/*! For license information please see dash.all.min.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.dashjs=t():e.dashjs=t()}(self,(()=>(()=>{var e={4593:(e,t)=>{var n,r,i,o,u,l=function(e){for(var t=[],n=0;n>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},c=function(e){for(var t=[],n=0;n>18)),r.push(n.charAt(63&a>>12)),r.push(n.charAt(63&a>>6)),r.push(n.charAt(63&a))}return 2==e.length-t?(a=(e[t]<<16)+(e[t+1]<<8),r.push(n.charAt(63&a>>18)),r.push(n.charAt(63&a>>12)),r.push(n.charAt(63&a>>6)),r.push("=")):1==e.length-t&&(a=e[t]<<16,r.push(n.charAt(63&a>>18)),r.push(n.charAt(63&a>>12)),r.push("==")),r.join("")},i=function(){for(var e=[],t=0;t{!function(e){"use strict";var t={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},n=function(e){var n=e;return t.hasOwnProperty(e)&&(n=t[e]),String.fromCharCode(n)},r=15,i=32,a={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},o={17:2,18:4,21:6,22:8,23:10,19:13,20:15},s={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},l=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){var n=this.verboseFilter[e];this.verboseLevel>=n&&console.log(this.time+" ["+e+"] "+t)}},f=function(e){for(var t=[],n=0;ni&&(c.log("ERROR","Too large cursor position "+this.pos),this.pos=i)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n=144&&this.backSpace();var t=n(e);this.pos>=i?c.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var m=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new p,this.nonDisplayedMemory=new p,this.lastOutputScreen=new p,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};m.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,c.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}c.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=c.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var y=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new m(1,t),new m(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};y.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var n,r,i,a=!1;this.lastTime=e,c.setTime(e);for(var o=0;o=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB?(this.lastCmdA=null,this.lastCmdB=null,c.log("DEBUG","Repeated command ("+f([r,i])+") is dropped")):0!==r||0!==i?(c.log("DATA","["+f([t[o],t[o+1]])+"] -> ("+f([r,i])+")"),(n=this.parseCmd(r,i))||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),n||(a=this.parseChars(r,i))&&(this.currChNr&&this.currChNr>=0?this.channels[this.currChNr-1].insertChars(a):c.log("WARNING","No channel found yet. TEXT-MODE?")),n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,c.log("WARNING","Couldn't parse cleaned data "+f([r,i])+" orig: "+f([t[o],t[o+1]])))):this.dataCounters.padding+=2},parseCmd:function(e,t){var n;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47||(23===e||31===e)&&33<=t&&t<=35))return!1;n=20===e||21===e||23===e?1:2;var r=this.channels[n-1];return 20===e||21===e||28===e||29===e?32===t?r.cc_RCL():33===t?r.cc_BS():34===t?r.cc_AOF():35===t?r.cc_AON():36===t?r.cc_DER():37===t?r.cc_RU(2):38===t?r.cc_RU(3):39===t?r.cc_RU(4):40===t?r.cc_FON():41===t?r.cc_RDC():42===t?r.cc_TR():43===t?r.cc_RTD():44===t?r.cc_EDM():45===t?r.cc_CR():46===t?r.cc_ENM():47===t&&r.cc_EOC():r.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},parseMidrow:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return c.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),c.log("DEBUG","MIDROW ("+f([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,r;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127||(16===e||24===e)&&64<=t&&t<=95))return!1;n=e<=23?1:2,r=64<=t&&t<=95?1===n?a[e]:s[e]:1===n?o[e]:u[e];var i=this.interpretPAC(r,t);return this.channels[n-1].setPAC(i),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},parseChars:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var o;o=17===a?t+80:18===a?t+112:t+144,c.log("INFO","Special char '"+n(o)+"' in channel "+r),i=[o],this.lastCmdA=e,this.lastCmdB=t}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null);if(i){var s=f(i);c.log("DEBUG","Char codes = "+s.join(","))}return i},parseBackgroundAttributes:function(e,t){var n,r,i;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=l[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(n),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e{"use strict";var r=n(3227),i=n(5448),a=n(6398),o=n(2032),s=(n(5530),"undefined"!=typeof window&&window||n.g),u=s.dashjs;u||(u=s.dashjs={}),u.MediaPlayer=r.Z,u.FactoryMaker=i.Z,u.Debug=a.Z,u.Version=(0,o.e)()},6398:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(5595),i=n(8512),a=n(5448),o=1,s=2,u=3,l=4,c=5;function f(e){e=e||{};var t,n,a,f,d=this.context,g=(0,r.Z)(d).getInstance(),h=e.settings,p=[];function m(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function y(){for(var e=arguments.length,t=new Array(e),n=0;n0&&(r+=" ");for(var s=arguments.length,u=new Array(s>2?s-2:0),l=2;l=e&&p[e](r),h&&h.get().debug.dispatchEvent&&g.trigger(i.Z.LOG,{message:r,level:e})}return t={getLogger:function(e){return{fatal:y.bind(e),error:E.bind(e),warn:v.bind(e),info:_.bind(e),debug:T.bind(e)}},setLogTimestampVisible:function(e){n=e},setCalleeNameVisible:function(e){a=e}},n=!0,a=!0,f=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(p[o]=m(window.console.error),p[s]=m(window.console.error),p[u]=m(window.console.warn),p[l]=m(window.console.info),p[c]=m(window.console.debug)),t}f.__dashjs_factory_name="Debug";var d=a.Z.getSingletonFactory(f);d.LOG_LEVEL_NONE=0,d.LOG_LEVEL_FATAL=o,d.LOG_LEVEL_ERROR=s,d.LOG_LEVEL_WARNING=u,d.LOG_LEVEL_INFO=l,d.LOG_LEVEL_DEBUG=c,a.Z.updateSingletonFactory(f.__dashjs_factory_name,d);const g=d},5595:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(5448),i=n(8825);function a(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}var n={on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var o=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var s={callback:r,scope:i,priority:o};i&&i.getStreamId&&(s.streamId=i.getStreamId()),i&&i.getType&&(s.mediaType=i.getType()),a&&a.mode&&(s.mode=a.mode);var u=e[n].some((function(t,r){if(t&&o>t.priority)return e[n].splice(r,0,s),!0}));u||e[n].push(s)}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null)}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return!(!e||r.streamId&&e.streamId&&e.streamId!==r.streamId||r.mediaType&&e.mediaType&&e.mediaType!==r.mediaType||r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===i.Z.EVENT_MODE_ON_RECEIVE)})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}};return n}a.__dashjs_factory_name="EventBus";var o=r.Z.getSingletonFactory(a);o.EVENT_PRIORITY_LOW=0,o.EVENT_PRIORITY_HIGH=5e3,r.Z.updateSingletonFactory(a.__dashjs_factory_name,o);const s=o},5448:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(){var e,t=[],n={},r={};function i(e,n){for(var r in t){var i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function a(e,t){return t[e]}function o(e,t,n){e in n&&(n[e]=t)}function s(t,n,r){var i,a=t.__dashjs_factory_name,o=n[a];if(o){var s=o.instance;if(!o.override)return s.apply({context:n,factory:e},r);for(var u in i=t.apply({context:n},r),s=s.apply({context:n,factory:e,parent:i},r))i.hasOwnProperty(u)&&(i[u]=s[u])}else i=t.apply({context:n},r);return i.getClassName=function(){return a},i}return e={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(var i in t){var a=t[i];if(a.context===e&&a.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},deleteSingletonInstances:function(e){t=t.filter((function(t){return t.context!==e}))},getSingletonFactory:function(e){var r=a(e.__dashjs_factory_name,n);return r||(r=function(n){var r;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=s(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return a(e,n)},updateSingletonFactory:function(e,t){o(e,t,n)},getClassFactory:function(e){var t=a(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return s(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return a(e,r)},updateClassFactory:function(e,t){o(e,t,r)}},e}()},1264:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(5448),i=n(703),a=n(6398),o=n(3393),s=n(7855),u=n(5595),l=n(8512);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(){var e,t,n=this.context,r=(0,u.Z)(n).getInstance(),d={"streaming.delay.liveDelay":l.Z.SETTING_UPDATED_LIVE_DELAY,"streaming.delay.liveDelayFragmentCount":l.Z.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,"streaming.liveCatchup.enabled":l.Z.SETTING_UPDATED_CATCHUP_ENABLED,"streaming.liveCatchup.playbackRate.min":l.Z.SETTING_UPDATED_PLAYBACK_RATE_MIN,"streaming.liveCatchup.playbackRate.max":l.Z.SETTING_UPDATED_PLAYBACK_RATE_MAX},g={debug:{logLevel:a.Z.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,wallclockTimeUpdateInterval:100,manifestUpdateRetryInterval:100,cacheInitSegments:!1,applyServiceDescription:!0,applyProducerReferenceTime:!0,applyContentSteering:!0,eventControllerRefreshDelay:100,enableManifestDurationMismatchFix:!0,enableManifestTimescaleMismatchFix:!1,capabilities:{filterUnsupportedEssentialProperties:!0,useMediaCapabilitiesApi:!1},timeShiftBuffer:{calcFromSegmentTimeline:!1,fallbackToSegmentTimeline:!0},metrics:{maxListDepth:100},delay:{liveDelayFragmentCount:NaN,liveDelay:NaN,useSuggestedPresentationDelay:!0},protection:{keepProtectionMediaKeys:!1,ignoreEmeEncryptedEvent:!1,detectPlayreadyMessageFormat:!0},buffer:{enableSeekDecorrelationFix:!1,fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,initialBufferLevel:NaN,stableBufferTime:12,longFormContentDurationThreshold:600,stallThreshold:.3,useAppendWindow:!0,setStallState:!0,avoidCurrentTimeRangePruning:!1,useChangeTypeForTrackSwitch:!0},gaps:{jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,threshold:.3,enableSeekFix:!0,enableStallFix:!1,stallSeek:.1},utcSynchronization:{enabled:!0,useManifestDateHeaderTimeSource:!0,backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"https://time.akamai.com/?iso&ms"}},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0},text:{defaultEnabled:!0,extendSegmentedCues:!0,webvtt:{customRenderingEnabled:!1}},liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN},playbackBufferMin:.5,enabled:null,mode:o.Z.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},cacheLoadThresholds:{video:50,audio:5},trackSwitchMode:{audio:o.Z.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:o.Z.TRACK_SWITCH_MODE_NEVER_REPLACE},selectionModeForInitialTrack:o.Z.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY,fragmentRequestTimeout:2e4,manifestRequestTimeout:1e4,retryIntervals:(e={},f(e,s.w.MPD_TYPE,500),f(e,s.w.XLINK_EXPANSION_TYPE,500),f(e,s.w.MEDIA_SEGMENT_TYPE,1e3),f(e,s.w.INIT_SEGMENT_TYPE,1e3),f(e,s.w.BITSTREAM_SWITCHING_SEGMENT_TYPE,1e3),f(e,s.w.INDEX_SEGMENT_TYPE,1e3),f(e,s.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE,1e3),f(e,s.w.LICENSE,1e3),f(e,s.w.OTHER_TYPE,1e3),f(e,"lowLatencyReductionFactor",10),e),retryAttempts:(t={},f(t,s.w.MPD_TYPE,3),f(t,s.w.XLINK_EXPANSION_TYPE,1),f(t,s.w.MEDIA_SEGMENT_TYPE,3),f(t,s.w.INIT_SEGMENT_TYPE,3),f(t,s.w.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),f(t,s.w.INDEX_SEGMENT_TYPE,3),f(t,s.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE,3),f(t,s.w.LICENSE,3),f(t,s.w.OTHER_TYPE,3),f(t,"lowLatencyMultiplyFactor",5),t),abr:{movingAverageMethod:o.Z.MOVING_AVERAGE_SLIDING_WINDOW,ABRStrategy:o.Z.ABR_STRATEGY_DYNAMIC,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!0},bandwidthSafetyFactor:.9,useDefaultABRRules:!0,useDeadTimeLatency:!0,limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},maxRepresentationRatio:{audio:1,video:1},initialBitrate:{audio:-1,video:-1},initialRepresentationRatio:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0},fetchThroughputCalculationMode:o.Z.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING},cmcd:{enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:o.Z.CMCD_MODE_QUERY,enabledKeys:["br","d","ot","tb","bl","dl","mtp","nor","nrr","su","bs","rtp","cid","pr","sf","sid","st","v"]},cmsd:{enabled:!1,abr:{applyMb:!1,etpWeightRatio:0}}},errors:{recoverAttempts:{mediaErrorDecode:5}}},h=i.Z.clone(g);function p(e,t,n){for(var a in e)e.hasOwnProperty(a)&&(t.hasOwnProperty(a)?"object"!==c(e[a])||e[a]instanceof Array||null===e[a]?(t[a]=i.Z.clone(e[a]),d[n+a]&&r.trigger(d[n+a])):p(e[a],t[a],n.slice()+a+"."):console.error("Settings parameter "+n+a+" is not supported"))}return{get:function(){return h},update:function(e){"object"===c(e)&&p(e,h,"")},reset:function(){h=i.Z.clone(g)}}}d.__dashjs_factory_name="Settings";const g=r.Z.getSingletonFactory(d)},703:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(3875),i=n.n(r),a=n(1067);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n0&&(t[a.substring(0,o)]=a.substring(o+2))}return t}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null;try{var t=null===e&&"undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"";return(0,a.UAParser)(t)}catch(e){return{}}}}],null&&s(t.prototype,null),n&&s(t,n),e}()},2032:(e,t,n)=>{"use strict";function r(){return"4.6.0"}n.d(t,{e:()=>r})},2230:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ni});const i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,(n=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&r(t.prototype,n),e}()},4351:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}n.d(t,{Z:()=>s});const s=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var i=o(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return a(this,e)});function s(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(e=r.call(this)).ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",e.BUFFERING_COMPLETED="bufferingCompleted",e.BUFFER_CLEARED="bufferCleared",e.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",e.BUFFER_REPLACEMENT_STARTED="bufferReplacementStarted",e.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",e.CMSD_STATIC_HEADER="cmsdStaticHeader",e.CURRENT_TRACK_CHANGED="currentTrackChanged",e.DATA_UPDATE_COMPLETED="dataUpdateCompleted",e.INBAND_EVENTS="inbandEvents",e.INITIAL_STREAM_SWITCH="initialStreamSwitch",e.INIT_FRAGMENT_LOADED="initFragmentLoaded",e.INIT_FRAGMENT_NEEDED="initFragmentNeeded",e.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",e.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",e.LOADING_COMPLETED="loadingCompleted",e.LOADING_PROGRESS="loadingProgress",e.LOADING_DATA_PROGRESS="loadingDataProgress",e.LOADING_ABANDONED="loadingAborted",e.MANIFEST_UPDATED="manifestUpdated",e.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",e.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",e.QUOTA_EXCEEDED="quotaExceeded",e.SEGMENT_LOCATION_BLACKLIST_ADD="segmentLocationBlacklistAdd",e.SEGMENT_LOCATION_BLACKLIST_CHANGED="segmentLocationBlacklistChanged",e.SERVICE_LOCATION_BLACKLIST_ADD="serviceLocationBlacklistAdd",e.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",e.SET_FRAGMENTED_TEXT_AFTER_DISABLED="setFragmentedTextAfterDisabled",e.SET_NON_FRAGMENTED_TEXT="setNonFragmentedText",e.SOURCE_BUFFER_ERROR="sourceBufferError",e.STREAMS_COMPOSED="streamsComposed",e.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",e.STREAM_REQUESTING_COMPLETED="streamRequestingCompleted",e.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",e.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",e.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",e.URL_RESOLUTION_FAILED="urlResolutionFailed",e.VIDEO_CHUNK_RECEIVED="videoChunkReceived",e.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",e.XLINK_ELEMENT_LOADED="xlinkElementLoaded",e.XLINK_READY="xlinkReady",e.SEEK_TARGET="seekTarget",e.SETTING_UPDATED_LIVE_DELAY="settingUpdatedLiveDelay",e.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT="settingUpdatedLiveDelayFragmentCount",e.SETTING_UPDATED_CATCHUP_ENABLED="settingUpdatedCatchupEnabled",e.SETTING_UPDATED_PLAYBACK_RATE_MIN="settingUpdatedPlaybackRateMin",e.SETTING_UPDATED_PLAYBACK_RATE_MAX="settingUpdatedPlaybackRateMax",e}return s}(n(8342).Z)},8512:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function o(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.d(t,{Z:()=>u});const u=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(u,e);var t,n,r=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=s(t);if(n){var i=s(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return o(this,e)});function u(){return i(this,u),r.apply(this,arguments)}return u}(n(4351).Z))},8342:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ni});const i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,(n=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&r(t.prototype,n),e}()},9326:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(3186),i=n(7855),a=n(5448),o=n(8825),s=n(7387),u=n(1553);function l(e){var t,n,a,l,c,f=(e=e||{}).eventBus,d=e.debug,g=e.urlUtils,h=e.type,p=e.streamInfo,m=e.segmentsController,y=e.timelineConverter,E=e.baseURLController;function v(){return h}function _(){a=null}function T(e,t,n){var r,i,a=E.resolve(n.path);return a&&t!==a.url&&g.isRelative(t)?(r=a.url,i=a.serviceLocation,t&&(r=g.resolve(t,r))):r=t,!g.isRelative(r)&&(e.url=r,e.serviceLocation=i,!0)}function S(e,t){if(null==t)return null;var n=new r.Z,a=t.representation,o=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].bandwidth,u=t.media;return u=(0,s.vi)(u,"Number",t.replacementNumber),u=(0,s.vi)(u,"Time",t.replacementTime),u=(0,s.vi)(u,"Bandwidth",o),u=(0,s.Aj)(u,a.id),u=(0,s.eR)(u),n.mediaType=v(),n.type=i.w.MEDIA_SEGMENT_TYPE,n.range=t.mediaRange,n.startTime=t.presentationStartTime,n.mediaStartTime=t.mediaStartTime,n.duration=t.duration,n.timescale=a.timescale,n.availabilityStartTime=t.availabilityStartTime,n.availabilityEndTime=t.availabilityEndTime,n.availabilityTimeComplete=a.availabilityTimeComplete,n.wallStartTime=t.wallStartTime,n.quality=a.index,n.index=t.index,n.mediaInfo=e,n.adaptationIndex=a.adaptation.index,n.representationId=a.id,T(n,u,a)?n:void 0}function b(e,t,r){var i=null;if(!t||!t.segmentInfoType)return i;var o=m.getSegmentByTime(t,r);return o&&(a=o,n.debug("Index for time "+r+" is "+o.index),i=S(e,o)),i}function A(){n.debug("Dynamic stream complete"),c=!0}return t={initialize:function(e){l=e,c=!1,m.initialize(e)},getStreamId:function(){return p.id},getType:v,getStreamInfo:function(){return p},getInitRequest:function(e,t){return t?function(e,t,n){var a=new r.Z,o=t.adaptation.period,u=o.start;if(a.mediaType=n,a.type=i.w.INIT_SEGMENT_TYPE,a.range=t.range,a.availabilityStartTime=y.calcAvailabilityStartTimeFromPresentationTime(u,t,l),a.availabilityEndTime=y.calcAvailabilityEndTimeFromPresentationTime(u+o.duration,t,l),a.quality=t.index,a.mediaInfo=e,a.representationId=t.id,T(a,t.initialization,t))return a.url=(0,s.vi)(a.url,"Bandwidth",t.bandwidth),a}(e,t,v()):null},getSegmentRequestForTime:b,getCurrentIndex:function(){return a?a.index:-1},getNextSegmentRequest:function(e,t){var r=null;if(!t||!t.segmentInfoType)return null;var i=a?a.index+1:0,o=m.getSegmentByIndex(t,i,a?a.mediaStartTime:-1);if(o)r=S(e,o),a=o;else{if(l&&!c)return n.debug(v()+" No segment found at index: "+i+". Wait for next loop"),null;c=!0}return r},isLastSegmentRequested:function(e,t){if(!e||!a)return!1;if(c)return!0;if(!isFinite(e.adaptation.period.duration))return!1;if(a.presentationStartTime+a.duration>t)return!1;if(e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.numberOfSegments)&&!isNaN(a.index)&&a.index>=e.mediaFinishedInformation.numberOfSegments-1){if(!l||e.segmentInfoType===u.Z.SEGMENT_TEMPLATE)return!0;if(l&&e.segmentInfoType===u.Z.SEGMENT_LIST&&e.adaptation.period.nextPeriodId)return!0}return!!(l&&e.adaptation.period.nextPeriodId&&e.segmentInfoType===u.Z.SEGMENT_TIMELINE&&e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&a&&!isNaN(a.mediaStartTime)&&!isNaN(a.duration)&&a.mediaStartTime+a.duration>=e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},reset:function(){_(),f.off(o.Z.DYNAMIC_TO_STATIC,A,t)},getNextSegmentRequestIdempotent:function(e,t){var n=a?a.index+1:0,r=m.getSegmentByIndex(t,n,a?a.mediaStartTime:-1);return r?S(e,r):null},getValidTimeAheadOfTargetTime:function(e,t,n,r){try{if(isNaN(e)||!t||!n)return NaN;if(e<0&&(e=0),isNaN(r)&&(r=.5),b(t,n,e))return e;if(n.adaptation.period.start+n.adaptation.period.durations.startTime&&l-e>r?e:!isNaN(s.startTime)&&es.startTime?s.startTime+.001:Math.min(l-r,o)}return o}catch(e){return NaN}}},n=d.getLogger(t),_(),f.on(o.Z.DYNAMIC_TO_STATIC,A,t),t}l.__dashjs_factory_name="DashHandler";const c=a.Z.getClassFactory(l)},1553:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ni});const i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n;return t=e,(n=[{key:"init",value:function(){this.BASE_URL="BaseURL",this.SEGMENT_BASE="SegmentBase",this.SEGMENT_TEMPLATE="SegmentTemplate",this.SEGMENT_LIST="SegmentList",this.SEGMENT_URL="SegmentURL",this.SEGMENT_TIMELINE="SegmentTimeline",this.SEGMENT_PROFILES="segmentProfiles",this.ADAPTATION_SET="AdaptationSet",this.REPRESENTATION="Representation",this.REPRESENTATION_INDEX="RepresentationIndex",this.SUB_REPRESENTATION="SubRepresentation",this.INITIALIZATION="Initialization",this.INITIALIZATION_MINUS="initialization",this.MPD="MPD",this.PERIOD="Period",this.ASSET_IDENTIFIER="AssetIdentifier",this.EVENT_STREAM="EventStream",this.ID="id",this.PROFILES="profiles",this.SERVICE_LOCATION="serviceLocation",this.RANGE="range",this.INDEX="index",this.MEDIA="media",this.BYTE_RANGE="byteRange",this.INDEX_RANGE="indexRange",this.MEDIA_RANGE="mediaRange",this.VALUE="value",this.CONTENT_TYPE="contentType",this.MIME_TYPE="mimeType",this.BITSTREAM_SWITCHING="BitstreamSwitching",this.BITSTREAM_SWITCHING_MINUS="bitstreamSwitching",this.CODECS="codecs",this.DEPENDENCY_ID="dependencyId",this.MEDIA_STREAM_STRUCTURE_ID="mediaStreamStructureId",this.METRICS="Metrics",this.METRICS_MINUS="metrics",this.REPORTING="Reporting",this.WIDTH="width",this.HEIGHT="height",this.SAR="sar",this.FRAMERATE="frameRate",this.AUDIO_SAMPLING_RATE="audioSamplingRate",this.MAXIMUM_SAP_PERIOD="maximumSAPPeriod",this.START_WITH_SAP="startWithSAP",this.MAX_PLAYOUT_RATE="maxPlayoutRate",this.CODING_DEPENDENCY="codingDependency",this.SCAN_TYPE="scanType",this.FRAME_PACKING="FramePacking",this.AUDIO_CHANNEL_CONFIGURATION="AudioChannelConfiguration",this.CONTENT_PROTECTION="ContentProtection",this.ESSENTIAL_PROPERTY="EssentialProperty",this.SUPPLEMENTAL_PROPERTY="SupplementalProperty",this.INBAND_EVENT_STREAM="InbandEventStream",this.PRODUCER_REFERENCE_TIME="ProducerReferenceTime",this.ACCESSIBILITY="Accessibility",this.ROLE="Role",this.RATING="Rating",this.CONTENT_COMPONENT="ContentComponent",this.SUBSET="Subset",this.LANG="lang",this.VIEWPOINT="Viewpoint",this.ROLE_ASARRAY="Role_asArray",this.REPRESENTATION_ASARRAY="Representation_asArray",this.PRODUCERREFERENCETIME_ASARRAY="ProducerReferenceTime_asArray",this.ACCESSIBILITY_ASARRAY="Accessibility_asArray",this.AUDIOCHANNELCONFIGURATION_ASARRAY="AudioChannelConfiguration_asArray",this.CONTENTPROTECTION_ASARRAY="ContentProtection_asArray",this.MAIN="main",this.DYNAMIC="dynamic",this.STATIC="static",this.MEDIA_PRESENTATION_DURATION="mediaPresentationDuration",this.MINIMUM_UPDATE_PERIOD="minimumUpdatePeriod",this.CODEC_PRIVATE_DATA="codecPrivateData",this.BANDWITH="bandwidth",this.SOURCE_URL="sourceURL",this.TIMESCALE="timescale",this.DURATION="duration",this.START_NUMBER="startNumber",this.PRESENTATION_TIME_OFFSET="presentationTimeOffset",this.AVAILABILITY_START_TIME="availabilityStartTime",this.AVAILABILITY_END_TIME="availabilityEndTime",this.TIMESHIFT_BUFFER_DEPTH="timeShiftBufferDepth",this.MAX_SEGMENT_DURATION="maxSegmentDuration",this.PRESENTATION_TIME="presentationTime",this.MIN_BUFFER_TIME="minBufferTime",this.MAX_SUBSEGMENT_DURATION="maxSubsegmentDuration",this.START="start",this.AVAILABILITY_TIME_OFFSET="availabilityTimeOffset",this.AVAILABILITY_TIME_COMPLETE="availabilityTimeComplete",this.CENC_DEFAULT_KID="cenc:default_KID",this.DVB_PRIORITY="dvb:priority",this.DVB_WEIGHT="dvb:weight",this.SUGGESTED_PRESENTATION_DELAY="suggestedPresentationDelay",this.SERVICE_DESCRIPTION="ServiceDescription",this.SERVICE_DESCRIPTION_SCOPE="Scope",this.SERVICE_DESCRIPTION_LATENCY="Latency",this.SERVICE_DESCRIPTION_PLAYBACK_RATE="PlaybackRate",this.SERVICE_DESCRIPTION_OPERATING_QUALITY="OperatingQuality",this.SERVICE_DESCRIPTION_OPERATING_BANDWIDTH="OperatingBandwidth",this.PATCH_LOCATION="PatchLocation",this.PUBLISH_TIME="publishTime",this.ORIGINAL_PUBLISH_TIME="originalPublishTime",this.ORIGINAL_MPD_ID="mpdId",this.WALL_CLOCK_TIME="wallClockTime",this.PRESENTATION_TIME="presentationTime",this.LABEL="Label",this.GROUP_LABEL="GroupLabel",this.CONTENT_STEERING="ContentSteering",this.CONTENT_STEERING_AS_ARRAY="ContentSteering_asArray",this.DEFAULT_SERVICE_LOCATION="defaultServiceLocation",this.QUERY_BEFORE_START="queryBeforeStart",this.PROXY_SERVER_URL="proxyServerURL",this.CONTENT_STEERING_RESPONSE={VERSION:"VERSION",TTL:"TTL",RELOAD_URI:"RELOAD-URI",SERVICE_LOCATION_PRIORITY:"SERVICE-LOCATION-PRIORITY"}}}])&&r(t.prototype,n),e}())},7802:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(5448),i=n(1724),a=n(3636),o=n(1736),s=n(5246);function u(e){e=e||{};var t,n,r=this.context,u=e.dashConstants,l=e.type,c=e.segmentBaseController;function f(e){return e?e.segments?n[u.SEGMENT_BASE]:n[e.segmentInfoType]:null}return t={initialize:function(t){n[u.SEGMENT_TIMELINE]=(0,i.Z)(r).create(e,t),n[u.SEGMENT_TEMPLATE]=(0,a.Z)(r).create(e,t),n[u.SEGMENT_LIST]=(0,o.Z)(r).create(e,t),n[u.SEGMENT_BASE]=(0,s.Z)(r).create(e,t)},updateInitData:function(e,t){return t?Promise.resolve():c.getSegmentBaseInitSegment({representation:e,mediaType:l})},updateSegmentData:function(e,t){return t?Promise.resolve():c.getSegmentList({mimeType:e.mimeType,representation:e,mediaType:l})},getSegmentByIndex:function(e,t,n){var r=f(e);return r?r.getSegmentByIndex(e,t,n):null},getSegmentByTime:function(e,t){var n=f(e);return n?n.getSegmentByTime(e,t):null},getMediaFinishedInformation:function(e){var t=f(e);return t?t.getMediaFinishedInformation(e):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},n={},t}u.__dashjs_factory_name="SegmentsController";const l=r.Z.getClassFactory(u)},1736:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(5448),i=n(3393),a=n(7387);function o(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.Z.MISSING_CONFIG_ERROR)}function o(e,i){if(r(),!e)return null;var o=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,s=o.SegmentURL_asArray.length,u=e&&!isNaN(e.startNumber)?e.startNumber:1,l=Math.max(u-1,0),c=Math.max(i-l,0),f=null;if(c{"use strict";n.d(t,{Z:()=>o});var r=n(5448),i=n(3393);function a(e){var t=(e=e||{}).timelineConverter;function n(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.Z.MISSING_CONFIG_ERROR)}function r(e,t){if(n(),!e)return null;var r,i=e.segments?e.segments.length:-1;if(t0)for(o=0;o=i&&t-n{"use strict";n.d(t,{Aj:()=>o,NF:()=>c,TJ:()=>f,eR:()=>a,vi:()=>s});var r=n(2011);function i(e,t){for(;e.lengthr&&o=a)}return!0}function c(e,t,n,r){var i,a,o;i=n.segmentDuration,isNaN(i)&&(i=n.adaptation.period.duration),a=parseFloat((n.adaptation.period.start+r*i).toFixed(5)),o=parseFloat((a+i).toFixed(5));var s=u(n,i,a,e.calcMediaTimeFromPresentationTime(a,n),e,o,t,r);return l(e,n,s,t)?s:null}function f(e,t,n,r,i,a,o,c,f,d){var g,h,p=r/a,m=i/a;return g=e.calcPresentationTimeFromMediaTime(p,n),l(e,n,h=u(n,m,g,p,e,g+m,t,f),t)?(h.replacementTime=d||r,o=s(o,"Number",h.replacementNumber),o=s(o,"Time",h.replacementTime),h.media=o,h.mediaRange=c,h):null}},3636:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(5448),i=n(3393),a=n(7387);function o(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.Z.MISSING_CONFIG_ERROR)}function o(e,i){if(r(),!e)return null;var o=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate;i=Math.max(i,0);var s=(0,a.NF)(n,t,e,i);if(s){s.replacementTime=Math.round((i-1)*e.segmentDuration*e.timescale,10);var u=o.media;u=(0,a.vi)(u,"Number",s.replacementNumber),u=(0,a.vi)(u,"Time",s.replacementTime),s.media=u}return s}return{getSegmentByIndex:o,getSegmentByTime:function(e,t){if(r(),!e)return null;var i=e.segmentDuration;if(isNaN(i))return null;var a=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return o(e,Math.floor(a/i))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var n=e.segmentDuration;return isNaN(n)?t.numberOfSegments=1:t.numberOfSegments=Math.ceil(e.adaptation.period.duration/n),t}}}o.__dashjs_factory_name="TemplateSegmentsGetter";const s=r.Z.getClassFactory(o)},1724:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(5448),i=n(3393),a=n(7387);function o(e,t){var n=(e=e||{}).timelineConverter,r=e.dashMetrics;function o(){if(!n)throw new Error(i.Z.MISSING_CONFIG_ERROR)}function s(e,t){var n,r,i,a,o,s,l,c=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,f=c.SegmentTimeline,d=c.SegmentURL_asArray,g=0,h=-1;l=e.timescale;var p=!1;for(i=0,a=(n=f.S_asArray).length;i=i*f-.5*c.d&&(l=!0),!1})),u},getSegmentByTime:function(e,r){if(o(),!e)return null;void 0===r&&(r=null);var i=null,u=n.calcMediaTimeFromPresentationTime(r,e);return s(e,(function(r,o,s,l,c,f,d){var g=parseFloat((u*c).toPrecision(15));if(g=r){var h=o.media,p=l.mediaRange;return s&&(h=s[d].media||"",p=s[d].mediaRange),i=(0,a.TJ)(n,t,e,r,l.d,c,h,p,f,l.tManifest),!0}return!1})),i},getMediaFinishedInformation:function(e){if(!e)return 0;var t,n,r,i,a,o,s,l=(e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList).SegmentTimeline,c=0,f=0,d=0;for(s=e.timescale,i=(t=l.S_asArray).length,r=0;r{"use strict";n.d(t,{Z:()=>r});const r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.wallStartTime=NaN,this.representation=null}},2610:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value=""}},3227:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Fa});var r=n(452),i=n.n(r),a=n(3393),o=n(1553),s=n(3860),u=n(5595),l=n(8512),c=n(5448),f=n(6398),d=n(8825);function g(){var e,t,n,r,i,o,c,g,h,p,m,y,E,v,_,T,S,b,A,I,R,w,N,C,D=this.context,O=(0,u.Z)(D).getInstance();function M(){F(),v=!1,p=0,m=0,T=0,w=!1,S=!0,b=!1,N=!1,A=NaN,c&&(O.off(l.Z.DATA_UPDATE_COMPLETED,Q,e),O.off(l.Z.LOADING_PROGRESS,me,e),O.off(l.Z.MANIFEST_UPDATED,_e,e),O.off(l.Z.STREAMS_COMPOSED,Te,e),O.off(d.Z.PLAYBACK_ENDED,he,e),O.off(d.Z.STREAM_INITIALIZING,Ee,e),O.off(d.Z.REPRESENTATION_SWITCH,ve,e),O.off(d.Z.BUFFER_LEVEL_STATE_CHANGED,ee,e),X(),c.removeEventListener("canplay",$),c.removeEventListener("canplaythrough",J),c.removeEventListener("play",te),c.removeEventListener("waiting",ne),c.removeEventListener("playing",re),c.removeEventListener("pause",ie),c.removeEventListener("error",pe),c.removeEventListener("seeking",ae),c.removeEventListener("seeked",oe),c.removeEventListener("timeupdate",se),c.removeEventListener("progress",ue),c.removeEventListener("ratechange",le),c.removeEventListener("loadedmetadata",ce),c.removeEventListener("loadeddata",fe),c.removeEventListener("stalled",ye),c.removeEventListener("ended",de),c.removeEventListener("volumechange",ge)),h=null,c=null,y=null,E=null}function P(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return parseFloat((L(e)-B()).toFixed(5))}function L(e){var t=e||y;return t.start+t.duration}function x(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];y&&c&&c.getElement()?(e&&E&&U(B()),c.play()):v=!0}function F(){y&&c&&c.pause()}function k(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(y&&c){var a=isNaN(A)?c.getTime():A;e!==a&&((I=!0===r)||(A=e),t.info("Requesting seek to time: "+e+(I?" (internal)":"")),E&&i&&U(e),c.setCurrentTime(e,n))}}function Z(){if(y&&c&&E){var e=n&&n.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,t=i.getCurrentDVRInfo(e);return t&&t.range?t.range.end:0}}function U(e){var t=new Date(g.getClientReferenceTime()),n=o.getRegularPeriods()[0],r=g.calcPresentationTimeFromWallTime(t,n);p=r-e}function B(){return y&&c?c.getTime():null}function G(){return y&&c?c.isPaused():null}function j(){return y&&c?c.isSeeking():null}function Y(){return y&&c?c.isStalled():null}function q(){return y&&c?c.getPlaybackRate():null}function H(){return y&&c?c.getEnded():null}function V(){return E}function K(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!G()&&E&&0!==c.getReadyState()&&!j()&&!w){e||(e=n.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO);var r=B(),i=z(r,e),o=!isNaN(i)&&i!==r;o&&!j()&&(Y()||R||1===c.getReadyState())&&(t.debug("UpdateCurrentTime: Seek to actual time: ".concat(i," from currentTime: ").concat(r)),k(i,!1,!1))}}function z(e,t){var n=i.getCurrentDVRInfo(t),r=n?n.range:null;return r?e>r.end?Math.max(r.end-p,r.start):e>0&&e+.25_+500)&&(_=e,se())):K())}),C.get().streaming.wallclockTimeUpdateInterval))}function X(){clearInterval(h),h=null}function Q(e){var t=o.convertRepresentationToRepresentationInfo(e.currentRepresentation),n=t?t.mediaInfo.streamInfo:null;null!==n&&y.id===n.id&&(y=n)}function $(){O.trigger(l.Z.CAN_PLAY)}function J(){O.trigger(l.Z.CAN_PLAY_THROUGH)}function ee(e){e.streamId===n.getActiveStreamInfo().id&&(R=e.state===s.Z.BUFFER_EMPTY,C.get().streaming.buffer.setStallState&&c.setStallState(e.mediaType,e.state===s.Z.BUFFER_EMPTY))}function te(){t.info("Native video element event: play"),K(),W(),O.trigger(l.Z.PLAYBACK_STARTED,{startTime:B()})}function ne(){t.info("Native video element event: waiting"),O.trigger(l.Z.PLAYBACK_WAITING,{playingTime:B()})}function re(){t.info("Native video element event: playing"),I=!1,O.trigger(l.Z.PLAYBACK_PLAYING,{playingTime:B()})}function ie(){t.info("Native video element event: pause"),O.trigger(l.Z.PLAYBACK_PAUSED,{ended:H()})}function ae(){if(!I){var e=B();isNaN(A)||A===e||(e=A),A=NaN,t.info("Seeking to: "+e),W(),O.trigger(l.Z.PLAYBACK_SEEKING,{seekTime:e,streamId:y.id})}}function oe(){t.info("Native video element event: seeked"),I=!1,O.trigger(l.Z.PLAYBACK_SEEKED)}function se(){y&&O.trigger(l.Z.PLAYBACK_TIME_UPDATED,{timeToEnd:P(),time:B(),streamId:y.id})}function ue(){O.trigger(l.Z.PLAYBACK_PROGRESS,{streamId:y.id})}function le(){var e=q();t.info("Native video element event: ratechange: ",e),O.trigger(l.Z.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function ce(){t.info("Native video element event: loadedmetadata"),O.trigger(l.Z.PLAYBACK_METADATA_LOADED),W()}function fe(){t.info("Native video element event: loadeddata"),O.trigger(l.Z.PLAYBACK_LOADED_DATA)}function de(){t.info("Native video element event: ended"),F(),X();var e=n?n.getActiveStreamInfo():null;e&&O.trigger(l.Z.PLAYBACK_ENDED,{isLast:e.isLast})}function ge(){O.trigger(l.Z.PLAYBACK_VOLUME_CHANGED)}function he(e){if(h&&e.isLast){t.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var n=e.seekTime?e.seekTime:L();c.setCurrentTime(n),F(),X()}}function pe(e){var t=e.target||e.srcElement;O.trigger(l.Z.PLAYBACK_ERROR,{error:t.error})}function me(e){if(!1===e.stream&&b&&!isNaN(e.request.duration)){var n=1.2*e.request.duration;n>p&&(t.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",n.toFixed(2)),p=n,m=n)}}function ye(e){O.trigger(l.Z.PLAYBACK_STALLED,{e})}function Ee(e){var n;(n=e.mediaInfo)&&n.supplementalProperties&&"true"===n.supplementalProperties[a.Z.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME]&&(t.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),b=!0)}function ve(e){var t=n.getActiveStreamInfo();e&&t&&e.currentRepresentation&&e.streamId&&e.streamId===t.id&&e.mediaType&&(e.mediaType===a.Z.VIDEO||e.mediaType===a.Z.AUDIO)&&(S=e.currentRepresentation.availabilityTimeComplete,(b=!S)&&!N&&(N=!0))}function _e(){w=!0}function Te(){w=!1}return e={initialize:function(t,n){y=t,!0!==n&&(c.addEventListener("canplay",$),c.addEventListener("canplaythrough",J),c.addEventListener("play",te),c.addEventListener("waiting",ne),c.addEventListener("playing",re),c.addEventListener("pause",ie),c.addEventListener("error",pe),c.addEventListener("seeking",ae),c.addEventListener("seeked",oe),c.addEventListener("timeupdate",se),c.addEventListener("progress",ue),c.addEventListener("ratechange",le),c.addEventListener("loadedmetadata",ce),c.addEventListener("loadeddata",fe),c.addEventListener("stalled",ye),c.addEventListener("ended",de),c.addEventListener("volumechange",ge),E=y.manifestInfo.isDynamic,R=!1,I=!1,O.on(l.Z.DATA_UPDATE_COMPLETED,Q,e),O.on(l.Z.LOADING_PROGRESS,me,e),O.on(l.Z.MANIFEST_UPDATED,_e,e),O.on(l.Z.STREAMS_COMPOSED,Te,e),O.on(d.Z.PLAYBACK_ENDED,he,e,{priority:u.Z.EVENT_PRIORITY_HIGH}),O.on(d.Z.STREAM_INITIALIZING,Ee,e),O.on(d.Z.REPRESENTATION_SWITCH,ve,e),O.on(d.Z.BUFFER_LEVEL_STATE_CHANGED,ee,e),v&&(v=!1,x()))},setConfig:function(e){e&&(e.streamController&&(n=e.streamController),e.serviceDescriptionController&&(r=e.serviceDescriptionController),e.dashMetrics&&(i=e.dashMetrics),e.adapter&&(o=e.adapter),e.videoModel&&(c=e.videoModel),e.timelineConverter&&(g=e.timelineConverter),e.settings&&(C=e.settings))},getTimeToStreamEnd:P,getBufferLevel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=null;return n.getActiveStreamProcessors().forEach((function(n){if(!e||0===e.length||-1===e.indexOf(n.getType())){var r=n.getBufferLevel();t=null===t?r:Math.min(t,r)}})),t},getPlaybackStalled:function(){return R},getTime:B,getLowLatencyModeEnabled:function(){return b},getInitialCatchupModeActivated:function(){return N},getIsManifestUpdateInProgress:function(){return w},getPlaybackRate:q,getPlayedRanges:function(){return y&&c?c.getPlayedRanges():null},getEnded:H,getIsDynamic:V,getStreamController:function(){return n},computeAndSetLiveDelay:function(e,t){var n,i,a,s=!isNaN(e)&&isFinite(e)?e:NaN,u=o.getSuggestedPresentationDelay(),l=r.getServiceDescriptionSettings();return n=isNaN(C.get().streaming.delay.liveDelay)?null===C.get().streaming.delay.liveDelayFragmentCount||isNaN(C.get().streaming.delay.liveDelayFragmentCount)||isNaN(s)?l&&!isNaN(l.liveDelay)&&l.liveDelay>0?l.liveDelay:!0===C.get().streaming.delay.useSuggestedPresentationDelay&&null!==u&&!isNaN(u)&&u>0?u:isNaN(s)?t&&!isNaN(t.minBufferTime)?4*t.minBufferTime:4*y.manifestInfo.minBufferTime:4*s:s*C.get().streaming.delay.liveDelayFragmentCount:C.get().streaming.delay.liveDelay,null!==(a=o.getAvailabilityStartTime())&&(T=a),i=t&&t.dvrWindowSize>0?Math.min(n,t.dvrWindowSize):n,p=i,m=i,i},getLiveDelay:function(){return p},getOriginalLiveDelay:function(){return m},getCurrentLiveLatency:function(){if(!E||isNaN(T))return NaN;var e=B();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*g.getClientTimeOffset();return Math.max(((t-T-1e3*e)/1e3).toFixed(3),0)},play:x,isPaused:G,isStalled:Y,pause:F,isSeeking:j,getStreamEndTime:L,seek:k,seekToOriginalLive:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=Z();if(0!==r){var i=r-(p=m);k(i,e,t,n)}},seekToCurrentLive:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=Z();if(0!==r){var i=r-p;k(i,e,t,n)}},reset:M,updateCurrentTime:K,getAvailabilityStartTime:function(){return T}},t=(0,f.Z)(D).getInstance().getLogger(e),M(),e}g.__dashjs_factory_name="PlaybackController";const h=c.Z.getSingletonFactory(g);var p=n(3186),m="loading",y="executed",E="failed";function v(e){var t,n,r,i,a=(e=e||{}).eventBus,o=e.events,s=e.dashMetrics,u=e.fragmentLoader,l=e.debug,c=e.streamInfo,f=e.type;function d(e){var t;return!!e&&(t=!1,r.some((function(n){if(r=e,i=n,!isNaN(r.index)&&r.startTime===i.startTime&&r.adaptationIndex===i.adaptationIndex&&r.type===i.type||function(e,t){return isNaN(e.index)&&isNaN(t.index)&&e.quality===t.quality}(e,n)||function(e,t){return e.action===p.Z.ACTION_COMPLETE&&e.action===t.action}(e,n))return t=!0;var r,i})),t)}function g(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function h(e){r=r.filter((function(t){var n=g(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-n}))}function v(e,t){t<=e+.5||(r=r.filter((function(n){var r=g(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r})))}function _(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r],a=i.startTime,o=a+i.duration;if(n=isNaN(n)?g(i):n,!isNaN(a)&&!isNaN(o)&&t+n>=a&&t-n0&&v(n,t)}else h()},abortRequests:function(){n.debug("abort requests"),u.abort(),i=[]},executeRequest:function(e){e.action===p.Z.ACTION_DOWNLOAD?(T(e,m),i.push(e),function(e){a.trigger(o.FRAGMENT_LOADING_STARTED,{request:e},{streamId:c.id,mediaType:f}),u.load(e)}(e)):n.warn("Unknown request action.")},reset:function(){a.off(o.LOADING_COMPLETED,S,this),a.off(o.LOADING_DATA_PROGRESS,b,this),a.off(o.LOADING_ABANDONED,A,this),u&&u.reset(),I()},resetInitialSettings:I,addExecutedRequest:function(e){r.push(e)}},n=l.getLogger(t),I(),a.on(o.LOADING_COMPLETED,S,t),a.on(o.LOADING_DATA_PROGRESS,b,t),a.on(o.LOADING_ABANDONED,A,t),t}v.__dashjs_factory_name="FragmentModel";var _=c.Z.getClassFactory(v);_.FRAGMENT_MODEL_LOADING=m,_.FRAGMENT_MODEL_EXECUTED=y,_.FRAGMENT_MODEL_CANCELED="canceled",_.FRAGMENT_MODEL_FAILED=E,c.Z.updateClassFactory(v.__dashjs_factory_name,_);const T=_;var S=n(5459);function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function A(e,t){return A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},A(e,t)}function I(e,t){return!t||"object"!==b(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}const w=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=R(t);if(n){var i=R(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return I(this,e)});function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,e.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,e.SEGMENT_BASE_LOADER_ERROR_CODE=15,e.TIME_SYNC_FAILED_ERROR_CODE=16,e.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,e.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,e.APPEND_ERROR_CODE=20,e.REMOVE_ERROR_CODE=21,e.DATA_UPDATE_FAILED_ERROR_CODE=22,e.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,e.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,e.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,e.DOWNLOAD_ERROR_ID_SIDX_CODE=26,e.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,e.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,e.DOWNLOAD_ERROR_ID_XLINK_CODE=29,e.MANIFEST_ERROR_ID_PARSE_CODE=31,e.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,e.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,e.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,e.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,e.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",e.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",e.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",e.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",e.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segment ranges from sidx",e.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize client and server time",e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",e.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",e.APPEND_ERROR_MESSAGE="chunk is not defined",e.REMOVE_ERROR_MESSAGE="Removing data from the SourceBuffer",e.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",e.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",e.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",e.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",e.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : ",e}return i}(n(2230).Z));var N=n(1264),C=n(7855);function D(e){var t,n,r,i,o,s,u=this.context,c=(0,N.Z)(u).getInstance(),d=e.textController,g=e.eventBus,h=[],p=[],m=!1,y=e.mediaSource,E=null;function v(e){return new Promise((function(t){M((function(){i.changeType&&i.changeType(e),t()}))}))}function _(e){return i=d.getTextSourceBuffer(e),Promise.resolve()}function T(){if("function"==typeof i.addEventListener)try{i.addEventListener("updateend",D,!1),i.addEventListener("error",O,!1),i.addEventListener("abort",O,!1)}catch(e){s=setInterval(D,50)}else s=setInterval(D,50)}function b(e){return new Promise((function(t){i&&c.get().streaming.buffer.useAppendWindow?M((function(){try{if(!i)return void t();var n=y.duration,a=0;e&&!isNaN(e.start)&&!isNaN(e.duration)&&isFinite(e.duration)&&(n=e.start+e.duration),e&&!isNaN(e.start)&&(a=e.start),i.appendWindowEnd===n&&i.appendWindowStart===a||(i.appendWindowStart=0,i.appendWindowEnd=n+.01,i.appendWindowStart=Math.max(a-.1,0),r.debug("Updated append window for ".concat(o.type,". Set start to ").concat(i.appendWindowStart," and end to ").concat(i.appendWindowEnd))),t()}catch(e){r.warn("Failed to set append window"),t()}})):t()}))}function A(e){return new Promise((function(t){i?M((function(){try{i.timestampOffset===e||isNaN(e)||(i.timestampOffset=e,r.debug("Set MSE timestamp offset to ".concat(e))),t()}catch(e){t()}})):t()}))}function I(){if(!m&&p.length>0){m=!0;var e=p[0];p.splice(0,1);var t=function(){m=!1,p.length>0&&I.call(this),e&&e.data&&e.data.segmentType&&e.data.segmentType!==C.w.INIT_SEGMENT_TYPE&&delete e.data.bytes,e.promise.resolve({chunk:e.data})};try{E=e.request,0===e.data.bytes.byteLength?t.call(this):(i.appendBuffer?i.appendBuffer(e.data.bytes):i.append(e.data.bytes,e.data),M(t.bind(this)))}catch(t){r.fatal('SourceBuffer append failed "'+t+'"'),p.length>0?I():m=!1,delete e.data.bytes,e.promise.reject({chunk:e.data,error:new S.Z(t.code,t.message)})}}}function R(){h.length>0&&(i.updating||(h.shift()(),R()))}function D(){i.updating||R()}function O(e){var t,r,i=e.target||{};t=l.Z.SOURCE_BUFFER_ERROR,r={error:i,lastRequestAppended:E}||{},g.trigger(t,r,{streamId:o.streamInfo.id,mediaType:n})}function M(e){h.push(e),i.updating||R()}return t={getType:function(){return n},getAllBufferRanges:function(){try{return i.buffered}catch(e){return r.error("getAllBufferRanges exception: "+e.message),null}},getBuffer:function(){return i},append:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise((function(r,i){e?(p.push({data:e,promise:{resolve:r,reject:i},request:n}),M(I.bind(t))):i({chunk:e,error:new S.Z(w.APPEND_ERROR_CODE,w.APPEND_ERROR_MESSAGE)})}))},remove:function(e){return new Promise((function(t,n){var r=e.start,a=e.end;r>=0&&a>r?M((function(){try{i.remove(r,a),M((function(){t({from:r,to:a,unintended:!1}),e.resolve&&e.resolve()}))}catch(t){n({from:r,to:a,unintended:!1,error:new S.Z(w.REMOVE_ERROR_CODE,w.REMOVE_ERROR_MESSAGE)}),e.reject&&e.reject(t)}})):t()}))},abort:function(){return new Promise((function(e){try{p=[],"open"===y.readyState?M((function(){try{i&&i.abort(),e()}catch(t){e()}})):i&&i.setTextTrack&&"ended"===y.readyState?(i.abort(),e()):e()}catch(t){e()}}))},reset:function(){if(i){try{h=[],function(){try{"function"==typeof i.removeEventListener&&(i.removeEventListener("updateend",D,!1),i.removeEventListener("error",O,!1),i.removeEventListener("abort",O,!1)),clearInterval(s)}catch(e){r.error(e)}}(),m=!1,p=[],i.getClassName&&"TextSourceBuffer"===i.getClassName()||(r.debug("Removing sourcebuffer from media source"),y.removeSourceBuffer(i))}catch(e){}i=null}E=null},updateTimestampOffset:A,initializeForStreamSwitch:function(e,t,r){n=(o=e).type;var a=o.codec;!function(e){i=e.getBuffer()}(r),T();var s=[];return s.push(new Promise((function(e){M((function(){var t=i.appendWindowStart,n=i.appendWindowEnd;i&&(i.abort(),i.appendWindowStart=t,i.appendWindowEnd=n),e()}))}))),s.push(b(o.streamInfo)),s.push(v(a)),t&&void 0!==t.MSETimeOffset&&s.push(A(t.MSETimeOffset)),Promise.all(s)},initializeForFirstUse:function(e,t,r){n=(o=t).type;var s=o.codec;try{if(s.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return _(e);i=y.addSourceBuffer(s),T();var u=[];return u.push(b(o.streamInfo)),r&&void 0!==r.MSETimeOffset&&u.push(A(r.MSETimeOffset)),Promise.all(u)}catch(t){return o.type==a.Z.TEXT&&!o.isFragmented||-1!==s.indexOf('codecs="stpp')||-1!==s.indexOf('codecs="vtt')?_(e):Promise.reject(t)}},updateAppendWindow:b,changeType:v},r=(0,f.Z)(u).getInstance().getLogger(t),t}D.__dashjs_factory_name="SourceBufferSink";const O=c.Z.getClassFactory(D);function M(e){var t,n,r,i=this.context,a=[],o=e;function s(e,t){return a=a.filter((function(n){return!((isNaN(t)||n.starte))})),Promise.resolve()}return t={getAllBufferRanges:function(){for(var e=[],t=0;te[e.length-1].end?e.push({start:n.start,end:n.end}):e[e.length-1].end=n.end}var r={start:function(t){return e[t].start},end:function(t){return e[t].end}};return Object.defineProperty(r,"length",{get:function(){return e.length}}),r},append:function(e){return"InitializationSegment"!==e.segmentType?(a.push(e),a.sort((function(e,t){return e.start-t.start})),r=null):r=e,n.debug("PreBufferSink appended chunk s: "+e.start+"; e: "+e.end),o&&o({chunk:e}),Promise.resolve()},remove:s,abort:function(){return Promise.resolve()},discharge:function(e,t){var n=function(e,t){return a.filter((function(n){return(isNaN(t)||n.starte)}))}(e,t);return r&&(n.push(r),r=null),s(e,t),n},reset:function(){a=[],r=null,o=null},updateTimestampOffset:function(){return Promise.resolve()},waitForUpdateEnd:function(e){e()},getBuffer:function(){return this}},n=(0,f.Z)(i).getInstance().getLogger(t),t}M.__dashjs_factory_name="PreBufferSink";const P=c.Z.getClassFactory(M);function L(){var e={};return{save:function(t){var n=t.streamId,r=t.representationId;e[n]=e[n]||{},e[n][r]=t},extract:function(t,n){return e&&e[t]&&e[t][n]?e[t][n]:null},reset:function(){e={}}}}L.__dashjs_factory_name="InitCache";const x=c.Z.getSingletonFactory(L);var F=.01,k="BufferController";function Z(e){e=e||{};var t,n,r,i,o,c,g,h,p,m,y,E,v,_,b,A,I,R,N,D,M=this.context,L=(0,u.Z)(M).getInstance(),Z=e.errHandler,U=e.fragmentModel,B=e.representationController,G=e.adapter,j=e.textController,Y=e.abrController,q=e.playbackController,H=e.streamInfo,V=e.type,K=e.settings;function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise((function(n,r){c=e,p&&t&&"function"==typeof p.discharge?(m=p,X(t).then((function(){n()})).catch((function(e){r(e)}))):n()}))}function W(e){return G.convertRepresentationToRepresentationInfo(B.getRepresentationForQuality(e))}function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new Promise((function(n,r){I&&e?c?$(e,t).then((function(e){n(e)})).catch((function(e){r(e)})):Q().then((function(e){n(e)})).catch((function(e){r(e)})):n(null)}))}function Q(){var e=this;return new Promise((function(t,n){var r=Y.getQualityFor(V,H.id);p=P(M).create(re.bind(e)),ve(W(r)).then((function(){t(p)})).catch((function(){n()}))}))}function $(e,t){return new Promise((function(r,i){var o=Y.getQualityFor(V,H.id);p=O(M).create({mediaSource:c,textController:j,eventBus:L}),function(e,t,n){var r=W(n);return t&&t[V]&&(V===a.Z.VIDEO||V===a.Z.AUDIO)?p.initializeForStreamSwitch(e,r,t[V]):p.initializeForFirstUse(H,e,r)}(e,t,o).then((function(){return ve(W(o))})).then((function(){r(p)})).catch((function(e){n.fatal("Caught error on create SourceBuffer: "+e),Z.error(new S.Z(w.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,w.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+V)),i(e)}))}))}function J(e){K.get().streaming.cacheInitSegments&&(n.info("Init fragment finished loading saving to",V+"'s init cache"),I.save(e.chunk)),n.debug("Append Init fragment",V," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),te(e.chunk)}function ee(e){te(e.chunk,e.request)}function te(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;p.append(e,t).then((function(e){re(e)})).catch((function(e){re(e)})),e.mediaInfo.type===a.Z.VIDEO&&we(l.Z.VIDEO_CHUNK_RECEIVED,{chunk:e})}function ne(e){if(e&&e.length>0)for(var t=0,r=e.length;t0){var e=Math.max(.2*o,1),t=o-e,r=Math.min(K.get().streaming.buffer.bufferTimeAtTopQuality,.9*t),i=Math.min(K.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*t),a={streaming:{buffer:{bufferToKeep:parseFloat(e.toFixed(5)),bufferTimeAtTopQuality:parseFloat(r.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(i.toFixed(5))}}};K.update(a)}}(),void(22!==e.error.code&&Re()||(n.warn("Clearing playback buffer to overcome quota exceed situation"),we(l.Z.QUOTA_EXCEEDED,{criticalBufferLevel:o,quotaExceededTime:e.chunk.start}),me(pe())));if(p&&(ce(),A=!1,(v=e.chunk)&&v.endFragment)){v&&!isNaN(v.index)&&(g=Math.max(v.index,g),fe());var t=p.getAllBufferRanges();v.segmentType===C.w.MEDIA_SEGMENT_TYPE&&(ne(t),oe(),function(){if(!isNaN(D))if(V===a.Z.AUDIO||V===a.Z.VIDEO){var e=q.getTime(),t=le(e,0),n=le(D,0);if(t&&n&&t.start===n.start)D=NaN;else{var r=B.getCurrentRepresentation().segmentDuration,i=le(D,r);i&&(K.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(e-D)>r?D<=i.end&&q.seek(Math.max(D,i.start),!1,!0):e0&&(r=!0),y=null),v&&!r&&we(l.Z.BYTES_APPENDED_END_FRAGMENT,{quality:v.quality,startTime:v.start,index:v.index,bufferedRanges:t,segmentType:v.segmentType,mediaType:V})}}function ie(){return new Promise((function(e,t){var n=ae();if(!n||0===n.length)return oe(),void e();me(n).then((function(){e()})).catch((function(e){t(e)}))}))}function ae(e){var t=[],r=p.getAllBufferRanges();if(!r||0===r.length)return t;if(!e&&0!==e||isNaN(e))t.push({start:r.start(0),end:r.end(r.length-1)+.5});else{var i=function(e,t){var n=K.get().streaming.buffer.bufferToKeep,r=t.start(0);if(e-r>n){var i=Math.max(0,e-n),a=U.getRequests({state:T.FRAGMENT_MODEL_EXECUTED,time:e,threshold:F})[0];if(a&&(i=Math.min(a.startTime,i)),i>0)return{start:r,end:i}}return null}(e,r),a=function(e,t){var r=t.end(t.length-1)+.5,i=Ie(e),a=H.manifestInfo.duration>=K.get().streaming.buffer.longFormContentDurationThreshold?K.get().streaming.buffer.bufferTimeAtTopQualityLongForm:K.get().streaming.buffer.bufferTimeAtTopQuality,o=isNaN(i)?e:Math.min(i,e+a);if(o>=t.end(t.length-1))return null;var s=U.getRequests({state:T.FRAGMENT_MODEL_EXECUTED,time:e,threshold:F})[0];if(s&&(o=Math.max(s.startTime+s.duration,o)),K.get().streaming.buffer.avoidCurrentTimeRangePruning)for(var u=0;u=a&&e=h-1,t=q.getTimeToStreamEnd(H)-i<1e-5;!e&&!t||r||(be(!0),n.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ".concat(H.id," and type ").concat(V)))}function de(){V!==a.Z.AUDIO&&V!==a.Z.VIDEO||((!q.getLowLatencyModeEnabled()&&i=K.get().streaming.buffer.stallThreshold||q.getLowLatencyModeEnabled()&&i>0)&&ge(s.Z.BUFFER_LOADED))}function ge(e){E===e||e===s.Z.BUFFER_EMPTY&&0===q.getTime()||V===a.Z.TEXT&&!j.isTextEnabled()||(E=e,we(l.Z.BUFFER_LEVEL_STATE_CHANGED,{state:e}),we(e===s.Z.BUFFER_LOADED?l.Z.BUFFER_LOADED:l.Z.BUFFER_EMPTY),n.debug(e===s.Z.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function he(){p&&V!==a.Z.TEXT&&(r||me(pe()))}function pe(){var e=[],t=p.getAllBufferRanges();if(!t||0===t.length)return e;var n=q.getTime(),r=Math.max(0,n-K.get().streaming.buffer.bufferToKeep),i=U.getRequests({state:T.FRAGMENT_MODEL_EXECUTED,time:n,threshold:F})[0];if(i)r=Math.min(i.startTime,r);else if(0===n&&q.getIsDynamic())return[];if(t.start(0)<=r){for(var a={start:0,end:r},o=0;o=K.get().streaming.buffer.bufferPruningInterval&&(_=0,he())}function Se(){de()}function be(e){r!==e&&((r=e)?we(l.Z.BUFFERING_COMPLETED):h=Number.POSITIVE_INFINITY)}function Ae(){try{var e,t,n=p.getAllBufferRanges(),r=0;if(!n)return r;for(t=0,e=n.length;t=i&&t<=a&&(t=a),r+=1}return t===e?NaN:t}catch(e){}}function Re(){var e=Ae();return isNaN(e)||e0){for(var t="Beginning "+V+"PreBuffer discharge, adding buffer for:",r=0;r=i&&e<=a)return!0;r+=1}return!1}catch(e){return n.error(e),!1}},pruneBuffer:he,setMediaSource:z,getMediaSource:function(){return c},appendInitSegmentFromCache:function(e){var t=I.extract(H.id,e);return!!t&&(n.info("Append Init fragment",V," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),te(t),!0)},getIsBufferingCompleted:function(){return r},setIsBufferingCompleted:be,getIsPruningInProgress:function(){return b},reset:function(e,t){L.off(l.Z.INIT_FRAGMENT_LOADED,J,this),L.off(l.Z.MEDIA_FRAGMENT_LOADED,ee,this),L.off(l.Z.WALLCLOCK_TIME_UPDATED,Te,this),L.off(d.Z.PLAYBACK_PLAYING,ue,this),L.off(d.Z.PLAYBACK_PROGRESS,oe,this),L.off(d.Z.PLAYBACK_TIME_UPDATED,oe,this),L.off(d.Z.PLAYBACK_RATE_CHANGED,Se,this),L.off(d.Z.PLAYBACK_STALLED,se,this),Ne(e,t)},prepareForPlaybackSeek:function(){return r&&be(!1),p.abort()},prepareForReplacementTrackSwitch:function(e){return new Promise((function(t,n){p.abort().then((function(){return _e()})).then((function(){return K.get().streaming.buffer.useChangeTypeForTrackSwitch?p.changeType(e):Promise.resolve()})).then((function(){return ie()})).then((function(){be(!1),t()})).catch((function(e){n(e)}))}))},prepareForNonReplacementTrackSwitch:function(e){return new Promise((function(t,n){_e().then((function(){return K.get().streaming.buffer.useChangeTypeForTrackSwitch?p.changeType(e):Promise.resolve()})).then((function(){t()})).catch((function(e){n(e)}))}))},prepareForReplacementQualitySwitch:function(){return new Promise((function(e,t){p.abort().then((function(){return _e()})).then((function(){return ie()})).then((function(){be(!1),e()})).catch((function(e){t(e)}))}))},updateAppendWindow:_e,getAllRangesWithSafetyFactor:ae,getContinuousBufferTimeForTargetTime:Ie,clearBuffers:me,pruneAllSafely:ie,updateBufferTimestampOffset:ve,setSeekTarget:function(e){D=e},segmentRequestingCompleted:function(e){isNaN(e)||(h=e,fe())}},n=(0,f.Z)(M).getInstance().getLogger(t),I=x(M).getInstance(),Ne(),t}Z.__dashjs_factory_name=k;const U=c.Z.getClassFactory(Z);var B="NotFragmentedTextBufferController";function G(e){e=e||{};var t,n,r,i,a,o,s=this.context,c=(0,u.Z)(s).getInstance(),f=e.textController,d=e.errHandler,g=e.streamInfo,h=e.type;function p(e){i=e}function m(e){var t,r;n!==e&&(n=e)&&(t=l.Z.BUFFERING_COMPLETED,r={},c.trigger(t,r,{streamId:g.id,mediaType:h}))}function y(e){e.chunk.bytes&&!n&&(o.save(e.chunk),a.append(e.chunk),m(!0))}return t={initialize:function(e){p(e)},getStreamId:function(){return g.id},getType:function(){return h},getBufferControllerType:function(){return B},createBufferSink:function(e){return new Promise((function(t,n){try{(a=O(s).create({mediaSource:i,textController:f,eventBus:c})).initializeForFirstUse(g,e),r||(a.getBuffer()&&"function"==typeof a.getBuffer().initialize&&a.getBuffer().initialize(),r=!0),t(a)}catch(e){d.error(new S.Z(w.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,w.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+h)),n(e)}}))},dischargePreBuffer:function(){},getBuffer:function(){return a},getBufferLevel:function(){return 0},getRangeAt:function(){return null},pruneBuffer:function(){},hasBufferAtTime:function(){return!0},getAllRangesWithSafetyFactor:function(){return[]},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},setMediaSource:p,getMediaSource:function(){return i},appendInitSegmentFromCache:function(e){return null!==o.extract(g.id,e)},getIsBufferingCompleted:function(){return n},setIsBufferingCompleted:m,getIsPruningInProgress:function(){return!1},reset:function(e){c.off(l.Z.INIT_FRAGMENT_LOADED,y,t),!e&&a&&(a.abort(),a.reset(),a=null)},clearBuffers:function(){return Promise.resolve()},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return n=!1,Promise.resolve()},setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()},segmentRequestingCompleted:function(){}},r=!1,i=null,n=!1,o=x(s).getInstance(),c.on(l.Z.INIT_FRAGMENT_LOADED,y,t),t}G.__dashjs_factory_name=B;const j=c.Z.getClassFactory(G);function Y(e){e=e||{};var t,n,r,i,o,c,g,h,p,m,y,E,v,_=this.context,S=(0,u.Z)(_).getInstance(),b=e.dashMetrics,A=e.mediaPlayerModel,I=e.fragmentModel,R=e.abrController,w=e.playbackController,N=e.textController,C=e.type,D=e.bufferController,O=e.settings;function M(e){if(!D.getIsBufferingCompleted()){P();var t=isNaN(e)?0:e;c=setTimeout(L,t)}}function P(){c&&(clearTimeout(c),c=null)}function L(){try{if(function(){try{return C===a.Z.TEXT&&!N.isTextEnabled()||w.isPaused()&&(!w.getStreamController().getInitialPlayback()||!w.getStreamController().getAutoPlay())&&!O.get().streaming.scheduling.scheduleWhilePaused}catch(e){return!1}}())return void P();if(function(){try{return i&&(isNaN(m)||y||(e=n.id,t=R.getMaxAllowedIndexFor(C,e),!(!isNaN(p)&&p==t||(r.info("Top quality "+C+" index has changed from "+p+" to "+t),p=t,0)))||!C||!i||b.getCurrentBufferLevel(C)=O.get().streaming.buffer.longFormContentDurationThreshold?O.get().streaming.buffer.bufferTimeAtTopQualityLongForm:O.get().streaming.buffer.bufferTimeAtTopQuality:A.getStableBufferTime()}catch(e){return A.getStableBufferTime()}}():e}function F(){k(!0)}function k(e){if(w&&I){var t=I.getRequests({state:T.FRAGMENT_MODEL_EXECUTED,time:w.getTime(),threshold:0})[0];t&&w.getTime()>=t.startTime&&((!h.mediaInfo||t.mediaInfo.type===h.mediaInfo.type&&t.mediaInfo.id!==h.mediaInfo.id)&&e&&S.trigger(l.Z.TRACK_CHANGE_RENDERED,{mediaType:C,oldMediaInfo:h.mediaInfo,newMediaInfo:t.mediaInfo,streamId:n.id}),t.quality===h.quality&&t.adaptationIndex===h.adaptationIndex||!e||(r.debug("Quality change rendered for streamId ".concat(n.id," and type ").concat(C)),S.trigger(l.Z.QUALITY_CHANGE_RENDERED,{mediaType:C,oldQuality:h.quality,newQuality:t.quality,streamId:n.id})),h={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function Z(e){r.debug("Appended bytes for ".concat(e.mediaType," and stream id ").concat(n.id)),(isNaN(e.index)||isNaN(m))&&(m=e.quality,r.info("["+C+"] lastInitializedRepresentationInfo changed to "+e.quality)),M(0)}function U(){I.abortRequests(),P()}function B(){O.get().streaming.scheduling.scheduleWhilePaused||M()}function G(e){b.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function j(){v=!0,o=0,m=NaN,h={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},p=NaN,y=!1,E=!1}return t={initialize:function(e){g=e,S.on(l.Z.BYTES_APPENDED_END_FRAGMENT,Z,t),S.on(l.Z.URL_RESOLUTION_FAILED,U,t),S.on(d.Z.PLAYBACK_STARTED,B,t),S.on(d.Z.PLAYBACK_RATE_CHANGED,G,t),S.on(d.Z.PLAYBACK_TIME_UPDATED,F,t)},getType:function(){return C},getStreamId:function(){return n.id},setCurrentRepresentation:function(e){i=e},setTimeToLoadDelay:function(e){o=e},getTimeToLoadDelay:function(){return o},setSwitchTrack:function(e){y=e},getSwitchStrack:function(){return y},startScheduleTimer:M,clearScheduleTimer:P,reset:function(){S.off(l.Z.BYTES_APPENDED_END_FRAGMENT,Z,t),S.off(l.Z.URL_RESOLUTION_FAILED,U,t),S.off(d.Z.PLAYBACK_STARTED,B,t),S.off(d.Z.PLAYBACK_RATE_CHANGED,G,t),S.off(d.Z.PLAYBACK_TIME_UPDATED,F,t),P(),k(!1),j(),n=null},getBufferTarget:x,getPlaybackController:function(){return w},setCheckPlaybackQuality:function(e){v=e},setInitSegmentRequired:function(e){E=e}},r=(0,f.Z)(_).getInstance().getLogger(t),j(),n=e.streamInfo,t}Y.__dashjs_factory_name="ScheduleController";const q=c.Z.getClassFactory(Y);var H=n(7387);function V(e){var t,n,r,i,o,s=(e=e||{}).eventBus,u=e.events,l=e.abrController,c=e.dashMetrics,f=e.playbackController,g=e.timelineConverter,h=e.type,p=e.streamInfo,m=e.dashConstants,y=e.segmentsController,E=e.isDynamic;function v(){return h}function _(){if(!(l&&c&&f&&g))throw new Error(a.Z.MISSING_CONFIG_ERROR)}function T(){return r}function S(){return o}function b(){n=null,r=!0,i=[]}function A(e){return new Promise((function(t,n){var r=e.hasInitialization(),a=e.hasSegments(),s=[];s.push(y.updateInitData(e,r)),s.push(y.updateSegmentData(e,a)),Promise.all(s).then((function(n){var r;n[0]&&!n[0].error&&(e=function(e,t){return t&&!t.error&&t.representation?t.representation:e}(e,n[0])),n[1]&&!n[1].error&&(e=function(e,t){if(t&&!t.error){var n,r,i,a,o=t.segments,s=[],u=0;for(n=0,r=o?o.length:0;n0&&(e.segments=s),e}}(e,n[1])),(r=e).mediaFinishedInformation=y.getMediaFinishedInformation(r),function(e){if(T()){var t,n,r=c.getCurrentManifestUpdate(),a=!1;if(r){for(var s=0;s=i.length?null:i[e]}function w(e){r=!1,s.trigger(u.DATA_UPDATE_COMPLETED,{data:n,currentRepresentation:o,error:e},{streamId:p.id,mediaType:h})}function N(e){o=e}function C(e){if(e.newDuration){var t=S();t&&t.adaptation.period&&(t.adaptation.period.duration=e.newDuration)}}return t={getStreamId:function(){return p.id},getType:v,getData:function(){return n},isUpdating:T,updateData:function(e,t,o,s,u){if(_(),r=!0,i=t,N(R(u)),n=e,o!==a.Z.VIDEO&&o!==a.Z.AUDIO&&(o!==a.Z.TEXT||!s))return w(),Promise.resolve();for(var l=[],c=0,f=i.length;c1&&void 0!==arguments[1])||arguments[1];if(e.sender)if(F.getIsManifestUpdateInProgress())le();else if((!ee()||Z.isTextEnabled())&&d&&e.representationId&&!d.appendInitSegmentFromCache(e.representationId)){var n=h.getCurrentRepresentation();if(0===n.range)return void ae();var r=y?y.getInitRequest(i,n):null;r?L.executeRequest(r):t&&(g.setInitSegmentRequired(!0),le())}}function ae(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(F.getIsManifestUpdateInProgress()||d.getIsPruningInProgress())le();else{var n=ue();n?(p=!1,oe(n)):se(t)}}function oe(e){isNaN(e.startTime+e.duration)||(v=e.startTime+e.duration),e.delayLoadingTime=(new Date).getTime()+g.getTimeToLoadDelay(),g.setTimeToLoadDelay(0),function(e){var t=e.url;return e.range&&(t=t.concat("_",e.range)),H.contains(t)}(e)?(n.warn("Fragment request url ".concat(e.url," for stream id ").concat(A.id," and media type ").concat(I," is on the ignore list and will be skipped")),le()):(n.debug("Next fragment request url for stream id ".concat(A.id," and media type ").concat(I," is ").concat(e.url)),L.executeRequest(e))}function se(e){var t,a=h.getCurrentRepresentation();if(!G.get().streaming.gaps.enableSeekFix||!p&&0!==F.getTime()||(r?r&&a.segmentInfoType===o.Z.SEGMENT_TIMELINE&&(t=y.getValidTimeAheadOfTargetTime(v,i,a,G.get().streaming.gaps.threshold)):t=y.getValidTimeAheadOfTargetTime(v,i,a,G.get().streaming.gaps.threshold),isNaN(t)||t===v)){if(y.isLastSegmentRequested(a,v)){var s=y.getCurrentIndex();return n.debug("Segment requesting for stream ".concat(A.id," has finished")),b.trigger(l.Z.STREAM_REQUESTING_COMPLETED,{segmentIndex:s},{streamId:A.id,mediaType:I}),d.segmentRequestingCompleted(s),void g.clearScheduleTimer()}e&&le()}else F.isSeeking()||0===F.getTime()?(n.warn("Adjusting playback time ".concat(t," because of gap in the manifest. Seeking by ").concat(t-v)),F.seek(t,!1,!1)):(n.warn("Adjusting buffering time ".concat(t," because of gap in the manifest. Adjusting time by ").concat(t-v)),De(t),e&&le())}function ue(){var e,t=be();if(isNaN(v)||J()===a.Z.TEXT&&!Z.isTextEnabled())return null;if(y){var n=h&&t?h.getRepresentationForQuality(t.quality):null;e=p?y.getSegmentRequestForTime(i,n,v):y.getNextSegmentRequest(i,n)}return e}function le(){g.startScheduleTimer(F.getLowLatencyModeEnabled()?G.get().streaming.scheduling.lowLatencyTimeout:G.get().streaming.scheduling.defaultTimeout)}function ce(e){e.error||(g.setCurrentRepresentation(O.convertRepresentationToRepresentationInfo(e.currentRepresentation)),d.getIsBufferingCompleted()||d.updateBufferTimestampOffset(e.currentRepresentation))}function fe(e){B.addBufferState(I,e.state,g.getBufferTarget()),e.state!==s.Z.BUFFER_EMPTY||F.isSeeking()||(n.info("Buffer is empty! Stalling!"),B.pushPlayListTraceMetrics(new Date,te.REBUFFERING_REASON))}function de(e){L.syncExecutedRequestsWithBufferedRange(d.getBuffer().getAllBufferRanges(),A.duration),e.quotaExceeded&&e.from>F.getTime()&&De(e.from),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&g.startScheduleTimer()}function ge(e){if(e&&e.lastRequestAppended&&e.lastRequestAppended.url){var t=e.lastRequestAppended.url;e.lastRequestAppended.range&&(t=t.concat("_",e.lastRequestAppended.range)),n.warn("Blacklisting segment with url ".concat(t)),H.add(t)}}function he(){Ne(),m=!1}function pe(e){n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),F.isSeeking()||g.getSwitchStrack()||m||(n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),e.request&&e.request.isInitializationRequest()?g.setInitSegmentRequired(!0):De(e.request.startTime+e.request.duration/2),g.startScheduleTimer(0))}function me(e){n.info("OnFragmentLoadingCompleted for stream id "+A.id+" and media type "+I+" - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),ee()&&g.startScheduleTimer(0),e.error&&e.request.serviceLocation&&function(e){n.info("Fragment loading completed with an error"),e&&e.request&&e.request.type&&(e.request.type===C.w.INIT_SEGMENT_TYPE?ie({representationId:e.request.representationId,sender:{}},!1):e.request.type===C.w.MEDIA_SEGMENT_TYPE&&(De(e.request.startTime+e.request.duration/2),ae({},!1)))}(e)}function ye(){De(F.getTime()),Se().startScheduleTimer()}function Ee(e){var t=e.currentTrackInfo;if(t){var n=c.find((function(e){return e.index===t.index&&e.lang===t.lang}));n&&Te(n).then((function(){d.setIsBufferingCompleted(!1),De(F.getTime()),g.setInitSegmentRequired(!0),g.startScheduleTimer()}))}}function ve(e){De(e.quotaExceededTime),g.clearScheduleTimer()}function _e(){return d?d.getBuffer():null}function Te(e){e===i||e&&i&&e.type!==i.type||(i=e);var t=O.getRealAdaptation(A,i),n=O.getVoRepresentations(i);if(h){var o,s=h.getData(),u=x.getMaxAllowedIndexFor(I,A.id),l=x.getMinAllowedIndexFor(I,A.id),c=null;return null!==s&&s.id===t.id||I===a.Z.TEXT?o=x.getQualityFor(I,A.id):(c=x.getThroughputHistory().getAverageThroughput(I,r)||x.getInitialBitrateFor(I,A.id),o=x.getQualityForBitrate(i,c,A.id)),void 0!==l&&ou&&(o=u),h.updateData(t,n,I,i.isFragmented,o)}return Promise.resolve()}function Se(){return g}function be(e){var t;return void 0!==e?((0,z.SE)(e),t=h?h.getRepresentationForQuality(e):null):t=h?h.getCurrentRepresentation():null,O.convertRepresentationToRepresentationInfo(t)}function Ae(){return!!d&&d.getIsBufferingCompleted()}function Ie(e){if(G.get().streaming.enableManifestTimescaleMismatchFix){var t=e.chunk,n=t.bytes,r=be(t.quality),i=h&&r?h.getRepresentationForQuality(r.quality):null;if(r&&i){var a=Y.getMediaTimescaleFromMoov(n);i.timescale=a}}}function Re(e){var t=e.chunk,n=t.bytes,r=t.quality,i=be(r),a=h&&i?h.getRepresentationForQuality(i.quality):null;if(i&&a){var o=O.getEventsFor(i.mediaInfo,null,A),s=O.getEventsFor(i,a,A);if(o&&o.length>0||s&&s.length>0){var u=function(e,t,n,r){try{for(var i={},a=[],o=n.concat(r),s=0,u=o.length;sG.get().streaming.buffer.stallThreshold;if(d.getIsBufferingCompleted()&&!t)return d.prepareForNonReplacementTrackSwitch(i.codec).then((function(){b.trigger(l.Z.BUFFERING_COMPLETED,{},{streamId:A.id,mediaType:I})})).catch((function(){b.trigger(l.Z.BUFFERING_COMPLETED,{},{streamId:A.id,mediaType:I})})),void e();g.clearScheduleTimer(),g.setSwitchTrack(!0),t?(b.trigger(l.Z.BUFFER_REPLACEMENT_STARTED,{mediaType:I,streamId:A.id},{mediaType:I,streamId:A.id}),L.abortRequests(),d.prepareForReplacementTrackSwitch(i.codec).then((function(){var e=be();return d.updateBufferTimestampOffset(e)})).then((function(){we(),e()})).catch((function(){we(),e()}))):d.prepareForNonReplacementTrackSwitch(i.codec).then((function(){Ne(),e()})).catch((function(){Ne(),e()}))}))},prepareQualityChange:function(e){n.debug("Preparing quality switch for type ".concat(I));var t=e.newQuality;m=!0,g.clearScheduleTimer();var r=be(t);g.setCurrentRepresentation(r),h.prepareQualityChange(t),L.abortRequests(),d.updateBufferTimestampOffset(r).then((function(){e.reason&&e.reason.forceReplace?(b.trigger(l.Z.BUFFER_REPLACEMENT_STARTED,{mediaType:I,streamId:A.id},{mediaType:I,streamId:A.id}),d.prepareForReplacementQualitySwitch().then((function(){we(),m=!1})).catch((function(){we(),m=!1}))):G.get().streaming.buffer.fastSwitchEnabled?function(e){var t=F.getTime(),n=1.5*(isNaN(e.fragmentDuration)?1:e.fragmentDuration),r=L.getRequests({state:T.FRAGMENT_MODEL_EXECUTED,time:t+n,threshold:0})[0];if(r&&!ee()){var i=d.getBufferLevel(),a=x.getAbandonmentStateFor(A.id,I);r.quality=n&&a!==s.Z.ABANDON_LOAD?(De(t+n),g.setCheckPlaybackQuality(!1),g.startScheduleTimer()):he()}else g.startScheduleTimer();m=!1}(r):he(),B.pushPlayListTraceMetrics(new Date,te.REPRESENTATION_SWITCH_STOP_REASON),B.createPlaylistTraceMetrics(r.id,1e3*F.getTime(),F.getPlaybackRate())}))},getMediaInfo:function(){return i},getMediaSource:function(){return d.getMediaSource()},setMediaSource:function(e){return d.setMediaSource(e,i)},getBuffer:_e,setExplicitBufferingTime:De,finalisePlayList:function(e,t){B.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=be(),t=h&&e?h.getRepresentationForQuality(e.quality):null;return y.getNextSegmentRequestIdempotent(i,t)},prepareInnerPeriodPlaybackSeeking:function(e){return new Promise((function(t){if(d.hasBufferAtTime(e.seekTime))return d.pruneBuffer(),void t();g.clearScheduleTimer(),L.abortRequests(),d.prepareForPlaybackSeek().then((function(){var t=d.getAllRangesWithSafetyFactor(e.seekTime);return d.clearBuffers(t)})).then((function(){var n=d.getContinuousBufferTimeForTargetTime(e.seekTime);if(!isNaN(n)&&!isNaN(A.duration)&&isFinite(A.duration)&&n>=A.start+A.duration)d.setIsBufferingCompleted(!0),t();else{var r=isNaN(n)?e.seekTime:n;De(r),d.setSeekTarget(r);var i=[];i.push(d.updateAppendWindow());var a=be();i.push(d.updateBufferTimestampOffset(a)),Promise.all(i).then((function(){g.setInitSegmentRequired(!0),g.setCheckPlaybackQuality(!1),g.startScheduleTimer(),t()}))}})).catch((function(e){n.error(e)}))}))},prepareOuterPeriodPlaybackSeeking:function(){return new Promise((function(e,t){try{g.clearScheduleTimer(),L.abortRequests(),d.prepareForPlaybackSeek().then((function(){return d.pruneAllSafely()})).then((function(){e()}))}catch(e){t(e)}}))},reset:function(e,n){y&&y.reset(),d&&(d.reset(e,n),d=null),g&&(g.reset(),g=null),h&&(h.reset(),h=null),E&&(E=null),x&&x.unRegisterStreamType(V(),I),b.off(l.Z.DATA_UPDATE_COMPLETED,ce,t),b.off(l.Z.INIT_FRAGMENT_NEEDED,ie,t),b.off(l.Z.MEDIA_FRAGMENT_NEEDED,ae,t),b.off(l.Z.INIT_FRAGMENT_LOADED,Ie,t),b.off(l.Z.MEDIA_FRAGMENT_LOADED,Re,t),b.off(l.Z.BUFFER_LEVEL_STATE_CHANGED,fe,t),b.off(l.Z.BUFFER_CLEARED,de,t),b.off(l.Z.SEEK_TARGET,Ce,t),b.off(l.Z.FRAGMENT_LOADING_ABANDONED,pe,t),b.off(l.Z.FRAGMENT_LOADING_COMPLETED,me,t),b.off(l.Z.SET_FRAGMENTED_TEXT_AFTER_DISABLED,ye,t),b.off(l.Z.SET_NON_FRAGMENTED_TEXT,Ee,t),b.off(l.Z.QUOTA_EXCEEDED,ve,t),b.off(l.Z.SOURCE_BUFFER_ERROR,ge,t),re(),I=null,A=null}},n=(0,f.Z)(_).getInstance().getLogger(t),re(),b.on(l.Z.DATA_UPDATE_COMPLETED,ce,t,{priority:u.Z.EVENT_PRIORITY_HIGH}),b.on(l.Z.INIT_FRAGMENT_NEEDED,ie,t),b.on(l.Z.MEDIA_FRAGMENT_NEEDED,ae,t),b.on(l.Z.INIT_FRAGMENT_LOADED,Ie,t),b.on(l.Z.MEDIA_FRAGMENT_LOADED,Re,t),b.on(l.Z.BUFFER_LEVEL_STATE_CHANGED,fe,t),b.on(l.Z.BUFFER_CLEARED,de,t),b.on(l.Z.SEEK_TARGET,Ce,t),b.on(l.Z.FRAGMENT_LOADING_ABANDONED,pe,t),b.on(l.Z.FRAGMENT_LOADING_COMPLETED,me,t),b.on(l.Z.QUOTA_EXCEEDED,ve,t),b.on(l.Z.SET_FRAGMENTED_TEXT_AFTER_DISABLED,ye,t),b.on(l.Z.SET_NON_FRAGMENTED_TEXT,Ee,t),b.on(l.Z.SOURCE_BUFFER_ERROR,ge,t),t}re.__dashjs_factory_name="StreamProcessor";const ie=c.Z.getClassFactory(re),ae=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representationId=null,this.endFragment=null};var oe=n(9032);function se(e,t){if(e){if("string"==typeof e)return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ue(e,t):void 0}}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(r.headers.keys());try{for(d.s();!(i=d.n()).done;){var g=i.value;u+=g+": "+r.headers.get(g)+"\r\n"}}catch(e){d.e(e)}finally{d.f()}if(e.response.responseHeaders=u,!r.body)return r.arrayBuffer().then((function(t){e.response.response=t;var n={loaded:t.byteLength,total:t.byteLength,stream:!1};e.progress(n),e.onload(),e.onend()}));var h,p,v,_,T=parseInt(r.headers.get("Content-Length"),10),S=0,b=!1,A=new Uint8Array,I=0;if(m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&o){var R=t,w=0,N=(v=r.body.tee(),_=2,function(e){if(Array.isArray(e))return e}(v)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n}}(v,_)||se(v,_)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),C=N[0],D=N[1];h=C.getReader(),p=[],h.read().then((function r(i){var a=i.value,s=i.done;if(w=Date.now(),a&&a.length){var c=w-R,f=a.length;p.push({chunkDownloadTimeRelativeMS:w-t,chunkDownloadDurationMS:c,chunkBytes:f,kbps:Math.round(8*f/(c/1e3)),bufferLevel:n.getCurrentBufferLevel(l.mediaType)})}if(s){var d=w-t,g=p.reduce((function(e,t){return e+t.chunkBytes}),0);return o.addMeasurement(l,d,p,y,E,u),void e.progress({loaded:g,total:g,lengthComputable:!0,time:o.getEstimatedDownloadDurationMS(l),stream:!0})}return R=Date.now(),h.read().then(r)})),e.reader=D.getReader()}else e.reader=r.body.getReader();var O=[],M=[],P=[],L=!0;c(e,(function t(n){var r=n.value;if(n.done){if(A){if(m!==a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_AAST){var i=null,o=null;m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING?(i=function(e,t){try{var n,r;n=e.filter((function(t,n){return n1){for(var a=0,o=0,s=0;s1)i.push(8*r[s].bytes/u);else{0===o&&(o=n[s].ts);var l=r[s].ts-o;l>1?(i.push(8*a/l),a=0,o=0):a+=r[s].bytes}}if(i.length>0)return i.reduce((function(e,t){return e+t}),0)/i.length}return null}catch(e){return null}}(M,P),i&&(o=8*S/i)):m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA&&(o=f(O,S)),e.progress({loaded:S,total:isNaN(T)?S:T,lengthComputable:!0,time:o,stream:!0})}e.response.response=A.buffer}return e.onload(),void e.onend()}if(r&&r.length>0){A=function(e,t){if(0===e.length)return t;var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(A,r),S+=r.length,O.push({ts:Date.now(),bytes:r.length}),m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&L&&s.findLastTopIsoBoxCompleted(["moof"],A,I).found&&(L=!1,M.push({ts:performance.now(),bytes:r.length}));var u=s.findLastTopIsoBoxCompleted(["moov","mdat"],A,I);if(u.found){var l,d=u.lastCompletedOffset+u.size;m!==a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING||L||(L=!0,P.push({ts:performance.now(),bytes:A.length})),d===A.length?(l=A,A=new Uint8Array):(l=new Uint8Array(A.subarray(0,d)),A=A.subarray(d)),e.progress({data:l.buffer,lengthComputable:!1,noTrace:!0}),I=0}else I=u.lastCompletedOffset,b||(e.progress({lengthComputable:!1,noTrace:!0}),b=!0)}c(e,t)}))})).catch((function(t){e.onerror&&e.onerror(t)}))}))}function c(e,t){e.reader.read().then(t).catch((function(t){e.onerror&&200===e.response.status&&e.onerror(t)}))}function f(e,t){try{if((e=e.filter((function(n){return n.bytes>t/4/e.length}))).length>1){var n=0,r=(e[e.length-1].ts-e[0].ts)/e.length;return e.forEach((function(t,i){var a=e[i+1];if(a){var o=a.ts-t.ts;n+=o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Oe(e,t){if(e){if("string"==typeof e)return Me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Me(e,t):void 0}}function Me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&Ce.Y.indexOf(n[0].schemeIdUri)>=0)return t===a.Z.IMAGE}if(e.ContentComponent_asArray&&e.ContentComponent_asArray.length>0){if(e.ContentComponent_asArray.length>1)return t===a.Z.MUXED;if(e.ContentComponent_asArray[0].contentType===t)return!0}var r=t===a.Z.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(t);if(e.Representation_asArray&&e.Representation_asArray.length){var i=e.Representation_asArray[0].codecs;if(r.test(i))return!0}if(e.hasOwnProperty(o.Z.MIME_TYPE))return r.test(e.mimeType);if(e.Representation_asArray)for(var s,u=0;u0){var t=e.Representation_asArray[0];if(t.hasOwnProperty(o.Z.SEGMENT_TEMPLATE)||t.hasOwnProperty(o.Z.SEGMENT_TIMELINE)||t.hasOwnProperty(o.Z.SEGMENT_LIST)||t.hasOwnProperty(o.Z.SEGMENT_BASE))return!0}return!1}function d(e){return l(e,a.Z.VIDEO)}function g(e){return l(e,a.Z.TEXT)}function h(e){return l(e,a.Z.IMAGE)}function p(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort((function(e,t){return e.bandwidth-t.bandwidth})),e}function m(e,t){return e&&e.Period_asArray&&u(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function y(e){return e&&e.Period_asArray?e.Period_asArray:[]}function E(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===o.Z.DYNAMIC),t}function v(e){return e&&e.EssentialProperty_asArray&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map((function(e){return{schemeIdUri:e.schemeIdUri,value:e.value}})):null}function _(e){if(!e||!e.S_asArray)return NaN;var t=e.S_asArray[0],n=e.S_asArray[1];return t.hasOwnProperty("d")?t.d:n.t-t.t}function T(e,t){if(!e)throw new Error("Period cannot be null or undefined");var n=me.DEFAULT_ID+"_"+t;return e.hasOwnProperty(o.Z.ID)&&e.id.length>0&&"__proto__"!==e.id&&(n=e.id),n}function b(e,t,n){var r,i=[];if(!e)return i;for(r=0;r0&&u(e)?r[e]:null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;for(var r=m(t,n),a=0;a0&&u(e)?n[e]:null},getCodec:function(e,t,n){var r=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var i=u(t)&&t>=0&&t0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(o.Z.CENC_DEFAULT_KID)?e[o.Z.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],n=0;n0&&(n=-1!==e.profiles.indexOf(t)),n},getDuration:function(e){return e&&e.hasOwnProperty(o.Z.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"==e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=NaN;return e&&e.hasOwnProperty(o.Z.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(o.Z.PUBLISH_TIME)?new Date(e[o.Z.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=p(e);return(t&&Array.isArray(t.Representation_asArray)?t.Representation_asArray:[]).map((function(e){return{bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}}))},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&t.Representation_asArray.length>0&&u(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,n,r,i,a=[],s=function(e){if(e&&e.period&&u(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&u(e.index))return p(t.AdaptationSet_asArray[e.index])}}(e);if(s&&s.Representation_asArray){if(e&&e.period&&u(e.period.index)){var l=A(e.period.mpd.manifest);l&&(n=l[0])}for(var f=0,d=s.Representation_asArray.length;f=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n]+)>/g,(function(e,t){return"$"+n[t]})))}if("function"==typeof t){var a=this;return r[Symbol.replace].call(this,e,(function(){var e=[];return e.push.apply(e,arguments),"object"!==Be(e[e.length-1])&&e.push(o(e,a)),t.apply(this,e)}))}return r[Symbol.replace].call(this,e,t)},Ge.apply(this,arguments)}function je(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ve(e,t)}function Ye(e){var t="function"==typeof Map?new Map:void 0;return Ye=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return qe(e,arguments,Ke(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Ve(r,e)},Ye(e)}function qe(e,t,n){return qe=He()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&Ve(i,n.prototype),i},qe.apply(null,arguments)}function He(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Ve(e,t){return Ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ve(e,t)}function Ke(e){return Ke=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ke(e)}var ze="static",We="dynamic",Xe="cmsd-",Qe=Xe+ze,$e=Xe+We,Je="stream",et=["mb","st","sf","v"],tt={video:"v",audio:"a",text:"tt",stream:Je},nt=/^[-0-9]/;function rt(){var e,t,n,r,i=this.context,a=(0,u.Z)(i).getInstance();function o(){n={},r={}}function s(e){e&&Object.keys(e).forEach((function(t){et.includes(t)||delete e[t]}))}function c(e){return!e||"false"!==e.toLowerCase()&&(nt.test(e)?parseInt(e,10):e.replace(/["]+/g,""))}function d(e){try{for(var n={},r=e.split(","),i=0;i=0;c--){var f=u[c].match(Ge(/^((?:(?!:)[\s\S])*):[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(.*)$/,{key:1,value:2}));if(f&&f.groups){var p=f.groups.key.toLowerCase(),m=f.groups.value;switch(p){case Qe:i=d(m),a.trigger(l.Z.CMSD_STATIC_HEADER,i);break;case $e:o||(o=g(m))}}}var y=Je;return i&&i.ot?y=i.ot:t&&(y=h(t)),s(n[y]),s(r[y]),i&&(n[y]=Object.assign(n[y]||{},i)),o&&(r[y]=Object.assign(r[y]||{},o)),{static:i,dynamic:o}},getMaxBitrate:function(e){var t=h(e);return p(We,t,"mb")||-1},getEstimatedThroughput:function(e){var t=h(e);return p(We,t,"etp")||null},getResponseDelay:function(e){var t=h(e);return p(We,t,"rd")||null},getRoundTripTime:function(e){var t=h(e);return p(We,t,"rtt")||null}},t=(0,f.Z)(i).getInstance().getLogger(e),o(),e}rt.__dashjs_factory_name="CmsdModel";const it=c.Z.getSingletonFactory(rt);function at(){var e,t,n=this.context,r={};function i(){t=(0,f.Z)(n).getInstance().getLogger(e)}function a(e){for(var t={},n=0,r=0,i=0,a=0,o=e.length,s=0;se.bitrate&&(n=!1):t=e.bitrate})),n}return e={setup:i,addMeasurement:function(e,t,n,i,o){e&&e.mediaType&&!r[e.mediaType]&&(r[e.mediaType]=[]);var s=e.mediaInfo.bitrateList.find((function(t){return t.id===e.representationId}));r[e.mediaType].push({index:e.index,repId:e.representationId,mediaType:e.mediaType,requestTimeMS:i,adjustedAvailabilityStartTimeMS:e.availabilityStartTime.getTime(),segDurationMS:1e3*e.duration,chunksDurationMS:n.reduce((function(e,t){return e+t.chunkDownloadDurationMS}),0),segmentBytes:n.reduce((function(e,t){return e+t.chunkBytes}),0),bitrate:s&&s.bandwidth,bitrateList:e.mediaInfo.bitrateList,chunkMeasurements:n,fetchDownloadDurationMS:t,throughputCapacityDelayMS:o,getEstimatedBufferLevel:a(n.slice(1))}),r[e.mediaType].length>10&&r[e.mediaType].shift()},getThroughputCapacityDelayMS:function(e,t){var n=r[e.mediaType]&&r[e.mediaType].slice(-3);return!n||n.length<3?0:o(n)?t/4>250?250:t/4:0},getEstimatedDownloadDurationMS:function(e){var n=r[e.mediaType].slice(-1).pop(),i=r[e.mediaType].slice(-3),a=n.chunkMeasurements.slice(-1).pop().chunkDownloadTimeRelativeMS;n.bufferLevelAtSegmentStart=n.getEstimatedBufferLevel(a/2),n.bufferLevelAtSegmentEnd=n.getEstimatedBufferLevel(a);var s=o(i),u=s?.6:.8;if(n.isBufferStable&&1.05*n.segDurationMS.2*n.chunkMeasurements.length){var p=c/f,m=n.segmentBytes/p;return n.fetchDownloadDurationMSn.bitrate)return y=e.bandwidth,!0})),y===n.bitrate?n.fetchDownloadDurationMS*u:u*n.segmentBytes*8*1e3/y}},i(),e}at.__dashjs_factory_name="LowLatencyThroughputModel";const ot=c.Z.getSingletonFactory(at);var st=n(5717);function ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lt(e){e=e||{};var t,n,r,i,o,s,c,d,g,h,p,m=this.context,y=e.errHandler,E=e.dashMetrics,v=e.mediaPlayerModel,_=e.requestModifier,T=e.boxParser,b=e.errors,A=e.requestTimeout||0,I=(0,u.Z)(m).getInstance(),R=(0,N.Z)(m).getInstance();function w(e,t){var u,f=e.request,p=[],b=!0,N=!0,D=new Date,O=D,M=0,P=null;if(!_||!E||!y)throw new Error("config object is not correct or missing");var L,x=function(e){if(N=!1,f.requestStartDate=D,f.requestEndDate=new Date,f.firstByteDate=f.firstByteDate||D,f.fileLoaderType=P,!f.checkExistenceOnly){var t=u.response?u.response.responseURL:null,n=u.response?u.response.status:null,r=u.response&&u.response.getAllResponseHeaders?u.response.getAllResponseHeaders():u.response?u.response.responseHeaders:null,i=R.get().streaming.cmsd&&R.get().streaming.cmsd.enabled?c.parseResponseHeaders(r,f.mediaType):null;E.addHttpRequest(f,t,n,r,e?p:null,i),f.type===C.w.MPD_TYPE&&E.addManifestUpdate(f)}},F=function(){if(-1!==n.indexOf(u)&&(n.splice(n.indexOf(u),1),N))if(x(!1),t>0){try{R.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&f.type===C.w.MEDIA_SEGMENT_TYPE&&v.getRetryAttemptsForType(C.w.MEDIA_SEGMENT_TYPE)===t&&I.trigger(l.Z.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var r={config:e};i.push(r),r.timeout=setTimeout((function(){-1!==i.indexOf(r)&&(i.splice(i.indexOf(r),1),w(e,t))}),v.getRetryIntervalsForType(f.type))}else{if(f.type===C.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;y.error(new S.Z(o[f.type],f.url+" is not available",{request:f,response:u.response})),e.error&&e.error(f,"error",u.response.statusText),e.complete&&e.complete(f,u.response.statusText)}};f.hasOwnProperty("availabilityTimeComplete")&&!1===f.availabilityTimeComplete&&window.fetch&&"arraybuffer"===f.responseType&&f.type===C.w.MEDIA_SEGMENT_TYPE?((L=ce(m).create({requestModifier:_,lowLatencyThroughputModel:g,boxParser:T})).setup({dashMetrics:E}),P=a.Z.FILE_LOADER_TYPES.FETCH):(L=(0,oe.Z)(m).create({requestModifier:_}),P=a.Z.FILE_LOADER_TYPES.XHR);var k=null,Z=_.modifyRequestURL?_.modifyRequestURL(f.url):f.url;if(R.get().streaming.cmcd&&R.get().streaming.cmcd.enabled){var U=R.get().streaming.cmcd.mode;if(U===a.Z.CMCD_MODE_QUERY){var B=function(e){try{var t=[],n=s.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(f);Z=xe.Z.addAditionalQueryParameterToUrl(Z,B)}else U===a.Z.CMCD_MODE_HEADER&&(k=s.getHeaderParameters(f))}f.url=Z;var G=f.checkExistenceOnly?C.w.HEAD:C.w.GET,j=d.getXHRWithCredentialsForType(f.type);u={url:Z,method:G,withCredentials:j,request:f,onload:function(){u.response.status>=200&&u.response.status<=299&&(x(!0),e.success&&e.success(u.response.response,u.response.statusText,u.response.responseURL),e.complete&&e.complete(f,u.response.statusText))},onend:F,onerror:F,progress:function(t){var n=new Date;b&&(b=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(f.firstByteDate=n)),t.lengthComputable&&(f.bytesLoaded=t.loaded,f.bytesTotal=t.total),t.noTrace||(p.push({s:O,d:t.time?t.time:n.getTime()-O.getTime(),b:[t.loaded?t.loaded-M:0]}),O=n,M=t.loaded),e.progress&&t&&e.progress(t)},onabort:function(){e.abort&&e.abort(f)},ontimeout:function(e){var t;if(e.lengthComputable){var n=e.loaded/e.total*100;t="Request timeout: loaded: "+e.loaded+", out of: "+e.total+" : "+n.toFixed(3)+"% Completed"}else t="Request timeout: non-computable download size";h.warn(t)},loader:L,timeout:A,headers:k};var Y=(new Date).getTime();if(isNaN(f.delayLoadingTime)||Y>=f.delayLoadingTime)n.push(u),L.load(u);else{var q={httpRequest:u};r.push(q),q.delayTimeout=setTimeout((function(){if(-1!==r.indexOf(q)){r.splice(r.indexOf(q),1);try{D=new Date,O=D,n.push(q.httpRequest),L.load(q.httpRequest)}catch(e){q.httpRequest.onerror()}}}),f.delayLoadingTime-Y)}}return t={load:function(e){e.request?w(e,v.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){i.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),i=[],r.forEach((function(e){return clearTimeout(e.delayTimeout)})),r=[],n.forEach((function(e){e.request.type!==C.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))})),n=[]}},h=(0,f.Z)(m).getInstance().getLogger(t),n=[],r=[],i=[],s=Ue(m).getInstance(),c=it(m).getInstance(),g=ot(m).getInstance(),d=(0,st.Z)(m).getInstance(),ut(p={},C.w.MPD_TYPE,b.DOWNLOAD_ERROR_ID_MANIFEST_CODE),ut(p,C.w.XLINK_EXPANSION_TYPE,b.DOWNLOAD_ERROR_ID_XLINK_CODE),ut(p,C.w.INIT_SEGMENT_TYPE,b.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),ut(p,C.w.MEDIA_SEGMENT_TYPE,b.DOWNLOAD_ERROR_ID_CONTENT_CODE),ut(p,C.w.INDEX_SEGMENT_TYPE,b.DOWNLOAD_ERROR_ID_CONTENT_CODE),ut(p,C.w.BITSTREAM_SWITCHING_SEGMENT_TYPE,b.DOWNLOAD_ERROR_ID_CONTENT_CODE),ut(p,C.w.OTHER_TYPE,b.DOWNLOAD_ERROR_ID_CONTENT_CODE),o=p,t}lt.__dashjs_factory_name="HTTPLoader";const ct=c.Z.getClassFactory(lt);function ft(){var e;function t(){e={}}function n(){t()}return n(),{getLoader:function(t){for(var n in e)if(e.hasOwnProperty(n)&&t.startsWith(n))return e[n];return ct},registerLoader:function(t,n){e[t]=n},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:n}}ft.__dashjs_factory_name="SchemeLoaderFactory";const dt=c.Z.getSingletonFactory(ft);function gt(e){e=e||{};var t,n,r=this.context;return t=dt(r).getInstance(),{load:function(i){if(!n){var a=t.getLoader(i&&i.request?i.request.url:null);n=a(r).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,requestTimeout:isNaN(e.requestTimeout)?0:e.requestTimeout,errors:e.errors})}n.load(i)},abort:function(){n&&n.abort()}}}gt.__dashjs_factory_name="URLLoader";const ht=c.Z.getClassFactory(gt);function pt(e){return pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pt(e)}function mt(e,t){return mt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},mt(e,t)}function yt(e,t){return!t||"object"!==pt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Et(e){return Et=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Et(e)}const vt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mt(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Et(t);if(n){var i=Et(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return yt(this,e)});function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=r.call(this,e)).checkForExistenceOnly=!0,t}return i}(p.Z);function _t(e){e=e||{};var t,n,r=this.context,i=e.eventBus,o=e.events,s=e.urlUtils,u=e.errors,l=e.streamId;return t={checkForExistence:function(e){var t=function(t){i.trigger(o.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){var r=new vt(e.url);n.load({request:r,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){var r=function(n,r){i.trigger(o.LOADING_COMPLETED,{request:e,response:n||null,error:r||null,sender:t})};e?n.load({request:e,progress:function(n){i.trigger(o.LOADING_PROGRESS,{request:e,stream:n.stream,streamId:l}),n.data&&i.trigger(o.LOADING_DATA_PROGRESS,{request:e,response:n.data||null,error:null,sender:t})},success:function(e){r(e)},error:function(e,t,n){r(void 0,new S.Z(u.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,n,t))},abort:function(e){e&&i.trigger(o.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:t})}}):r(void 0,new S.Z(u.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,u.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){n&&n.abort()},reset:function(){n&&(n.abort(),n=null)}},n=ht(r).create({errHandler:e.errHandler,errors:u,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:s,constants:a.Z,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),t}_t.__dashjs_factory_name="FragmentLoader";const Tt=c.Z.getClassFactory(_t);function St(){return{modifyResponseAsync:function(e){return Promise.resolve(e)}}}St.__dashjs_factory_name="SegmentResponseModifier";const bt=c.Z.getSingletonFactory(St);function At(e){e=e||{};var t,n,r,i=this.context,o=(0,u.Z)(i).getInstance(),s=e.errHandler,c=e.mediaPlayerModel,g=e.dashMetrics,h=(0,f.Z)(i).getInstance(),p=bt(i).getInstance(),m=e.streamInfo;function y(){return m.id}function E(){for(var e in r)r[e].reset();r={}}function v(e){if(e.sender){var t=e.request,r=e.response,i=t.isInitializationRequest(),s=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType===a.Z.AUDIO||t.mediaType===a.Z.VIDEO||t.mediaType===a.Z.TEXT&&t.mediaInfo.isFragmented)&&o.trigger(l.Z.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation}),r&&s){var u=function(e,t,n,r){var i=new ae;return i.streamId=n,i.mediaInfo=t.mediaInfo,i.segmentType=t.type,i.start=t.startTime,i.duration=t.duration,i.end=i.start+i.duration,i.bytes=e,i.index=t.index,i.quality=t.quality,i.representationId=t.representationId,i.endFragment=r,i}(r,t,m.id,e.type!==l.Z.FRAGMENT_LOADING_PROGRESS);p.modifyResponseAsync(u).then((function(e){o.trigger(i?l.Z.INIT_FRAGMENT_LOADED:l.Z.MEDIA_FRAGMENT_LOADED,{chunk:e,request:t},{streamId:s.id,mediaType:t.mediaType})})).catch((function(e){n.error(e),o.trigger(i?l.Z.INIT_FRAGMENT_LOADED:l.Z.MEDIA_FRAGMENT_LOADED,{chunk:u,request:t},{streamId:s.id,mediaType:t.mediaType})}))}else n.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return t={getStreamId:y,getModel:function(t){var n=r[t];return n||(n=T(i).create({streamInfo:m,type:t,dashMetrics:g,fragmentLoader:Tt(i).create({dashMetrics:g,mediaPlayerModel:c,errHandler:s,requestModifier:(0,X.Z)(i).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:o,events:l.Z,errors:w,dashConstants:e.dashConstants,urlUtils:e.urlUtils,streamId:y()}),debug:h,eventBus:o,events:l.Z}),r[t]=n),n},reset:function(){o.off(d.Z.FRAGMENT_LOADING_COMPLETED,v,this),o.off(d.Z.FRAGMENT_LOADING_PROGRESS,v,this),E()}},n=h.getLogger(t),E(),o.on(d.Z.FRAGMENT_LOADING_COMPLETED,v,t),o.on(d.Z.FRAGMENT_LOADING_PROGRESS,v,t),t}At.__dashjs_factory_name="FragmentController";const It=c.Z.getClassFactory(At),Rt=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=null,this.width=null,this.height=null,this.x=null,this.y=null},wt=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN};function Nt(e){var t,n,r=this.context,i=e.streamInfo;function o(e){n.setTrackByIndex(e)}function s(){n&&n.reset()}return t={getStreamId:function(){return i.id},initialize:function(){n.addTracks();var e=n.getTracks();e&&e.length>0&&o(0)},provide:function(e,t){if("function"==typeof t){var r,i,a=n.getCurrentTrack();if(!a||a.segmentDuration<=0||null==e)t(null);else{(i=n.getThumbnailRequestForTime(e))&&(a.segmentDuration=i.duration),r=e%a.segmentDuration;var o=Math.floor(r*a.tilesHor*a.tilesVert/a.segmentDuration),s=new Rt;if(s.width=Math.floor(a.widthPerTile),s.height=Math.floor(a.heightPerTile),s.x=Math.floor(o%a.tilesHor)*a.widthPerTile,s.y=Math.floor(o/a.tilesHor)*a.heightPerTile,"readThumbnail"in a)return a.readThumbnail(e,(function(e){s.url=e,t(s)}));if(i)s.url=i.url,a.segmentDuration=NaN;else{var u=Math.floor(e/a.segmentDuration);s.url=function(e,t){var n=t+e.startNumber,r=(0,H.vi)(e.templateUrl,"Number",n);return r=(0,H.vi)(r,"Time",(n-1)*e.segmentDuration*e.timescale),r=(0,H.vi)(r,"Bandwidth",e.bandwidth),(0,H.eR)(r)}(a,u)}t(s)}}},setTrackByIndex:o,getCurrentTrackIndex:function(){return n.getCurrentTrackIndex()},getBitrateList:function(){var e=n.getTracks(),t=0;return e.map((function(e){var n=new wt;return n.mediaType=a.Z.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:s},s(),n=(0,Ce.Z)(r).create({streamInfo:i,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),t}Nt.__dashjs_factory_name="ThumbnailController";const Ct=c.Z.getClassFactory(Nt);function Dt(e){var t;e=e||{};var n=[],r=(0,u.Z)(this.context).getInstance(),i=e.updateEventName,a=e.addBlacklistEventName;function o(e){-1===n.indexOf(e)&&(n.push(e),r.trigger(i,{entry:e}))}return t={add:o,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.indexOf(e)},reset:function(){n=[]}},a&&r.on(a,(function(e){o(e.entry)}),t),t}Dt.__dashjs_factory_name="BlackListController";const Ot=c.Z.getClassFactory(Dt);var Mt=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT,a.Z.MUXED,a.Z.IMAGE];function Pt(e){e=e||{};var t,n,r,i,s,c,d,g,h,p,m,y,E,v,_,T,b,A,I=this.context,R=(0,u.Z)(I).getInstance(),N=(0,Q.Z)(I).getInstance(),C=e.manifestModel,D=e.mediaPlayerModel,O=e.dashMetrics,M=e.manifestUpdater,P=e.adapter,L=e.timelineConverter,x=e.capabilities,F=e.errHandler,k=e.abrController,Z=e.playbackController,U=e.eventController,B=e.mediaController,G=e.protectionController,j=e.textController,Y=e.videoModel,q=e.streamInfo,H=e.settings;function V(e,t){return new Promise((function(i,o){re(),p=!0,oe();var s,u=Y.getElement();Mt.forEach((function(t){(t!==a.Z.TEXT||e)&&(t!==a.Z.VIDEO||!u||u&&/^VIDEO$/i.test(u.nodeName))&&K(t,e)})),(s=t,new Promise((function(e){var t={},n=r.map((function(e){return e.createBufferSinks(s)}));Promise.all(n).then((function(n){n.forEach((function(e){e&&(t[e.getType()]=e)})),e(t)})).catch((function(){e(t)}))}))).then((function(t){if(p=!1,0===r.length){var a="No streams to play.";F.error(new S.Z(w.MANIFEST_ERROR_ID_NOSTREAMS_CODE,a,C.getValue())),n.fatal(a)}else se();e&&j.createTracks(q),i(t)})).catch((function(e){o(e)}))}))}function K(t,i){var s,u=P.getAllMediaInfoForType(q,t),c=[],f=null;if(u&&0!==u.length){t===a.Z.VIDEO&&(d=!0),t===a.Z.AUDIO&&(g=!0);for(var h=0,p=u.length;h0&&(B.setInitialMediaSettingsForType(t,q),j.addMediaInfosToBuffer(q,t,c)),u=u.filter((function(e){return!e.isEmbedded})),0!==u.length)if(t!==a.Z.IMAGE){R.trigger(l.Z.STREAM_INITIALIZING,{streamInfo:q,mediaInfo:f}),B.setInitialMediaSettingsForType(t,q);var v=function(t,n){var i=t&&t.length>0?t[0]:null,o=m.getModel(i?i.type:null),s=i?i.type:null,u=i?i.mimeType:null,l=i?i.isFragmented:null,c=ie(I).create({streamInfo:q,type:s,mimeType:u,timelineConverter:L,adapter:P,manifestModel:C,mediaPlayerModel:D,fragmentModel:o,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,segmentBaseController:e.segmentBaseController,abrController:k,playbackController:Z,mediaController:B,textController:j,errHandler:F,settings:H,boxParser:_,segmentBlacklistController:E});c.initialize(n,d,l),r.push(c);for(var f=0;f0&&U.addInlineEvents(e,q.id)}}function se(){for(var e=r.length,t=h.audio||h.video?new S.Z(w.DATA_UPDATE_FAILED_ERROR_CODE,w.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,n=0;n0&&e.Representation[0].ContentProtection)}function me(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!e.hasOwnProperty("getStreamInfo"))return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():ne();if(!r||!i)return!1;var a=P.getAdaptationForType(r.index,t,r),o=P.getAdaptationForType(i.index,t,i);if(!a||!o)return!a&&!o;var s=a&&o&&a.mimeType===o.mimeType,u=o.Representation_asArray.map((function(e){return e.codecs})),l=a.Representation_asArray.map((function(e){return e.codecs})),c=l.some((function(e){return u.indexOf(e)>-1})),f=l.some((function(e){return u.some((function(t){return x.codecRootCompatibleWithCodec(t,e)}))}));return c||f&&s}function ye(e){v=e}function Ee(){return v}return t={initialize:function(){R.on(l.Z.BUFFERING_COMPLETED,ue,t),R.on(l.Z.DATA_UPDATE_COMPLETED,le,t),R.on(l.Z.INBAND_EVENTS,ce,t),G&&(R.on(l.Z.KEY_ERROR,ae,t),R.on(l.Z.SERVER_CERTIFICATE_UPDATED,ae,t),R.on(l.Z.LICENSE_REQUEST_COMPLETE,ae,t),R.on(l.Z.KEY_SYSTEM_SELECTED,ae,t),R.on(l.Z.KEY_SESSION_CREATED,ae,t),R.on(l.Z.KEY_STATUSES_CHANGED,ae,t)),j.initializeForStream(q),R.trigger(l.Z.STREAM_UPDATED,{streamInfo:q})},getStreamId:function(){return q?q.id:null},activate:function(e,t){return new Promise((function(n,r){if(!s)return Ee()?(s=!0,R.trigger(l.Z.STREAM_ACTIVATED,{streamInfo:q}),void n(t)):void function(e,t){return V(e,t)}(e,t).then((function(e){s=!0,R.trigger(l.Z.STREAM_ACTIVATED,{streamInfo:q}),n(e)})).catch((function(e){r(e)}));n(t)}))},deactivate:W,getIsActive:function(){return s},getDuration:function(){return q?q.duration:NaN},getStartTime:ee,getId:te,getStreamInfo:ne,getHasAudioTrack:function(){return g},getHasVideoTrack:function(){return d},startPreloading:function(e,t){return new Promise((function(i,a){Ee()?a():(n.info("[startPreloading] Preloading next stream with id ".concat(te())),ye(!0),V(e,t).then((function(){for(var e=0;e0;){var e=A.pop(),t=e.newMediaInfo,r=fe(e.oldMediaInfo);if(!r)return;n.push(r.prepareTrackSwitch()),r.selectMediaInfo(t)}return Promise.all(n)})).then((function(){p=!1,se(),R.trigger(l.Z.STREAM_UPDATED,{streamInfo:q}),t()}))}))},reset:function(e){m&&(m.reset(),m=null),k&&q&&k.clearDataForStream(q.id),E&&(E.reset(),E=null),X(e),q=null,R.off(l.Z.DATA_UPDATE_COMPLETED,le,t),R.off(l.Z.BUFFERING_COMPLETED,ue,t),R.off(l.Z.INBAND_EVENTS,ce,t),G&&(R.off(l.Z.KEY_ERROR,ae,t),R.off(l.Z.SERVER_CERTIFICATE_UPDATED,ae,t),R.off(l.Z.LICENSE_REQUEST_COMPLETE,ae,t),R.off(l.Z.KEY_SYSTEM_SELECTED,ae,t),R.off(l.Z.KEY_SESSION_CREATED,ae,t),R.off(l.Z.KEY_STATUSES_CHANGED,ae,t))},getProcessors:ge,setMediaSource:function(e){return new Promise((function(t,i){for(var a=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:null;return me(e,a.Z.VIDEO,t)&&me(e,a.Z.AUDIO,t)},isProtectionCompatible:function(e){return!e||he(a.Z.VIDEO,e)&&he(a.Z.AUDIO,e)},getPreloaded:Ee,getIsEndedEventSignaled:function(){return b},setIsEndedEventSignaled:J,getAdapter:function(){return P},getHasFinishedBuffering:function(){return c},setPreloaded:ye,startScheduleControllers:function(){for(var e=r.length,t=0;t0&&void 0!==arguments[0]&&arguments[0];s=!0;var t=g.getValue(),n=t.url,r=h.getPatchLocation(t),i=h.getLocation(t);r&&!e?n=r:i&&(n=i),v.isRelative(n)&&(n=v.resolve(n,t.url)),c.load(n)}function A(e){if(e){if(h.getIsPatch(e)){var r=e;e=g.getValue();var u=h.isPatchValid(e,r),c=u;if(u){var f=h.getPublishTime(e);c=h.applyPatchToManifest(e,r);var d=h.getPublishTime(e);c=f.getTime()!=d.getTime()}if(!c)return t.debug("Patch provided is invalid, performing full manifest refresh"),void b(!0);e.loadedTime=new Date}}else(e=g.getValue()).loadedTime=new Date;if(g.getValue()&&g.getValue().type===o.Z.DYNAMIC&&e.type===o.Z.STATIC)return E.trigger(l.Z.DYNAMIC_TO_STATIC),s=!1,void(a=!0);g.setValue(e);var p=new Date,m=(p.getTime()-e.loadedTime.getTime())/1e3;1e3*(n=h.getManifestUpdatePeriod(e,m))>2147483647&&(n=2147483.647),E.trigger(l.Z.MANIFEST_UPDATED,{manifest:e}),t.info("Manifest has been refreshed at "+p+"["+p.getTime()/1e3+"] "),i||S()}function I(){i||(s?S(m.get().streaming.manifestUpdateRetryInterval):b())}function R(e){e.error?e.error.code===w.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&p.error(e.error):A(e.manifest)}function N(){i=!1,S()}function C(){(i=!m.get().streaming.scheduling.scheduleWhilePaused)&&T()}function D(){s=!1}return e={initialize:function(){_(),E.on(l.Z.STREAMS_COMPOSED,D,this),E.on(d.Z.PLAYBACK_STARTED,N,this),E.on(d.Z.PLAYBACK_PAUSED,C,this),E.on(l.Z.INTERNAL_MANIFEST_LOADED,R,this)},setManifest:function(e){A(e)},refreshManifest:b,getIsUpdating:function(){return s},setConfig:function(e){e&&(e.manifestModel&&(g=e.manifestModel),e.adapter&&(h=e.adapter),e.manifestLoader&&(c=e.manifestLoader),e.errHandler&&(p=e.errHandler),e.settings&&(m=e.settings))},reset:function(){E.off(d.Z.PLAYBACK_STARTED,N,this),E.off(d.Z.PLAYBACK_PAUSED,C,this),E.off(l.Z.STREAMS_COMPOSED,D,this),E.off(l.Z.INTERNAL_MANIFEST_LOADED,R,this),_()}},t=(0,f.Z)(y).getInstance().getLogger(e),e}xt.__dashjs_factory_name="ManifestUpdater";const Ft=c.Z.getClassFactory(xt);function kt(){var e,t,n,r,i,a,o,s,c,d,g,h,p,m,y,E,v=this.context,_=(0,u.Z)(v).getInstance(),T=(0,Q.Z)(v).getInstance();function b(){s=[],c=[],d=null,g=null,p=null,h=NaN,n=!1,r=!1,m=i.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function A(){i.get().streaming.utcSynchronization.enabled&&!n&&!r&&p&&p.value&&p.schemeIdUri&&!isNaN(h)&&!isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)&&(g&&(Date.now()-g)/1e3<30||(s=[],r=!0,I(isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)?2:i.get().streaming.utcSynchronization.backgroundAttempts)))}function I(e){try{if(e<=0)return void B();var t=Date.now();a[p.schemeIdUri](p.value,(function(n){var r=Date.now(),i=N(t,r,n);s.push(i),I(e-1)}),(function(){B()}))}catch(e){B()}}function R(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e||0;if(!c||0===c.length||t>=c.length)D();else{var n=c[t];if(n)if(a.hasOwnProperty(n.schemeIdUri)){var r=(new Date).getTime();a[n.schemeIdUri](n.value,(function(e){var t=(new Date).getTime(),i=N(r,t,e);p=n,D(i)}),(function(){R(t+1)}))}else R(t+1);else D()}}function N(e,t,n){return n-(t-(t-e)/2)}function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,t=isNaN(e);t&&i.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?Z():U(t,e)}function O(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t,n,r=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&(parseInt(r[6],10)||0),r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]&&(n=60*parseInt(r[9],10)+parseInt(r[10],10),t+=("+"===r[8]?-1:1)*n*60*1e3),new Date(t).getTime()}(e)),t}function M(e){return Date.parse(e)}function P(e){return Date.parse(e)}function L(e,t,n){n()}function x(e,t,n){var r=O(e);isNaN(r)?n():t(r)}function F(e,t,n,r,i){var a,o,s=!1,u=new XMLHttpRequest,l=i?C.w.HEAD:C.w.GET,c=t.match(/\S+/g);if(t=c.shift(),a=function(){s||(s=!0,c.length?F(e,c.join(" "),n,r,i):r())},o=function(){var t,r;200===u.status&&(t=i?u.getResponseHeader("Date"):u.response,r=e(t),isNaN(r)||(n(r),s=!0))},T.isRelative(t)){var f=E.resolve();f&&(t=T.resolve(t,f.url))}u.open(l,t),u.timeout=5e3,u.onload=o,u.onloadend=a,u.send()}function k(e,t,n){F(P,e,t,n,!0)}function Z(){var e=o.getLatestMPDRequestHeaderValueByID("Date"),t=null!==e?new Date(e).getTime():Number.NaN;isNaN(t)?U(!0):U(!1,t-Date.now())}function U(e,r){if(isNaN(h)||isNaN(r)||e||function(e){try{var n,r=G(e),a=isNaN(m)?30:m,o=isNaN(i.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:i.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,s=isNaN(i.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:i.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,u=isNaN(i.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:i.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;r?(n=Math.min(a*o,s),t.debug("Increasing timeBetweenSyncAttempts to ".concat(n))):(n=Math.max(a/o,u),t.debug("Decreasing timeBetweenSyncAttempts to ".concat(n))),m=n}catch(e){}}(r),!e&&!isNaN(r)){d=Date.now(),n=!1;var a=isNaN(h);h=r,a&&A(),t.debug("Completed UTC sync. Setting client - server offset to ".concat(r))}e&&(p=null,n=!1,y.error(new S.Z(w.TIME_SYNC_FAILED_ERROR_CODE,w.TIME_SYNC_FAILED_ERROR_MESSAGE))),_.trigger(l.Z.UPDATE_TIME_SYNC_OFFSET,{offset:r}),_.trigger(l.Z.TIME_SYNCHRONIZATION_COMPLETED)}function B(){if(s&&0!==s.length){var e=s.reduce((function(e,t){return e+t}),0)/s.length;G(e)?t.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(t.debug("Completed background UTC sync. Setting client - server offset to ".concat(e)),h=e,_.trigger(l.Z.UPDATE_TIME_SYNC_OFFSET,{offset:h})),r=!1,g=Date.now()}}function G(e){try{if(isNaN(h))return!0;var t=i.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(i.get().streaming.utcSynchronization.maximumAllowedDrift)?i.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=h-t&&e<=h+t}catch(e){return!0}}return e={initialize:function(){b(),a={"urn:mpeg:dash:utc:http-head:2014":k,"urn:mpeg:dash:utc:http-xsdate:2014":F.bind(null,O),"urn:mpeg:dash:utc:http-iso:2014":F.bind(null,M),"urn:mpeg:dash:utc:direct:2014":x,"urn:mpeg:dash:utc:http-head:2012":k,"urn:mpeg:dash:utc:http-xsdate:2012":F.bind(null,O),"urn:mpeg:dash:utc:http-iso:2012":F.bind(null,M),"urn:mpeg:dash:utc:direct:2012":x,"urn:mpeg:dash:utc:http-ntp:2014":L,"urn:mpeg:dash:utc:ntp:2014":L,"urn:mpeg:dash:utc:sntp:2014":L}},attemptSync:function(e,t){c=e,n||(function(e){try{if(!e||!i.get().streaming.utcSynchronization.enabled)return!1;var t=isNaN(m)?30:m;return!(d&&t&&!isNaN(t))||(Date.now()-d)/1e3>=t}catch(e){return!0}}(t)?(n=!0,R()):_.trigger(l.Z.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(e){e&&(e.dashMetrics&&(o=e.dashMetrics),e.baseURLController&&(E=e.baseURLController),e.errHandler&&(y=e.errHandler),e.settings&&(i=e.settings))},reset:function(){b(),_.off(l.Z.ATTEMPT_BACKGROUND_SYNC,A,e)}},t=(0,f.Z)(v).getInstance().getLogger(e),_.on(l.Z.ATTEMPT_BACKGROUND_SYNC,A,e),e}kt.__dashjs_factory_name="TimeSyncController";var Zt=c.Z.getSingletonFactory(kt);Zt.HTTP_TIMEOUT_MS=5e3,c.Z.updateSingletonFactory(kt.__dashjs_factory_name,Zt);const Ut=Zt;function Bt(){var e,t,n,r=this.context;return e={createMediaSource:function(){var e="WebKitMediaSource"in window;return"MediaSource"in window?t=new MediaSource:e&&(t=new WebKitMediaSource),t},attachMediaSource:function(e){var n=window.URL.createObjectURL(t);return e.setSource(n),n},detachMediaSource:function(e){e.setSource(null)},setDuration:function e(r){t&&"open"===t.readyState&&(null===r&&isNaN(r)||t.duration!==r&&(function(e){for(var t=e.sourceBuffers,n=0;n=0&&e0?Math.max(0,i):0,b(r,i,e),b(n,i,e),A(r),A(n),a=e,c=!1}}catch(e){c=!1,t.error(e)}}function b(e,n,r){try{N(e,(function(i){if(void 0!==i){var a=isNaN(i.duration)?0:i.duration;i.calculatedPresentationTime<=r&&i.calculatedPresentationTime+n+a>=r?D(i,d.Z.EVENT_MODE_ON_START):(C(r,a+n,i.calculatedPresentationTime)||function(e){try{var n=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>n}catch(e){return t.error(e),!1}}(i))&&(t.debug("Removing event ".concat(i.id," from period ").concat(i.eventStream.period.id," as it is expired or invalid")),function(e,n){try{var r=n.eventStream.schemeIdUri,i=n.eventStream.period.id,a=n.eventStream.value,o=n.id;e[i][r]=e[i][r].filter((function(e){return a&&e.eventStream.value&&e.eventStream.value!==a||e.id!==o})),0===e[i][r].length&&delete e[i][r]}catch(e){t.error(e)}}(e,i))}}))}catch(e){t.error(e)}}function A(e){try{for(var n in e)e.hasOwnProperty(n)&&0===Object.keys(e[n]).length&&delete e[n]}catch(e){t.error(e)}}function I(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.eventStream.schemeIdUri,i=e.eventStream.value,a=e.id,o=p;t[r]||(t[r]=[]);var s=t[r].findIndex((function(e){return(!i||e.eventStream.value&&e.eventStream.value===i)&&e.id===a}));if(-1===s)t[r].push(e),e.triggeredReceivedEvent=!1,e.triggeredStartEvent=!1,o=y;else if(n){var u=t[r][s];e.triggeredReceivedEvent=u.triggeredReceivedEvent,e.triggeredStartEvent=u.triggeredStartEvent,t[r][s]=e,o=m}return o}function R(e){try{if(1==e.eventStream.value){var n,r=e.calculatedPresentationTime;n=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,v.trigger(d.Z.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:r,newDuration:n,newManifestValidAfter:NaN},{mode:d.Z.EVENT_MODE_ON_START})}}catch(e){t.error(e)}}function w(e){try{var n=s.getTime();N(e,(function(e){var t=e.eventStream&&e.eventStream.period&&!isNaN(e.eventStream.period.duration)?e.eventStream.period.duration:NaN,r=e.eventStream&&e.eventStream.period&&!isNaN(e.eventStream.period.start)?e.eventStream.period.start:NaN;if(!isNaN(t)&&!isNaN(r)){var i=e.calculatedPresentationTime;Math.abs(i-n)<300&&D(e,d.Z.EVENT_MODE_ON_START)}}))}catch(e){t.error(e)}}function N(e,n){try{if(e)for(var r=Object.keys(e),i=0;ir}catch(e){return t.error(e),!1}}function D(e,n){try{var r=s.getTime(),i=e.id;if(n===d.Z.EVENT_MODE_ON_RECEIVE&&!e.triggeredReceivedEvent)return t.debug("Received event ".concat(i)),e.triggeredReceivedEvent=!0,void v.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n});e.triggeredStartEvent||(e.eventStream.schemeIdUri===h&&1==e.eventStream.value?0===e.duration&&0===e.presentationTimeDelta||(t.debug("Starting manifest refresh event ".concat(i," at ").concat(r)),function(){try{_(),o.refreshManifest()}catch(e){t.error(e)}}()):"urn:mpeg:dash:event:callback:2015"===e.eventStream.schemeIdUri&&1==e.eventStream.value?(t.debug("Starting callback event ".concat(i," at ").concat(r)),function(e){try{(0,oe.Z)(E).create({}).load({method:"get",url:e,request:{responseType:"arraybuffer"}})}catch(e){t.error(e)}}(e.messageData)):(t.debug("Starting event ".concat(i," from period ").concat(e.eventStream.period.id," at ").concat(r)),v.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n})),e.triggeredStartEvent=!0)}catch(e){t.error(e)}}return e={addInlineEvents:function(e,r){try{if(_(),n[r]||(n[r]={}),e)for(var i=0;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&h.updateManifestUpdateInfo({currentTime:G.getTime(),buffered:B.getBufferRange(),presentationStartTime:e[0].start,clientTimeOffset:N.getClientTimeOffset()}),C.length>0&&function(e){0!==e.length?C=C.filter((function(n){var r=e.filter((function(e){return e.id===n.getId()})).length>0||n.getId()===D.getId();return r||(t.debug("Removing stream ".concat(n.getId())),n.reset(!0)),r})):t.warn("No periods included in the current manifest. Skipping the filtering of outdated stream objects.")}(e);for(var n=[],r=0,i=e.length;r2&&void 0!==arguments[2]&&arguments[2];function a(){if(U&&"open"===U.readyState){t.debug("MediaSource is open!"),window.URL.revokeObjectURL(r),U.removeEventListener("sourceopen",a),U.removeEventListener("webkitsourceopen",a),xe();var o=h.getCurrentDVRInfo();p.setSeekable(o.range.start,o.range.end),i?D.setMediaSource(U).then((function(){D.initializeForTextWithMediaSource(U)})):pe(e,n)}}function o(){U.addEventListener("sourceopen",a,!1),U.addEventListener("webkitsourceopen",a,!1),r=p.attachMediaSource(B),t.debug("MediaSource attached to element. Waiting on open...")}U?n?pe(e,n):(p.detachMediaSource(B),o()):(U=p.createMediaSource(),o())}function pe(e,t){D.activate(U,t?W:void 0,e).then((function(t){if(t){var n=Object.keys(t);n.length>0&&t[n[0]].getBuffer().changeType&&(Q=!0),W=t}isNaN(e)||(oe.trigger(l.Z.SEEK_TARGET,{time:e},{streamId:D.getId()}),G.seek(e,!1,!0),D.startScheduleControllers()),F=!1,oe.trigger(l.Z.PERIOD_SWITCH_COMPLETED,{toStreamInfo:Ve()})}))}function me(e){var t=Se(e.seekTime);t&&t!==D?t&&t!==D&&(ye(),function(e,t){var n=e&&!isNaN(e.seekTime)?e.seekTime:NaN,r=D.getProcessors().map((function(t){return t.prepareOuterPeriodPlaybackSeeking(e)}));Promise.all(r).then((function(){ge(t,D,n)})).catch((function(e){R.error(e)}))}(e,t)):(ye(),function(e){D.getProcessors().forEach((function(t){return t.prepareInnerPeriodPlaybackSeeking(e)})),Ye(te.USER_REQUEST_STOP_REASON)}(e)),qe(ee.SEEK_START_REASON)}function ye(){Ee()}function Ee(){X&&X.length>0&&(X.forEach((function(e){e.deactivate(!0)})),X=[])}function ve(e){e.newMediaInfo.streamInfo.id===D.getId()&&(Ee(),D.prepareTrackChange(e))}function _e(e,t){try{return $.get().streaming.buffer.reuseExistingSourceBuffers&&(t.isProtectionCompatible(e)||J)&&(Q||t.isMediaCodecCompatible(e,t))}catch(e){return!1}}function Te(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(U&&!e.getPreloaded()){var n=_e(e,t);n&&e.startPreloading(U,W).then((function(){X.push(e)}))}}function Se(e){if(isNaN(e))return null;for(var t=C.length,n=0;nG.getLiveDelay())&&(V=!1,qe(ee.INITIAL_PLAYOUT_START_REASON),G.play())}e&&e.mediaType&&h.addBufferLevel(e.mediaType,new Date,1e3*e.bufferLevel)}function Ie(e){e.streamInfo.id===D.getId()&&e.reason&&e.reason.forceReplace&&Ee(),Ke(e.streamInfo.id).prepareQualityChange(e)}function Re(){if(g.getIsDynamic()&&0!==G.getOriginalLiveDelay()&&D){var e=g.getStreamsInfo();if(e.length>0){var t=e[0].manifestInfo,n=Ue(e,t);G.computeAndSetLiveDelay(n,t)}}}function we(){if(Ge()){var e=B.getPlaybackQuality();e&&h.addDroppedFrames(e)}}function Ne(){t.debug("[onPlaybackStarted]"),!V&&H&&qe(ee.RESUME_FROM_PAUSE_START_REASON),V&&(V=!1),K&&(K=!1,$.get().streaming.applyContentSteering&&!y.shouldQueryBeforeStart()&&y.loadSteeringData()),H=!1}function Ce(e){t.debug("[onPlaybackPaused]"),e.ended||(H=!0,Ye(te.USER_REQUEST_STOP_REASON))}function De(e){t.debug("Stream with id ".concat(e.streamInfo.id," finished buffering"));var n=e.streamInfo.isLast;U&&n?(t.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),p.signalEndOfStream(U)):Oe()}function Oe(){if(D&&D.getHasFinishedBuffering())for(var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=e||D||null;if(t){var n=t.getStreamInfo();return C.filter((function(e){var t=e.getStreamInfo();return t.start>n.start&&n.id!==t.id}))}}catch(e){return[]}}(D),t=0;t0&&void 0!==arguments[0]?arguments[0]:null,t=e||D||null;if(!t)return null;for(var n=t.getStreamInfo(),r=n.start,i=0,a=-1,o=NaN;i0&&(isNaN(o)||u=0?C[a]:null}();n?(t.debug("StreamController onEnded, found next stream with id ".concat(n.getStreamInfo().id,". Switching from ").concat(D.getStreamInfo().id," to ").concat(n.getStreamInfo().id)),ge(n,D,NaN)):(t.debug("StreamController no next stream found"),D.setIsEndedEventSignaled(!1)),Ye(n?te.END_OF_PERIOD_STOP_REASON:te.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&(Me(),y.stopSteeringRequestTimer())}function xe(e){var t=e||Ve().manifestInfo.duration;p.setDuration(t)}function Fe(e){var t=_.getURIFragmentData();if(!t||!t.t)return NaN;var n=$e()[0].getStreamInfo().start;return t.t=t.t.split(",")[0],Ze(e,t.t,n)}function ke(e,t){var n=0;return e||(n=$e()[0].getStreamInfo().start),Ze(e,t,n)}function Ze(e,t,n){var r=g.getRegularPeriods()[0],i=t.toString(),a=-1!==i.indexOf("posix:")?"now"===i.substring(6)?Date.now()/1e3:parseFloat(i.substring(6)):NaN;return e&&!isNaN(a)?N.calcPresentationTimeFromWallTime(new Date(1e3*a),r):parseFloat(i)+n}function Ue(e,t){try{var n=NaN;if(t&&!isNaN(t.maxFragmentDuration)&&isFinite(t.maxFragmentDuration))return t.maxFragmentDuration;if(e&&1===e.length){var r=e[0],i=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT].reduce((function(e,t){var n=g.getMediaInfoForType(r,t);return n&&!1!==n.isFragmented&&e.push(n),e}),[]).reduce((function(e,t){var n=g.getVoRepresentations(t);return n&&n.length>0&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=g.convertRepresentationToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,function(e){if(Array.isArray(e))return Ht(e)}(o=i)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(o)||function(e,t){if(e){if("string"==typeof e)return Ht(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ht(e,t):void 0}}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}return isFinite(n)?n:NaN}catch(e){return NaN}var o}function Be(e){if(e.error)Z=!0,Xe();else{t.info("Manifest updated... updating data system wide.");var n=e.manifest;g.updatePeriods(n);var i=g.getUTCTimingSources();!g.getIsDynamic()||i&&0!==i.length||oe.trigger(d.Z.CONFORMANCE_VIOLATION,{level:qt.LEVELS.WARNING,event:qt.EVENTS.NO_UTC_TIMING_ELEMENT});var a=g.getIsDynamic()?i.concat(q.getUTCTimingSources()):i;r.filterUnsupportedFeatures(n).then((function(){E.initialize(n),m.attemptSync(a,g.getIsDynamic())}))}}function Ge(){return!!D&&D.getHasVideoTrack()}function je(){return!!D&&D.getHasAudioTrack()}function Ye(e,t){t=t||new Date,Pe().forEach((function(n){n.finalisePlayList(t,e)})),h.addPlayList()}function qe(e){h.createPlaylistMetrics(1e3*G.getTime(),e)}function He(e){if(e.error){var n="";switch(e.error.code){case 1:n="MEDIA_ERR_ABORTED";break;case 2:n="MEDIA_ERR_NETWORK";break;case 3:n="MEDIA_ERR_DECODE",ie.counts.mediaErrorDecode+=1;break;case 4:n="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:n="MEDIA_ERR_ENCRYPTED";break;default:n="UNKNOWN"}"MEDIA_ERR_DECODE"===n&&$.get().errors.recoverAttempts.mediaErrorDecode>=ie.counts.mediaErrorDecode?function(){t.warn("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");var e=G.getTime();D.deactivate(!1),t.warn("MediaSource has been resetted. Resuming playback from time ".concat(e)),he(e,!1,!1)}():(k=!0,e.error.message&&(n+=" ("+e.error.message+")"),e.error.msExtendedCode&&(n+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),t.fatal("Video Element Error: "+n),e.error&&t.fatal(e.error),R.error(new S.Z(e.error.code,n)),Xe())}}function Ve(){return D?D.getStreamInfo():null}function Ke(e){for(var t=0,n=C.length;t1&&void 0!==arguments[1]?arguments[1]:NaN;se(),re=t,o.load(e)},loadWithManifest:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;ue(),re=t,i.setManifest(e)},getActiveStreamProcessors:Pe,setConfig:function(e){e&&(e.capabilities&&(n=e.capabilities),e.capabilitiesFilter&&(r=e.capabilitiesFilter),e.manifestLoader&&(o=e.manifestLoader),e.manifestModel&&(c=e.manifestModel),e.mediaPlayerModel&&(Y=e.mediaPlayerModel),e.customParametersModel&&(q=e.customParametersModel),e.protectionController&&(O=e.protectionController),e.adapter&&(g=e.adapter),e.dashMetrics&&(h=e.dashMetrics),e.errHandler&&(R=e.errHandler),e.timelineConverter&&(N=e.timelineConverter),e.videoModel&&(B=e.videoModel),e.playbackController&&(G=e.playbackController),e.serviceDescriptionController&&(j=e.serviceDescriptionController),e.contentSteeringController&&(y=e.contentSteeringController),e.textController&&(M=e.textController),e.abrController&&(T=e.abrController),e.mediaController&&(b=e.mediaController),e.settings&&($=e.settings),e.baseURLController&&(E=e.baseURLController),e.uriFragmentModel&&(_=e.uriFragmentModel),e.segmentBaseController&&(v=e.segmentBaseController))},setProtectionData:function(e){P=e,O&&O.setProtectionData(P)},getIsStreamSwitchInProgress:function(){return F},switchToVideoElement:function(e){D&&(G.initialize(Ve()),he(e,!1,!0))},getHasMediaOrInitialisationError:function(){return k||Z},getStreams:$e,getActiveStream:function(){return D},getInitialPlayback:function(){return V},getAutoPlay:function(){return L},reset:Xe},t=(0,f.Z)(ae).getInstance().getLogger(e),m=Ut(ae).getInstance(),p=Gt(ae).getInstance(),I=x(ae).getInstance(),We(),e}Vt.__dashjs_factory_name="StreamController";const Kt=c.Z.getSingletonFactory(Vt);function zt(){var e,t,n,r,i,o,s,c,d,g,h,p,m=this.context,y=(0,u.Z)(m).getInstance();function E(){p.debug("Stopping the gap controller"),i&&(clearInterval(i),i=null),function(){y.off(l.Z.WALLCLOCK_TIME_UPDATED,b,this),y.off(l.Z.INITIAL_STREAM_SWITCH,S,this),y.off(l.Z.PLAYBACK_SEEKING,v,this),y.off(l.Z.BUFFER_REPLACEMENT_STARTED,_,e),y.off(l.Z.TRACK_CHANGE_RENDERED,T,e)}(),i=null,o=NaN,r=0,g=null,h={}}function v(){g&&(clearTimeout(g),g=null)}function _(e){try{if(e.streamId!==c.getActiveStreamInfo().id||e.mediaType!==a.Z.VIDEO&&e.mediaType!==a.Z.AUDIO)return;e.streamId===c.getActiveStreamInfo().id&&(h[e.mediaType]=!0)}catch(e){p.error(e)}}function T(e){e&&e.mediaType&&(h[e.mediaType]=!1)}function S(){i||function(){try{i||(p.debug("Starting the gap controller"),i=setInterval((function(){A()&&N(s.getTime())}),100))}catch(e){}}()}function b(){if(A(n.get().streaming.gaps.enableSeekFix)&&++r>=10){var e=s.getTime();t===e?N(e,!0):(t=e,o=NaN),r=0}}function A(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!c.getActiveStream())return!1;var t=Object.keys(h).some((function(e){return h[e]})),r=!!e&&I();return!t&&n.get().streaming.gaps.jumpGaps&&c.getActiveStreamProcessors().length>0&&(!s.isSeeking()||r)&&!s.isPaused()&&!c.getIsStreamSwitchInProgress()&&!c.getHasMediaOrInitialisationError()}function I(){var e=c.getActiveStream(),t=parseFloat((e.getStartTime()+e.getDuration()).toFixed(5));return s.getTime()+n.get().streaming.gaps.threshold>=t}function R(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var r=NaN,i=0;isNaN(r)&&i0?e.end(i-1):0;t=e.start(n)&&t<=e.end(n))return!0;return!1}function N(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n.get().streaming.gaps.enableStallFix,a=n.get().streaming.gaps.stallSeek,u=n.get().streaming.gaps.smallGapLimit,l=n.get().streaming.gaps.jumpLargeGaps,f=d.getBufferRange(),h=NaN,m=!1;if(t=R(f,e),!isNaN(t)){var y=f.start(t),E=y-e;E>0&&(E<=u||l)&&(h=y)}var v=s.getTimeToStreamEnd();if(isNaN(h)&&r&&isFinite(v)&&!isNaN(v)&&v0&&o!==h&&h>e&&!g){var _=h-e;if(m){var T=c.getStreamForTime(h),S=T&&!!T.getPreloaded();p.warn("Jumping to end of stream because of gap from ".concat(e," to ").concat(h,". Gap duration: ").concat(_)),s.seek(h,!0,S)}else{var b=s.getIsDynamic(),A=t>0?f.end(t-1):e,I=b?1e3*Math.max(0,_-.1):0;g=window.setTimeout((function(){s.seek(h,!0,!0),p.warn("Jumping gap occuring in period ".concat(c.getActiveStream().getStreamId()," starting at ").concat(A," and ending at ").concat(h,". Jumping by: ").concat(h-A)),g=null}),I)}o=h}}return e={reset:E,setConfig:function(e){e&&(e.settings&&(n=e.settings),e.playbackController&&(s=e.playbackController),e.streamController&&(c=e.streamController),e.videoModel&&(d=e.videoModel))},initialize:function(){!function(){y.on(l.Z.WALLCLOCK_TIME_UPDATED,b,this),y.on(l.Z.INITIAL_STREAM_SWITCH,S,this),y.on(l.Z.PLAYBACK_SEEKING,v,this),y.on(l.Z.BUFFER_REPLACEMENT_STARTED,_,e),y.on(l.Z.TRACK_CHANGE_RENDERED,T,e)}()}},p=(0,f.Z)(m).getInstance().getLogger(e),E(),e}zt.__dashjs_factory_name="GapController";const Wt=c.Z.getSingletonFactory(zt);function Xt(){var e,t,n,r,i,o,c,g,h,p,m=this.context,y=(0,u.Z)(m).getInstance();function E(){t=!1;var e=xe.Z.parseUserAgent();n=e&&e.browser&&e.browser.name&&"safari"===e.browser.name.toLowerCase()}function v(){t=!1}function _(e){if(e.streamId===o.getActiveStreamInfo().id&&h){var t=c.getLiveDelay();c.getBufferLevel()>t/2&&(h=!1)}}function T(e){e.streamId===o.getActiveStreamInfo().id&&(h=e.state===s.Z.BUFFER_EMPTY)}function S(){g.getCatchupModeEnabled()||r.setPlaybackRate(1)}function b(){c.getIsDynamic()&&g.getCatchupModeEnabled()&&(g.getCatchupPlaybackRates().max>0||g.getCatchupPlaybackRates().min<0)&&!c.isPaused()&&!c.isSeeking()&&function(){try{return!(!c.getTime()>0||t)&&(I()===a.Z.LIVE_CATCHUP_MODE_LOLP?function(e,t){try{return Math.abs(A())>0||e0}catch(e){return!1}}())}catch(e){return!1}}()&&function(){if(!t&&r){var e,o=r.getPlaybackRate(),s=g.getCatchupPlaybackRates(),u=c.getBufferLevel(),l=A(),f=g.getCatchupMaxDrift();if(!isNaN(f)&&f>0&&l>f)p.info("[CatchupController]: Low Latency catchup mechanism. Latency too high, doing a seek to live point"),t=!0,c.seekToCurrentLive(!0,!1);else{var d=c.getCurrentLiveLatency(),m=c.getLiveDelay();e=I()===a.Z.LIVE_CATCHUP_MODE_LOLP?function(e,t,n,r,i){var a;if(i0&&(s=1),s}(s,d,m,u);var y=n?.25:.02/(.5/s.max);e&&Math.abs(o-e)>=y&&(p.debug("[CatchupController]: Setting playback rate to ".concat(e)),r.setPlaybackRate(e))}}}()}function A(){return c.getCurrentLiveLatency()-c.getLiveDelay()}function I(){var e=i.get().streaming.liveCatchup.playbackBufferMin;return i.get().streaming.liveCatchup.mode!==a.Z.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?a.Z.LIVE_CATCHUP_MODE_DEFAULT:a.Z.LIVE_CATCHUP_MODE_LOLP}function R(){g.getCatchupPlaybackRates(!0)}return e={reset:function(){y.off(d.Z.BUFFER_LEVEL_UPDATED,_,e),y.off(d.Z.BUFFER_LEVEL_STATE_CHANGED,T,e),y.off(d.Z.PLAYBACK_PROGRESS,b,e),y.off(d.Z.PLAYBACK_TIME_UPDATED,b,e),y.off(d.Z.PLAYBACK_SEEKED,b,e),y.off(l.Z.SETTING_UPDATED_CATCHUP_ENABLED,S,e),y.off(l.Z.SETTING_UPDATED_PLAYBACK_RATE_MIN,R,e),y.off(l.Z.SETTING_UPDATED_PLAYBACK_RATE_MAX,R,e),y.off(d.Z.STREAM_INITIALIZED,R,e),E(),r.setPlaybackRate(1,!0)},setConfig:function(e){e&&(e.settings&&(i=e.settings),e.videoModel&&(r=e.videoModel),e.streamController&&(o=e.streamController),e.playbackController&&(c=e.playbackController),e.mediaPlayerModel&&(g=e.mediaPlayerModel))},initialize:function(){y.on(d.Z.BUFFER_LEVEL_UPDATED,_,e),y.on(d.Z.BUFFER_LEVEL_STATE_CHANGED,T,e),y.on(d.Z.PLAYBACK_PROGRESS,b,e),y.on(d.Z.PLAYBACK_TIME_UPDATED,b,e),y.on(d.Z.PLAYBACK_SEEKED,v,e),y.on(l.Z.SETTING_UPDATED_CATCHUP_ENABLED,S,e),y.on(l.Z.SETTING_UPDATED_PLAYBACK_RATE_MIN,R,e),y.on(l.Z.SETTING_UPDATED_PLAYBACK_RATE_MAX,R,e),y.on(d.Z.STREAM_INITIALIZED,R,e),R()}},p=(0,f.Z)(m).getInstance().getLogger(e),E(),e}Xt.__dashjs_factory_name="CatchupController";const Qt=c.Z.getSingletonFactory(Xt);var $t=[a.Z.SERVICE_DESCRIPTION_DVB_LL_SCHEME],Jt="video",en="audio";function tn(){var e,t,n,r,i,s=this.context;function u(){t={liveDelay:NaN,liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN}},minBitrate:{},maxBitrate:{},initialBitrate:{}},n=[]}function l(e,n,i){try{t[e][n]=i/1e3}catch(e){r.error(e)}}return e={getServiceDescriptionSettings:function(){return t},getProducerReferenceTimeOffsets:function(){return n},calculateProducerReferenceTimeOffsets:function(e){try{var t=[];if(e&&e.length>0){var s=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT],u=i.getAvailabilityStartTime()/1e3;e.forEach((function(e){var n=s.reduce((function(t,n){return t.concat(i.getAllMediaInfoForType(e,n))}),[]).reduce((function(t,n){return i.getProducerReferenceTimes(e,n).forEach((function(r){var a=i.getVoRepresentations(n);if(a&&a.length>0&&a[0].adaptation&&a[0].segmentInfoType===o.Z.SEGMENT_TEMPLATE){var s=a[0],l=new Date(r[o.Z.WALL_CLOCK_TIME]).getTime()/1e3-(r[o.Z.PRESENTATION_TIME]/s[o.Z.TIMESCALE]-s[o.Z.PRESENTATION_TIME_OFFSET]+e.start),c=u-l;t.push({id:r[o.Z.ID],to:c})}})),t}),[]);t=t.concat(n)}))}n=t}catch(e){r.error(e),n=[]}},applyServiceDescription:function(e){if(e&&e.serviceDescriptions){var i=e.serviceDescriptions.filter((function(e){return $t.includes(e.schemeIdUri)})),o=e.serviceDescriptions.filter((function(e){return null==e.schemeIdUri})),s=i.length>0?i[i.length-1]:o[o.length-1];s&&(s.latency&&s.latency.target>0&&function(e){var i;if(e.schemeIdUri,a.Z.SERVICE_DESCRIPTION_DVB_LL_SCHEME,i=function(e){return{liveDelay:e.latency.target/1e3,maxDrift:!isNaN(e.latency.max)&&e.latency.max>e.latency.target?(e.latency.max-e.latency.target+500)/1e3:NaN,referenceId:e.latency.referenceId||NaN}}(e),n.length>0){var o=function(e){var t,r=0,i=n.filter((function(t){return t.id===e.referenceId}));return 0===i.length?(r=n.length>0?n[0].to:0,t=n[0].id||NaN):(r=i[0].to||0,t=i[0].id||NaN),{to:r,id:t}}(i),s=o.to,u=o.id;t.liveDelay=i.liveDelay-s,t.liveCatchup.maxDrift=i.maxDrift,r.debug("\n Found latency properties coming from service description. Applied time offset of ".concat(s," from ProducerReferenceTime element with id ").concat(u,".\n Live Delay: ").concat(i.liveDelay-s,", Live catchup max drift: ").concat(i.maxDrift,"\n "))}else t.liveDelay=i.liveDelay,t.liveCatchup.maxDrift=i.maxDrift,r.debug("Found latency properties coming from service description: Live Delay: ".concat(i.liveDelay,", Live catchup max drift: ").concat(i.maxDrift))}(s),s.playbackRate&&function(e){var n=e.playbackRate.min?Math.round(1e3*(e.playbackRate.min-1))/1e3:NaN,i=e.playbackRate.max?Math.round(1e3*(e.playbackRate.max-1))/1e3:NaN;t.liveCatchup.playbackRate.min=n,t.liveCatchup.playbackRate.max=i,r.debug("Found latency properties coming from service description: Live catchup min playback rate: ".concat(n)),r.debug("Found latency properties coming from service description: Live catchup max playback rate: ".concat(i))}(s),s.operatingQuality,s.operatingBandwidth&&function(e){if(e&&e.operatingBandwidth&&e.operatingBandwidth.mediaType&&"all"!==e.operatingBandwidth.mediaType){var t={};t.minBandwidth=e.operatingBandwidth.min,t.maxBandwidth=e.operatingBandwidth.max,t.targetBandwidth=e.operatingBandwidth.target;var n=[];e.operatingBandwidth.mediaType===Jt||e.operatingBandwidth.mediaType===en?n.push(e.operatingBandwidth.mediaType):"any"===e.operatingBandwidth.mediaType&&(n.push(en),n.push(Jt)),n.forEach((function(e){isNaN(t.minBandwidth)||l("minBitrate",e,t.minBandwidth),isNaN(t.maxBandwidth)||l("maxBitrate",e,t.maxBandwidth),isNaN(t.targetBandwidth)||l("initialBitrate",e,t.targetBandwidth)}))}}(s))}},reset:function(){u()},setConfig:function(e){e&&e.adapter&&(i=e.adapter)}},r=(0,f.Z)(s).getInstance().getLogger(e),u(),e}tn.__dashjs_factory_name="ServiceDescriptionController";const nn=c.Z.getSingletonFactory(tn),rn=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||null,this.type=C.w.CONTENT_STEERING_TYPE,this.responseType="json"},an=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.version=null,this.ttl=300,this.reloadUri=null,this.serviceLocationPriority=[]};function on(){var e,t,n,r,i,s,u,c,g,h,p,m,y,E,v,_=this.context,T=(0,Q.Z)(_).getInstance();function S(e){e&&e.toStreamInfo&&(r=e.toStreamInfo)}function b(e){e&&e.request&&e.request.serviceLocation&&(i=e.request.serviceLocation)}function A(){var e=p.getValue();return v.getContentSteering(e)}function I(){return new Promise((function(e){try{var s=A();if(!s||!s.serverUrl)return void e();var l=function(e){var t=e.proxyServerUrl?e.proxyServerUrl:e.serverUrl;n&&n.reloadUri&&(t=T.isRelative(n.reloadUri)?T.resolve(n.reloadUri,e.serverUrl):n.reloadUri);var o=[];if(r){var s=v.getIsDynamic(),u=v.getAllMediaInfoForType(r,a.Z.VIDEO).length>0?a.Z.VIDEO:a.Z.AUDIO,l=y.getThroughputHistory(),c=l?l.getAverageThroughput(u,s):NaN;isNaN(c)||o.push({key:"_DASH_throughput",value:1e3*c})}return i&&o.push({key:"_DASH_pathway",value:i}),e.proxyServerUrl&&e.proxyServerUrl===t&&e.serverUrl&&o.push({key:"url",value:encodeURI(e.serverUrl)}),t=xe.Z.addAditionalQueryParameterToUrl(t,o)}(s),c=new rn(l);u.load({request:c,success:function(t){!function(e){e&&e[o.Z.CONTENT_STEERING_RESPONSE.VERSION]&&1===parseInt(e[o.Z.CONTENT_STEERING_RESPONSE.VERSION])&&((n=new an).version=e[o.Z.CONTENT_STEERING_RESPONSE.VERSION],e[o.Z.CONTENT_STEERING_RESPONSE.TTL]&&!isNaN(e[o.Z.CONTENT_STEERING_RESPONSE.TTL])&&(n.ttl=e[o.Z.CONTENT_STEERING_RESPONSE.TTL]),e[o.Z.CONTENT_STEERING_RESPONSE.RELOAD_URI]&&(n.reloadUri=e[o.Z.CONTENT_STEERING_RESPONSE.RELOAD_URI]),e[o.Z.CONTENT_STEERING_RESPONSE.SERVICE_LOCATION_PRIORITY]&&(n.serviceLocationPriority=e[o.Z.CONTENT_STEERING_RESPONSE.SERVICE_LOCATION_PRIORITY]),R())}(t),E.trigger(d.Z.CONTENT_STEERING_REQUEST_COMPLETED,{currentSteeringResponseData:n,url:l}),e()},error:function(n){!function(e){t.warn("Error fetching data from content steering server",e),R()}(n),e(n)}})}catch(t){e(t)}}))}function R(){n&&n.ttl&&!isNaN(n.ttl)&&(s&&clearTimeout(s),s=setTimeout((function(){I()}),1e3*n.ttl))}function N(){s&&clearTimeout(s),s=null}function C(){n=null,r=null,i=null,N()}return e={reset:function(){C(),E.off(d.Z.PERIOD_SWITCH_COMPLETED,S,e),E.off(l.Z.FRAGMENT_LOADING_STARTED,b,e)},setConfig:function(e){e&&(e.adapter&&(v=e.adapter),e.errHandler&&(c=e.errHandler),e.dashMetrics&&(g=e.dashMetrics),e.mediaPlayerModel&&(h=e.mediaPlayerModel),e.requestModifier&&(m=e.requestModifier),e.manifestModel&&(p=e.manifestModel),e.abrController&&(y=e.abrController),e.eventBus&&(E=e.eventBus))},loadSteeringData:I,getCurrentSteeringResponseData:function(){return n},shouldQueryBeforeStart:function(){var e=A();return e&&e.queryBeforeStart},getSteeringDataFromManifest:A,stopSteeringRequestTimer:N,initialize:function(){u=ht(_).create({errHandler:c,dashMetrics:g,mediaPlayerModel:h,requestModifier:m,errors:w}),E.on(d.Z.PERIOD_SWITCH_COMPLETED,S,e),E.on(l.Z.FRAGMENT_LOADING_STARTED,b,e)}},t=(0,f.Z)(_).getInstance().getLogger(e),C(),e}on.__dashjs_factory_name="ContentSteeringController";const sn=c.Z.getSingletonFactory(on);var un=n(3973),ln=n.n(un),cn=n(3039);function fn(){var e,t,n,r,i,o,s,c,d=this.context,g=(0,u.Z)(d).getInstance();function h(e,t){return e&&n[t]&&n[t][e]?n[t][e].list:[]}function p(e,t){return e&&n[t]&&n[t][e]?n[t][e].current:null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&e.streamInfo){var i=e.type,s=e.streamInfo,u=s.id,f=p(i,u);if(n[u]&&n[u][i]&&(n[u][i].current=e,n[u][i].current&&(i!==a.Z.TEXT&&!v(e,f)||i===a.Z.TEXT&&e.isFragmented)&&g.trigger(l.Z.CURRENT_TRACK_CHANGED,{oldMediaInfo:f,newMediaInfo:e,switchMode:r.get().streaming.trackSwitchMode[i]},{streamId:u}),!t)){var d=T(e);if(!d||!n[u][i].storeLastSettings)return;d.roles&&(d.role=d.roles[0],delete d.roles),d.accessibility&&(d.accessibility=d.accessibility[0]),d.audioChannelConfiguration&&(d.audioChannelConfiguration=d.audioChannelConfiguration[0]),o[i]=d,c.setSavedMediaSettings(i,d)}}}function y(e,t){e&&t&&(i[e]=t)}function E(e){return e?i[e]:null}function v(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=e.lang===t.lang,a=e.codec===t.codec,o=e.roles.toString()===t.roles.toString(),s=e.accessibility.toString()===t.accessibility.toString(),u=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&a&&r&&i&&o&&s&&u}function _(){n={},o={},i={audio:null,video:null,text:null}}function T(e){var t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}function S(e,t,n){var r=[];return e.forEach((function(e){t(n,e)&&r.push(e)})),0!==r.length?r:e}function b(e,t){return!e.lang||e.lang instanceof RegExp?t.lang.match(e.lang):""!==t.lang&&(0,cn.extendedFilter)(t.lang,ln()(e.lang)).length>0}function A(e,t){return void 0===e.index||null===e.index||t.index===e.index}function I(e,t){return!e.viewpoint||e.viewpoint===t.viewpoint}function R(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0];return r||t.type===a.Z.AUDIO&&n}function w(e,t){return e.accessibility?!!t.accessibility.filter((function(t){return t===e.accessibility}))[0]:!t.accessibility.length}function N(e,t){return!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0]}function C(e){var t,n=0,r=[];return e.forEach((function(e){(t=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))))>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function D(e){var t,n=1/0,r=[];return e.forEach((function(e){var i=e.bitrateList.reduce((function(e,t){var n=Math.max(1,t.width*t.height);return e+t.bandwidth/n}),0);(t=i/e.bitrateList.length)n?(n=t,r=[e]):t===n&&r.push(e)})),r}function M(e,n){if(e===a.Z.TEXT)return n[0];var i,o=r.get().streaming.selectionModeForInitialTrack,u=s.getCustomInitialTrackSelectionFunction();if(u&&"function"==typeof u)i=u(n);else switch(o){case a.Z.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY:i=function(e){var t,n,r=(t=0,n=[],e.forEach((function(e){isNaN(e.selectionPriority)||(e.selectionPriority>t?(t=e.selectionPriority,n=[e]):e.selectionPriority===t&&n.push(e))})),n);return r.length>1&&(r=C(r)),r.length>1&&(r=O(r)),r}(n);break;case a.Z.TRACK_SELECTION_MODE_HIGHEST_BITRATE:i=function(e){var t=C(e);return t.length>1&&(t=O(t)),t}(n);break;case a.Z.TRACK_SELECTION_MODE_FIRST_TRACK:i=P(n);break;case a.Z.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:i=function(e){var t=D(e);return t.length>1&&(t=C(t)),t}(n);break;case a.Z.TRACK_SELECTION_MODE_WIDEST_RANGE:i=function(e){var t=O(e);return t.length>1&&(t=C(e)),t}(n);break;default:t.warn("Track selection mode ".concat(o," is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK")),i=P(n)}return i.length>0?i[0]:n[0]}function P(e){return e[0]}return e={setInitialMediaSettingsForType:function(e,t){var n=o[e]||E(e),r=h(e,t.id),i=[];n||y(e,n=c.getSavedMediaSettings(e)),r&&0!==r.length&&(n&&(i=S(i=Array.from(r),b,n),i=S(i,A,n),i=S(i,I,n),e===a.Z.AUDIO&&o[e]||(i=S(i,R,n)),i=S(i,w,n),i=S(i,N,n)),0===i.length?m(M(e,r),!0):i.length>1?m(M(e,i,o[e])):m(i[0]))},addTrack:function(e){if(e){var t=e.type;if((r=t)===a.Z.AUDIO||r===a.Z.VIDEO||r===a.Z.TEXT||r===a.Z.IMAGE){var r,i=e.streamInfo.id;n[i]||(n[i]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var o=n[i][t].list,s=0,u=o.length;s2&&void 0!==arguments[2]&&arguments[2];try{var r=!1;if(e.lang){if(e.lang instanceof RegExp)r=t.lang.match(e.lang);else if(""!==t.lang){var i=ln()(e.lang);i&&(r=(0,cn.extendedFilter)(t.lang,i).length>0)}}else r=!0;var o=void 0===e.index||null===e.index||t.index===e.index,s=!e.viewpoint||e.viewpoint===t.viewpoint,u=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],l=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],c=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return r&&o&&s&&(u||t.type===a.Z.AUDIO&&n)&&l&&c}catch(e){return!1}},matchSettingsLang:b,matchSettingsIndex:A,matchSettingsViewPoint:I,matchSettingsRole:R,matchSettingsAccessibility:w,matchSettingsAudioChannelConfig:N,saveTextSettingsDisabled:function(){c.setSavedMediaSettings(a.Z.TEXT,null)},setConfig:function(e){e&&(e.domStorage&&(c=e.domStorage),e.settings&&(r=e.settings),e.customParametersModel&&(s=e.customParametersModel))},reset:_},t=(0,f.Z)(d).getInstance().getLogger(e),_(),e}fn.__dashjs_factory_name="MediaController";var dn=c.Z.getSingletonFactory(fn);c.Z.updateSingletonFactory(fn.__dashjs_factory_name,dn);const gn=dn;var hn=NaN,pn=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.data={baseUrls:t||null,selectedIdx:n||hn},this.children=[]};function mn(){var e,t,n,r=this.context,i=Ne(r).getInstance();function a(e,t,r){var a=n.getBaseURLsFromElement(r);e[t]?i.areEqual(a,e[t].data.baseUrls)||(e[t].data.baseUrls=a,e[t].data.selectedIdx=hn):e[t]=new pn(a)}function o(e,n){var r=n||t;e(r.data),r.children&&r.children.forEach((function(t){return o(e,t)}))}function s(){t=new pn}return e={reset:s,update:function(e){!function(e){!function(){if(!n||!n.hasOwnProperty("getBaseURLsFromElement")||!n.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")}();var r=n.getBaseURLsFromElement(e);i.areEqual(r,t.data.baseUrls)||(t.data.baseUrls=r,t.data.selectedIdx=hn),e&&e.Period_asArray&&e.Period_asArray.forEach((function(e,r){a(t.children,r,e),e.AdaptationSet_asArray&&e.AdaptationSet_asArray.forEach((function(e,i){a(t.children[r].children,i,e),e.Representation_asArray&&e.Representation_asArray.sort(n.getRepresentationSortFunction()).forEach((function(e,n){a(t.children[r].children[i].children,n,e)}))}))}))}(e)},getForPath:function(e){var n=t,r=[n.data];return e&&e.forEach((function(e){(n=n.children[e])&&r.push(n.data)})),r.filter((function(e){return e.baseUrls.length}))},invalidateSelectedIndexes:function(e){o((function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=hn)}))},setConfig:function(e){e.adapter&&(n=e.adapter)}},s(),e}mn.__dashjs_factory_name="BaseURLTreeModel";const yn=c.Z.getClassFactory(mn);function En(e){var t=(e=e||{}).blacklistController;return{select:function(e){return e&&function(e){var t,n,r=0,i=[],a=0;if((n=e.sort((function(e,t){var n=e.dvb_priority-t.dvb_priority;return isNaN(n)?0:n})).filter((function(e,t,n){return!t||n[0].dvb_priority&&e.dvb_priority&&n[0].dvb_priority===e.dvb_priority}))).length)return n.length>1&&(n.forEach((function(e){r+=e.dvb_weight,i.push(r)})),t=Math.floor(Math.random()*(r-1)),i.every((function(e,n){return a=n,!(t0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=0,i=NaN,a=function(){var a=e[r],o=t.findIndex((function(e){return e.serviceLocation&&e.serviceLocation===a}));if(-1!==o&&!n.contains(t[o].serviceLocation))return i=o,"break";r+=1};r/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function r(e,t,n,r){for(var i=0;i0&&r(e.arrayAccessFormPaths,t,n,i)&&(t[n]=[t[n]])}function a(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),r=t[5].split(".");if(n.setHours(t[3],t[4],r[0]),r.length>1&&n.setMilliseconds(r[1]),t[6]&&t[7]){var i=60*t[6]+Number(t[7]);i=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*i:i),n.setMinutes(n.getMinutes()-i-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function o(t,n,i,a){return!(1==n&&e.xmlElementsFilter.length>0)||r(e.xmlElementsFilter,t,i,a)}function s(n,u){if(9==n.nodeType){for(var l=new Object,c=n.childNodes,f=0;f0){var o=i.split(".#")[0];return r(e.datetimeAccessFormPaths,t,n,o)?a(t):t}return t}(l.__text,h,u+"."+h)),null!=l["#cdata-section"]&&(l.__cdata=l["#cdata-section"],delete l["#cdata-section"],"property"==e.arrayAccessForm&&delete l["#cdata-section_asArray"]),0==l.__cnt&&"text"==e.emptyNodeForm?l="":1==l.__cnt&&null!=l.__text?l=l.__text:1!=l.__cnt||null==l.__cdata||e.keepCData?l.__cnt>1&&null!=l.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==l.__text||""==l.__text.trim())&&delete l.__text:l=l.__cdata,delete l.__cnt,!e.enableToStringFunc||null==l.__text&&null==l.__cdata||(l.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),l}if(3==n.nodeType||4==n.nodeType)return n.nodeValue}function u(t,r,i,a){var o="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+r;if(null!=i)for(var s=0;s":">")}function l(e,t){return""}function c(t,n){return"property"==e.arrayAccessForm&&(i="_asArray",-1!==(r=n.toString()).indexOf(i,r.length-i.length))||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function;var r,i}function f(e){var t=0;if(e instanceof Object)for(var n in e)c(e,n)||t++;return t}function d(t,n,i){return 0==e.jsonPropertiesFilter.length||""==i||r(e.jsonPropertiesFilter,t,n,i)}function g(t){var n=[];if(t instanceof Object)for(var r in t)-1==r.toString().indexOf("__")&&0==r.toString().indexOf(e.attributePrefix)&&n.push(r);return n}function h(t){var r="";return t instanceof Object?r+=function(t){var r="";return null!=t.__cdata&&(r+=""),null!=t.__text&&(e.escapeMode?r+=n(t.__text):r+=t.__text),r}(t):null!=t&&(e.escapeMode?r+=n(t):r+=t),r}function p(e,t){return""===e?t:e+"."+t}function m(e,t,n,r){var i="";if(0==e.length)i+=u(e,t,n,!0);else for(var a=0;a0)for(var r in e)if(!c(e,r)&&(""==t||d(e,r,p(t,r)))){var i=e[r],a=g(i);null==i||null==i?n+=u(i,r,a,!0):i instanceof Object?i instanceof Array?n+=m(i,r,a,t):i instanceof Date?(n+=u(i,r,a,!1),n+=i.toISOString(),n+=l(i,r)):f(i)>0||null!=i.__text||null!=i.__cdata?(n+=u(i,r,a,!1),n+=y(i,p(t,r)),n+=l(i,r)):n+=u(i,r,a,!0):(n+=u(i,r,a,!1),n+=h(i),n+=l(i,r))}return n+h(e)}this.parseXmlString=function(e){var t;if(window.ActiveXObject||window,void 0===e)return null;if(window.DOMParser){var n=new window.DOMParser;try{(t=n.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?a(e):e},this.xml2json=function(e){return s(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return y(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}};var Fn="onLoad";function kn(e){e=e||{};var t,n,r,i,a,s,c=this.context,f=(0,u.Z)(c).getInstance(),d=(0,Q.Z)(c).getInstance();function g(e,t,n){var r,i,a={};a.elements=e,a.type=t,a.resolveType=n,0===a.elements.length&&p(a);for(var o=0;o")+2),r=t.resolvedContent.substr(0,i)+""+t.resolvedContent.substr(i)+"",t.resolvedContent=a.xml_str2json(r)}(function(e){var t;for(t=0;t=0;o--){if(n=(t=e.elements[o]).type+"_asArray",t.resolvedContent){if(t.resolvedContent)for(s=0;s0&&r.run(i)}(e),"onActuate"===e.resolveType&&f.trigger(l.Z.XLINK_READY,{manifest:i}),e.resolveType===Fn)switch(e.type){case o.Z.PERIOD:for(t=0;t=0;a--)(i=e[a]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===i["xlink:href"]&&e.splice(a,1);for(a=0;a=0}return!1}),(function(e){return String(e)}))}return i}(Yn);function Xn(e){return Xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xn(e)}function Qn(e,t){return Qn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Qn(e,t)}function $n(e,t){return!t||"object"!==Xn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Jn(e){return Jn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Jn(e)}var er=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/;const tr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qn(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Jn(t);if(n){var i=Jn(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return $n(this,e)});function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,(function(e){for(var t=[o.Z.MIN_BUFFER_TIME,o.Z.MEDIA_PRESENTATION_DURATION,o.Z.MINIMUM_UPDATE_PERIOD,o.Z.TIMESHIFT_BUFFER_DEPTH,o.Z.MAX_SEGMENT_DURATION,o.Z.MAX_SUBSEGMENT_DURATION,o.Z.SUGGESTED_PRESENTATION_DELAY,o.Z.START,a.Z.START_TIME,o.Z.DURATION],n=t.length,r=0;r=0}return!1}),(function(e){var t=ln()(e);return void 0!==t?t:String(e)}))}return i}(Yn);function _r(e,t){for(var n=0;n-1?(p&&(t=p.createMssParser(),p.registerEvents()),t):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?xr(c).create({debug:f}):t}(t)),null!==s){i.setMatchers(s.getMatchers()),i.setIron(s.getIron());try{y=s.parse(t)}catch(t){return void g.trigger(l.Z.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new S.Z(w.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,w.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}if(y){if(y.url=u||e,y.originalUrl||(y.originalUrl=y.url),y.hasOwnProperty(a.Z.LOCATION)&&(m=h.parseBaseUrl(y.Location_asArray[0]),n.debug("BaseURI set by Location to: "+m)),d&&d.get().streaming.enableManifestDurationMismatchFix&&y.mediaPresentationDuration&&y.Period_asArray.length>1){var E=y.Period_asArray.reduce((function(e,t){return e+t.duration}),0);!isNaN(E)&&y.mediaPresentationDuration>E&&(n.warn("Media presentation duration greater than duration of all periods. Setting duration to total period duration"),y.mediaPresentationDuration=E)}y.baseUri=m,y.loadedTime=new Date,i.resolveManifestOnLoad(y),g.trigger(l.Z.ORIGINAL_MANIFEST_LOADED,{originalManifest:t})}else g.trigger(l.Z.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new S.Z(w.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,w.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}else g.trigger(l.Z.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new S.Z(w.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,w.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))});else g.trigger(l.Z.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(t,n,r){g.trigger(l.Z.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new S.Z(w.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,w.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+"".concat(e,", ").concat(r))})}})},reset:function(){g.off(l.Z.XLINK_READY,y,t),p&&p.reset(),i&&(i.reset(),i=null),r&&(r.abort(),r=null)}},n=f.getLogger(t),g.on(l.Z.XLINK_READY,y,t),r=ht(c).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:h,constants:a.Z,dashConstants:o.Z,errors:w,requestTimeout:e.settings.get().streaming.manifestRequestTimeout}),i=Zn(c).create({errHandler:m,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),s=null,t}Fr.__dashjs_factory_name="ManifestLoader";const kr=c.Z.getClassFactory(Fr);function Zr(){var e=this.context,t=(0,u.Z)(e).getInstance();return{error:function(e){t.trigger(l.Z.ERROR,{error:e})}}}Zr.__dashjs_factory_name="ErrorHandler";const Ur=c.Z.getSingletonFactory(Zr);var Br=n(1715);function Gr(){var e,t,n,r,i,o,s=this.context,c=(0,u.Z)(s).getInstance();function d(e,r){if(!r||!r.Period_asArray||0===r.Period_asArray.length)return Promise.resolve();var i=[];return r.Period_asArray.forEach((function(r){i.push(function(e,r){return new Promise((function(i){if(e&&e.AdaptationSet_asArray&&0!==e.AdaptationSet_asArray.length){var s=[];e.AdaptationSet_asArray.forEach((function(e){t.getIsTypeOf(e,r)&&s.push(function(e,r){return new Promise((function(i){if(e.Representation_asArray&&0!==e.Representation_asArray.length){var s=[],u=[];e.Representation_asArray.forEach((function(i,o){var l=t.getCodec(e,o,!1),c=function(e,t,n){switch(e){case a.Z.VIDEO:return function(e,t){return{codec:t,width:e.width||null,height:e.height||null,framerate:e.frameRate||null,bitrate:e.bandwidth||null}}(t,n);case a.Z.AUDIO:return function(e,t){var n=e.audioSamplingRate||null;return{codec:t,bitrate:e.bandwidth||null,samplerate:n}}(t,n);default:return null}}(r,i,l);u.push(c),s.push(n.supportsCodec(c,r))})),Promise.all(s).then((function(t){e.Representation_asArray=e.Representation_asArray.filter((function(e,n){return t[n]||o.debug("[Stream] Codec ".concat(u[n].codec," not supported ")),t[n]})),i()})).catch((function(){i()}))}else i()}))}(e,r))})),Promise.all(s).then((function(){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){var t=e.Representation_asArray&&e.Representation_asArray.length>0;return t||(c.trigger(l.Z.ADAPTATION_SET_REMOVED_NO_CAPABILITIES,{adaptationSet:e}),o.warn("AdaptationSet has been removed because of no supported Representation")),t})),i()})).catch((function(){i()}))}else i()}))}(r,e))})),Promise.all(i)}return e={setConfig:function(e){e&&(e.adapter&&(t=e.adapter),e.capabilities&&(n=e.capabilities),e.settings&&(r=e.settings),e.customParametersModel&&(i=e.customParametersModel))},filterUnsupportedFeatures:function(e){return new Promise((function(s){var u=[];u.push(d(a.Z.VIDEO,e)),u.push(d(a.Z.AUDIO,e)),Promise.all(u).then((function(){r.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(e){e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){var r=t.getEssentialPropertiesForRepresentation(e);if(r&&r.length>0)for(var i=0;i0)}))}))}(e),function(e){var t=i.getCustomCapabilitiesFilters();t&&0!==t.length&&e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){return!t.some((function(t){return!t(e)}))})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}))}(e),s()})).catch((function(){s()}))}))}},o=(0,f.Z)(s).getInstance().getLogger(e),e}Gr.__dashjs_factory_name="CapabilitiesFilter";const jr=c.Z.getSingletonFactory(Gr),Yr=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null};function qr(){var e;return{initialize:function(t){if(e=new Yr,!t)return null;var n=t.indexOf("#");if(-1!==n)for(var r=t.substr(n+1).split("&"),i=0,a=r.length;i0?(n&&t.warn("Supplied minimum playback rate is a positive value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):e1?(n&&t.warn("Supplied maximum playback rate is out of range and will be limited to ".concat(1,": ").concat(200,"% playback speed.")),1):e}function u(){var e=a.get().streaming.buffer.stableBufferTime>0?a.get().streaming.buffer.stableBufferTime:a.get().streaming.buffer.fastSwitchEnabled?20:12,t=n.getLiveDelay();return!isNaN(t)&&t>0?Math.min(e,t):e}return e={getCatchupMaxDrift:function(){if(!isNaN(a.get().streaming.liveCatchup.maxDrift)&&a.get().streaming.liveCatchup.maxDrift>0)return a.get().streaming.liveCatchup.maxDrift;var e=r.getServiceDescriptionSettings();return e&&e.liveCatchup&&!isNaN(e.liveCatchup.maxDrift)&&e.liveCatchup.maxDrift>0?e.liveCatchup.maxDrift:12},getCatchupModeEnabled:function(){return null!==a.get().streaming.liveCatchup.enabled?a.get().streaming.liveCatchup.enabled:n.getInitialCatchupModeActivated()},getStableBufferTime:u,getInitialBufferLevel:function(){var e=a.get().streaming.buffer.initialBufferLevel;return isNaN(e)||e<0?0:Math.min(u(),e)},getRetryAttemptsForType:function(e){var t=isNaN(a.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:a.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return n.getLowLatencyModeEnabled()?a.get().streaming.retryAttempts[e]*t:a.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){var t=isNaN(a.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:a.get().streaming.retryIntervals.lowLatencyReductionFactor;return n.getLowLatencyModeEnabled()?a.get().streaming.retryIntervals[e]/t:a.get().streaming.retryIntervals[e]},getCatchupPlaybackRates:function(e){var t=a.get().streaming.liveCatchup.playbackRate;if(!isNaN(t.min)||!isNaN(t.max))return{min:o(t.min,e),max:s(t.max,e)};var n=r.getServiceDescriptionSettings();if(n&&n.liveCatchup&&(!isNaN(n.liveCatchup.playbackRate.min)||!isNaN(n.liveCatchup.playbackRate.max))){var i=n.liveCatchup.playbackRate;return{min:o(i.min,e),max:s(i.max,e)}}return{min:-.5,max:.5}},getAbrBitrateParameter:function(e,t){try{var n=a.get().streaming.abr[e][t];if(!isNaN(n)&&-1!==n)return n;var i=r.getServiceDescriptionSettings();return i&&i[e]&&!isNaN(i[e][t])?i[e][t]:-1}catch(e){return-1}},setConfig:function(e){e.playbackController&&(n=e.playbackController),e.serviceDescriptionController&&(r=e.serviceDescriptionController)},reset:function(){}},t=(0,f.Z)(i).getInstance().getLogger(e),e}Wr.__dashjs_factory_name="MediaPlayerModel";const Xr=c.Z.getSingletonFactory(Wr);var Qr=n(1767);function $r(e){var t=(e=e||{}).abrController,n=e.switchHistory,r=e.droppedFramesHistory,i=e.currentRequest,a=e.useBufferOccupancyABR,o=e.useL2AABR,s=e.useLoLPABR,u=e.streamProcessor?e.streamProcessor.getScheduleController():null,l=e.streamProcessor?e.streamProcessor.getRepresentationInfo():null,c=e.videoModel?e.videoModel:null;function f(){return l?l.mediaInfo:null}return{getMediaType:function(){var e=f();return e?e.type:null},getMediaInfo:f,getDroppedFramesHistory:function(){return r},getCurrentRequest:function(){return i},getSwitchHistory:function(){return n},getStreamInfo:function(){var e=f();return e?e.streamInfo:null},getScheduleController:function(){return u},getAbrController:function(){return t},getRepresentationInfo:function(){return l},useBufferOccupancyABR:function(){return a},useL2AABR:function(){return o},useLoLPABR:function(){return s},getVideoModel:function(){return c}}}$r.__dashjs_factory_name="RulesContext";const Jr=c.Z.getClassFactory($r);var ei=n(2068);function ti(){var e=[],t=[];return{push:function(n){n.newValue===ei.Z.NO_CHANGE&&(n.newValue=n.oldValue),e[n.oldValue]||(e[n.oldValue]={noDrops:0,drops:0,dropSize:0});var r=n.newValue-n.oldValue,i=r<0?1:0,a=i?-r:0,o=i?0:1;if(e[n.oldValue].drops+=i,e[n.oldValue].dropSize+=a,e[n.oldValue].noDrops+=o,t.push({idx:n.oldValue,noDrop:o,drop:i,dropSize:a}),t.length>8){var s=t.shift();e[s.idx].drops-=s.drop,e[s.idx].dropSize-=s.dropSize,e[s.idx].noDrops-=s.noDrop}},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}ti.__dashjs_factory_name="SwitchRequestHistory";const ni=c.Z.getClassFactory(ti);function ri(){var e={},t={},n={};return{push:function(r,i,a){if(i){e[r]||(e[r]=[],t[r]=0,n[r]=0);var o=a&&a.droppedVideoFrames?a.droppedVideoFrames:0,s=a&&a.totalVideoFrames?a.totalVideoFrames:0,u=o-t[r];t[r]=o;var l=s-n[r];n[r]=s;var c=e[r];isNaN(i)||(c[i]?(c[i].droppedVideoFrames+=u,c[i].totalVideoFrames+=l):c[i]={droppedVideoFrames:u,totalVideoFrames:l})}},getFrameHistory:function(t){return e[t]},clearForStream:function(r){try{delete e[r],delete t[r],delete n[r]}catch(e){}},reset:function(){e={},t={},n={}}}}ri.__dashjs_factory_name="DroppedFramesHistory";const ii=c.Z.getClassFactory(ri);function ai(e){var t,n,r,i,o,s=(e=e||{}).settings;function u(e,t,n,r){var i=Math.pow(.5,n/r.fast);e.fastEstimate=(1-i)*t+i*e.fastEstimate;var a=Math.pow(.5,n/r.slow);e.slowEstimate=(1-a)*t+a*e.slowEstimate,e.totalWeight+=n}function l(e,u,l){return s.get().streaming.abr.movingAverageMethod!==a.Z.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var n=e?o.throughputHalfLife:o.latencyHalfLife,a=e?r[t]:i[t];if(!a||a.totalWeight<=0)return NaN;var s=a.fastEstimate/(1-Math.pow(.5,a.totalWeight/n.fast)),u=a.slowEstimate/(1-Math.pow(.5,a.totalWeight/n.slow));return e?Math.min(s,u):Math.max(s,u)}(e,u):function(e,r,i){var a=function(e,r,i){var a,o;if(e?(a=t[r],o=i?3:4):(a=n[r],o=4),a){if(o>=a.length)o=a.length;else if(e)for(var s=1;s=1.3||u<=1/1.3)&&(o+=1)===a.length)break}}else o=0;return o}(e,r,i),o=(e?t:n)[r];return 0!==a&&o&&0!==o.length?(o=o.slice(-a)).reduce((function(e,t){return e+t}))/o.length:NaN}(e,u,l)}function c(e,t){return l(!0,e,t)}function f(e){t[e]=t[e]||[],n[e]=n[e]||[],r[e]=r[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},i[e]=i[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function d(){t={},n={},r={},i={}}var g={push:function(e,l,c){if(l.trace&&l.trace.length){var d,g=l.tresponse.getTime()-l.trequest.getTime()||1,h=l._tfinish.getTime()-l.tresponse.getTime()||1,p=l.trace.reduce((function(e,t){return e+t.b[0]}),0),m=0;if(0!==(d=l._fileLoaderType&&l._fileLoaderType===a.Z.FILE_LOADER_TYPES.FETCH?l.trace.reduce((function(e,t){return e+t.d}),0):c?h:g+h)&&(m=Math.round(8*p/d)),l.cmsd){var y=l.cmsd.dynamic&&l.cmsd.dynamic.etp?l.cmsd.dynamic.etp:null;if(y){var E=s.get().streaming.cmsd.abr.etpWeightRatio;E>0&&E<=1&&(m=m*(1-E)+y*E)}}if(f(e),function(e,t,n){return e===a.Z.VIDEO?n0&&!t[e].hasCachedEntries)return;t[e].hasCachedEntries=!0}else t[e]&&t[e].hasCachedEntries&&function(e){delete t[e],delete n[e],delete r[e],delete i[e],f(e)}(e);t[e].push(m),t[e].length>20&&t[e].shift(),n[e].push(g),n[e].length>20&&n[e].shift(),u(r[e],m,.001*h,o.throughputHalfLife),u(i[e],g,1,o.latencyHalfLife)}},getAverageThroughput:c,getSafeAverageThroughput:function(e,t){var n=c(e,t);return isNaN(n)||(n*=s.get().streaming.abr.bandwidthSafetyFactor),n},getAverageLatency:function(e){return l(!1,e)},reset:d};return o={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},d(),g}ai.__dashjs_factory_name="ThroughputHistory";const oi=c.Z.getClassFactory(ai);function si(){var e,t,n,r,i,o,c,g,h,p,m,y,E,v,_,S,b,A,I,R,w,N,D,O,M,P,L,x=this.context,F=(0,f.Z)(x).getInstance(),k=(0,u.Z)(x).getInstance();function Z(){i={},o={},g={},c={},R={},D={},O={},M={},void 0===p&&(p=!1),w&&w.reset(),I=void 0,w=void 0,N=void 0,clearTimeout(h),h=null}function U(t){var i=t.request.mediaType,a=t.streamId;if(i&&a&&c[a]&&L.get().streaming.abr.autoSwitchBitrate[i]){var o=c[a][i];if(o){var u=Jr(x).create({abrController:e,streamProcessor:o,currentRequest:t.request,useBufferOccupancyABR:D[i],useL2AABR:O[i],useLoLPABR:M[i],videoModel:v}),l=n.shouldAbandonFragment(u,a);l.quality>ei.Z.NO_CHANGE&&o.getFragmentModel().getRequests({state:T.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(g[a][i].state=s.Z.ABANDON_LOAD,R[a][i].reset(),R[a][i].push({oldValue:q(i,a),newValue:l.quality,confidence:1,reason:l.reason}),H(i,r.getActiveStreamInfo(),l.quality,l.reason),clearTimeout(h),h=setTimeout((function(){g[a][i].state=s.Z.ALLOW_LOAD,h=null}),L.get().streaming.abandonLoadTimeout))}}}function B(e){e.mediaType===a.Z.VIDEO&&(void 0!==I&&w.push(e.streamId,I,v.getPlaybackQuality()),I=e.newQuality)}function G(e){var n,r;e.metric!==s.Z.HTTP_REQUEST||!e.value||e.value.type!==C.w.MEDIA_SEGMENT_TYPE||e.mediaType!==a.Z.AUDIO&&e.mediaType!==a.Z.VIDEO||N.push(e.mediaType,e.value,L.get().streaming.abr.useDeadTimeLatency),e.metric!==s.Z.BUFFER_LEVEL||e.mediaType!==a.Z.AUDIO&&e.mediaType!==a.Z.VIDEO||(n=e.mediaType,r=.001*e.value.level,L.get().streaming.abr.ABRStrategy===a.Z.ABR_STRATEGY_DYNAMIC&&function(e,n){try{var r=_.getStableBufferTime(),i=r,a=.5*r,o=D[e],s=n>(o?a:i);D[e]=s,s!==o&&(s?t.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+n.toFixed(3)+")."):t.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+n.toFixed(3)+")."))}catch(e){t.error(e)}}(n,r))}function j(e,n){try{var r;return i[n]=i[n]||{},i[n].hasOwnProperty(e)||(i[n][e]=0),r=function(e,t){var n=i[t][e],r=n;if(!c[t]||!c[t][e])return r;var a=Y(e,t);void 0!==a&&(r=Math.max(n,a));var o=function(e,t){try{var n=_.getAbrBitrateParameter("maxBitrate",e);return n>-1?W(c[t][e].getMediaInfo(),n,t):void 0}catch(e){return}}(e,t);return void 0!==o&&(r=Math.min(r,o)),r}(e,n),r=function(e,t,n){var r=i[n][t],a=L.get().streaming.abr.maxRepresentationRatio[t];return isNaN(a)||a>=1||a<0?e:Math.min(e,Math.round(r*a))}(r,e,n),r=function(e,t,n){if(t!==a.Z.VIDEO||!L.get().streaming.abr.limitBitrateByPortal||!c[n]||!c[n][t])return e;p||Q();var r=c[n][t].getStreamInfo(),i=E.getAdaptationForType(r.index,t,r).Representation_asArray,o=e;if(m>0&&y>0){for(;o>0&&i[o]&&m-1){var r=c[t][e].getMediaInfo(),i=X(r),a=W(r,n,t);return i[a]&&a1&&void 0!==arguments[1]?arguments[1]:null;try{return t||(t=r.getActiveStreamInfo().id),e&&c[t]&&c[t][e]&&t?(o[t]=o[t]||{},o[t].hasOwnProperty(e)||(o[t][e]=0),o[t][e]):0}catch(e){return 0}}function H(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(t&&t.id&&e){var i=t.id,a=q(e,i);(0,z.SE)(n);var o=j(e,i);n!==a&&n>=0&&n<=o&&V(e,a,n,o,r,i)}}function V(e,n,r,i,a,s){if(e&&c[s]&&c[s][e]){var u=c[s][e].getStreamInfo(),f=u&&u.manifestInfo&&u.manifestInfo.isDynamic,d=P.getCurrentBufferLevel(e);t.info("Stream ID: "+s+" ["+e+"] switch from "+n+" to "+r+"/"+i+" (buffer: "+d+") "+(a?JSON.stringify(a):".")),o[s]=o[s]||{},o[s][e]=r;var g=K(s,e,r);k.trigger(l.Z.QUALITY_CHANGE_REQUESTED,{oldQuality:n,newQuality:r,reason:a,streamInfo:u,bitrateInfo:g,maxIdx:i,mediaType:e},{streamId:u.id,mediaType:e});var h=N.getAverageThroughput(e,f);isNaN(h)||A.setSavedBitrateSettings(e,h)}}function K(e,t,n){if(t&&c&&c[e]&&c[e][t]){var r=X(c[e][t].getMediaInfo());return r[n]?r[n]:null}return null}function W(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e&&e.type?c[n][e.type].getRepresentationInfo():null;if(L.get().streaming.abr.useDeadTimeLatency&&r&&i&&i.fragmentDuration){r/=1e3;var a=i.fragmentDuration;if(r>a)return 0;var o=r/a;t*=1-o}for(var s=X(e),u=s.length-1;u>=0;u--){var l=s[u];if(1e3*t>=l.bitrate)return u}return 0}function X(e){var t=[];if(!e||!e.bitrateList)return t;for(var n,r=e.bitrateList,i=e.type,a=0,o=r.length;a1&&void 0!==arguments[1]?arguments[1]:null;if(t||(t=r.getActiveStreamInfo().id),e&&c&&c[t]&&c[t][e]){var n=j(e,t),i=X(c[t][e].getMediaInfo());return i[n]?i[n]:null}return null},getMinAllowedIndexFor:Y,getMaxAllowedIndexFor:j,getInitialBitrateFor:function(e,t){if(function(){if(!A||!A.hasOwnProperty("getSavedBitrateSettings"))throw new Error(a.Z.MISSING_CONFIG_ERROR)}(),e===a.Z.TEXT)return NaN;var n=A.getSavedBitrateSettings(e),r=_.getAbrBitrateParameter("initialBitrate",e),i=L.get().streaming.abr.initialRepresentationRatio[e];if(-1===r)if(i>-1){var o=c[t][e].getStreamInfo(),s=E.getAdaptationForType(o.index,e,o).Representation_asArray;r=Array.isArray(s)?s[Math.max(Math.round(s.length*i)-1,0)].bandwidth/1e3:0}else r=isNaN(n)?e===a.Z.VIDEO?1e3:100:n;return r},getQualityFor:q,getAbandonmentStateFor:function(e,t){return g[e]&&g[e][t]?g[e][t].state:null},setPlaybackQuality:H,checkPlaybackQuality:function(t,r){try{if(!(t&&c&&c[r]&&c[r][t]))return!1;if(w){var i=v.getPlaybackQuality();i&&w.push(r,I,i)}if(!L.get().streaming.abr.autoSwitchBitrate[t])return!1;var a=q(t,r),o=Jr(x).create({abrController:e,switchHistory:R[r][t],droppedFramesHistory:w,streamProcessor:c[r][t],currentValue:a,useBufferOccupancyABR:D[t],useL2AABR:O[t],useLoLPABR:M[t],videoModel:v}),u=Y(t,r),l=j(t,r),f=n.getMaxQuality(o),d=f.quality;return void 0!==u&&(d>ei.Z.NO_CHANGE?d:a)l&&(d=l),R[r][t].push({oldValue:a,newValue:d}),d>ei.Z.NO_CHANGE&&d!==a&&(g[r][t].state===s.Z.ALLOW_LOAD||d0}function p(){if(n&&h()&&0===n.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}function m(e,t){n&&n.addEventListener(e,t)}function y(e,t){n&&n.removeEventListener(e,t)}function E(){return n?n.readyState:NaN}function v(){return n?n.buffered:null}function _(e,t,r,i,a){if(n)for(var o=0;o=e?t():function(e,t){m(e,(function n(){y(e,n),t(e)}))}(ci.get(e),t)}return e={initialize:function(){c.on(l.Z.PLAYBACK_PLAYING,p,this)},setCurrentTime:function(e,t){n&&(r=e,T(a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(function(){if(n.currentTime!==r)try{r=t?function(e){var t=v(),n=e,r=9999999999;if(t)for(var i=0;i=a&&e<=o)return e;s1&&void 0!==arguments[1]&&arguments[1];n&&(!t&&n.readyState<=2&&e>0?n.addEventListener("canplay",g):n.playbackRate=e)},getPlayedRanges:function(){return n?n.played:null},getEnded:function(){return n?n.ended:null},setStallState:function(e,t){!function(e,t){t?function(e){null!==e&&n&&!n.seeking&&-1===d.indexOf(e)&&d.push(e)}(e):function(e){var t=d.indexOf(e);null!==e&&-1!==t&&d.splice(t,1)}(e)}(e,t)},getElement:function(){return n},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw"element is not video or audio DOM type!";(n=e)&&(n.preload="auto")},setSource:function(e){n&&(e?n.src=e:(n.removeAttribute("src"),n.load()))},getSource:function(){return n?n.src:null},getTTMLRenderingDiv:function(){return i},setTTMLRenderingDiv:function(e){(i=e).style.position="absolute",i.style.display="flex",i.style.overflow="hidden",i.style.pointerEvents="none",i.style.top=0,i.style.left=0},getVttRenderingDiv:function(){return o},setVttRenderingDiv:function(e){o=e},getPlaybackQuality:function(){if(!n)return null;var e="webkitDroppedFrameCount"in n&&"webkitDecodedFrameCount"in n,t=null;return"getVideoPlaybackQuality"in n?t=n.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:n.webkitDroppedFrameCount,totalVideoFrames:n.webkitDroppedFrameCount+n.webkitDecodedFrameCount,creationTime:new Date}),t},addEventListener:m,removeEventListener:y,getReadyState:E,getBufferRange:v,getClientWidth:function(){return n?n.clientWidth:NaN},getClientHeight:function(){return n?n.clientHeight:NaN},getTextTracks:function(){return n?n.textTracks:[]},getTextTrack:_,addTextTrack:function(e,t,r,i,a){if(!n)return null;var o=_(e,t,r,i,a);return o||((o=n.addTextTrack(e,t,r)).isEmbedded=a,o.isTTML=i),o},appendChild:function(e){n&&(n.appendChild(e),void 0!==e.isTTML&&(n.textTracks[n.textTracks.length-1].isTTML=e.isTTML,n.textTracks[n.textTracks.length-1].isEmbedded=e.isEmbedded))},removeChild:function(e){n&&n.removeChild(e)},getVideoWidth:function(){return n?n.videoWidth:NaN},getVideoHeight:function(){return n?n.videoHeight:NaN},getVideoRelativeOffsetTop:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN},getVideoRelativeOffsetLeft:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN},waitForReadyState:T,reset:function(){c.off(l.Z.PLAYBACK_PLAYING,p,this)}},t=(0,f.Z)(s).getInstance().getLogger(e),r=NaN,e}fi.__dashjs_factory_name="VideoModel";const di=c.Z.getSingletonFactory(fi);var gi=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],hi="dashjs_?_bitrate",pi="dashjs_?_settings",mi="localStorage",yi="lastBitrate",Ei="lastMediaSettings";function vi(e){e=e||{};var t,n,r,i=this.context,o=e.settings;function s(e){if(void 0!==r)return r;var t;r=!1;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return n.warn("DOMStorage access denied: "+e.message),r}if(!t||e!==mi&&"sessionStorage"!==e)return r;try{t.setItem("1","1"),t.removeItem("1"),r=!0}catch(e){n.warn("DOMStorage is supported, but cannot be used: "+e.message)}return r}function u(){var e=6e5;return Math.round((new Date).getTime()/e)*e}function l(e,t){return s(e)&&o.get().streaming[t+"CachingInfo"].enabled}function c(){if(!o)throw new Error(a.Z.MISSING_CONFIG_ERROR)}return t={getSavedBitrateSettings:function(e){if(c(),!o.get().streaming.lastBitrateCachingInfo.enabled)return NaN;var t=NaN;if(l(mi,yi)){var r=hi.replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=o.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(i.bitrate);isNaN(s)||a?a&&localStorage.removeItem(r):(t=s,n.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(l(mi,yi)&&t){var r=hi.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({bitrate:t.toFixed(3),timestamp:u()}))}catch(e){n.error(e.message)}}},getSavedMediaSettings:function(e){if(c(),!o.get().streaming.lastMediaSettingsCachingInfo.enabled)return null;var t=null;if(l(mi,Ei)){var n=pi.replace(/\?/,e);try{var r=JSON.parse(localStorage.getItem(n))||{},i=(new Date).getTime()-parseInt(r.timestamp,10)>=o.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=r.settings,i&&(localStorage.removeItem(n),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(l(mi,Ei)){var r=pi.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({settings:t,timestamp:u()}))}catch(e){n.error(e.message)}}}},n=(0,f.Z)(i).getInstance().getLogger(t),s(mi)&&gi.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){n.error(e.message)}}})),t}vi.__dashjs_factory_name="DOMStorage";const _i=c.Z.getSingletonFactory(vi);var Ti=n(2032),Si=n(2011);function bi(){var e,t,n,r,i,a,o,s,u,l,c,f,d,g=this.context;function h(e,n,i,a){var o=null,u=e?d.resolve(e.path):null,l=a||{init:!0,url:u?u.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:n};t.debug("Start searching for initialization.");var c=E(l);s.load({request:c,success:function(t){if(l.bytesLoaded=l.range.end,!(o=r.findInitRange(t)))return l.range.end=l.bytesLoaded+l.bytesToLoad,h(e,n,i,l);e.range=o,i(e)},error:function(){i(e)}}),t.debug("Perform init search: "+l.url)}function m(e,n,i,a,o,u){if(i&&(void 0===i.start||void 0===i.end)){var l=i?i.toString().split("-"):null;i=l?{start:parseFloat(l[0]),end:parseFloat(l[1])}:null}o=o||y;var c=null,f=null,g=!!i,h=e?d.resolve(e.path):null,p={init:!1,url:h?h.url:void 0,range:g?i:{start:0,end:1500},searching:!g,bytesLoaded:u?u.bytesLoaded:0,bytesToLoad:1500,mediaType:n},v=E(p);s.load({request:v,success:function(i){var s=p.bytesToLoad,u=i.byteLength;if(p.bytesLoaded=p.range.end-p.range.start,c=r.parse(i),(f=c.getBox("sidx"))&&f.isComplete){var l,d,g=f.references;if(null!=g&&g.length>0&&(l=1===g[0].reference_type),l){var h,y,E,v;t.debug("Initiate multiple SIDX load."),p.range.end=p.range.start+f.size;var _=[],T=0,S=(f.offset||p.range.start)+f.size,b=function(t){t?(_=_.concat(t),++T>=y&&(_.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),o(_,e,a))):o(null,e,a)};for(h=0,y=g.length;h16777215?(n.getUint32(r)!==e.tag&&(i=!1),a=4):e.tag>65535?(256*n.getUint16(r)+n.getUint8(r+2)!==e.tag&&(i=!1),a=3):e.tag>255?(n.getUint16(r)!==e.tag&&(i=!1),a=2):(n.getUint8(r)!==e.tag&&(i=!1),a=1),!i&&e.required&&!t)throw new Error("required tag not found");return i&&(r+=a),i}function a(e){var t=1,i=128,a=-1,o=0,s=n.getUint8(r),u=0;for(u=0;u<8;u+=1){if((s&i)===i){o=void 0===e?s&~i:s,a=u;break}i>>=1}for(u=0;u1&&a){var l=d(a,n);if(i[a.id]&&i[a.id][n])for(var f=0,g=u.length;f0))return u;s=r[0].mpd.manifest}var l=E(e,o),c=t.getAdaptationsForType(s,e?e.index:null,n);return u=f(s,l,e,c,n),n===a.TEXT&&(c=t.getAdaptationsForType(s,e?e.index:null,a.VIDEO),u=u.concat(f(s,l,e,c,n,!0))),u}function g(e){var n=h(e);return t.getRegularPeriods(n)}function h(e){var n=m(e);return t.getMpd(n)}function p(){r=[],i={}}function m(e){return e||(r.length>0?r[0].mpd.manifest:null)}function y(e){try{var n=E(e.streamInfo,r),i=t.getAdaptationsForPeriod(n);return e&&e.streamInfo&&void 0!==e.streamInfo.id&&i?i[e.index]:null}catch(e){return null}}function E(e,t){for(var n=t.length,r=0;r=0&&void 0!==s&&(n=t?"cea-608:"+t:"cea-608",r.embeddedCaptions=!0),n})),r.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(i).map((function(e){return e.value})),0===r.audioChannelConfiguration.length&&Array.isArray(i.Representation_asArray)&&i.Representation_asArray.length>0&&(r.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(i.Representation_asArray[0]).map((function(e){return e.value}))),r.roles=t.getRolesForAdaptation(i).map((function(e){return e.value})),r.codec=t.getCodec(i),r.mimeType=t.getMimeType(i),r.contentProtection=t.getContentProtectionData(i),r.bitrateList=t.getBitrateListForAdaptation(i),r.selectionPriority=t.getSelectionPriority(i),r.contentProtection){var a=r.contentProtection.map((function(e){return t.getKID(e)})).filter((function(e){return null!==e}));if(a.length){var o=a[0];r.contentProtection.forEach((function(e){e.keyId=o}))}}return r.isText=t.getIsText(i),r.supplementalProperties=t.getSupplementalProperties(i),r.isFragmented=t.getIsFragmented(i),r.isEmbedded=!1,r}function _(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=a.TEXT,e.codec="cea-608-in-SEI",e.isEmbedded=!0,e.isFragmented=!1,e.lang=ln()(n),e.roles=["caption"]}function T(e){var n,r,i=new Pi;return i.id=e.id,i.index=e.index,i.start=e.start,i.duration=e.duration,i.manifestInfo=(n=e.mpd,(r=new Li).dvrWindowSize=n.timeShiftBufferDepth,r.loadedTime=n.manifest.loadedTime,r.availableFrom=n.availabilityStartTime,r.minBufferTime=n.manifest.minBufferTime,r.maxFragmentDuration=n.maxSegmentDuration,r.duration=t.getDuration(n.manifest),r.isDynamic=t.getIsDynamic(n.manifest),r.serviceDescriptions=t.getServiceDescriptions(n.manifest),r.protocol=n.manifest.protocol,r),i.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(i.start+i.duration-i.manifestInfo.duration)<1,i}function S(){if(!a)throw new Error("setConfig function has to be called previously")}function b(e){return r.length>0?r[0].mpd.manifest.Period_asArray[e]:null}function A(e,t,n){var r,i,a,o,s;if(e)for(r=e.AdaptationSet_asArray,o=0;o0?e.segments[0].duration:NaN),n.MSETimeOffset=e.MSETimeOffset,n.mediaInfo=v(e.adaptation),n}return null},getStreamsInfo:function(e,t){var n=[],i=r;if(e&&(S(),i=g(e)),i.length>0){(!t||t>i.length)&&(t=i.length);for(var a=0;a0&&o&&(a=i?t.getAdaptationForId(i,r[0].mpd.manifest,o.index):t.getAdaptationForIndex(n?n.index:null,r[0].mpd.manifest,o.index)),a},getProducerReferenceTimes:function(e,n){var i,a,o=E(e,r);return i=n?n.id:null,r.length>0&&o&&(a=i?t.getAdaptationForId(i,r[0].mpd.manifest,o.index):t.getAdaptationForIndex(n?n.index:null,r[0].mpd.manifest,o.index)),a?t.getProducerReferenceTimesForAdaptation(a):[]},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,r[0].mpd.manifest)},getEssentialPropertiesForRepresentation:function(e){try{return t.getEssentialPropertiesForRepresentation(e)}catch(e){return[]}},getVoRepresentations:function(e){var n=y(e);return t.getRepresentationsForAdaptation(n)},getEventsFor:function(e,n,i){var a=[];if(r.length>0){var o=r[0].mpd.manifest;if(e instanceof Pi){var s=E(e,r);a=t.getEventsForPeriod(s)}else if(e instanceof Mi){var u=E(i,r);a=t.getEventStreamForAdaptationSet(o,y(e),u)}else if(e instanceof Oi){var l=E(i,r);a=t.getEventStreamForRepresentation(o,n,l)}}return a},getEvent:function(e,t,n,r){try{if(!e||!t||isNaN(n)||!r)return null;var i=e.scheme_id_uri,a=e.value;if(!t[i+"/"+a])return null;var o,s=new ve,u=e.timescale||1,l=r.adaptation.period.start,c=t[i+"/"+a],f=isNaN(r.presentationTimeOffset)?isNaN(c.presentationTimeOffset)?0:c.presentationTimeOffset:r.presentationTimeOffset,d=e.presentation_time_delta/u;o=0===e.version?l+n-f+d:l-f+d;var g=e.event_duration/u,h=e.id,p=e.message_data;return s.eventStream=c,s.eventStream.value=a,s.eventStream.timescale=u,s.duration=g,s.id=h,s.calculatedPresentationTime=o,s.messageData=p,s.presentationTimeDelta=d,s}catch(e){return null}},getMpd:h,setConfig:function(e){e&&(e.constants&&(a=e.constants),e.cea608parser&&(s=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;S(),r=g(e)},getIsTextTrack:function(e){return t.getIsText(e)},getUTCTimingSources:function(){var e=m();return t.getUTCTimingSources(e)},getSuggestedPresentationDelay:function(){var e=r.length>0?r[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getAvailabilityStartTime:function(e){var n=h(e);return t.getAvailabilityStartTime(n)},getIsTypeOf:function(e,n){return t.getIsTypeOf(e,n)},getIsDynamic:function(e){var n=m(e);return t.getIsDynamic(n)},getDuration:function(e){var n=m(e);return t.getDuration(n)},getRegularPeriods:g,getContentSteering:function(e){return t.getContentSteering(e)},getLocation:function(e){return t.getLocation(e)},getPatchLocation:function(e){var n=t.getPatchLocation(e),r=t.getPublishTime(e);if(!n||!r)return null;if(n.hasOwnProperty("ttl")&&r){var i=1e3*parseFloat(n.ttl);if(r.getTime()+i<=(new Date).getTime())return null}return n.__text},getManifestUpdatePeriod:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.getManifestUpdatePeriod(e,n)},getPublishTime:function(e){return t.getPublishTime(e)},getIsDVB:function(e){return t.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getIsPatch:function(e){return n.getIsPatch(e)},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getCodec:function(e,n,r){return t.getCodec(e,n,r)},getPeriodById:function(e){if(!e||0===r.length)return null;var t=r.filter((function(t){return t.id===e}));return t&&t.length>0?t[0]:null},setCurrentMediaInfo:function(e,t,n){i[e]=i[e]||{},i[e][t]=i[e][t]||{},i[e][t]=n},isPatchValid:function(e,r){var i=t.getId(e),a=n.getMpdId(r),o=t.getPublishTime(e),s=n.getPublishTime(r),u=n.getOriginalPublishTime(r);return!!(i&&a&&i==a&&o&&u&&o.getTime()==u.getTime()&&s&&o.getTime()1?i[r]=u:1==u.length?i[r]=u[0]:delete i[r+"_asArray"]}"add"!==t.action&&"replace"!==t.action||Object.keys(t.value).forEach((function(e){var n=t.value[e],a=i[e+"_asArray"]||[];if(0===a.length&&i[e]&&a.push(i[e]),0===a.length)a=n;else{var u=a.length;u=e==r&&-1!=o?o+(s?0:1)+("replace"==t.action?-1:0):s?0:a.length,a.splice.apply(a,[u,0].concat(n))}i[e+"_asArray"]=a,i[e]=1==a.length?a[0]:a}))}}}))},areMediaInfosEqual:c,reset:p},t=Le(u).getInstance(),n=Bi(u).getInstance(),p(),e}Gi.__dashjs_factory_name="DashAdapter";const ji=c.Z.getSingletonFactory(Gi);function Yi(e,t){for(var n=0;nr.get().streaming.metrics.maxListDepth&&i[t].shift())}function m(e,t,n){p(e,t,n),g(e,t,n)}return t={clearCurrentMetricsForType:function(e){delete n[e],f(e)},clearAllCurrentMetrics:function(){n={},c()},getMetricsFor:h,addHttpRequest:function e(t,n,r,i,a,o,u,l,c,f,d,g,h,p,y,E,v){var _=new C.w;o&&o!==i&&(e(t,null,r,i,a,null,null,l,c,null,null,null,h,null,null,E,v),_.actualurl=o),_.tcpid=n,_.type=r,_.url=i,_.range=l,_.trequest=c,_.tresponse=f,_.responsecode=g,_.cmsd=v,_._tfinish=d,_._stream=t,_._mediaduration=h,_._quality=a,_._responseHeaders=p,_._serviceLocation=u,_._fileLoaderType=E,y?y.forEach((function(e){!function(e,t,n,r){var i=new C.O;i.s=t,i.d=n,i.b=r,e.trace.push(i),e.interval||(e.interval=0),e.interval+=n}(_,e.s,e.d,e.b)})):(delete _.interval,delete _.trace),m(t,s.Z.HTTP_REQUEST,_)},addRepresentationSwitch:function(e,t,n,r,i){var a=new Vi;a.t=t,a.mt=n,a.to=r,i?a.lto=i:delete a.lto,m(e,s.Z.TRACK_SWITCH,a)},addBufferLevel:function(e,t,n){var r=new Ki;r.t=t,r.level=n,m(e,s.Z.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){var r=new zi;r.target=n,r.state=t,m(e,s.Z.BUFFER_STATE,r)},addDVRInfo:function(e,t,n,r){var i=new Wi;i.time=t,i.range=r,i.manifestInfo=n,m(e,s.Z.DVR_INFO,i)},addDroppedFrames:function(e,t){var n=new Xi,r=h(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||m(e,s.Z.DROPPED_FRAMES,n))},addSchedulingInfo:function(e,t,n,r,i,a,o,u,l){var c=new ta;c.mediaType=e,c.t=t,c.type=n,c.startTime=r,c.availabilityStartTime=i,c.duration=a,c.quality=o,c.range=u,c.state=l,m(e,s.Z.SCHEDULING_INFO,c)},addRequestsQueue:function(e,t,n){var r=new na;r.loadingRequests=t,r.executedRequests=n,h(e).RequestsQueue=r,g(e,s.Z.REQUESTS_QUEUE,r)},addManifestUpdate:function(e,t,n,r,i,o,u,l,c,f){var d=new $i;d.mediaType=e,d.type=t,d.requestTime=n,d.fetchTime=r,d.availabilityStartTime=i,d.presentationStartTime=o,d.clientTimeOffset=u,d.currentTime=l,d.buffered=c,d.latency=f,p(a.Z.STREAM,s.Z.MANIFEST_UPDATE,d),g(e,s.Z.MANIFEST_UPDATE,d)},updateManifestUpdateInfo:function(e,t){if(e){for(var n in t)e[n]=t[n];d(e.mediaType,s.Z.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,i){if(e){var a=new Ji;a.id=t,a.index=n,a.start=r,a.duration=i,e.streamInfo.push(a),d(e.mediaType,s.Z.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,n,r,i,a,o,u){if(e&&e.representationInfo){var l=new ea;l.id=t,l.index=n,l.streamIndex=r,l.mediaType=i,l.startNumber=o,l.fragmentInfoType=u,l.presentationTimeOffset=a,e.representationInfo.push(l),d(e.mediaType,s.Z.MANIFEST_UPDATE_TRACK_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach((function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel})):delete e.trace,m(a.Z.STREAM,s.Z.PLAY_LIST,e)},addDVBErrors:function(e){m(a.Z.STREAM,s.Z.DVB_ERRORS,e)}},n={},t}ra.__dashjs_factory_name="MetricsModel";const ia=c.Z.getSingletonFactory(ra);function aa(e){e=e||{};var t,n,r,i,o=this.context,u=e.metricsModel;function l(e){var t=u.getMetricsFor(e,!0);if(!t)return null;var n,r=t.HttpList,i=null;if(!r||r.length<=0)return null;for(n=r.length-1;n>=0;){if(r[n].responsecode){i=r[n];break}n--}return i}function c(e){var t=u.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function f(e,t){if(!e)return null;var n=e[t];return n&&0!==n.length?n[n.length-1]:null}return t={getCurrentRepresentationSwitch:function(e){return f(u.getMetricsFor(e,!0),s.Z.TRACK_SWITCH)},getCurrentBufferState:function(e){return f(u.getMetricsFor(e,!0),s.Z.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=f(u.getMetricsFor(e,!0),s.Z.BUFFER_LEVEL);return t?qi.round10(t.level/1e3,-3):0},getCurrentHttpRequest:l,getHttpRequests:c,getCurrentDroppedFrames:function(){return f(u.getMetricsFor(a.Z.VIDEO,!0),s.Z.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return f(u.getMetricsFor(e,!0),s.Z.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return f(e?u.getMetricsFor(e,!0):u.getMetricsFor(a.Z.VIDEO,!0)||u.getMetricsFor(a.Z.AUDIO,!0),s.Z.DVR_INFO)},getCurrentManifestUpdate:function(){return f(u.getMetricsFor(a.Z.STREAM),s.Z.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){if(!t)return null;var n={},r=l(e);r&&(n=xe.Z.parseHttpHeaders(r._responseHeaders));var i=n[t.toLowerCase()];return void 0===i?null:i},getLatestMPDRequestHeaderValueByID:function(e){if(!e)return null;var t,n,r,i={};for(r=(t=c(a.Z.STREAM)).length-1;r>=0;r--)if((n=t[r]).type===C.w.MPD_TYPE){i=xe.Z.parseHttpHeaders(n._responseHeaders);break}var o=i[e.toLowerCase()];return void 0===o?null:o},addRepresentationSwitch:function(e,t,n,r,i){u.addRepresentationSwitch(e,t,n,r,i)},addDVRInfo:function(e,t,n,r){u.addDVRInfo(e,t,n,r)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();u.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();u.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var n=this.getCurrentManifestUpdate();u.addManifestUpdateRepresentationInfo(n,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){u.addManifestUpdate(a.Z.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,n,r,i,a){u.addHttpRequest(e.mediaType,null,e.type,e.url,e.quality,t,e.serviceLocation||null,e.range||null,e.requestStartDate,e.firstByteDate,e.requestEndDate,n,e.duration,r,i,e.fileLoaderType,a)},addSchedulingInfo:function(e,t){u.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,n){u.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){u.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){u.addBufferState(e,t,n)},addDroppedFrames:function(e){u.addDroppedFrames(a.Z.VIDEO,e)},addPlayList:function(){i&&(u.addPlayList(i),i=null)},addDVBErrors:function(e){u.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(i=new ee).start=new Date,i.mstart=e,i.starttype=t},createPlaylistTraceMetrics:function(e,t,i){!0===n&&(n=!1,(r=new te).representationid=e,r.start=new Date,r.mstart=t,r.playbackspeed=null!==i?i.toString():null)},updatePlayListTraceMetrics:function(e){if(r)for(var t in r)r[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===n&&i&&r&&r.start){var a=r.start,o=e.getTime()-a.getTime();r.duration=o,r.stopreason=t,i.trace.push(r),n=!0}},clearAllCurrentMetrics:function(){u.clearAllCurrentMetrics()}},u=u||ia(o).getInstance({settings:e.settings}),n=!0,r=null,i=null,t}aa.__dashjs_factory_name="DashMetrics";const oa=c.Z.getSingletonFactory(aa);function sa(){var e,t,n,r,i=this.context,s=(0,u.Z)(i).getInstance(),c=(0,N.Z)(i).getInstance();function f(e){r=e}function g(e,t,n,r){var i,a=t.adaptation.period.mpd,o=a.availabilityStartTime;if(r)i=n&&a.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(o.getTime()+1e3*(e+a.timeShiftBufferDepth)):a.availabilityEndTime;else if(n){var s=t.availabilityTimeOffset;i=new Date(o.getTime()+1e3*(e-s))}else i=o;return i}function h(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*r)/1e3}function p(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function m(e){var n={start:NaN,end:NaN},r=e[0].getAdapter().getRegularPeriods()[0],i=h(new Date,r);if(!e||0===e.length)return{range:n,now:i};e.forEach((function(e){var r=e.getAdapter(),s=r.getMediaInfoForType(e.getStreamInfo(),a.Z.VIDEO)||r.getMediaInfoForType(e.getStreamInfo(),a.Z.AUDIO),u=r.getVoRepresentations(s)[0],l={start:NaN,end:NaN};if(u)if(u.segmentInfoType===o.Z.SEGMENT_TIMELINE)l=function(e){var n,r,i,a,o=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],s=t.getRepresentationFor(e.index,o),u=s.SegmentTemplate.SegmentTimeline,l=s.SegmentTemplate.timescale,c=u.S_asArray,f={start:0,end:0},d=0;for(f.start=p(c[0].t/l,e),i=0,a=c.length;il.start)&&(n.start=l.start),!isNaN(l.end)&&(isNaN(n.end)||n.end2&&void 0!==arguments[2]&&arguments[2];try{for(var r=0,i=!1,a=NaN;!i&&r=t)?(a=t,i=!0):!n&&o.start>t&&(isNaN(a)||o.starta)&&(a=o.start+o.duration),r+=1}return a}catch(e){return t}}function v(e){void 0===e.offset||isNaN(e.offset)||f(e.offset/1e3)}function _(){r=0,n=0}function T(){s.off(l.Z.UPDATE_TIME_SYNC_OFFSET,v,this),_()}return e={initialize:function(){_(),s.on(l.Z.UPDATE_TIME_SYNC_OFFSET,v,this)},getClientTimeOffset:function(){return r},setClientTimeOffset:f,getClientReferenceTime:function(){return Date.now()-1e3*n+1e3*r},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return g(e,t,n)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return g(e,t,n,!0)},calcPresentationTimeFromWallTime:h,calcPresentationTimeFromMediaTime:p,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcWallTimeForSegment:function(e,t){var n,r,i;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},calcTimeShiftBufferWindow:function(e,t){if(!t)return function(e){var t={start:NaN,end:NaN},n=0,r=NaN;return e.forEach((function(e){var t=e.getStreamInfo();n+=t.duration,(isNaN(r)||t.start0&&(p.spans.push({name:m,line:T,row:c}),T="");var w="style_cea608_"+R.foreground+"_"+R.background;R.underline&&(w+="_underline"),R.italics&&(w+="_italics"),E.hasOwnProperty(w)||(E[w]=JSON.parse(JSON.stringify(R))),S=R,m=w}T+=I.uchar}T.trim().length>0&&p.spans.push({name:m,line:T,row:c}),g=!0,h=b}else g=!1,h=-1,d&&(d.p.push(p),p={start:s,end:u,spans:[]},d.y2=c,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(v.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d=null)}d&&(d.p.push(p),d.y2=c+1,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(v.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d=null);var N=[];for(c=0;c0){if(0!==f&&k!=Z.row){var U=document.createElement("br");U.className="lineBreak",L.appendChild(U)}var B=!1;k===Z.row&&(B=!0),k=Z.row;var G=E[Z.name],j=document.createElement("span");j.className="spanPadding "+Z.name+" customSpanColor",j.style.cssText=i(r,G),0!==f&&B?f===F.spans.length-1?j.textContent=o(Z.line):j.textContent=Z.line:F.spans.length>1&&f1&&e.isEmbedded?t=e.id&&e.id===a.Z.CC1:1===y.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===y.length&&(t=e.index===s[0].index),t}(e),t.isFragmented=e.isFragmented,t.isEmbedded=!!e.isEmbedded,t.isTTML=function(e){return e.codec&&e.codec.search(a.Z.STPP)>=0||e.mimeType&&e.mimeType.search(a.Z.TTML)>=0}(e),t.kind=function(e,t){var n=e.roles&&e.roles.length>0?t[e.roles[0]]:t.caption;return n=n===t.caption||n===t.subtitle?n:t.caption}(e,{subtitle:"subtitles",caption:"captions"}),N.addTextTrack(t)}function B(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&j(t.bytes,t)}function G(e){m=e}function j(e,s){var u=s.mediaInfo,l=u.type,f=u.mimeType,h=u.codec||f;h?-1!==u.codec.indexOf("application/mp4")?function(e,i,s){var u;if("InitializationSegment"===i.segmentType)d=!0,g=r.getMediaTimescaleFromMoov(e);else{if(!d)return;(u=r.getSamplesInfo(e).sampleList).length>0&&(p=u[0].cts-i.start*g),s.search(a.Z.STPP)>=0?function(e,r,i){var s,u;for(o=null!==o?o:H(i),s=0;s0&&N.addCaptions(m,0,s)}(e,u)}}(e,s,h):l===a.Z.VIDEO?function(e,t){var a,o;if(t.segmentType===C.w.INIT_SEGMENT_TYPE)0===E&&(E=r.getMediaTimescaleFromMoov(e));else if(t.segmentType===C.w.MEDIA_SEGMENT_TYPE){if(0===E)return void n.warn("CEA-608: No timescale for embeddedTextTrack yet");var s=(o=r.getSamplesInfo(e)).lastSequenceNumber;if(_[0]||_[1]||function(){for(var e,t=0;t0){o.cts!==u?l=0:l+=1;var g=q();n.fields[d].push([o.cts+g*E,f[d],l]),u=o.cts}return n.fields.forEach((function(e){e.sort((function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]}))})),n}(e,o.sampleList),l=0;l<_.length;l++){var c=u.fields[l],f=_[l];if(f)for(a=0;a=0?t=L.get().streaming.text.webvtt.customRenderingEnabled&&O?O:D:(e.search(a.Z.TTML)>=0||e.search(a.Z.STPP)>=0)&&(t=M),t}function V(e){y.forEach((function(t){var n=N.getTrackIdxForId(t.id);n>=0&&N.deleteCuesFromTrackIdx(n,e.from,e.to)}))}return t={initialize:function(){k||(y=[],m=null,E=0,_=[],v=null,k=!0,T=Ea(x).getInstance(),F.on(l.Z.VIDEO_CHUNK_RECEIVED,B,t),F.on(l.Z.BUFFER_CLEARED,V,t))},addMediaInfos:function(e,n,r){if(s=s.concat(n),e===a.Z.TEXT&&n[0].isFragmented&&!n[0].isEmbedded){c=r,t.buffered=(0,ma.Z)(x).create(),h=I.getTracksFor(a.Z.TEXT,P.id).filter((function(e){return e.isFragmented}));for(var i=I.getCurrentTrackFor(a.Z.TEXT,P.id),o=0;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);nn/r?o=(s=t)/r*n:s=(o=e)/n*r;var u,l,c=0,f=0;return o/s>i?(f=s,c=s*i):(c=o,f=o/i),u=(e-c)/2,l=(t-f)/2,a?{x:u+.1*c,y:l+.1*f,w:.8*c,h:.8*f}:{x:u,y:l,w:c,h:f}}function D(e,t){var n=R.getClientWidth(),r=R.getClientHeight(),i=R.getVideoWidth(),a=R.getVideoHeight(),o=R.getVideoRelativeOffsetTop(),s=R.getVideoRelativeOffsetLeft();if(0!==i&&0!==a){var u=i/a,l=!1;e.isFromCEA608&&(u=3.5/3,l=!0);var f=C.call(this,n,r,i,a,u,l),y=f.w,E=f.h,T=f.x,b=f.y;if(y!=h||E!=p||T!=c||b!=g||t){if(c=T+s,g=b+o,h=y,p=E,m){var A=m.style;A&&(A.left=c+"px",A.top=g+"px",A.width=h+"px",A.height=p+"px",A.zIndex=v&&document[v]||_?S:null,I.trigger(d.Z.CAPTION_CONTAINER_RESIZE))}var w=e.activeCues;if(w)for(var N=w.length,D=0;D=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(R.getTextTracks());try{for(n.s();!(e=n.n()).done;){var r=e.value;r.manualMode===a.Z.TEXT_SHOWING&&t.push(r)}}catch(e){n.e(e)}finally{n.f()}return t}function Z(e){return e>=0&&i[e]?R.getTextTrack(i[e].kind,i[e].id,i[e].lang,i[e].isTTML,i[e].isEmbedded):null}function U(e){var t=this;if(e!==s){var n=Z(s=e);B.call(this,n),E&&(clearInterval(E),E=null),n&&"html"===n.renderingType&&(D.call(this,n,!0),window.ResizeObserver?(b=new window.ResizeObserver((function(){D.call(t,n,!0)}))).observe(R.getElement()):E=setInterval(D.bind(this,n),500))}}function B(e){V.call(this),e&&"html"===e.renderingType?q.call(this):H.call(this)}function G(e,t){if(!e.cues)return!1;for(var n=0;n3&&void 0!==arguments[3])||arguments[3];return(isNaN(t)||(r?e.startTime:e.endTime)>=t)&&(isNaN(n)||(r?e.endTime:e.startTime)<=n)}function Y(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e.cues)for(var i=e.cues,a=i.length-1,o=a;o>=0;o--)j(i[o],t,n,r)&&(i[o].onexit&&i[o].onexit(),e.removeCue(i[o]))}function q(){var e=document.getElementById("native-cue-style");if(!e){(e=document.createElement("style")).id="native-cue-style",document.head.appendChild(e);var t=e.sheet,r=R.getElement();try{r&&(r.id?t.insertRule("#"+r.id+"::cue {background: transparent}",0):0!==r.classList.length?t.insertRule("."+r.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){n.info(""+e.message)}}}function H(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function V(){if(m)for(;m.firstChild;)m.removeChild(m.firstChild)}return t={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(r=window.VTTCue||window.TextTrackCue,i=[],o=[],s=-1,c=0,g=0,h=0,p=0,m=null,y=null,E=null,_=!1,S=2147483647,T=null,void 0!==document.fullscreenElement?v="fullscreenElement":void 0!==document.webkitIsFullScreen?v="webkitIsFullScreen":document.msFullscreenElement?v="msFullscreenElement":document.mozFullScreen&&(v="mozFullScreen"))},getStreamId:function(){return w.id},addTextTrack:function(e){i.push(e)},addCaptions:L,createTracks:function(){i.sort((function(e,t){return e.index-t.index})),m=R.getTTMLRenderingDiv(),y=R.getVttRenderingDiv();for(var e,t,n,r,u,c,f=-1,g=0;g=0){I.on(d.Z.PLAYBACK_METADATA_LOADED,(function e(){var t=Z(f);t&&"html"===t.renderingType&&D.call(this,t,!0),I.off(d.Z.PLAYBACK_METADATA_LOADED,e,this)}),this);for(var E=0;E0){var n=t[0].manualCueList;n&&n.length>0&&n.forEach((function(t){if(t.startTime<=e&&t.endTime>=e&&!t.isActive)t.isActive=!0,WebVTT.processCues(window,[t],y,t.cueID);else if(t.isActive&&(t.startTime>e||t.endTime0){var t=e[0].manualCueList;t&&t.length>0&&t.forEach((function(e){if(e.isActive&&(e.isActive=!1,y))for(var t=y.childNodes,n=0;n1){var n=e.split(/:/)[1];n&&-1!=n.search(/%/)&&(n=parseInt(n.replace(/%/,""),10)),(e.match(/align/)||e.match(/A/))&&(t.align=n),(e.match(/line/)||e.match(/L/))&&(t.line=n),(e.match(/position/)||e.match(/P/))&&(t.position=n),(e.match(/size/)||e.match(/S/))&&(t.size=n)}})),t}function c(e,t){for(var n,i=t,a="",o="";""!==e[i]&&i1)for(var s=0;s0&&"WEBVTT"!==d&&d.match(r)){var g=u(d),h=g.cuePoints,p=g.styles,m=c(e,f+1),y=s(h[0].replace(i,"")),E=s(h[1].replace(i,""));!isNaN(y)&&!isNaN(E)&&y>=o&&E>y?""!==m?(o=y,l.push({start:y,end:E,data:m,styles:p})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return l}},t=(0,f.Z)(o).getInstance().getLogger(e),n=/(?:\r\n|\r|\n)/gm,r=/-->/,i=/(^[\s]+|[\s]+$)/g,a=/\s\b/g,e}Ra.__dashjs_factory_name="VTTParser";const wa=c.Z.getSingletonFactory(Ra);function Na(){var e,t;return e={parse:function(e){var n=[];return t.oncue=function(e){e.start=e.startTime,e.end=e.endTime,e.data=e.text,e.styles={align:e.align,line:e.line,position:e.position,size:e.size},n.push(e)},t.parse(e),n}},function(){try{window&&window.WebVTT&&window.WebVTT.Parser&&(t=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()))}catch(e){}}(),e}Na.__dashjs_factory_name="VttCustomRenderingParser";const Ca=c.Z.getSingletonFactory(Na);function Da(){var e,t,n=this.context,r=(0,u.Z)(n).getInstance(),i=0;return e={parse:function(e,n,a,o,s){var u,c,f,g="",h=[],p={},m={},y="",E="",v={onOpenTag:function(e,n,i){if(i[" imagetype"]&&!i[" imageType"]&&(r.trigger(d.Z.CONFORMANCE_VIOLATION,{level:qt.LEVELS.ERROR,event:qt.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),i[" imageType"]=i[" imagetype"]),"image"===n&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!i[" imageType"]||"PNG"!==i[" imageType"].value)return void t.warn("smpte-tt imageType != PNG. Discarded");y=i["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){y&&(m[y]=E.trim()),E="",y=""},onText:function(e){y&&(E+=e)}};if(!e)throw g="no ttml data to parse",new Error(g);p.data=e,r.trigger(l.Z.TTML_TO_PARSE,p);var _=(0,Ta.fromXML)(p.data,(function(e){g=e}),v);r.trigger(l.Z.TTML_PARSED,{ttmlString:p.data,ttmlDoc:_});var T,S=_.getMediaTimeEvents();for(f=0;fo?o:S[f+1]+n)&&h.push({start:u,end:c,type:"html",cueID:(void 0,T="cue_TTML_"+i,i++,T),isd:b,images:s,embeddedImages:m})}if(""!==g)throw t.error(g),new Error(g);return h}},t=(0,f.Z)(n).getInstance().getLogger(e),e}Da.__dashjs_factory_name="TTMLParser";const Oa=c.Z.getSingletonFactory(Da);function Ma(e){var t,n,r,i,o,s,c,f,g,h,p,m,y=this.context,E=e.adapter,v=e.errHandler,_=e.manifestModel,T=e.mediaController,S=e.videoModel,b=e.settings;function A(e){var t=e.tracks,r=e.index,i=e.streamId;if(!1===b.get().streaming.text.defaultEnabled&&!w()||m)N(i,-1);else{var o=T.getCurrentTrackFor(a.Z.TEXT,i);if(o){var s={lang:o.lang,role:o.roles[0],index:o.index,codec:o.codec,accessibility:o.accessibility[0]};t.some((function(e,t){if(T.matchSettings(s,e))return N(i,t),r=t,!0}))}g=!1}n[i].lastEnabledIndex=r,f.trigger(d.Z.TEXT_TRACKS_ADDED,{enabled:w(),index:r,tracks:t,streamId:i}),p=!0}function I(e){try{var t=e.streamId;if(!i[t]||isNaN(e.time))return;i[t].manualCueProcessing(e.time)}catch(e){}}function R(e){try{var t=e.streamId;if(!i[t])return;i[t].disableManualTracks()}catch(e){}}function w(){var e=!0;return g&&!h&&(e=!1),e}function N(e,t){(g=-1===t)&&T&&T.saveTextSettingsDisabled();var n=C(e);if(n!==t&&i[e]){i[e].disableManualTracks(),i[e].setModeForTrackIdx(n,a.Z.TEXT_HIDDEN),i[e].setCurrentTrackIdx(t),i[e].setModeForTrackIdx(t,a.Z.TEXT_SHOWING);var o=i[e].getCurrentTrackInfo();o&&o.isFragmented&&!o.isEmbedded?function(e,t,n){if(r[e])for(var o=r[e].getConfig().fragmentedTracks,s=0;s3&&void 0!==arguments[3]?arguments[3]:null,a=e.id;r[a]&&r[a].addMediaInfos(t,n,i)},reset:function(){D(),f.off(l.Z.TEXT_TRACKS_QUEUE_INITIALIZED,A,t),b.get().streaming.text.webvtt.customRenderingEnabled&&(f.off(l.Z.PLAYBACK_TIME_UPDATED,I,t),f.off(l.Z.PLAYBACK_SEEKING,R,t)),Object.keys(r).forEach((function(e){r[e].resetEmbedded(),r[e].reset()}))}},h=!1,p=!1,m=!1,o=wa(y).getInstance(),s=Ca(y).getInstance(),c=Oa(y).getInstance(),f=(0,u.Z)(y).getInstance(),D(),t}Ma.__dashjs_factory_name="TextController";const Pa=c.Z.getClassFactory(Ma);function La(){var e,t,n,r,g,p,m,y,E,v,_,T,b,A,I,R,D,O,M,P,L,x,F,k,Z,U,B,G,j,Y,q,H,V,K,W,J,ee,te,ne="You must first call initialize() and set a source before calling this method",re="You must first call initialize() and set a valid source and view before calling this method",ie="You must first call attachView() to set the video element before calling this method",ae="You must first call attachSource() with a valid source before calling this method",oe="MediaPlayer not initialized!",se=this.context,ue=(0,u.Z)(se).getInstance(),le=(0,N.Z)(se).getInstance(),ce=(0,f.Z)(se).getInstance({settings:le});function fe(){Ie(null),be(null),r=null,b&&(b.reset(),b=null),A&&(A.reset(),A=null),M&&M.reset(),le.reset(),R&&(R.reset(),R=null)}function de(){return!!n&&!!W.getElement()}function ge(){return(0,Ti.e)()}function he(){if(!m)throw re;return B.isPaused()}function pe(){if(!m)throw re;return B.getIsDynamic()}function me(e){var t=k&&k.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,n=q.getCurrentDVRInfo(t);if(!n)return 0;var r=B.getOriginalLiveDelay(),i=n.range.start+e;return i>n.range.end-r&&(i=n.range.end-r),i}function ye(e){if(!m)throw re;var t=Se().currentTime;if(void 0!==e)t=k.getTimeRelativeToStreamId(t,e);else if(B.getIsDynamic()){var n=k&&k.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,r=q.getCurrentDVRInfo(n);t=null===r||0===t?0:Math.max(0,t-r.range.start)}return t}function Ee(){if(!m)throw re;var e=Se().duration;if(B.getIsDynamic()){var t=k&&k.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,n=q.getCurrentDVRInfo(t);e=n?n.range.end-n.range.start:0}return e}function ve(e){(0,z.PS)(e,"boolean"),y=e}function _e(){M.restoreDefaultUTCTimingSources()}function Te(){return q}function Se(){if(!W.getElement())throw ie;return W.getElement()}function be(e){if(!g)throw oe;W.setElement(e),e&&(De(),function(){if(!A){var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(se).create();A=t.createMetricsReporting({debug:ce,eventBus:ue,mediaElement:Se(),adapter:D,dashMetrics:q,mediaPlayerModel:O,events:l.Z,constants:a.Z,metricsConstants:s.Z})}}}(),function(){if(!I){var e=dashjs.MssHandler;"function"==typeof e&&(w.extend(e.errors),I=e(se).create({eventBus:ue,mediaPlayerModel:O,dashMetrics:q,manifestModel:H,playbackController:B,streamController:k,protectionController:b,baseURLController:L,errHandler:P,events:l.Z,constants:a.Z,debug:ce,initSegmentType:C.w.INIT_SEGMENT_TYPE,BASE64:la,ISOBoxer:ca,settings:le}))}}(),k&&k.switchToVideoElement()),m&&we(),Pe()}function Ae(e){if(!p)throw ne;var t=k.getActiveStreamInfo();return t?T.getTracksFor(e,t.id):[]}function Ie(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;if(!g)throw oe;"string"==typeof e&&J.initialize(e),null==t&&(t=NaN),isNaN(t)||(t=Math.max(0,t)),n=e,(p||m)&&we(),de()&&Pe(t)}function Re(){if(!p)throw ne;var e=k.getActiveStreamInfo();return e?k.getStreamById(e.id):null}function we(){m=!1,p=!1,D.reset(),k.reset(),U.reset(),Y.reset(),B.reset(),G.reset(),j.reset(),E.reset(),T.reset(),te.reset(),b&&(le.get().streaming.protection.keepProtectionMediaKeys?b.stop():(b.reset(),b=null,De())),Z.reset(),V.reset(),K.reset()}function Ne(){var e=Ce();k||(k=Kt(se).getInstance()),Z||(Z=Pa(se).create({errHandler:P,manifestModel:H,adapter:D,mediaController:T,videoModel:W,settings:le})),F.setConfig({capabilities:x,customParametersModel:M,adapter:D,settings:le,manifestModel:H,errHandler:P}),k.setConfig({capabilities:x,capabilitiesFilter:F,manifestLoader:e,manifestModel:H,mediaPlayerModel:O,customParametersModel:M,protectionController:b,textController:Z,adapter:D,dashMetrics:q,errHandler:P,timelineConverter:_,videoModel:W,playbackController:B,serviceDescriptionController:G,contentSteeringController:j,abrController:E,mediaController:T,settings:le,baseURLController:L,uriFragmentModel:J,segmentBaseController:te}),U.setConfig({settings:le,playbackController:B,streamController:k,videoModel:W,timelineConverter:_,adapter:D}),B.setConfig({streamController:k,serviceDescriptionController:G,dashMetrics:q,adapter:D,videoModel:W,timelineConverter:_,settings:le}),Y.setConfig({streamController:k,playbackController:B,mediaPlayerModel:O,videoModel:W,settings:le}),E.setConfig({streamController:k,domStorage:ee,mediaPlayerModel:O,customParametersModel:M,cmsdModel:K,dashMetrics:q,adapter:D,videoModel:W,settings:le}),V.setConfig({abrController:E,dashMetrics:q,playbackController:B}),K.setConfig({}),E.initialize(),k.initialize(y,r),Z.initialize(),U.initialize(),Y.initialize(),V.initialize(),K.initialize(),j.initialize(),te.initialize()}function Ce(){return kr(se).create({debug:ce,errHandler:P,dashMetrics:q,mediaPlayerModel:O,requestModifier:(0,X.Z)(se).getInstance(),mssHandler:I,settings:le})}function De(){if(b)return b;var e=dashjs.Protection;if("function"==typeof e){var t=e(se).create();return l.Z.extend(e.events),d.Z.extend(e.events,{publicOnly:!0}),w.extend(e.errors),x||(x=(0,Br.Z)(se).getInstance()),b=t.createProtectionSystem({debug:ce,errHandler:P,videoModel:W,customParametersModel:M,capabilities:x,eventBus:ue,events:l.Z,BASE64:la,constants:a.Z,cmcdModel:V,settings:le})}return null}function Oe(){if(!g)throw oe;if(R)return R;var e=dashjs.OfflineController;if("function"==typeof e){l.Z.extend(e.events),d.Z.extend(e.events,{publicOnly:!0}),w.extend(e.errors);var t=Ce(),n=Ft(se).create();return n.setConfig({manifestModel:H,adapter:D,manifestLoader:t,errHandler:P}),R=e(se).create({debug:ce,manifestUpdater:n,baseURLController:L,manifestLoader:t,manifestModel:H,mediaPlayerModel:O,abrController:E,playbackController:B,adapter:D,errHandler:P,dashMetrics:q,timelineConverter:_,segmentBaseController:te,schemeLoaderFactory:v,eventBus:ue,events:l.Z,errors:w,constants:a.Z,settings:le,dashConstants:o.Z,urlUtils:(0,Q.Z)(se).getInstance()})}return null}function Me(e){var t=k&&k.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,n=q.getCurrentDVRInfo(t);return n?e+(n.manifestInfo.availableFrom.getTime()/1e3+n.range.start):0}function Pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN;R&&R.resetRecords(),!p&&n&&(p=!0,t.info("Streaming Initialized"),Ne(),"string"==typeof n?k.load(n,e):k.loadWithManifest(n,e)),!m&&de()&&(m=!0,t.info("Playback Initialized"))}return e={initialize:function(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:NaN;x||(x=(0,Br.Z)(se).getInstance()).setConfig({settings:le}),P||(P=Ur(se).getInstance()),x.supportsMediaSource()?(g||(g=!0,_=ua(se).getInstance(),E||(E=li(se).getInstance()).setConfig({settings:le}),v||(v=dt(se).getInstance()),B||(B=h(se).getInstance()),T||(T=gn(se).getInstance()),k||(k=Kt(se).getInstance()),U||(U=Wt(se).getInstance()),Y||(Y=Qt(se).getInstance()),G||(G=nn(se).getInstance()),j||(j=sn(se).getInstance()),F||(F=jr(se).getInstance()),D=ji(se).getInstance(),H=Kr(se).getInstance(),V=Ue(se).getInstance(),K=it(se).getInstance(),q=oa(se).getInstance({settings:le}),ee=_i(se).getInstance({settings:le}),D.setConfig({constants:a.Z,cea608parser:i(),errHandler:P,BASE64:la}),L||(L=wn(se).create()),L.setConfig({adapter:D}),G.setConfig({adapter:D}),te||(te=Di(se).getInstance({dashMetrics:q,mediaPlayerModel:O,errHandler:P,baseURLController:L,events:l.Z,eventBus:ue,debug:ce,boxParser:(0,$.Z)(se).getInstance(),requestModifier:(0,X.Z)(se).getInstance(),errors:w})),T.setConfig({domStorage:ee,settings:le,customParametersModel:M}),O.setConfig({playbackController:B,serviceDescriptionController:G}),j.setConfig({adapter:D,errHandler:P,dashMetrics:q,mediaPlayerModel:O,manifestModel:H,abrController:E,eventBus:ue,requestModifier:(0,X.Z)(se).getInstance()}),_e(),ve(void 0===r||r),Oe()),e&&be(e),n&&Ie(n,o),t.info("[dash.js "+ge()+"] MediaPlayer has been initialized")):P.error(new S.Z(w.CAPABILITY_MEDIASOURCE_ERROR_CODE,w.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(x=e.capabilities),e.capabilitiesFilter&&(F=e.capabilitiesFilter),e.streamController&&(k=e.streamController),e.textController&&(Z=e.textController),e.gapController&&(U=e.gapController),e.playbackController&&(B=e.playbackController),e.serviceDescriptionController&&(G=e.serviceDescriptionController),e.contentSteeringController&&(j=e.contentSteeringController),e.catchupController&&(Y=e.catchupController),e.mediaPlayerModel&&(O=e.mediaPlayerModel),e.customParametersModel&&(M=e.customParametersModel),e.abrController&&(E=e.abrController),e.schemeLoaderFactory&&(v=e.schemeLoaderFactory),e.mediaController&&(T=e.mediaController),e.settings&&(le=e.settings))},on:function(e,t,n,r){ue.on(e,t,n,r)},off:function(e,t,n){ue.off(e,t,n)},extend:function(e,t,n){c.Z.extend(e,t,n,se)},attachView:be,attachSource:Ie,isReady:de,preload:function(){if(W.getElement()||p)return!1;if(!n)throw ae;Pe()},play:function(){if(!m)throw re;(!y||he()&&m)&&B.play(!0)},isPaused:he,pause:function(){if(!m)throw re;B.pause()},isSeeking:function(){if(!m)throw re;return B.isSeeking()},isDynamic:pe,getLowLatencyModeEnabled:function(){if(!m)throw re;return B.getLowLatencyModeEnabled()},seek:function(e){if(!m)throw re;if((0,z.PS)(e,"number"),isNaN(e))throw a.Z.BAD_ARGUMENT_ERROR;e<0&&(e=0);var t=B.getIsDynamic()?me(e):e,n=Se();!B.getIsDynamic()&&n.duration&&(t=Math.min(n.duration,t)),B.seek(t,!1,!1,!0)},seekToOriginalLive:function(){m&&pe()&&B.seekToOriginalLive()},setPlaybackRate:function(e){Se().playbackRate=e},getPlaybackRate:function(){return Se().playbackRate},setMute:function(e){(0,z.PS)(e,"boolean"),Se().muted=e},isMuted:function(){return Se().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw a.Z.BAD_ARGUMENT_ERROR;Se().volume=e},getVolume:function(){return Se().volume},time:ye,duration:Ee,timeAsUTC:function(){if(!m)throw re;return ye()<0?NaN:Me(ye())},durationAsUTC:function(){if(!m)throw re;return Me(Ee())},getActiveStream:Re,getDVRWindowSize:function(){var e=k&&k.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,t=q.getCurrentDVRInfo(e);return t?t.manifestInfo.dvrWindowSize:0},getDVRSeekOffset:me,getTargetLiveDelay:function(){if(!m)throw re;return B.getOriginalLiveDelay()},convertToTimeCode:function(e){e=Math.max(e,0);var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(r<10?"0"+r.toString():r.toString())},formatUTC:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=new Date(1e3*e),a=i.toLocaleDateString(t),o=i.toLocaleTimeString(t,{hour12:n});return r?o+" "+a:o},getVersion:ge,getDebug:function(){return ce},getBufferLength:function(e){var n=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT];if(e)return-1!==n.indexOf(e)?Te().getCurrentBufferLevel(e)||NaN:(t.warn("getBufferLength requested for invalid type"),NaN);var r=n.map((function(e){return Ae(e).length>0?Te().getCurrentBufferLevel(e):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)}));return r===Number.MAX_VALUE?NaN:r},getTTMLRenderingDiv:function(){return W?W.getTTMLRenderingDiv():null},getVideoElement:Se,getSource:function(){if(!n)throw ae;return n},updateSource:function(e){n=e,k.load(n)},getCurrentLiveLatency:function(){if(!g)throw oe;return m?B.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(e){if(!p)throw ne;return E.getTopBitrateInfoFor(e)},setAutoPlay:ve,getAutoPlay:function(){return y},getDashMetrics:Te,getQualityFor:function(e){if(!p)throw ne;if(e===a.Z.IMAGE){var t=Re();if(!t)return-1;var n=t.getThumbnailController();return n?n.getCurrentTrackIndex():-1}return E.getQualityFor(e)},setQualityFor:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!p)throw ne;if(e===a.Z.IMAGE){var r=Re();if(!r)return;var i=r.getThumbnailController();i&&i.setTrackByIndex(t)}E.setPlaybackQuality(e,k.getActiveStreamInfo(),t,{forceReplace:n})},updatePortalSize:function(){E.setElementSize(),E.setWindowResizeEventCalled(!0)},enableText:function(e){var t=k.getActiveStreamInfo();return!(!t||!Z)&&Z.enableText(t.id,e)},enableForcedTextStreaming:function(e){return!(!k.getActiveStreamInfo()||!Z)&&Z.enableForcedTextStreaming(e)},isTextEnabled:function(){var e=k.getActiveStreamInfo();return!(!e||!Z)&&Z.isTextEnabled(e)},setTextTrack:function(e){if(!m)throw re;var t=k.getActiveStreamInfo();t&&Z&&Z.setTextTrack(t.id,e)},getBitrateInfoListFor:function(e){if(!p)throw ne;var t=Re();return t?t.getBitrateListFor(e):[]},getStreamsFromManifest:function(e){if(!p)throw ne;return D.getStreamsInfo(e)},getTracksFor:Ae,getTracksForTypeFromManifest:function(e,t,n){if(!p)throw ne;return(n=n||D.getStreamsInfo(t,1)[0])?D.getAllMediaInfoForType(n,e,t):[]},getCurrentTrackFor:function(e){if(!p)throw ne;var t=k.getActiveStreamInfo();return T.getCurrentTrackFor(e,t.id)},setInitialMediaSettingsFor:function(e,t){if(!g)throw oe;T.setInitialSettings(e,t)},getInitialMediaSettingsFor:function(e){if(!g)throw oe;return T.getInitialSettings(e)},setCurrentTrack:function(e){if(!p)throw ne;T.setTrack(e)},addABRCustomRule:function(e,t,n){M.addAbrCustomRule(e,t,n)},removeABRCustomRule:function(e){M.removeAbrCustomRule(e)},removeAllABRCustomRule:function(){M.removeAllAbrCustomRule()},getABRCustomRules:function(){return M.getAbrCustomRules()},getAverageThroughput:function(e){var t=E.getThroughputHistory(),n=B.getIsDynamic();return t?t.getAverageThroughput(e,n):0},retrieveManifest:function(e,t){var n=Ce(),r=this;ue.on(l.Z.INTERNAL_MANIFEST_LOADED,(function e(i){i.error?t(null,i.error):t(i.manifest),ue.off(l.Z.INTERNAL_MANIFEST_LOADED,e,r),n.reset()}),r),J.initialize(e),n.load(e)},addUTCTimingSource:function(e,t){M.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){M.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){M.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:_e,setXHRWithCredentialsForType:function(e,t){M.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return M.getXHRWithCredentialsForType(e)},getProtectionController:function(){return De()},attachProtectionController:function(e){b=e},setProtectionData:function(e){r=e,k&&k.setProtectionData(r)},registerLicenseRequestFilter:function(e){M.registerLicenseRequestFilter(e)},registerLicenseResponseFilter:function(e){M.registerLicenseResponseFilter(e)},unregisterLicenseRequestFilter:function(e){M.unregisterLicenseRequestFilter(e)},unregisterLicenseResponseFilter:function(e){M.unregisterLicenseResponseFilter(e)},registerCustomCapabilitiesFilter:function(e){M.registerCustomCapabilitiesFilter(e)},unregisterCustomCapabilitiesFilter:function(e){M.unregisterCustomCapabilitiesFilter(e)},setCustomInitialTrackSelectionFunction:function(e){M.setCustomInitialTrackSelectionFunction(e)},resetCustomInitialTrackSelectionFunction:function(){M.resetCustomInitialTrackSelectionFunction(null)},attachTTMLRenderingDiv:function(e){if(!W.getElement())throw ie;W.setTTMLRenderingDiv(e)},attachVttRenderingDiv:function(e){if(!W.getElement())throw ie;W.setVttRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=k.getActiveStreamInfo();if(e&&Z)return Z.getCurrentTrackIdx(e.id)},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var n=B.getIsDynamic()?me(e):e,r=k.getStreamForTime(n);if(null!==r){var i=r.getThumbnailController();if(i)return i.provide(n,t);t(null)}else t(null)}},getDashAdapter:function(){return D},getOfflineController:function(){return Oe()},triggerSteeringRequest:function(){if(j)return j.loadSteeringData()},getCurrentSteeringResponseData:function(){if(j)return j.getCurrentSteeringResponseData()},getSettings:function(){return le.get()},updateSettings:function(e){le.update(e)},resetSettings:function(){le.reset()},reset:fe,destroy:function(){fe(),c.Z.deleteSingletonInstances(se)}},t=ce.getLogger(e),g=!1,m=!1,p=!1,y=!0,b=null,R=null,r=null,D=null,te=null,l.Z.extend(d.Z),O=Xr(se).getInstance(),M=(0,st.Z)(se).getInstance(),W=di(se).getInstance(),J=Hr(se).getInstance(),e}La.__dashjs_factory_name="MediaPlayer";var xa=c.Z.getClassFactory(La);xa.events=d.Z,xa.errors=w,c.Z.updateClassFactory(La.__dashjs_factory_name,xa);const Fa=xa},8825:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}n.d(t,{Z:()=>s});const s=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var i=o(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return a(this,e)});function s(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(e=r.call(this)).AST_IN_FUTURE="astInFuture",e.BUFFER_EMPTY="bufferStalled",e.BUFFER_LOADED="bufferLoaded",e.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",e.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",e.DYNAMIC_TO_STATIC="dynamicToStatic",e.ERROR="error",e.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",e.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",e.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",e.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",e.LOG="log",e.MANIFEST_LOADED="manifestLoaded",e.METRICS_CHANGED="metricsChanged",e.METRIC_CHANGED="metricChanged",e.METRIC_ADDED="metricAdded",e.METRIC_UPDATED="metricUpdated",e.PERIOD_SWITCH_STARTED="periodSwitchStarted",e.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",e.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",e.QUALITY_CHANGE_RENDERED="qualityChangeRendered",e.TRACK_CHANGE_RENDERED="trackChangeRendered",e.STREAM_INITIALIZING="streamInitializing",e.STREAM_UPDATED="streamUpdated",e.STREAM_ACTIVATED="streamActivated",e.STREAM_DEACTIVATED="streamDeactivated",e.STREAM_INITIALIZED="streamInitialized",e.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",e.TEXT_TRACKS_ADDED="allTextTracksAdded",e.TEXT_TRACK_ADDED="textTrackAdded",e.TTML_PARSED="ttmlParsed",e.TTML_TO_PARSE="ttmlToParse",e.CAPTION_RENDERED="captionRendered",e.CAPTION_CONTAINER_RESIZE="captionContainerResize",e.CAN_PLAY="canPlay",e.CAN_PLAY_THROUGH="canPlayThrough",e.PLAYBACK_ENDED="playbackEnded",e.PLAYBACK_ERROR="playbackError",e.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",e.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",e.PLAYBACK_LOADED_DATA="playbackLoadedData",e.PLAYBACK_PAUSED="playbackPaused",e.PLAYBACK_PLAYING="playbackPlaying",e.PLAYBACK_PROGRESS="playbackProgress",e.PLAYBACK_RATE_CHANGED="playbackRateChanged",e.PLAYBACK_SEEKED="playbackSeeked",e.PLAYBACK_SEEKING="playbackSeeking",e.PLAYBACK_STALLED="playbackStalled",e.PLAYBACK_STARTED="playbackStarted",e.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",e.PLAYBACK_VOLUME_CHANGED="playbackVolumeChanged",e.PLAYBACK_WAITING="playbackWaiting",e.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",e.EVENT_MODE_ON_START="eventModeOnStart",e.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",e.CONFORMANCE_VIOLATION="conformanceViolation",e.REPRESENTATION_SWITCH="representationSwitch",e.ADAPTATION_SET_REMOVED_NO_CAPABILITIES="adaptationSetRemovedNoCapabilities",e.CONTENT_STEERING_REQUEST_COMPLETED="contentSteeringRequestCompleted",e}return s}(n(8342).Z))},3393:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ni});const i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n;return t=e,(n=[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.CONTENT_STEERING="contentSteering",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.ABR_FETCH_THROUGHPUT_CALCULATION_AAST="abrFetchThroughputCalculationAAST",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY="highestSelectionPriority",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.LOCATION="Location",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_DVB_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability",this.VIDEO_ELEMENT_READY_STATES={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},this.FILE_LOADER_TYPES={FETCH:"fetch_loader",XHR:"xhr_loader"}}}])&&r(t.prototype,n),e}())},3860:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ni});const i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n;return t=e,(n=[{key:"init",value:function(){this.TCP_CONNECTION="TcpList",this.HTTP_REQUEST="HttpList",this.TRACK_SWITCH="RepSwitchList",this.BUFFER_LEVEL="BufferLevel",this.BUFFER_LOADED="bufferLoaded",this.ABANDON_LOAD="abandonload",this.ALLOW_LOAD="allowload",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_STATE="BufferState",this.DVR_INFO="DVRInfo",this.DROPPED_FRAMES="DroppedFrames",this.SCHEDULING_INFO="SchedulingInfo",this.REQUESTS_QUEUE="RequestsQueue",this.MANIFEST_UPDATE="ManifestUpdate",this.MANIFEST_UPDATE_STREAM_INFO="ManifestUpdatePeriodInfo",this.MANIFEST_UPDATE_TRACK_INFO="ManifestUpdateRepresentationInfo",this.PLAY_LIST="PlayList",this.DVB_ERRORS="DVBErrors",this.HTTP_REQUEST_DVB_REPORTING_TYPE="DVBReporting"}}])&&r(t.prototype,n),e}())},8080:(e,t,n)=>{"use strict";n.d(t,{default:()=>V});var r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null};r.SSL_CONNECTION_FAILED_PREFIX="SSL",r.DNS_RESOLUTION_FAILED="C00",r.HOST_UNREACHABLE="C01",r.CONNECTION_REFUSED="C02",r.CONNECTION_ERROR="C03",r.CORRUPT_MEDIA_ISOBMFF="M00",r.CORRUPT_MEDIA_OTHER="M01",r.BASE_URL_CHANGED="F00",r.BECAME_REPORTER="S00";const i=r;var a=n(1180);function o(e){var t,n,r=(e=e||{}).eventBus,o=e.dashMetrics,s=e.metricsConstants,u=e.events;function l(e){var t=new i;if(n){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.mpdurl||(t.mpdurl=n.originalUrl||n.url),t.terror||(t.terror=new Date),o.addDVBErrors(t)}}function c(e){e.error||(n=e.manifest)}function f(e){l({errorcode:i.BASE_URL_CHANGED,servicelocation:e.entry})}function d(){l({errorcode:i.BECAME_REPORTER})}function g(e){var t;e.metric===s.HTTP_REQUEST&&(0===(t=e.value).responsecode||null==t.responsecode||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&l({errorcode:t.responsecode||i.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}function h(e){var t;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=i.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=i.CORRUPT_MEDIA_OTHER;break;default:return}l({errorcode:t})}return t={initialise:function(){r.on(u.MANIFEST_UPDATED,c,t),r.on(u.SERVICE_LOCATION_BLACKLIST_CHANGED,f,t),r.on(u.METRIC_ADDED,g,t),r.on(u.METRIC_UPDATED,g,t),r.on(u.PLAYBACK_ERROR,h,t),r.on(a.Z.BECAME_REPORTING_PLAYER,d,t)},reset:function(){r.off(u.MANIFEST_UPDATED,c,t),r.off(u.SERVICE_LOCATION_BLACKLIST_CHANGED,f,t),r.off(u.METRIC_ADDED,g,t),r.off(u.METRIC_UPDATED,g,t),r.off(u.PLAYBACK_ERROR,h,t),r.off(a.Z.BECAME_REPORTING_PLAYER,d,t)}}}o.__dashjs_factory_name="DVBErrorsTranslator";const s=dashjs.FactoryMaker.getSingletonFactory(o);var u=n(2295);function l(e){e=e||{};var t,n,r=!1,i=this.context,a=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((function(e){var t=e.starttime,r=t+e.duration;n.add(t,r)})),r=!!e[0]._useWallClockTime)},reset:function(){n.clear()},isEnabled:function(){var e,t=n.length;if(!t)return!0;e=r?(new Date).getTime()/1e3:a.currentTime;for(var i=0;i=200&&i.status<300)&&(n&&n()))};c.push(i);try{i.open("GET",e),i.onloadend=a,i.onerror=a,i.send()}catch(e){i.onerror()}}(i="".concat(s,"?").concat(i),0,(function(){o=!1}))}))},initialize:function(e,t){var n;if(u=t,!(s=e.dvb_reportingUrl))throw new Error("required parameter missing (dvb:reportingUrl)");a||((n=e.dvb_probability)&&(1e3===n||n/1e3>=i.random())&&(o=!0),a=!0)},reset:function(){g()}},n=d(l).getInstance(),i=h(l).getInstance(),r=(0,p.Z)(l).getInstance(),g(),t}m.__dashjs_factory_name="DVBReporting";const y=dashjs.FactoryMaker.getClassFactory(m);function E(e){e=e||{};var t,n={"urn:dvb:dash:reporting:2014":y},r=this.context,i=e.debug?e.debug.getLogger(t):{},a=e.metricsConstants,o=e.mediaPlayerModel||{};return{create:function(e,t){var s;try{(s=n[e.schemeIdUri](r).create({metricsConstants:a,mediaPlayerModel:o})).initialize(e,t)}catch(t){s=null,i.error("ReportingFactory: could not create Reporting with schemeIdUri ".concat(e.schemeIdUri," (").concat(t.message,")"))}return s},register:function(e,t){n[e]=t},unregister:function(e){delete n[e]}}}E.__dashjs_factory_name="ReportingFactory";const v=dashjs.FactoryMaker.getSingletonFactory(E);function _(e){var t=[],n=v(this.context).getInstance(e);return{initialize:function(e,r){e.some((function(e){var i=n.create(e,r);if(i)return t.push(i),!0}))},reset:function(){t.forEach((function(e){return e.reset()})),t=[]},report:function(e,n){t.forEach((function(t){return t.report(e,n)}))}}}_.__dashjs_factory_name="ReportingController";const T=dashjs.FactoryMaker.getClassFactory(_);function S(){return{reconstructFullMetricName:function(e,t,n){var r=e;return t&&(r+="("+t,n&&n.length&&(r+=","+n),r+=")"),r},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}S.__dashjs_factory_name="HandlerHelpers";const b=dashjs.FactoryMaker.getSingletonFactory(S);function A(e){var t,n,r,i,a;e=e||{};var o=this.context,s=b(o).getInstance(),u=[],l=e.metricsConstants;function c(){var e=function(){try{return Object.keys(u).map((function(e){return u[e]})).reduce((function(e,t){return e.level{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}n.d(t,{Z:()=>s});const s=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var i=o(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return a(this,e)});function s(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(e=r.call(this)).METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",e.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",e.CMCD_DATA_GENERATED="cmcdDataGenerated",e}return s}(n(8342).Z))},5717:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(2610),i=n(5448),a=n(1264),o=n(3106),s=n(1767),u=n(3393);function l(){var e,t,n,i,l,c,f,d,g=this.context,h=(0,a.Z)(g).getInstance();function p(){i=[],l=[],c=[],d=[],f=null,t=[]}function m(e,t){var n=-1;e.some((function(e,r){if(e===t)return n=r,!0})),n<0||e.splice(n,1)}function y(e){var t;for(t=0;t{"use strict";n.d(t,{Z:()=>o});var r=n(5448),i=n(7473);function a(e){var t=(e=e||{}).requestModifier;function n(e){var n=new Date,r=e.request,i=new XMLHttpRequest;if(i.open(e.method,e.url,!0),r.responseType&&(i.responseType=r.responseType),r.range&&i.setRequestHeader("Range","bytes="+r.range),r.requestStartDate||(r.requestStartDate=n),t&&t.modifyRequestHeader&&(i=t.modifyRequestHeader(i,{url:e.url})),e.headers)for(var a in e.headers){var o=e.headers[a];o&&i.setRequestHeader(a,o)}i.withCredentials=e.withCredentials,i.onload=e.onload,i.onloadend=e.onend,i.onerror=e.onerror,i.onprogress=e.progress,i.onabort=e.onabort,i.ontimeout=e.ontimeout,i.timeout=e.timeout,i.send(),e.response=i}return{load:function(e){t&&t.modifyRequest?(0,i.k)(e,t).then((function(){return n(e)})):n(e)},abort:function(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}}}a.__dashjs_factory_name="XHRLoader";const o=r.Z.getClassFactory(a)},1737:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;nbe});var i={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]};const a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,n=[{key:"findCencContentProtection",value:function(e){for(var t=null,n=0;n0&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(t,n){var r=e.parsePSSHList(n);return t&&r.hasOwnProperty(t.uuid.toLowerCase())?r[t.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),n={},r=0;;){var i,a,o=void 0,s=r;if(r>=t.buffer.byteLength)break;if(i=r+t.getUint32(r),r+=4,1886614376===t.getUint32(r))if(r+=4,0===(a=t.getUint8(r))||1===a){r++,r+=3,o="";var u=void 0,l=void 0;for(u=0;u<4;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=4,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<6;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;r+=6,r+=4,n[o=o.toLowerCase()]=t.buffer.slice(s,i),r=i}else r=i;else r=i}return n}},{key:"getLicenseServerUrlFromMediaInfo",value:function(e,t){try{if(!e||0===e.length)return null;for(var n=0,r=null;n0){var o=a.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===t}));if(o&&o.length>0)for(var s=0;s=0?u[t.ks.systemString].priority:e.length)-(u&&u[n.ks.systemString]&&u[n.ks.systemString].priority>=0?u[n.ks.systemString].priority:e.length)}));for(var a=0;a0&&A.setServerCertificate(N.decodeArray(t.serverCertificate).buffer),F()}})).catch((function(e){f=null,v=!1,t||I.trigger(R.KEY_SYSTEM_SELECTED,{data:null,error:new g.Z(d.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,d.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+e.error)})}))}}(e,t)}function F(){for(var e,t=0;t0?t.audioRobustness:c,u=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:c,l=e.sessionType,f=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",d=t&&t.persistentState?t.persistentState:"temporary"===l?"optional":"required";return i.forEach((function(e){e.type===C.AUDIO?n.push(new o(e.codec,a)):e.type===C.VIDEO&&r.push(new o(e.codec,u))})),new s(n,r,f,d,[l])}function q(e){e.error?I.trigger(R.KEY_STATUSES_CHANGED,{data:null,error:e.error}):n.debug("DRM: key status = "+e.status)}function H(e){n.debug("DRM: onKeyMessage");var t=e.data;I.trigger(R.KEY_MESSAGE,{data:t});var r=t.messageType?t.messageType:"license-request",o=t.message,s=t.sessionToken,u=B(f),l=b.getLicenseServerModelInstance(f,u,r),c={sessionToken:s,messageType:r};if(o&&0!==o.byteLength){if(!l)return n.debug("DRM: License server request not required for this message (type = "+e.data.messageType+"). Session ID = "+s.getSessionId()),void V(c);if(b.isClearKey(f)){var E=b.processClearKeyLicenseRequest(f,u,o);if(E&&E.keyPairs&&E.keyPairs.length>0)return n.debug("DRM: ClearKey license request handled by application!"),V(c),void A.updateKeySession(s,E)}!function(e,t,n){var r=e.sessionToken,o=e.messageType?e.messageType:"license-request",s={sessionToken:r,messageType:o},u=f?f.systemString:null,l=function(e,t,n,r,o){var s=null,u=r.message;if(e&&e.serverURL){var l=e.serverURL;"string"==typeof l&&""!==l?s=l:"object"===_(l)&&l.hasOwnProperty(t)&&(s=l[t])}else if(e&&e.laURL&&""!==e.laURL)s=e.laURL;else if(!(s=a.getLicenseServerUrlFromMediaInfo(i,f.schemeIdURI))&&!b.isClearKey(f)){var c=a.getPSSHData(n.initData);(s=f.getLicenseServerURLFromInitData(c))||(s=r.laURL)}return s=o.getServerURLFromMessage(s,u,t)}(n,o,r,e,t);if(l){var c={},E=!1;n&&W(c,n.httpRequestHeaders);var v=e.message;W(c,f.getRequestHeadersFromMessage(v)),Object.keys(c).forEach((function(e){"authorization"===e.toLowerCase()&&(E=!0)})),n&&"boolean"==typeof n.withCredentials&&(E=n.withCredentials);var T=function(e){if(A)if(e.status>=200&&e.status<=299){var n=y.Z.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),i=new p(e.responseURL,n,e.response);Q(P.getLicenseResponseFilters(),i).then((function(){var n=t.getLicenseMessage(i.data,u,o);null!==n?(V(s),A.updateKeySession(r,n)):X(e,s,u,o,t)}))}else X(e,s,u,o,t)},S=function(e){V(s,new g.Z(d.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,d.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+u+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},I=function(e){V(s,new g.Z(d.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,d.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+u+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},R=f.getLicenseRequestFromMessage(v),w=t.getHTTPMethod(o),N=t.getResponseType(u,o),C=n&&!isNaN(n.httpTimeout)?n.httpTimeout:8e3,D=r.getSessionId()||null,O=new h(l,w,N,c,E,o,D,R),L=isNaN(M.get().streaming.retryAttempts[m.w.LICENSE])?3:M.get().streaming.retryAttempts[m.w.LICENSE];Q(P.getLicenseRequestFilters(),O).then((function(){K(O,L,C,T,S,I)}))}else V(s,new g.Z(d.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,d.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}(t,l,u)}else V(c,new g.Z(d.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,d.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function V(e,t){I.trigger(R.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function K(e,t,r,i,a,o){var s=new XMLHttpRequest;if(M.get().streaming.cmcd&&M.get().streaming.cmcd.enabled&&M.get().streaming.cmcd.mode===E.Z.CMCD_MODE_QUERY){var u=O.getQueryParameter({url:e.url,type:m.w.LICENSE});u&&(e.url=y.Z.addAditionalQueryParameterToUrl(e.url,[u]))}for(var l in s.open(e.method,e.url,!0),s.responseType=e.responseType,s.withCredentials=e.withCredentials,r>0&&(s.timeout=r),e.headers)s.setRequestHeader(l,e.headers[l]);if(M.get().streaming.cmcd&&M.get().streaming.cmcd.enabled&&M.get().streaming.cmcd.mode===E.Z.CMCD_MODE_HEADER){var c=O.getHeaderParameters({url:e.url,type:m.w.LICENSE});if(c)for(var f in c){var d=c[f];d&&s.setRequestHeader(f,d)}}var g=function(){t--;var n=isNaN(M.get().streaming.retryIntervals[m.w.LICENSE])?1e3:M.get().streaming.retryIntervals[m.w.LICENSE];S=setTimeout((function(){K(e,t,r,i,a,o)}),n)};s.onload=function(){T=null,this.status>=200&&this.status<=299||t<=0?i(this):(n.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+t),g())},s.ontimeout=s.onerror=function(){T=null,t<=0?o(this):(n.warn("License request network request failed . Retrying it... Pending retries: "+t),g())},s.onabort=function(){a(this)},I.trigger(R.LICENSE_REQUEST_SENDING,{url:e.url,headers:e.headers,payload:e.data,sessionId:e.sessionId}),T=s,s.send(e.data)}function z(){T&&(T.onloadend=T.onerror=T.onprogress=void 0,T.abort(),T=null),S&&(clearTimeout(S),S=null)}function W(e,t){if(t)for(var n in t)e[n]=t[n]}function X(e,t,n,r,i){var a="NONE",o=null;e.response&&(a=i.getErrorResponse(e.response,n,r),o={serverResponse:e.response||null,responseCode:e.status||null,responseText:e.statusText||null}),V(t,new g.Z(d.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,d.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+". Response is "+a,o))}function Q(e,t){return e?e.reduce((function(e,n){return e.then((function(){return n(t)}))}),Promise.resolve()):Promise.resolve()}function $(e,t){if(!M.get().streaming.protection.ignoreEmeEncryptedEvent){if(n.debug("DRM: onNeedKey"),"cenc"!==e.key.initDataType)return void n.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+e.key.initDataType);if(0===i.length&&(n.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(t=void 0===t?1:t+1)<5))return void D.push(setTimeout((function(){$(e,t)}),500));var o=e.key.initData;if(ArrayBuffer.isView(o)&&(o=o.buffer),f){var s=a.getPSSHForKeySystem(f,o);if(s&&G(s))return}n.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(o)));var c=b.getSupportedKeySystemsFromSegmentPssh(o,u,l);if(0===c.length)return void n.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!");!function(e){r.push(e),x(e,!1)}(c)}}return t={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");L(),i.push(e)},clearMediaInfoArray:function(){i=[]},handleKeySystemFromManifest:function(){if(i&&0!==i.length){var e=[];i.forEach((function(t){var n=b.getSupportedKeySystemsFromContentProtection(t.contentProtection,u,l);n.length>0&&(0===e.length&&(e=n),r.push(n))})),e&&e.length>0&&x(e,!0)}},createKeySession:U,loadKeySession:Z,removeKeySession:function(e){L(),A.removeKeySession(e)},closeKeySession:function(e){L(),A.closeKeySession(e)},setServerCertificate:function(e){L(),A.setServerCertificate(e)},setMediaElement:j,setSessionType:function(e){l=e},setRobustnessLevel:function(e){c=e},setProtectionData:function(e){u=e,b.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return L(),b.getSupportedKeySystemsFromContentProtection(e,u,l)},getKeySystems:function(){return b?b.getKeySystems():[]},setKeySystems:function(e){b&&b.setKeySystems(e)},stop:function(){z(),A&&A.stop()},reset:function(){I.off(R.INTERNAL_KEY_MESSAGE,H,t),I.off(R.INTERNAL_KEY_STATUS_CHANGED,q,t),L(),z(),j(null),f=null,v=!1,A&&(A.reset(),A=null),D.forEach((function(e){return clearTimeout(e)})),D=[],i=[],r=[]}},n=w.getLogger(t),r=[],i=[],l="temporary",c="",T=null,S=null,I.on(R.INTERNAL_KEY_MESSAGE,H,t),I.on(R.INTERNAL_KEY_STATUS_CHANGED,q,t),t}T.__dashjs_factory_name="ProtectionController";const S=v.Z.getClassFactory(T),b=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=n};function A(e,t){for(var n=0;n%CUSTOMDATA%'.replace("%CUSTOMDATA%",t),a=[],o=0;o0&&(e[0]&&("string"==typeof e[0]?t=e[0]:n=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:n=e[1])),{status:t,keyId:n}}function _(e,t){var r={session:e,keyId:t.keyId,initData:t.initData,sessionId:t.sessionId,sessionType:t.sessionType,handleEvent:function(e){switch(e.type){case"keystatuseschange":c.trigger(f.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=v(arguments);"expired"===e.status?c.trigger(f.INTERNAL_KEY_STATUS_CHANGED,{error:new g.Z(d.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,d.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)}):c.trigger(f.INTERNAL_KEY_STATUS_CHANGED,e)}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;c.trigger(f.INTERNAL_KEY_MESSAGE,{data:new ce(this,t,void 0,e.messageType)})}},getKeyId:function(){return this.keyId},getSessionId:function(){return e.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){var e=v(arguments);"usable"===e.status&&(t=!0)})),t}};return e.addEventListener("keystatuseschange",r),e.addEventListener("message",r),e.closed.then((function(){E(r),n.debug("DRM: Session closed. SessionID = "+r.getSessionId()),c.trigger(f.KEY_SESSION_CLOSED,{data:r.getSessionId()})})),o.push(r),r}return t={getAllInitData:function(){for(var e=[],t=0;t=1?t():(e=t.bind(this),r.addEventListener("loadedmetadata",e))}return t={getAllInitData:function(){for(var e=[],t=0;t0&&(t=o.ksConfiguration.videoCapabilities[0]),null===t&&o.ksConfiguration.audioCapabilities&&o.ksConfiguration.audioCapabilities.length>0&&(t=o.ksConfiguration.audioCapabilities[0]),null===t)throw new Error("Can not create sessions for unknown content types.");var r=t.contentType,s=a.createSession(r,new Uint8Array(e.initData),e.cdmData?new Uint8Array(e.cdmData):null),l=function(e,t){return{session:e,keyId:t.keyId,initData:t.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case y.error:h.trigger(p.KEY_ERROR,{error:new g.Z(d.MEDIA_KEYERR_CODE,"KeyError",this)});break;case y.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;h.trigger(p.INTERNAL_KEY_MESSAGE,{data:new ce(this,t,e.destinationURL)});break;case y.ready:n.debug("DRM: Key added."),h.trigger(p.KEY_ADDED);break;case y.close:n.debug("DRM: Session closed. SessionID = "+this.getSessionId()),h.trigger(p.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(s,e);s.addEventListener(y.error,l),s.addEventListener(y.message,l),s.addEventListener(y.ready,l),s.addEventListener(y.close,l),u.push(l),n.debug("DRM: Session created. SessionID = "+l.getSessionId()),h.trigger(p.KEY_SESSION_CREATED,{data:l})},updateKeySession:function(e,t){var n=e.session;c.isClearKey(i)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t)),h.trigger(p.KEY_SESSION_UPDATED)},closeKeySession:v,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:E,reset:E},n=m.getLogger(t),r=null,i=null,a=null,o=null,u=[],c=re(f).getInstance(),l={handleEvent:function(e){if(e.type===y.needkey&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;h.trigger(p.NEED_KEY,{key:new le(t,"cenc")})}}},t}pe.__dashjs_factory_name="ProtectionModel_3Feb2014";const me=dashjs.FactoryMaker.getClassFactory(pe);function ye(e){e=e||{};var t,n,r,i,a,o,u,l,c,f=this.context,h=e.eventBus,p=e.events,m=e.debug,y=e.api,E=e.errHandler;function v(){r&&S();for(var e=0;e0&&(t=o.shift(),u.push(t),t.sessionId=e.sessionId,h.trigger(p.KEY_SESSION_CREATED,{data:t})):o.length>0&&(t=o.shift(),u.push(t),0!==o.length&&E.error(new g.Z(d.MEDIA_KEY_MESSAGE_ERROR_CODE,d.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var s=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=s,h.trigger(p.INTERNAL_KEY_MESSAGE,{data:new ce(t,s,e.defaultURL)})}else n.warn("No session token found for key message")}}},t}ye.__dashjs_factory_name="ProtectionModel_01b";const Ee=dashjs.FactoryMaker.getClassFactory(ye);var ve=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],_e=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function Te(){var e,t=this.context;function n(e,t){for(var n=0;n{"use strict";n.d(t,{Z:()=>s});var r=n(5448),i={DEFAULT:.5,STRONG:1,WEAK:0};function a(e,t,n){var r,a;return r=void 0===e?-1:e,a=function(e){var t=i.DEFAULT;return e!==i.DEFAULT&&e!==i.STRONG&&e!==i.WEAK||(t=e),t}(n),{quality:r,reason:void 0===t?null:t,priority:a}}a.__dashjs_factory_name="SwitchRequest";var o=r.Z.getClassFactory(a);o.NO_CHANGE=-1,o.PRIORITY=i,r.Z.updateClassFactory(a.__dashjs_factory_name,o);const s=o},1767:(e,t,n)=>{"use strict";n.d(t,{Z:()=>E});var r=n(5628),i=n(6535),a=n(7423),o=n(895),s=n(6070),u=n(3112),l=n(1914),c=n(5435),f=n(5448),d=n(2068),g=n(3393),h="qualitySwitchRules",p="abandonFragmentRules";function m(e){e=e||{};var t,n,f=this.context,m=e.mediaPlayerModel,y=e.customParametersModel,E=e.dashMetrics,v=e.settings;function _(e){return e.filter((function(e){return e.quality>d.Z.NO_CHANGE}))}function T(e){var t,n,r,i,a,o={},s=null;if(0!==e.length){for(o[d.Z.PRIORITY.STRONG]={quality:d.Z.NO_CHANGE,reason:null},o[d.Z.PRIORITY.WEAK]={quality:d.Z.NO_CHANGE,reason:null},o[d.Z.PRIORITY.DEFAULT]={quality:d.Z.NO_CHANGE,reason:null},t=0,n=e.length;tr.quality)&&(o[r.priority].quality=r.quality,o[r.priority].reason=r.reason||null);return o[d.Z.PRIORITY.WEAK].quality!==d.Z.NO_CHANGE&&(s=o[d.Z.PRIORITY.WEAK]),o[d.Z.PRIORITY.DEFAULT].quality!==d.Z.NO_CHANGE&&(s=o[d.Z.PRIORITY.DEFAULT]),o[d.Z.PRIORITY.STRONG].quality!==d.Z.NO_CHANGE&&(s=o[d.Z.PRIORITY.STRONG]),s&&(i=s.quality,a=s.reason),(0,d.Z)(f).create(i,a)}}return{initialize:function(){t=[],n=[],v.get().streaming.abr.useDefaultABRRules&&(v.get().streaming.abr.ABRStrategy===g.Z.ABR_STRATEGY_L2A?t.push((0,l.Z)(f).create({dashMetrics:E,settings:v})):v.get().streaming.abr.ABRStrategy===g.Z.ABR_STRATEGY_LoLP?t.push((0,c.Z)(f).create({dashMetrics:E})):(t.push((0,u.Z)(f).create({dashMetrics:E,mediaPlayerModel:m,settings:v})),t.push((0,r.Z)(f).create({dashMetrics:E})),v.get().streaming.abr.additionalAbrRules.insufficientBufferRule&&t.push((0,i.Z)(f).create({dashMetrics:E,settings:v})),v.get().streaming.abr.additionalAbrRules.switchHistoryRule&&t.push((0,s.Z)(f).create()),v.get().streaming.abr.additionalAbrRules.droppedFramesRule&&t.push((0,o.Z)(f).create()),v.get().streaming.abr.additionalAbrRules.abandonRequestsRule&&n.push((0,a.Z)(f).create({dashMetrics:E,mediaPlayerModel:m,settings:v})))),y.getAbrCustomRules().forEach((function(e){e.type===h&&t.push(e.rule(f).create()),e.type===p&&n.push(e.rule(f).create())}))},reset:function(){[t,n].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),t=[],n=[]},getMaxQuality:function(e){return T(_(t.map((function(t){return t.getMaxIndex(e)}))))||(0,d.Z)(f).create()},getMinSwitchRequest:T,shouldAbandonFragment:function(e,t){return T(_(n.map((function(n){return n.shouldAbandon(e,t)}))))||(0,d.Z)(f).create()},getQualitySwitchRules:function(){return t}}}m.__dashjs_factory_name="ABRRulesCollection";var y=f.Z.getClassFactory(m);y.QUALITY_SWITCH_RULES=h,y.ABANDON_FRAGMENT_RULES=p,f.Z.updateSingletonFactory(m.__dashjs_factory_name,y);const E=y},7423:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(2068),i=n(5448),a=n(6398);function o(e){e=e||{};var t,n,i,s,u,l=this.context,c=e.mediaPlayerModel,f=e.dashMetrics,d=e.settings;function g(){i={},s={},u=[]}return t={shouldAbandon:function(e){var t=(0,r.Z)(l).create(r.Z.NO_CHANGE,{name:o.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return t;var a,g,h=e.getMediaInfo(),p=e.getMediaType(),m=e.getStreamInfo(),y=m?m.id:null,E=e.getCurrentRequest();if(!isNaN(E.index)){a=p,g=E.index,i[a]=i[a]||{},i[a][g]=i[a][g]||{};var v=c.getStableBufferTime();if(f.getCurrentBufferLevel(p)>v)return t;var _=i[p][E.index];if(null===_||null===E.firstByteDate||s.hasOwnProperty(_.id))return t;if(void 0===_.firstByteTime&&(u[p]=[],_.firstByteTime=E.firstByteDate.getTime(),_.segmentDuration=E.duration,_.bytesTotal=E.bytesTotal,_.id=E.index),_.bytesLoaded=E.bytesLoaded,_.elapsedTime=(new Date).getTime()-_.firstByteTime,_.bytesLoaded>0&&_.elapsedTime>0&&function(e,t){u[e]=u[e]||[],u[e].push(t)}(p,Math.round(8*_.bytesLoaded/_.elapsedTime)),u[p].length>=5&&_.elapsedTime>500&&_.bytesLoaded<_.bytesTotal){var T=u[p].reduce((function(e,t){return e+t}),0);if(_.measuredBandwidthInKbps=Math.round(T/u[p].length),_.estimatedTimeOfDownload=+(8*_.bytesTotal/_.measuredBandwidthInKbps/1e3).toFixed(2),_.estimatedTimeOfDownload<1.8*_.segmentDuration||0===e.getRepresentationInfo().quality)return t;if(!s.hasOwnProperty(_.id)){var S=e.getAbrController(),b=_.bytesTotal-_.bytesLoaded,A=S.getBitrateList(h),I=S.getQualityForBitrate(h,_.measuredBandwidthInKbps*d.get().streaming.abr.bandwidthSafetyFactor,y),R=S.getMinAllowedIndexFor(p,y),w=void 0!==R?Math.max(R,I):I;b>_.bytesTotal*A[w].bitrate/A[S.getQualityFor(p,y)].bitrate&&(t.quality=w,t.reason.throughput=_.measuredBandwidthInKbps,t.reason.fragmentID=_.id,s[_.id]=_,n.debug("["+p+"] frag id",_.id," is asking to abandon and switch to quality to ",w," measured bandwidth was",_.measuredBandwidthInKbps),delete i[p][_.id])}}else _.bytesLoaded===_.bytesTotal&&delete i[p][_.id]}return t},reset:g},n=(0,a.Z)(l).getInstance().getLogger(t),g(),t}o.__dashjs_factory_name="AbandonRequestsRule";const s=i.Z.getClassFactory(o)},3112:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(3860),i=n(2068),a=n(5448),o=n(7855),s=n(5595),u=n(8512),l=n(6398),c=n(8825),f=n(3393),d=10;function g(e){e=e||{};var t,n,a,g=this.context,h=e.dashMetrics,p=e.mediaPlayerModel,m=(0,s.Z)(g).getInstance();function y(e,t,n){var r=n.reduce((function(e,t,r){return t>n[e]?r:e}),0);if(0===r)return null;var i=Math.max(e,d+2*t.length),a=(n[r]-1)/(i/d-1);return{gp:a,Vp:d/a}}function E(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function v(e,t){var n=p.getStableBufferTime();if(e.stableBufferTime!==n){var r=y(n,e.bitrates,e.utilities);if(r.Vp!==e.Vp||r.gp!==e.gp){var i=h.getCurrentBufferLevel(t),a=i+e.placeholderBuffer;a-=d,a*=r.Vp/e.Vp,a+=d,e.stableBufferTime=n,e.Vp=r.Vp,e.gp=r.gp,e.placeholderBuffer=Math.max(0,a-i)}}}function _(e,t){return e.Vp*(e.utilities[t]+e.gp)}function T(e,t){for(var n=e.bitrates[t],r=e.utilities[t],i=0,a=t-1;a>=0;--a)if(e.utilities[a]t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,R(t,e.chunk.mediaInfo.type)}}}function I(e){if(e&&e.metric===r.Z.HTTP_REQUEST&&e.value&&e.value.type===o.w.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=a[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),R(t,e.mediaType))}}function R(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var n=h.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),r=_(e,e.lastQuality),i=Math.max(0,r-n);e.placeholderBuffer=Math.min(i,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function w(e){if(e){var t=a[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function N(e){if(e){var t=a[e.mediaType];if(t&&0!==t.state){var n,r=h.getCurrentBufferLevel(e.mediaType);n=t.abrQuality>0?T(t,t.abrQuality):d;var i=Math.max(0,n-r);t.placeholderBuffer=Math.min(t.placeholderBuffer,i)}}}function C(){a={}}return t={getMaxIndex:function(e){var t=(0,i.Z)(g).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return t;var r=e.getMediaInfo(),o=e.getMediaType(),s=e.getScheduleController(),u=e.getStreamInfo(),l=e.getAbrController(),c=l.getThroughputHistory(),f=u?u.id:null,d=u&&u.manifestInfo&&u.manifestInfo.isDynamic,m=e.useBufferOccupancyABR();if(t.reason=t.reason||{},!m)return t;s.setTimeToLoadDelay(0);var S=function(e){var t=e.getMediaType(),n=a[t];return n?0!==n.state&&v(n,t):(n=function(e){var t={},n=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),r=function(e){return e.map((function(e){return Math.log(e)}))}(n);r=r.map((function(e){return e-r[0]+1}));var i=p.getStableBufferTime(),a=y(i,n,r);return a?(t.state=1,t.bitrates=n,t.utilities=r,t.stableBufferTime=i,t.Vp=a.Vp,t.gp=a.gp,t.lastQuality=0,E(t)):t.state=0,t}(e),a[t]=n),n}(e);if(0===S.state)return t;var b,A=h.getCurrentBufferLevel(o),I=c.getAverageThroughput(o,d),R=c.getSafeAverageThroughput(o,d),w=c.getAverageLatency(o);if(t.reason.state=S.state,t.reason.throughput=I,t.reason.latency=w,isNaN(I))return t;switch(S.state){case 1:b=l.getQualityForBitrate(r,R,f,w),t.quality=b,t.reason.throughput=R,S.placeholderBuffer=Math.max(0,T(S,b)-A),S.lastQuality=b,!isNaN(S.lastSegmentDurationS)&&A>=S.lastSegmentDurationS&&(S.state=2);break;case 2:!function(e,t){var n=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){var r=.001*(n-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,r)}}else{var i=.001*(n-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,i)}e.lastCallTimeMs=n,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,v(e,t)}(S,o),b=function(e,t){for(var n=e.bitrates.length,r=NaN,i=NaN,a=0;a=i)&&(i=o,r=a)}return r}(S,A+S.placeholderBuffer);var N=l.getQualityForBitrate(r,R,f,w);b>S.lastQuality&&b>N&&(b=Math.max(N,S.lastQuality));var C=Math.max(0,A+S.placeholderBuffer-_(S,b));C<=S.placeholderBuffer?(S.placeholderBuffer-=C,C=0):(C-=S.placeholderBuffer,S.placeholderBuffer=0,b{"use strict";n.d(t,{Z:()=>s});var r=n(5448),i=n(2068),a=n(6398);function o(){var e,t,n=this.context;return e={getMaxIndex:function(e){var r=(0,i.Z)(n).create();if(!e||!e.hasOwnProperty("getDroppedFramesHistory"))return r;var a=e.getDroppedFramesHistory(),o=e.getStreamInfo().id;if(a){var s=a.getFrameHistory(o);if(!s||0===s.length)return r;for(var u=0,l=0,c=i.Z.NO_CHANGE,f=1;f375&&u/l>.15)){c=f-1,t.debug("index: "+c+" Dropped Frames: "+u+" Total Frames: "+l);break}return(0,i.Z)(n).create(c,{droppedFrames:u})}return r}},t=(0,a.Z)(n).getInstance().getLogger(e),e}o.__dashjs_factory_name="DroppedFramesRule";const s=r.Z.getClassFactory(o)},6535:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(5595),i=n(8512),a=n(5448),o=n(6398),s=n(2068),u=n(3393),l=n(3860),c=n(8825);function f(e){e=e||{};var t,n,a,f=this.context,d=(0,r.Z)(f).getInstance(),g=e.dashMetrics;function h(){(a={})[u.Z.VIDEO]={ignoreCount:2},a[u.Z.AUDIO]={ignoreCount:2}}function p(){h()}function m(e){isNaN(e.startTime)||e.mediaType!==u.Z.AUDIO&&e.mediaType!==u.Z.VIDEO||a[e.mediaType].ignoreCount>0&&a[e.mediaType].ignoreCount--}return t={getMaxIndex:function(e){var t=(0,s.Z)(f).create();if(!e||!e.hasOwnProperty("getMediaType"))return t;!function(){if(!g||!g.hasOwnProperty("getCurrentBufferLevel")||!g.hasOwnProperty("getCurrentBufferState"))throw new Error(u.Z.MISSING_CONFIG_ERROR)}();var r=e.getMediaType(),i=g.getCurrentBufferState(r),o=e.getRepresentationInfo().fragmentDuration,c=e.getStreamInfo(),d=c?c.id:null,h=e.getScheduleController(),p=c&&c.manifestInfo&&c.manifestInfo.isDynamic;if(function(e,t){return!e&&a[t].ignoreCount>0}(h.getPlaybackController().getLowLatencyModeEnabled(),r)||!o)return t;if(i&&i.state===l.Z.BUFFER_EMPTY)n.debug("["+r+"] Switch to index 0; buffer is empty."),t.quality=0,t.reason="InsufficientBufferRule: Buffer is empty";else{var m=e.getMediaInfo(),y=e.getAbrController(),E=y.getThroughputHistory(),v=g.getCurrentBufferLevel(r),_=E.getAverageThroughput(r,p),T=E.getAverageLatency(r),S=_*(v/o)*.5;t.quality=y.getQualityForBitrate(m,S,d,T),t.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return t},reset:function(){h(),d.off(c.Z.PLAYBACK_SEEKING,p,t),d.off(i.Z.BYTES_APPENDED_END_FRAGMENT,m,t)}},n=(0,o.Z)(f).getInstance().getLogger(t),h(),d.on(c.Z.PLAYBACK_SEEKING,p,t),d.on(i.Z.BYTES_APPENDED_END_FRAGMENT,m,t),t}f.__dashjs_factory_name="InsufficientBufferRule";const d=a.Z.getClassFactory(f)},1914:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(3860),i=n(2068),a=n(5448),o=n(7855),s=n(5595),u=n(8512),l=n(6398),c=n(3393);function f(e){e=e||{};var t,n,a,f,d=this.context,g=e.dashMetrics,h=(0,s.Z)(d).getInstance();function p(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function m(){for(var e in n)if(n.hasOwnProperty(e)){var t=n[e];0!==t.state&&(t.state=1,p(t))}}function y(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=n[e.chunk.mediaInfo.type],r=a[e.chunk.mediaInfo.type];if(t&&0!==t.state){var i=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||i>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=i,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=i,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,v(t,r)}}}function E(e){if(e&&e.metric===r.Z.HTTP_REQUEST&&e.value&&e.value.type===o.w.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=n[e.mediaType],i=a[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),v(t,i))}}function v(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function _(e){if(e&&e.mediaType){var t=n[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function T(e,t){if(e.length!==t.length)return-1;for(var n=0,r=0;r=D.B_target){C.state=2,D.Q=o;for(var O=0;Ox&&(k=-1),D.w[Z]=D.prev_w[Z]+k*(F/(2*s))*((D.Q+o)*(N*h[Z]/x));D.w=function(e){for(var t=e.length,n=!1,r=[],i=0;i=a[l+1]){n=!0;break}n||(s=(o+a[t-1]-1)/t);for(var c=0;cC.lastQuality&&h[C.lastQuality+1]<=x&&(t=C.lastQuality+1),h[t]>=x&&(D.Q=2*Math.max(o,D.Q)),r.quality=t,r.reason.throughput=R,r.reason.latency=w,r.reason.bufferLevel=A,C.lastQuality=r.quality;break;default:f.debug("L2A ABR rule invoked in bad state."),r.quality=v.getQualityForBitrate(u,I,E.id,w),r.reason.state=C.state,r.reason.throughput=I,r.reason.latency=w,C.state=1,p(C)}return r},reset:function(){S(),h.off(u.Z.PLAYBACK_SEEKING,m,t),h.off(u.Z.MEDIA_FRAGMENT_LOADED,y,t),h.off(u.Z.METRIC_ADDED,E,t),h.off(u.Z.QUALITY_CHANGE_REQUESTED,_,t)}},f=(0,l.Z)(d).getInstance().getLogger(t),S(),h.on(u.Z.PLAYBACK_SEEKING,m,t),h.on(u.Z.MEDIA_FRAGMENT_LOADED,y,t),h.on(u.Z.METRIC_ADDED,E,t),h.on(u.Z.QUALITY_CHANGE_REQUESTED,_,t),t}f.__dashjs_factory_name="L2ARule";const d=a.Z.getClassFactory(f)},6070:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(5448),i=n(6398),a=n(2068);function o(){var e,t,n=this.context;return e={getMaxIndex:function(e){for(var r=e?e.getSwitchHistory():null,i=r?r.getSwitchRequests():[],o=0,s=0,u=0,l=(0,a.Z)(n).create(),c=0;c=6&&o/s>.075)){l.quality=c>0&&i[c].drops>0?c-1:c,l.reason={index:l.quality,drops:o,noDrops:s,dropSize:u},t.debug("Switch history rule index: "+l.quality+" samples: "+(o+s)+" drops: "+o);break}return l}},t=(0,i.Z)(n).getInstance().getLogger(e),e}o.__dashjs_factory_name="SwitchHistoryRule";const s=r.Z.getClassFactory(o)},5628:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(5448),i=n(2068),a=n(3393),o=n(3860);function s(e){e=e||{};var t=this.context,n=e.dashMetrics;return{getMaxIndex:function(e){var r=(0,i.Z)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("useBufferOccupancyABR")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("getScheduleController")))return r;!function(){if(!n||!n.hasOwnProperty("getCurrentBufferState"))throw new Error(a.Z.MISSING_CONFIG_ERROR)}();var s=e.getMediaInfo(),u=e.getMediaType(),l=n.getCurrentBufferState(u),c=e.getScheduleController(),f=e.getAbrController(),d=e.getStreamInfo(),g=d?d.id:null,h=d&&d.manifestInfo?d.manifestInfo.isDynamic:null,p=f.getThroughputHistory(),m=p.getSafeAverageThroughput(u,h),y=p.getAverageLatency(u),E=e.useBufferOccupancyABR();return isNaN(m)||!l||E||f.getAbandonmentStateFor(g,u)!==o.Z.ABANDON_LOAD&&(l.state===o.Z.BUFFER_LOADED||h)&&(r.quality=f.getQualityForBitrate(s,m,g,y),c.setTimeToLoadDelay(0),r.reason={throughput:m,latency:y}),r},reset:function(){}}}s.__dashjs_factory_name="ThroughputRule";const u=r.Z.getClassFactory(s)},4722:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(5448),i=n(6398);function a(){var e,t,n,r,a,o,s,u,l,c=this.context;function f(){n=null,r=1,a=100,o=0,s=null,u=null,l="dynamic_weight_selection"}function d(){var e=0;if(n)for(var t=0;te&&(e=r.state.throughput)}return e}function g(e,t,n){var r=e.map((function(e,r){return n[r]*Math.pow(e-t[r],2)})).reduce((function(e,t){return e+t}));return(r<0?-1:1)*Math.sqrt(Math.abs(r))}function h(e,t){return g([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function p(e,t,n){for(var r=0;ro)&&(a=u,o=l)}t.push(a)}for(var h=null,p=null,m=0;mh)&&(h=y,p=m)}var v=[];for(v.push(t[p]),t.splice(p,1);t.length>0;){for(var _=null,T=null,S=0;S1&&(S=d()),c/=a,t.debug("getNextQuality called throughput:".concat(S," latency:").concat(c," bufferSize:").concat(f," currentQualityIndex:").concat(m," playbackRate:").concat(h));var b=T[m],A=b.bitrate*y.getSegmentDuration()/_,I=Math.max(0,A-v);if(v-A{"use strict";n.d(t,{Z:()=>o});var r=n(5448),i=n(2298);function a(){var e,t,n,r,a;function o(){t=null,n=null,r=null,a=null}function s(e,t,n,r){var a=new i.Z;return a.type=e,a.weights.bitrateReward=t||1,a.weights.bitrateSwitchPenalty=1,a.weights.rebufferPenalty=n||1e3,a.weights.latencyPenalty=[],a.weights.latencyPenalty.push({threshold:1.1,penalty:.05*r}),a.weights.latencyPenalty.push({threshold:1e8,penalty:.1*n}),a.weights.playbackSpeedPenalty=r||200,a}function u(e,t,n,r,i){i.bitrateWSum+=i.weights.bitrateReward*e,i.lastBitrate&&(i.bitrateSwitchWSum+=i.weights.bitrateSwitchPenalty*Math.abs(e-i.lastBitrate)),i.lastBitrate=e,i.rebufferWSum+=i.weights.rebufferPenalty*t;for(var a=0;a{"use strict";n.d(t,{Z:()=>d});var r=n(6398),i=n(5448),a=n(4722),o=n(5317),s=n(2068),u=n(3860),l=n(6523),c=n(3393);function f(e){var t,n,i,f,d=(e=e||{}).dashMetrics,g=this.context;return n={getMaxIndex:function(e){try{var n=(0,s.Z)(g).create(),r=e.getMediaInfo().type,a=e.getAbrController(),o=e.getStreamInfo(),h=a.getQualityFor(r,o.id),p=e.getMediaInfo(),m=d.getCurrentBufferState(r),y=e.getScheduleController(),E=d.getCurrentBufferLevel(r,!0),v=o&&o.manifestInfo?o.manifestInfo.isDynamic:null,_=y.getPlaybackController(),T=_.getCurrentLiveLatency();if(!e.useLoLPABR()||r===c.Z.AUDIO)return n;T||(T=0);var S=_.getPlaybackRate(),b=a.getThroughputHistory().getSafeAverageThroughput(r,v);if(t.debug("Throughput ".concat(Math.round(b)," kbps")),isNaN(b)||!m)return n;if(a.getAbandonmentStateFor(o.id,r)===u.Z.ABANDON_LOAD)return n;for(var A=p.bitrateList,I=e.getRepresentationInfo().fragmentDuration,R=A[0].bandwidth/1e3,w=A[A.length-1].bandwidth/1e3,N=0;Nw?w=C:CI?M-I:0;f.setupPerSegmentQoe(I,w,R),f.logSegmentMetrics(D,P,T,S);var L=(0,l.Z)(g).create({targetLatency:1.5,bufferMin:.3,segmentDuration:I,qoeEvaluator:f});return n.quality=i.getNextQuality(p,1e3*b,T,E,S,h,L),n.reason={throughput:b,latency:T},n.priority=s.Z.PRIORITY.STRONG,y.setTimeToLoadDelay(0),n.quality!==h&&console.log("[TgcLearningRule]["+r+"] requesting switch to index: ",n.quality,"Average throughput",Math.round(b),"kbps"),n}catch(e){throw e}},reset:function(){i.reset(),f.reset()}},t=(0,r.Z)(g).getInstance().getLogger(n),i=(0,a.Z)(g).create(),f=(0,o.Z)(g).create(),n}f.__dashjs_factory_name="LoLPRule";const d=i.Z.getClassFactory(f)},6523:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(5448);function i(e){var t,n,r,i,a=e.targetLatency,o=e.bufferMin,s=e.segmentDuration,u=e.qoeEvaluator;function l(){return s}function c(e,t){var n=l();return t>n?e-n:e+n-t}return t={getMinBuffer:function(){return o},getSegmentDuration:l,getNextBufferWithBitrate:function(e,t,n){return c(t,e*s/n)},getNextBuffer:c,findWeightVector:function(e,t,i,l,f,d){var g=null,h=null,p=null,m=Math.abs(t-r);return e.forEach((function(e){n.forEach((function(n){n[0];var r=n[1],l=n[2],y=(n[3],e.bitrate*s/f),E=c(i,y),v=(0===l?10:1/l)*Math.max(1e-5,y-E),_=(0===r?10:1/r)*e.state.latency,T=u.calculateSingleUseQoe(e.bitrate,v,_,d);(null===g||T>g)&&function(e,t,n){return!(e>a+n)&&t>=o}(t,E,m)&&(g=T,h=n,p=e.bitrate)}))})),null===h&&null===p&&(h=-1),r=t,h}},4,n=function e(t,n,r){if(r===n)return t;for(var a=t.length,o=0;o{"use strict";n.d(t,{Z:()=>r});const r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=null,this.lastBitrate=null,this.weights={},this.weights.bitrateReward=null,this.weights.bitrateSwitchPenalty=null,this.weights.rebufferPenalty=null,this.weights.latencyPenalty=null,this.weights.playbackSpeedPenalty=null,this.bitrateWSum=0,this.bitrateSwitchWSum=0,this.rebufferWSum=0,this.latencyWSum=0,this.playbackSpeedWSum=0,this.totalQoe=0}},7803:(e,t,n)=>{"use strict";n.d(t,{Y:()=>g,Z:()=>p});var r=n(3393),i=n(1553),a=n(5448),o=n(2128),s=n(2594),u=n(7387),l=n(7417),c=n(9032),f=n(9326),d=n(7802),g=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];function h(e){var t,n,a,h,p,m,y,E,v=this.context,_=e.adapter,T=e.baseURLController,S=e.streamInfo,b=e.timelineConverter,A=e.debug,I=e.eventBus,R=e.events,w=e.dashConstants,N=(0,s.Z)(v).getInstance();function C(e,t){var r=new o.Z;r.id=e.id,r.bitrate=e.bandwidth,r.width=e.width,r.height=e.height,r.tilesHor=1,r.tilesVert=1,e.essentialProperties&&e.essentialProperties.forEach((function(e){if(g.indexOf(e.schemeIdUri)>=0&&e.value){var t=e.value.split("x");2!==t.length||isNaN(t[0])||isNaN(t[1])||(r.tilesHor=parseInt(t[0],10),r.tilesVert=parseInt(t[1],10))}})),t?m.updateSegmentData(e).then((function(t){!function(e,t,n){var r=[],i=function(e,t){var n,r,i,a,o=[],s=0;for(n=0,r=e.segments.length;ne)return i=t.url,!0})),i?n(i):t.segments.some((function(i){if(i.mediaStartTime<=e&&i.mediaStartTime+i.duration>e){var a=T.resolve(t.path);return y.load({method:"get",url:a.url,request:{range:i.mediaRange,responseType:"arraybuffer"},onload:function(e){var t=E.getSamplesInfo(e.target.response),a=new Blob([e.target.response.slice(t.sampleList[0].offset,t.sampleList[0].offset+t.sampleList[0].size)],{type:"image/jpeg"}),o=window.URL.createObjectURL(a);r.push({start:i.mediaStartTime,end:i.mediaStartTime+i.duration,url:o}),n&&n(o)}}),!0}}))}}(r,e,t)})):(r.startNumber=e.startNumber,r.segmentDuration=e.segmentDuration,r.timescale=e.timescale,r.templateUrl=function(e){var t=N.isRelative(e.media)?N.resolve(e.media,T.resolve(e.path).url):e.media;return t?(0,u.Aj)(t,e.id):""}(e)),r.tilesHor>0&&r.tilesVert>0&&(r.widthPerTile=r.width/r.tilesHor,r.heightPerTile=r.height/r.tilesVert,n.push(r))}function D(){n=[],h=-1,p=null}return t={getTracks:function(){return n},addTracks:function(){if(S&&_&&(p=_.getMediaInfoForType(S,r.Z.IMAGE))){var e=_.getVoRepresentations(p);e&&e.length>0&&e.forEach((function(e){(e.segmentInfoType===i.Z.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===i.Z.SEGMENT_TIMELINE)&&C(e),e.segmentInfoType===i.Z.SEGMENT_BASE&&C(e,!0)})),n.length>0&&n.sort((function(e,t){return e.bitrate-t.bitrate}))}},reset:D,setTrackByIndex:function(e){n&&0!==n.length&&(e>=n.length&&(e=n.length-1),h=e)},getCurrentTrack:function(){return h<0?null:n[h]},getCurrentTrackIndex:function(){return h},getThumbnailRequestForTime:function(e){for(var t,r=_.getVoRepresentations(p),i=0;i{"use strict";n.d(t,{Z:()=>l});var r=n(6398),i=n(8260),a=n(5448),o=n(6934),s=n(9597);function u(){var e,t,n=this.context;function a(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=o.parseBuffer(e),r=(0,i.Z)(n).create();return r.setData(t),r}function u(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function l(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:a,findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new s.Z(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,a=0;n=0?r=new s.Z(n,!0,o):a=n+o),n+=o}return r||new s.Z(a,!1)},getMediaTimescaleFromMoov:function(e){var t=a(e),n=t?t.getBox("mdhd"):void 0;return n?n.timescale:NaN},getSamplesInfo:function(e){if(!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var t,n,r,i,o,s,u,l,c,f,d,g,h,p,m,y,E=a(e),v=E.getBoxes("moof"),_=E.getBoxes("mfhd");m=E.getBoxes("moof").length,p=_[_.length-1].sequence_number,n=0,o=[];var T=-1,S=-1;for(f=0;fS&&(T++,S+=M.entries[T].sample_delta),u==S){O.subSizes=[];var P=M.entries[T];for(g=0;g=t.byteLength)return new s.Z(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,a=0;n=0?r=new s.Z(n,!0,o,c):a=n+o),n+=o}return r||new s.Z(a,!1)}},e=(0,r.Z)(n).getInstance().getLogger(t),t}u.__dashjs_factory_name="BoxParser";const l=a.Z.getSingletonFactory(u)},1715:(e,t,n)=>{"use strict";n.d(t,{B:()=>s,Z:()=>l});var r=n(5448),i=n(7803),a=n(3393),o=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function s(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t}function u(){var e,t,n;return e={setConfig:function(e){e&&e.settings&&(t=e.settings)},supportsMediaSource:s,supportsEncryptedMedia:function(){return n},supportsCodec:function(e,n){return n!==a.Z.AUDIO&&n!==a.Z.VIDEO?Promise.resolve(!0):function(e,n){return t.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(e.codec&&n===a.Z.AUDIO||n===a.Z.VIDEO&&e.codec&&e.width&&e.height&&e.bitrate&&e.framerate)}(e,n)?function(e,t){return new Promise((function(n){if(e&&e.codec){var r={type:"media-source"};r[t]={},r[t].contentType=e.codec,r[t].width=e.width,r[t].height=e.height,r[t].bitrate=parseInt(e.bitrate),r[t].framerate=parseFloat(e.framerate),navigator.mediaCapabilities.decodingInfo(r).then((function(e){n(e.supported)})).catch((function(){n(!1)}))}else n(!1)}))}(e,n):function(e){return new Promise((function(t){if(e&&e.codec){var n=e.codec;e.width&&e.height&&(n+=';width="'+e.width+'";height="'+e.height+'"'),"MediaSource"in window&&MediaSource.isTypeSupported(n)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(n)?t(!0):t(!1)}else t(!1)}))}(e)},setEncryptedMediaSupported:function(e){n=e},supportsEssentialProperty:function(e){try{return-1!==i.Y.indexOf(e.schemeIdUri)}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var n,r=e.split(".")[0],i=0===t.indexOf(r),a=0;a{"use strict";n.d(t,{Z:()=>o});var r=n(5448),i=n(3106);function a(){return{customTimeRangeArray:[],length:0,add:function(e,t){var n=0;for(n=0;nthis.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&tthis.customTimeRangeArray[n].start&&ethis.customTimeRangeArray[n].start&&t=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return(0,i.SE)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}a.__dashjs_factory_name="CustomTimeRanges";const o=r.Z.getClassFactory(a)},5:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(5448);function i(){var e,t=/^[a-z][a-z0-9+\-_.]*:/i,n=/^https?:\/\//i,r=/^https:\/\//i,i=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,a=function(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}},o=function(e,t){var n=s;if(!t)return e;if(!c(e))return e;f(e)&&(n=u),d(e)&&(n=l);var r=n(t),i="/"!==r.charAt(r.length-1)&&"/"!==e.charAt(0)?"/":"";return[r,e].join(i)};function s(e){var t=e.indexOf("/"),n=e.lastIndexOf("/");return-1!==t?n===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,n+1)):""}function u(e){var t=e.match(i);return t?t[1]:""}function l(e){var n=e.match(t);return n?n[0]:""}function c(e){return!t.test(e)}function f(e){return c(e)&&"/"===e.charAt(0)}function d(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y"),e=a}catch(e){}finally{e=e||o}}(),{parseBaseUrl:s,parseOrigin:u,parseScheme:l,isRelative:c,isPathAbsolute:f,isSchemeRelative:d,isHTTPURL:function(e){return n.test(e)},isHTTPS:function(e){return r.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,n){return e(t,n)}}}i.__dashjs_factory_name="DefaultURLUtils";const a=r.Z.getSingletonFactory(i)},8260:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(2839),i=n(5448);function a(){var e;function t(t){var r=[];if(!t||!e||"function"!=typeof e.fetchAll)return r;for(var i,a=e.fetchAll(t),o=0,s=a.length;o0?n[n.length-1]:null}}}a.__dashjs_factory_name="IsoFile";const o=i.Z.getClassFactory(a)},7473:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o,k:()=>i});var r=n(5448);function i(e,t){var n={url:e.url,method:e.method,headers:Object.assign({},e.headers),credentials:e.withCredentials?"include":void 0};return Promise.resolve(t.modifyRequest(n)).then((function(){return Object.assign(e,n,{withCredentials:"include"===n.credentials})}))}function a(){return{modifyRequest:null,modifyRequestURL:function(e){return e},modifyRequestHeader:function(e,t){return t.url,e}}}a.__dashjs_factory_name="RequestModifier";const o=r.Z.getSingletonFactory(a)},3106:(e,t,n)=>{"use strict";n.d(t,{PS:()=>a,SE:()=>o});var r=n(3393);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){if(i(e)!==t)throw r.Z.BAD_ARGUMENT_ERROR}function o(e){if(null===e||isNaN(e)||e%1!=0)throw r.Z.BAD_ARGUMENT_ERROR+" : argument is not an integer"}},2594:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(5448),i=n(5);function a(){var e,t=[],n=this.context;function r(n,r,i){var a=function(n){var r;for(r=0;r{"use strict";n.d(t,{Z:()=>r});const r=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=r||null}},3186:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7855);function i(e,t){for(var n=0;n{"use strict";function r(e,t){for(var n=0;ni});const i=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.offset=t._offset,this.type=t.type,this.size=t.size,this.boxes=[],t.boxes)for(var n=0;n{"use strict";n.d(t,{Z:()=>r});const r=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=n,this.size=r}},2128:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""}},7855:(e,t,n)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{O:()=>a,w:()=>i});var i=function e(){r(this,e),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this.cmsd=null,this._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null,this._fileLoaderType=null},a=function e(){r(this,e),this.s=null,this.d=null,this.b=[]};i.GET="GET",i.HEAD="HEAD",i.MPD_TYPE="MPD",i.XLINK_EXPANSION_TYPE="XLinkExpansion",i.INIT_SEGMENT_TYPE="InitializationSegment",i.INDEX_SEGMENT_TYPE="IndexSegment",i.MEDIA_SEGMENT_TYPE="MediaSegment",i.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",i.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",i.DVB_REPORTING_TYPE="DVBReporting",i.LICENSE="license",i.CONTENT_STEERING_TYPE="ContentSteering",i.OTHER_TYPE="other"},3039:(e,t)=>{"use strict";function n(e,t){return function(n,i){for(var a,o,s,u=r(n,"tag"),l=r(null==i?"*":i,"range"),c=[],f=-1;++f-1}),!0),t.extendedFilter=n((function(e,t){var n=e.split("-"),r=t.split("-"),i=0,a=0;if("*"!==r[a]&&n[i]!==r[a])return!1;for(i++,a++;a{"use strict";e.exports=n(3854)},3854:(e,t,n)=>{"use strict";var r=n(2415),i=n(3039),a=n(7778),o=n(5813),s=n(3165),u=n(9460);e.exports=function(e,t){var n,c=t||{},m=r.parse(String(e||"").toLowerCase(),c),y=r.stringify(m),E=-1;if(!y)return y;for(;++E-1||!e[i]||!e[i].length)&&h(e,i,o[i])}function g(e,t,n){var r,i,a,o,s=!1;if(n){if(i=r=e[t],r&&"object"==typeof r)for(i=[],a=-1;++a{"use strict";t.parse=n(6903),t.stringify=n(6713)},6903:(e,t,n)=>{"use strict";var r=n(2219),i=n(3516),a=n(395),o=n(858),s=n(8589);e.exports=function e(t,n){var l,c,f,d=n||{},g={language:null,extendedLanguageSubtags:[],script:null,region:null,variants:[],extensions:[],privateuse:[],irregular:null,regular:null},h=String(t),p=h.toLowerCase(),m=0;if(null==t)throw new Error("Expected string, got `"+t+"`");if(u.call(s,p))return(null==d.normalize||d.normalize)&&s[p]?e(s[p]):(g[-1===o.indexOf(p)?"irregular":"regular"]=h,g);for(;i(p.charCodeAt(m))&&m<9;)m++;if(m>1&&m<9){if(g.language=h.slice(0,m),m<4)for(c=0;45===p.charCodeAt(m)&&i(p.charCodeAt(m+1))&&i(p.charCodeAt(m+2))&&i(p.charCodeAt(m+3))&&!i(p.charCodeAt(m+4));){if(c>2)return y(m,3,"Too many extended language subtags, expected at most 3 subtags");g.extendedLanguageSubtags.push(h.slice(m+1,m+4)),m+=4,c++}for(45===p.charCodeAt(m)&&i(p.charCodeAt(m+1))&&i(p.charCodeAt(m+2))&&i(p.charCodeAt(m+3))&&i(p.charCodeAt(m+4))&&!i(p.charCodeAt(m+5))&&(g.script=h.slice(m+1,m+5),m+=5),45===p.charCodeAt(m)&&(i(p.charCodeAt(m+1))&&i(p.charCodeAt(m+2))&&!i(p.charCodeAt(m+3))?(g.region=h.slice(m+1,m+3),m+=3):a(p.charCodeAt(m+1))&&a(p.charCodeAt(m+2))&&a(p.charCodeAt(m+3))&&!a(p.charCodeAt(m+4))&&(g.region=h.slice(m+1,m+4),m+=4));45===p.charCodeAt(m);){for(f=l=m+1;r(p.charCodeAt(f));){if(f-l>7)return y(f,1,"Too long variant, expected at most 8 characters");f++}if(!(f-l>4||f-l>3&&a(p.charCodeAt(l))))break;g.variants.push(h.slice(l,f)),m=f}for(;45===p.charCodeAt(m)&&120!==p.charCodeAt(m+1)&&r(p.charCodeAt(m+1))&&45===p.charCodeAt(m+2)&&r(p.charCodeAt(m+3));){for(f=m+2,c=0;45===p.charCodeAt(f)&&r(p.charCodeAt(f+1))&&r(p.charCodeAt(f+2));)for(f=(l=f+1)+2,c++;r(p.charCodeAt(f));){if(f-l>7)return y(f,2,"Too long extension, expected at most 8 characters");f++}if(!c)return y(f,4,"Empty extension, extensions must have at least 2 characters of content");g.extensions.push({singleton:h.charAt(m+1),extensions:h.slice(m+3,f).split("-")}),m=f}}else m=0;if(0===m&&120===p.charCodeAt(m)||45===p.charCodeAt(m)&&120===p.charCodeAt(m+1))for(f=m=m?m+2:1;45===p.charCodeAt(f)&&r(p.charCodeAt(f+1));){for(f=l=m+1;r(p.charCodeAt(f));){if(f-l>7)return y(f,5,"Too long private-use area, expected at most 8 characters");f++}g.privateuse.push(h.slice(m+1,f)),m=f}return m!==h.length?y(m,6,"Found superfluous content after tag"):g;function y(e,t,n){return d.warning&&d.warning(n,t,e),d.forgiving?g:{language:null,extendedLanguageSubtags:[],script:null,region:null,variants:[],extensions:[],privateuse:[],irregular:null,regular:null}}};var u={}.hasOwnProperty},6713:e=>{"use strict";e.exports=function(e){var t,n,r,i=e||{},a=[];if(i.irregular||i.regular)return i.irregular||i.regular;if(i.language)for(a=a.concat(i.language,i.extendedLanguageSubtags||[],i.script||[],i.region||[],i.variants||[]),t=i.extensions||[],n=-1;++n{"use strict";var r=n(6693),i=n(2165),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;var o=2147483647;function s(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|p(e,t),r=s(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(G(e,Uint8Array)){var t=new Uint8Array(e);return g(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(G(e,ArrayBuffer)||e&&G(e.buffer,ArrayBuffer))return g(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(G(e,SharedArrayBuffer)||e&&G(e.buffer,SharedArrayBuffer)))return g(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);var i=function(e){if(u.isBuffer(e)){var t=0|h(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||j(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return c(e),s(e<0?0:0|h(e))}function d(e){for(var t=e.length<0?0:0|h(e.length),n=s(t),r=0;r=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||G(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(i)return r?-1:Z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return D(this,t,n);case"utf8":case"utf-8":return R(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function E(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),j(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var a,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=n;as&&(n=s-u),a=n;a>=0;a--){for(var f=!0,d=0;di&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function R(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&l)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr.length?u.from(a).copy(r,i):Uint8Array.prototype.set.call(r,a,i);else{if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i)}i+=a.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(e+=" ... "),""},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if(G(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(r,i),c=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return T(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return b(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function N(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function L(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function x(e,t,n,r,a){return t=+t,n>>>=0,a||L(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function F(e,t,n,r,a){return t=+t,n>>>=0,a||L(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||M(e,t,this.length);for(var r=this[e],i=1,a=0;++a>>=0,t>>>=0,n||M(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||M(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||M(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||M(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||M(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||M(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||M(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,n>>>=0,r||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,n){return x(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return x(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function U(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function G(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function j(e){return e!=e}var Y=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},6693:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,a=u(e),o=a[0],s=a[1],l=new i(function(e,t,n){return 3*(t+n)/4-n}(0,o,s)),c=0,f=s>0?o-4:o;for(n=0;n>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,l[c++]=255&t),1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=16383,s=0,u=r-i;su?u:s+o));return 1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,r){for(var i,a,o=[],s=t;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},2165:(e,t)=>{t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<>1,c=-7,f=n?i-1:0,d=n?-1:1,g=e[t+f];for(f+=d,a=g&(1<<-c)-1,g>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(g?-1:1);o+=Math.pow(2,r),a-=l}return(g?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,u,l=8*a-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:a-1,h=r?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[n+g]=255&s,g+=h,s/=256,i-=8);for(o=o<0;e[n+g]=255&o,g+=h,o/=256,l-=8);e[n+g-h]|=128*p}},6934:(e,t)=>{var n={parseBuffer:function(e){return new r(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(i.prototype._boxProcessors[e]=t)},createFile:function(){return new r},createBox:function(e,t,n){var r=i.create(e);return t&&t.append(r,n),r},createFullBox:function(e,t,r){var i=n.createBox(e,t,r);return i.version=0,i.flags=0,i},Utils:{}};n.Utils.dataViewToString=function(e,t){var n=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(e);var r=[],i=0;if("utf-8"===n)for(;i>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},n.Utils.appendBox=function(e,t,n){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==n)if(null!=n){var r,i=-1;if("number"==typeof n)i=n;else{if("string"==typeof n)r=n;else{if("object"!=typeof n||!n.type)return void e.boxes.push(t);r=n.type}for(var a=0;a>3,t},i.prototype._readUint=function(e){var t,n,r=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:r=this._raw.getUint8(i);break;case 16:r=this._raw.getUint16(i);break;case 24:r=((t=this._raw.getUint16(i))<<8)+(n=this._raw.getUint8(i+2));break;case 32:r=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),n=this._raw.getUint32(i+4),r=t*Math.pow(2,32)+n}return this._cursor.offset+=e>>3,r},i.prototype._readString=function(e){for(var t="",n=0;n0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,n}return null},i.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?n.Utils.dataViewToString(t):t},i.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);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._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},i.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},i.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset>3}else this.size+=e>>3},i.prototype._writeUint=function(e,t){if(this._rawo){var n,r,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:n=(16776960&t)>>8,r=255&t,this._rawo.setUint16(i,n),this._rawo.setUint8(i+2,r);break;case 32:this._rawo.setUint32(i,t);break;case 64:r=t-(n=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(i,n),this._rawo.setUint32(i+4,r)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeString=function(e,t){for(var n=0;n>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},i.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},i.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},i.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},i.prototype._boxProcessors.mp4a=i.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},i.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},i.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},i.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},i.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},i.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},i.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},i.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},i.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,(function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)}))}))},i.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,(function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)}))}))},i.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},i.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},i.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},i.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},i.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},i.prototype._boxProcessors["url "]=i.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},i.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},i.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},i.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},i.prototype._boxProcessors.vtte=function(){}},5530:(e,t,n)=>{"use strict";e.exports=n(6146).polyfill()},6146:function(e,t,n){e.exports=function(){"use strict";function e(e){return"function"==typeof e}var t=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,i=void 0,a=void 0,o=function(e,t){g[r]=e,g[r+1]=t,2===(r+=2)&&(a?a(h):v())};var s="undefined"!=typeof window?window:void 0,u=s||{},l=u.MutationObserver||u.WebKitMutationObserver,c="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var e=setTimeout;return function(){return e(h,1)}}var g=new Array(1e3);function h(){for(var e=0;e{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}p(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&p(e,"error",t,{once:!0})}(e,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,a,o,l;if(s(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,l=c,console&&console.warn&&console.warn(l)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=a[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var l=u.length,c=h(u,l);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return d(this,e,!0)},a.prototype.rawListeners=function(e){return d(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},3101:e=>{"use strict";var t=Array.isArray,n=Object.keys,r=Object.prototype.hasOwnProperty;e.exports=function e(i,a){if(i===a)return!0;if(i&&a&&"object"==typeof i&&"object"==typeof a){var o,s,u,l=t(i),c=t(a);if(l&&c){if((s=i.length)!=a.length)return!1;for(o=s;0!=o--;)if(!e(i[o],a[o]))return!1;return!0}if(l!=c)return!1;var f=i instanceof Date,d=a instanceof Date;if(f!=d)return!1;if(f&&d)return i.getTime()==a.getTime();var g=i instanceof RegExp,h=a instanceof RegExp;if(g!=h)return!1;if(g&&h)return i.toString()==a.toString();var p=n(i);if((s=p.length)!==n(a).length)return!1;for(o=s;0!=o--;)if(!r.call(a,p[o]))return!1;for(o=s;0!=o--;)if(!e(i[u=p[o]],a[u]))return!1;return!0}return i!=i&&a!=a}},3362:(e,t,n)=>{!function(e,t,n,r,i){function a(e,t,n,r){var i=r&&"seq"===r.timeContainer,o=0;r&&(o=i&&n?n.end:r.begin),t.begin=t.explicit_begin?t.explicit_begin+o:o;var s=t.begin,u=null;for(var l in t.sets)a(e,t.sets[l],u,t),s="seq"===t.timeContainer?t.sets[l].end:Math.max(s,t.sets[l].end),u=t.sets[l];if("contents"in t)for(var c in t.contents)a(e,t.contents[c],u,t),s="seq"===t.timeContainer?t.contents[c].end:Math.max(s,t.contents[c].end),u=t.contents[c];else s=i?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,o+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=o+t.explicit_end:t.end=s,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function o(e){this.node=e}function s(){this.events=[],this.head=null,this.body=null}function u(){this.styling=null,this.layout=null}function l(){this.styles={}}function c(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function f(){this.regions={}}function d(e){this.kind=e}function g(e){this.id=e}function h(e){this.regionID=e}function p(e){this.styleAttrs=e}function m(e){this.sets=e}function y(e){this.contents=e}function E(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function v(){d.call(this,"body")}function _(){d.call(this,"div")}function T(){d.call(this,"p")}function S(){d.call(this,"span")}function b(){d.call(this,"span")}function A(){d.call(this,"br")}function I(){}function R(){}function w(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function N(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function C(e,t){var n={};if(null!==e)for(var i in e.attributes){var a=e.attributes[i].uri+" "+e.attributes[i].local,o=r.byQName[a];if(void 0!==o){var s=o.parse(e.attributes[i].value);null!==s?(n[a]=s,o===r.byName.zIndex&&x(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):F(t,"Cannot parse styling attribute "+a+" --\x3e "+e.attributes[i].value)}}return n}function D(e,t,n){for(var r in e.attributes)if(e.attributes[r].uri===t&&e.attributes[r].local===n)return e.attributes[r].value;return null}function O(e,t,n){var r,i=null;return null!==(r=/^(\d+(?:\.\d+)?)f$/.exec(n))?null!==t&&(i=parseFloat(r[1])/t):null!==(r=/^(\d+(?:\.\d+)?)t$/.exec(n))?null!==e&&(i=parseFloat(r[1])/e):null!==(r=/^(\d+(?:\.\d+)?)ms$/.exec(n))?i=parseFloat(r[1])/1e3:null!==(r=/^(\d+(?:\.\d+)?)s$/.exec(n))?i=parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)h$/.exec(n))?i=3600*parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)m$/.exec(n))?i=60*parseFloat(r[1]):null!==(r=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n))?i=3600*parseInt(r[1])+60*parseInt(r[2])+parseFloat(r[3]):null!==(r=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n))&&null!==t&&(i=3600*parseInt(r[1])+60*parseInt(r[2])+parseInt(r[3])+(null===r[4]?0:parseInt(r[4])/t)),i}function M(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(M(e,e.styles[r],n),L(e.styles[r].styleAttrs,t.styleAttrs)):F(n,"Non-existant style id referenced")}}function P(e,t,n,r){for(var i=t.length-1;i>=0;i--){var a=t[i];a in e.styles?L(e.styles[a].styleAttrs,n):F(r,"Non-existant style id referenced")}}function L(e,t){for(var n in e)n in t||(t[n]=e[n])}function x(e,t){if(e&&e.warn&&e.warn(t))throw t}function F(e,t){if(e&&e.error&&e.error(t))throw t}function k(e,t){throw e&&e.fatal&&e.fatal(t),t}function Z(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=e[n=Math.floor((r+i)/2)];if(at))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,r,i){var d=t.parser(!0,{xmlns:!0}),g=[],h=[],p=[],m=0,y=null;d.onclosetag=function(e){if(g[0]instanceof l)for(var t in g[0].styles)M(g[0],g[0].styles[t],r);else if(g[0]instanceof T||g[0]instanceof S){if(g[0].contents.length>1){var a,s=[g[0].contents[0]];for(a=1;a0&&i&&"onCloseTag"in i&&i.onCloseTag());p.shift(),h.shift(),g.shift()},d.ontext=function(e){if(void 0===g[0]);else if(g[0]instanceof S||g[0]instanceof T){var t=new b;t.initFromText(y,g[0],e,p[0],r),g[0].contents.push(t)}else g[0]instanceof o&&m>0&&i&&"onText"in i&&i.onText(e)},d.onopentag=function(e){var t=e.attributes["xml:space"];t?p.unshift(t.value):0===p.length?p.unshift("default"):p.unshift(p[0]);var a=e.attributes["xml:lang"];if(a?h.unshift(a.value):0===h.length?h.unshift(""):h.unshift(h[0]),e.uri===n.ns_tt)if("tt"===e.local)null!==y&&k(r,"Two elements at ("+this.line+","+this.column+")"),(y=new s).initFromNode(e,r),g.unshift(y);else if("head"===e.local)g[0]instanceof s||k(r,"Parent of element is not at ("+this.line+","+this.column+")"),null!==y.head&&k("Second element at ("+this.line+","+this.column+")"),y.head=new u,g.unshift(y.head);else if("styling"===e.local)g[0]instanceof u||k(r,"Parent of element is not at ("+this.line+","+this.column+")"),null!==y.head.styling&&k("Second element at ("+this.line+","+this.column+")"),y.head.styling=new l,g.unshift(y.head.styling);else if("style"===e.local){var d;g[0]instanceof l?((d=new c).initFromNode(e,r),d.id?y.head.styling.styles[d.id]=d:F(r,"