@bitmovin/player-web-x 10.0.0-beta.12 → 10.0.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/bundles/playerx-bitmovin-v8-core.js +3 -3
  2. package/bundles/playerx-bitmovin-v8.js +3 -3
  3. package/bundles/playerx-core.js +3 -3
  4. package/bundles/playerx-dash.js +3 -3
  5. package/bundles/playerx-hls.js +3 -3
  6. package/bundles/playerx-playlist.js +3 -3
  7. package/bundles/playerx-tv.js +3 -3
  8. package/package.json +1 -1
  9. package/packages/playerx-adaptation.package.js +3 -3
  10. package/packages/playerx-bitmovin-source-api.package.js +2 -2
  11. package/packages/playerx-bitmovin-ui.package.js +2 -2
  12. package/packages/playerx-bitmovin-v8-core.package.js +2 -2
  13. package/packages/playerx-bitmovin-v8-static-api.package.js +2 -2
  14. package/packages/playerx-bitmovin-video-element-utils.package.js +2 -2
  15. package/packages/playerx-capabilities.package.js +2 -2
  16. package/packages/playerx-container-mp4.package.js +3 -3
  17. package/packages/playerx-container-ts.package.js +2 -2
  18. package/packages/playerx-core.package.js +3 -3
  19. package/packages/playerx-dash-parsing.package.js +2 -2
  20. package/packages/playerx-dash-translation.package.js +2 -2
  21. package/packages/playerx-dash.package.js +2 -2
  22. package/packages/playerx-data.package.js +3 -3
  23. package/packages/playerx-hls-parsing.package.js +2 -2
  24. package/packages/playerx-hls-translation.package.js +3 -3
  25. package/packages/playerx-hls.package.js +2 -2
  26. package/packages/playerx-network.package.js +2 -2
  27. package/packages/playerx-playback-state.package.js +2 -2
  28. package/packages/playerx-playlist.package.js +2 -2
  29. package/packages/playerx-presentation.package.js +2 -2
  30. package/packages/playerx-resize-tracker.package.js +2 -2
  31. package/packages/playerx-segment-processing.package.js +2 -2
  32. package/packages/playerx-source-api.package.js +2 -2
  33. package/packages/playerx-source.package.js +2 -2
  34. package/packages/playerx-sources-api.package.js +2 -2
  35. package/packages/playerx-trick-play.package.js +2 -2
  36. package/packages/playerx-ts-transmuxer.package.js +2 -2
  37. package/packages/playerx-tv.package.js +2 -2
  38. package/playerx-framework-utils.js +2 -2
  39. package/types/framework/core/core/Core.package.d.ts +2 -1
  40. package/types/framework/core/core/state/selection-group/SelectionGroupAtom.d.ts +4 -2
  41. package/types/framework/core/core/state/track/TrackTypeGuards.d.ts +2 -1
@@ -1,10 +1,10 @@
1
1
  /*******************************************************************************
2
2
  * This source code is the proprietary property of Bitmovin, Inc. Unauthorized
3
3
  * copying, distribution, or use of this code, or any portion thereof, is
4
- * strictly prohibited. © 2023 Bitmovin, Inc. All rights reserved. This
4
+ * strictly prohibited. © 2024 Bitmovin, Inc. All rights reserved. This
5
5
  * source code is subject to the terms and conditions of the accompanying
6
6
  * license agreement.
7
7
  *
8
- * Bitmovin Player X Version 10.0.0-beta.12
8
+ * Bitmovin Player X Version 10.0.0-beta.13
9
9
  *******************************************************************************/
10
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["container-mp4"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.playerx=t.bitmovin.playerx||{},t.bitmovin.playerx["container-mp4"]=e())}(self,(()=>(()=>{"use strict";var t={3898:(t,e)=>{function s(t,e,s){const i=e;return i._name=t,{onAdd:i,dependencies:s}}Object.defineProperty(e,"__esModule",{value:!0}),e.createPackage=void 0,e.createPackage=s},8465:(t,e)=>{function s(t,e){const s=e;return s._name=t,s}function i(t){return(...e)=>{const[i,r]=t(...e);return s(i,r)}}Object.defineProperty(e,"__esModule",{value:!0}),e.createTaskClosure=e.createTask=void 0,e.createTask=s,e.createTaskClosure=i},9062:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ComponentName=void 0,function(t){t.Logger="logger",t.Constants="constants",t.NetworkTask="network-task",t.FetchTask="fetch-task",t.SourceState="source-state",t.StreamTimeline="stream-timeline",t.Utils="utils",t.CoreEffects="core-effects",t.CoreStateAtoms="core-state-atoms",t.NetworkAtom="network-atom",t.SourceThread="source-thread",t.VideoElementUtils="video-element-utils",t.Metrics="metrics",t.AdaptationTask="adaptation-task",t.PlayerConfig="player-config"}(e.ComponentName||(e.ComponentName={}))},8904:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BoxTypes=void 0,e.BoxTypes=["ftyp","pdin","moov","moof","mvhd","trak","tkhd","edts","elst","mdia","mdhd","hdlr","minf","vmhd","smhd","dinf","dref","stbl","stsd","avc1","avcC","hvcC","mp4a","esds","stts","stsc","stsz","stco","ctts","stss","stsh","padb","stdp","cprt","free","skip","wide","pasp","clap","meco","mere","udta","meta","iloc","ipro","sinf","frma","schm","schi","hnti","hinf","vttC","tref","iref","urn ","url ","urn ","url ","styp","prft","pitm","fiin","feci","senc","sbgp","sgpd","subs","frma","saio","saiz","saio","saiz","seig","prft","fecr","urim","fiin","feci","fecr","gitn","wave","junk","void","pssh"]},3036:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerMp4Package=void 0;const i=s(3898),r=s(9062),n=s(7019),o=s(8926);e.ContainerMp4Package=(0,i.createPackage)("container-mp4-package",((t,e)=>{const{StateEffectFactory:s,EventListenerEffectFactory:i}=e.registry.get(r.ComponentName.CoreEffects),a=e.using(s).using(i);a.registry.get(n.SegmentProcessingExportNames.SegmentProcessingComponent).addProcessor((0,o.createFmp4Parser)(a))}),[r.ComponentName.CoreEffects,r.ComponentName.CoreStateAtoms,n.SegmentProcessingExportNames.SegmentProcessorType,n.SegmentProcessingExportNames.SegmentProcessorErrors,n.SegmentProcessingExportNames.SegmentProcessingComponent]),e.default=e.ContainerMp4Package},8926:function(t,e,s){var i=this&&this.__awaiter||function(t,e,s,i){function r(t){return t instanceof s?t:new s((function(e){e(t)}))}return new(s||(s=Promise))((function(s,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){t.done?s(t.value):r(t.value).then(o,a)}h((i=i.apply(t,e||[])).next())}))},r=this&&this.__asyncValues||function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,s=t[Symbol.asyncIterator];return s?s.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=t[s]&&function(e){return new Promise((function(i,n){r(i,n,(e=t[s](e)).done,e.value)}))}}function r(t,e,s,i){Promise.resolve(i).then((function(e){t({value:e,done:s})}),e)}};Object.defineProperty(e,"__esModule",{value:!0}),e.createFmp4Parser=void 0;const n=s(8465),o=s(9062),a=s(7019),h=s(6107),_=(0,n.createTask)("fmp4-parser-processor",((t,e)=>i(void 0,void 0,void 0,(function*(){var s,i,n,o;const a=new h.FragmentParser(e,t);try{for(var _,c=!0,d=r(t.input);!(s=(_=yield d.next()).done);){o=_.value,c=!1;try{const t=o;yield a.addChunk(t)}finally{c=!0}}}catch(t){i={error:t}}finally{try{c||s||!(n=d.return)||(yield n.call(d))}finally{if(i)throw i.error}}yield a.flush()}))));function c(t){const{ContainerFormat:e}=t.registry.get(o.ComponentName.CoreStateAtoms).Segments;return{name:"fmp4-parser",type:t.registry.get(a.SegmentProcessingExportNames.SegmentProcessorType).Parser,container:e.MP4,process:_}}e.createFmp4Parser=c},6107:function(t,e,s){var i=this&&this.__awaiter||function(t,e,s,i){function r(t){return t instanceof s?t:new s((function(e){e(t)}))}return new(s||(s=Promise))((function(s,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){t.done?s(t.value):r(t.value).then(o,a)}h((i=i.apply(t,e||[])).next())}))},r=this&&this.__asyncValues||function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,s=t[Symbol.asyncIterator];return s?s.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=t[s]&&function(e){return new Promise((function(i,n){r(i,n,(e=t[s](e)).done,e.value)}))}}function r(t,e,s,i){Promise.resolve(i).then((function(e){t({value:e,done:s})}),e)}};Object.defineProperty(e,"__esModule",{value:!0}),e.FragmentParser=e.FragmentParserError=void 0;const n=s(9062),o=s(7048),a=s(7019),h=s(8904),_=s(671);class c extends o.FrameworkError{constructor(t){super(t),this.name="FragmentParserError"}}e.FragmentParserError=c;class d{constructor(t,e){this.context=t,this.data=e,this.parsedBoxes=[],this.chunks=[],this.totalSegmentDuration=0,this.playbackTimeExposed=!1,this.trackIdMap=new Map,this.dataAtomPublished=!1,this.containerFormatValidated=!1,this.fragmentStartChunkIndex=0,this.fragmentStartByteOffset=0,this.cursorChunkIndex=0,this.cursorByteOffset=0,this.dataAtoms=[]}getBoxesOfType(t){return this.parsedBoxes.filter((e=>e.type===t))}hasCompleteFragment(){const t=this.getBoxesOfType("moof"),e=this.getBoxesOfType("mdat");return t.length>=1&&e.length>=1}getRemainingBytes(t,e){let s=-t;for(let t=e;t<this.chunks.length;t++)s+=this.chunks[t].byteLength;return Math.max(0,s)}readNextBoxHeaderBytes(){const t=[];let e=this.cursorChunkIndex,s=this.cursorByteOffset;for(let i=0;i<8;i++){const i=this.chunks[e];t.push(i[s]),s++,s>=i.byteLength&&(s=0,e++)}return t}tryCreateNextFragment(){if(!this.hasCompleteFragment())return;const t=["moof","mdat"],e=[],s=()=>t.every((t=>e.some((e=>e.type===t))));do{const t=this.parsedBoxes.shift();if(!t)throw new c("Unexpectedly encountered empty box");e.push(t)}while(!s());const i=e.reduce(((t,e)=>t+e.size),0),r=new Uint8Array(i);return this.fillFragment(r),{data:r}}fillFragment(t){const e=t.byteLength;let s=0;for(;s<e;){const i=this.chunks[this.fragmentStartChunkIndex],r=i.byteLength-this.fragmentStartByteOffset,n=e-s;r>n?(t.set(i.subarray(this.fragmentStartByteOffset,this.fragmentStartByteOffset+n),s),s+=n,this.fragmentStartByteOffset+=n):(t.set(i.subarray(this.fragmentStartByteOffset),s),s+=r,this.fragmentStartByteOffset=0,this.cursorChunkIndex--,this.chunks.shift())}}advanceCursor(t){for(;t>0;){const e=this.chunks[this.cursorChunkIndex].byteLength-this.cursorByteOffset;e>t?(this.cursorByteOffset+=t,t=0):(this.cursorChunkIndex++,this.cursorByteOffset=0,t-=e)}}maybeValidateContainerFormat(t){if(!this.containerFormatValidated&&!h.BoxTypes.includes(t)){const{UnsupportedContainerFormatError:t}=this.context.registry.get(a.SegmentProcessingExportNames.SegmentProcessorErrors);throw new t("fmp4-parser")}this.containerFormatValidated=!0}tryParseNextBox(){const t=this.getRemainingBytes(this.cursorByteOffset,this.cursorChunkIndex);if(t<8)return;const e=this.readNextBoxHeaderBytes(),s=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],i=String.fromCharCode(e[4],e[5],e[6],e[7]),r=s<=t;return this.maybeValidateContainerFormat(i),r&&this.advanceCursor(s),r?{size:s,type:i}:void 0}getMoovBox(t){var e,s,o,a,h,c,d,f;return i(this,void 0,void 0,(function*(){const{segment:i}=this.data,{isDataSegment:u}=this.context.registry.get(n.ComponentName.CoreStateAtoms).Segments,p=t.get("moov");if(p)return p;if(u(i))try{for(var l,m=!0,g=r(i.initSegment.data);l=yield g.next(),!(e=l.done);){a=l.value,m=!1;try{const t=a;try{for(var y,x=!0,U=(c=void 0,r(t.fragments));y=yield U.next(),!(h=y.done);){f=y.value,x=!1;try{const t=f,e=_.ISOBoxer.parseBuffer(t.data.buffer).get("moov");if(e)return e}finally{x=!0}}}catch(t){c={error:t}}finally{try{x||h||!(d=U.return)||(yield d.call(U))}finally{if(c)throw c.error}}}finally{m=!0}}}catch(t){s={error:t}}finally{try{m||e||!(o=g.return)||(yield o.call(g))}finally{if(s)throw s.error}}}))}parseTimescale(t){var e,s;return null!==(s=null===(e=t.get("trak.mdia.mdhd"))||void 0===e?void 0:e.timescale)&&void 0!==s?s:1}extractPlaybackTime(t,e){const s=this.parseTimescale(e);return b(t,s)+v(t,s)}extractDuration(t,e){const s=this.parseTimescale(e);if(void 0===s)return-1;return t.list("moof.traf").reduce(((t,s)=>t+S(s,w(e))),0)/s}getOrCreateDataAtom(t){const{state:e}=this.context.effects,{Segments:s,DataStream:i}=this.context.registry.get(n.ComponentName.CoreStateAtoms),{createSegmentDataAtom:r,ContainerFormat:o}=s,{createDataStreamAtom:a}=i,h=this.dataAtoms.find((e=>e.mediaTypes.length===t.length&&e.mediaTypes.every((e=>t.includes(e)))));if(h)return h;const _=r(this.context,{mediaTypes:t,containerFormat:o.MP4,fragments:a(this.context)});return this.dataAtoms.push(_),e.dispatch(this.data.output.push,_),_}parseFragment(t){return i(this,void 0,void 0,(function*(){const{segment:e,playbackTimeExtracted:s,codecsExtracted:i}=this.data,{state:r}=this.context.effects,{isDataOrSelfInitSegment:o}=this.context.registry.get(n.ComponentName.CoreStateAtoms).Segments,a=_.ISOBoxer.parseBuffer(t.data.buffer),h=yield this.getMoovBox(a),{codecMap:c,trackMap:d}=U(this.context,h);if(o(e)&&void 0!==h){const t=this.extractPlaybackTime(a,h),e=this.extractDuration(a,h);e>-1&&(this.totalSegmentDuration+=e),!this.playbackTimeExposed&&t>-1&&(r.dispatch(s.trigger,t),this.playbackTimeExposed=!0)}r.dispatch(i.trigger,c);const f=this.getMediaTypesForFragment(a,d),u=this.getOrCreateDataAtom(f);r.dispatch(u.fragments.push,t)}))}getMediaTypesForFragment(t,e){const s=[],i=[...t.list("moov.trak.tkhd"),...t.list("moof.traf.tfhd")];for(const{track_ID:t}of i){const i=e[t];void 0===i||s.includes(i)||s.push(i)}return s}consumeRemainingBytes(){return i(this,void 0,void 0,(function*(){const t=this.getRemainingBytes(this.fragmentStartByteOffset,this.fragmentStartChunkIndex);if(t<=0)return;const e=new Uint8Array(t);this.fillFragment(e),yield this.parseFragment({data:e})}))}addChunk(t){return i(this,void 0,void 0,(function*(){let e,s;for(this.chunks.push(t);void 0!==(e=this.tryParseNextBox());)this.parsedBoxes.push(e);for(;void 0!==(s=this.tryCreateNextFragment());)yield this.parseFragment(s)}))}flush(){return i(this,void 0,void 0,(function*(){const{state:t}=this.context.effects;yield this.consumeRemainingBytes(),this.totalSegmentDuration>0&&t.dispatch(this.data.durationExtracted.trigger,this.totalSegmentDuration);for(const e of this.dataAtoms)t.dispatch(e.fragments.close);t.dispatch(this.data.output.close)}))}}e.FragmentParser=d;const f={Avc:["avc1","avc2","avc3"],Hvc:["hvc1","hev1"],Av1:["av01"]};function u(t){return t.get("mdia.minf.stbl.stsd")}function p(t){const e=t.get("avcC");if(!e||0===e.sps.length)return null;return t.type+"."+l(new Uint8Array(e.sps[0].splice(1,3)))}function l(t){let e="";for(let s=0;s<t.byteLength;s++){const i=(255&t[s]).toString(16);i.length<2&&(e+="0"),e+=i}return e}function m(t,e){const s=u(e);if(!s)return;const i=s.entries[0],r=(i.get("esds")||{}).decoderConfig;if(!r)return;const o=i.type,a=r.objectProfileIndication.toString(16),h=r.decoderConfigDescriptor.audioObjectType;if(0===parseInt(a)&&0===parseInt(h)&&"mp4a"===o){return t.registry.get(n.ComponentName.Logger).warn('Failed to extract MP4 codec string from segment - carrying on assuming it is "mp4a.40.2"'),"mp4a.40.2"}return o+"."+a+"."+h}function g(t,e){if(!e)return;const s=[...e.general_constraint_indicator_flags_bytes];for(;0===s[s.length-1];)s.pop();const i=s.map((t=>t.toString(16).toUpperCase()));return[t,`${["","A","B","C"][e.general_profile_space]}${e.general_profile_idc}`,`${e.general_profile_compatibility_flags}`,`${0===e.general_tier_flag?"L":"H"}${e.general_level_idc}`,...i].join(".")}function y(t,e){const s=u(e);if(!s)return;const i=s.entries.find((t=>[...f.Avc,...f.Hvc,...f.Av1].includes(t.type)));if(i){if(f.Avc.includes(i.type))return p(i);if(f.Hvc.includes(i.type))return g(i.type,i.get("hvcC"));if(f.Av1.includes(i.type)){return t.registry.get(n.ComponentName.Logger).warn('Skipping AV1 codec extraction - using "av01.0.09M.08.0.111.01.01.01.0" instead'),"av01.0.09M.08.0.111.01.01.01.0"}}}function x(t){return t.list("trak")}function U(t,e){const{MediaType:s}=t.registry.get(n.ComponentName.Constants),i={[s.Unknown]:[]},r={};if(void 0===e)return{codecMap:i,trackMap:r};const o=x(e);for(const e of o){const n=e.get("tkhd").track_ID,o=y(t,e),a=m(t,e);o&&(r[n]=s.Video,delete i[s.Unknown],i[s.Video]=[o]),a&&(r[n]=s.Audio,delete i[s.Unknown],i[s.Audio]=[a])}return{codecMap:i,trackMap:r}}function v(t,e){var s,i;const r=null===(s=t.fetch("trun").samples)||void 0===s?void 0:s[0];return(null!==(i=null==r?void 0:r.sample_composition_time_offset)&&void 0!==i?i:0)/e}function b(t,e){const s=t.fetch("tfdt");return s&&void 0!==e?s.baseMediaDecodeTime/e:-1}function S(t,e){var s;const i=t.get("trun");if(!i)return 0;const r=t.get("tfhd"),n=r?r.default_sample_duration:void 0,o=null===(s=i.samples)||void 0===s?void 0:s.reduce(((t,s)=>t+(s.sample_duration||n||e||0)),0);return null!=o?o:0}function w(t){var e;const s=t.get("mvex.trex");return null!==(e=null==s?void 0:s.default_sample_duration)&&void 0!==e?e:0}},671:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ISOBox=e.ISOFile=e.ISOBoxer=void 0;const s=["moov","trak","tref","mdia","minf","stbl","edts","dinf","sinf","mvex","moof","traf","mfra","udta","meco","strk","vttc","schi"];e.ISOBoxer={parseBuffer:function(t,s={}){return new e.ISOFile(t,s).parse()}};const i=8;function r(t=0){return{offset:t}}var n=function(t,e={}){this.options=Object.assign({},e),this.options.iv_size=e.iv_size||i,t&&(this._raw=new DataView(t)),this._cursor=r(),this.boxes=[]};function o(t){return 0===t.length?null:t[0]}function a(t,e){const s=e.indexOf(".");let i=[];if(-1===s)for(let s=0;s<t.length;s++)t[s].type===e&&i.push(t[s]);else{const r=e.substr(0,s),n=e.substr(s+1);for(let e=0;e<t.length;e++)t[e].type===r&&(i=i.concat(t[e].list(n)))}return i}e.ISOFile=n,e.ISOFile.prototype.fetch=function(t){const e=this.fetchAll(t,!0);return e.length?e[0]:null},e.ISOFile.prototype.fetchAll=function(t,s){const i=[];return e.ISOFile._sweep.call(this,t,i,s),i},e.ISOFile.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){const t=e.ISOBox.parse(this);if(void 0===t.type)break;this.boxes.push(t)}return this},e.ISOFile._sweep=function(t,s,i){this.type&&this.type===t&&s.push(this);for(const r in this.boxes){if(s.length&&i)return;e.ISOFile._sweep.call(this.boxes[r],t,s,i)}},e.ISOFile.prototype.get=function(t){return o(this.list(t))},e.ISOFile.prototype.list=function(t){return a(this.boxes,t)};const h=function(){this._cursor=r()};function _(t,s){t.forEach((function(t){e.ISOBox.prototype._boxParsers[t]=s}))}e.ISOBox=h,e.ISOBox.parse=function(t){const s=new e.ISOBox;return s._offset=t._cursor.offset,s._root=t._root?t._root:t,s._raw=t._raw,s._parent=t,s._parseBox(),t._cursor.offset=s._raw.byteOffset+s._raw.byteLength,s},e.ISOBox.prototype.list=function(t){return a(this.boxes||this.entries||[],t)},e.ISOBox.prototype.get=function(t){return o(this.list(t))},e.ISOBox.prototype._readUint64=function(){const t=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset),e=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset+4);return t*Math.pow(2,32)+e},e.ISOBox.prototype._readInt64=function(){const t=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset),e=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset+4);return t*Math.pow(2,32)+e},e.ISOBox.prototype._readInt=function(t){let e=null;switch(t){case 8:e=this._raw.getInt8(this._cursor.offset-this._raw.byteOffset);break;case 16:e=this._raw.getInt16(this._cursor.offset-this._raw.byteOffset);break;case 32:e=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset);break;case 64:e=this._readInt64()}return this._cursor.offset+=t>>3,e},e.ISOBox.prototype._readUint=function(t){let e=null;switch(t){case 8:e=this._raw.getUint8(this._cursor.offset-this._raw.byteOffset);break;case 16:e=this._raw.getUint16(this._cursor.offset-this._raw.byteOffset);break;case 24:e=(this._raw.getUint16(this._cursor.offset-this._raw.byteOffset)<<8)+this._raw.getUint8(this._cursor.offset-this._raw.byteOffset+2);break;case 32:e=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset);break;case 64:e=this._readUint64()}return this._cursor.offset+=t>>3,e},e.ISOBox.prototype._readUintArray=function(t,e){const s=new Array(e);for(let i=0;i<e;++i)s[i]=this._readUint(t);return s},e.ISOBox.prototype._readFP=function(t){return this._readInt(2*t)/Math.pow(2,t)},e.ISOBox.prototype._readString=function(t){let e="";for(let s=0;s<t;s++){const t=this._readUint(8);e+=String.fromCharCode(t)}return e},e.ISOBox.prototype._readHex=function(t){for(var e=[],s=0;s<t;s++){const t=this._readUint(8);e.push((t>>>4).toString(16)),e.push((15&t).toString(16))}return e.join("")},e.ISOBox.prototype._readUUID=function(){return this._readUintArray(8,16)},e.ISOBox.prototype._readTerminatedString=function(){let t="";for(;;){const e=this._readUint(8);if(0==e)break;t+=String.fromCharCode(e)}return t},e.ISOBox.prototype._readTemplate=function(t){return this._readUint(t/2)+this._readUint(t/2)/Math.pow(2,t/2)},e.ISOBox.prototype._parseBox=function(){if(this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this.size=this._readUint(32),this.type=this._readString(4),1===this.size&&(this.largesize=this._readUint(64)),"uuid"===this.type&&(this.usertype=this._readUUID()),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}!this._incomplete&&this._boxParsers[this.type]&&this._boxParsers[this.type].call(this)}},e.ISOBox.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},e.ISOBox.prototype._createDataView=function(){return new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset))},e.ISOBox.prototype._boxParsers={},_(s,(function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(e.ISOBox.parse(this))})),e.ISOBox.prototype._boxParsers.elst=function(){this._parseFullBox(),this.entry_count=this._readUint(32),this.entries=[];for(let t=1;t<=this.entry_count;t++){const t=new e.ISOBox;1===this.version?(t.segment_duration=this._readUint(64),t.media_time=this._readInt(64)):(t.segment_duration=this._readUint(32),t.media_time=this._readInt(32)),t.media_rate_integer=this._readInt(16),t.media_rate_fraction=this._readInt(16),this.entries.push(t)}},e.ISOBox.prototype._boxParsers.emsg=function(){this._parseFullBox(),0===this.version?(this.scheme_id_uri=this._readTerminatedString(),this.value=this._readTerminatedString(),this.timescale=this._readUint(32),this.presentation_time_delta=this._readUint(32),this.event_duration=this._readUint(32),this.id=this._readUint(32)):(this.timescale=this._readUint(32),this.presentation_time=this._readUint(64),this.event_duration=this._readUint(32),this.id=this._readUint(32),this.scheme_id_uri=this._readTerminatedString(),this.value=this._readTerminatedString()),this.message_data=this._createDataView()},_(["free","mdat"],(function(){this.data=this._createDataView()})),_(["ftyp","styp"],(function(){for(this.major_brand=this._readString(4),this.minor_versions=this._readUint(32),this.compatible_brands=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.compatible_brands.push(this._readString(4))})),e.ISOBox.prototype._boxParsers.hdlr=function(){this._parseFullBox(),this.pre_defined=this._readUint(32),this.handler_type=this._readString(4),this.reserved=[this._readUint(32),this._readUint(32),this._readUint(32)],this.name=this._readTerminatedString()},e.ISOBox.prototype._boxParsers.mdhd=function(){this._parseFullBox(),1==this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.timescale=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.timescale=this._readUint(32),this.duration=this._readUint(32));const t=this._readUint(16);this.pad=t>>15,this.language=String.fromCharCode(96+(t>>10&31),96+(t>>5&31),96+(31&t)),this.pre_defined=this._readUint(16)},e.ISOBox.prototype._boxParsers.mfhd=function(){this._parseFullBox(),this.sequence_number=this._readUint(32)},e.ISOBox.prototype._boxParsers.mvhd=function(){this._parseFullBox(),1===this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.timescale=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.timescale=this._readUint(32),this.duration=this._readUint(32)),this.rate=this._readTemplate(32),this.volume=this._readTemplate(16),this.reserved1=this._readUint(16),this.reserved2=[this._readUint(32),this._readUint(32)],this.matrix=[];for(var t=0;t<9;t++)this.matrix.push(this._readTemplate(32));for(this.pre_defined=[],t=0;t<6;t++)this.pre_defined.push(this._readUint(32));this.next_track_ID=this._readUint(32)},e.ISOBox.prototype._boxParsers.sidx=function(){this._parseFullBox(),this.reference_ID=this._readUint(32),this.timescale=this._readUint(32),0===this.version?(this.earliest_presentation_time=this._readUint(32),this.first_offset=this._readUint(32)):(this.earliest_presentation_time=this._readUint(64),this.first_offset=this._readUint(64)),this.reserved=this._readUint(16),this.reference_count=this._readUint(16),this.references=[];for(let t=0;t<this.reference_count;t++){const t={},e=this._readUint(32);t.reference_type=e>>31&1,t.referenced_size=2147483647&e,t.subsegment_duration=this._readUint(32);const s=this._readUint(32);t.starts_with_SAP=s>>31&1,t.SAP_type=s>>28&7,t.SAP_delta_time=268435455&s,this.references.push(t)}},e.ISOBox.prototype._boxParsers.ssix=function(){this._parseFullBox(),this.subsegment_count=this._readUint(32),this.subsegments=[];for(let t=0;t<this.subsegment_count;t++){const t={};t.ranges_count=this._readUint(32),t.ranges=[];for(let e=0;e<t.ranges_count;e++){const e={};e.level=this._readUint(8),e.range_size=this._readUint(24),t.ranges.push(e)}this.subsegments.push(t)}},e.ISOBox.prototype._boxParsers.tfdt=function(){this._parseFullBox(),1===this.version?this.baseMediaDecodeTime=this._readUint(64):this.baseMediaDecodeTime=this._readUint(32)},e.ISOBox.prototype._boxParsers.tfhd=function(){this._parseFullBox(),this.track_ID=this._readUint(32),1&this.flags?(this.base_data_offset_present=!0,this.base_data_offset=this._readUint(64)):131072&this.flags&&(this.default_base_is_moof=!0),2&this.flags&&(this.sample_description_offset=this._readUint(32)),8&this.flags&&(this.default_sample_duration=this._readUint(32)),16&this.flags&&(this.default_sample_size=this._readUint(32)),32&this.flags&&(this.default_sample_flags=this._readUint(32))},e.ISOBox.prototype._boxParsers.tkhd=function(){this._parseFullBox(),1===this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.track_ID=this._readUint(32),this.reserved1=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.track_ID=this._readUint(32),this.reserved1=this._readUint(32),this.duration=this._readUint(32)),this.reserved2=[this._readUint(32),this._readUint(32)],this.layer=this._readUint(16),this.alternate_group=this._readUint(16),this.volume=this._readTemplate(16),this.reserved3=this._readUint(16),this.matrix=[];for(let t=0;t<9;t++)this.matrix.push(this._readTemplate(32));this.width=this._readTemplate(32),this.height=this._readTemplate(32)},e.ISOBox.prototype._boxParsers.trun=function(){this._parseFullBox(),this.sample_count=this._readUint(32),1&this.flags&&(this.data_offset_present=!0,this.data_offset=this._readInt(32)),4&this.flags&&(this.first_sample_flags=this._readUint(32)),this.samples=[];for(let t=0;t<this.sample_count;t++){const t={};256&this.flags&&(t.sample_duration=this._readUint(32)),512&this.flags&&(t.sample_size=this._readUint(32)),1024&this.flags&&(t.sample_flags=this._readUint(32)),2048&this.flags&&(0==this.version?t.sample_composition_time_offset=this._readUint(32):t.sample_composition_time_offset=this._readInt(32)),this.samples.push(t)}},e.ISOBox.prototype._boxParsers.trex=function(){this._parseFullBox(),this.track_ID=this._readUint(32),this.default_sample_description_index=this._readUint(32),this.default_sample_duration=this._readUint(32),this.default_sample_size=this._readUint(32),this.default_sample_flags=this._readUint(32)},e.ISOBox.prototype._boxParsers.stsd=function(){for(this._parseFullBox(),this.entry_count=this._readUint(32),this.entries=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.entries.push(e.ISOBox.parse(this))},e.ISOBox.prototype._boxParsers.encv=function(){for(this._readHex(6),this.data_reference_index=this._readUint(16),this._readUint(16),this._readUint(16),this._readUint(32),this._readUint(32),this._readUint(32),this.width=this._readUint(16),this.height=this._readUint(16),this.horizresolution=this._readTemplate(32),this.vertresolution=this._readTemplate(32),this._readUint(32),this.frame_count=this._readUint(16),this._readUint(8),this.compressor_name=this._readString(4),this.depth=this._readUint(16),this._readUint(16),this._readHex(27),this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(e.ISOBox.parse(this))},_(["enca","mp4a"],(function(){for(this._readHex(6),this.data_reference_index=this._readUint(16),this._readUint(32),this._readUint(32),this.channel_count=this._readUint(16),this.sample_size=this._readUint(16),this._readUint(16),this._readUint(16),this.sample_rate=this._readUint(32)>>>16,this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(e.ISOBox.parse(this))}));function c(t,e){return t._cursor.offset-t._raw.byteOffset+e<=t.size}function d(t){if(!c(t,6))return{bytes_of_clear_data:0,bytes_of_encrypted_data:0};return{bytes_of_clear_data:t._readUint(16),bytes_of_encrypted_data:t._readUint(32)}}function f(t,e){return c(t,2)?(e.subsample_count=t._readUint(16),e.subsamples=Array.apply(null,Array(e.subsample_count)).map((e=>d(t))),e):Object.assign(Object.assign({},e),{subsample_count:0,subsamples:[]})}function u(t){if(!c(t,t._root.options.iv_size))return void(t.samples=[]);let e={iv:t._readHex(t._root.options.iv_size)};return t.flags&&(e=f(t,e)),e}_(["avc1","hvc1","hev1"],(function(){this._readUint(32),this._readUint(16),this.data_reference_index=this._readUint(16),this.version=this._readUint(16),this.revision_level=this._readUint(16),this.vendor=this._readUint(32),this.temporal_quality=this._readUint(32),this.spatial_quality=this._readUint(32),this.width=this._readUint(16),this.height=this._readUint(16),this.horizontal_resolution=this._readTemplate(32),this.vertical_resolution=this._readTemplate(32),this.data_size=this._readUint(32),this.frame_count=this._readUint(16);const t=this._readUint(8);this.compressor_name="";for(let e=0;e<31;e++){const s=this._readUint(8);e<t&&(this.compressor_name+=String.fromCharCode(s))}for(this.depth=this._readUint(16),this._readInt(16),this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(e.ISOBox.parse(this))})),e.ISOBox.prototype._boxParsers.avcC=function(){this.configuration_version=this._readUint(8),this.avc_profile_indication=this._readUint(8),this.profile_compatibility=this._readUint(8),this.avc_level_indication=this._readUint(8);const t=this._readUint(8);this.complete_representation=t>>>7&1,this.length_size_minus_one=3&t,this.num_sps=31&this._readUint(8),this.sps=[];for(let t=0;t<this.num_sps;++t)this.sps.push(this._readUintArray(8,this._readUint(16)));this.num_pps=31&this._readUint(8),this.pps=[];for(let t=0;t<this.num_pps;++t)this.pps.push(this._readUintArray(8,this._readUint(16)))},e.ISOBox.prototype._boxParsers.hvcC=function(){let t;this.configurationVersion=this._readUint(8),t=this._readUint(8),this.general_profile_space=t>>>6,this.general_tier_flag=t>>>5&1,this.general_profile_idc=31&t,this.general_profile_compatibility_flags=this._readUint(32),this.general_constraint_indicator_flags_bytes=[];for(let t=0;t<6;t++)this.general_constraint_indicator_flags_bytes[t]=this._readUint(8);this.general_level_idc=this._readUint(8),this.min_spatial_segmentation_idc=4095&this._readUint(16),this.parallelismType=3&this._readUint(8),this.chroma_format_idc=3&this._readUint(8),this.bit_depth_luma_minus8=7&this._readUint(8),this.bit_depth_chroma_minus8=7&this._readUint(8),this.avgFrameRate=this._readUint(16),t=this._readUint(8),this.constantFrameRate=t>>>6,this.numTemporalLayers=t>>>3&7,this.temporalIdNested=t>>>2&1,this.lengthSizeMinusOne=3&t,this.numOfArrays=this._readUint(8)},e.ISOBox.prototype._boxParsers.esds=function(){this._parseFullBox(),this._readUint(16),this.esId=this._readUint(16),this.streamPriority=31&this._readUint(8),this._readUint(16),this.decoderConfig={},this.decoderConfig.objectProfileIndication=this._readUint(8),this.decoderConfig.streamType=this._readUint(8)>>>2&63,this.decoderConfig.bufferSize=this._readUint(24),this.decoderConfig.maxBitrate=this._readUint(32),this.decoderConfig.avgBitrate=this._readUint(32),this.decoderConfig.decoderConfigDescriptor={},this.decoderConfig.decoderConfigDescriptor.tag=this._readUint(8),this.decoderConfig.decoderConfigDescriptor.length=this._readUint(8);const t=this._readUint(8),e=this._readUint(8),s=this.decoderConfig.decoderConfigDescriptor;s.audioObjectType=t>>>3&31,s.samplingFrequencyIndex=(7&t)<<1|e>>>7&1,s.channelConfiguration=e>>>3&15},e.ISOBox.prototype._boxParsers.tenc=function(){this._parseFullBox(),this.default_is_encrypted=1===this._readUint(24),this.default_iv_size=this._readUint(8),this.default_kid=this._readHex(16)},e.ISOBox.prototype._boxParsers.senc=function(){this._parseFullBox(),this.sample_count=this._readUint(32),this.samples=Array.apply(null,Array(this.sample_count)).map((t=>u(this)))},e.ISOBox.prototype._boxParsers.frma=function(){this.codingname=this._readString(4)},e.ISOBox.prototype._boxParsers.schm=function(){this._parseFullBox(),this.scheme_type=this._readString(4),this.scheme_version=this._readUint(32),1&this.flags&&(this.scheme_uri=this._readUint(8))},e.ISOBox.prototype._boxParsers.saiz=function(){if(this._parseFullBox(),1&this.flags&&(this.aux_info_type=this._readUint(32),this.aux_info_type_parameter=this._readUint(32)),this.default_sample_info_size=this._readUint(8),this.sample_count=this._readUint(32),0===this.default_sample_info_size){this.sample_info_size=[];for(let t=0;t<this.sample_count;++t)this.sample_info_size.push(this._readUint(8))}},e.ISOBox.prototype._boxParsers.pssh=function(){if(this._parseFullBox(),this.system_id=this._readUUID(),this.version>0){this.kid_count=this._readUint(32),this.kids=[];for(let t=0;t<this.kid_count;++t)this.kids.push(this._readString(16))}this.data_size=this._readUint(32),this.data=new DataView(this._raw.buffer,this._cursor.offset,this.data_size)},e.ISOBox.prototype._boxParsers.prft=function(){this._parseFullBox(),this.reference_track_ID=this._readUint(32),this.ntp_timestamp_seconds=this._readUint(32),this.ntp_timestamp_seconds_fraction=this._readUint(32),0===this.version?this.media_time=this._readUint(32):this.media_time=this._readUint(64)}},7048:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FrameworkError=void 0;class s extends Error{constructor(t){super(t),this.name="FrameworkError"}}e.FrameworkError=s},7019:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SegmentProcessorType=e.SegmentProcessingExportNames=void 0,function(t){t.SegmentProcessingComponent="segment-processing-component",t.SegmentProcessorType="segment-processor-type",t.SegmentProcessorErrors="segment-processor-errors"}(e.SegmentProcessingExportNames||(e.SegmentProcessingExportNames={})),function(t){t.Decryptor="decryptor",t.Parser="parser",t.Preprocessor="preprocessor",t.Transmuxer="transmuxer",t.Postprocessor="postprocessor"}(e.SegmentProcessorType||(e.SegmentProcessorType={}))}},e={};function s(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={exports:{}};return t[i].call(n.exports,n,n.exports,s),n.exports}return s(3036)})()));
10
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["container-mp4"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.playerx=t.bitmovin.playerx||{},t.bitmovin.playerx["container-mp4"]=e())}(self,(()=>(()=>{"use strict";var t={3898:(t,e)=>{function s(t,e,s){const i=e;return i._name=t,{onAdd:i,dependencies:s}}Object.defineProperty(e,"__esModule",{value:!0}),e.createPackage=void 0,e.createPackage=s},8465:(t,e)=>{function s(t,e){const s=e;return s._name=t,s}function i(t){return(...e)=>{const[i,r]=t(...e);return s(i,r)}}Object.defineProperty(e,"__esModule",{value:!0}),e.createTaskClosure=e.createTask=void 0,e.createTask=s,e.createTaskClosure=i},9062:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ComponentName=void 0,function(t){t.Logger="logger",t.Constants="constants",t.NetworkTask="network-task",t.FetchTask="fetch-task",t.SourceState="source-state",t.StreamTimeline="stream-timeline",t.Utils="utils",t.CoreEffects="core-effects",t.CoreStateAtoms="core-state-atoms",t.NetworkAtom="network-atom",t.SourceThread="source-thread",t.VideoElementUtils="video-element-utils",t.Metrics="metrics",t.AdaptationTask="adaptation-task",t.PlayerConfig="player-config"}(e.ComponentName||(e.ComponentName={}))},8904:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BoxTypes=void 0,e.BoxTypes=["ftyp","pdin","moov","moof","mvhd","trak","tkhd","edts","elst","mdia","mdhd","hdlr","minf","vmhd","smhd","dinf","dref","stbl","stsd","avc1","avcC","hvcC","mp4a","esds","stts","stsc","stsz","stco","ctts","stss","stsh","padb","stdp","cprt","free","skip","wide","pasp","clap","meco","mere","udta","meta","iloc","ipro","sinf","frma","schm","schi","hnti","hinf","vttC","tref","iref","urn ","url ","urn ","url ","styp","prft","pitm","fiin","feci","senc","sbgp","sgpd","subs","frma","saio","saiz","saio","saiz","seig","prft","fecr","urim","fiin","feci","fecr","gitn","wave","junk","void","pssh"]},3036:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerMp4Package=void 0;const i=s(3898),r=s(9062),n=s(7019),o=s(8926);e.ContainerMp4Package=(0,i.createPackage)("container-mp4-package",((t,e)=>{const{StateEffectFactory:s,EventListenerEffectFactory:i}=e.registry.get(r.ComponentName.CoreEffects),a=e.using(s).using(i);a.registry.get(n.SegmentProcessingExportNames.SegmentProcessingComponent).addProcessor((0,o.createFmp4Parser)(a))}),[r.ComponentName.CoreEffects,r.ComponentName.CoreStateAtoms,n.SegmentProcessingExportNames.SegmentProcessorType,n.SegmentProcessingExportNames.SegmentProcessorErrors,n.SegmentProcessingExportNames.SegmentProcessingComponent]),e.default=e.ContainerMp4Package},8926:function(t,e,s){var i=this&&this.__awaiter||function(t,e,s,i){function r(t){return t instanceof s?t:new s((function(e){e(t)}))}return new(s||(s=Promise))((function(s,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){t.done?s(t.value):r(t.value).then(o,a)}h((i=i.apply(t,e||[])).next())}))},r=this&&this.__asyncValues||function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,s=t[Symbol.asyncIterator];return s?s.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=t[s]&&function(e){return new Promise((function(i,n){r(i,n,(e=t[s](e)).done,e.value)}))}}function r(t,e,s,i){Promise.resolve(i).then((function(e){t({value:e,done:s})}),e)}};Object.defineProperty(e,"__esModule",{value:!0}),e.createFmp4Parser=void 0;const n=s(8465),o=s(9062),a=s(7019),h=s(6107),_=(0,n.createTask)("fmp4-parser-processor",((t,e)=>i(void 0,void 0,void 0,(function*(){var s,i,n,o;const a=new h.FragmentParser(e,t);try{for(var _,c=!0,d=r(t.input);!(s=(_=yield d.next()).done);){o=_.value,c=!1;try{const t=o;yield a.addChunk(t)}finally{c=!0}}}catch(t){i={error:t}}finally{try{c||s||!(n=d.return)||(yield n.call(d))}finally{if(i)throw i.error}}yield a.flush()}))));function c(t){const{ContainerFormat:e}=t.registry.get(o.ComponentName.CoreStateAtoms).Segments;return{name:"fmp4-parser",type:t.registry.get(a.SegmentProcessingExportNames.SegmentProcessorType).Parser,container:e.MP4,process:_}}e.createFmp4Parser=c},6107:function(t,e,s){var i=this&&this.__awaiter||function(t,e,s,i){function r(t){return t instanceof s?t:new s((function(e){e(t)}))}return new(s||(s=Promise))((function(s,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){t.done?s(t.value):r(t.value).then(o,a)}h((i=i.apply(t,e||[])).next())}))},r=this&&this.__asyncValues||function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,s=t[Symbol.asyncIterator];return s?s.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=t[s]&&function(e){return new Promise((function(i,n){r(i,n,(e=t[s](e)).done,e.value)}))}}function r(t,e,s,i){Promise.resolve(i).then((function(e){t({value:e,done:s})}),e)}};Object.defineProperty(e,"__esModule",{value:!0}),e.FragmentParser=e.FragmentParserError=void 0;const n=s(9062),o=s(7048),a=s(7019),h=s(8904),_=s(671);class c extends o.FrameworkError{constructor(t){super(t),this.name="FragmentParserError"}}e.FragmentParserError=c;class d{constructor(t,e){this.context=t,this.data=e,this.parsedBoxes=[],this.chunks=[],this.totalSegmentDuration=0,this.playbackTimeExposed=!1,this.trackIdMap=new Map,this.dataAtomPublished=!1,this.containerFormatValidated=!1,this.fragmentStartChunkIndex=0,this.fragmentStartByteOffset=0,this.cursorChunkIndex=0,this.cursorByteOffset=0,this.dataAtoms=[]}getBoxesOfType(t){return this.parsedBoxes.filter((e=>e.type===t))}hasCompleteFragment(){const t=this.getBoxesOfType("moof"),e=this.getBoxesOfType("mdat");return t.length>=1&&e.length>=1}getRemainingBytes(t,e){let s=-t;for(let t=e;t<this.chunks.length;t++)s+=this.chunks[t].byteLength;return Math.max(0,s)}readNextBoxHeaderBytes(){const t=[];let e=this.cursorChunkIndex,s=this.cursorByteOffset;for(let i=0;i<8;i++){const i=this.chunks[e];t.push(i[s]),s++,s>=i.byteLength&&(s=0,e++)}return t}tryCreateNextFragment(){if(!this.hasCompleteFragment())return;const t=["moof","mdat"],e=[],s=()=>t.every((t=>e.some((e=>e.type===t))));do{const t=this.parsedBoxes.shift();if(!t)throw new c("Unexpectedly encountered empty box");e.push(t)}while(!s());const i=e.reduce(((t,e)=>t+e.size),0),r=new Uint8Array(i);return this.fillFragment(r),{data:r}}fillFragment(t){const e=t.byteLength;let s=0;for(;s<e;){const i=this.chunks[this.fragmentStartChunkIndex],r=i.byteLength-this.fragmentStartByteOffset,n=e-s;r>n?(t.set(i.subarray(this.fragmentStartByteOffset,this.fragmentStartByteOffset+n),s),s+=n,this.fragmentStartByteOffset+=n):(t.set(i.subarray(this.fragmentStartByteOffset),s),s+=r,this.fragmentStartByteOffset=0,this.cursorChunkIndex--,this.chunks.shift())}}advanceCursor(t){for(;t>0;){const e=this.chunks[this.cursorChunkIndex].byteLength-this.cursorByteOffset;e>t?(this.cursorByteOffset+=t,t=0):(this.cursorChunkIndex++,this.cursorByteOffset=0,t-=e)}}maybeValidateContainerFormat(t){if(!this.containerFormatValidated&&!h.BoxTypes.includes(t)){const{UnsupportedContainerFormatError:t}=this.context.registry.get(a.SegmentProcessingExportNames.SegmentProcessorErrors);throw new t("fmp4-parser")}this.containerFormatValidated=!0}tryParseNextBox(){const t=this.getRemainingBytes(this.cursorByteOffset,this.cursorChunkIndex);if(t<8)return;const e=this.readNextBoxHeaderBytes(),s=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],i=String.fromCharCode(e[4],e[5],e[6],e[7]),r=s<=t;return this.maybeValidateContainerFormat(i),r&&this.advanceCursor(s),r?{size:s,type:i}:void 0}getMoovBox(t){var e,s,o,a,h,c,d,f;return i(this,void 0,void 0,(function*(){const{segment:i}=this.data,{isDataSegment:u}=this.context.registry.get(n.ComponentName.CoreStateAtoms).Segments,p=t.get("moov");if(p)return p;if(u(i))try{for(var l,m=!0,g=r(i.initSegment.data);l=yield g.next(),!(e=l.done);){a=l.value,m=!1;try{const t=a;try{for(var y,x=!0,U=(c=void 0,r(t.fragments));y=yield U.next(),!(h=y.done);){f=y.value,x=!1;try{const t=f,e=_.ISOBoxer.parseBuffer(t.data.buffer).get("moov");if(e)return e}finally{x=!0}}}catch(t){c={error:t}}finally{try{x||h||!(d=U.return)||(yield d.call(U))}finally{if(c)throw c.error}}}finally{m=!0}}}catch(t){s={error:t}}finally{try{m||e||!(o=g.return)||(yield o.call(g))}finally{if(s)throw s.error}}}))}parseTimescale(t){var e,s;return null!==(s=null===(e=t.get("trak.mdia.mdhd"))||void 0===e?void 0:e.timescale)&&void 0!==s?s:1}extractPlaybackTime(t,e){const s=this.parseTimescale(e);return b(t,s)+v(t,s)}extractDuration(t,e){const s=this.parseTimescale(e);if(void 0===s)return-1;return t.list("moof.traf").reduce(((t,s)=>t+S(s,w(e))),0)/s}getOrCreateDataAtom(t){const{state:e}=this.context.effects,{Segments:s,DataStream:i}=this.context.registry.get(n.ComponentName.CoreStateAtoms),{createSegmentDataAtom:r,ContainerFormat:o}=s,{createDataStreamAtom:a}=i,h=this.dataAtoms.find((e=>e.mediaTypes.length===t.length&&e.mediaTypes.every((e=>t.includes(e)))));if(h)return h;const _=r(this.context,{mediaTypes:t,containerFormat:o.MP4,fragments:a(this.context)});return this.dataAtoms.push(_),e.dispatch(this.data.output.push,_),_}parseFragment(t){return i(this,void 0,void 0,(function*(){const{segment:e,playbackTimeExtracted:s,codecsExtracted:i}=this.data,{state:r}=this.context.effects,{isDataOrSelfInitSegment:o}=this.context.registry.get(n.ComponentName.CoreStateAtoms).Segments,a=_.ISOBoxer.parseBuffer(t.data.buffer),h=yield this.getMoovBox(a),{codecMap:c,trackMap:d}=U(this.context,h);if(o(e)&&void 0!==h){const t=this.extractPlaybackTime(a,h),e=this.extractDuration(a,h);e>-1&&(this.totalSegmentDuration+=e),!this.playbackTimeExposed&&t>-1&&(r.dispatch(s.trigger,t),this.playbackTimeExposed=!0)}r.dispatch(i.trigger,c);const f=this.getMediaTypesForFragment(a,d),u=this.getOrCreateDataAtom(f);r.dispatch(u.fragments.push,t)}))}getMediaTypesForFragment(t,e){const s=[],i=[...t.list("moov.trak.tkhd"),...t.list("moof.traf.tfhd")];for(const{track_ID:t}of i){const i=e[t];void 0===i||s.includes(i)||s.push(i)}return s}consumeRemainingBytes(){return i(this,void 0,void 0,(function*(){const t=this.getRemainingBytes(this.fragmentStartByteOffset,this.fragmentStartChunkIndex);if(t<=0)return;const e=new Uint8Array(t);this.fillFragment(e),yield this.parseFragment({data:e})}))}addChunk(t){return i(this,void 0,void 0,(function*(){let e,s;for(this.chunks.push(t);void 0!==(e=this.tryParseNextBox());)this.parsedBoxes.push(e);for(;void 0!==(s=this.tryCreateNextFragment());)yield this.parseFragment(s)}))}flush(){return i(this,void 0,void 0,(function*(){const{state:t}=this.context.effects;yield this.consumeRemainingBytes(),this.totalSegmentDuration>0&&t.dispatch(this.data.durationExtracted.trigger,this.totalSegmentDuration);for(const e of this.dataAtoms)t.dispatch(e.fragments.close);t.dispatch(this.data.output.close)}))}}e.FragmentParser=d;const f={Avc:["avc1","avc2","avc3"],Hvc:["hvc1","hev1"],Av1:["av01"]};function u(t){return t.get("mdia.minf.stbl.stsd")}function p(t){const e=t.get("avcC");if(!e||0===e.sps.length)return null;return t.type+"."+l(new Uint8Array(e.sps[0].splice(1,3)))}function l(t){let e="";for(let s=0;s<t.byteLength;s++){const i=(255&t[s]).toString(16);i.length<2&&(e+="0"),e+=i}return e}function m(t,e){const s=u(e);if(!s)return;const i=s.entries[0],r=(i.get("esds")||{}).decoderConfig;if(!r)return;const o=i.type,a=r.objectProfileIndication.toString(16),h=r.decoderConfigDescriptor.audioObjectType;if(0===parseInt(a)&&0===parseInt(h)&&"mp4a"===o){return t.registry.get(n.ComponentName.Logger).warn('Failed to extract MP4 codec string from segment - carrying on assuming it is "mp4a.40.2"'),"mp4a.40.2"}return o+"."+a+"."+h}function g(t,e){if(!e)return;const s=[...e.general_constraint_indicator_flags_bytes];for(;0===s[s.length-1];)s.pop();const i=s.map((t=>t.toString(16).toUpperCase()));return[t,`${["","A","B","C"][e.general_profile_space]}${e.general_profile_idc}`,`${e.general_profile_compatibility_flags}`,`${0===e.general_tier_flag?"L":"H"}${e.general_level_idc}`,...i].join(".")}function y(t,e){const s=u(e);if(!s)return;const i=s.entries.find((t=>[...f.Avc,...f.Hvc,...f.Av1].includes(t.type)));if(i){if(f.Avc.includes(i.type))return p(i);if(f.Hvc.includes(i.type))return g(i.type,i.get("hvcC"));if(f.Av1.includes(i.type)){return t.registry.get(n.ComponentName.Logger).warn('Skipping AV1 codec extraction - using "av01.0.09M.08.0.111.01.01.01.0" instead'),"av01.0.09M.08.0.111.01.01.01.0"}}}function x(t){return t.list("trak")}function U(t,e){const{MediaType:s}=t.registry.get(n.ComponentName.Constants),i={[s.Unknown]:[]},r={};if(void 0===e)return{codecMap:i,trackMap:r};const o=x(e);for(const e of o){const n=e.get("tkhd").track_ID,o=y(t,e),a=m(t,e);o&&(r[n]=s.Video,delete i[s.Unknown],i[s.Video]=[o]),a&&(r[n]=s.Audio,delete i[s.Unknown],i[s.Audio]=[a])}return{codecMap:i,trackMap:r}}function v(t,e){var s,i;const r=t.fetch("trun"),n=null===(s=null==r?void 0:r.samples)||void 0===s?void 0:s[0];return(null!==(i=null==n?void 0:n.sample_composition_time_offset)&&void 0!==i?i:0)/e}function b(t,e){const s=t.fetch("tfdt");return s&&void 0!==e?s.baseMediaDecodeTime/e:-1}function S(t,e){var s;const i=t.get("trun");if(!i)return 0;const r=t.get("tfhd"),n=r?r.default_sample_duration:void 0,o=null===(s=i.samples)||void 0===s?void 0:s.reduce(((t,s)=>t+(s.sample_duration||n||e||0)),0);return null!=o?o:0}function w(t){var e;const s=t.get("mvex.trex");return null!==(e=null==s?void 0:s.default_sample_duration)&&void 0!==e?e:0}},671:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ISOBox=e.ISOFile=e.ISOBoxer=void 0;const s=["moov","trak","tref","mdia","minf","stbl","edts","dinf","sinf","mvex","moof","traf","mfra","udta","meco","strk","vttc","schi"];e.ISOBoxer={parseBuffer:function(t,s={}){return new e.ISOFile(t,s).parse()}};const i=8;function r(t=0){return{offset:t}}var n=function(t,e={}){this.options=Object.assign({},e),this.options.iv_size=e.iv_size||i,t&&(this._raw=new DataView(t)),this._cursor=r(),this.boxes=[]};function o(t){return 0===t.length?null:t[0]}function a(t,e){const s=e.indexOf(".");let i=[];if(-1===s)for(let s=0;s<t.length;s++)t[s].type===e&&i.push(t[s]);else{const r=e.substr(0,s),n=e.substr(s+1);for(let e=0;e<t.length;e++)t[e].type===r&&(i=i.concat(t[e].list(n)))}return i}e.ISOFile=n,e.ISOFile.prototype.fetch=function(t){const e=this.fetchAll(t,!0);return e.length?e[0]:null},e.ISOFile.prototype.fetchAll=function(t,s){const i=[];return e.ISOFile._sweep.call(this,t,i,s),i},e.ISOFile.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){const t=e.ISOBox.parse(this);if(void 0===t.type)break;this.boxes.push(t)}return this},e.ISOFile._sweep=function(t,s,i){this.type&&this.type===t&&s.push(this);for(const r in this.boxes){if(s.length&&i)return;e.ISOFile._sweep.call(this.boxes[r],t,s,i)}},e.ISOFile.prototype.get=function(t){return o(this.list(t))},e.ISOFile.prototype.list=function(t){return a(this.boxes,t)};const h=function(){this._cursor=r()};function _(t,s){t.forEach((function(t){e.ISOBox.prototype._boxParsers[t]=s}))}e.ISOBox=h,e.ISOBox.parse=function(t){const s=new e.ISOBox;return s._offset=t._cursor.offset,s._root=t._root?t._root:t,s._raw=t._raw,s._parent=t,s._parseBox(),t._cursor.offset=s._raw.byteOffset+s._raw.byteLength,s},e.ISOBox.prototype.list=function(t){return a(this.boxes||this.entries||[],t)},e.ISOBox.prototype.get=function(t){return o(this.list(t))},e.ISOBox.prototype._readUint64=function(){const t=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset),e=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset+4);return t*Math.pow(2,32)+e},e.ISOBox.prototype._readInt64=function(){const t=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset),e=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset+4);return t*Math.pow(2,32)+e},e.ISOBox.prototype._readInt=function(t){let e=null;switch(t){case 8:e=this._raw.getInt8(this._cursor.offset-this._raw.byteOffset);break;case 16:e=this._raw.getInt16(this._cursor.offset-this._raw.byteOffset);break;case 32:e=this._raw.getInt32(this._cursor.offset-this._raw.byteOffset);break;case 64:e=this._readInt64()}return this._cursor.offset+=t>>3,e},e.ISOBox.prototype._readUint=function(t){let e=null;switch(t){case 8:e=this._raw.getUint8(this._cursor.offset-this._raw.byteOffset);break;case 16:e=this._raw.getUint16(this._cursor.offset-this._raw.byteOffset);break;case 24:e=(this._raw.getUint16(this._cursor.offset-this._raw.byteOffset)<<8)+this._raw.getUint8(this._cursor.offset-this._raw.byteOffset+2);break;case 32:e=this._raw.getUint32(this._cursor.offset-this._raw.byteOffset);break;case 64:e=this._readUint64()}return this._cursor.offset+=t>>3,e},e.ISOBox.prototype._readUintArray=function(t,e){const s=new Array(e);for(let i=0;i<e;++i)s[i]=this._readUint(t);return s},e.ISOBox.prototype._readFP=function(t){return this._readInt(2*t)/Math.pow(2,t)},e.ISOBox.prototype._readString=function(t){let e="";for(let s=0;s<t;s++){const t=this._readUint(8);e+=String.fromCharCode(t)}return e},e.ISOBox.prototype._readHex=function(t){for(var e=[],s=0;s<t;s++){const t=this._readUint(8);e.push((t>>>4).toString(16)),e.push((15&t).toString(16))}return e.join("")},e.ISOBox.prototype._readUUID=function(){return this._readUintArray(8,16)},e.ISOBox.prototype._readTerminatedString=function(){let t="";for(;;){const e=this._readUint(8);if(0==e)break;t+=String.fromCharCode(e)}return t},e.ISOBox.prototype._readTemplate=function(t){return this._readUint(t/2)+this._readUint(t/2)/Math.pow(2,t/2)},e.ISOBox.prototype._parseBox=function(){if(this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this.size=this._readUint(32),this.type=this._readString(4),1===this.size&&(this.largesize=this._readUint(64)),"uuid"===this.type&&(this.usertype=this._readUUID()),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}!this._incomplete&&this._boxParsers[this.type]&&this._boxParsers[this.type].call(this)}},e.ISOBox.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},e.ISOBox.prototype._createDataView=function(){return new DataView(this._raw.buffer,this._cursor.offset,this._raw.byteLength-(this._cursor.offset-this._offset))},e.ISOBox.prototype._boxParsers={},_(s,(function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(e.ISOBox.parse(this))})),e.ISOBox.prototype._boxParsers.elst=function(){this._parseFullBox(),this.entry_count=this._readUint(32),this.entries=[];for(let t=1;t<=this.entry_count;t++){const t=new e.ISOBox;1===this.version?(t.segment_duration=this._readUint(64),t.media_time=this._readInt(64)):(t.segment_duration=this._readUint(32),t.media_time=this._readInt(32)),t.media_rate_integer=this._readInt(16),t.media_rate_fraction=this._readInt(16),this.entries.push(t)}},e.ISOBox.prototype._boxParsers.emsg=function(){this._parseFullBox(),0===this.version?(this.scheme_id_uri=this._readTerminatedString(),this.value=this._readTerminatedString(),this.timescale=this._readUint(32),this.presentation_time_delta=this._readUint(32),this.event_duration=this._readUint(32),this.id=this._readUint(32)):(this.timescale=this._readUint(32),this.presentation_time=this._readUint(64),this.event_duration=this._readUint(32),this.id=this._readUint(32),this.scheme_id_uri=this._readTerminatedString(),this.value=this._readTerminatedString()),this.message_data=this._createDataView()},_(["free","mdat"],(function(){this.data=this._createDataView()})),_(["ftyp","styp"],(function(){for(this.major_brand=this._readString(4),this.minor_versions=this._readUint(32),this.compatible_brands=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.compatible_brands.push(this._readString(4))})),e.ISOBox.prototype._boxParsers.hdlr=function(){this._parseFullBox(),this.pre_defined=this._readUint(32),this.handler_type=this._readString(4),this.reserved=[this._readUint(32),this._readUint(32),this._readUint(32)],this.name=this._readTerminatedString()},e.ISOBox.prototype._boxParsers.mdhd=function(){this._parseFullBox(),1==this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.timescale=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.timescale=this._readUint(32),this.duration=this._readUint(32));const t=this._readUint(16);this.pad=t>>15,this.language=String.fromCharCode(96+(t>>10&31),96+(t>>5&31),96+(31&t)),this.pre_defined=this._readUint(16)},e.ISOBox.prototype._boxParsers.mfhd=function(){this._parseFullBox(),this.sequence_number=this._readUint(32)},e.ISOBox.prototype._boxParsers.mvhd=function(){this._parseFullBox(),1===this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.timescale=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.timescale=this._readUint(32),this.duration=this._readUint(32)),this.rate=this._readTemplate(32),this.volume=this._readTemplate(16),this.reserved1=this._readUint(16),this.reserved2=[this._readUint(32),this._readUint(32)],this.matrix=[];for(var t=0;t<9;t++)this.matrix.push(this._readTemplate(32));for(this.pre_defined=[],t=0;t<6;t++)this.pre_defined.push(this._readUint(32));this.next_track_ID=this._readUint(32)},e.ISOBox.prototype._boxParsers.sidx=function(){this._parseFullBox(),this.reference_ID=this._readUint(32),this.timescale=this._readUint(32),0===this.version?(this.earliest_presentation_time=this._readUint(32),this.first_offset=this._readUint(32)):(this.earliest_presentation_time=this._readUint(64),this.first_offset=this._readUint(64)),this.reserved=this._readUint(16),this.reference_count=this._readUint(16),this.references=[];for(let t=0;t<this.reference_count;t++){const t={},e=this._readUint(32);t.reference_type=e>>31&1,t.referenced_size=2147483647&e,t.subsegment_duration=this._readUint(32);const s=this._readUint(32);t.starts_with_SAP=s>>31&1,t.SAP_type=s>>28&7,t.SAP_delta_time=268435455&s,this.references.push(t)}},e.ISOBox.prototype._boxParsers.ssix=function(){this._parseFullBox(),this.subsegment_count=this._readUint(32),this.subsegments=[];for(let t=0;t<this.subsegment_count;t++){const t={};t.ranges_count=this._readUint(32),t.ranges=[];for(let e=0;e<t.ranges_count;e++){const e={};e.level=this._readUint(8),e.range_size=this._readUint(24),t.ranges.push(e)}this.subsegments.push(t)}},e.ISOBox.prototype._boxParsers.tfdt=function(){this._parseFullBox(),1===this.version?this.baseMediaDecodeTime=this._readUint(64):this.baseMediaDecodeTime=this._readUint(32)},e.ISOBox.prototype._boxParsers.tfhd=function(){this._parseFullBox(),this.track_ID=this._readUint(32),1&this.flags?(this.base_data_offset_present=!0,this.base_data_offset=this._readUint(64)):131072&this.flags&&(this.default_base_is_moof=!0),2&this.flags&&(this.sample_description_offset=this._readUint(32)),8&this.flags&&(this.default_sample_duration=this._readUint(32)),16&this.flags&&(this.default_sample_size=this._readUint(32)),32&this.flags&&(this.default_sample_flags=this._readUint(32))},e.ISOBox.prototype._boxParsers.tkhd=function(){this._parseFullBox(),1===this.version?(this.creation_time=this._readUint(64),this.modification_time=this._readUint(64),this.track_ID=this._readUint(32),this.reserved1=this._readUint(32),this.duration=this._readUint(64)):(this.creation_time=this._readUint(32),this.modification_time=this._readUint(32),this.track_ID=this._readUint(32),this.reserved1=this._readUint(32),this.duration=this._readUint(32)),this.reserved2=[this._readUint(32),this._readUint(32)],this.layer=this._readUint(16),this.alternate_group=this._readUint(16),this.volume=this._readTemplate(16),this.reserved3=this._readUint(16),this.matrix=[];for(let t=0;t<9;t++)this.matrix.push(this._readTemplate(32));this.width=this._readTemplate(32),this.height=this._readTemplate(32)},e.ISOBox.prototype._boxParsers.trun=function(){this._parseFullBox(),this.sample_count=this._readUint(32),1&this.flags&&(this.data_offset_present=!0,this.data_offset=this._readInt(32)),4&this.flags&&(this.first_sample_flags=this._readUint(32)),this.samples=[];for(let t=0;t<this.sample_count;t++){const t={};256&this.flags&&(t.sample_duration=this._readUint(32)),512&this.flags&&(t.sample_size=this._readUint(32)),1024&this.flags&&(t.sample_flags=this._readUint(32)),2048&this.flags&&(0==this.version?t.sample_composition_time_offset=this._readUint(32):t.sample_composition_time_offset=this._readInt(32)),this.samples.push(t)}},e.ISOBox.prototype._boxParsers.trex=function(){this._parseFullBox(),this.track_ID=this._readUint(32),this.default_sample_description_index=this._readUint(32),this.default_sample_duration=this._readUint(32),this.default_sample_size=this._readUint(32),this.default_sample_flags=this._readUint(32)},e.ISOBox.prototype._boxParsers.stsd=function(){for(this._parseFullBox(),this.entry_count=this._readUint(32),this.entries=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.entries.push(e.ISOBox.parse(this))},e.ISOBox.prototype._boxParsers.encv=function(){for(this._readHex(6),this.data_reference_index=this._readUint(16),this._readUint(16),this._readUint(16),this._readUint(32),this._readUint(32),this._readUint(32),this.width=this._readUint(16),this.height=this._readUint(16),this.horizresolution=this._readTemplate(32),this.vertresolution=this._readTemplate(32),this._readUint(32),this.frame_count=this._readUint(16),this._readUint(8),this.compressor_name=this._readString(4),this.depth=this._readUint(16),this._readUint(16),this._readHex(27),this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(e.ISOBox.parse(this))},_(["enca","mp4a"],(function(){for(this._readHex(6),this.data_reference_index=this._readUint(16),this._readUint(32),this._readUint(32),this.channel_count=this._readUint(16),this.sample_size=this._readUint(16),this._readUint(16),this._readUint(16),this.sample_rate=this._readUint(32)>>>16,this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(e.ISOBox.parse(this))}));function c(t,e){return t._cursor.offset-t._raw.byteOffset+e<=t.size}function d(t){if(!c(t,6))return{bytes_of_clear_data:0,bytes_of_encrypted_data:0};return{bytes_of_clear_data:t._readUint(16),bytes_of_encrypted_data:t._readUint(32)}}function f(t,e){return c(t,2)?(e.subsample_count=t._readUint(16),e.subsamples=Array.apply(null,Array(e.subsample_count)).map((e=>d(t))),e):Object.assign(Object.assign({},e),{subsample_count:0,subsamples:[]})}function u(t){if(!c(t,t._root.options.iv_size))return void(t.samples=[]);let e={iv:t._readHex(t._root.options.iv_size)};return t.flags&&(e=f(t,e)),e}_(["avc1","hvc1","hev1"],(function(){this._readUint(32),this._readUint(16),this.data_reference_index=this._readUint(16),this.version=this._readUint(16),this.revision_level=this._readUint(16),this.vendor=this._readUint(32),this.temporal_quality=this._readUint(32),this.spatial_quality=this._readUint(32),this.width=this._readUint(16),this.height=this._readUint(16),this.horizontal_resolution=this._readTemplate(32),this.vertical_resolution=this._readTemplate(32),this.data_size=this._readUint(32),this.frame_count=this._readUint(16);const t=this._readUint(8);this.compressor_name="";for(let e=0;e<31;e++){const s=this._readUint(8);e<t&&(this.compressor_name+=String.fromCharCode(s))}for(this.depth=this._readUint(16),this._readInt(16),this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(e.ISOBox.parse(this))})),e.ISOBox.prototype._boxParsers.avcC=function(){this.configuration_version=this._readUint(8),this.avc_profile_indication=this._readUint(8),this.profile_compatibility=this._readUint(8),this.avc_level_indication=this._readUint(8);const t=this._readUint(8);this.complete_representation=t>>>7&1,this.length_size_minus_one=3&t,this.num_sps=31&this._readUint(8),this.sps=[];for(let t=0;t<this.num_sps;++t)this.sps.push(this._readUintArray(8,this._readUint(16)));this.num_pps=31&this._readUint(8),this.pps=[];for(let t=0;t<this.num_pps;++t)this.pps.push(this._readUintArray(8,this._readUint(16)))},e.ISOBox.prototype._boxParsers.hvcC=function(){let t;this.configurationVersion=this._readUint(8),t=this._readUint(8),this.general_profile_space=t>>>6,this.general_tier_flag=t>>>5&1,this.general_profile_idc=31&t,this.general_profile_compatibility_flags=this._readUint(32),this.general_constraint_indicator_flags_bytes=[];for(let t=0;t<6;t++)this.general_constraint_indicator_flags_bytes[t]=this._readUint(8);this.general_level_idc=this._readUint(8),this.min_spatial_segmentation_idc=4095&this._readUint(16),this.parallelismType=3&this._readUint(8),this.chroma_format_idc=3&this._readUint(8),this.bit_depth_luma_minus8=7&this._readUint(8),this.bit_depth_chroma_minus8=7&this._readUint(8),this.avgFrameRate=this._readUint(16),t=this._readUint(8),this.constantFrameRate=t>>>6,this.numTemporalLayers=t>>>3&7,this.temporalIdNested=t>>>2&1,this.lengthSizeMinusOne=3&t,this.numOfArrays=this._readUint(8)},e.ISOBox.prototype._boxParsers.esds=function(){this._parseFullBox(),this._readUint(16),this.esId=this._readUint(16),this.streamPriority=31&this._readUint(8),this._readUint(16),this.decoderConfig={},this.decoderConfig.objectProfileIndication=this._readUint(8),this.decoderConfig.streamType=this._readUint(8)>>>2&63,this.decoderConfig.bufferSize=this._readUint(24),this.decoderConfig.maxBitrate=this._readUint(32),this.decoderConfig.avgBitrate=this._readUint(32),this.decoderConfig.decoderConfigDescriptor={},this.decoderConfig.decoderConfigDescriptor.tag=this._readUint(8),this.decoderConfig.decoderConfigDescriptor.length=this._readUint(8);const t=this._readUint(8),e=this._readUint(8),s=this.decoderConfig.decoderConfigDescriptor;s.audioObjectType=t>>>3&31,s.samplingFrequencyIndex=(7&t)<<1|e>>>7&1,s.channelConfiguration=e>>>3&15},e.ISOBox.prototype._boxParsers.tenc=function(){this._parseFullBox(),this.default_is_encrypted=1===this._readUint(24),this.default_iv_size=this._readUint(8),this.default_kid=this._readHex(16)},e.ISOBox.prototype._boxParsers.senc=function(){this._parseFullBox(),this.sample_count=this._readUint(32),this.samples=Array.apply(null,Array(this.sample_count)).map((t=>u(this)))},e.ISOBox.prototype._boxParsers.frma=function(){this.codingname=this._readString(4)},e.ISOBox.prototype._boxParsers.schm=function(){this._parseFullBox(),this.scheme_type=this._readString(4),this.scheme_version=this._readUint(32),1&this.flags&&(this.scheme_uri=this._readUint(8))},e.ISOBox.prototype._boxParsers.saiz=function(){if(this._parseFullBox(),1&this.flags&&(this.aux_info_type=this._readUint(32),this.aux_info_type_parameter=this._readUint(32)),this.default_sample_info_size=this._readUint(8),this.sample_count=this._readUint(32),0===this.default_sample_info_size){this.sample_info_size=[];for(let t=0;t<this.sample_count;++t)this.sample_info_size.push(this._readUint(8))}},e.ISOBox.prototype._boxParsers.pssh=function(){if(this._parseFullBox(),this.system_id=this._readUUID(),this.version>0){this.kid_count=this._readUint(32),this.kids=[];for(let t=0;t<this.kid_count;++t)this.kids.push(this._readString(16))}this.data_size=this._readUint(32),this.data=new DataView(this._raw.buffer,this._cursor.offset,this.data_size)},e.ISOBox.prototype._boxParsers.prft=function(){this._parseFullBox(),this.reference_track_ID=this._readUint(32),this.ntp_timestamp_seconds=this._readUint(32),this.ntp_timestamp_seconds_fraction=this._readUint(32),0===this.version?this.media_time=this._readUint(32):this.media_time=this._readUint(64)}},7048:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FrameworkError=void 0;class s extends Error{constructor(t){super(t),this.name="FrameworkError"}}e.FrameworkError=s},7019:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SegmentProcessorType=e.SegmentProcessingExportNames=void 0,function(t){t.SegmentProcessingComponent="segment-processing-component",t.SegmentProcessorType="segment-processor-type",t.SegmentProcessorErrors="segment-processor-errors"}(e.SegmentProcessingExportNames||(e.SegmentProcessingExportNames={})),function(t){t.Decryptor="decryptor",t.Parser="parser",t.Preprocessor="preprocessor",t.Transmuxer="transmuxer",t.Postprocessor="postprocessor"}(e.SegmentProcessorType||(e.SegmentProcessorType={}))}},e={};function s(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={exports:{}};return t[i].call(n.exports,n,n.exports,s),n.exports}return s(3036)})()));
@@ -1,10 +1,10 @@
1
1
  /*******************************************************************************
2
2
  * This source code is the proprietary property of Bitmovin, Inc. Unauthorized
3
3
  * copying, distribution, or use of this code, or any portion thereof, is
4
- * strictly prohibited. © 2023 Bitmovin, Inc. All rights reserved. This
4
+ * strictly prohibited. © 2024 Bitmovin, Inc. All rights reserved. This
5
5
  * source code is subject to the terms and conditions of the accompanying
6
6
  * license agreement.
7
7
  *
8
- * Bitmovin Player X Version 10.0.0-beta.12
8
+ * Bitmovin Player X Version 10.0.0-beta.13
9
9
  *******************************************************************************/
10
10
  !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["container-ts"]=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.playerx=e.bitmovin.playerx||{},e.bitmovin.playerx["container-ts"]=t())}(self,(()=>(()=>{"use strict";var e={3898:(e,t)=>{function n(e,t,n){const r=t;return r._name=e,{onAdd:r,dependencies:n}}Object.defineProperty(t,"__esModule",{value:!0}),t.createPackage=void 0,t.createPackage=n},8465:(e,t)=>{function n(e,t){const n=t;return n._name=e,n}function r(e){return(...t)=>{const[r,o]=e(...t);return n(r,o)}}Object.defineProperty(t,"__esModule",{value:!0}),t.createTaskClosure=t.createTask=void 0,t.createTask=n,t.createTaskClosure=r},9062:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentName=void 0,function(e){e.Logger="logger",e.Constants="constants",e.NetworkTask="network-task",e.FetchTask="fetch-task",e.SourceState="source-state",e.StreamTimeline="stream-timeline",e.Utils="utils",e.CoreEffects="core-effects",e.CoreStateAtoms="core-state-atoms",e.NetworkAtom="network-atom",e.SourceThread="source-thread",e.VideoElementUtils="video-element-utils",e.Metrics="metrics",e.AdaptationTask="adaptation-task",e.PlayerConfig="player-config"}(t.ComponentName||(t.ComponentName={}))},562:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerTsPackage=void 0;const r=n(3898),o=n(9062),a=n(7019),s=n(7994);t.ContainerTsPackage=(0,r.createPackage)("container-ts-package",((e,t)=>{const{StateEffectFactory:n,EventListenerEffectFactory:r}=t.registry.get(o.ComponentName.CoreEffects),c=t.using(n).using(r);c.registry.get(a.SegmentProcessingExportNames.SegmentProcessingComponent).addProcessor((0,s.createTsParser)(c))}),[o.ComponentName.CoreEffects,o.ComponentName.CoreStateAtoms,a.SegmentProcessingExportNames.SegmentProcessorType,a.SegmentProcessingExportNames.SegmentProcessorErrors,a.SegmentProcessingExportNames.SegmentProcessingComponent]),t.default=t.ContainerTsPackage},7994:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function s(e){try{i(r.next(e))}catch(e){a(e)}}function c(e){try{i(r.throw(e))}catch(e){a(e)}}function i(e){e.done?n(e.value):o(e.value).then(s,c)}i((r=r.apply(e,t||[])).next())}))},o=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,a){o(r,a,(t=e[n](t)).done,t.value)}))}}function o(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}};Object.defineProperty(t,"__esModule",{value:!0}),t.createTsParser=void 0;const a=n(8465),s=n(9062),c=n(7019),i=188,u=new Uint8Array(0),p=0;var d,f;function m(e,t){let n=-t.chunkOffset;for(let r=t.chunkIndex;r<e.length;r++)n+=e[r].byteLength;return Math.max(0,n)}function l(e,t,n){for(t.chunkOffset+=n;t.chunkOffset>0&&t.chunkOffset>=e[t.chunkIndex].byteLength;)t.chunkOffset-=e[t.chunkIndex].byteLength,t.chunkIndex++}function g(e,t){const n=e[t.chunkIndex][t.chunkOffset];return l(e,t,1),n}function y(e,t){return g(e,t)}function h(e,t){return(y(e,t)<<8)+y(e,t)}function k(e,t){return(h(e,t)<<16)+h(e,t)}function S(e,t,n){const r=new Uint8Array(n);let o=0,a=n;for(;a>0;){const n=e[t.chunkIndex],s=n.byteLength-t.chunkOffset;s>a?(r.set(n.subarray(t.chunkOffset,t.chunkOffset+a),o),t.chunkOffset+=a,a=0):(r.set(n.subarray(t.chunkOffset),o),o+=s,a-=s,t.chunkIndex++,t.chunkOffset=0)}return r}!function(e){e[e.Reserved=0]="Reserved",e[e.PayloadOnly=1]="PayloadOnly",e[e.AdaptationOnly=2]="AdaptationOnly",e[e.AdaptationAndPayload=3]="AdaptationAndPayload"}(d||(d={})),function(e){e[e.NotScrambled=0]="NotScrambled",e[e.Reserved=1]="Reserved",e[e.ScrambledWithEvenKey=2]="ScrambledWithEvenKey",e[e.ScrambledWithOddKey=3]="ScrambledWithOddKey"}(f||(f={}));const P=[1,2,27,30,31,32,33,34,35,36,37,38],v=[3,4,15,17,28],b=[29];function C(e,t){const{MediaType:n}=e.registry.get(s.ComponentName.Constants);return P.includes(t)?n.Video:v.includes(t)?n.Audio:b.includes(t)?n.Subtitle:n.Unknown}function x(e,t){const{Codec:n}=e.registry.get(s.ComponentName.Constants);switch(t){case 27:return n.AVC+".4D4016";case 15:return n.Mp4a+".40.2";default:return n.Unknown}}function T(e,t,n){if(!t.payloadUnitStartIndicator)return;let r=0;const o=new DataView(t.payload.buffer);r=o.getUint8(r)+1;o.getUint8(r);r+=1;const a=4095&o.getUint16(r);r+=2;o.getUint16(r);r+=2;o.getUint8(r);r+=1;o.getUint8(r);r+=1;o.getUint8(r);r+=1;const s=(a-9)/4;for(let e=0;e<s;e++){const t=4*e,a=o.getUint16(r+t),s=8191&o.getUint16(r+t+2);r+=4,n.push({programNumber:a,programMapId:s})}}function U(e,t,n){if(!t.payloadUnitStartIndicator)return;let r=0;const o=new DataView(t.payload.buffer);r=o.getUint8(r)+1,r+=1;const a=4095&o.getUint16(r);r+=9;const s=4095&o.getUint16(r);r+=2+s;let c=a-s-13;for(;c>0;){const e=o.getUint8(r),t=8191&o.getUint16(r+1),a=(4095&o.getUint16(r+3))+5;r+=a,c-=a,n.push({streamType:e,packetId:t})}}function I(e,t,n,r){if(!t.payloadUnitStartIndicator)return;let o=0;const a=new DataView(t.payload.buffer);o+=3;const s=a.getUint8(o);o+=3;if([188,190,191,240,241,255,242,248].includes(s))return;o+=1;const c=(192&a.getUint8(o))>>6;if(o+=2,2&c){const e=(14&a.getUint8(o))<<29,n=(65534&a.getUint16(o+1))<<14,s=(65534&a.getUint16(o+3))>>1;if(r.some((e=>e.packetId===t.packetIdentifier)))return;r.push({packetId:t.packetIdentifier,playbackTime:(e+n+s)/9e4})}}function O(e,t,n,r,o){t.packetIdentifier===p&&T(e,t,n),n.some((e=>e.programMapId===t.packetIdentifier))&&U(e,t,r),r.some((e=>e.packetId===t.packetIdentifier))&&I(e,t,r,o)}function w(e,t,n,r,o,a){const s=[];for(;m(t,n)>=i;){const i=k(t,n);if(i>>24!=71){const{UnsupportedContainerFormatError:t}=e.registry.get(c.SegmentProcessingExportNames.SegmentProcessorErrors);throw new t("ts-parser")}const p={transportErrorIndicator:(8388608&i)>0,payloadUnitStartIndicator:(4194304&i)>0,transportPriority:(2097152&i)>0,packetIdentifier:(2096896&i)>>8,scramblingControl:(192&i)>>6,adaptationFieldControl:(48&i)>>4,continuityCounter:15&i,adaptation:u,payload:u};switch(p.adaptationFieldControl){case d.PayloadOnly:p.payload=S(t,n,184);break;case d.AdaptationOnly:p.adaptation=S(t,n,184);break;case d.AdaptationAndPayload:{const e=g(t,n),r=183-e;p.adaptation=S(t,n,e),p.payload=S(t,n,r);break}default:l(t,n,184)}s.push(p),O(e,p,r,o,a)}return s}const E=(0,a.createTask)("ts-parser-processor",((e,t)=>r(void 0,void 0,void 0,(function*(){var n,r,a,c;const{state:i}=t.effects,{merge:u}=t.registry.get(s.ComponentName.Utils).TypedArrays,{Segments:p,DataStream:{createDataStreamAtom:d}}=t.registry.get(s.ComponentName.CoreStateAtoms),{createSegmentDataAtom:f,ContainerFormat:m}=p,l=[],g=[],y=[],h=[],k={chunkIndex:0,chunkOffset:0};try{for(var S,P=!0,v=o(e.input);!(n=(S=yield v.next()).done);){c=S.value,P=!1;try{const e=c;l.push(e),w(t,l,k,g,y,h)}finally{P=!0}}}catch(e){r={error:e}}finally{try{P||n||!(a=v.return)||(yield a.call(v))}finally{if(r)throw r.error}}const b={},T=Math.min(...h.map((e=>e.playbackTime)));for(const{streamType:e}of y){const n=C(t,e),r=x(t,e);b[n]=[r]}i.dispatch(e.playbackTimeExtracted.trigger,T),i.dispatch(e.codecsExtracted.trigger,b);const U=d(t),I=f(t,{mediaTypes:Object.keys(b),fragments:U,containerFormat:m.TS});i.dispatch(U.push,{data:u(...l)}),i.dispatch(U.close),i.dispatch(e.output.push,I),i.dispatch(e.output.close)}))));function N(e){const{ContainerFormat:t}=e.registry.get(s.ComponentName.CoreStateAtoms).Segments;return{name:"ts-parser",type:e.registry.get(c.SegmentProcessingExportNames.SegmentProcessorType).Parser,container:t.TS,process:E}}t.createTsParser=N},7019:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentProcessorType=t.SegmentProcessingExportNames=void 0,function(e){e.SegmentProcessingComponent="segment-processing-component",e.SegmentProcessorType="segment-processor-type",e.SegmentProcessorErrors="segment-processor-errors"}(t.SegmentProcessingExportNames||(t.SegmentProcessingExportNames={})),function(e){e.Decryptor="decryptor",e.Parser="parser",e.Preprocessor="preprocessor",e.Transmuxer="transmuxer",e.Postprocessor="postprocessor"}(t.SegmentProcessorType||(t.SegmentProcessorType={}))}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}return n(562)})()));
@@ -1,10 +1,10 @@
1
1
  /*******************************************************************************
2
2
  * This source code is the proprietary property of Bitmovin, Inc. Unauthorized
3
3
  * copying, distribution, or use of this code, or any portion thereof, is
4
- * strictly prohibited. © 2023 Bitmovin, Inc. All rights reserved. This
4
+ * strictly prohibited. © 2024 Bitmovin, Inc. All rights reserved. This
5
5
  * source code is subject to the terms and conditions of the accompanying
6
6
  * license agreement.
7
7
  *
8
- * Bitmovin Player X Version 10.0.0-beta.12
8
+ * Bitmovin Player X Version 10.0.0-beta.13
9
9
  *******************************************************************************/
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.core=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.playerx=e.bitmovin.playerx||{},e.bitmovin.playerx.core=t())}(self,(()=>(()=>{"use strict";var e={5775:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.isAbortable=t.sequence=t.rightCompose=t.race=t.forEach=t.map=t.abortAndWaitForExit=t.waitForExit=t.rejectAfter=t.resolveAfter=t.linkAbortSignal=t.Abortable=void 0;class r{constructor(e,t=new AbortController){this.abortController=t;let n=()=>{};const r=new Promise(((r,o)=>{n=()=>t.signal.removeEventListener("abort",a);const a=()=>{n(),o(t.signal.reason)},i=e=>{t.signal.aborted?o(t.signal.reason):r(e)},s=e=>{t.abort(e),o(e)};t.signal.addEventListener("abort",a);try{const n=e(i,s,t);n instanceof Promise&&n.catch(o)}catch(e){o(e)}}));this.boundThen=r.then.bind(r),this.boundCatch=r.catch.bind(r),this.boundFinally=r.finally.bind(r),this.finally(n).catch((()=>{}))}abort(e){this.abortController.abort(e)}get then(){return this.boundThen}get catch(){return this.boundCatch}get finally(){return this.boundFinally}get[Symbol.toStringTag](){return"Abortable"}static resolve(e){return new r((t=>t(e)))}static reject(e){return new r(((t,n)=>n(e)))}}function o(e,t){const n=()=>{t.removeEventListener("abort",n),e.abort(t.reason)};return t.addEventListener("abort",n),e.finally((()=>t.removeEventListener("abort",n))).catch((()=>{})),e}function a(e,t,n){try{const a=t(n);return o(h(a)?a:r.resolve(a),e)}catch(e){return r.reject(e instanceof Error?e:new Error(String(e)))}}function i(e,t){return new r(((r,a,i)=>{o(e,i.signal).then((e=>n(this,void 0,void 0,(function*(){yield t(),i.signal.aborted?a(i.signal.reason):r(e)})))).catch((e=>a(e)))}))}function s(e,t){const o=new r(((r,o)=>{e.then((e=>r(e))).catch((e=>n(this,void 0,void 0,(function*(){yield t(e),o(e)}))))}));return o.abort=t=>{e.abort(t)},o}function c(e){return e.catch((()=>{})).then((()=>{}))}function u(e,t){return t.abort(e),c(t)}function d(e,t){return new r(((n,r,o)=>{const a=[];let i=Promise.resolve();e.forEach((e=>i=i.then((()=>{o.signal.aborted?r(o.signal.reason):a.push(t(e))})))),i=i.then((()=>n(a))).catch(r)}))}function f(e,t){return new r(((n,r,a)=>{o(d(e,t),a.signal).then((()=>n())).catch(r)}))}function l(e){return new r(((t,n,r)=>Promise.race(e.map((e=>o(e,r.signal)))).then((e=>t(e))).catch((e=>n(e)))))}function m(e,t,a){return o(new r(((e,r,i)=>{o(t,i.signal).then((t=>n(this,void 0,void 0,(function*(){i.signal.aborted?r(i.signal.reason):o(a(t),i.signal).then(e).catch(r)})))).catch(r)})),e)}function g(e,...t){if(1===t.length)return n=>a(e,t[0],n);const[n,...r]=t;return t=>m(e,a(e,n,t),g(e,...r))}function h(e){return Boolean(e)&&"object"==typeof e&&null!==e&&"abort"in e&&"function"==typeof e.abort}t.Abortable=r,t.linkAbortSignal=o,t.resolveAfter=i,t.rejectAfter=s,t.waitForExit=c,t.abortAndWaitForExit=u,t.map=d,t.forEach=f,t.race=l,t.rightCompose=m,t.sequence=g,t.isAbortable=h},8508:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createEffectFactory=void 0;const n=e=>e;t.createEffectFactory=n},8581:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FrameworkError=void 0;class n extends Error{constructor(e){super(e),this.name="FrameworkError"}}t.FrameworkError=n},3898:(e,t)=>{function n(e,t,n){const r=t;return r._name=e,{onAdd:r,dependencies:n}}Object.defineProperty(t,"__esModule",{value:!0}),t.createPackage=void 0,t.createPackage=n},466:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isTask=t.bindTask=void 0;const r=n(5775);function o(e,t){const n=[n=>t(n,e)];return t=>(0,r.sequence)(e.abortSignal,...n)(t)}function a(e){return null!=e&&"function"==typeof e&&"_name"in e}t.bindTask=o,t.isTask=a},8465:(e,t)=>{function n(e,t){const n=t;return n._name=e,n}function r(e){return(...t)=>{const[r,o]=e(...t);return n(r,o)}}Object.defineProperty(t,"__esModule",{value:!0}),t.createTaskClosure=t.createTask=void 0,t.createTask=n,t.createTaskClosure=r},2955:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Thread=t.ThreadState=t.ThreadDisposedError=t.ThreadTerminationError=void 0;const o=n(5775),a=n(8581),i=n(466),s=n(438),c=n(4719),u=n(4081);class d extends a.FrameworkError{constructor(e,t){super(null==e?void 0:e.message),this.name="ThreadTerminationError",this.threadStack=[],this.updateThreadStack(e,t),this.updateStack(e,t)}updateThreadStack(e,t){void 0!==t&&this.threadStack.push(`Task<${t}>`),void 0!==e&&e instanceof d&&this.threadStack.unshift(...e.threadStack)}getTaskStack(e,t){return t&&e?`\nin Task<${t}> with root cause: ${e.stack}`:t?`\nin Task<${t}>`:e?`\nwith root cause: ${e.stack}`:"\nin unknown Task"}updateStack(e,t){var n;this.stack=(null!==(n=this.stack)&&void 0!==n?n:"")+this.getTaskStack(e,t)}}t.ThreadTerminationError=d;class f extends a.FrameworkError{constructor(e){super(e),this.name="ThreadDisposedError"}}var l;t.ThreadDisposedError=f,function(e){e.Idle="idle",e.Disposing="disposing",e.Disposed="disposed"}(l||(t.ThreadState=l={}));class m extends u.ThreadEventBus{constructor(e){super(e),this.waitForChildren=()=>{const e=this.getChildAbortables().map(o.waitForExit);return Promise.all(e).then((()=>{if(0!==this.getChildAbortables().length)return this.waitForChildren()}))},this.handleError=e=>r(this,void 0,void 0,(function*(){var t;e instanceof d||(yield this.abortAndWaitForChildren(e),this.abortController.abort(e),null===(t=this.abortable)||void 0===t||t.abort(e),this.dispose())})),this.abortAndWaitForChildren=(e=new d)=>r(this,void 0,void 0,(function*(){var t;if(this.threadState=l.Disposing,0===this.children.size)return;const n=[];for(const r of this.children){const a=(0,o.abortAndWaitForExit)(e,null!==(t=r.abortable)&&void 0!==t?t:o.Abortable.resolve());a.then((()=>{this.children.delete(r)})),n.push(a)}yield Promise.all(n),yield this.abortAndWaitForChildren(e)})),this.dispose=()=>{this.threadState=l.Disposed,this.children.clear(),this.disposeEventBus()},this.id=(0,c.generateId)(),this.threadState=l.Idle,this.executionDeferred=new s.Deferred,this.children=new Set,this.abortController=new AbortController;const t=()=>this.executionDeferred.reject(this.abortController.signal.reason);this.removeAbortListener=()=>this.abortController.signal.removeEventListener("abort",t),this.abortController.signal.addEventListener("abort",t),this.executionDeferred.promise.finally(this.removeAbortListener).catch((()=>{}))}get onExit(){return this.executionDeferred.promise}get state(){return this.threadState}createChild(e,t=(()=>!1)){if(this.threadState===l.Disposed)throw new f(`Calling fork on already disposed thread for ${e}`);const n=new m(this.eventBus);return this.children.add(n),n.onExit.catch((e=>t(e)?Promise.resolve():this.handleError(e))).finally((()=>this.removeChild(n))),n}getChildAbortables(){return Array.from(this.children).map((e=>{var t;return null!==(t=e.abortable)&&void 0!==t?t:o.Abortable.resolve()}))}abort(e){var t;null===(t=this.abortable)||void 0===t||t.abort(e),this.abortController.abort(e),this.getChildAbortables().forEach((t=>t.abort(e)))}fork(e,t,n){this.eventBus.dispatch(u.ThreadEventType.Bound,{taskName:t._name||t.name,context:e,param:n,task:t});const r=(0,i.bindTask)(e,t),a=()=>this.waitForChildren().finally(this.dispose),s=(0,o.resolveAfter)(r(n),a);return this.abortable=(0,o.rejectAfter)(s,this.abortAndWaitForChildren),this.abortable.catch((e=>{this.abortController.abort(e),this.executionDeferred.reject(e)})).then((()=>this.executionDeferred.resolve())),this.abortable}removeChild(e){this.children.delete(e)}}t.Thread=m},4081:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ThreadEventBus=t.ThreadEventType=void 0,function(e){e.Bound="bound",e.Started="started",e.Finished="finished",e.Aborted="aborted"}(n||(t.ThreadEventType=n={}));class r{constructor(e){this.eventBus=e,this.unsubscribes=[]}attach(e,t){const n=this.eventBus.on(e,t);return this.unsubscribes.push(n),()=>{this.unsubscribes=this.unsubscribes.filter((e=>e!==n)),n()}}disposeEventBus(){for(const e of this.unsubscribes)e();this.unsubscribes=[]}}t.ThreadEventBus=r},438:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0;class n{constructor(){this._reject=()=>{},this._resolve=()=>{},this.promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}get resolve(){return this._resolve}get reject(){return this._reject}}t.Deferred=n},4719:(e,t)=>{function n(){const e=16,t=Math.pow(1048576,3),n=1;return Date.now().toString(e)+Math.floor((n+Math.random())*t).toString(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.generateId=void 0,t.generateId=n},9062:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentName=void 0,function(e){e.Logger="logger",e.Constants="constants",e.NetworkTask="network-task",e.FetchTask="fetch-task",e.SourceState="source-state",e.StreamTimeline="stream-timeline",e.Utils="utils",e.CoreEffects="core-effects",e.CoreStateAtoms="core-state-atoms",e.NetworkAtom="network-atom",e.SourceThread="source-thread",e.VideoElementUtils="video-element-utils",e.Metrics="metrics",e.AdaptationTask="adaptation-task",e.PlayerConfig="player-config"}(t.ComponentName||(t.ComponentName={}))},6829:(e,t)=>{function n(e,t){const r=l();return n=function(t,o){let a=r[t-=366];if(void 0===n.YLIbdI){var i=function(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=";let n="",r="";for(let r,o,a=0,i=0;o=e.charAt(i++);~o&&(r=a%4?64*r+o:o,a++%4)?n+=String.fromCharCode(255&r>>(-2*a&6)):0)o=t.indexOf(o);for(let e=0,t=n.length;e<t;e++)r+="%"+("00"+n.charCodeAt(e).toString(16)).slice(-2);return decodeURIComponent(r)};n.RyeVjU=i,e=arguments,n.YLIbdI=!0}const s=t+r[0],c=e[s];return c?a=c:(a=n.RyeVjU(a),e[s]=a),a},n(e,t)}const r=n;!function(e,t){const r=n,o=e();for(;;)try{if(parseInt(r(374))/1*(-parseInt(r(381))/2)+parseInt(r(394))/3+-parseInt(r(387))/4*(parseInt(r(385))/5)+parseInt(r(384))/6+parseInt(r(392))/7*(parseInt(r(375))/8)+parseInt(r(370))/9+-parseInt(r(393))/10*(-parseInt(r(380))/11)===t)break;o.push(o.shift())}catch(e){o.push(o.shift())}}(l,135795),Object[r(390)](t,r(372),{value:!0}),t[r(367)]=t[r(378)]=t[r(368)]=t[r(366)]=void 0;const o=20;function a(e=o,t=[]){const r=n;if(e<1)throw new Error(r(396));const a=t[r(376)](0,e),s={buffer:a,capacity:e,size:a[r(389)],head:0,tail:0},c=i(s);return s[r(383)]=new Proxy(s[r(383)],c),s}function i(e){return{get:(t,r,o)=>{const a=n;return r===a(389)?e[a(395)]:Reflect[a(386)](t,r,o)},set:(e,t,r,o)=>{const a=n;if(t===a(389))throw new Error(a(379));return Reflect[a(373)](e,t,r,o)}}}function s(e,t){const r=n;function o(e){const t=n;return 0!==e[t(395)]&&(e[t(371)]=(e[t(371)]+1)%e[t(377)],e[t(395)]--,!0)}return null!=t&&(e[r(395)]===e[r(377)]&&o(e),e[r(383)][e[r(369)]]=t,e[r(369)]=(e[r(369)]+1)%e[r(377)],e[r(395)]++,!0)}function c(e){const t=n;if(0===e[t(395)])return!1;const r=new Array(e[t(377)]),o=i(e),a=new Proxy(r,o);return e[t(383)]=a,e[t(395)]=0,e[t(371)]=0,e[t(369)]=0,!0}function u(e){const t=n,r=(e[t(369)]-1)%e[t(377)],o=r<0?e[t(383)][t(389)]-1:r;return e[t(383)][o]}function d(e){const t=n;return e[t(383)][e[t(371)]]}t[r(366)]=a,t[r(368)]=u,t[r(378)]=d;const f=(e,t,r)=>{const o=n,i={add:s,clear:c};return e[o(382)][o(388)][o(391)](a(t,r),i)};function l(){const e=["mZaYmZCWEgH4Bu9w","mJeYnZm5tMXuEefR","C2L6zq","uMLUz0j1zMzLCIbJyxbHy2L0EsbUzwvKCYb0BYbIzsbHDcbSzwfZDcaX","z2v0rgvMyxvSDfjPBMDcDwzMzxi","y3jLyxrLuMLUz0j1zMzLCKf0B20","z2v0vgfPBa","DgfPBa","mtiWmte0ovffELn1yG","AgvHza","x19LC01VzhvSzq","C2v0","nZi3r0nsrMTf","oeDmzeTiwq","C2XPy2u","y2fWywnPDhK","z2v0sgvHza","q2fUBM90ihnLDcb0AguGj2XLBMD0AcCGChjVCgvYDhKGB2yGDgHLihjPBMCGyNvMzMvYlG","mZnXuu5YDuG","ndeWuhjQweL4","zwzMzwn0CW","yNvMzMvY","nJuWnZKWv3nYwMze","otKZnuHeDuXjDa","z2v0","mZu2Defmv3zR","C3rHDgu","BgvUz3rO","zgvMAw5LuhjVCgvYDhK","y3jLyxrL","nda2odyXzMrsrw5K"];return(l=function(){return e})()}t[r(367)]=f},5185:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MediaTypeValues=t.Codec=t.MediaType=void 0,function(e){e.Audio="audio",e.Video="video",e.Muxed="muxed",e.Subtitle="subtitle",e.Thumbnail="thumbnail",e.Unknown="unknown"}(n=t.MediaType||(t.MediaType={})),function(e){e.Mp4a="mp4a",e.AVC="avc1",e.HEVC="hvc1",e.ADTS="adts",e.Unknown="unknown"}(t.Codec||(t.Codec={})),t.MediaTypeValues=Object.values(n)},204:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CorePackage=void 0;const r=n(3898),o=n(9062),a=n(5234),i=n(6614),s=n(5185),c=n(4389),u=n(525),d=n(2369),f=n(605),l=n(8992),m=n(5266),g=n(99),h=n(5054),p=n(7041),v=n(9452),b=n(151),y=n(1093),S=n(8331),A=n(5783),w=n(4528),M=n(4033),C=n(253),T=n(8808),k=n(2161),E=n(367),D=n(780),j=n(9286),x=n(7831),L=n(3219),P=n(3987),z=n(1833),O=n(8694),I=n(8621),_=n(7422),B=n(4),N=n(8900),U=n(4233),G=n(2648);t.CorePackage=(0,r.createPackage)("core-package",((e,t)=>{t.registry.set(o.ComponentName.CoreEffects,{StateEffectFactory:C.StateEffectFactory,EventListenerEffectFactory:c.EventListenerEffectFactory,StoreEffectFactory:T.CreateStoreEffectFactory}),t.registry.set(o.ComponentName.CoreStateAtoms,{createArrayAtom:f.createArrayAtom,createSourceStateAtom:i.createSourceStateAtom,createMapStateAtom:g.createMapStateAtom,createPrimitiveAtom:h.createPrimitiveAtom,Segments:Object.assign({ContainerFormat:v.ContainerFormat,createDataSegmentAtom:p.createDataSegmentAtom,createInitSegmentAtom:p.createInitSegmentAtom,createSelfInitSegmentAtom:p.createSelfInitSegmentAtom,createSegmentDataAtom:v.createSegmentDataAtom,getReadableSegmentName:p.getReadableSegmentName,getTimeRange:p.getTimeRange,getGapToNextSegment:p.getGapToNextSegment,createSegmentTiming:b.createSegmentTiming,isDataOrSelfInitSegment:y.isDataOrSelfInitSegment,isDataSegment:y.isDataSegment,isInitSegment:y.isInitSegment},S.SegmentUtils),SelectionGroups:Object.assign({createAudioSelectionGroupAtom:A.createAudioSelectionGroupAtom,createVideoSelectionGroupAtom:A.createVideoSelectionGroupAtom,createSubtitleSelectionGroupAtom:A.createSubtitleSelectionGroupAtom,createUnknownSelectionGroupAtom:A.createUnknownSelectionGroupAtom,isVideoSelectionGroup:w.isVideoSelectionGroup,isAudioSelectionGroup:w.isAudioSelectionGroup,isMediaSelectionGroup:w.isMediaSelectionGroup},M.SelectionGroupUtils),Tracks:{createAudioTrackAtom:x.createAudioTrackAtom,createVideoTrackAtom:x.createVideoTrackAtom,createMuxedTrackAtom:x.createMuxedTrackAtom,createSubtitleTrackAtom:x.createSubtitleTrackAtom,createUnknownTrackAtom:x.createUnknownTrackAtom,isMuxedTrack:L.isMuxedTrack,isAudioTrack:L.isAudioTrack,isMediaTrack:L.isMediaTrack,isVideoTrack:L.isVideoTrack},Stream:{Type:k.StreamType,createStreamAtom:k.createStreamAtom},SegmentTimeline:{createStreamSectionAtom:E.createStreamSectionAtom,createStreamSequenceMapAtom:D.createStreamSequenceMapAtom,createStreamTimelineAtom:j.createStreamTimelineAtom},Metrics:{createMetricsAtom:u.createMetricsAtom,network:{SampleType:d.Type,createNetworkSampleAtom:d.createNetworkSampleAtom}},DataStream:{createDataStreamAtom:m.createDataStreamAtom},CodecMap:{createCodecMapAtom:l.createCodecMapAtom,addCodecs:l.addCodecs,copyCodecs:l.copyCodecs}}),t.registry.set(o.ComponentName.Utils,{Url:G.default,Codecs:z.default,Logger:I.Logger,Ranges:_.default,Error:O.default,String:N.default,State:B.default,Arrays:P.default,TypedArrays:U.default}),t.registry.set(o.ComponentName.Constants,{Codec:s.Codec,MediaType:s.MediaType,MediaTypeValues:s.MediaTypeValues}),e.get("packages").add(a.default),e.set("configure",(e=>t.registry.set(o.ComponentName.PlayerConfig,e)))}),[]),t.default=t.CorePackage},4389:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EventListenerEffectFactory=void 0;const r=n(8508),o=n(8465);function a(e,t,n,r,a){var i,s;if(void 0===e)throw new Error("Encountered undefined ExecutionContext in EventListenerEffect");const c=()=>{},u=null!==(i=t.get(n))&&void 0!==i?i:new Map,d=null!==(s=u.get(r))&&void 0!==s?s:[],f=(0,o.createTask)(`${String(r)}-subscriber`,a),l=t=>e.fork(f,t).catch(c),m=()=>{n.removeEventListener(String(r),l);const e=d.indexOf(m);e>-1&&d.splice(e,1)};return d.push(m),n.addEventListener(String(r),l),u.set(r,d),t.set(n,u),m}t.EventListenerEffectFactory=(0,r.createEffectFactory)((e=>{const t=new Map;return{effect:{events:{subscribe:(n,r,o)=>a(e,t,n,r,o)}},removeEffect(){for(const[e,n]of t)for(const[e,t]of n){const e=t.slice();for(const t of e)t()}t.clear()}}}))},525:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createMetricsAtom=void 0;const r=n(6829),o=10;function a(e,t=[]){return{network:(0,r.createRingBufferAtom)(e,o,t)}}function i(e,t){return e.effects.state.create(a(e,t),{})}t.createMetricsAtom=i},2369:(e,t)=>{function n(e,t){return e.type!==t&&(e.type=t,!0)}function r(e,t){return e.roundTripTimeSeconds!==t&&(e.roundTripTimeSeconds=t,!0)}function o(e,t){return e.downloadTimeSeconds!==t&&(e.downloadTimeSeconds=t,!0)}function a(e,t){return e.sizeInBytes!==t&&(e.sizeInBytes=t,!0)}function i(e,t){return e.timestamp!==t&&(e.timestamp=t,!0)}function s(e,t,s=0,c=0,u=0,d=Date.now()){return e.effects.state.create({type:t,sizeInBytes:s,roundTripTimeSeconds:c,downloadTimeSeconds:u,timestamp:d},{setType:n,setRoundTripTimeSeconds:r,setDownloadTimeSeconds:o,setSizeInBytes:a,setTimestamp:i})}Object.defineProperty(t,"__esModule",{value:!0}),t.createNetworkSampleAtom=t.Type=void 0,function(e){e.Manifest="manifest",e.InitSegment="init-segment",e.DataSegment="data-segment"}(t.Type||(t.Type={})),t.createNetworkSampleAtom=s},605:(e,t)=>{function n(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}function r(e,...t){return 0!==t.length&&(e.push(...t),!0)}function o(e,...t){const n=e.length;for(const n of t)e.includes(n)||e.push(n);return n===e.length}function a(e,t,...n){return 0!==n.length&&(e.splice(t,0,...n),!0)}function i(e,t,n){let r=0,o=e.length;for(;r<o;){const a=r+o>>>1;n(e[a])<n(t)?r=a+1:o=a}return r}function s(e,t,...n){const r=e.length;if(0===n.length)return!1;if(0===e.length)return e.push(...n.sort(((e,n)=>t(e)-t(n)))),!0;for(const r of n){const n=t(r),o=t(e[0]);if(t(e[e.length-1])<=n)e.push(r);else if(n<=o)e.unshift(r);else{const n=i(e,r,t);e.splice(n,0,r)}}return e.length!==r}function c(e,...t){let n=!1;for(const r of t){const t=e.indexOf(r);t<0||(n=!0,e.splice(t,1))}return n}function u(e){return 0!==e.length&&(e.splice(0,e.length),!0)}function d(e,t){if(n(e,t))return!1;const r=u(e);return t.forEach((t=>e.push(t))),r||t.length>0}Object.defineProperty(t,"__esModule",{value:!0}),t.createArrayAtom=void 0;const f=(e,t=[])=>{const n={add:r,insert:a,insertSorted:s,remove:c,clear:u,set:d,addIfNew:o};return e.effects.state.create(t,n)};t.createArrayAtom=f},99:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createMapStateAtom=void 0;const n=(e,t,n)=>(e.set(t,n),!0),r=(e,t)=>!!e.has(t)&&(e.delete(t),!0),o=e=>!!Array.from(e.keys()).length&&(e.clear(),!0),a=e=>{const t=new Map,a={add:n,remove:r,reset:o};return e.effects.state.create(t,a)};t.createMapStateAtom=a},5054:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPrimitiveAtom=void 0;const n=e=>({value:e});function r(e,t){return e.value!==t&&(e.value=t,!0)}function o(e,t){return e.effects.state.create(n(t),{setValue:r})}t.createPrimitiveAtom=o},8808:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateStoreEffectFactory=void 0;const r=n(8508);function o(e){return e&&"store"in e.effects&&"object"==typeof e.effects.store?e.effects.store:{}}const a=(e,t)=>(0,r.createEffectFactory)((n=>({effect:{store:Object.assign(Object.assign({},o(n)),{[e]:t})}})));t.CreateStoreEffectFactory=a},4686:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ModifierIdentifier=t.StateAtomIdentifier=void 0,t.StateAtomIdentifier=Symbol(),t.ModifierIdentifier=Symbol()},8992:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.copyCodecs=t.addCodecs=t.createCodecMapAtom=void 0;const r=n(9062);function o(e){const{createMapStateAtom:t}=e.registry.get(r.ComponentName.CoreStateAtoms);return t(e)}function a(e,t,n,r){var o;const{state:a}=e.effects,i=[...null!==(o=t.get(n))&&void 0!==o?o:[]];let s=!t.has(n);for(const e of r){const t=i.map((e=>e.toLowerCase()));t.includes(e.toLowerCase())||(s=!0,i.push(e))}return a.dispatch(t.add,n,i),s}function i(e,t){const{state:n}=e.effects,{createCodecMapAtom:o}=e.registry.get(r.ComponentName.CoreStateAtoms).CodecMap,a=o(e);for(const[e,r]of t)n.dispatch(a.add,e,r);return a}t.createCodecMapAtom=o,t.addCodecs=a,t.copyCodecs=i},3175:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDataRangesAtom=void 0;const r=n(8465),o=n(9062);function a(){return{ranges:[],enclosingRange:{start:1/0,end:-1/0},source:{}}}function i(){return{media:{}}}function s(e){return e.map((e=>({start:e.segmentTiming.parsedPlaybackTime,end:e.segmentTiming.parsedPlaybackTime+e.segmentTiming.parsedDuration})))}function c(e,t){var n,r,a,i;const{mergeRanges:c}=e.registry.get(o.ComponentName.Utils).Ranges;let u=[];for(const e in t.source)u=c([...u,...s(t.source[e])]);t.ranges.splice(0,t.ranges.length),t.ranges.push(...u),t.enclosingRange.start=null!==(r=null===(n=null==u?void 0:u[0])||void 0===n?void 0:n.start)&&void 0!==r?r:1/0,t.enclosingRange.end=null!==(i=null===(a=null==u?void 0:u[u.length-1])||void 0===a?void 0:a.end)&&void 0!==i?i:-1/0}const u=(0,r.createTaskClosure)((e=>["segment-timing-subscriber",(t,n)=>c(n,e)]));function d(e,t,n,r,i,s){const{insertSorted:d}=e.registry.get(o.ComponentName.Utils).Arrays.Sorted;if(n.media[r]||(n.media[r]=a()),n.media[r].source[i]||(n.media[r].source[i]=[]),n.media[r].source[i].includes(s))return!1;const{state:f}=e.effects,l=f.subscribe(e,s.segmentTiming,u(n.media[r]));return t.set(s,l),d(n.media[r].source[i],(e=>e.segmentTiming.parsedPlaybackTime),s),c(e,n.media[r]),!0}function f(e,t,n,r,o,a){var i;const s=n.media[r],u=null==s?void 0:s.source[o],d=u?u.indexOf(a):-1;return-1!==d&&(null===(i=t.get(a))||void 0===i||i(),t.delete(a),u.splice(d,1),0===u.length&&delete s.source[o],Object.keys(s.source).length?c(e,n.media[r]):delete n.media[r],!0)}function l(e,t){let n=!1;for(const e in t.media)delete t.media[e],n=!0;for(const[t,n]of e)n();return e.clear(),n}function m(e,t,n,r,o){let a=!1;for(const i in n.media)if(r===i)for(const s in n.media[i].source){if(s!==o)continue;const c=n.media[i].source[s].slice();for(const i of c){a=f(e,t,n,r,o,i)||a}}return a}const g=e=>{const t=new Map;return e.effects.state.create(i(),{addSegment:(n,r,o,a)=>d(e,t,n,r,o,a),removeSegment:(n,r,o,a)=>f(e,t,n,r,o,a),clear:e=>l(t,e),deleteSource:(n,r,o)=>m(e,t,n,r,o)})};t.createDataRangesAtom=g},5266:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.createDataStreamAtom=t.DataStreamClearedError=t.DataStreamClosedError=void 0;const o=n(4),{createTransient:a}=o.default;class i extends Error{constructor(){super("Cannot perform operation: DataStream is closed"),this.name="DataStreamClosedError"}}t.DataStreamClosedError=i;class s extends Error{constructor(){super("Cannot perform operation: DataStream was cleared"),this.name="DataStreamClearedError"}}function c(e){const t=(e=o.error)=>{if(e)for(const{reject:t}of n)t(e);else for(const{resolve:e}of n)e()},n=[],o={closed:!1,error:void 0,data:[],cleared:a(e),[Symbol.asyncIterator]:i};function i(){const e={resolve:()=>{},reject:()=>{}};let t=0;const a={next:()=>r(this,void 0,void 0,(function*(){if(o.error)throw o.error;for(;t>=o.data.length&&!o.closed;)yield new Promise(((t,n)=>{e.resolve=t,e.reject=n}));const n=o.data[t++];return!o.closed||t<=o.data.length?{done:!1,value:n}:{done:!0,value:void 0}}))};return n.push(e),a}return{dataStream:o,continuation:t}}function u(e,t){if(t.error)throw t.error;return!t.closed&&(t.closed=!0,e(),!0)}function d(e,t){if(t.error)throw t.error;return!!t.closed&&(t.closed=!1,e(),!0)}function f(e,t,n){const{state:r}=e.effects;return n.error=void 0,n.data.splice(0,n.data.length),n.closed=!1,t(new s),r.dispatch(n.cleared.trigger),!0}function l(e,t,...n){if(t.error)throw t.error;if(t.closed)throw new i;return t.data.push(...n),e(),!0}function m(e,t,n,r){if(n.error)throw r;const{state:o}=e.effects;return n.data.splice(0,n.data.length),n.error=r,n.closed=!0,t(),o.dispatch(n.cleared.trigger),!0}function g(e){const{abortSignal:t,effects:n}=e,{state:r,events:o}=n,{continuation:a,dataStream:i}=c(e),s=r.create(i,{push:(e,...t)=>l(a,e,...t),close:u.bind(null,a),open:d.bind(null,a),clear:f.bind(null,e,a),throw:m.bind(null,e,a)});return o.subscribe(t,"abort",(()=>r.dispatch(s.throw,t.reason))),s}t.DataStreamClearedError=s,t.createDataStreamAtom=g},7041:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGapToNextSegment=t.getTimeRange=t.getReadableSegmentName=t.createSelfInitSegmentAtom=t.createInitSegmentAtom=t.createDataSegmentAtom=t.SegmentType=void 0;const r=n(5266),o=n(99);var a;!function(e){e.Initialization="initialization",e.SelfInitializing="self-initializing",e.Data="data"}(a=t.SegmentType||(t.SegmentType={}));const i=(e,t)=>e.initSegment!==t&&(e.initSegment=t,!0);function s(e,t,n){var a;return Object.assign(Object.assign({metadata:{},data:(0,r.createDataStreamAtom)(e),byteRange:void 0},n),{type:t,selectionGroup:null!==(a=n.selectionGroup)&&void 0!==a?a:n.track.selectionGroup,codecs:(0,o.createMapStateAtom)(e)})}const c={setMetadata:(e,t)=>e.metadata!==t&&(e.metadata=t,!0),setSelectionGroup:(e,t)=>e.selectionGroup!==t&&(e.selectionGroup=t,!0)},u=(e,t)=>e.effects.state.create(s(e,a.Data,t),Object.assign(Object.assign({},c),{setInitSegment:i}));t.createDataSegmentAtom=u;const d=(e,t)=>e.effects.state.create(s(e,a.Initialization,t),c);t.createInitSegmentAtom=d;const f=(e,t)=>e.effects.state.create(s(e,a.SelfInitializing,t),c);function l(e,t=3){const n=e.url.split("?").shift().split("://").pop().split("#").shift().split("/"),r=Math.max(0,t),o=Math.min(n.length-1,Math.max(0,n.length-r-1));return n.slice(o).join("/")}function m(e){const{segmentTiming:{parsedPlaybackTime:t,parsedDuration:n}}=e;return{start:t,end:t+n}}function g(e,t){if(void 0===t)return;const n=t.segmentTiming.parsedPlaybackTime,r=e.segmentTiming.parsedPlaybackTime+e.segmentTiming.parsedDuration;return n!==r?{start:r,end:n}:void 0}t.createSelfInitSegmentAtom=f,t.getReadableSegmentName=l,t.getTimeRange=m,t.getGapToNextSegment=g},9452:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSegmentDataAtom=t.ContainerFormat=void 0,function(e){e.MP4="mp4",e.TS="mp2t",e.WebM="webm",e.Unknown="unknown"}(t.ContainerFormat||(t.ContainerFormat={}));const n=(e,t)=>e.effects.state.create(t,{});t.createSegmentDataAtom=n},151:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSegmentTiming=t.getDefaultSegmentTiming=void 0;const n=e=>Object.assign({parsedDuration:-1,parsedPlaybackTime:-1,encodedDuration:-1,encodedPlaybackTime:-1,timestampOffset:-1/0},e);function r(e,t,n){return(e.parsedDuration!==t||e.parsedPlaybackTime!==n)&&(e.parsedDuration=t,e.parsedPlaybackTime=n,!0)}function o(e,t,n){return(e.encodedDuration!==t||e.encodedPlaybackTime!==n)&&(e.encodedDuration=t,e.encodedPlaybackTime=n,!0)}function a(e,t){return e.timestampOffset!==t&&(e.timestampOffset=t,!0)}function i(e,n){return e.effects.state.create((0,t.getDefaultSegmentTiming)(n),{manifestParsed:r,dataParsed:o,timestampOffsetChanged:a})}t.getDefaultSegmentTiming=n,t.createSegmentTiming=i},1093:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isInitSegment=t.isDataSegment=t.isDataOrSelfInitSegment=void 0;const r=n(7041);function o(e){return[r.SegmentType.Data,r.SegmentType.SelfInitializing].includes(e.type)}function a(e){return[r.SegmentType.Data].includes(e.type)}function i(e){return e.type===r.SegmentType.Initialization}t.isDataOrSelfInitSegment=o,t.isDataSegment=a,t.isInitSegment=i},8331:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentUtils=void 0;const r=n(7041);function o(e){const t=e[0],n=(0,r.getTimeRange)(t);return e.every((e=>{const{start:t,end:o}=(0,r.getTimeRange)(e);return!(o<n.start||t>n.end)&&n.start!==o&&n.end!==t}))}function a(e,{effects:{state:t}},n){n.log(`Clearing data for ${e.url}`),t.dispatch(e.data.clear)}t.SegmentUtils={areSegmentsOverlapping:o,resetData:a}},5783:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createUnknownSelectionGroupAtom=t.createSubtitleSelectionGroupAtom=t.createAudioSelectionGroupAtom=t.createVideoSelectionGroupAtom=void 0;const r=n(9062),o=n(8992),a=(e,t,n,r)=>(0,o.addCodecs)(e,t.codecs,n,r),i=(e,t)=>e.language!==t&&(e.language=t,!0),s=(e,t)=>e.sequenceNumber!==t&&(e.sequenceNumber=t,!0);function c(e){return{setSequenceNumber:s,setCodecs:a.bind(void 0,e)}}const u=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),o=Object.assign(Object.assign({sequenceNumber:1/0},t),{mediaId:`${n.Video}:TODO-FIX-ME`});return p(e,o),e.effects.state.create(o,c(e))};function d(e){return{setCodecs:a.bind(void 0,e),setLanguage:i,setSequenceNumber:s}}t.createVideoSelectionGroupAtom=u;const f=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),o=Object.assign(Object.assign({sequenceNumber:1/0},t),{mediaId:`${n.Audio}:${t.language}:TODO-FIX-ME`});return p(e,o),e.effects.state.create(o,d(e))};t.createAudioSelectionGroupAtom=f;const l={setSequenceNumber:s,setLanguage:i},m=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),o=Object.assign(Object.assign({sequenceNumber:1/0},t),{mediaId:`${n.Subtitle}:${t.language}`});return p(e,o),e.effects.state.create(o,l)};t.createSubtitleSelectionGroupAtom=m;const g={setSequenceNumber:s},h=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),o=Object.assign(Object.assign({sequenceNumber:1/0},t),{mediaId:`${n.Unknown}`});return p(e,o),e.effects.state.create(o,g)};function p(e,t){const{deriveFrom:n}=e.registry.get(r.ComponentName.Utils).State;n(t,"timeRange",(()=>{const e={start:1/0,end:-1/0};for(const n of t.tracks){const{start:t,end:r}=n.timeRange;(t<e.start||!isFinite(e.start))&&(e.start=t),(r>e.end||!isFinite(e.end))&&(e.end=r)}return e}))}t.createUnknownSelectionGroupAtom=h},4528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isMediaSelectionGroup=t.isAudioSelectionGroup=t.isVideoSelectionGroup=void 0;const r=n(5185);function o(e,t){const n=e.codecs;for(const[e,r]of n)if(e===t)return!0;return!1}function a(e){return s(e)&&o(e,r.MediaType.Video)}function i(e){return s(e)&&o(e,r.MediaType.Audio)}function s(e){return"codecs"in e}t.isVideoSelectionGroup=a,t.isAudioSelectionGroup=i,t.isMediaSelectionGroup=s},4033:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionGroupUtils=void 0;const r=n(5185),o=n(4528);function a(e){if((0,o.isAudioSelectionGroup)(e))return r.MediaType.Audio;if((0,o.isVideoSelectionGroup)(e))return r.MediaType.Video;throw new Error(`Unsupported SelectionGroup ${e.mediaId}`)}t.SelectionGroupUtils={getMediaType:a}},253:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StateEffectFactory=t.UnsubscribedError=void 0;const r=n(8508),o=n(2955),a=n(4686);class i extends Error{constructor(){super("Thread aborted by unsubscribe"),this.name="UnsubscribedError"}}t.UnsubscribedError=i;const s=new WeakMap,c=new WeakMap;function u(e,t){const n=e,r=Object.keys(t);return n[a.StateAtomIdentifier]=10,r.forEach((e=>{const r=(...r)=>t[e].call(n,n,...r);r[a.ModifierIdentifier]=n,n[e]=r})),n}function d(){}function f(e,t,n){return e.has(t)}function l(e,t,n){const r=e.get(t);return f(e,t,r)?r:(e.set(t,n),n)}function m(e,t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}function g(e){e.abort(new i)}function h(e,t,n,r,o){const a=(i=!0)=>{if(m(r,n),m(o,a),!i)return;const s=l(c,e,new WeakMap),u=l(s,t,[]);u.forEach(g),u.splice(0,u.length)};return a}function p(e,t,n,r,o){const a=[t,r,e=>o(e)||e instanceof i],c=l(s,n,[]),u=h(n,r,a,c,e);return e.push(u),c.push(a),u}function v(e,...t){var n;const r=e[a.ModifierIdentifier];if(!e(...t))return;(null!==(n=s.get(r))&&void 0!==n?n:[]).forEach((([e,t,n])=>{const o=l(c,r,new WeakMap),a=l(o,t,[]),i=e.fork(t,r,n);a.forEach(g),a.splice(0,a.length,i),i.finally((()=>m(a,i))).catch(d)}))}function b(e,t){const n=null==e?void 0:e.abortSignal,r=()=>null==n?void 0:n.removeEventListener("abort",a);if(void 0===n)return()=>{};if(n.aborted)throw t(),new o.ThreadDisposedError("Attempted to add StateEffect on already disposed thread");const a=()=>{r(),t()};return n.addEventListener("abort",a),r}t.StateEffectFactory=(0,r.createEffectFactory)((e=>{const t=[];let n=()=>{};const r=()=>{t.slice().forEach((e=>e())),t.splice(0,t.length),n()};n=b(e,r);const o={UnsubscribedError:i,create:u,subscribe:(e,n,r,o=(()=>!1))=>p(t,e,n,r,o),dispatch:v};return{effect:{state:o},removeEffect:r}}))},367:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createStreamSectionAtom=void 0;const r=n(9062),o=n(780),a=e=>{const t={streamSequenceMap:(0,o.createStreamSequenceMapAtom)(e)};return s(e,t),c(e,t),e.effects.state.create(t,{})};function i(e,t){const n=t.segmentTiming.parsedPlaybackTime;return{start:n,end:n+t.segmentTiming.parsedDuration}}function s(e,t){const{deriveFrom:n}=e.registry.get(r.ComponentName.Utils).State;n(t,"timeRange",(()=>{const n={start:1/0,end:-1/0};for(const[r,o]of t.streamSequenceMap){if(0===o.length)continue;const t=i(e,o[0]).start,r=i(e,o[o.length-1]).end;n.start=isFinite(n.start)?Math.min(n.start,t):t,n.end=isFinite(n.end)?Math.max(n.end,r):r}return n}))}function c(e,t){const{deriveFrom:n}=e.registry.get(r.ComponentName.Utils).State;n(t,"sequenceNumber",(()=>{const e=t.streamSequenceMap.keys().next();return e.done?-1:e.value.sequenceNumber}))}t.createStreamSectionAtom=a},780:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createStreamSequenceMapAtom=void 0;const r=n(99),o=e=>(0,r.createMapStateAtom)(e);t.createStreamSequenceMapAtom=o},9286:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createStreamTimelineAtom=void 0;const r=n(605),o=e=>(0,r.createArrayAtom)(e,[]);t.createStreamTimelineAtom=o},2161:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createStreamAtom=t.StreamType=void 0;const r=n(4),o=n(605),a=n(5054),{createTransient:i}=r.default;function s(e,t){return e.type!==t&&(e.type=t,!0)}!function(e){e.Live="live",e.VoD="vod"}(t.StreamType||(t.StreamType={}));const c=(e,t)=>e.effects.state.create({tracks:(0,o.createArrayAtom)(e,[]),selectionGroups:(0,o.createArrayAtom)(e,[]),type:t,duration:(0,a.createPrimitiveAtom)(e,1/0),onPlaybackTimeMismatch:i(e),onDurationMismatch:i(e)},{setType:s});t.createStreamAtom=c},7831:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createUnknownTrackAtom=t.createSubtitleTrackAtom=t.createMuxedTrackAtom=t.createVideoTrackAtom=t.createAudioTrackAtom=void 0;const r=n(9062),o=n(605),a=n(8992),i=n(1093),s=(e,t)=>e.segments!==t&&(e.segments=t,!0),c=(e,t,n,r)=>(0,a.addCodecs)(e,t.codecs,n,r),u=(e,t)=>e.sequenceNumber!==t&&(e.sequenceNumber=t,!0),d=({effects:{state:e}},t,n)=>{if(t.selectionGroup===n)return!1;for(const r of"segments"in t?t.segments:[])e.dispatch(r.setSelectionGroup,n),(0,i.isDataSegment)(r)&&r.initSegment.selectionGroup!==n&&e.dispatch(r.initSegment.setSelectionGroup,n);return t.selectionGroup=n,!0};function f(e){return{setSegments:s,setSequenceNumber:u,setSelectionGroup:(t,n)=>d(e,t,n)}}function l(e){return Object.assign(Object.assign({},f(e)),{setCodecs:c.bind(void 0,e)})}const m=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),a=Object.assign({segments:(0,o.createArrayAtom)(e,[]),sequenceNumber:1/0,type:n.Audio},t);return b(e,a),e.effects.state.create(a,l(e))};t.createAudioTrackAtom=m;const g=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),a=Object.assign({segments:(0,o.createArrayAtom)(e,[]),sequenceNumber:1/0,type:n.Video},t);return b(e,a),e.effects.state.create(a,l(e))};t.createVideoTrackAtom=g;const h=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),a=Object.assign({segments:(0,o.createArrayAtom)(e,[]),sequenceNumber:1/0,type:n.Muxed},t);return b(e,a),e.effects.state.create(a,l(e))};t.createMuxedTrackAtom=h;const p=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),a=Object.assign({segments:(0,o.createArrayAtom)(e,[]),sequenceNumber:1/0,type:n.Subtitle},t);return b(e,a),e.effects.state.create(a,f(e))};t.createSubtitleTrackAtom=p;const v=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),a=Object.assign({segments:(0,o.createArrayAtom)(e,[]),sequenceNumber:1/0,type:n.Unknown},t);return b(e,a),e.effects.state.create(a,f(e))};function b(e,t){const{deriveFrom:n}=e.registry.get(r.ComponentName.Utils).State;n(t,"timeRange",(()=>{var e,n,r;if(t.sequenceNumber===1/0)return{start:-1/0,end:1/0};const o=null===(e=t.segments[0])||void 0===e?void 0:e.segmentTiming,a=null===(n=t.segments[t.segments.length-1])||void 0===n?void 0:n.segmentTiming;return{start:null!==(r=null==o?void 0:o.parsedPlaybackTime)&&void 0!==r?r:1/0,end:a?a.parsedPlaybackTime+a.parsedDuration:-1/0}}))}t.createUnknownTrackAtom=v},3219:(e,t)=>{function n(e){return"audio"===e.type}function r(e){return n(e)||o(e)}function o(e){return"video"===e.type}function a(e){return"muxed"===e.type}Object.defineProperty(t,"__esModule",{value:!0}),t.isMuxedTrack=t.isVideoTrack=t.isMediaTrack=t.isAudioTrack=void 0,t.isAudioTrack=n,t.isMediaTrack=r,t.isVideoTrack=o,t.isMuxedTrack=a},3987:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))},r=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,a){o(r,a,(t=e[n](t)).done,t.value)}))}}function o(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}};function o(e,t,n){if(0===e.length)return-1;let r=e.length-1,o=0;for(;o<=r;){const a=Math.floor((r+o)/2),i=n(e[a]);if(i>t)r=a-1;else{if(!(i<t))return a;o=a+1}}return-1}function*a(e,t=0){const n=t;let r=1;for(yield n;;){const t=n+r>=e;if(t&&t)return;n-r<0||(yield n-r),t||(yield n+r),r++}}function i(e,t,n,r,o){if(t<0)return-1;const a=[...t-1>=0?[-1]:[],...t+1<e.length?[1]:[]];for(;a.length>0;){const i=a.splice(0,a.length);for(const s of i){const i=t+s,c=e[i];if(r(c)===n){if(o(c))return i;a.push(s+Math.sign(s))}}}return-1}Object.defineProperty(t,"__esModule",{value:!0});class s extends Error{constructor(){super("The IterableStream has already closed"),this.name="IterableStreamClosedError"}}function c(e){var t,o,a,i,s,c,u;return n(this,void 0,void 0,(function*(){const n=[];try{for(t=!0,o=r(e);a=yield o.next(),!(i=a.done);){u=a.value,t=!1;try{const e=u;n.push(e)}finally{t=!0}}}catch(e){s={error:e}}finally{try{t||i||!(c=o.return)||(yield c.call(o))}finally{if(s)throw s.error}}return n}))}function u(e,t){return e.length===t.length&&e.every((e=>t.includes(e)))}function d(e,t,n){let r=0,o=e.length;for(;r<o;){const a=r+o>>>1;n(e[a])<n(t)?r=a+1:o=a}return r}function f(e,t,...n){const r=e.length;if(0===n.length)return!1;if(0===e.length)return e.push(...n.sort(((e,n)=>t(e)-t(n)))),!0;for(const r of n){const n=t(r),o=t(e[0]);if(t(e[e.length-1])<=n)e.push(r);else if(n<=o)e.unshift(r);else{const n=d(e,r,t);e.splice(n,0,r)}}return e.length!==r}t.default={Sorted:{findIndex:o,findIndexWithPivot:i,insertSorted:f,sortedIndex:d},AlternatingIndexGenerator:a,IterableStreamClosedError:s,readToEnd:c,equals:u}},1833:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=n(9062),o=n(5185),a=n(8992),i=new RegExp("^avc1.[0-9]{2,3}.[0-9]{2,3}$"),s={video:["avc","hvc","hev","mp4v","svc","mvc","av1","av01","vp8","vp9","dvh1","dvhe","dvav","dva1"],audio:["mp4a","mp3","opus","vorbis","speex","flac","samr","ac-3","ec-3","ac-4","ec-4"],application:["stpp","wvtt"]};function c(e){return i.test(e)}function u(e){const[t,n,r]=e.split(".");return t&&n&&r?`${t}.${parseInt(n).toString(16)}${parseInt(r).toString(16).toString().padStart(4,"0")}`:e}function d(e){const t={};return e.forEach((e=>{e.split(",").forEach((e=>{var n;const r=m(e),o=e.trim(),a=null!==(n=t[r])&&void 0!==n?n:t[r]=[];a.includes(o)||a.push(o)}))})),t}function f(e,t){var n;const{state:r}=e.effects,o=(0,a.createCodecMapAtom)(e);for(const a of t.split(",")){const t=a.trim();if(0===t.length)continue;const i=l(e,t),s=[...null!==(n=o.get(i))&&void 0!==n?n:[]];s.push(t),r.dispatch(o.add,i,[...s])}return o}function l(e,t){const{MediaType:n}=e.registry.get(r.ComponentName.Constants);switch(m(t)){case"audio":return n.Audio;case"video":return n.Video;default:return n.Unknown}}function m(e){if(!e)return"unknown";const t=["video","audio","application"];for(let n=0;n<t.length;n++)if(s[t[n]].find((t=>e.indexOf(t)>-1)))return t[n];return"unknown"}function g(e,t){if(e===t)return!0;return[["mp4a.40.2","mp4a.40.5"],["ac-3","mp4a.a5","mp4a.A5"],["ec-3","mp4a.a6","mp4a.A6"]].some((n=>n.includes(e)&&n.includes(t)))}function h(e){if(e)return e.split(".")[0]}function p(e){return"video"===m(e)}function v(e){return"audio"===m(e)}function b(e){return"application"===m(e)}function y(e){return p(e)?o.MediaType.Video:v(e)?o.MediaType.Audio:b(e)?o.MediaType.Subtitle:void 0}function S(e){return[o.MediaType.Video,o.MediaType.Audio].includes(e)}function A(e){return o.MediaTypeValues.includes(e)}t.default={hasOldAvc1CodecFormat:c,convertAvc1ToAvcotiCodecFormat:u,extractCodecStrings:d,extractCodecMap:f,canSwitchBetweenAudioCodecs:g,extractCodec:h,getMediaTypeFromCodec:y,isAvMediaType:S,isMediaType:A}},8694:(e,t)=>{function n(e){return e instanceof Error?e:new Error(e?String(e):void 0)}Object.defineProperty(t,"__esModule",{value:!0}),t.default={formatError:n}},8621:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.LogLevel=void 0,function(e){e[e.Off=0]="Off",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Log=3]="Log",e[e.Debug=4]="Debug",e[e.Verbose=5]="Verbose"}(n=t.LogLevel||(t.LogLevel={}));class r{constructor(){this.noop=()=>{},this.logLevel=n.Off,this.verboseFn=this.debugFn=this.logFn=this.warnFn=this.errorFn=this.noop,this.setLevel(n.Verbose)}get verbose(){return this.verboseFn}get debug(){return this.debugFn}get log(){return this.logFn}get warn(){return this.warnFn}get error(){return this.errorFn}get level(){return this.logLevel}setLevel(e){this.logLevel=e,this.errorFn=e>=n.Error?console.error.bind(console):this.noop,this.warnFn=e>=n.Warn?console.warn.bind(console):this.noop,this.logFn=e>=n.Log?console.log.bind(console):this.noop,this.debugFn=e>=n.Debug?console.info.bind(console):this.noop,this.verboseFn=e>=n.Verbose?console.debug.bind(console):this.noop}}t.Logger=r},1412:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MultiRange=void 0;class n{constructor(e,t,n){this.rangeStart=e,this.rangeEnd=t,this.rangeHits=n||1}get hits(){return this.rangeHits}get start(){return this.rangeStart}get end(){return this.rangeEnd}split(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r],a=o.rangeStart,i=o.rangeEnd,s=o.rangeHits,c=this.rangeStart<a&&this.rangeEnd>i,u=this.rangeStart<a&&this.rangeEnd>a&&this.rangeEnd<i,d=this.rangeStart>a&&this.rangeStart<i&&this.rangeEnd>i,f=this.rangeStart>a&&this.rangeEnd<i,l=this.rangeStart===a&&this.rangeEnd<i,m=this.rangeStart===a&&this.rangeEnd>i,g=this.rangeStart<a&&this.rangeEnd===i,h=this.rangeStart>a&&this.rangeEnd===i,p=this.rangeStart===a&&this.rangeEnd===i;c||m||g||p?t.push(new n(a,i,s+1)):u||l?(t.push(new n(a,this.rangeEnd,s+1)),t.push(new n(this.rangeEnd,i,s))):d||h?(t.push(new n(a,this.rangeStart,s)),t.push(new n(this.rangeStart,i,s+1))):f?(t.push(new n(a,this.rangeStart,s)),t.push(new n(this.rangeStart,this.rangeEnd,s+1)),t.push(new n(this.rangeEnd,i,s))):t.push(new n(a,i,s))}return t}merge(e){for(let t=0;t<e.length&&!(this.rangeEnd-this.rangeStart<=0);t++){const r=e[t];let o=null;if(t+1<e.length&&(o=e[t+1]),this.rangeStart<r.rangeStart){e.unshift(new n(this.rangeStart,Math.min(r.rangeStart,this.rangeEnd))),t++,this.rangeStart=r.rangeEnd;const o=Math.max(this.rangeStart,r.end);t===e.length-1&&o<this.rangeEnd&&e.push(new n(o,this.rangeEnd))}else if(o&&o.rangeStart>this.rangeStart){const a=Math.max(r.rangeEnd,this.rangeStart),i=Math.min(this.rangeEnd,o.rangeStart);i>a&&(e.splice(t+1,0,new n(a,i)),t++),this.rangeStart=o.rangeEnd}else null===o&&this.rangeEnd>r.rangeEnd&&(e.push(new n(Math.max(r.rangeEnd,this.rangeStart),this.rangeEnd)),this.rangeStart=this.rangeEnd)}return e}intersect(e){if(0===e.length)return[this];{const t=this.split(e);return this.merge(t)}}}t.MultiRange=n},7422:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=n(1412);function o(e){if(e.length<1)return e;e.sort(((e,t)=>e.start-t.start));const t=[];t.push(Object.assign({},e[0]));for(let n=1;n<e.length;n++){const r=t.slice(-1)[0],o=e[n];if(a(o,r))continue;const i=r.end>=o.start,s=r.end<=o.end;i&&s?t[t.length-1].end=o.end:t.push(Object.assign({},o))}return t}function a(e,t){return t.start<=e.start&&t.end>=e.end}function i(e,t){return e>t.start&&e<=t.end}function s(e,t){return e<t.end&&e>=t.start}function c(e,t){return e.filter((e=>!a(e,t))).reduce(((e,n)=>{const r=i(t.start,n),o=s(t.end,n);return r&&e.push(Object.assign(Object.assign({},n),{end:t.start})),o&&e.push(Object.assign(Object.assign({},n),{start:t.end})),r||o||e.push(Object.assign({},n)),e}),[])}function u(e){let t=[],n=0;for(const o in e){const a=e[o];n++;for(let e=0;e<a.length;e++)t=new r.MultiRange(a[e].start,a[e].end).intersect(t)}return[t,n]}function d(e){const t=[],[n,r]=u(e);for(const e in n)n[e].hits<r||t.push({start:n[e].start,end:n[e].end});return t}function f(e,t){const{start:n,end:r}=e,{start:o,end:a}=t;return n>=o&&n<a||r>o&&r<=a||o>=n&&o<r||a>n&&a<=r}t.default={mergeRanges:o,subtractRanges:c,getCommonRanges:d,isStartInRange:i,isEndInRange:s,overlaps:f,isFullyIncluded:a}},4:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const o=n(8465),a=n(9062);class i extends Error{constructor(){super("Aborted from map-subscribe"),this.name="MapUnsubscribedError"}}const s=(e,t,n)=>(0,o.createTask)(`map-subscribe-${n.name}`,((r,o)=>{var a;const s=Array.from(t.keys()),c=s.filter((e=>!r.includes(e))),u=r.filter((e=>!s.includes(e)));for(const e of c)null===(a=t.get(e))||void 0===a||a.abort(new i),t.delete(e);for(const r of u){const o=e.fork(n,r);t.set(r,o),o.finally((()=>t.delete(r))).catch((()=>{}))}}));function c(e,t,n){const r=new Map,o=s(e,r,n),a=e.effects.state.subscribe(e,t,o,(e=>e instanceof i));return()=>{a();for(const[e,t]of r)t.abort(new i)}}function u(e,t){const n=[],a=[];let i=!1;const s=(0,o.createTask)("sequence-task",t);function c(){return r(this,void 0,void 0,(function*(){if(i)return;const t=n.shift();void 0!==t&&(i=!0,yield e.fork(s,t).catch((()=>{})),i=!1,a.push(t),c().catch((()=>{})))}))}return{addToQueue:e=>{a.includes(e)||n.includes(e)||(n.push(e),c().catch((()=>{})))}}}function d(e,t,n){Object.defineProperty(e,t,{get:()=>n(e)})}function f(e,t,n,a=(()=>!1)){let s;const c=e=>a(e)||e instanceof i,u=(0,o.createTask)(`subscribe-${n.name}-once`,((e,t)=>r(this,void 0,void 0,(function*(){t.fork(n,e,c),s(!1)}))));return s=e.effects.state.subscribe(e,t,u,c)}function l(e){const{state:t}=e.effects,n=(e,t)=>(e.value=t,!0);return t.create({value:void 0},{trigger:n})}function m(e,t){let n=()=>{};const{abortable:r}=e.effects,{subscribeOnce:i}=e.registry.get(a.ComponentName.Utils).State,s=r((e=>n=e)),c=(0,o.createTask)("wait-for-transient",(({value:e},t)=>n(e)));return s.unsubscribe=i(e,t,c),s}t.default={mapSubscribe:c,subscribeOnce:f,waitFor:m,deriveFrom:d,createTransient:l,sequencererere:u}},8900:(e,t)=>{function n(){const e=16,t=Math.pow(1048576,3),n=1;return Date.now().toString(e)+Math.floor((n+Math.random())*t).toString(e)}Object.defineProperty(t,"__esModule",{value:!0});const r=function*(){let e=0;for(;;){e+=1;const t=Date.now().toString(16).padStart(14,"0"),n=e.toString(16).padStart(14,"0");yield`cafe${t.substring(0,4)}-${t.substring(4,8)}-${t.substring(8,12)}-${t.substring(12,14)}${n.substring(0,2)}-${n.substring(2)}`}}();function o(){return r.next().value}function a(e){return e.split("-").map(((e,t)=>0===t?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join("")}function i(e){return e?(" "+e).slice(1):""}function s(e){let t=e.length;1&t&&(e="0"+e,t++);const n=new Uint8Array(t>>1);for(let r=0;r<t;r+=2)n[r>>1]=parseInt(e.substr(r,2),16);return n}t.default={generateId:n,generateUuid:o,kebabCaseToCamelCase:a,forceReallocation:i,hexStringToUint8Array:s}},4233:(e,t)=>{function n(...e){const t=e.reduce(((e,t)=>t.byteLength+e),0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.byteLength;return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default={merge:n}},2648:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=new RegExp("^(?:[a-z]+:)?//","i");function r(e,t,n){return a(n)?n:i(n)?t+n:e+n}function o(e){let t=s(e);for(;"/"!==e[t]&&t<e.length;)t++;return e.substring(0,t)}function a(e){return!!e&&n.test(e)}function i(e){return!!(e&&e.length>0)&&"/"===e[0]}function s(e){const t="://",n=e.indexOf(t);return n>-1?n+t.length:-1===n&&0===e.indexOf("//")?2:0}function c(e){return e.indexOf("?")>-1&&(e=e.split("?")[0]),e}function u(e){const t=s(e=c(e));let n=e.lastIndexOf("/");return n===e.length-1&&(e=e.substring(0,n)),n=e.lastIndexOf("/"),n<0?"":n<=t?e+"/":e.substring(0,n+1)}function d(e,t){let n="/";return!e||e.length<1||a(t)?t:!t||t.length<1?e:((e=c(e)).indexOf("/")>-1&&(e=e.substring(0,e.lastIndexOf("/"))),"/"===t[0]&&(e=o(e),n=""),e+n+t)}function f(e,t){let n=e;return n=c(n),!(t=u(t))||t.indexOf("/")<0?e:d(n,t)}t.default={removeUrlParameters:c,removeLastPathPart:u,concatUrlParts:d,getDomainUrl:o,buildAbsoluteUrl:r,getBaseUrl:f}},1777:(e,t,n)=>{const r=i;function o(){const e=["mJmWodq4mfvAzuLUAa","twf4tgLJzw5ZzunHBgXezwXHEu1Z","r3jHBNrLza","Ahr0Chm6lY9SAwnLBNnPBMCTBgvNywn5lxnZBc1JB21WyxqUyML0Bw92Aw4Uy29T","sg9ZDg5HBwvZvg9tA2LW","mti3lJaUmc4X","r3jHBNrLzfjLC3bVBNnL","oduYnNfuvgz0Ca","ntmYodKXyK9oB3DU","ow9LtezREG","Bg9JywXOB3n0","ofj4BLnXyW","zgvMAw5LuhjVCgvYDhK","mJiYmZqZmeTIA1PSzW","tgLJzw5ZzunHBgXtDgf0Dxm","nJq3ntiZmgHtDgzVAa","tgLJzw5ZAw5NtgvNywn5u3nSqMfJA2vUzejHC2vvCMW","mtC1ndCWnMHZyKTkBa","mtu1nfvXsfvUCq","vgL6zw5gywXSyMfJA1vYBa","x19LC01VzhvSzq","l2XPy2vUC2LUzW","mtq4nZiWAej1zw9d"];return(o=function(){return e})()}!function(e,t){const n=i,r=e();for(;;)try{if(-parseInt(n(455))/1+-parseInt(n(460))/2+parseInt(n(464))/3*(parseInt(n(458))/4)+parseInt(n(462))/5+-parseInt(n(465))/6*(parseInt(n(454))/7)+parseInt(n(469))/8*(-parseInt(n(456))/9)+parseInt(n(470))/10===t)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(o,717040),Object[r(459)](t,r(467),{value:!0}),t[r(453)]=t[r(471)]=t[r(466)]=t[r(463)]=t[r(474)]=void 0;const a=n(552);function i(e,t){const n=o();return i=function(t,r){let o=n[t-=453];if(void 0===i.PhfxAl){var a=function(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=";let n="",r="";for(let r,o,a=0,i=0;o=e.charAt(i++);~o&&(r=a%4?64*r+o:o,a++%4)?n+=String.fromCharCode(255&r>>(-2*a&6)):0)o=t.indexOf(o);for(let e=0,t=n.length;e<t;e++)r+="%"+("00"+n.charCodeAt(e).toString(16)).slice(-2);return decodeURIComponent(r)};i.jZGWpd=a,e=arguments,i.PhfxAl=!0}const s=t+n[0],c=e[s];return c?o=c:(o=i.jZGWpd(o),e[s]=o),o},i(e,t)}t[r(474)]=[r(457),r(475)],t[r(463)]=r(473),t[r(466)]=t[r(463)]+r(468),t[r(471)]=3e4,t[r(453)]={status:a[r(461)][r(472)]}},1008:function(e,t,n){const r=b;!function(e,t){const n=b,r=e();for(;;)try{if(parseInt(n(389))/1*(-parseInt(n(412))/2)+-parseInt(n(432))/3+parseInt(n(410))/4+parseInt(n(419))/5*(-parseInt(n(438))/6)+parseInt(n(395))/7*(parseInt(n(418))/8)+-parseInt(n(387))/9+-parseInt(n(409))/10*(-parseInt(n(437))/11)===t)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(l,123194);var o=this&&this[r(386)]||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){const i=b;function s(e){const t=b;try{u(r[t(413)](e))}catch(e){a(e)}}function c(e){const t=b;try{u(r[t(388)](e))}catch(e){a(e)}}function u(e){const t=b;e[t(383)]?n(e[t(420)]):o(e[t(420)])[t(398)](s,c)}u((r=r[i(382)](e,t||[]))[i(413)]())}))};Object[r(430)](t,r(416),{value:!0}),t[r(397)]=void 0;const a=n(8465),i=n(9062),s=n(1777),c=n(552);class u extends Error{constructor(e){const t=b;super(e),this[t(435)]=t(380)}}function d(e){const t=b;if(void 0===e)return new u(t(417));if(e[t(378)]&&e[t(378)][t(393)](t(429)))return new u(e[t(378)]);if(void 0!==e[t(415)]){const n=[];for(const{key:r,errorMessage:o}of e[t(415)])n[t(405)](r+": "+o);return new u(n[t(426)](t(425)))}return e[t(378)]?new u(e[t(378)]):new u(t(431))}function f(){const e=b;return s[e(411)][e(393)](location[e(384)])}function l(){const e=["ChvZAa","mtaUmc4WlwjLDgeUW6y","DMfSDwvZ","y3jLyxrLvgfZAW","mZuWExvAz2jN","nZCWody4Ee51s3bn","sg9ZDg5HBwvZvg9tA2LW","ndzrrLvyD1K","BMv4Da","C3rHDhvZ","DMfSAwrHDgLVBKLUzM9YBwf0Aw9U","x19LC01VzhvSzq","tM8GBgLJzw5ZzsbPBMzVCM1HDgLVBIb3yxmGCMv0DxjUzwqGzNjVBsb0AguGC2vYDMvY","mtmYndb0quXbCwW","mtbYrvn4the","DMfSDwu","rMfPBgvKihrVihnLBMqGBgLJzw5ZzsbYzxf1zxn0oG","ue9tva","tMv0D29YA1rHC2S","r3jHBNrLzfjLC3bVBNnL","pc9ICJ4","AM9PBG","z2v0","q291BgqGBM90ihbHCNnLihjLC3bVBNnLoIbIB2r5igLZig5VDcbHiePtt04GB2jQzwn0","ww91CIbWBgf5zxiGAxmGBM90igfSBg93zwqGDg8GCgXHEsbVBIb0AguGzg9TywLU","zgvMAw5LuhjVCgvYDhK","qw4GDw5RBM93BIbSAwnLBNnLigvYCM9YigHHCYbVy2n1CNjLza","ntiZoti5EwDwD3fM","C3rYAw5NAwz5","Bg9N","BMfTzq","q29TCg9Uzw50tMfTzq","mty2nti5Dgn0EhnS","nZa1mtaYzxHfCxnl","BwvZC2fNzq","q291BgqGBM90ihbHCNnLihjLC3bVBNnLoIbIB2r5igLZigLUDMfSAwq","tgLJzw5ZAw5NrxjYB3i","Ahr0Chm6lY9SAwnLBNnPBMCUyML0Bw92Aw4Uy29Tl2XPy2vUC2LUzW","yxbWBhK","zg9Uzq","Ag9ZDg5HBwu","tgLJzw5ZzunHBgXtDgf0Dxm","x19HD2fPDgvY","mJaWmZu1m1fQA05OBq","DgHYB3C","mJm4m1P5q1fYCW","r3jHBNrLza","uMvXDwvZDcbMywLSzwqGD2L0Aca","tg9Nz2vY","Aw5JBhvKzxm","CMvNAxn0CNK","mZCXAeLVAuLQ","C3rYAw5N","tgLJzw5ZzvjLCxvLC3ruyxnR","DgHLBG","ANnVBG","ugXHEwvYq29UzMLN","BgLJzw5Zzs1Yzxf1zxn0","B21PDa","zM9YAW","B2jQzwn0"];return(l=function(){return e})()}function m(e){const t=b,{key:n}=e[t(394)][t(427)](i[t(436)][t(400)]);return JSON[t(433)]({key:n,domain:location[t(384)],version:t(406),customData:void 0})}function g(e){const t=b;return{body:m(e),url:t(381),method:t(422),numRetries:3,headers:{},responseType:t(399),credentials:t(402),retryDelay:0,requestTimeout:2e4,disableRetriesForResponseStatus:[]}}function h(e){const t=b,n=Object[t(407)](c[t(385)]);return t(414)in e&&typeof e[t(414)]===t(396)&&n[t(393)](e[t(414)])}function p({body:e,status:t}){const n=b;if(t<200||t>=300)throw new Error(n(391)+t);if(typeof e!==n(404))throw new Error(n(428));if(!h(e))throw new Error(n(379));return e}function v(e){return o(this,void 0,void 0,(function*(){const t=b,n=e[t(394)][t(427)](i[t(436)][t(423)]),r=e[t(394)][t(427)](i[t(436)][t(392)]),o=g(e);if(f())return s[t(424)];try{return p(yield e[t(403)](n,[o,void 0],(()=>!0)))}catch(e){return r[t(434)](t(421),e),s[t(424)]}}))}function b(e,t){const n=l();return b=function(t,r){let o=n[t-=378];if(void 0===b.XZEeVg){var a=function(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=";let n="",r="";for(let r,o,a=0,i=0;o=e.charAt(i++);~o&&(r=a%4?64*r+o:o,a++%4)?n+=String.fromCharCode(255&r>>(-2*a&6)):0)o=t.indexOf(o);for(let e=0,t=n.length;e<t;e++)r+="%"+("00"+n.charCodeAt(e).toString(16)).slice(-2);return decodeURIComponent(r)};b.oIFsLO=a,e=arguments,b.XZEeVg=!0}const i=t+n[0],s=e[i];return s?o=s:(o=b.oIFsLO(o),e[i]=o),o},b(e,t)}t[r(397)]=(0,a[r(408)])(r(401),((e,t)=>o(void 0,void 0,void 0,(function*(){const e=b,n=yield v(t);if(n[e(414)]!==c[e(385)][e(390)])throw d(n)}))))},5234:function(e,t,n){const r=i;!function(e,t){const n=i,r=e();for(;;)try{if(parseInt(n(484))/1+-parseInt(n(481))/2+-parseInt(n(485))/3+-parseInt(n(475))/4*(-parseInt(n(460))/5)+-parseInt(n(468))/6+parseInt(n(465))/7*(parseInt(n(476))/8)+parseInt(n(487))/9*(parseInt(n(488))/10)===t)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(a,191139);var o=this&&this[r(467)]||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){const s=i;function c(e){const t=i;try{d(r[t(482)](e))}catch(e){a(e)}}function u(e){const t=i;try{d(r[t(489)](e))}catch(e){a(e)}}function d(e){const t=i;e[t(490)]?n(e[t(479)]):o(e[t(479)])[t(462)](c,u)}d((r=r[s(483)](e,t||[]))[s(482)]())}))};function a(){const e=["x19LC01VzhvSzq","DxnPBMC","zgvMyxvSDa","twv0CMLJCW","zgvMAw5LuhjVCgvYDhK","mtqWCgXzvgTO","mtzID2X0Buu","CMvNAxn0CNK","zM9YAW","DMfSDwu","y3jLyxrLugfJA2fNzq","nZa2ndC2C2LmAxLU","BMv4Da","yxbWBhK","mJi4otaWyxHewxfT","mtK2oti5ExvUCgXg","tgLJzw5ZzvjLCxvLC3ruyxnR","mtHHBefhAMW","mtCZmJKWvgfVzM1x","DgHYB3C","zg9Uzq","q29TCg9Uzw50tMfTzq","ugXHEwvYq29UzMLN","tMv0D29YA1rHC2S","nti5ntb2CLzxr1O","q29YzuvMzMvJDhm","DgHLBG","BgLJzw5ZAw5NlxbHy2THz2u","z2v0","mte1mZi5ouP0C2PurW","tg9Nz2vY","x19HD2fPDgvY","mJeYmJiXmM9ztLvvtq","vxrPBhm"];return(a=function(){return e})()}function i(e,t){const n=a();return i=function(t,r){let o=n[t-=459];if(void 0===i.QqcTCT){var a=function(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=";let n="",r="";for(let r,o,a=0,i=0;o=e.charAt(i++);~o&&(r=a%4?64*r+o:o,a++%4)?n+=String.fromCharCode(255&r>>(-2*a&6)):0)o=t.indexOf(o);for(let e=0,t=n.length;e<t;e++)r+="%"+("00"+n.charCodeAt(e).toString(16)).slice(-2);return decodeURIComponent(r)};i.CoVtTD=a,e=arguments,i.QqcTCT=!0}const s=t+n[0],c=e[s];return c?o=c:(o=i.CoVtTD(o),e[s]=o),o},i(e,t)}Object[r(474)](t,r(470),{value:!0});const s=n(3898),c=n(9062),u=n(1008),d=(0,s[r(480)])(r(463),((e,t)=>o(void 0,void 0,void 0,(function*(){const e=i,{StateEffectFactory:n,EventListenerEffectFactory:r}=t[e(477)][e(464)](c[e(491)][e(461)]),o=t[e(471)](n)[e(471)](r);yield o[e(478)](u[e(486)],void 0)}))),[c[r(491)][r(466)],c[r(491)][r(492)],c[r(491)][r(459)],c[r(491)][r(469)],c[r(491)][r(461)],c[r(491)][r(473)]]);t[r(472)]=d},552:(e,t)=>{var n=r;function r(e,t){var n=o();return r=function(t,o){var a=n[t-=119];if(void 0===r.TtjlOl){var i=function(e){for(var t,n,r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",o="",a="",i=0,s=0;n=e.charAt(s++);~n&&(t=i%4?64*t+n:n,i++%4)?o+=String.fromCharCode(255&t>>(-2*i&6)):0)n=r.indexOf(n);for(var c=0,u=o.length;c<u;c++)a+="%"+("00"+o.charCodeAt(c).toString(16)).slice(-2);return decodeURIComponent(a)};r.CxApKn=i,e=arguments,r.TtjlOl=!0}var s=t+n[0],c=e[s];return c?a=c:(a=r.CxApKn(a),e[s]=a),a},r(e,t)}function o(){var e=["mJCZntHks2ThDee","otuXndi1D0fZEw1s","x19LC01VzhvSzq","ntC5mty4n01nC1zUsa","z3jHBNrLza","rgvUAwvK","nte3mtuXmMzHquH0sa","mtrItNPJzKO","oda2oti4uwH0DhHf","zgvUAwvK","mZbpAvHlzhG","tgLJzw5ZzunHBgXtDgf0Dxm","nZi1otu2mMPTu0LxBG","mJyYmdeWu2XothzT","nJLMwNHVAhm","zgvMAw5LuhjVCgvYDhK","mJrcuK5rCeq","r3jHBNrLza"];return(o=function(){return e})()}!function(e,t){for(var n=r,o=e();;)try{if(-parseInt(n(129))/1+-parseInt(n(128))/2*(parseInt(n(124))/3)+parseInt(n(134))/4+parseInt(n(123))/5*(parseInt(n(126))/6)+parseInt(n(135))/7*(-parseInt(n(136))/8)+-parseInt(n(122))/9+-parseInt(n(120))/10*(-parseInt(n(131))/11)===t)break;o.push(o.shift())}catch(e){o.push(o.shift())}}(o,807645),Object[n(125)](t,n(130),{value:!0}),t[n(121)]=void 0,function(e){var t=r;e[t(127)]=t(132),e[t(133)]=t(119)}(t[n(121)]||(t[n(121)]={}))},3984:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createBufferConfigAtom=void 0;const r=n(9062);function o(){return{forwardDuration:12,backwardDuration:6}}function a(e,t){const{MediaType:n}=e.registry.get(r.ComponentName.Constants);return Object.assign({[n.Video]:o(),[n.Audio]:o(),[n.Muxed]:o(),[n.Subtitle]:o(),[n.Thumbnail]:o(),[n.Unknown]:o()},t)}function i(e,t,n){return e[t].forwardDuration!==n&&(e[t].forwardDuration=n,!0)}function s(e,t,n){return e[t].backwardDuration!==n&&(e[t].backwardDuration=n,!0)}function c(e,t={}){return e.effects.state.create(a(e,t),{setForwardTargetLevel:i,setBackwardTargetLevel:s})}t.createBufferConfigAtom=c},5840:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createMediaTypeMapAtom=void 0;const r=n(9062);function o(e,...t){const{createMapStateAtom:n,createArrayAtom:o}=e.registry.get(r.ComponentName.CoreStateAtoms),a=n(e);for(const n of t)e.effects.state.dispatch(a.add,n,o(e));return a}t.createMediaTypeMapAtom=o},9414:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPlaybackAtom=t.PlaybackState=void 0;const r=n(9937);var o;function a(e){return{state:o.Initial,playhead:(0,r.createPlayheadAtom)(e)}}function i(e,t){return e.state!==t&&(e.state=t,!0)}function s(e){return e.effects.state.create(a(e),{setState:i})}!function(e){e.Initial="initial",e.CanPlay="can-play",e.Playing="can-play"}(o=t.PlaybackState||(t.PlaybackState={})),t.createPlaybackAtom=s},9937:(e,t)=>{function n(e,t){return Math.round(e*t)/t}function r(e,t){return e.precision!==t&&(e.precision=t,!0)}function o(e,t){const r=n(t,e.precision);return e.position!==r&&(e.position=r,!0)}function a(e){return Object.assign({position:-1,precision:1e3},e)}function i(e,t={}){return e.effects.state.create(a(t),{setPrecision:r,setPosition:o})}Object.defineProperty(t,"__esModule",{value:!0}),t.createPlayheadAtom=void 0,t.createPlayheadAtom=i},6614:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSourceStateAtom=void 0;const r=n(9062),o=n(605),a=n(3175),i=n(2161),s=n(8621),c=n(3984),u=n(5840),d=n(9414),f=n(1125),l=n(379);function m(e,t){const{MediaType:n}=e.registry.get(r.ComponentName.Constants);return{url:t,stream:(0,i.createStreamAtom)(e,i.StreamType.VoD),activeTracks:(0,o.createArrayAtom)(e,[]),activeSelectionGroups:(0,o.createArrayAtom)(e,[]),config:{buffer:(0,c.createBufferConfigAtom)(e),startup:(0,f.createStartupOptionsAtom)(e)},dataRanges:(0,a.createDataRangesAtom)(e),video:(0,l.createVideoElementAtom)(e),isActive:!1,logLevel:s.LogLevel.Log,playback:(0,d.createPlaybackAtom)(e),activeMediaTypes:(0,u.createMediaTypeMapAtom)(e,n.Audio,n.Video,n.Unknown)}}const g=(e,t)=>e.effects.state.create(m(e,t),{forceVideoElementUpdate:()=>!0,setLogLevel:(e,t)=>e.logLevel!==t&&(e.logLevel=t,!0),setActive(e,t){return e.isActive!==t&&(e.isActive=t,!0)}});t.createSourceStateAtom=g},1125:(e,t)=>{var n;function r(e,t){return e.position!==t&&(e.position=t,!0)}function o(e,t){return e.mode!==t&&(e.mode=t,!0)}function a(e){return Object.assign({position:-1,mode:n.Fast},e)}function i(e,t={}){return e.effects.state.create(a(t),{setPosition:r,setMode:o})}Object.defineProperty(t,"__esModule",{value:!0}),t.createStartupOptionsAtom=t.StartupMode=void 0,function(e){e.Fast="fast",e.Precise="precise"}(n=t.StartupMode||(t.StartupMode={})),t.createStartupOptionsAtom=i},379:(e,t)=>{function n(){return{element:void 0}}function r(e){return void 0!==e.element&&(e.element=void 0,!0)}function o(e,t){return e.element!==t&&(e.element=t,!0)}function a(e){return e.effects.state.create(n(),{clear:r,set:o})}Object.defineProperty(t,"__esModule",{value:!0}),t.createVideoElementAtom=void 0,t.createVideoElementAtom=a}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}return n(204)})()));
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.core=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.playerx=e.bitmovin.playerx||{},e.bitmovin.playerx.core=t())}(self,(()=>(()=>{"use strict";var e={5775:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.isAbortable=t.sequence=t.rightCompose=t.race=t.forEach=t.map=t.abortAndWaitForExit=t.waitForExit=t.rejectAfter=t.resolveAfter=t.linkAbortSignal=t.Abortable=void 0;class r{constructor(e,t=new AbortController){this.abortController=t;let n=()=>{};const r=new Promise(((r,o)=>{n=()=>t.signal.removeEventListener("abort",a);const a=()=>{n(),o(t.signal.reason)},i=e=>{t.signal.aborted?o(t.signal.reason):r(e)},s=e=>{t.abort(e),o(e)};t.signal.addEventListener("abort",a);try{const n=e(i,s,t);n instanceof Promise&&n.catch(o)}catch(e){o(e)}}));this.boundThen=r.then.bind(r),this.boundCatch=r.catch.bind(r),this.boundFinally=r.finally.bind(r),this.finally(n).catch((()=>{}))}abort(e){this.abortController.abort(e)}get then(){return this.boundThen}get catch(){return this.boundCatch}get finally(){return this.boundFinally}get[Symbol.toStringTag](){return"Abortable"}static resolve(e){return new r((t=>t(e)))}static reject(e){return new r(((t,n)=>n(e)))}}function o(e,t){const n=()=>{t.removeEventListener("abort",n),e.abort(t.reason)};return t.addEventListener("abort",n),e.finally((()=>t.removeEventListener("abort",n))).catch((()=>{})),e}function a(e,t,n){try{const a=t(n);return o(h(a)?a:r.resolve(a),e)}catch(e){return r.reject(e instanceof Error?e:new Error(String(e)))}}function i(e,t){return new r(((r,a,i)=>{o(e,i.signal).then((e=>n(this,void 0,void 0,(function*(){yield t(),i.signal.aborted?a(i.signal.reason):r(e)})))).catch((e=>a(e)))}))}function s(e,t){const o=new r(((r,o)=>{e.then((e=>r(e))).catch((e=>n(this,void 0,void 0,(function*(){yield t(e),o(e)}))))}));return o.abort=t=>{e.abort(t)},o}function c(e){return e.catch((()=>{})).then((()=>{}))}function u(e,t){return t.abort(e),c(t)}function d(e,t){return new r(((n,r,o)=>{const a=[];let i=Promise.resolve();e.forEach((e=>i=i.then((()=>{o.signal.aborted?r(o.signal.reason):a.push(t(e))})))),i=i.then((()=>n(a))).catch(r)}))}function f(e,t){return new r(((n,r,a)=>{o(d(e,t),a.signal).then((()=>n())).catch(r)}))}function l(e){return new r(((t,n,r)=>Promise.race(e.map((e=>o(e,r.signal)))).then((e=>t(e))).catch((e=>n(e)))))}function m(e,t,a){return o(new r(((e,r,i)=>{o(t,i.signal).then((t=>n(this,void 0,void 0,(function*(){i.signal.aborted?r(i.signal.reason):o(a(t),i.signal).then(e).catch(r)})))).catch(r)})),e)}function g(e,...t){if(1===t.length)return n=>a(e,t[0],n);const[n,...r]=t;return t=>m(e,a(e,n,t),g(e,...r))}function h(e){return Boolean(e)&&"object"==typeof e&&null!==e&&"abort"in e&&"function"==typeof e.abort}t.Abortable=r,t.linkAbortSignal=o,t.resolveAfter=i,t.rejectAfter=s,t.waitForExit=c,t.abortAndWaitForExit=u,t.map=d,t.forEach=f,t.race=l,t.rightCompose=m,t.sequence=g,t.isAbortable=h},8508:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createEffectFactory=void 0;const n=e=>e;t.createEffectFactory=n},8581:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FrameworkError=void 0;class n extends Error{constructor(e){super(e),this.name="FrameworkError"}}t.FrameworkError=n},3898:(e,t)=>{function n(e,t,n){const r=t;return r._name=e,{onAdd:r,dependencies:n}}Object.defineProperty(t,"__esModule",{value:!0}),t.createPackage=void 0,t.createPackage=n},466:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isTask=t.bindTask=void 0;const r=n(5775);function o(e,t){const n=[n=>t(n,e)];return t=>(0,r.sequence)(e.abortSignal,...n)(t)}function a(e){return null!=e&&"function"==typeof e&&"_name"in e}t.bindTask=o,t.isTask=a},8465:(e,t)=>{function n(e,t){const n=t;return n._name=e,n}function r(e){return(...t)=>{const[r,o]=e(...t);return n(r,o)}}Object.defineProperty(t,"__esModule",{value:!0}),t.createTaskClosure=t.createTask=void 0,t.createTask=n,t.createTaskClosure=r},2955:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Thread=t.ThreadState=t.ThreadDisposedError=t.ThreadTerminationError=void 0;const o=n(5775),a=n(8581),i=n(466),s=n(438),c=n(4719),u=n(4081);class d extends a.FrameworkError{constructor(e,t){super(null==e?void 0:e.message),this.name="ThreadTerminationError",this.threadStack=[],this.updateThreadStack(e,t),this.updateStack(e,t)}updateThreadStack(e,t){void 0!==t&&this.threadStack.push(`Task<${t}>`),void 0!==e&&e instanceof d&&this.threadStack.unshift(...e.threadStack)}getTaskStack(e,t){return t&&e?`\nin Task<${t}> with root cause: ${e.stack}`:t?`\nin Task<${t}>`:e?`\nwith root cause: ${e.stack}`:"\nin unknown Task"}updateStack(e,t){var n;this.stack=(null!==(n=this.stack)&&void 0!==n?n:"")+this.getTaskStack(e,t)}}t.ThreadTerminationError=d;class f extends a.FrameworkError{constructor(e){super(e),this.name="ThreadDisposedError"}}var l;t.ThreadDisposedError=f,function(e){e.Idle="idle",e.Disposing="disposing",e.Disposed="disposed"}(l||(t.ThreadState=l={}));class m extends u.ThreadEventBus{constructor(e){super(e),this.waitForChildren=()=>{const e=this.getChildAbortables().map(o.waitForExit);return Promise.all(e).then((()=>{if(0!==this.getChildAbortables().length)return this.waitForChildren()}))},this.handleError=e=>r(this,void 0,void 0,(function*(){var t;e instanceof d||(yield this.abortAndWaitForChildren(e),this.abortController.abort(e),null===(t=this.abortable)||void 0===t||t.abort(e),this.dispose())})),this.abortAndWaitForChildren=(e=new d)=>r(this,void 0,void 0,(function*(){var t;if(this.threadState=l.Disposing,0===this.children.size)return;const n=[];for(const r of this.children){const a=(0,o.abortAndWaitForExit)(e,null!==(t=r.abortable)&&void 0!==t?t:o.Abortable.resolve());a.then((()=>{this.children.delete(r)})),n.push(a)}yield Promise.all(n),yield this.abortAndWaitForChildren(e)})),this.dispose=()=>{this.threadState=l.Disposed,this.children.clear(),this.disposeEventBus()},this.id=(0,c.generateId)(),this.threadState=l.Idle,this.executionDeferred=new s.Deferred,this.children=new Set,this.abortController=new AbortController;const t=()=>this.executionDeferred.reject(this.abortController.signal.reason);this.removeAbortListener=()=>this.abortController.signal.removeEventListener("abort",t),this.abortController.signal.addEventListener("abort",t),this.executionDeferred.promise.finally(this.removeAbortListener).catch((()=>{}))}get onExit(){return this.executionDeferred.promise}get state(){return this.threadState}createChild(e,t=(()=>!1)){if(this.threadState===l.Disposed)throw new f(`Calling fork on already disposed thread for ${e}`);const n=new m(this.eventBus);return this.children.add(n),n.onExit.catch((e=>t(e)?Promise.resolve():this.handleError(e))).finally((()=>this.removeChild(n))),n}getChildAbortables(){return Array.from(this.children).map((e=>{var t;return null!==(t=e.abortable)&&void 0!==t?t:o.Abortable.resolve()}))}abort(e){var t;null===(t=this.abortable)||void 0===t||t.abort(e),this.abortController.abort(e),this.getChildAbortables().forEach((t=>t.abort(e)))}fork(e,t,n){this.eventBus.dispatch(u.ThreadEventType.Bound,{taskName:t._name||t.name,context:e,param:n,task:t});const r=(0,i.bindTask)(e,t),a=()=>this.waitForChildren().finally(this.dispose),s=(0,o.resolveAfter)(r(n),a);return this.abortable=(0,o.rejectAfter)(s,this.abortAndWaitForChildren),this.abortable.catch((e=>{this.abortController.abort(e),this.executionDeferred.reject(e)})).then((()=>this.executionDeferred.resolve())),this.abortable}removeChild(e){this.children.delete(e)}}t.Thread=m},4081:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ThreadEventBus=t.ThreadEventType=void 0,function(e){e.Bound="bound",e.Started="started",e.Finished="finished",e.Aborted="aborted"}(n||(t.ThreadEventType=n={}));class r{constructor(e){this.eventBus=e,this.unsubscribes=[]}attach(e,t){const n=this.eventBus.on(e,t);return this.unsubscribes.push(n),()=>{this.unsubscribes=this.unsubscribes.filter((e=>e!==n)),n()}}disposeEventBus(){for(const e of this.unsubscribes)e();this.unsubscribes=[]}}t.ThreadEventBus=r},438:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0;class n{constructor(){this._reject=()=>{},this._resolve=()=>{},this.promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}get resolve(){return this._resolve}get reject(){return this._reject}}t.Deferred=n},4719:(e,t)=>{function n(){const e=16,t=Math.pow(1048576,3),n=1;return Date.now().toString(e)+Math.floor((n+Math.random())*t).toString(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.generateId=void 0,t.generateId=n},9062:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentName=void 0,function(e){e.Logger="logger",e.Constants="constants",e.NetworkTask="network-task",e.FetchTask="fetch-task",e.SourceState="source-state",e.StreamTimeline="stream-timeline",e.Utils="utils",e.CoreEffects="core-effects",e.CoreStateAtoms="core-state-atoms",e.NetworkAtom="network-atom",e.SourceThread="source-thread",e.VideoElementUtils="video-element-utils",e.Metrics="metrics",e.AdaptationTask="adaptation-task",e.PlayerConfig="player-config"}(t.ComponentName||(t.ComponentName={}))},6829:(e,t)=>{const n=i;!function(e,t){const n=i,r=e();for(;;)try{if(parseInt(n(500))/1*(-parseInt(n(473))/2)+-parseInt(n(497))/3*(-parseInt(n(498))/4)+parseInt(n(475))/5*(parseInt(n(480))/6)+parseInt(n(477))/7+-parseInt(n(476))/8*(-parseInt(n(502))/9)+-parseInt(n(496))/10+-parseInt(n(483))/11===t)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(l,335405),Object[n(488)](t,n(499),{value:!0}),t[n(486)]=t[n(501)]=t[n(481)]=t[n(494)]=void 0;const r=20;function o(e=r,t=[]){const n=i;if(e<1)throw new Error(n(474));const o=t[n(493)](0,e),s={buffer:o,capacity:e,size:o[n(489)],head:0,tail:0},c=a(s);return s[n(484)]=new Proxy(s[n(484)],c),s}function a(e){return{get:(t,n,r)=>{const o=i;return n===o(489)?e[o(485)]:Reflect[o(482)](t,n,r)},set:(e,t,n,r)=>{const o=i;if(t===o(489))throw new Error(o(478));return Reflect[o(487)](e,t,n,r)}}}function i(e,t){const n=l();return i=function(t,r){let o=n[t-=473];if(void 0===i.luosYh){var a=function(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=";let n="",r="";for(let r,o,a=0,i=0;o=e.charAt(i++);~o&&(r=a%4?64*r+o:o,a++%4)?n+=String.fromCharCode(255&r>>(-2*a&6)):0)o=t.indexOf(o);for(let e=0,t=n.length;e<t;e++)r+="%"+("00"+n.charCodeAt(e).toString(16)).slice(-2);return decodeURIComponent(r)};i.TbFmgI=a,e=arguments,i.luosYh=!0}const s=t+n[0],c=e[s];return c?o=c:(o=i.TbFmgI(o),e[s]=o),o},i(e,t)}function s(e,t){const n=i;function r(e){const t=i;return 0!==e[t(485)]&&(e[t(479)]=(e[t(479)]+1)%e[t(492)],e[t(485)]--,!0)}return null!=t&&(e[n(485)]===e[n(492)]&&r(e),e[n(484)][e[n(490)]]=t,e[n(490)]=(e[n(490)]+1)%e[n(492)],e[n(485)]++,!0)}function c(e){const t=i;if(0===e[t(485)])return!1;const n=new Array(e[t(492)]),r=a(e),o=new Proxy(n,r);return e[t(484)]=o,e[t(485)]=0,e[t(479)]=0,e[t(490)]=0,!0}function u(e){const t=i,n=(e[t(490)]-1)%e[t(492)],r=n<0?e[t(484)][t(489)]-1:n;return e[t(484)][r]}function d(e){const t=i;return e[t(484)][e[t(479)]]}t[n(494)]=o,t[n(481)]=u,t[n(501)]=d;const f=(e,t,n)=>{const r=i,a={add:s,clear:c};return e[r(495)][r(491)][r(503)](o(t,n),a)};function l(){const e=["C2v0","zgvMAw5LuhjVCgvYDhK","BgvUz3rO","DgfPBa","C3rHDgu","y2fWywnPDhK","C2XPy2u","z2v0rgvMyxvSDfjPBMDcDwzMzxi","zwzMzwn0CW","ndGXote3mfPqEej4rq","mJGYmtHNCLL3yuK","mJi4ueHvtePU","x19LC01VzhvSzq","mKrKwKrLqG","z2v0sgvHza","mtHdzKjvuhG","y3jLyxrL","mJG4mZqWvhnrCMDh","uMLUz0j1zMzLCIbJyxbHy2L0EsbUzwvKCYb0BYbIzsbHDcbSzwfZDcaX","nvHgD2HIAq","mJiYodm2ohzKtuDcsq","mJC2ndC5meDKCNvzrW","q2fUBM90ihnLDcb0AguGj2XLBMD0AcCGChjVCgvYDhKGB2yGDgHLihjPBMCGyNvMzMvYlG","AgvHza","mta2otaYnNjRquHbzG","z2v0vgfPBa","z2v0","nJe2nZG0m25KvLztCG","yNvMzMvY","C2L6zq","y3jLyxrLuMLUz0j1zMzLCKf0B20"];return(l=function(){return e})()}t[n(486)]=f},5185:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.MediaTypeValues=t.Codec=t.MediaType=void 0,function(e){e.Audio="audio",e.Video="video",e.Muxed="muxed",e.Subtitle="subtitle",e.Thumbnail="thumbnail",e.Unknown="unknown"}(n=t.MediaType||(t.MediaType={})),function(e){e.Mp4a="mp4a",e.AVC="avc1",e.HEVC="hvc1",e.ADTS="adts",e.Unknown="unknown"}(t.Codec||(t.Codec={})),t.MediaTypeValues=Object.values(n)},204:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CorePackage=void 0;const r=n(3898),o=n(9062),a=n(5234),i=n(6614),s=n(5185),c=n(4389),u=n(525),d=n(2369),f=n(605),l=n(8992),m=n(5266),g=n(99),h=n(5054),p=n(7041),v=n(9452),b=n(151),y=n(1093),S=n(8331),A=n(5783),w=n(4528),M=n(4033),C=n(253),T=n(8808),k=n(2161),D=n(367),E=n(780),j=n(9286),P=n(7831),L=n(3219),z=n(3987),I=n(1833),x=n(8694),O=n(8621),_=n(7422),N=n(4),B=n(8900),G=n(4233),q=n(2648);t.CorePackage=(0,r.createPackage)("core-package",((e,t)=>{t.registry.set(o.ComponentName.CoreEffects,{StateEffectFactory:C.StateEffectFactory,EventListenerEffectFactory:c.EventListenerEffectFactory,StoreEffectFactory:T.CreateStoreEffectFactory}),t.registry.set(o.ComponentName.CoreStateAtoms,{createArrayAtom:f.createArrayAtom,createSourceStateAtom:i.createSourceStateAtom,createMapStateAtom:g.createMapStateAtom,createPrimitiveAtom:h.createPrimitiveAtom,Segments:Object.assign({ContainerFormat:v.ContainerFormat,createDataSegmentAtom:p.createDataSegmentAtom,createInitSegmentAtom:p.createInitSegmentAtom,createSelfInitSegmentAtom:p.createSelfInitSegmentAtom,createSegmentDataAtom:v.createSegmentDataAtom,getReadableSegmentName:p.getReadableSegmentName,getTimeRange:p.getTimeRange,getGapToNextSegment:p.getGapToNextSegment,createSegmentTiming:b.createSegmentTiming,isDataOrSelfInitSegment:y.isDataOrSelfInitSegment,isDataSegment:y.isDataSegment,isInitSegment:y.isInitSegment},S.SegmentUtils),SelectionGroups:Object.assign({createAudioSelectionGroupAtom:A.createAudioSelectionGroupAtom,createVideoSelectionGroupAtom:A.createVideoSelectionGroupAtom,createSubtitleSelectionGroupAtom:A.createSubtitleSelectionGroupAtom,createUnknownSelectionGroupAtom:A.createUnknownSelectionGroupAtom,isVideoSelectionGroup:w.isVideoSelectionGroup,isAudioSelectionGroup:w.isAudioSelectionGroup,isMediaSelectionGroup:w.isMediaSelectionGroup},M.SelectionGroupUtils),Tracks:{createAudioTrackAtom:P.createAudioTrackAtom,createVideoTrackAtom:P.createVideoTrackAtom,createMuxedTrackAtom:P.createMuxedTrackAtom,createSubtitleTrackAtom:P.createSubtitleTrackAtom,createUnknownTrackAtom:P.createUnknownTrackAtom,isMuxedTrack:L.isMuxedTrack,isAudioTrack:L.isAudioTrack,isMediaTrack:L.isMediaTrack,isSubtitleTrack:L.isSubtitleTrack,isVideoTrack:L.isVideoTrack},Stream:{Type:k.StreamType,createStreamAtom:k.createStreamAtom},SegmentTimeline:{createStreamSectionAtom:D.createStreamSectionAtom,createStreamSequenceMapAtom:E.createStreamSequenceMapAtom,createStreamTimelineAtom:j.createStreamTimelineAtom},Metrics:{createMetricsAtom:u.createMetricsAtom,network:{SampleType:d.Type,createNetworkSampleAtom:d.createNetworkSampleAtom}},DataStream:{createDataStreamAtom:m.createDataStreamAtom},CodecMap:{createCodecMapAtom:l.createCodecMapAtom,addCodecs:l.addCodecs,copyCodecs:l.copyCodecs}}),t.registry.set(o.ComponentName.Utils,{Url:q.default,Codecs:I.default,Logger:O.Logger,Ranges:_.default,Error:x.default,String:B.default,State:N.default,Arrays:z.default,TypedArrays:G.default}),t.registry.set(o.ComponentName.Constants,{Codec:s.Codec,MediaType:s.MediaType,MediaTypeValues:s.MediaTypeValues}),e.get("packages").add(a.default),e.set("configure",(e=>t.registry.set(o.ComponentName.PlayerConfig,e)))}),[]),t.default=t.CorePackage},4389:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EventListenerEffectFactory=void 0;const r=n(8508),o=n(8465);function a(e,t,n,r,a){var i,s;if(void 0===e)throw new Error("Encountered undefined ExecutionContext in EventListenerEffect");const c=()=>{},u=null!==(i=t.get(n))&&void 0!==i?i:new Map,d=null!==(s=u.get(r))&&void 0!==s?s:[],f=(0,o.createTask)(`${String(r)}-subscriber`,a),l=t=>e.fork(f,t).catch(c),m=()=>{n.removeEventListener(String(r),l);const e=d.indexOf(m);e>-1&&d.splice(e,1)};return d.push(m),n.addEventListener(String(r),l),u.set(r,d),t.set(n,u),m}t.EventListenerEffectFactory=(0,r.createEffectFactory)((e=>{const t=new Map;return{effect:{events:{subscribe:(n,r,o)=>a(e,t,n,r,o)}},removeEffect(){for(const[e,n]of t)for(const[e,t]of n){const e=t.slice();for(const t of e)t()}t.clear()}}}))},525:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createMetricsAtom=void 0;const r=n(6829),o=10;function a(e,t=[]){return{network:(0,r.createRingBufferAtom)(e,o,t)}}function i(e,t){return e.effects.state.create(a(e,t),{})}t.createMetricsAtom=i},2369:(e,t)=>{function n(e,t){return e.type!==t&&(e.type=t,!0)}function r(e,t){return e.roundTripTimeSeconds!==t&&(e.roundTripTimeSeconds=t,!0)}function o(e,t){return e.downloadTimeSeconds!==t&&(e.downloadTimeSeconds=t,!0)}function a(e,t){return e.sizeInBytes!==t&&(e.sizeInBytes=t,!0)}function i(e,t){return e.timestamp!==t&&(e.timestamp=t,!0)}function s(e,t,s=0,c=0,u=0,d=Date.now()){return e.effects.state.create({type:t,sizeInBytes:s,roundTripTimeSeconds:c,downloadTimeSeconds:u,timestamp:d},{setType:n,setRoundTripTimeSeconds:r,setDownloadTimeSeconds:o,setSizeInBytes:a,setTimestamp:i})}Object.defineProperty(t,"__esModule",{value:!0}),t.createNetworkSampleAtom=t.Type=void 0,function(e){e.Manifest="manifest",e.InitSegment="init-segment",e.DataSegment="data-segment"}(t.Type||(t.Type={})),t.createNetworkSampleAtom=s},605:(e,t)=>{function n(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}function r(e,...t){return 0!==t.length&&(e.push(...t),!0)}function o(e,...t){const n=e.length;for(const n of t)e.includes(n)||e.push(n);return n===e.length}function a(e,t,...n){return 0!==n.length&&(e.splice(t,0,...n),!0)}function i(e,t,n){let r=0,o=e.length;for(;r<o;){const a=r+o>>>1;n(e[a])<n(t)?r=a+1:o=a}return r}function s(e,t,...n){const r=e.length;if(0===n.length)return!1;if(0===e.length)return e.push(...n.sort(((e,n)=>t(e)-t(n)))),!0;for(const r of n){const n=t(r),o=t(e[0]);if(t(e[e.length-1])<=n)e.push(r);else if(n<=o)e.unshift(r);else{const n=i(e,r,t);e.splice(n,0,r)}}return e.length!==r}function c(e,...t){let n=!1;for(const r of t){const t=e.indexOf(r);t<0||(n=!0,e.splice(t,1))}return n}function u(e){return 0!==e.length&&(e.splice(0,e.length),!0)}function d(e,t){if(n(e,t))return!1;const r=u(e);return t.forEach((t=>e.push(t))),r||t.length>0}Object.defineProperty(t,"__esModule",{value:!0}),t.createArrayAtom=void 0;const f=(e,t=[])=>{const n={add:r,insert:a,insertSorted:s,remove:c,clear:u,set:d,addIfNew:o};return e.effects.state.create(t,n)};t.createArrayAtom=f},99:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createMapStateAtom=void 0;const n=(e,t,n)=>(e.set(t,n),!0),r=(e,t)=>!!e.has(t)&&(e.delete(t),!0),o=e=>!!Array.from(e.keys()).length&&(e.clear(),!0),a=e=>{const t=new Map,a={add:n,remove:r,reset:o};return e.effects.state.create(t,a)};t.createMapStateAtom=a},5054:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPrimitiveAtom=void 0;const n=e=>({value:e});function r(e,t){return e.value!==t&&(e.value=t,!0)}function o(e,t){return e.effects.state.create(n(t),{setValue:r})}t.createPrimitiveAtom=o},8808:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateStoreEffectFactory=void 0;const r=n(8508);function o(e){return e&&"store"in e.effects&&"object"==typeof e.effects.store?e.effects.store:{}}const a=(e,t)=>(0,r.createEffectFactory)((n=>({effect:{store:Object.assign(Object.assign({},o(n)),{[e]:t})}})));t.CreateStoreEffectFactory=a},4686:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ModifierIdentifier=t.StateAtomIdentifier=void 0,t.StateAtomIdentifier=Symbol(),t.ModifierIdentifier=Symbol()},8992:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.copyCodecs=t.addCodecs=t.createCodecMapAtom=void 0;const r=n(9062);function o(e){const{createMapStateAtom:t}=e.registry.get(r.ComponentName.CoreStateAtoms);return t(e)}function a(e,t,n,r){var o;const{state:a}=e.effects,i=[...null!==(o=t.get(n))&&void 0!==o?o:[]];let s=!t.has(n);for(const e of r){const t=i.map((e=>e.toLowerCase()));t.includes(e.toLowerCase())||(s=!0,i.push(e))}return a.dispatch(t.add,n,i),s}function i(e,t){const{state:n}=e.effects,{createCodecMapAtom:o}=e.registry.get(r.ComponentName.CoreStateAtoms).CodecMap,a=o(e);for(const[e,r]of t)n.dispatch(a.add,e,r);return a}t.createCodecMapAtom=o,t.addCodecs=a,t.copyCodecs=i},3175:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDataRangesAtom=void 0;const r=n(8465),o=n(9062);function a(){return{ranges:[],enclosingRange:{start:1/0,end:-1/0},source:{}}}function i(){return{media:{}}}function s(e){return e.map((e=>({start:e.segmentTiming.parsedPlaybackTime,end:e.segmentTiming.parsedPlaybackTime+e.segmentTiming.parsedDuration})))}function c(e,t){var n,r,a,i;const{mergeRanges:c}=e.registry.get(o.ComponentName.Utils).Ranges;let u=[];for(const e in t.source)u=c([...u,...s(t.source[e])]);t.ranges.splice(0,t.ranges.length),t.ranges.push(...u),t.enclosingRange.start=null!==(r=null===(n=null==u?void 0:u[0])||void 0===n?void 0:n.start)&&void 0!==r?r:1/0,t.enclosingRange.end=null!==(i=null===(a=null==u?void 0:u[u.length-1])||void 0===a?void 0:a.end)&&void 0!==i?i:-1/0}const u=(0,r.createTaskClosure)((e=>["segment-timing-subscriber",(t,n)=>c(n,e)]));function d(e,t,n,r,i,s){const{insertSorted:d}=e.registry.get(o.ComponentName.Utils).Arrays.Sorted;if(n.media[r]||(n.media[r]=a()),n.media[r].source[i]||(n.media[r].source[i]=[]),n.media[r].source[i].includes(s))return!1;const{state:f}=e.effects,l=f.subscribe(e,s.segmentTiming,u(n.media[r]));return t.set(s,l),d(n.media[r].source[i],(e=>e.segmentTiming.parsedPlaybackTime),s),c(e,n.media[r]),!0}function f(e,t,n,r,o,a){var i;const s=n.media[r],u=null==s?void 0:s.source[o],d=u?u.indexOf(a):-1;return-1!==d&&(null===(i=t.get(a))||void 0===i||i(),t.delete(a),u.splice(d,1),0===u.length&&delete s.source[o],Object.keys(s.source).length?c(e,n.media[r]):delete n.media[r],!0)}function l(e,t){let n=!1;for(const e in t.media)delete t.media[e],n=!0;for(const[t,n]of e)n();return e.clear(),n}function m(e,t,n,r,o){let a=!1;for(const i in n.media)if(r===i)for(const s in n.media[i].source){if(s!==o)continue;const c=n.media[i].source[s].slice();for(const i of c){a=f(e,t,n,r,o,i)||a}}return a}const g=e=>{const t=new Map;return e.effects.state.create(i(),{addSegment:(n,r,o,a)=>d(e,t,n,r,o,a),removeSegment:(n,r,o,a)=>f(e,t,n,r,o,a),clear:e=>l(t,e),deleteSource:(n,r,o)=>m(e,t,n,r,o)})};t.createDataRangesAtom=g},5266:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.createDataStreamAtom=t.DataStreamClearedError=t.DataStreamClosedError=void 0;const o=n(4),{createTransient:a}=o.default;class i extends Error{constructor(){super("Cannot perform operation: DataStream is closed"),this.name="DataStreamClosedError"}}t.DataStreamClosedError=i;class s extends Error{constructor(){super("Cannot perform operation: DataStream was cleared"),this.name="DataStreamClearedError"}}function c(e){const t=(e=o.error)=>{if(e)for(const{reject:t}of n)t(e);else for(const{resolve:e}of n)e()},n=[],o={closed:!1,error:void 0,data:[],cleared:a(e),[Symbol.asyncIterator]:i};function i(){const e={resolve:()=>{},reject:()=>{}};let t=0;const a={next:()=>r(this,void 0,void 0,(function*(){if(o.error)throw o.error;for(;t>=o.data.length&&!o.closed;)yield new Promise(((t,n)=>{e.resolve=t,e.reject=n}));const n=o.data[t++];return!o.closed||t<=o.data.length?{done:!1,value:n}:{done:!0,value:void 0}}))};return n.push(e),a}return{dataStream:o,continuation:t}}function u(e,t){if(t.error)throw t.error;return!t.closed&&(t.closed=!0,e(),!0)}function d(e,t){if(t.error)throw t.error;return!!t.closed&&(t.closed=!1,e(),!0)}function f(e,t,n){const{state:r}=e.effects;return n.error=void 0,n.data.splice(0,n.data.length),n.closed=!1,t(new s),r.dispatch(n.cleared.trigger),!0}function l(e,t,...n){if(t.error)throw t.error;if(t.closed)throw new i;return t.data.push(...n),e(),!0}function m(e,t,n,r){if(n.error)throw r;const{state:o}=e.effects;return n.data.splice(0,n.data.length),n.error=r,n.closed=!0,t(),o.dispatch(n.cleared.trigger),!0}function g(e){const{abortSignal:t,effects:n}=e,{state:r,events:o}=n,{continuation:a,dataStream:i}=c(e),s=r.create(i,{push:(e,...t)=>l(a,e,...t),close:u.bind(null,a),open:d.bind(null,a),clear:f.bind(null,e,a),throw:m.bind(null,e,a)});return o.subscribe(t,"abort",(()=>r.dispatch(s.throw,t.reason))),s}t.DataStreamClearedError=s,t.createDataStreamAtom=g},7041:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGapToNextSegment=t.getTimeRange=t.getReadableSegmentName=t.createSelfInitSegmentAtom=t.createInitSegmentAtom=t.createDataSegmentAtom=t.SegmentType=void 0;const r=n(5266),o=n(99);var a;!function(e){e.Initialization="initialization",e.SelfInitializing="self-initializing",e.Data="data"}(a=t.SegmentType||(t.SegmentType={}));const i=(e,t)=>e.initSegment!==t&&(e.initSegment=t,!0);function s(e,t,n){var a;return Object.assign(Object.assign({metadata:{},data:(0,r.createDataStreamAtom)(e),byteRange:void 0},n),{type:t,selectionGroup:null!==(a=n.selectionGroup)&&void 0!==a?a:n.track.selectionGroup,codecs:(0,o.createMapStateAtom)(e)})}const c={setMetadata:(e,t)=>e.metadata!==t&&(e.metadata=t,!0),setSelectionGroup:(e,t)=>e.selectionGroup!==t&&(e.selectionGroup=t,!0)},u=(e,t)=>e.effects.state.create(s(e,a.Data,t),Object.assign(Object.assign({},c),{setInitSegment:i}));t.createDataSegmentAtom=u;const d=(e,t)=>e.effects.state.create(s(e,a.Initialization,t),c);t.createInitSegmentAtom=d;const f=(e,t)=>e.effects.state.create(s(e,a.SelfInitializing,t),c);function l(e,t=3){const n=e.url.split("?").shift().split("://").pop().split("#").shift().split("/"),r=Math.max(0,t),o=Math.min(n.length-1,Math.max(0,n.length-r-1));return n.slice(o).join("/")}function m(e){const{segmentTiming:{parsedPlaybackTime:t,parsedDuration:n}}=e;return{start:t,end:t+n}}function g(e,t){if(void 0===t)return;const n=t.segmentTiming.parsedPlaybackTime,r=e.segmentTiming.parsedPlaybackTime+e.segmentTiming.parsedDuration;return n!==r?{start:r,end:n}:void 0}t.createSelfInitSegmentAtom=f,t.getReadableSegmentName=l,t.getTimeRange=m,t.getGapToNextSegment=g},9452:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSegmentDataAtom=t.ContainerFormat=void 0,function(e){e.MP4="mp4",e.TS="mp2t",e.WebM="webm",e.Unknown="unknown"}(t.ContainerFormat||(t.ContainerFormat={}));const n=(e,t)=>e.effects.state.create(t,{});t.createSegmentDataAtom=n},151:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSegmentTiming=t.getDefaultSegmentTiming=void 0;const n=e=>Object.assign({parsedDuration:-1,parsedPlaybackTime:-1,encodedDuration:-1,encodedPlaybackTime:-1,timestampOffset:-1/0},e);function r(e,t,n){return(e.parsedDuration!==t||e.parsedPlaybackTime!==n)&&(e.parsedDuration=t,e.parsedPlaybackTime=n,!0)}function o(e,t,n){return(e.encodedDuration!==t||e.encodedPlaybackTime!==n)&&(e.encodedDuration=t,e.encodedPlaybackTime=n,!0)}function a(e,t){return e.timestampOffset!==t&&(e.timestampOffset=t,!0)}function i(e,n){return e.effects.state.create((0,t.getDefaultSegmentTiming)(n),{manifestParsed:r,dataParsed:o,timestampOffsetChanged:a})}t.getDefaultSegmentTiming=n,t.createSegmentTiming=i},1093:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isInitSegment=t.isDataSegment=t.isDataOrSelfInitSegment=void 0;const r=n(7041);function o(e){return[r.SegmentType.Data,r.SegmentType.SelfInitializing].includes(e.type)}function a(e){return[r.SegmentType.Data].includes(e.type)}function i(e){return e.type===r.SegmentType.Initialization}t.isDataOrSelfInitSegment=o,t.isDataSegment=a,t.isInitSegment=i},8331:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentUtils=void 0;const r=n(7041);function o(e){const t=e[0],n=(0,r.getTimeRange)(t);return e.every((e=>{const{start:t,end:o}=(0,r.getTimeRange)(e);return!(o<n.start||t>n.end)&&n.start!==o&&n.end!==t}))}function a(e,{effects:{state:t}},n){n.log(`Clearing data for ${e.url}`),t.dispatch(e.data.clear)}t.SegmentUtils={areSegmentsOverlapping:o,resetData:a}},5783:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createUnknownSelectionGroupAtom=t.createSubtitleSelectionGroupAtom=t.createAudioSelectionGroupAtom=t.createVideoSelectionGroupAtom=void 0;const r=n(9062),o=n(8992),a=(e,t,n,r)=>(0,o.addCodecs)(e,t.codecs,n,r),i=(e,t)=>e.language!==t&&(e.language=t,!0),s=(e,t)=>e.sequenceNumber!==t&&(e.sequenceNumber=t,!0);function c(e){return{setSequenceNumber:s,setCodecs:a.bind(void 0,e)}}const u=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),o=Object.assign(Object.assign({sequenceNumber:1/0},t),{mediaId:`${n.Video}:TODO-FIX-ME`});return p(e,o),e.effects.state.create(o,c(e))};function d(e){return{setCodecs:a.bind(void 0,e),setLanguage:i,setSequenceNumber:s}}t.createVideoSelectionGroupAtom=u;const f=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),o=Object.assign(Object.assign({sequenceNumber:1/0},t),{mediaId:`${n.Audio}:${t.language}:TODO-FIX-ME`});return p(e,o),e.effects.state.create(o,d(e))};t.createAudioSelectionGroupAtom=f;const l={setSequenceNumber:s,setLanguage:i},m=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),o=Object.assign(Object.assign({sequenceNumber:1/0},t),{mediaId:`${n.Subtitle}:${t.language}`});return p(e,o),e.effects.state.create(o,l)};t.createSubtitleSelectionGroupAtom=m;const g={setSequenceNumber:s},h=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),o=Object.assign(Object.assign({sequenceNumber:1/0},t),{mediaId:`${n.Unknown}`});return p(e,o),e.effects.state.create(o,g)};function p(e,t){const{deriveFrom:n}=e.registry.get(r.ComponentName.Utils).State;n(t,"timeRange",(()=>{const e={start:1/0,end:-1/0};for(const n of t.tracks){const{start:t,end:r}=n.timeRange;(t<e.start||!isFinite(e.start))&&(e.start=t),(r>e.end||!isFinite(e.end))&&(e.end=r)}return e}))}t.createUnknownSelectionGroupAtom=h},4528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isMediaSelectionGroup=t.isAudioSelectionGroup=t.isVideoSelectionGroup=void 0;const r=n(5185);function o(e,t){const n=e.codecs;for(const[e,r]of n)if(e===t)return!0;return!1}function a(e){return s(e)&&o(e,r.MediaType.Video)}function i(e){return s(e)&&o(e,r.MediaType.Audio)}function s(e){return"codecs"in e}t.isVideoSelectionGroup=a,t.isAudioSelectionGroup=i,t.isMediaSelectionGroup=s},4033:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionGroupUtils=void 0;const r=n(5185),o=n(4528);function a(e){if((0,o.isAudioSelectionGroup)(e))return r.MediaType.Audio;if((0,o.isVideoSelectionGroup)(e))return r.MediaType.Video;throw new Error(`Unsupported SelectionGroup ${e.mediaId}`)}t.SelectionGroupUtils={getMediaType:a}},253:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StateEffectFactory=t.UnsubscribedError=void 0;const r=n(8508),o=n(2955),a=n(4686);class i extends Error{constructor(){super("Thread aborted by unsubscribe"),this.name="UnsubscribedError"}}t.UnsubscribedError=i;const s=new WeakMap,c=new WeakMap;function u(e,t){const n=e,r=Object.keys(t);return n[a.StateAtomIdentifier]=10,r.forEach((e=>{const r=(...r)=>t[e].call(n,n,...r);r[a.ModifierIdentifier]=n,n[e]=r})),n}function d(){}function f(e,t,n){return e.has(t)}function l(e,t,n){const r=e.get(t);return f(e,t,r)?r:(e.set(t,n),n)}function m(e,t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}function g(e){e.abort(new i)}function h(e,t,n,r,o){const a=(i=!0)=>{if(m(r,n),m(o,a),!i)return;const s=l(c,e,new WeakMap),u=l(s,t,[]);u.forEach(g),u.splice(0,u.length)};return a}function p(e,t,n,r,o){const a=[t,r,e=>o(e)||e instanceof i],c=l(s,n,[]),u=h(n,r,a,c,e);return e.push(u),c.push(a),u}function v(e,...t){var n;const r=e[a.ModifierIdentifier];if(!e(...t))return;(null!==(n=s.get(r))&&void 0!==n?n:[]).forEach((([e,t,n])=>{const o=l(c,r,new WeakMap),a=l(o,t,[]),i=e.fork(t,r,n);a.forEach(g),a.splice(0,a.length,i),i.finally((()=>m(a,i))).catch(d)}))}function b(e,t){const n=null==e?void 0:e.abortSignal,r=()=>null==n?void 0:n.removeEventListener("abort",a);if(void 0===n)return()=>{};if(n.aborted)throw t(),new o.ThreadDisposedError("Attempted to add StateEffect on already disposed thread");const a=()=>{r(),t()};return n.addEventListener("abort",a),r}t.StateEffectFactory=(0,r.createEffectFactory)((e=>{const t=[];let n=()=>{};const r=()=>{t.slice().forEach((e=>e())),t.splice(0,t.length),n()};n=b(e,r);const o={UnsubscribedError:i,create:u,subscribe:(e,n,r,o=(()=>!1))=>p(t,e,n,r,o),dispatch:v};return{effect:{state:o},removeEffect:r}}))},367:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createStreamSectionAtom=void 0;const r=n(9062),o=n(780),a=e=>{const t={streamSequenceMap:(0,o.createStreamSequenceMapAtom)(e)};return s(e,t),c(e,t),e.effects.state.create(t,{})};function i(e,t){const n=t.segmentTiming.parsedPlaybackTime;return{start:n,end:n+t.segmentTiming.parsedDuration}}function s(e,t){const{deriveFrom:n}=e.registry.get(r.ComponentName.Utils).State;n(t,"timeRange",(()=>{const n={start:1/0,end:-1/0};for(const[r,o]of t.streamSequenceMap){if(0===o.length)continue;const t=i(e,o[0]).start,r=i(e,o[o.length-1]).end;n.start=isFinite(n.start)?Math.min(n.start,t):t,n.end=isFinite(n.end)?Math.max(n.end,r):r}return n}))}function c(e,t){const{deriveFrom:n}=e.registry.get(r.ComponentName.Utils).State;n(t,"sequenceNumber",(()=>{const e=t.streamSequenceMap.keys().next();return e.done?-1:e.value.sequenceNumber}))}t.createStreamSectionAtom=a},780:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createStreamSequenceMapAtom=void 0;const r=n(99),o=e=>(0,r.createMapStateAtom)(e);t.createStreamSequenceMapAtom=o},9286:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createStreamTimelineAtom=void 0;const r=n(605),o=e=>(0,r.createArrayAtom)(e,[]);t.createStreamTimelineAtom=o},2161:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createStreamAtom=t.StreamType=void 0;const r=n(4),o=n(605),a=n(5054),{createTransient:i}=r.default;function s(e,t){return e.type!==t&&(e.type=t,!0)}!function(e){e.Live="live",e.VoD="vod"}(t.StreamType||(t.StreamType={}));const c=(e,t)=>e.effects.state.create({tracks:(0,o.createArrayAtom)(e,[]),selectionGroups:(0,o.createArrayAtom)(e,[]),type:t,duration:(0,a.createPrimitiveAtom)(e,1/0),onPlaybackTimeMismatch:i(e),onDurationMismatch:i(e)},{setType:s});t.createStreamAtom=c},7831:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createUnknownTrackAtom=t.createSubtitleTrackAtom=t.createMuxedTrackAtom=t.createVideoTrackAtom=t.createAudioTrackAtom=void 0;const r=n(9062),o=n(605),a=n(8992),i=n(1093),s=(e,t)=>e.segments!==t&&(e.segments=t,!0),c=(e,t,n,r)=>(0,a.addCodecs)(e,t.codecs,n,r),u=(e,t)=>e.sequenceNumber!==t&&(e.sequenceNumber=t,!0),d=({effects:{state:e}},t,n)=>{if(t.selectionGroup===n)return!1;for(const r of"segments"in t?t.segments:[])e.dispatch(r.setSelectionGroup,n),(0,i.isDataSegment)(r)&&r.initSegment.selectionGroup!==n&&e.dispatch(r.initSegment.setSelectionGroup,n);return t.selectionGroup=n,!0};function f(e){return{setSegments:s,setSequenceNumber:u,setSelectionGroup:(t,n)=>d(e,t,n)}}function l(e){return Object.assign(Object.assign({},f(e)),{setCodecs:c.bind(void 0,e)})}const m=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),a=Object.assign({segments:(0,o.createArrayAtom)(e,[]),sequenceNumber:1/0,type:n.Audio},t);return b(e,a),e.effects.state.create(a,l(e))};t.createAudioTrackAtom=m;const g=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),a=Object.assign({segments:(0,o.createArrayAtom)(e,[]),sequenceNumber:1/0,type:n.Video},t);return b(e,a),e.effects.state.create(a,l(e))};t.createVideoTrackAtom=g;const h=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),a=Object.assign({segments:(0,o.createArrayAtom)(e,[]),sequenceNumber:1/0,type:n.Muxed},t);return b(e,a),e.effects.state.create(a,l(e))};t.createMuxedTrackAtom=h;const p=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),a=Object.assign({segments:(0,o.createArrayAtom)(e,[]),sequenceNumber:1/0,type:n.Subtitle},t);return b(e,a),e.effects.state.create(a,f(e))};t.createSubtitleTrackAtom=p;const v=(e,t)=>{const{MediaType:n}=e.registry.get(r.ComponentName.Constants),a=Object.assign({segments:(0,o.createArrayAtom)(e,[]),sequenceNumber:1/0,type:n.Unknown},t);return b(e,a),e.effects.state.create(a,f(e))};function b(e,t){const{deriveFrom:n}=e.registry.get(r.ComponentName.Utils).State;n(t,"timeRange",(()=>{var e,n,r;if(t.sequenceNumber===1/0)return{start:-1/0,end:1/0};const o=null===(e=t.segments[0])||void 0===e?void 0:e.segmentTiming,a=null===(n=t.segments[t.segments.length-1])||void 0===n?void 0:n.segmentTiming;return{start:null!==(r=null==o?void 0:o.parsedPlaybackTime)&&void 0!==r?r:1/0,end:a?a.parsedPlaybackTime+a.parsedDuration:-1/0}}))}t.createUnknownTrackAtom=v},3219:(e,t)=>{function n(e){return"audio"===e.type}function r(e){return n(e)||a(e)}function o(e){return"subtitle"===e.type}function a(e){return"video"===e.type}function i(e){return"muxed"===e.type}Object.defineProperty(t,"__esModule",{value:!0}),t.isMuxedTrack=t.isVideoTrack=t.isSubtitleTrack=t.isMediaTrack=t.isAudioTrack=void 0,t.isAudioTrack=n,t.isMediaTrack=r,t.isSubtitleTrack=o,t.isVideoTrack=a,t.isMuxedTrack=i},3987:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))},r=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,a){o(r,a,(t=e[n](t)).done,t.value)}))}}function o(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}};function o(e,t,n){if(0===e.length)return-1;let r=e.length-1,o=0;for(;o<=r;){const a=Math.floor((r+o)/2),i=n(e[a]);if(i>t)r=a-1;else{if(!(i<t))return a;o=a+1}}return-1}function*a(e,t=0){const n=t;let r=1;for(yield n;;){const t=n+r>=e;if(t&&t)return;n-r<0||(yield n-r),t||(yield n+r),r++}}function i(e,t,n,r,o){if(t<0)return-1;const a=[...t-1>=0?[-1]:[],...t+1<e.length?[1]:[]];for(;a.length>0;){const i=a.splice(0,a.length);for(const s of i){const i=t+s,c=e[i];if(r(c)===n){if(o(c))return i;a.push(s+Math.sign(s))}}}return-1}Object.defineProperty(t,"__esModule",{value:!0});class s extends Error{constructor(){super("The IterableStream has already closed"),this.name="IterableStreamClosedError"}}function c(e){var t,o,a,i,s,c,u;return n(this,void 0,void 0,(function*(){const n=[];try{for(t=!0,o=r(e);a=yield o.next(),!(i=a.done);){u=a.value,t=!1;try{const e=u;n.push(e)}finally{t=!0}}}catch(e){s={error:e}}finally{try{t||i||!(c=o.return)||(yield c.call(o))}finally{if(s)throw s.error}}return n}))}function u(e,t){return e.length===t.length&&e.every((e=>t.includes(e)))}function d(e,t,n){let r=0,o=e.length;for(;r<o;){const a=r+o>>>1;n(e[a])<n(t)?r=a+1:o=a}return r}function f(e,t,...n){const r=e.length;if(0===n.length)return!1;if(0===e.length)return e.push(...n.sort(((e,n)=>t(e)-t(n)))),!0;for(const r of n){const n=t(r),o=t(e[0]);if(t(e[e.length-1])<=n)e.push(r);else if(n<=o)e.unshift(r);else{const n=d(e,r,t);e.splice(n,0,r)}}return e.length!==r}t.default={Sorted:{findIndex:o,findIndexWithPivot:i,insertSorted:f,sortedIndex:d},AlternatingIndexGenerator:a,IterableStreamClosedError:s,readToEnd:c,equals:u}},1833:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=n(9062),o=n(5185),a=n(8992),i=new RegExp("^avc1.[0-9]{2,3}.[0-9]{2,3}$"),s={video:["avc","hvc","hev","mp4v","svc","mvc","av1","av01","vp8","vp9","dvh1","dvhe","dvav","dva1"],audio:["mp4a","mp3","opus","vorbis","speex","flac","samr","ac-3","ec-3","ac-4","ec-4"],application:["stpp","wvtt"]};function c(e){return i.test(e)}function u(e){const[t,n,r]=e.split(".");return t&&n&&r?`${t}.${parseInt(n).toString(16)}${parseInt(r).toString(16).toString().padStart(4,"0")}`:e}function d(e){const t={};return e.forEach((e=>{e.split(",").forEach((e=>{var n;const r=m(e),o=e.trim(),a=null!==(n=t[r])&&void 0!==n?n:t[r]=[];a.includes(o)||a.push(o)}))})),t}function f(e,t){var n;const{state:r}=e.effects,o=(0,a.createCodecMapAtom)(e);for(const a of t.split(",")){const t=a.trim();if(0===t.length)continue;const i=l(e,t),s=[...null!==(n=o.get(i))&&void 0!==n?n:[]];s.push(t),r.dispatch(o.add,i,[...s])}return o}function l(e,t){const{MediaType:n}=e.registry.get(r.ComponentName.Constants);switch(m(t)){case"audio":return n.Audio;case"video":return n.Video;default:return n.Unknown}}function m(e){if(!e)return"unknown";const t=["video","audio","application"];for(let n=0;n<t.length;n++)if(s[t[n]].find((t=>e.indexOf(t)>-1)))return t[n];return"unknown"}function g(e,t){if(e===t)return!0;return[["mp4a.40.2","mp4a.40.5"],["ac-3","mp4a.a5","mp4a.A5"],["ec-3","mp4a.a6","mp4a.A6"]].some((n=>n.includes(e)&&n.includes(t)))}function h(e){if(e)return e.split(".")[0]}function p(e){return"video"===m(e)}function v(e){return"audio"===m(e)}function b(e){return"application"===m(e)}function y(e){return p(e)?o.MediaType.Video:v(e)?o.MediaType.Audio:b(e)?o.MediaType.Subtitle:void 0}function S(e){return[o.MediaType.Video,o.MediaType.Audio].includes(e)}function A(e){return o.MediaTypeValues.includes(e)}t.default={hasOldAvc1CodecFormat:c,convertAvc1ToAvcotiCodecFormat:u,extractCodecStrings:d,extractCodecMap:f,canSwitchBetweenAudioCodecs:g,extractCodec:h,getMediaTypeFromCodec:y,isAvMediaType:S,isMediaType:A}},8694:(e,t)=>{function n(e){return e instanceof Error?e:new Error(e?String(e):void 0)}Object.defineProperty(t,"__esModule",{value:!0}),t.default={formatError:n}},8621:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.LogLevel=void 0,function(e){e[e.Off=0]="Off",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Log=3]="Log",e[e.Debug=4]="Debug",e[e.Verbose=5]="Verbose"}(n=t.LogLevel||(t.LogLevel={}));class r{constructor(){this.noop=()=>{},this.logLevel=n.Off,this.verboseFn=this.debugFn=this.logFn=this.warnFn=this.errorFn=this.noop,this.setLevel(n.Verbose)}get verbose(){return this.verboseFn}get debug(){return this.debugFn}get log(){return this.logFn}get warn(){return this.warnFn}get error(){return this.errorFn}get level(){return this.logLevel}setLevel(e){this.logLevel=e,this.errorFn=e>=n.Error?console.error.bind(console):this.noop,this.warnFn=e>=n.Warn?console.warn.bind(console):this.noop,this.logFn=e>=n.Log?console.log.bind(console):this.noop,this.debugFn=e>=n.Debug?console.info.bind(console):this.noop,this.verboseFn=e>=n.Verbose?console.debug.bind(console):this.noop}}t.Logger=r},1412:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MultiRange=void 0;class n{constructor(e,t,n){this.rangeStart=e,this.rangeEnd=t,this.rangeHits=n||1}get hits(){return this.rangeHits}get start(){return this.rangeStart}get end(){return this.rangeEnd}split(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r],a=o.rangeStart,i=o.rangeEnd,s=o.rangeHits,c=this.rangeStart<a&&this.rangeEnd>i,u=this.rangeStart<a&&this.rangeEnd>a&&this.rangeEnd<i,d=this.rangeStart>a&&this.rangeStart<i&&this.rangeEnd>i,f=this.rangeStart>a&&this.rangeEnd<i,l=this.rangeStart===a&&this.rangeEnd<i,m=this.rangeStart===a&&this.rangeEnd>i,g=this.rangeStart<a&&this.rangeEnd===i,h=this.rangeStart>a&&this.rangeEnd===i,p=this.rangeStart===a&&this.rangeEnd===i;c||m||g||p?t.push(new n(a,i,s+1)):u||l?(t.push(new n(a,this.rangeEnd,s+1)),t.push(new n(this.rangeEnd,i,s))):d||h?(t.push(new n(a,this.rangeStart,s)),t.push(new n(this.rangeStart,i,s+1))):f?(t.push(new n(a,this.rangeStart,s)),t.push(new n(this.rangeStart,this.rangeEnd,s+1)),t.push(new n(this.rangeEnd,i,s))):t.push(new n(a,i,s))}return t}merge(e){for(let t=0;t<e.length&&!(this.rangeEnd-this.rangeStart<=0);t++){const r=e[t];let o=null;if(t+1<e.length&&(o=e[t+1]),this.rangeStart<r.rangeStart){e.unshift(new n(this.rangeStart,Math.min(r.rangeStart,this.rangeEnd))),t++,this.rangeStart=r.rangeEnd;const o=Math.max(this.rangeStart,r.end);t===e.length-1&&o<this.rangeEnd&&e.push(new n(o,this.rangeEnd))}else if(o&&o.rangeStart>this.rangeStart){const a=Math.max(r.rangeEnd,this.rangeStart),i=Math.min(this.rangeEnd,o.rangeStart);i>a&&(e.splice(t+1,0,new n(a,i)),t++),this.rangeStart=o.rangeEnd}else null===o&&this.rangeEnd>r.rangeEnd&&(e.push(new n(Math.max(r.rangeEnd,this.rangeStart),this.rangeEnd)),this.rangeStart=this.rangeEnd)}return e}intersect(e){if(0===e.length)return[this];{const t=this.split(e);return this.merge(t)}}}t.MultiRange=n},7422:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=n(1412);function o(e){if(e.length<1)return e;e.sort(((e,t)=>e.start-t.start));const t=[];t.push(Object.assign({},e[0]));for(let n=1;n<e.length;n++){const r=t.slice(-1)[0],o=e[n];if(a(o,r))continue;const i=r.end>=o.start,s=r.end<=o.end;i&&s?t[t.length-1].end=o.end:t.push(Object.assign({},o))}return t}function a(e,t){return t.start<=e.start&&t.end>=e.end}function i(e,t){return e>t.start&&e<=t.end}function s(e,t){return e<t.end&&e>=t.start}function c(e,t){return e.filter((e=>!a(e,t))).reduce(((e,n)=>{const r=i(t.start,n),o=s(t.end,n);return r&&e.push(Object.assign(Object.assign({},n),{end:t.start})),o&&e.push(Object.assign(Object.assign({},n),{start:t.end})),r||o||e.push(Object.assign({},n)),e}),[])}function u(e){let t=[],n=0;for(const o in e){const a=e[o];n++;for(let e=0;e<a.length;e++)t=new r.MultiRange(a[e].start,a[e].end).intersect(t)}return[t,n]}function d(e){const t=[],[n,r]=u(e);for(const e in n)n[e].hits<r||t.push({start:n[e].start,end:n[e].end});return t}function f(e,t){const{start:n,end:r}=e,{start:o,end:a}=t;return n>=o&&n<a||r>o&&r<=a||o>=n&&o<r||a>n&&a<=r}t.default={mergeRanges:o,subtractRanges:c,getCommonRanges:d,isStartInRange:i,isEndInRange:s,overlaps:f,isFullyIncluded:a}},4:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(i,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const o=n(8465),a=n(9062);class i extends Error{constructor(){super("Aborted from map-subscribe"),this.name="MapUnsubscribedError"}}const s=(e,t,n)=>(0,o.createTask)(`map-subscribe-${n.name}`,((r,o)=>{var a;const s=Array.from(t.keys()),c=s.filter((e=>!r.includes(e))),u=r.filter((e=>!s.includes(e)));for(const e of c)null===(a=t.get(e))||void 0===a||a.abort(new i),t.delete(e);for(const r of u){const o=e.fork(n,r);t.set(r,o),o.finally((()=>t.delete(r))).catch((()=>{}))}}));function c(e,t,n){const r=new Map,o=s(e,r,n),a=e.effects.state.subscribe(e,t,o,(e=>e instanceof i));return()=>{a();for(const[e,t]of r)t.abort(new i)}}function u(e,t){const n=[],a=[];let i=!1;const s=(0,o.createTask)("sequence-task",t);function c(){return r(this,void 0,void 0,(function*(){if(i)return;const t=n.shift();void 0!==t&&(i=!0,yield e.fork(s,t).catch((()=>{})),i=!1,a.push(t),c().catch((()=>{})))}))}return{addToQueue:e=>{a.includes(e)||n.includes(e)||(n.push(e),c().catch((()=>{})))}}}function d(e,t,n){Object.defineProperty(e,t,{get:()=>n(e)})}function f(e,t,n,a=(()=>!1)){let s;const c=e=>a(e)||e instanceof i,u=(0,o.createTask)(`subscribe-${n.name}-once`,((e,t)=>r(this,void 0,void 0,(function*(){t.fork(n,e,c),s(!1)}))));return s=e.effects.state.subscribe(e,t,u,c)}function l(e){const{state:t}=e.effects,n=(e,t)=>(e.value=t,!0);return t.create({value:void 0},{trigger:n})}function m(e,t){let n=()=>{};const{abortable:r}=e.effects,{subscribeOnce:i}=e.registry.get(a.ComponentName.Utils).State,s=r((e=>n=e)),c=(0,o.createTask)("wait-for-transient",(({value:e},t)=>n(e)));return s.unsubscribe=i(e,t,c),s}t.default={mapSubscribe:c,subscribeOnce:f,waitFor:m,deriveFrom:d,createTransient:l,sequencererere:u}},8900:(e,t)=>{function n(){const e=16,t=Math.pow(1048576,3),n=1;return Date.now().toString(e)+Math.floor((n+Math.random())*t).toString(e)}Object.defineProperty(t,"__esModule",{value:!0});const r=function*(){let e=0;for(;;){e+=1;const t=Date.now().toString(16).padStart(14,"0"),n=e.toString(16).padStart(14,"0");yield`cafe${t.substring(0,4)}-${t.substring(4,8)}-${t.substring(8,12)}-${t.substring(12,14)}${n.substring(0,2)}-${n.substring(2)}`}}();function o(){return r.next().value}function a(e){return e.split("-").map(((e,t)=>0===t?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join("")}function i(e){return e?(" "+e).slice(1):""}function s(e){let t=e.length;1&t&&(e="0"+e,t++);const n=new Uint8Array(t>>1);for(let r=0;r<t;r+=2)n[r>>1]=parseInt(e.substr(r,2),16);return n}t.default={generateId:n,generateUuid:o,kebabCaseToCamelCase:a,forceReallocation:i,hexStringToUint8Array:s}},4233:(e,t)=>{function n(...e){const t=e.reduce(((e,t)=>t.byteLength+e),0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.byteLength;return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default={merge:n}},2648:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=new RegExp("^(?:[a-z]+:)?//","i");function r(e,t,n){return a(n)?n:i(n)?t+n:e+n}function o(e){let t=s(e);for(;"/"!==e[t]&&t<e.length;)t++;return e.substring(0,t)}function a(e){return!!e&&n.test(e)}function i(e){return!!(e&&e.length>0)&&"/"===e[0]}function s(e){const t="://",n=e.indexOf(t);return n>-1?n+t.length:-1===n&&0===e.indexOf("//")?2:0}function c(e){return e.indexOf("?")>-1&&(e=e.split("?")[0]),e}function u(e){const t=s(e=c(e));let n=e.lastIndexOf("/");return n===e.length-1&&(e=e.substring(0,n)),n=e.lastIndexOf("/"),n<0?"":n<=t?e+"/":e.substring(0,n+1)}function d(e,t){let n="/";return!e||e.length<1||a(t)?t:!t||t.length<1?e:((e=c(e)).indexOf("/")>-1&&(e=e.substring(0,e.lastIndexOf("/"))),"/"===t[0]&&(e=o(e),n=""),e+n+t)}function f(e,t){let n=e;return n=c(n),!(t=u(t))||t.indexOf("/")<0?e:d(n,t)}t.default={removeUrlParameters:c,removeLastPathPart:u,concatUrlParts:d,getDomainUrl:o,buildAbsoluteUrl:r,getBaseUrl:f}},1777:(e,t,n)=>{function r(){const e=["zgvMAw5LuhjVCgvYDhK","tgLJzw5ZAw5NtgvNywn5u3nSqMfJA2vUzejHC2vvCMW","mti3lJaUmc4X","vgL6zw5gywXSyMfJA1vYBa","Bg9JywXOB3n0","x19LC01VzhvSzq","r3jHBNrLzfjLC3bVBNnL","tgLJzw5ZzunHBgXtDgf0Dxm","Ahr0Chm6lY9SAwnLBNnPBMCTBgvNywn5lxnZBc1JB21WyxqUyML0Bw92Aw4Uy29T","nJn6u3r0qLu","mJaWmJb6y0X5CvC","mZy3nJi0DM1bB2jb","ndy2mKTMCerVCW","mJy1nZq4AfvTuM1s","mte3mtfpr0XwB3G","mJbbDKH4ze0","r3jHBNrLza","l2XPy2vUC2LUzW","odyYmgjZrK1UDG","ndKWBKjUruX1","ntq3mZe2ner2q2HUDG","sg9ZDg5HBwvZvg9tA2LW","twf4tgLJzw5ZzunHBgXezwXHEu1Z","mZCZmNPZqwLquW","mZiYmdKZAgnXs2r0"];return(r=function(){return e})()}const o=a;function a(e,t){const n=r();return a=function(t,r){let o=n[t-=130];if(void 0===a.giBKSc){var i=function(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=";let n="",r="";for(let r,o,a=0,i=0;o=e.charAt(i++);~o&&(r=a%4?64*r+o:o,a++%4)?n+=String.fromCharCode(255&r>>(-2*a&6)):0)o=t.indexOf(o);for(let e=0,t=n.length;e<t;e++)r+="%"+("00"+n.charCodeAt(e).toString(16)).slice(-2);return decodeURIComponent(r)};a.FtNNZj=i,e=arguments,a.giBKSc=!0}const s=t+n[0],c=e[s];return c?o=c:(o=a.FtNNZj(o),e[s]=o),o},a(e,t)}!function(e,t){const n=a,r=e();for(;;)try{if(parseInt(n(135))/1+parseInt(n(130))/2*(-parseInt(n(134))/3)+-parseInt(n(149))/4*(parseInt(n(151))/5)+-parseInt(n(148))/6*(parseInt(n(150))/7)+-parseInt(n(147))/8*(-parseInt(n(145))/9)+-parseInt(n(154))/10*(-parseInt(n(146))/11)+parseInt(n(131))/12===t)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(r,798252),Object[o(136)](t,o(141),{value:!0}),t[o(142)]=t[o(133)]=t[o(139)]=t[o(137)]=t[o(132)]=void 0;const i=n(552);t[o(132)]=[o(140),o(138)],t[o(137)]=o(144),t[o(139)]=t[o(137)]+o(153),t[o(133)]=3e4,t[o(142)]={status:i[o(143)][o(152)]}},1008:function(e,t,n){const r=v;!function(e,t){const n=v,r=e();for(;;)try{if(-parseInt(n(515))/1*(parseInt(n(495))/2)+parseInt(n(505))/3+parseInt(n(465))/4*(parseInt(n(480))/5)+parseInt(n(493))/6*(-parseInt(n(463))/7)+-parseInt(n(500))/8*(-parseInt(n(498))/9)+-parseInt(n(517))/10*(parseInt(n(474))/11)+-parseInt(n(496))/12*(parseInt(n(475))/13)===t)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(f,596286);var o=this&&this[r(504)]||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){const i=v;function s(e){const t=v;try{u(r[t(503)](e))}catch(e){a(e)}}function c(e){const t=v;try{u(r[t(478)](e))}catch(e){a(e)}}function u(e){const t=v;e[t(507)]?n(e[t(460)]):o(e[t(460)])[t(518)](s,c)}u((r=r[i(508)](e,t||[]))[i(503)]())}))};Object[r(461)](t,r(509),{value:!0}),t[r(512)]=void 0;const a=n(8465),i=n(9062),s=n(1777),c=n(552);class u extends Error{constructor(e){const t=v;super(e),this[t(510)]=t(464)}}function d(e){const t=v;if(void 0===e)return new u(t(483));if(e[t(502)]&&e[t(502)][t(499)](t(476)))return new u(e[t(502)]);if(void 0!==e[t(479)]){const n=[];for(const{key:r,errorMessage:o}of e[t(479)])n[t(462)](r+": "+o);return new u(n[t(458)](t(485)))}return e[t(502)]?new u(e[t(502)]):new u(t(469))}function f(){const e=["q291BgqGBM90ihbHCNnLihjLC3bVBNnLoIbIB2r5igLZigLUDMfSAwq","mJC4ntCZmfPvDgP6Dq","DgHLBG","C3rYAw5N","ugXHEwvYq29UzMLN","AM9PBG","Ahr0Chm6lY9SAwnLBNnPBMCUyML0Bw92Aw4Uy29Tl2XPy2vUC2LUzW","DMfSDwu","zgvMAw5LuhjVCgvYDhK","ChvZAa","mtKYnuDit3HItW","tgLJzw5ZAw5NrxjYB3i","nZCYmdr2tu1ryMS","uMvXDwvZDcbMywLSzwqGD2L0Aca","Ag9ZDg5HBwu","BgLJzw5Zzs1Yzxf1zxn0","qw4GDw5RBM93BIbSAwnLBNnLigvYCM9YigHHCYbVy2n1CNjLza","r3jHBNrLzfjLC3bVBNnL","ue9tva","CMvNAxn0CNK","C3rHDhvZ","mZnky1vhsgO","mZG4n3fpzufQDa","ww91CIbWBgf5zxiGAxmGBM90igfSBg93zwqGDg8GCgXHEsbVBIb0AguGzg9TywLU","y3jLyxrLvgfZAW","DgHYB3C","DMfSAwrHDgLVBKLUzM9YBwf0Aw9U","mZa1ywvKvwTq","ANnVBG","q291BgqGBM90ihbHCNnLihjLC3bVBNnLoIbIB2r5igLZig5VDcbHiePtt04GB2jQzwn0","tM8GBgLJzw5ZzsbPBMzVCM1HDgLVBIb3yxmGCMv0DxjUzwqGzNjVBsb0AguGC2vYDMvY","mtaUmc4WlwjLDgeUW6y","pc9ICJ4","q29TCg9Uzw50tMfTzq","B21PDa","tg9Nz2vY","tgLJzw5ZzunHBgXtDgf0Dxm","C3rYAw5NAwz5","DMfSDwvZ","tMv0D29YA1rHC2S","nZm4mhjMEMzhyW","z2v0","mtG3nJK4nM5hBhfMAG","mti1mtzNze5AtLe","rMfPBgvKihrVihnLBMqGBgLJzw5ZzsbYzxf1zxn0oG","ouTxqwHMuq","Aw5JBhvKzxm","ntGYmJy5nNzoywzisW","zM9YAW","BwvZC2fNzq","BMv4Da","x19HD2fPDgvY","mZm0nJiYmwTpswvxuG","B2jQzwn0","zg9Uzq","yxbWBhK","x19LC01VzhvSzq","BMfTzq","r3jHBNrLza","tgLJzw5ZzvjLCxvLC3ruyxnR","Bg9N","sg9ZDg5HBwvZvg9tA2LW","mwnvAuvptW"];return(f=function(){return e})()}function l(){const e=v;return s[e(514)][e(499)](location[e(467)])}function m(e){const t=v,{key:n}=e[t(472)][t(494)](i[t(486)][t(520)]);return JSON[t(490)]({key:n,domain:location[t(467)],version:t(484),customData:void 0})}function g(e){const t=v;return{body:m(e),url:t(459),method:t(471),numRetries:3,headers:{},responseType:t(481),credentials:t(487),retryDelay:0,requestTimeout:2e4,disableRetriesForResponseStatus:[]}}function h(e){const t=v,n=Object[t(491)](c[t(489)]);return t(473)in e&&typeof e[t(473)]===t(519)&&n[t(499)](e[t(473)])}function p({body:e,status:t}){const n=v;if(t<200||t>=300)throw new Error(n(466)+t);if(typeof e!==n(506))throw new Error(n(482));if(!h(e))throw new Error(n(516));return e}function v(e,t){const n=f();return v=function(t,r){let o=n[t-=458];if(void 0===v.zbRPUR){var a=function(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=";let n="",r="";for(let r,o,a=0,i=0;o=e.charAt(i++);~o&&(r=a%4?64*r+o:o,a++%4)?n+=String.fromCharCode(255&r>>(-2*a&6)):0)o=t.indexOf(o);for(let e=0,t=n.length;e<t;e++)r+="%"+("00"+n.charCodeAt(e).toString(16)).slice(-2);return decodeURIComponent(r)};v.VtAVAN=a,e=arguments,v.zbRPUR=!0}const i=t+n[0],s=e[i];return s?o=s:(o=v.VtAVAN(o),e[i]=o),o},v(e,t)}function b(e){return o(this,void 0,void 0,(function*(){const t=v,n=e[t(472)][t(494)](i[t(486)][t(492)]),r=e[t(472)][t(494)](i[t(486)][t(488)]),o=g(e);if(l())return s[t(470)];try{return p(yield e[t(501)](n,[o,void 0],(()=>!0)))}catch(e){return r[t(513)](t(497),e),s[t(470)]}}))}t[r(512)]=(0,a[r(477)])(r(468),((e,t)=>o(void 0,void 0,void 0,(function*(){const e=v,n=yield b(t);if(n[e(473)]!==c[e(489)][e(511)])throw d(n)}))))},5234:function(e,t,n){const r=o;function o(e,t){const n=i();return o=function(t,r){let a=n[t-=464];if(void 0===o.Tikjaq){var i=function(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=";let n="",r="";for(let r,o,a=0,i=0;o=e.charAt(i++);~o&&(r=a%4?64*r+o:o,a++%4)?n+=String.fromCharCode(255&r>>(-2*a&6)):0)o=t.indexOf(o);for(let e=0,t=n.length;e<t;e++)r+="%"+("00"+n.charCodeAt(e).toString(16)).slice(-2);return decodeURIComponent(r)};o.jUmsKQ=i,e=arguments,o.Tikjaq=!0}const s=t+n[0],c=e[s];return c?a=c:(a=o.jUmsKQ(a),e[s]=a),a},o(e,t)}!function(e,t){const n=o,r=e();for(;;)try{if(parseInt(n(471))/1+parseInt(n(495))/2*(-parseInt(n(483))/3)+-parseInt(n(500))/4*(parseInt(n(494))/5)+-parseInt(n(464))/6*(parseInt(n(478))/7)+parseInt(n(474))/8*(-parseInt(n(497))/9)+parseInt(n(498))/10*(parseInt(n(484))/11)+parseInt(n(469))/12*(parseInt(n(490))/13)===t)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(i,212336);var a=this&&this[r(477)]||function(e,t,n,r){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){const s=o;function c(e){const t=o;try{d(r[t(466)](e))}catch(e){i(e)}}function u(e){const t=o;try{d(r[t(480)](e))}catch(e){i(e)}}function d(e){const t=o;e[t(486)]?n(e[t(496)]):a(e[t(496)])[t(470)](c,u)}d((r=r[s(491)](e,t||[]))[s(466)]())}))};function i(){const e=["zM9YAW","zgvMyxvSDa","nZC1mZmWng5RCNrpBG","yxbWBhK","tgLJzw5ZzvjLCxvLC3ruyxnR","z2v0","mtG5ntC5nxjHseHtrW","mtjNuwvqA0W","DMfSDwu","ntG1BvrPDhPM","mtuZmtaWAKfQDNLU","tg9Nz2vY","nhzzs05pva","mtaZmJe4C1PVu3zw","tMv0D29YA1rHC2S","BMv4Da","y3jLyxrLugfJA2fNzq","zgvMAw5LuhjVCgvYDhK","mJrQqMj6rM0","DgHLBG","mJyZmZzpA1PZAeu","BgLJzw5ZAw5NlxbHy2THz2u","q29TCg9Uzw50tMfTzq","mJuWnJrfvuLIDhq","CMvNAxn0CNK","x19LC01VzhvSzq","x19HD2fPDgvY","nZbiy2HLtM4","twv0CMLJCW","DgHYB3C","vxrPBhm","q29YzuvMzMvJDhm","mtq4otu2zwrJrfPW","mZnUC0fsD1y","ugXHEwvYq29UzMLN","zg9Uzq","DxnPBMC"];return(i=function(){return e})()}Object[r(468)](t,r(476),{value:!0});const s=n(3898),c=n(9062),u=n(1008),d=(0,s[r(467)])(r(472),((e,t)=>a(void 0,void 0,void 0,(function*(){const e=o,{StateEffectFactory:n,EventListenerEffectFactory:r}=t[e(475)][e(493)](c[e(473)][e(482)]),a=t[e(487)](n)[e(487)](r);yield a[e(488)](u[e(492)],void 0)}))),[c[r(473)][r(499)],c[r(473)][r(485)],c[r(473)][r(465)],c[r(473)][r(481)],c[r(473)][r(482)],c[r(473)][r(479)]]);t[r(489)]=d},552:(e,t)=>{var n=r;function r(e,t){var n=o();return r=function(t,o){var a=n[t-=429];if(void 0===r.tvfMHk){var i=function(e){for(var t,n,r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",o="",a="",i=0,s=0;n=e.charAt(s++);~n&&(t=i%4?64*t+n:n,i++%4)?o+=String.fromCharCode(255&t>>(-2*i&6)):0)n=r.indexOf(n);for(var c=0,u=o.length;c<u;c++)a+="%"+("00"+o.charCodeAt(c).toString(16)).slice(-2);return decodeURIComponent(a)};r.GqzLyY=i,e=arguments,r.tvfMHk=!0}var s=t+n[0],c=e[s];return c?a=c:(a=r.GqzLyY(a),e[s]=a),a},r(e,t)}function o(){var e=["mZeXmta5mgTVqLfAEa","ntiZrMzotuTm","ntq1odm1rKTQuvv6","zgvMAw5LuhjVCgvYDhK","mZiWyvvHv3vX","mtuZmdiZngrLugTryG","mtG3ndCWD3D0rgHp","z3jHBNrLza","rgvUAwvK","r3jHBNrLza","ntuZmdaZmhfTwvv4qW","mtz5zfnUv0i","tgLJzw5ZzunHBgXtDgf0Dxm","mtG3mZu3ogXAwhzTsW","zgvUAwvK","x19LC01VzhvSzq","mtvPqNvvDLK","mJu0mKXHv3fwyW"];return(o=function(){return e})()}!function(e,t){for(var n=r,o=e();;)try{if(-parseInt(n(429))/1*(parseInt(n(445))/2)+parseInt(n(430))/3*(parseInt(n(439))/4)+-parseInt(n(444))/5*(-parseInt(n(433))/6)+-parseInt(n(441))/7+-parseInt(n(432))/8*(parseInt(n(434))/9)+parseInt(n(446))/10+parseInt(n(438))/11===t)break;o.push(o.shift())}catch(e){o.push(o.shift())}}(o,541149),Object[n(431)](t,n(443),{value:!0}),t[n(440)]=void 0,function(e){var t=r;e[t(437)]=t(435),e[t(436)]=t(442)}(t[n(440)]||(t[n(440)]={}))},3984:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createBufferConfigAtom=void 0;const r=n(9062);function o(){return{forwardDuration:12,backwardDuration:6}}function a(e,t){const{MediaType:n}=e.registry.get(r.ComponentName.Constants);return Object.assign({[n.Video]:o(),[n.Audio]:o(),[n.Muxed]:o(),[n.Subtitle]:o(),[n.Thumbnail]:o(),[n.Unknown]:o()},t)}function i(e,t,n){return e[t].forwardDuration!==n&&(e[t].forwardDuration=n,!0)}function s(e,t,n){return e[t].backwardDuration!==n&&(e[t].backwardDuration=n,!0)}function c(e,t={}){return e.effects.state.create(a(e,t),{setForwardTargetLevel:i,setBackwardTargetLevel:s})}t.createBufferConfigAtom=c},5840:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createMediaTypeMapAtom=void 0;const r=n(9062);function o(e,...t){const{createMapStateAtom:n,createArrayAtom:o}=e.registry.get(r.ComponentName.CoreStateAtoms),a=n(e);for(const n of t)e.effects.state.dispatch(a.add,n,o(e));return a}t.createMediaTypeMapAtom=o},9414:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPlaybackAtom=t.PlaybackState=void 0;const r=n(9937);var o;function a(e){return{state:o.Initial,playhead:(0,r.createPlayheadAtom)(e)}}function i(e,t){return e.state!==t&&(e.state=t,!0)}function s(e){return e.effects.state.create(a(e),{setState:i})}!function(e){e.Initial="initial",e.CanPlay="can-play",e.Playing="can-play"}(o=t.PlaybackState||(t.PlaybackState={})),t.createPlaybackAtom=s},9937:(e,t)=>{function n(e,t){return Math.round(e*t)/t}function r(e,t){return e.precision!==t&&(e.precision=t,!0)}function o(e,t){const r=n(t,e.precision);return e.position!==r&&(e.position=r,!0)}function a(e){return Object.assign({position:-1,precision:1e3},e)}function i(e,t={}){return e.effects.state.create(a(t),{setPrecision:r,setPosition:o})}Object.defineProperty(t,"__esModule",{value:!0}),t.createPlayheadAtom=void 0,t.createPlayheadAtom=i},6614:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSourceStateAtom=void 0;const r=n(9062),o=n(605),a=n(3175),i=n(2161),s=n(8621),c=n(3984),u=n(5840),d=n(9414),f=n(1125),l=n(379);function m(e,t){const{MediaType:n}=e.registry.get(r.ComponentName.Constants);return{url:t,stream:(0,i.createStreamAtom)(e,i.StreamType.VoD),activeTracks:(0,o.createArrayAtom)(e,[]),activeSelectionGroups:(0,o.createArrayAtom)(e,[]),config:{buffer:(0,c.createBufferConfigAtom)(e),startup:(0,f.createStartupOptionsAtom)(e)},dataRanges:(0,a.createDataRangesAtom)(e),video:(0,l.createVideoElementAtom)(e),isActive:!1,logLevel:s.LogLevel.Log,playback:(0,d.createPlaybackAtom)(e),activeMediaTypes:(0,u.createMediaTypeMapAtom)(e,n.Audio,n.Video,n.Unknown)}}const g=(e,t)=>e.effects.state.create(m(e,t),{forceVideoElementUpdate:()=>!0,setLogLevel:(e,t)=>e.logLevel!==t&&(e.logLevel=t,!0),setActive(e,t){return e.isActive!==t&&(e.isActive=t,!0)}});t.createSourceStateAtom=g},1125:(e,t)=>{var n;function r(e,t){return e.position!==t&&(e.position=t,!0)}function o(e,t){return e.mode!==t&&(e.mode=t,!0)}function a(e){return Object.assign({position:-1,mode:n.Fast},e)}function i(e,t={}){return e.effects.state.create(a(t),{setPosition:r,setMode:o})}Object.defineProperty(t,"__esModule",{value:!0}),t.createStartupOptionsAtom=t.StartupMode=void 0,function(e){e.Fast="fast",e.Precise="precise"}(n=t.StartupMode||(t.StartupMode={})),t.createStartupOptionsAtom=i},379:(e,t)=>{function n(){return{element:void 0}}function r(e){return void 0!==e.element&&(e.element=void 0,!0)}function o(e,t){return e.element!==t&&(e.element=t,!0)}function a(e){return e.effects.state.create(n(),{clear:r,set:o})}Object.defineProperty(t,"__esModule",{value:!0}),t.createVideoElementAtom=void 0,t.createVideoElementAtom=a}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}return n(204)})()));
@@ -1,10 +1,10 @@
1
1
  /*******************************************************************************
2
2
  * This source code is the proprietary property of Bitmovin, Inc. Unauthorized
3
3
  * copying, distribution, or use of this code, or any portion thereof, is
4
- * strictly prohibited. © 2023 Bitmovin, Inc. All rights reserved. This
4
+ * strictly prohibited. © 2024 Bitmovin, Inc. All rights reserved. This
5
5
  * source code is subject to the terms and conditions of the accompanying
6
6
  * license agreement.
7
7
  *
8
- * Bitmovin Player X Version 10.0.0-beta.12
8
+ * Bitmovin Player X Version 10.0.0-beta.13
9
9
  *******************************************************************************/
10
10
  !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports["dash-parsing"]=r():(e.bitmovin=e.bitmovin||{},e.bitmovin.playerx=e.bitmovin.playerx||{},e.bitmovin.playerx["dash-parsing"]=r())}(self,(()=>(()=>{"use strict";var e={3898:(e,r)=>{function a(e,r,a){const s=r;return s._name=e,{onAdd:s,dependencies:a}}Object.defineProperty(r,"__esModule",{value:!0}),r.createPackage=void 0,r.createPackage=a},8465:(e,r)=>{function a(e,r){const a=r;return a._name=e,a}function s(e){return(...r)=>{const[s,o]=e(...r);return a(s,o)}}Object.defineProperty(r,"__esModule",{value:!0}),r.createTaskClosure=r.createTask=void 0,r.createTask=a,r.createTaskClosure=s},7048:(e,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FrameworkError=void 0;class a extends Error{constructor(e){super(e),this.name="FrameworkError"}}r.FrameworkError=a},2948:(e,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DashParsingPackage=void 0;const s=a(3898),o=a(560),t=a(5801),n=a(1676);r.DashParsingPackage=(0,s.createPackage)("DashParsingPackage",((e,r)=>{r.registry.maybeSet(n.DashParsingExportNames.ParsingTask,o.DashParsingTask),r.registry.maybeSet(n.DashParsingExportNames.Errors,{DashParsingError:t.DashParsingError})}),[]),r.default=r.DashParsingPackage},560:(e,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DashParsingTask=void 0;const s=a(8465),o=a(1676);r.DashParsingTask=(0,s.createTask)(o.DashParsingExportNames.ParsingTask,((e,r)=>(new DOMParser).parseFromString(e,"application/xml")))},5801:(e,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DashParsingError=void 0;const s=a(7048);class o extends s.FrameworkError{constructor(e){super(e)}}r.DashParsingError=o},1676:(e,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DashParsingExportNames=void 0,function(e){e.ParsingTask="dash-parsing-task",e.Errors="dash-parsing-errors"}(r.DashParsingExportNames||(r.DashParsingExportNames={}))}},r={};function a(s){var o=r[s];if(void 0!==o)return o.exports;var t=r[s]={exports:{}};return e[s](t,t.exports,a),t.exports}return a(2948)})()));