@flowplayer/player 3.8.1 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/plugins/dash.js CHANGED
@@ -1,5 +1,5 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.dash=t())}(this,(function(){"use strict";const e=["com.widevine.alpha","com.microsoft.playready","org.w3.clearkey"];function t(e){const{pathname:t}=function(e){const t=document.createElement("a");return t.href=e,t}(e);return t.endsWith(".mpd")}function n(n,r,i){return!(r.drm&&(!Object.keys(r.drm).some(t=>{return n=t,e.find((function(e){return e===n}));var n})||function(){const e="undefined"!=typeof document&&"undefined"!=typeof window,t=e?navigator.userAgent:"",n=/iP(hone|od)/i.test(t)&&!/iPad/.test(t)&&!/IEMobile/i.test(t),r=/Android/.test(t)&&!/Firefox/.test(t),i=/^((?!chrome|android).)*safari/i.test(t),a=/SamsungBrowser/.test(t),o=a&&/SMART-TV/.test(t);return{controls:!n,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:r,iphone:n,safari:i,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:a,samsung_tv:a&&o,touch:"ontouchstart"in window,tizen:"tizen"in window,webOS:"webos"in window}}().safari))&&("application/dash+xml"==r.type||t(n))}var r="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}function u(e){var t={exports:{}};return e(t,t.exports),t.exports}var l=u((function(e,t){!function(e){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={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},i={17:2,18:4,21:6,22:8,23:10,19:13,20:15},a={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},o={25:2,26:4,29:6,30:8,31:10,27:13,28:15},s=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u={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)}},l=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},f=function(e,t,n,r,i){this.foreground=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=r||"black",this.flash=i||!1};f.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var d=function(e,t,n,r,i,a){this.uchar=e||" ",this.penState=new f(t,n,r,i,a)};d.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(e,t){this.uchar=e,this.penState.copy(t)},setPenState:function(e){this.penState.copy(e)},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}};var c=function(){this.chars=[];for(var e=0;e<32;e++)this.chars.push(new d);this.pos=0,this.currPenState=new f};c.prototype={equals:function(e){for(var t=!0,n=0;n<32;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<32;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;t<32;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(u.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>32&&(u.log("ERROR","Too large cursor position "+this.pos),this.pos=32)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(e){e>=144&&this.backSpace();var t=n(e);this.pos>=32?u.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;t<32;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,n=0;n<32;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var h=function(){this.rows=[];for(var e=0;e<15;e++)this.rows.push(new c);this.currRow=14,this.nrRollUpRows=null,this.reset()};h.prototype={reset:function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,n=0;n<15;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){u.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){u.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var n=this.rows[this.currRow];if(null!==e.indent){var r=e.indent,i=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[i].penState.foreground}var a={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(a)},setBkgData:function(e){u.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){if(null!==this.nrRollUpRows){u.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),u.log("INFO","Rolling up")}else u.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t=[],n="",r=-1,i=0;i<15;i++){var a=this.rows[i].getTextString();a&&(r=i+1,e?t.push("Row "+r+': "'+a+'"'):t.push(a.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var g=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new h,this.nonDisplayedMemory=new h,this.lastOutputScreen=new h,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};g.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,u.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<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";u.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(u.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){u.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){u.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){u.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){u.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){u.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){u.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){u.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){u.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){u.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){u.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){u.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(u.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,u.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(e){u.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}u.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=u.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 p=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new g(1,t),new g(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}};p.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,u.setTime(e);for(var o=0;o<t.length;o+=2)if(r=127&t[o],i=127&t[o+1],r>=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB)this.lastCmdA=null,this.lastCmdB=null,u.log("DEBUG","Repeated command ("+l([r,i])+") is dropped");else if(0!==r||0!==i){if(u.log("DATA","["+l([t[o],t[o+1]])+"] -> ("+l([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)if(a=this.parseChars(r,i))if(this.currChNr&&this.currChNr>=0)this.channels[this.currChNr-1].insertChars(a);else u.log("WARNING","No channel found yet. TEXT-MODE?");n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,u.log("WARNING","Couldn't parse cleaned data "+l([r,i])+" orig: "+l([t[o],t[o+1]])))}else this.dataCounters.padding+=2},parseCmd:function(e,t){var n=null;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 u.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),u.log("DEBUG","MIDROW ("+l([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,s=null;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,s=64<=t&&t<=95?1===n?r[e]:a[e]:1===n?i[e]:o[e];var u=this.interpretPAC(s,t);return this.channels[n-1].setPAC(u),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n=t,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=t;o=17===a?t+80:18===a?t+112:t+144,u.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=l(i);u.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=s[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<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}};e.logger=u,e.PenState=f,e.CaptionScreen=h,e.Cea608Parser=p,e.findCea608Nalus=function(e,t,n){for(var r=0,i=t,a=[],o=function(e,t,n,r){if(4!==e||t<8)return null;var i=n.getUint8(r),a=n.getUint16(r+1),o=n.getUint32(r+3),s=n.getUint8(r+7);return 181==i&&49==a&&1195456820==o&&3==s};i<t+n;){if(r=e.getUint32(i),6===(31&e.getUint8(i+4)))for(var s=i+5,u=-1;s<i+4+r-1;){u=0;for(var l=255;255===l;)u+=l=e.getUint8(s),s++;var f=0;for(l=255;255===l;)f+=l=e.getUint8(s),s++;o(u,f,e,s)&&a.push([s,f]),s+=f}i+=r+4}return a},e.extractCea608DataFromRange=function(e,t){var n=t[0],r=[[],[]];n+=8;var i=31&e.getUint8(n);n+=2;for(var a=0;a<i;a++){var o=e.getUint8(n),s=4&o,u=3&o;n++;var l=e.getUint8(n);n++;var f=e.getUint8(n);n++,s&&(127&l)+(127&f)!=0&&(0===u?(r[0].push(l),r[0].push(f)):1===u&&(r[1].push(l),r[1].push(f)))}return r}}(t)})),f=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var d=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()}return f(e,[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.FRAGMENTED_TEXT="fragmentedText",this.EMBEDDED_TEXT="embeddedText",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",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.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.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_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_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"}}]),e}()),c=Object.defineProperty({default:d},"__esModule",{value:!0}),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var g=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()}return h(e,[{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.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.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.PATCH_LOCATION="PatchLocation",this.PUBLISH_TIME="publishTime",this.ORIGINAL_PUBLISH_TIME="originalPublishTime",this.ORIGINAL_MPD_ID="mpdId"}}]),e}()),p=Object.defineProperty({default:g},"__esModule",{value:!0}),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var _=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()}return m(e,[{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"}}]),e}()),E=Object.defineProperty({default:_},"__esModule",{value:!0}),y=function(){var e=void 0,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=void 0,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=void 0;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)}}}(),v=Object.defineProperty({default:y},"__esModule",{value:!0}),T=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var A,S=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return T(e,[{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])}}}]),e}(),b=Object.defineProperty({default:S},"__esModule",{value:!0});var I=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.AST_IN_FUTURE="astInFuture",e.BUFFER_EMPTY="bufferStalled",e.BUFFER_LOADED="bufferLoaded",e.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",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_COMPLETED="periodSwitchCompleted",e.PERIOD_SWITCH_STARTED="periodSwitchStarted",e.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",e.QUALITY_CHANGE_RENDERED="qualityChangeRendered",e.TRACK_CHANGE_RENDERED="trackChangeRendered",e.SOURCE_INITIALIZED="sourceInitialized",e.STREAM_INITIALIZING="streamInitializing",e.STREAM_UPDATED="streamUpdated",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.PLAYBACK_ENDED="playbackEnded",e.PLAYBACK_ERROR="playbackError",e.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",e.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",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_SEEK_ASKED="playbackSeekAsked",e.PLAYBACK_STALLED="playbackStalled",e.PLAYBACK_STARTED="playbackStarted",e.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",e.PLAYBACK_WAITING="playbackWaiting",e.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",e.GAP_CAUSED_SEEK_TO_PERIOD_END="gapCausedSeekToPeriodEnd",e.GAP_CAUSED_INTERNAL_SEEK="gapCausedInternalSeek",e.EVENT_MODE_ON_START="eventModeOnStart",e.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",e.CONFORMANCE_VIOLATION="conformanceViolation",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((A=b)&&A.__esModule?A:{default:A}).default)),R=Object.defineProperty({default:I},"__esModule",{value:!0}),w=M(v),N=M(R);function M(e){return e&&e.__esModule?e:{default:e}}function C(){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}return{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===N.default.EVENT_MODE_ON_RECEIVE)))})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}}}C.__dashjs_factory_name="EventBus";var D=w.default.getSingletonFactory(C);D.EVENT_PRIORITY_LOW=0,D.EVENT_PRIORITY_HIGH=5e3,w.default.updateSingletonFactory(C.__dashjs_factory_name,D);var O=D,P=Object.defineProperty({default:O},"__esModule",{value:!0});var L=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",e.BUFFERING_COMPLETED="bufferingCompleted",e.BUFFER_CLEARED="bufferCleared",e.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",e.BYTES_APPENDED="bytesAppended",e.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",e.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",e.CURRENT_TRACK_CHANGED="currentTrackChanged",e.DATA_UPDATE_COMPLETED="dataUpdateCompleted",e.DATA_UPDATE_STARTED="dataUpdateStarted",e.INBAND_EVENTS="inbandEvents",e.INITIALIZATION_LOADED="initializationLoaded",e.INIT_FRAGMENT_LOADED="initFragmentLoaded",e.INIT_FRAGMENT_NEEDED="initFragmentNeeded",e.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",e.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",e.LIVE_EDGE_SEARCH_COMPLETED="liveEdgeSearchCompleted",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.REPRESENTATION_UPDATE_STARTED="representationUpdateStarted",e.REPRESENTATION_UPDATE_COMPLETED="representationUpdateCompleted",e.SEGMENTS_LOADED="segmentsLoaded",e.SERVICE_LOCATION_BLACKLIST_ADD="serviceLocationBlacklistAdd",e.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",e.SOURCEBUFFER_REMOVE_COMPLETED="sourceBufferRemoveCompleted",e.STREAMS_COMPOSED="streamsComposed",e.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",e.STREAM_COMPLETED="streamCompleted",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.SEGMENTBASE_INIT_REQUEST_NEEDED="segmentBaseInitRequestNeeded",e.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED="segmentBaseSegmentsListRequestNeeded",e.SEEK_TARGET="seekTarget",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(b).default);function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var U=new(function(e){function t(){return F(this,t),x(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(Object.defineProperty({default:L},"__esModule",{value:!0})).default)),B=Object.defineProperty({default:U},"__esModule",{value:!0}),k=Y(P),G=Y(B),j=Y(v);function Y(e){return e&&e.__esModule?e:{default:e}}var q=1,H=2,K=3,V=4,z=5;function W(e){e=e||{};var t,n=this.context,r=(0,k.default)(n).getInstance(),i=e.settings,a=[],o=void 0,s=void 0,u=void 0;function l(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function f(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];p.apply(void 0,[q,this].concat(t))}function d(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];p.apply(void 0,[H,this].concat(t))}function c(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];p.apply(void 0,[K,this].concat(t))}function h(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];p.apply(void 0,[V,this].concat(t))}function g(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];p.apply(void 0,[z,this].concat(t))}function p(e,t){var n="",l=null;o&&(l=(new Date).getTime(),n+="["+(l-u)+"]"),s&&t&&t.getClassName&&(n+="["+t.getClassName()+"]",t.getType&&(n+="["+t.getType()+"]")),n.length>0&&(n+=" ");for(var f=arguments.length,d=Array(f>2?f-2:0),c=2;c<f;c++)d[c-2]=arguments[c];Array.apply(null,d).forEach((function(e){n+=e+" "})),a[e]&&i.get().debug.logLevel>=e&&a[e](n),i&&i.get().debug.dispatchEvent&&r.trigger(G.default.LOG,{message:n,level:e})}return t={getLogger:function(e){return{fatal:f.bind(e),error:d.bind(e),warn:c.bind(e),info:h.bind(e),debug:g.bind(e)}},setLogTimestampVisible:function(e){o=e},setCalleeNameVisible:function(e){s=e}},o=!0,s=!0,u=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(a[q]=l(window.console.error),a[H]=l(window.console.error),a[K]=l(window.console.warn),a[V]=l(window.console.info),a[z]=l(window.console.debug)),t}W.__dashjs_factory_name="Debug";var X=j.default.getSingletonFactory(W);X.LOG_LEVEL_NONE=0,X.LOG_LEVEL_FATAL=q,X.LOG_LEVEL_ERROR=H,X.LOG_LEVEL_WARNING=K,X.LOG_LEVEL_INFO=V,X.LOG_LEVEL_DEBUG=z,j.default.updateSingletonFactory(W.__dashjs_factory_name,X);var Q=X,Z=Object.defineProperty({default:Q},"__esModule",{value:!0}),$=ie(c),J=ie(E),ee=ie(P),te=ie(B),ne=ie(v),re=ie(Z);function ie(e){return e&&e.__esModule?e:{default:e}}function ae(){var e=this.context,t=(0,ee.default)(e).getInstance(),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0;function R(e){if(!l||!isNaN(f)){var n=f;if(isNaN(n))if(g){n=e.liveStartTime;var i=a.getCurrentDVRInfo(),o=i?i.range:null;if(o){var u=j(!0);isNaN(u)||(r.info("Start time from URI parameters: "+u),n=Math.max(Math.min(n,u),o.start))}}else{n=h.start;var d=j(!1);!isNaN(d)&&d<n+h.duration&&(r.info("Start time from URI parameters: "+d),n=Math.max(n,d))}isNaN(n)||n===s.getTime()||(t.trigger(te.default.PLAYBACK_SEEKING,{seekTime:n}),P(n,!1,!0))}}function w(){return parseFloat((N()-L()).toFixed(5))}function N(){return h.start+h.duration}function M(){h&&s&&s.getElement()?s.play():m=!0}function C(){return h&&s?s.isPaused():null}function D(){h&&s&&s.pause()}function O(){return h&&s?s.isSeeking():null}function P(e,n,i){h&&s&&(e!==(isNaN(y)?s.getTime():y)&&((v=!0===i)||(y=e,t.trigger(te.default.PLAYBACK_SEEK_ASKED)),r.info("Requesting seek to time: "+e+(v?" (internal)":"")),s.setCurrentTime(e,n)))}function L(){return h&&s?s.getTime():null}function F(){var e=L();if(g&&!isNaN(E)){var t=E/1e3;e>t&&(e-=t)}return e}function x(){return h&&s?s.getPlaybackRate():null}function U(){return h&&s?s.getEnded():null}function B(){return g}function k(){if(!g||isNaN(E))return NaN;var e=F();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*u.getClientTimeOffset();return Math.max(((t-E-1e3*e)/1e3).toFixed(3),0)}function G(){m=!1,l=!1,f=NaN,c=0,E=0,y=NaN,s&&(t.off(te.default.STREAM_INITIALIZED,R,this),t.off(te.default.DATA_UPDATE_COMPLETED,K,this),t.off(te.default.BUFFER_LEVEL_STATE_CHANGED,_e,this),t.off(te.default.LOADING_PROGRESS,me,this),t.off(te.default.PLAYBACK_PROGRESS,de,this),t.off(te.default.PLAYBACK_TIME_UPDATED,de,this),t.off(te.default.PLAYBACK_ENDED,le,this),t.off(te.default.STREAM_INITIALIZING,ye,this),q(),s.removeEventListener("canplay",V),s.removeEventListener("play",z),s.removeEventListener("waiting",W),s.removeEventListener("playing",X),s.removeEventListener("pause",Q),s.removeEventListener("error",fe),s.removeEventListener("seeking",Z),s.removeEventListener("seeked",ne),s.removeEventListener("timeupdate",ie),s.removeEventListener("progress",ae),s.removeEventListener("ratechange",oe),s.removeEventListener("loadedmetadata",se),s.removeEventListener("stalled",Ee),s.removeEventListener("ended",ue)),d=null,s=null,h=null,g=null}function j(e){var t=b.getURIFragmentData();if(!t||!t.t)return NaN;var n=i.getStreams()[0].getStreamInfo().start;t.t=t.t.split(",")[0];var r=-1!==t.t.indexOf("posix:")?"now"===t.t.substring(6)?Date.now()/1e3:parseInt(t.t.substring(6)):NaN;return e&&!isNaN(r)?r-E/1e3:parseInt(t.t)+n}function Y(){if(null===d){d=setInterval((function(){var e;t.trigger(te.default.WALLCLOCK_TIME_UPDATED,{isDynamic:g,time:new Date}),B()&&C()&&(e=Date.now(),(!_||e>_+500)&&(_=e,ie()))}),I.get().streaming.wallclockTimeUpdateInterval)}}function q(){clearInterval(d),d=null}function H(e){if(!C()&&g&&0!==s.getReadyState()){var t=F(),n=function(e,t){var n=a.getCurrentDVRInfo(t),i=n?n.range:null;return i?(r.debug("Checking DVR window for at "+e+" with DVR window range "+i.start+" - "+i.end),e>i.end?Math.max(i.end-c,i.start):e>0&&e+.25<i.start&&Math.abs(e-i.start)<31536e4?i.start:e):NaN}(t,e);!isNaN(n)&&n!==t&&!O()&&(r.debug("UpdateCurrentTime: Seek to actual time: "+n+" from currentTime: "+t),P(n))}}function K(e){if(!e.error){var t=o.convertDataToRepresentationInfo(e.currentRepresentation),n=t?t.mediaInfo.streamInfo:null;null!==n&&h.id===n.id&&(h=n,H())}}function V(){t.trigger(te.default.CAN_PLAY)}function z(){r.info("Native video element event: play"),H(),Y(),t.trigger(te.default.PLAYBACK_STARTED,{startTime:L()})}function W(){r.info("Native video element event: waiting"),t.trigger(te.default.PLAYBACK_WAITING,{playingTime:L()})}function X(){r.info("Native video element event: playing"),t.trigger(te.default.PLAYBACK_PLAYING,{playingTime:L()})}function Q(){r.info("Native video element event: pause"),t.trigger(te.default.PLAYBACK_PAUSED,{ended:U()})}function Z(){if(v)v=!1;else{var e=L();isNaN(y)||y===e||(e=y),y=NaN,r.info("Seeking to: "+e),Y(),t.trigger(te.default.PLAYBACK_SEEKING,{seekTime:e})}}function ne(){r.info("Native video element event: seeked"),t.trigger(te.default.PLAYBACK_SEEKED)}function ie(){h&&t.trigger(te.default.PLAYBACK_TIME_UPDATED,{timeToEnd:w(),time:L()})}function ae(){t.trigger(te.default.PLAYBACK_PROGRESS)}function oe(){var e=x();r.info("Native video element event: ratechange: ",e),t.trigger(te.default.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function se(){r.info("Native video element event: loadedmetadata"),t.trigger(te.default.PLAYBACK_METADATA_LOADED),Y()}function ue(){r.info("Native video element event: ended"),D(),q();var e=i?i.getActiveStreamInfo():null;e&&t.trigger(te.default.PLAYBACK_ENDED,{isLast:e.isLast})}function le(e){if(d&&e.isLast){r.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var t=e.seekTime?e.seekTime:N();s.setCurrentTime(t),D(),q()}}function fe(e){var n=e.target||e.srcElement;t.trigger(te.default.PLAYBACK_ERROR,{error:n.error})}function de(){g&&ce()&&I.get().streaming.liveCatchup.playbackRate>0&&!C()&&!O()&&(function(){try{if(ce()&&I.get().streaming.liveCatchup.playbackRate>0&&L()>0){var e=ge(),t=k(),n=p.getLiveDelay(),r=p.getLiveCatchupLatencyThreshold(),i=I.get().streaming.liveCatchup.minDrift;if(e===$.default.LIVE_CATCHUP_MODE_LOLP){var a=he(),o=I.get().streaming.liveCatchup.playbackBufferMin;return function(e,t,n,r,i,a){try{var o=Math.abs(e-t);return(isNaN(a)||e<=a)&&(o>n||r<i)}catch(e){return!1}}(t,n,i,a,o,r)}return function(e,t,n,r){try{return Math.abs(e-t)>r&&(isNaN(n)||e<=n)}catch(e){return!1}}(t,n,r,i)}}catch(e){return!1}}()?function(){if(s){var e=void 0,t=s.getPlaybackRate(),n=I.get().streaming.liveCatchup.playbackRate,i=k(),o=p.getLiveDelay(),u=he();if(ge()===$.default.LIVE_CATCHUP_MODE_LOLP){I.get().streaming.liveCatchup.minDrift;var l=I.get().streaming.liveCatchup.playbackBufferMin;e=function(e,t,n,i,a,o,s){var u=e,l=void 0;if(o<a){var f=5*(o-a),d=2*u/(1+Math.pow(Math.E,-f));l=1-u+d,r.debug("[LoL+ playback control_buffer-based] bufferLevel: "+o+", newRate: "+l)}else{if(Math.abs(t-n)<=.02*n)l=1;else{var c=5*(t-n),h=2*u/(1+Math.pow(Math.E,-c));l=1-u+h}r.debug("[LoL+ playback control_latency-based] latency: "+t+", newRate: "+l)}A&&o>n/2&&(A=!1);Math.abs(s-l)<=S&&(l=null);return{newRate:l}}(n,i,o,0,l,u,t)}else e=function(e,t,n,r,i){var a=e,o=t-n,s=5*o,u=2*a/(1+Math.pow(Math.E,-s)),l=1-a+u;A&&(r>n/2?A=!1:o>0&&(l=1));Math.abs(i-l)<=S&&(l=null);return{newRate:l}}(n,i,o,u,t);var f=e.newRate;f&&s.setPlaybackRate(f);var d=i-o;I.get().streaming.liveCatchup.maxDrift>0&&!T&&d>I.get().streaming.liveCatchup.maxDrift?(r.info("Low Latency catchup mechanism. Latency too high, doing a seek to live point"),T=!0,P(((c=a.getCurrentDVRInfo())?c.range:null).end-p.getLiveDelay(),!0,!1)):T=!1}var c}():pe())}function ce(){return I.get().streaming.liveCatchup.enabled||I.get().streaming.lowLatencyEnabled}function he(){var e=null;return i.getActiveStreamProcessors().forEach((function(t){var n=t.getBufferLevel();e=null===e?n:Math.min(e,n)})),e}function ge(){var e=I.get().streaming.liveCatchup.playbackBufferMin;return I.get().streaming.liveCatchup.mode!==$.default.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?$.default.LIVE_CATCHUP_MODE_DEFAULT:$.default.LIVE_CATCHUP_MODE_LOLP}function pe(){s&&s.setPlaybackRate(1)}function me(e){if(!1===e.stream&&I.get().streaming.lowLatencyEnabled&&!isNaN(e.request.duration)){var t=1.2*e.request.duration;if(t>p.getLiveDelay()){r.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",t.toFixed(2));var n={streaming:{liveDelay:t}};I.update(n)}}}function _e(e){e.streamId===h.id&&(ce()?e.state!==J.default.BUFFER_EMPTY||O()||A||(A=!0,pe()):s.setStallState(e.mediaType,e.state===J.default.BUFFER_EMPTY))}function Ee(e){t.trigger(te.default.PLAYBACK_STALLED,{e:e})}function ye(e){!function(e,t){if(e&&e.manifestInfo&&e.manifestInfo.serviceDescriptions){for(var n=void 0,i=0;i<e.manifestInfo.serviceDescriptions.length;i++){var a=e.manifestInfo.serviceDescriptions[i];if(a.schemeIdUri===$.default.SERVICE_DESCRIPTION_LL_SCHEME){n=a;break}}n&&t&&t.supplementalProperties&&"true"===t.supplementalProperties[$.default.SUPPLEMENTAL_PROPERTY_LL_SCHEME]&&(n.latency&&n.latency.target>0&&(r.debug("Apply LL properties coming from service description. Target Latency (ms):",n.latency.target),I.update({streaming:{lowLatencyEnabled:!0,liveDelay:n.latency.target/1e3,liveCatchup:{minDrift:n.latency.max>n.latency.target?(n.latency.max-n.latency.target)/1e3:void 0}}})),n.playbackRate&&n.playbackRate.max>1&&(r.debug("Apply LL properties coming from service description. Max PlaybackRate:",n.playbackRate.max),I.update({streaming:{lowLatencyEnabled:!0,liveCatchup:{playbackRate:n.playbackRate.max-1}}})))}}(e.streamInfo,e.mediaInfo)}return n={initialize:function(e,n,r){h=e,s.addEventListener("canplay",V),s.addEventListener("play",z),s.addEventListener("waiting",W),s.addEventListener("playing",X),s.addEventListener("pause",Q),s.addEventListener("error",fe),s.addEventListener("seeking",Z),s.addEventListener("seeked",ne),s.addEventListener("timeupdate",ie),s.addEventListener("progress",ae),s.addEventListener("ratechange",oe),s.addEventListener("loadedmetadata",se),s.addEventListener("stalled",Ee),s.addEventListener("ended",ue),g=h.manifestInfo.isDynamic,T=!1,A=!1,l=!0===n,f=r,v=!1;var i="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",a=/safari/.test(i)&&!/chrome/.test(i);S=a?.25:.02,t.on(te.default.STREAM_INITIALIZED,R,this),t.on(te.default.DATA_UPDATE_COMPLETED,K,this),t.on(te.default.LOADING_PROGRESS,me,this),t.on(te.default.BUFFER_LEVEL_STATE_CHANGED,_e,this),t.on(te.default.PLAYBACK_PROGRESS,de,this),t.on(te.default.PLAYBACK_TIME_UPDATED,de,this),t.on(te.default.PLAYBACK_ENDED,le,this,{priority:ee.default.EVENT_PRIORITY_HIGH}),t.on(te.default.STREAM_INITIALIZING,ye,this),m&&(m=!1,M())},setConfig:function(e){e&&(e.streamController&&(i=e.streamController),e.dashMetrics&&(a=e.dashMetrics),e.mediaPlayerModel&&(p=e.mediaPlayerModel),e.adapter&&(o=e.adapter),e.videoModel&&(s=e.videoModel),e.timelineConverter&&(u=e.timelineConverter),e.uriFragmentModel&&(b=e.uriFragmentModel),e.settings&&(I=e.settings))},getStartTimeFromUriParameters:j,getTimeToStreamEnd:w,getTime:L,getNormalizedTime:F,getPlaybackRate:x,getPlayedRanges:function(){return h&&s?s.getPlayedRanges():null},getEnded:U,getIsDynamic:B,getStreamController:function(){return i},computeAndSetLiveDelay:function(e,t,n){var r,i=void 0,a=void 0,s=!isNaN(e)&&isFinite(e)?e:NaN,u=o.getSuggestedPresentationDelay();if(i=I.get().streaming.lowLatencyEnabled?0:p.getLiveDelay()?p.getLiveDelay():null===I.get().streaming.liveDelayFragmentCount||isNaN(I.get().streaming.liveDelayFragmentCount)||isNaN(s)?!0===I.get().streaming.useSuggestedPresentationDelay&&null!==u&&!isNaN(u)&&u>0?u:isNaN(s)?isNaN(n)?4*h.manifestInfo.minBufferTime:4*n:4*s:s*I.get().streaming.liveDelayFragmentCount,null!==(r=o.getAvailabilityStartTime())&&(E=r),t>0){var l=Math.max(t-10,t/2);a=Math.min(i,l)}else a=i;return c=a,a},getLiveDelay:function(){return c},setLiveDelay:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&e<c||(c=e)},getCurrentLiveLatency:k,play:M,isPaused:C,pause:D,isSeeking:O,getStreamEndTime:N,seek:P,updateCurrentTime:H,reset:G},r=(0,re.default)(e).getInstance().getLogger(n),G(),n}ae.__dashjs_factory_name="PlaybackController";var oe=ne.default.getSingletonFactory(ae),se=Object.defineProperty({default:oe},"__esModule",{value:!0});function ue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var le=function e(){ue(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._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null};le.GET="GET",le.HEAD="HEAD",le.MPD_TYPE="MPD",le.XLINK_EXPANSION_TYPE="XLinkExpansion",le.INIT_SEGMENT_TYPE="InitializationSegment",le.INDEX_SEGMENT_TYPE="IndexSegment",le.MEDIA_SEGMENT_TYPE="MediaSegment",le.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",le.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",le.LICENSE="license",le.OTHER_TYPE="other";var fe=le,de=function e(){ue(this,e),this.s=null,this.d=null,this.b=[]},ce=Object.defineProperty({HTTPRequest:fe,HTTPRequestTrace:de},"__esModule",{value:!0}),he=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var ge=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=e.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaStartTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=t||null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer",this.representationId=null}return he(e,[{key:"isInitializationRequest",value:function(){return this.type&&this.type===ce.HTTPRequest.INIT_SEGMENT_TYPE}},{key:"setInfo",value:function(e){this.type=e&&e.init?ce.HTTPRequest.INIT_SEGMENT_TYPE:ce.HTTPRequest.MEDIA_SEGMENT_TYPE,this.url=e&&e.url?e.url:null,this.range=e&&e.range?e.range.start+"-"+e.range.end:null,this.mediaType=e&&e.mediaType?e.mediaType:null}}]),e}();ge.ACTION_DOWNLOAD="download",ge.ACTION_COMPLETE="complete";var pe=ge,me=Object.defineProperty({default:pe},"__esModule",{value:!0}),_e=ye(v),Ee=ye(me);function ye(e){return e&&e.__esModule?e:{default:e}}function ve(e){var t=(e=e||{}).eventBus,n=e.events,r=e.dashMetrics,i=e.fragmentLoader,a=e.debug,o=e.streamInfo,s=e.type,u=void 0,l=void 0,f=void 0,d=void 0;function c(e){var t;return!!e&&(t=!1,f.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===Ee.default.ACTION_COMPLETE&&e.action===t.action}(e,n))return t=!0;var r,i})),t)}function h(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function g(e){f=f.filter((function(t){var n=h(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-n}))}function p(e,t){t<=e+.5||(f=f.filter((function(n){var r=h(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r})))}function m(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)?h(i):n,!isNaN(a)&&!isNaN(o)&&t+n>=a&&t-n<o||isNaN(a)&&isNaN(t))return i}return null}function _(e,t){r.addSchedulingInfo(e,t),r.addRequestsQueue(e.mediaType,d,f)}function E(e){e.sender===i&&(d.splice(d.indexOf(e.request),1),e.response&&!e.error&&f.push(e.request),_(e.request,e.error?"failed":"executed"),t.trigger(n.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:o.id,mediaType:s}))}function y(e){e.sender===i&&t.trigger(n.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:o.id,mediaType:s})}function v(e){e.sender===i&&t.trigger(n.FRAGMENT_LOADING_ABANDONED,{request:e.request},{streamId:o.id,mediaType:s})}function T(){f=[],d=[]}return u={getStreamId:function(){return o.id},getType:function(){return s},getRequests:function(e){var t=e?e.state instanceof Array?e.state:[e.state]:[],n=[];return t.forEach((function(t){var r=function(e){var t=void 0;switch(e){case"loading":t=d;break;case"executed":t=f;break;default:t=[]}return t}(t);n=n.concat(function(e,t){if(t.hasOwnProperty("time"))return[m(e,t.time,t.threshold)];return e.filter((function(e){for(var n in t)if("state"!==n&&t.hasOwnProperty(n)&&e[n]!=t[n])return!1;return!0}))}(r,e))})),n},isFragmentLoaded:c,isFragmentLoadedOrPending:function(e){var t=!1,n=0,r=void 0;if(!(t=c(e)))for(n=0;n<d.length;n++)r=d[n],e.url===r.url&&e.startTime===r.startTime&&(t=!0);return t},removeExecutedRequestsBeforeTime:g,removeExecutedRequestsAfterTime:function(e){f=f.filter((function(t){return isNaN(t.startTime)||void 0!==e&&t.startTime<e}))},syncExecutedRequestsWithBufferedRange:function(e,t){if(e&&0!==e.length){for(var n=0,r=0,i=e.length;r<i;r++)p(n,e.start(r)),n=e.end(r);t>0&&p(n,t)}else g()},abortRequests:function(){l.debug("abort requests"),i.abort(),d=[]},executeRequest:function(e){switch(e.action){case Ee.default.ACTION_COMPLETE:f.push(e),_(e,"executed"),l.debug("STREAM_COMPLETED"),t.trigger(n.STREAM_COMPLETED,{request:e},{streamId:e.mediaInfo.streamInfo.id,mediaType:e.mediaType});break;case Ee.default.ACTION_DOWNLOAD:_(e,"loading"),d.push(e),function(e){t.trigger(n.FRAGMENT_LOADING_STARTED,{request:e},{streamId:o.id,mediaType:s}),i.load(e)}(e);break;default:l.warn("Unknown request action.")}},reset:function(){t.off(n.LOADING_COMPLETED,E,this),t.off(n.LOADING_DATA_PROGRESS,y,this),t.off(n.LOADING_ABANDONED,v,this),i&&i.reset(),T()},addExecutedRequest:function(e){f.push(e)}},l=a.getLogger(u),T(),t.on(n.LOADING_COMPLETED,E,u),t.on(n.LOADING_DATA_PROGRESS,y,u),t.on(n.LOADING_ABANDONED,v,u),u}ve.__dashjs_factory_name="FragmentModel";var Te=_e.default.getClassFactory(ve);Te.FRAGMENT_MODEL_LOADING="loading",Te.FRAGMENT_MODEL_EXECUTED="executed",Te.FRAGMENT_MODEL_CANCELED="canceled",Te.FRAGMENT_MODEL_FAILED="failed",_e.default.updateClassFactory(ve.__dashjs_factory_name,Te);var Ae=Te,Se=Object.defineProperty({default:Ae},"__esModule",{value:!0});var be=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},Ie=Object.defineProperty({default:be},"__esModule",{value:!0});var Re=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.captionData=null,this.label=null,this.lang=null,this.defaultTrack=!1,this.kind=null,this.isFragmented=!1,this.isEmbedded=!1},we=Object.defineProperty({default:Re},"__esModule",{value:!0}),Ne=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Me=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<t.boxes.length;n++)this.boxes.push(new e(t.boxes[n]));switch(this.isComplete=!0,t.type){case"sidx":if(this.timescale=t.timescale,this.earliest_presentation_time=t.earliest_presentation_time,this.first_offset=t.first_offset,this.references=t.references,t.references){this.references=[];for(var r=0;r<t.references.length;r++){var i={reference_type:t.references[r].reference_type,referenced_size:t.references[r].referenced_size,subsegment_duration:t.references[r].subsegment_duration};this.references.push(i)}}break;case"emsg":this.id=t.id,this.version=1===t.version?1:0,this.value=t.value,this.timescale=t.timescale,this.scheme_id_uri=t.scheme_id_uri,this.presentation_time_delta=1===t.version?t.presentation_time:t.presentation_time_delta,this.event_duration=t.event_duration,this.message_data=t.message_data;break;case"mdhd":this.timescale=t.timescale;break;case"mfhd":this.sequence_number=t.sequence_number;break;case"subs":this.entry_count=t.entry_count,this.entries=t.entries;break;case"tfhd":this.base_data_offset=t.base_data_offset,this.sample_description_index=t.sample_description_index,this.default_sample_duration=t.default_sample_duration,this.default_sample_size=t.default_sample_size,this.default_sample_flags=t.default_sample_flags,this.flags=t.flags;break;case"tfdt":this.version=t.version,this.baseMediaDecodeTime=t.baseMediaDecodeTime,this.flags=t.flags;break;case"trun":if(this.sample_count=t.sample_count,this.first_sample_flags=t.first_sample_flags,this.data_offset=t.data_offset,this.flags=t.flags,this.samples=t.samples,t.samples){this.samples=[];for(var a=0,o=t.samples.length;a<o;a++){var s={sample_size:t.samples[a].sample_size,sample_duration:t.samples[a].sample_duration,sample_composition_time_offset:t.samples[a].sample_composition_time_offset};this.samples.push(s)}}}}return Ne(e,[{key:"getChildBox",value:function(e){for(var t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}},{key:"getChildBoxes",value:function(e){for(var t=[],n=0;n<this.boxes.length;n++)this.boxes[n].type===e&&t.push(this.boxes[n]);return t}}]),e}(),Ce=Oe(Object.defineProperty({default:Me},"__esModule",{value:!0})),De=Oe(v);function Oe(e){return e&&e.__esModule?e:{default:e}}function Pe(){var e=void 0;function t(t){var r=[];if(!t||!e||"function"!=typeof e.fetchAll)return r;for(var i=e.fetchAll(t),a=void 0,o=0,s=i.length;o<s;o++)(a=n(i[o]))&&r.push(a);return r}function n(e){if(!e)return null;var t=new Ce.default(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}return{getBox:function(t){return t&&e&&e.boxes&&0!==e.boxes.length&&"function"==typeof e.fetch?n(e.fetch(t)):null},getBoxes:t,setData:function(t){e=t},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;var n=t(e.boxes[e.boxes.length-1].type);return n.length>0?n[n.length-1]:null}}}Pe.__dashjs_factory_name="IsoFile";var Le=De.default.getClassFactory(Pe),Fe=Object.defineProperty({default:Le},"__esModule",{value:!0}),xe=u((function(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<e.byteLength;){var a=e.getUint8(i++);a<128||(a<224?(a=(31&a)<<6,a|=63&e.getUint8(i++)):a<240?(a=(15&a)<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++)):(a=(7&a)<<18,a|=(63&e.getUint8(i++))<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++))),r.push(String.fromCharCode(a))}else for(;i<e.byteLength;)r.push(String.fromCharCode(e.getUint8(i++)));return r.join("")},n.Utils.utf8ToByteArray=function(e){var t,n;if("undefined"!=typeof TextEncoder)t=(new TextEncoder).encode(e);else for(t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>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<e.boxes.length;a++)if(r===e.boxes[a].type){i=a+1;break}}e.boxes.splice(i,0,t)}else e.boxes.push(t)},t.parseBuffer=n.parseBuffer,t.addBoxProcessor=n.addBoxProcessor,t.createFile=n.createFile,t.createBox=n.createBox,t.createFullBox=n.createFullBox,t.Utils=n.Utils,n.Cursor=function(e){this.offset=void 0===e?0:e};var r=function(e){this._cursor=new n.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};r.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},r.prototype.fetchAll=function(e,t){var n=[];return r._sweep.call(this,e,n,t),n},r.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=i.parse(this);if(void 0===e.type)break;this.boxes.push(e)}return this},r._sweep=function(e,t,n){for(var i in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;r._sweep.call(this.boxes[i],e,t,n)}},r.prototype.write=function(){var e,t=0;for(e=0;e<this.boxes.length;e++)t+=this.boxes[e].getLength(!1);var n=new Uint8Array(t);for(this._rawo=new DataView(n.buffer),this.bytes=n,this._cursor.offset=0,e=0;e<this.boxes.length;e++)this.boxes[e].write();return n.buffer},r.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)};var i=function(){this._cursor=new n.Cursor};i.parse=function(e){var t=new i;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},i.create=function(e){var t=new i;return t.type=e,t.boxes=[],t},i.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca"],i.prototype._boxProcessors={},i.prototype._procField=function(e,t,n){this._parsing?this[e]=this._readField(t,n):this._writeField(t,n,this[e])},i.prototype._procFieldArray=function(e,t,n,r){var i;if(this._parsing)for(this[e]=[],i=0;i<t;i++)this[e][i]=this._readField(n,r);else for(i=0;i<this[e].length;i++)this._writeField(n,r,this[e][i])},i.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},i.prototype._procEntries=function(e,t,n){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e].push({}),n.call(this,this[e][r]);else for(r=0;r<t;r++)n.call(this,this[e][r])},i.prototype._procSubEntries=function(e,t,n,r){var i;if(this._parsing)for(e[t]=[],i=0;i<n;i++)e[t].push({}),r.call(this,e[t][i]);else for(i=0;i<n;i++)r.call(this,e[t][i])},i.prototype._procEntryField=function(e,t,n,r){this._parsing?e[t]=this._readField(n,r):this._writeField(n,r,e[t])},i.prototype._procSubBoxes=function(e,t){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push(i.parse(this));else for(n=0;n<t;n++)this._rawo?this[e][n].write():this.size+=this[e][n].getLength()},i.prototype._readField=function(e,t){switch(e){case"uint":return this._readUint(t);case"int":return this._readInt(t);case"template":return this._readTemplate(t);case"string":return-1===t?this._readTerminatedString():this._readString(t);case"data":return this._readData(t);case"utf8":return this._readUTF8String();default:return-1}},i.prototype._readInt=function(e){var t=null,n=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(n);break;case 16:t=this._raw.getInt16(n);break;case 32:t=this._raw.getInt32(n);break;case 64:var r=this._raw.getInt32(n),i=this._raw.getInt32(n+4);t=r*Math.pow(2,32)+i}return this._cursor.offset+=e>>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;n<e;n++){var r=this._readUint(8);t+=String.fromCharCode(r)}return t},i.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/Math.pow(2,e/2)},i.prototype._readTerminatedString=function(){for(var e="";this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(0===t)break;e+=String.fromCharCode(t)}return e},i.prototype._readData=function(e){var t=e>0?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<this._raw.byteLength;)this.boxes.push(i.parse(this))},i.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)},i.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,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._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},i.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(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._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},i.prototype._writeInt=function(e,t){if(this._rawo){var n=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(n,t);break;case 16:this._rawo.setInt16(n,t);break;case 32:this._rawo.setInt32(n,t);break;case 64:var r=Math.floor(t/Math.pow(2,32)),i=t-r*Math.pow(2,32);this._rawo.setUint32(n,r),this._rawo.setUint32(n+4,i)}this._cursor.offset+=e>>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<e;n++)this._writeUint(8,t.charCodeAt(n))},i.prototype._writeTerminatedString=function(e){if(0!==e.length){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},i.prototype._writeTemplate=function(e,t){var n=Math.floor(t),r=(t-n)*Math.pow(2,e/2);this._writeUint(e/2,n),this._writeUint(e/2,r)},i.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,n=0;n<e.length;n++)this._rawo.setInt8(t+n,e[n]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},i.prototype._writeUTF8String=function(e){var t=n.Utils.utf8ToByteArray(e);if(this._rawo)for(var r=new DataView(this._rawo.buffer,this._cursor.offset,t.length),i=0;i<t.length;i++)r.setUint8(i,t[i]);else this.size+=t.length},i.prototype._writeField=function(e,t,n){switch(e){case"uint":this._writeUint(t,n);break;case"int":this._writeInt(t,n);break;case"template":this._writeTemplate(t,n);break;case"string":-1==t?this._writeTerminatedString(n):this._writeString(t,n);break;case"data":this._writeData(n);break;case"utf8":this._writeUTF8String(n)}},i.prototype._boxProcessors.avc1=i.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},i.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"segment_duration","uint",1===this.version?64:32),this._procEntryField(e,"media_time","int",1===this.version?64:32),this._procEntryField(e,"media_rate_integer","int",16),this._procEntryField(e,"media_rate_fraction","int",16)}))},i.prototype._boxProcessors.emsg=function(){this._procFullBox(),1==this.version?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},i.prototype._boxProcessors.free=i.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},i.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},i.prototype._boxProcessors.ftyp=i.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",e,"string",4)},i.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},i.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},i.prototype._boxProcessors.mdhd=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._parsing||"string"!=typeof this.language||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>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(){}}));var Ue=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},Be=Object.defineProperty({default:Ue},"__esModule",{value:!0}),ke=He(Z),Ge=He(Fe),je=He(v),Ye=He(xe),qe=He(Be);function He(e){return e&&e.__esModule?e:{default:e}}function Ke(){var e=void 0,t=void 0,n=this.context;function r(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=Ye.default.parseBuffer(e),r=(0,Ge.default)(n).create();return r.setData(t),r}function i(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function a(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:r,findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new qe.default(0,!1);for(var r=t instanceof ArrayBuffer?new Uint8Array(t):t,o=void 0,s=0;n<r.byteLength;){var u=i(r,n),l=a(r,n+4);if(0===u)break;n+u<=r.byteLength&&(e.indexOf(l)>=0?o=new qe.default(n,!0,u):s=n+u),n+=u}return o||new qe.default(s,!1)},getMediaTimescaleFromMoov:function(e){var t=r(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,i=r(e),a=i.getBoxes("moof"),o=i.getBoxes("mfhd"),s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0;n=i.getBoxes("moof").length,t=o[o.length-1].sequence_number,u=0,d=[];var T=-1,A=-1;for(m=0;m<a.length;m++){var S=a[m],b=S.getChildBoxes("traf");for(g=0;g<b.length;g++){var I=b[g],R=I.getChildBox("tfhd"),w=I.getChildBox("tfdt");f=w.baseMediaDecodeTime;var N=I.getChildBoxes("trun"),M=I.getChildBoxes("subs");for(p=0;p<N.length;p++){var C=N[p];for(u=C.sample_count,y=(R.base_data_offset||0)+(C.data_offset||0),h=0;h<u;h++){s=void 0!==(c=C.samples[h]).sample_duration?c.sample_duration:R.default_sample_duration,l=void 0!==c.sample_size?c.sample_size:R.default_sample_size;var D={dts:f,cts:f+(void 0!==c.sample_composition_time_offset?c.sample_composition_time_offset:0),duration:s,offset:S.offset+y,size:l,subSizes:[l]};if(M)for(_=0;_<M.length;_++){var O=M[_];if(T<O.entry_count-1&&h>A&&(T++,A+=O.entries[T].sample_delta),h==A){D.subSizes=[];var P=O.entries[T];for(E=0;E<P.subsample_count;E++)D.subSizes.push(P.subsamples[E].subsample_size)}}d.push(D),y+=l,f+=s}}v=f-w.baseMediaDecodeTime}}return{sampleList:d,lastSequenceNumber:t,totalDuration:v,numSequences:n}},findInitRange:function(t){var n=null,i=r(t);if(!i)return n;var a=i.getBox("ftyp"),o=i.getBox("moov");return e.debug("Searching for initialization."),o&&o.isComplete&&(n=(a?a.offset:o.offset)+"-"+(o.offset+o.size-1),e.debug("Found the initialization. Range: "+n)),n},parsePayload:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new qe.default(0,!1);for(var r=t instanceof ArrayBuffer?new Uint8Array(t):t,o=void 0,s=0;n<r.byteLength;){var u=i(r,n),l=a(r,n+4);if(0===u)break;n+u<=r.byteLength&&(e.indexOf(l)>=0?o=new qe.default(n,!0,u,l):s=n+u),n+=u}return o||new qe.default(s,!1)}},e=(0,ke.default)(n).getInstance().getLogger(t),t}Ke.__dashjs_factory_name="BoxParser";var Ve=je.default.getSingletonFactory(Ke),ze=Object.defineProperty({default:Ve},"__esModule",{value:!0}),We="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},Xe=function(e,t){if((void 0===e?"undefined":We(e))!==t)throw Je.default.BAD_ARGUMENT_ERROR},Qe=function(e){if(null===e||isNaN(e)||e%1!=0)throw Je.default.BAD_ARGUMENT_ERROR+" : argument is not an integer"},Ze=function(e,t,n){if(e<t||e>n)throw Je.default.BAD_ARGUMENT_ERROR+" : argument out of range"},$e=function(e){if("string"!=typeof e||e!==Je.default.AUDIO&&e!==Je.default.VIDEO)throw Je.default.BAD_ARGUMENT_ERROR},Je=function(e){return e&&e.__esModule?e:{default:e}}(c);var et=Object.defineProperty({checkParameterType:Xe,checkInteger:Qe,checkRange:Ze,checkIsVideoOrAudioType:$e},"__esModule",{value:!0}),tt=function(e){return e&&e.__esModule?e:{default:e}}(v);function nt(){return{customTimeRangeArray:[],length:0,add:function(e,t){var n=0;for(n=0;n<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n<this.customTimeRangeArray.length-1;n++)this.mergeRanges(n,n+1)&&n--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(e,t){for(var n=0;n<this.customTimeRangeArray.length;n++)if(e<=this.customTimeRangeArray[n].start&&t>=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end){this.customTimeRangeArray.splice(n+1,0,{start:t,end:this.customTimeRangeArray[n].end}),this.customTimeRangeArray[n].end=e;break}e>this.customTimeRangeArray[n].start&&e<this.customTimeRangeArray[n].end?this.customTimeRangeArray[n].end=e:t>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end&&(this.customTimeRangeArray[n].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){var n=this.customTimeRangeArray[e],r=this.customTimeRangeArray[t];return n.start<=r.start&&r.start<=n.end&&n.end<=r.end?(n.end=r.end,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&r.end<=n.end?(n.start=r.start,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&n.end<=r.end?(this.customTimeRangeArray.splice(e,1),!0):n.start<=r.start&&r.start<=n.end&&r.end<=n.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return(0,et.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return(0,et.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}nt.__dashjs_factory_name="CustomTimeRanges";var rt=tt.default.getClassFactory(nt),it=Object.defineProperty({default:rt},"__esModule",{value:!0}),at=u((function(e,t){!function(e){e.ns_tt="http://www.w3.org/ns/ttml",e.ns_tts="http://www.w3.org/ns/ttml#styling",e.ns_ttp="http://www.w3.org/ns/ttml#parameter",e.ns_xml="http://www.w3.org/XML/1998/namespace",e.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",e.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",e.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",e.ns_ebutts="urn:ebu:tt:style"}(t)})),ot=u((function(e,t){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var a,o=null,s=i[e.toLowerCase()];return void 0!==s?o=s:null!==(a=t.exec(e))?o=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),void 0!==a[4]?parseInt(a[4],16):255]:null!==(a=n.exec(e))?o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),255]:null!==(a=r.exec(e))&&(o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseInt(a[4])]),o};var a=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;e.parseLength=function(e){var t,n=null;return null!==(t=a.exec(e))&&(n={value:parseFloat(t[1]),unit:t[2]}),n},e.parseTextShadow=function(t){for(var n=t.match(/([^\(,\)]|\([^\)]+\))+/g),r=[],i=0;i<n.length;i++){var a=n[i].split(" ");if(1===a.length&&"none"===a[0])return"none";if(a.length>1&&a.length<5){var o=[null,null,null,null],s=e.parseLength(a.shift());if(null===s)return null;if(o[0]=s,null===(s=e.parseLength(a.shift())))return null;if(o[1]=s,0===a.length){r.push(o);continue}if(null!==(s=e.parseLength(a[0]))&&(o[2]=s,a.shift()),0===a.length){r.push(o);continue}var u=e.parseColor(a[0]);if(null===u)return null;o[3]=u,r.push(o)}}return r},e.parsePosition=function(t){var n=t.split(" "),r=function(e){return"center"===e||"left"===e||"top"===e||"bottom"===e||"right"===e};if(n.length>4)return null;for(var i=0;i<n.length;i++)if(!r(n[i])){var a=e.parseLength(n[i]);if(null===a)return null;n[i]=a}for(var o={h:{edge:"left",offset:{value:50,unit:"%"}},v:{edge:"top",offset:{value:50,unit:"%"}}},s=0;s<n.length;){var u=n[s++];if(r(u)){var l={value:0,unit:"%"};2!==n.length&&s<n.length&&!r(n[s])&&(l=n[s++]),"right"===u?(o.h.edge=u,o.h.offset=l):"bottom"===u?(o.v.edge=u,o.v.offset=l):"left"===u?o.h.offset=l:"top"===u&&(o.v.offset=l)}else{if(1!==n.length&&2!==n.length)return null;1===s?o.h.offset=u:o.v.offset=u}}return o},e.ComputedLength=function(e,t){this.rw=e,this.rh=t},e.ComputedLength.prototype.toUsedLength=function(e,t){return e*this.rw+t*this.rh},e.ComputedLength.prototype.isZero=function(){return 0===this.rw&&0===this.rh},e.toComputedLength=function(t,n,r,i,a,o){return"%"===n&&i?new e.ComputedLength(i.rw*t/100,i.rh*t/100):"em"===n&&r?new e.ComputedLength(r.rw*t,r.rh*t):"c"===n&&a?new e.ComputedLength(t*a.rw,t*a.rh):"px"===n&&o?new e.ComputedLength(t*o.rw,t*o.rh):"rh"===n?new e.ComputedLength(0,t/100):"rw"===n?new e.ComputedLength(t/100,0):null}}(t)})),st=u((function(e,t){!function(e,t,n){function r(e,t,n,r,i,a,o,s){this.name=t,this.ns=e,this.qname=e+" "+t,this.inherit=i,this.animatable=a,this.initial=n,this.applies=r,this.parse=o,this.compute=s}for(var i in e.all=[new r(t.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,n.parseColor,null),new r(t.ns_tts,"color","white",["span"],!0,!0,n.parseColor,null),new r(t.ns_tts,"direction","ltr",["p","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"displayAlign","before",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"extent","auto",["tt","region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,a){var o,s;if("auto"===i)o=new n.ComputedLength(0,1);else if(null===(o=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)s=new n.ComputedLength(1,0);else if(null===(s=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:o,w:s}})),new r(t.ns_tts,"fontFamily","default",["span","p"],!0,!0,(function(e){for(var t=e.split(","),n=[],r=0;r<t.length;r++)"'"!==t[r].charAt(0)&&'"'!==t[r].charAt(0)&&"default"===t[r]?n.push("monospaceSerif"):n.push(t[r]);return n}),null),new r(t.ns_tts,"shear","0%",["p"],!0,!0,n.parseLength,(function(e,t,n,r){return"%"!==r.unit?null:Math.abs(r.value)>100?100*Math.sign(r.value):r.value})),new r(t.ns_tts,"fontSize","1c",["span","p"],!0,!0,n.parseLength,(function(t,r,i,a,o){return n.toComputedLength(a.value,a.unit,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,t.cellLength.h,t.pxLength.h)})),new r(t.ns_tts,"fontStyle","normal",["span","p"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"fontWeight","normal",["span","p"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"lineHeight","normal",["p"],!0,!0,(function(e){return"normal"===e?e:n.parseLength(e)}),(function(t,r,i,a,o){var s;if("normal"===a)s=a;else if(null===(s=n.toComputedLength(a.value,a.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h)))return null;return s})),new r(t.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new r(t.ns_tts,"origin","auto",["region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,a){var o,s;if("auto"===i)o=new n.ComputedLength(0,0);else if(null===(o=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)s=new n.ComputedLength(0,0);else if(null===(s=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:o,w:s}})),new r(t.ns_tts,"overflow","hidden",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"padding","0px",["region"],!1,!0,(function(e){var t=e.split(" ");if(t.length>4)return null;for(var r=[],i=0;i<t.length;i++){var a=n.parseLength(t[i]);if(!a)return null;r.push(a)}return r}),(function(t,r,i,a,o){var s;if(1===a.length)s=[a[0],a[0],a[0],a[0]];else if(2===a.length)s=[a[0],a[1],a[0],a[1]];else if(3===a.length)s=[a[0],a[1],a[2],a[1]];else{if(4!==a.length)return null;s=[a[0],a[1],a[2],a[3]]}var u=i.styleAttrs[e.byName.writingMode.qname];if("lrtb"===u||"lr"===u)s=[s[0],s[3],s[2],s[1]];else if("rltb"===u||"rl"===u)s=[s[0],s[1],s[2],s[3]];else if("tblr"===u)s=[s[3],s[0],s[1],s[2]];else{if("tbrl"!==u&&"tb"!==u)return null;s=[s[3],s[2],s[1],s[0]]}for(var l=[],f=0;f<s.length;f++)if(0===s[f].value)l[f]=new n.ComputedLength(0,0);else if(l[f]=n.toComputedLength(s[f].value,s[f].unit,i.styleAttrs[e.byName.fontSize.qname],0===f||2===f?i.styleAttrs[e.byName.extent.qname].h:i.styleAttrs[e.byName.extent.qname].w,0===f||2===f?t.cellLength.h:t.cellLength.w,0===f||2===f?t.pxLength.h:t.pxLength.w),null===l[f])return null;return l})),new r(t.ns_tts,"position","top left",["region"],!1,!0,(function(e){return n.parsePosition(e)}),(function(t,r,i,a){var o,s;return null===(o=n.toComputedLength(a.v.offset.value,a.v.offset.unit,null,new n.ComputedLength(-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-i.styleAttrs[e.byName.extent.qname].h.rh),null,t.pxLength.h))?null:("bottom"===a.v.edge&&(o=new n.ComputedLength(-o.rw-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-o.rh-i.styleAttrs[e.byName.extent.qname].h.rh)),s=n.toComputedLength(a.h.offset.value,a.h.offset.unit,null,new n.ComputedLength(t.dimensions.w.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-i.styleAttrs[e.byName.extent.qname].w.rh),null,t.pxLength.w),null===o?null:("right"===a.h.edge&&(s=new n.ComputedLength(t.dimensions.w.rw-s.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-s.rh-i.styleAttrs[e.byName.extent.qname].w.rh)),{h:o,w:s}))})),new r(t.ns_tts,"ruby","none",["span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"rubyAlign","center",["span"],!0,!0,(function(e){return"center"!==e&&"spaceAround"!==e?null:e}),null),new r(t.ns_tts,"rubyPosition","outside",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"rubyReserve","none",["p"],!0,!0,(function(e){var t=e.split(" "),r=[null,null];if(0===t.length||t.length>2)return null;if("none"!==t[0]&&"both"!==t[0]&&"after"!==t[0]&&"before"!==t[0]&&"outside"!==t[0])return null;if(r[0]=t[0],2===t.length&&"none"!==t[0]){var i=n.parseLength(t[1]);if(!i)return null;r[1]=i}return r}),(function(t,r,i,a,o){if("none"===a[0])return a;var s=null;return null===(s=null===a[1]?new n.ComputedLength(.5*i.styleAttrs[e.byName.fontSize.qname].rw,.5*i.styleAttrs[e.byName.fontSize.qname].rh):n.toComputedLength(a[1].value,a[1].unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h))?null:[a[0],s]})),new r(t.ns_tts,"showBackground","always",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"textAlign","start",["p"],!0,!0,(function(e){return e}),(function(e,t,n,r,i){return"left"===r?"start":"right"===r?"end":r})),new r(t.ns_tts,"textCombine","none",["span"],!0,!0,(function(e){return"none"===e||"all"===e?e:null}),null),new r(t.ns_tts,"textDecoration","none",["span"],!0,!0,(function(e){return e.split(" ")}),null),new r(t.ns_tts,"textEmphasis","none",["span"],!0,!0,(function(e){for(var t=e.split(" "),r={style:null,symbol:null,color:null,position:null},i=0;i<t.length;i++)if("none"===t[i]||"auto"===t[i])r.style=t[i];else if("filled"===t[i]||"open"===t[i])r.style=t[i];else if("circle"===t[i]||"dot"===t[i]||"sesame"===t[i])r.symbol=t[i];else if("current"===t[i])r.color=t[i];else if("outside"===t[i]||"before"===t[i]||"after"===t[i])r.position=t[i];else if(r.color=n.parseColor(t[i]),null===r.color)return null;return null==r.style&&null==r.symbol?r.style="auto":(r.symbol=r.symbol||"circle",r.style=r.style||"filled"),r.position=r.position||"outside",r.color=r.color||"current",r}),null),new r(t.ns_tts,"textOutline","none",["span"],!0,!0,(function(e){if("none"===e)return e;var t={},r=e.split(" ");if(0===r.length||r.length>2)return null;var i=n.parseColor(r[0]);if(t.color=i,null!==i&&r.shift(),1!==r.length)return null;var a=n.parseLength(r[0]);return a?(t.thickness=a,t):null}),(function(t,r,i,a,o){if("none"===a)return a;var s={};return null===a.color?s.color=i.styleAttrs[e.byName.color.qname]:s.color=a.color,s.thickness=n.toComputedLength(a.thickness.value,a.thickness.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h),null===s.thickness?null:s})),new r(t.ns_tts,"textShadow","none",["span"],!0,!0,n.parseTextShadow,(function(t,r,i,a){if("none"===a)return a;for(var o=[],s=0;s<a.length;s++){var u={};if(u.x_off=n.toComputedLength(a[s][0].value,a[s][0].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.w),null===u.x_off)return null;if(u.y_off=n.toComputedLength(a[s][1].value,a[s][1].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===u.y_off)return null;if(null===a[s][2])u.b_radius=0;else if(u.b_radius=n.toComputedLength(a[s][2].value,a[s][2].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===u.b_radius)return null;null===a[s][3]?u.color=i.styleAttrs[e.byName.color.qname]:u.color=a[s][3],o.push(u)}return o})),new r(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"zIndex","auto",["region"],!1,!0,(function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t}),null),new r(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,n.parseLength,(function(e,t,r,i,a){return n.toComputedLength(i.value,i.unit,null,null,e.cellLength.w,null)})),new r(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(e){return e}),null),new r(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(e){return e}),null),new r(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(e){return"true"===e}),null),new r(t.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(e){return"true"===e}),null)],e.byQName={},e.all)e.byQName[e.all[i].qname]=e.all[i];for(var a in e.byName={},e.all)e.byName[e.all[a].name]=e.all[a]}(t,"undefined"==typeof imscNames?at:imscNames,"undefined"==typeof imscUtils?ot:imscUtils)})),ut=u((function(e,t){!function(e,t,n,r){e.generateISD=function(e,t,r){var i=new o(e),s={},u={},l={},f=e.head.styling.initials[n.byName.showBackground.qname],d=e.head.styling.initials[n.byName.backgroundColor.qname];for(var c in e.head.layout.regions)if(e.head.layout.regions.hasOwnProperty(c)){var h=e.head.layout.regions[c],g=h.styleAttrs[n.byName.showBackground.qname]||f,p=h.styleAttrs[n.byName.backgroundColor.qname]||d;l[h.id]=("always"===g||void 0===g)&&void 0!==p&&!(t<h.begin||t>=h.end)}for(var m in e.body&&e.body.regionID&&(l[e.body.regionID]=!0),u=null!==e.body?function e(t,n){if(n.contents){var r={};for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);return r.contents=[],n.contents.filter((function(e){return!(t<e.begin||t>=e.end)})).forEach((function(n){var i=e(t,n);i.regionID&&(l[i.regionID]=!0),null!==i&&r.contents.push(i)})),r}return n}(t,e.body):null,void 0!==l[""]&&(l[""]=!0),l)if(l[m]){var _=a(e,t,e.head.layout.regions[m],u,null,"",e.head.layout.regions[m],r,s);null!==_&&i.contents.push(_.element)}return i};var i=[n.byName.color.qname,n.byName.textCombine.qname,n.byName.textDecoration.qname,n.byName.textEmphasis.qname,n.byName.textOutline.qname,n.byName.textShadow.qname];function a(e,t,o,l,f,d,c,h,g){if(t<c.begin||t>=c.end)return null;var p="regionID"in c&&""!==c.regionID?c.regionID:d;if(null!==f&&p!==o.id&&(!("contents"in c)||"contents"in c&&0===c.contents.length||""!==p))return null;var m=new s(c);if("sets"in c)for(var _=0;_<c.sets.length;_++)t<c.sets[_].begin||t>=c.sets[_].end||(m.styleAttrs[c.sets[_].qname]=c.sets[_].value);var E={};for(var y in m.styleAttrs)if(m.styleAttrs.hasOwnProperty(y)&&(E[y]=!0,"region"===m.kind&&y===n.byName.writingMode.qname&&!(n.byName.direction.qname in m.styleAttrs))){var v=m.styleAttrs[y];"lrtb"===v||"lr"===v?m.styleAttrs[n.byName.direction.qname]="ltr":"rltb"!==v&&"rl"!==v||(m.styleAttrs[n.byName.direction.qname]="rtl")}if(null!==f)for(var T=0;T<n.all.length;T++){var A=n.all[T];if(A.qname===n.byName.textDecoration.qname){var S=f.styleAttrs[A.qname],b=m.styleAttrs[A.qname],I=[];void 0===b?I=S:-1===b.indexOf("none")?((-1===b.indexOf("noUnderline")&&-1!==S.indexOf("underline")||-1!==b.indexOf("underline"))&&I.push("underline"),(-1===b.indexOf("noLineThrough")&&-1!==S.indexOf("lineThrough")||-1!==b.indexOf("lineThrough"))&&I.push("lineThrough"),(-1===b.indexOf("noOverline")&&-1!==S.indexOf("overline")||-1!==b.indexOf("overline"))&&I.push("overline")):I.push("none"),m.styleAttrs[A.qname]=I}else if(A.qname!==n.byName.fontSize.qname||A.qname in m.styleAttrs||"span"!==m.kind||"textContainer"!==m.styleAttrs[n.byName.ruby.qname])if(A.qname!==n.byName.fontSize.qname||A.qname in m.styleAttrs||"span"!==m.kind||"text"!==m.styleAttrs[n.byName.ruby.qname])A.inherit&&A.qname in f.styleAttrs&&!(A.qname in m.styleAttrs)&&(m.styleAttrs[A.qname]=f.styleAttrs[A.qname]);else{var R=f.styleAttrs[n.byName.fontSize.qname];"textContainer"===f.styleAttrs[n.byName.ruby.qname]?m.styleAttrs[A.qname]=R:m.styleAttrs[A.qname]=new r.ComputedLength(.5*R.rw,.5*R.rh)}else{var w=f.styleAttrs[n.byName.fontSize.qname];m.styleAttrs[A.qname]=new r.ComputedLength(.5*w.rw,.5*w.rh)}}for(var N=0;N<n.all.length;N++){var M=n.all[N];if(!(M.qname in m.styleAttrs)&&!(M.qname===n.byName.position.qname&&n.byName.origin.qname in m.styleAttrs||M.qname===n.byName.origin.qname&&n.byName.position.qname in m.styleAttrs)){var C=e.head.styling.initials[M.qname]||M.initial;if(null!==C&&("region"===m.kind||!1===M.inherit&&null!==C)){var D=M.parse(C);null!==D?(m.styleAttrs[M.qname]=D,E[M.qname]=!0):u(h,"Invalid initial value for '"+M.qname+"' on element '"+m.kind)}}}for(var O=0;O<n.all.length;O++){var P=n.all[O];if(P.qname in E&&null!==P.compute){var L=P.compute(e,f,m,m.styleAttrs[P.qname],g);null!==L?m.styleAttrs[P.qname]=L:(m.styleAttrs[P.qname]=P.compute(e,f,m,P.parse(P.initial),g),u(h,"Style '"+P.qname+"' on element '"+m.kind+"' cannot be computed"))}}if("none"===m.styleAttrs[n.byName.display.qname])return null;var F=null;null===f?F=null===l?[]:[l]:"contents"in c&&(F=c.contents);for(var x=0;null!==F&&x<F.length;x++){var U=a(e,t,o,l,m,p,F[x],h,g);null!==U&&m.contents.push(U.element)}for(var B in m.styleAttrs)if(m.styleAttrs.hasOwnProperty(B)){var k=!1;if("span"===m.kind){var G=m.styleAttrs[n.byName.ruby.qname];(k=("container"===G||"textContainer"===G||"baseContainer"===G)&&-1!==i.indexOf(B))||(k="container"!==G&&B===n.byName.rubyAlign.qname),k||(k=!("textContainer"===G||"text"===G)&&B===n.byName.rubyPosition.qname)}if(!k){var j=n.byQName[B];"applies"in j&&(k=-1===j.applies.indexOf(m.kind))}k&&delete m.styleAttrs[B]}var Y=m.styleAttrs[n.byName.ruby.qname];if("p"===m.kind||"span"===m.kind&&("textContainer"===Y||"text"===Y)){var q=[];!function e(t,r){if(!("contents"in t))return;for(var i=0;i<t.contents.length;i++){var a=t.contents[i],o=a.styleAttrs[n.byName.ruby.qname];("span"!==a.kind||"textContainer"!==o&&"text"!==o)&&("contents"in a?e(a,r):("span"===a.kind&&0!==a.text.length||"br"===a.kind)&&r.push(a))}}(m,q),function(e){for(var t,n=0;n<e.length;)if("br"!==(t=e[n]).kind&&"preserve"!==t.space){var r=t.text.replace(/[\t\r\n ]+/g," ");/^[ ]/.test(r)&&(0===n||("br"===(i=e[n-1]).kind||/[\r\n\t ]$/.test(i.text)))&&(r=r.substring(1)),t.text=r,0===r.length?e.splice(n,1):n++}else n++;var i;for(n=0;n<e.length;n++)"br"!==(t=e[n]).kind&&"preserve"!==t.space?/[ ]$/.test(t.text)&&(n===e.length-1||("br"===(a=e[n+1]).kind||"preserve"===a.space&&/^[\r\n]/.test(a.text)))&&(t.text=t.text.slice(0,-1)):n++;var a}(q),function e(t){if("br"===t.kind)return!1;if("text"in t)return 0===t.text.length;if("contents"in t){for(var n=t.contents.length;n--;)e(t.contents[n])&&t.contents.splice(n,1);return 0===t.contents.length}}(m)}return"div"===m.kind&&n.byName.backgroundImage.qname in m.styleAttrs||"br"===m.kind||"image"===m.kind||"contents"in m&&m.contents.length>0||"span"===m.kind&&null!==m.text||"region"===m.kind&&"always"===m.styleAttrs[n.byName.showBackground.qname]?{region_id:p,element:m}:null}function o(e){this.contents=[],this.aspectRatio=e.aspectRatio,this.lang=e.lang}function s(e){for(var t in this.kind=e.kind||"region",this.lang=e.lang,e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)e.styleAttrs.hasOwnProperty(t)&&(this.styleAttrs[t]=e.styleAttrs[t]);"src"in e&&(this.src=e.src),"type"in e&&(this.type=e.type),"text"in e?this.text=e.text:("region"===this.kind||"contents"in e)&&(this.contents=[]),"space"in e&&(this.space=e.space)}function u(e,t){if(e&&e.error&&e.error(t))throw t}}(t,"undefined"==typeof imscNames||imscNames,"undefined"==typeof imscStyles?st:imscStyles,"undefined"==typeof imscUtils?ot:imscUtils)})),lt=[],ft=[],dt="undefined"!=typeof Uint8Array?Uint8Array:Array,ct=!1;function ht(){ct=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t<n;++t)lt[t]=e[t],ft[e.charCodeAt(t)]=t;ft["-".charCodeAt(0)]=62,ft["_".charCodeAt(0)]=63}function gt(e,t,n){for(var r,i,a=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],a.push(lt[(i=r)>>18&63]+lt[i>>12&63]+lt[i>>6&63]+lt[63&i]);return a.join("")}function pt(e){var t;ct||ht();for(var n=e.length,r=n%3,i="",a=[],o=0,s=n-r;o<s;o+=16383)a.push(gt(e,o,o+16383>s?s:o+16383));return 1===r?(t=e[n-1],i+=lt[t>>2],i+=lt[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=lt[t>>10],i+=lt[t>>4&63],i+=lt[t<<2&63],i+="="),a.push(i),a.join("")}function mt(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,l=u>>1,f=-7,d=n?i-1:0,c=n?-1:1,h=e[t+d];for(d+=c,a=h&(1<<-f)-1,h>>=-f,f+=s;f>0;a=256*a+e[t+d],d+=c,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=r;f>0;o=256*o+e[t+d],d+=c,f-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r),a-=l}return(h?-1:1)*o*Math.pow(2,a-r)}function _t(e,t,n,r,i,a){var o,s,u,l=8*a-i-1,f=(1<<l)-1,d=f>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,g=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=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+d>=1?c/u:c*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=f?(s=0,o=f):o+d>=1?(s=(t*u-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=g,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+h]=255&o,h+=g,o/=256,l-=8);e[n+h-g]|=128*p}var Et={}.toString,yt=Array.isArray||function(e){return"[object Array]"==Et.call(e)};function vt(){return At.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Tt(e,t){if(vt()<t)throw new RangeError("Invalid typed array length");return At.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=At.prototype:(null===e&&(e=new At(t)),e.length=t),e}function At(e,t,n){if(!(At.TYPED_ARRAY_SUPPORT||this instanceof At))return new At(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return It(this,e)}return St(this,e,t,n)}function St(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);At.TYPED_ARRAY_SUPPORT?(e=t).__proto__=At.prototype:e=Rt(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!At.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Mt(t,n),i=(e=Tt(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(Nt(t)){var n=0|wt(t.length);return 0===(e=Tt(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?Tt(e,0):Rt(e,t);if("Buffer"===t.type&&yt(t.data))return Rt(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function bt(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function It(e,t){if(bt(t),e=Tt(e,t<0?0:0|wt(t)),!At.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function Rt(e,t){var n=t.length<0?0:0|wt(t.length);e=Tt(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function wt(e){if(e>=vt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+vt().toString(16)+" bytes");return 0|e}function Nt(e){return!(null==e||!e._isBuffer)}function Mt(e,t){if(Nt(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return tn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return nn(e).length;default:if(r)return tn(e).length;t=(""+t).toLowerCase(),r=!0}}function Ct(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 Ht(this,t,n);case"utf8":case"utf-8":return jt(this,t,n);case"ascii":return Yt(this,t,n);case"latin1":case"binary":return qt(this,t,n);case"base64":return Gt(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kt(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Dt(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Ot(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),n=+n,isNaN(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=At.from(t,r)),Nt(t))return 0===t.length?-1:Pt(e,t,n,r,i);if("number"==typeof t)return t&=255,At.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Pt(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function Pt(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 f=-1;for(a=n;a<s;a++)if(l(e,a)===l(t,-1===f?0:a-f)){if(-1===f&&(f=a),a-f+1===u)return f*o}else-1!==f&&(a-=a-f),f=-1}else for(n+u>s&&(n=s-u),a=n;a>=0;a--){for(var d=!0,c=0;c<u;c++)if(l(e,a+c)!==l(t,c)){d=!1;break}if(d)return a}return-1}function Lt(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function Ft(e,t,n,r){return rn(tn(t,e.length-n),e,n,r)}function xt(e,t,n,r){return rn(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function Ut(e,t,n,r){return xt(e,t,n,r)}function Bt(e,t,n,r){return rn(nn(t),e,n,r)}function kt(e,t,n,r){return rn(function(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function Gt(e,t,n){return 0===t&&n===e.length?pt(e):pt(e.slice(t,n))}function jt(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,o,s,u,l=e[i],f=null,d=l>239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(f=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(f=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)&&(f=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&&(f=u)}null===f?(f=65533,d=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}At.TYPED_ARRAY_SUPPORT=void 0===r.TYPED_ARRAY_SUPPORT||r.TYPED_ARRAY_SUPPORT,vt(),At.poolSize=8192,At._augment=function(e){return e.__proto__=At.prototype,e},At.from=function(e,t,n){return St(null,e,t,n)},At.TYPED_ARRAY_SUPPORT&&(At.prototype.__proto__=Uint8Array.prototype,At.__proto__=Uint8Array),At.alloc=function(e,t,n){return function(e,t,n,r){return bt(t),t<=0?Tt(e,t):void 0!==n?"string"==typeof r?Tt(e,t).fill(n,r):Tt(e,t).fill(n):Tt(e,t)}(null,e,t,n)},At.allocUnsafe=function(e){return It(null,e)},At.allocUnsafeSlow=function(e){return It(null,e)},At.isBuffer=function(e){return null!=e&&(!!e._isBuffer||an(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&an(e.slice(0,0))}(e))},At.compare=function(e,t){if(!Nt(e)||!Nt(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},At.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},At.concat=function(e,t){if(!yt(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return At.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=At.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!Nt(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},At.byteLength=Mt,At.prototype._isBuffer=!0,At.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;t<e;t+=2)Dt(this,t,t+1);return this},At.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Dt(this,t,t+3),Dt(this,t+1,t+2);return this},At.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Dt(this,t,t+7),Dt(this,t+1,t+6),Dt(this,t+2,t+5),Dt(this,t+3,t+4);return this},At.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?jt(this,0,e):Ct.apply(this,arguments)},At.prototype.equals=function(e){if(!Nt(e))throw new TypeError("Argument must be a Buffer");return this===e||0===At.compare(this,e)},At.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},At.prototype.compare=function(e,t,n,r,i){if(!Nt(e))throw new TypeError("Argument must be a Buffer");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),u=this.slice(r,i),l=e.slice(t,n),f=0;f<s;++f)if(u[f]!==l[f]){a=u[f],o=l[f];break}return a<o?-1:o<a?1:0},At.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},At.prototype.indexOf=function(e,t,n){return Ot(this,e,t,n,!0)},At.prototype.lastIndexOf=function(e,t,n){return Ot(this,e,t,n,!1)},At.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=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 Lt(this,e,t,n);case"utf8":case"utf-8":return Ft(this,e,t,n);case"ascii":return xt(this,e,t,n);case"latin1":case"binary":return Ut(this,e,t,n);case"base64":return Bt(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kt(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},At.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Yt(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function qt(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function Ht(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=en(e[a]);return i}function Kt(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function Vt(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function zt(e,t,n,r,i,a){if(!Nt(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function Wt(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i<a;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Xt(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i<a;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function Qt(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 Zt(e,t,n,r,i){return i||Qt(e,0,n,4),_t(e,t,n,r,23,4),n+4}function $t(e,t,n,r,i){return i||Qt(e,0,n,8),_t(e,t,n,r,52,8),n+8}At.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),At.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=At.prototype;else{var i=t-e;n=new At(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},At.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||Vt(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},At.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||Vt(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},At.prototype.readUInt8=function(e,t){return t||Vt(e,1,this.length),this[e]},At.prototype.readUInt16LE=function(e,t){return t||Vt(e,2,this.length),this[e]|this[e+1]<<8},At.prototype.readUInt16BE=function(e,t){return t||Vt(e,2,this.length),this[e]<<8|this[e+1]},At.prototype.readUInt32LE=function(e,t){return t||Vt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},At.prototype.readUInt32BE=function(e,t){return t||Vt(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},At.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||Vt(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},At.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||Vt(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},At.prototype.readInt8=function(e,t){return t||Vt(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},At.prototype.readInt16LE=function(e,t){t||Vt(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},At.prototype.readInt16BE=function(e,t){t||Vt(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},At.prototype.readInt32LE=function(e,t){return t||Vt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},At.prototype.readInt32BE=function(e,t){return t||Vt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},At.prototype.readFloatLE=function(e,t){return t||Vt(e,4,this.length),mt(this,e,!0,23,4)},At.prototype.readFloatBE=function(e,t){return t||Vt(e,4,this.length),mt(this,e,!1,23,4)},At.prototype.readDoubleLE=function(e,t){return t||Vt(e,8,this.length),mt(this,e,!0,52,8)},At.prototype.readDoubleBE=function(e,t){return t||Vt(e,8,this.length),mt(this,e,!1,52,8)},At.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||zt(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},At.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||zt(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},At.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||zt(this,e,t,1,255,0),At.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},At.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||zt(this,e,t,2,65535,0),At.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Wt(this,e,t,!0),t+2},At.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||zt(this,e,t,2,65535,0),At.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Wt(this,e,t,!1),t+2},At.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||zt(this,e,t,4,4294967295,0),At.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Xt(this,e,t,!0),t+4},At.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||zt(this,e,t,4,4294967295,0),At.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Xt(this,e,t,!1),t+4},At.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);zt(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},At.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);zt(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},At.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||zt(this,e,t,1,127,-128),At.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},At.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||zt(this,e,t,2,32767,-32768),At.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Wt(this,e,t,!0),t+2},At.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||zt(this,e,t,2,32767,-32768),At.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Wt(this,e,t,!1),t+2},At.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||zt(this,e,t,4,2147483647,-2147483648),At.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Xt(this,e,t,!0),t+4},At.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||zt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),At.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Xt(this,e,t,!1),t+4},At.prototype.writeFloatLE=function(e,t,n){return Zt(this,e,t,!0,n)},At.prototype.writeFloatBE=function(e,t,n){return Zt(this,e,t,!1,n)},At.prototype.writeDoubleLE=function(e,t,n){return $t(this,e,t,!0,n)},At.prototype.writeDoubleBE=function(e,t,n){return $t(this,e,t,!1,n)},At.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!At.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},At.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!At.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var o=Nt(e)?e:tn(new At(e,r).toString()),s=o.length;for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var Jt=/[^+\/0-9A-Za-z-_]/g;function en(e){return e<16?"0"+e.toString(16):e.toString(16)}function tn(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&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 nn(e){return function(e){var t,n,r,i,a,o;ct||ht();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new dt(3*s/4-a),r=a>0?s-4:s;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=ft[e.charCodeAt(t)]<<18|ft[e.charCodeAt(t+1)]<<12|ft[e.charCodeAt(t+2)]<<6|ft[e.charCodeAt(t+3)],o[u++]=i>>16&255,o[u++]=i>>8&255,o[u++]=255&i;return 2===a?(i=ft[e.charCodeAt(t)]<<2|ft[e.charCodeAt(t+1)]>>4,o[u++]=255&i):1===a&&(i=ft[e.charCodeAt(t)]<<10|ft[e.charCodeAt(t+1)]<<4|ft[e.charCodeAt(t+2)]>>2,o[u++]=i>>8&255,o[u++]=255&i),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Jt,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function rn(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function an(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var on,sn="object"==typeof Reflect?Reflect:null,un=sn&&"function"==typeof sn.apply?sn.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};on=sn&&"function"==typeof sn.ownKeys?sn.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var ln=Number.isNaN||function(e){return e!=e};function fn(){fn.init.call(this)}var dn=fn,cn=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))}An(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&An(e,"error",t,n)}(e,i,{once:!0})}))};fn.EventEmitter=fn,fn.prototype._events=void 0,fn.prototype._eventsCount=0,fn.prototype._maxListeners=void 0;var hn=10;function gn(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function pn(e){return void 0===e._maxListeners?fn.defaultMaxListeners:e._maxListeners}function mn(e,t,n,r){var i,a,o,s;if(gn(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=pn(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function _n(){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 En(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=_n.bind(r);return i.listener=n,r.wrapFn=i,i}function yn(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;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):Tn(i,i.length)}function vn(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function Tn(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function An(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){r.once&&e.removeEventListener(t,i),n(a)}))}}function Sn(){throw new Error("setTimeout has not been defined")}function bn(){throw new Error("clearTimeout has not been defined")}Object.defineProperty(fn,"defaultMaxListeners",{enumerable:!0,get:function(){return hn},set:function(e){if("number"!=typeof e||e<0||ln(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");hn=e}}),fn.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},fn.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||ln(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},fn.prototype.getMaxListeners=function(){return pn(this)},fn.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)un(s,this,t);else{var u=s.length,l=Tn(s,u);for(n=0;n<u;++n)un(l[n],this,t)}return!0},fn.prototype.addListener=function(e,t){return mn(this,e,t,!1)},fn.prototype.on=fn.prototype.addListener,fn.prototype.prependListener=function(e,t){return mn(this,e,t,!0)},fn.prototype.once=function(e,t){return gn(t),this.on(e,En(this,e,t)),this},fn.prototype.prependOnceListener=function(e,t){return gn(t),this.prependListener(e,En(this,e,t)),this},fn.prototype.removeListener=function(e,t){var n,r,i,a,o;if(gn(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=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<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},fn.prototype.off=fn.prototype.removeListener,fn.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},fn.prototype.listeners=function(e){return yn(this,e,!0)},fn.prototype.rawListeners=function(e){return yn(this,e,!1)},fn.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):vn.call(e,t)},fn.prototype.listenerCount=vn,fn.prototype.eventNames=function(){return this._eventsCount>0?on(this._events):[]},dn.once=cn;var In=Sn,Rn=bn;function wn(e){if(In===setTimeout)return setTimeout(e,0);if((In===Sn||!In)&&setTimeout)return In=setTimeout,setTimeout(e,0);try{return In(e,0)}catch(t){try{return In.call(null,e,0)}catch(t){return In.call(this,e,0)}}}"function"==typeof r.setTimeout&&(In=setTimeout),"function"==typeof r.clearTimeout&&(Rn=clearTimeout);var Nn,Mn=[],Cn=!1,Dn=-1;function On(){Cn&&Nn&&(Cn=!1,Nn.length?Mn=Nn.concat(Mn):Dn=-1,Mn.length&&Pn())}function Pn(){if(!Cn){var e=wn(On);Cn=!0;for(var t=Mn.length;t;){for(Nn=Mn,Mn=[];++Dn<t;)Nn&&Nn[Dn].run();Dn=-1,t=Mn.length}Nn=null,Cn=!1,function(e){if(Rn===clearTimeout)return clearTimeout(e);if((Rn===bn||!Rn)&&clearTimeout)return Rn=clearTimeout,clearTimeout(e);try{Rn(e)}catch(t){try{return Rn.call(null,e)}catch(t){return Rn.call(this,e)}}}(e)}}function Ln(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Mn.push(new Fn(e,t)),1!==Mn.length||Cn||wn(Pn)}function Fn(e,t){this.fun=e,this.array=t}Fn.prototype.run=function(){this.fun.apply(null,this.array)};function xn(){}var Un=xn,Bn=xn,kn=xn,Gn=xn,jn=xn,Yn=xn,qn=xn;var Hn=r.performance||{},Kn=Hn.now||Hn.mozNow||Hn.msNow||Hn.oNow||Hn.webkitNow||function(){return(new Date).getTime()};var Vn=new Date;var zn={nextTick:Ln,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Un,addListener:Bn,once:kn,off:Gn,removeListener:jn,removeAllListeners:Yn,emit:qn,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*Kn.call(Hn),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Vn)/1e3}},Wn="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},Xn=/%[sdj%]/g;function Qn(e){if(!ur(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(er(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,a=String(e).replace(Xn,(function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),o=r[n];n<i;o=r[++n])sr(o)||!dr(o)?a+=" "+o:a+=" "+er(o);return a}function Zn(e,t){if(lr(r.process))return function(){return Zn(e,t).apply(this,arguments)};if(!0===zn.noDeprecation)return e;var n=!1;return function(){if(!n){if(zn.throwDeprecation)throw new Error(t);zn.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}}var $n,Jn={};function er(e,t){var n={seen:[],stylize:nr};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),or(t)?n.showHidden=t:t&&mr(n,t),lr(n.showHidden)&&(n.showHidden=!1),lr(n.depth)&&(n.depth=2),lr(n.colors)&&(n.colors=!1),lr(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=tr),rr(n,e,n.depth)}function tr(e,t){var n=er.styles[t];return n?"["+er.colors[n][0]+"m"+e+"["+er.colors[n][1]+"m":e}function nr(e,t){return e}function rr(e,t,n){if(e.customInspect&&t&&gr(t.inspect)&&t.inspect!==er&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return ur(r)||(r=rr(e,r,n)),r}var i=function(e,t){if(lr(t))return e.stylize("undefined","undefined");if(ur(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(r=t,"number"==typeof r)return e.stylize(""+t,"number");var r;if(or(t))return e.stylize(""+t,"boolean");if(sr(t))return e.stylize("null","null")}(e,t);if(i)return i;var a=Object.keys(t),o=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),hr(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return ir(t);if(0===a.length){if(gr(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(fr(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(cr(t))return e.stylize(Date.prototype.toString.call(t),"date");if(hr(t))return ir(t)}var u,l,f="",d=!1,c=["{","}"];(u=t,Array.isArray(u)&&(d=!0,c=["[","]"]),gr(t))&&(f=" [Function"+(t.name?": "+t.name:"")+"]");return fr(t)&&(f=" "+RegExp.prototype.toString.call(t)),cr(t)&&(f=" "+Date.prototype.toUTCString.call(t)),hr(t)&&(f=" "+ir(t)),0!==a.length||d&&0!=t.length?n<0?fr(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=d?function(e,t,n,r,i){for(var a=[],o=0,s=t.length;o<s;++o)_r(t,String(o))?a.push(ar(e,t,n,r,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(ar(e,t,n,r,i,!0))})),a}(e,t,n,o,a):a.map((function(r){return ar(e,t,n,o,r,d)})),e.seen.pop(),function(e,t,n){if(e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(l,f,c)):c[0]+f+c[1]}function ir(e){return"["+Error.prototype.toString.call(e)+"]"}function ar(e,t,n,r,i,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),_r(r,i)||(o="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=sr(n)?rr(e,u.value,null):rr(e,u.value,n-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),lr(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function or(e){return"boolean"==typeof e}function sr(e){return null===e}function ur(e){return"string"==typeof e}function lr(e){return void 0===e}function fr(e){return dr(e)&&"[object RegExp]"===pr(e)}function dr(e){return"object"==typeof e&&null!==e}function cr(e){return dr(e)&&"[object Date]"===pr(e)}function hr(e){return dr(e)&&("[object Error]"===pr(e)||e instanceof Error)}function gr(e){return"function"==typeof e}function pr(e){return Object.prototype.toString.call(e)}function mr(e,t){if(!t||!dr(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function _r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}er.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},er.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};for(var Er=function(e){var t=wr(e),n=t[0],r=t[1];return 3*(n+r)/4-r},yr=function(e){var t,n,r=wr(e),i=r[0],a=r[1],o=new Sr(function(e,t,n){return 3*(t+n)/4-n}(0,i,a)),s=0,u=a>0?i-4:i;for(n=0;n<u;n+=4)t=Ar[e.charCodeAt(n)]<<18|Ar[e.charCodeAt(n+1)]<<12|Ar[e.charCodeAt(n+2)]<<6|Ar[e.charCodeAt(n+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=255&t;2===a&&(t=Ar[e.charCodeAt(n)]<<2|Ar[e.charCodeAt(n+1)]>>4,o[s++]=255&t);1===a&&(t=Ar[e.charCodeAt(n)]<<10|Ar[e.charCodeAt(n+1)]<<4|Ar[e.charCodeAt(n+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t);return o},vr=function(e){for(var t,n=e.length,r=n%3,i=[],a=0,o=n-r;a<o;a+=16383)i.push(Nr(e,a,a+16383>o?o:a+16383));1===r?(t=e[n-1],i.push(Tr[t>>2]+Tr[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(Tr[t>>10]+Tr[t>>4&63]+Tr[t<<2&63]+"="));return i.join("")},Tr=[],Ar=[],Sr="undefined"!=typeof Uint8Array?Uint8Array:Array,br="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ir=0,Rr=br.length;Ir<Rr;++Ir)Tr[Ir]=br[Ir],Ar[br.charCodeAt(Ir)]=Ir;function wr(e){var t=e.length;if(t%4>0)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 Nr(e,t,n){for(var r,i,a=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(Tr[(i=r)>>18&63]+Tr[i>>12&63]+Tr[i>>6&63]+Tr[63&i]);return a.join("")}Ar["-".charCodeAt(0)]=62,Ar["_".charCodeAt(0)]=63;var Mr={byteLength:Er,toByteArray:yr,fromByteArray:vr},Cr=function(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,l=u>>1,f=-7,d=n?i-1:0,c=n?-1:1,h=e[t+d];for(d+=c,a=h&(1<<-f)-1,h>>=-f,f+=s;f>0;a=256*a+e[t+d],d+=c,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=r;f>0;o=256*o+e[t+d],d+=c,f-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r),a-=l}return(h?-1:1)*o*Math.pow(2,a-r)},Dr=function(e,t,n,r,i,a){var o,s,u,l=8*a-i-1,f=(1<<l)-1,d=f>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,g=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=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+d>=1?c/u:c*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=f?(s=0,o=f):o+d>=1?(s=(t*u-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=g,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+h]=255&o,h+=g,o/=256,l-=8);e[n+h-g]|=128*p},Or=u((function(e,t){var n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=i,t.SlowBuffer=function(e){+e!=e&&(e=0);return i.alloc(+e)},t.INSPECT_MAX_BYTES=50;function r(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,i.prototype),t}function i(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 s(e)}return a(e,t,n)}function a(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!i.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|d(e,t),a=r(n),o=a.write(e,t);o!==n&&(a=a.slice(0,o));return a}(e,t);if(ArrayBuffer.isView(e))return function(e){if(x(e,Uint8Array)){var t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return u(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(x(e,ArrayBuffer)||e&&x(e.buffer,ArrayBuffer))return l(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(x(e,SharedArrayBuffer)||e&&x(e.buffer,SharedArrayBuffer)))return l(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var a=e.valueOf&&e.valueOf();if(null!=a&&a!==e)return i.from(a,t,n);var o=function(e){if(i.isBuffer(e)){var t=0|f(e.length),n=r(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||U(e.length)?r(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.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 o(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 s(e){return o(e),r(e<0?0:0|f(e))}function u(e){for(var t=e.length<0?0:0|f(e.length),n=r(t),i=0;i<t;i+=1)n[i]=255&e[i];return n}function l(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,i.prototype),r}function f(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function d(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||x(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 a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return L(e).length;default:if(a)return r?-1:P(e).length;t=(""+t).toLowerCase(),a=!0}}function c(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 I(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return S(this,t,n);case"latin1":case"binary":return b(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function h(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),U(n=+n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=i.from(t,r)),i.isBuffer(t))return 0===t.length?-1:p(e,t,n,r,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):p(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function p(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 f=-1;for(a=n;a<s;a++)if(l(e,a)===l(t,-1===f?0:a-f)){if(-1===f&&(f=a),a-f+1===u)return f*o}else-1!==f&&(a-=a-f),f=-1}else for(n+u>s&&(n=s-u),a=n;a>=0;a--){for(var d=!0,c=0;c<u;c++)if(l(e,a+c)!==l(t,c)){d=!1;break}if(d)return a}return-1}function m(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(U(s))return o;e[n+o]=s}return o}function _(e,t,n,r){return F(P(t,e.length-n),e,n,r)}function E(e,t,n,r){return F(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function y(e,t,n,r){return F(L(t),e,n,r)}function v(e,t,n,r){return F(function(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?Mr.fromByteArray(e):Mr.fromByteArray(e.slice(t,n))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,o,s,u,l=e[i],f=null,d=l>239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(f=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(f=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)&&(f=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&&(f=u)}null===f?(f=65533,d=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.kMaxLength=2147483647,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),i.poolSize=8192,i.from=function(e,t,n){return a(e,t,n)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array),i.alloc=function(e,t,n){return function(e,t,n){return o(e),e<=0?r(e):void 0!==t?"string"==typeof n?r(e).fill(t,n):r(e).fill(t):r(e)}(e,t,n)},i.allocUnsafe=function(e){return s(e)},i.allocUnsafeSlow=function(e){return s(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==i.prototype},i.compare=function(e,t){if(x(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),x(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,a=0,o=Math.min(n,r);a<o;++a)if(e[a]!==t[a]){n=e[a],r=t[a];break}return n<r?-1:r<n?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=i.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(x(o,Uint8Array))a+o.length>r.length?i.from(o).copy(r,a):Uint8Array.prototype.set.call(r,o,a);else{if(!i.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,a)}a+=o.length}return r},i.byteLength=d,i.prototype._isBuffer=!0,i.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;t<e;t+=2)h(this,t,t+1);return this},i.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)h(this,t,t+3),h(this,t+1,t+2);return this},i.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)h(this,t,t+7),h(this,t+1,t+6),h(this,t+2,t+5),h(this,t+3,t+4);return this},i.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):c.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},n&&(i.prototype[n]=i.prototype.inspect),i.prototype.compare=function(e,t,n,r,a){if(x(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.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===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),u=Math.min(o,s),l=this.slice(r,a),f=e.slice(t,n),d=0;d<u;++d)if(l[d]!==f[d]){o=l[d],s=f[d];break}return o<s?-1:s<o?1:0},i.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},i.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},i.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},i.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=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 m(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":case"latin1":case"binary":return E(this,e,t,n);case"base64":return y(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function b(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function I(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=B[e[a]];return i}function R(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length-1;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function w(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,a,o){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function M(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 C(e,t,n,r,i){return t=+t,n>>>=0,i||M(e,0,n,4),Dr(e,t,n,r,23,4),n+4}function D(e,t,n,r,i){return t=+t,n>>>=0,i||M(e,0,n,8),Dr(e,t,n,r,52,8),n+8}i.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<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,i.prototype),r},i.prototype.readUintLE=i.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||w(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},i.prototype.readUintBE=i.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||w(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},i.prototype.readUint8=i.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||w(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},i.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||w(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},i.prototype.readInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),Cr(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),Cr(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),Cr(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),Cr(this,e,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||N(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},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(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},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(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},i.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},i.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);N(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},i.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(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},i.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(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},i.prototype.writeFloatLE=function(e,t,n){return C(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){return C(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},i.prototype.copy=function(e,t,n,r){if(!i.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<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=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<r-n&&(r=e.length-t+n);var a=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),a},i.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!i.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var a=e.charCodeAt(0);("utf8"===r&&a<128||"latin1"===r)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=i.isBuffer(e)?e:i.from(e,r),u=s.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=s[o%u]}return this};var O=/[^+/0-9A-Za-z-_]/g;function P(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&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 L(e){return Mr.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function x(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function U(e){return e!=e}var B=function(){for(var e=new Array(256),t=0;t<16;++t)for(var n=16*t,r=0;r<16;++r)e[n+r]="0123456789abcdef"[t]+"0123456789abcdef"[r];return e}()}));
2
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function Pr(){this.head=null,this.tail=null,this.length=0}Pr.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},Pr.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},Pr.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},Pr.prototype.clear=function(){this.head=this.tail=null,this.length=0},Pr.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},Pr.prototype.concat=function(e){if(0===this.length)return Or.Buffer.alloc(0);if(1===this.length)return this.head.data;for(var t=Or.Buffer.allocUnsafe(e>>>0),n=this.head,r=0;n;)n.data.copy(t,r),r+=n.data.length,n=n.next;return t};
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.dash=t())}(this,(function(){"use strict";function e(e){const t=function(){const e="undefined"!=typeof document&&"undefined"!=typeof window,t=e?navigator.userAgent:"",n=/iP(hone|od)/i.test(t)&&!/iPad/.test(t)&&!/IEMobile/i.test(t),r=/Android/.test(t)&&!/Firefox/.test(t),i=/^((?!chrome|android).)*safari/i.test(t),a=/chrome|crios/i.test(t)&&!/opr|opera|chromium|edg|ucbrowser|googlebot/i.test(t),o=/firefox|fxios/i.test(t)&&!/seamonkey/i.test(t),s=/edg/i.test(t),u=/opr|opera/i.test(t),l=/SamsungBrowser/.test(t),f=l&&/SMART-TV/.test(t);return{controls:!n,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:r,iphone:n,safari:i,edge:s,opera:u,chrome:a,firefox:o,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:l,samsung_tv:l&&f,touch:"ontouchstart"in window,tizen:"tizen"in window,webOS:"webos"in window}}();switch(e){case"com.widevine.alpha":return t.chrome||t.firefox||t.edge||t.opera;case"org.w3.clearkey":return t.chrome||t.firefox;case"com.microsoft.playready":return t.edge}}function t(e){const{pathname:t}=function(e){const t=document.createElement("a");return t.href=e,t}(e);return t.endsWith(".mpd")}var n="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}function o(e){var t={exports:{}};return e(t,t.exports),t.exports}var u=o((function(e,t){!function(e){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={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},i={17:2,18:4,21:6,22:8,23:10,19:13,20:15},a={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},o={25:2,26:4,29:6,30:8,31:10,27:13,28:15},s=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u={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)}},l=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},f=function(e,t,n,r,i){this.foreground=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=r||"black",this.flash=i||!1};f.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var d=function(e,t,n,r,i,a){this.uchar=e||" ",this.penState=new f(t,n,r,i,a)};d.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(e,t){this.uchar=e,this.penState.copy(t)},setPenState:function(e){this.penState.copy(e)},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}};var c=function(){this.chars=[];for(var e=0;e<32;e++)this.chars.push(new d);this.pos=0,this.currPenState=new f};c.prototype={equals:function(e){for(var t=!0,n=0;n<32;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<32;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;t<32;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(u.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>32&&(u.log("ERROR","Too large cursor position "+this.pos),this.pos=32)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(e){e>=144&&this.backSpace();var t=n(e);this.pos>=32?u.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;t<32;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,n=0;n<32;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var h=function(){this.rows=[];for(var e=0;e<15;e++)this.rows.push(new c);this.currRow=14,this.nrRollUpRows=null,this.reset()};h.prototype={reset:function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,n=0;n<15;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){u.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){u.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var n=this.rows[this.currRow];if(null!==e.indent){var r=e.indent,i=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[i].penState.foreground}var a={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(a)},setBkgData:function(e){u.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){if(null!==this.nrRollUpRows){u.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),u.log("INFO","Rolling up")}else u.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t=[],n="",r=-1,i=0;i<15;i++){var a=this.rows[i].getTextString();a&&(r=i+1,e?t.push("Row "+r+': "'+a+'"'):t.push(a.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var g=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new h,this.nonDisplayedMemory=new h,this.lastOutputScreen=new h,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};g.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,u.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<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";u.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(u.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){u.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){u.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){u.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){u.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){u.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){u.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){u.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){u.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){u.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){u.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){u.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(u.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,u.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(e){u.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}u.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=u.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 p=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new g(1,t),new g(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}};p.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,u.setTime(e);for(var o=0;o<t.length;o+=2)if(r=127&t[o],i=127&t[o+1],r>=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB)this.lastCmdA=null,this.lastCmdB=null,u.log("DEBUG","Repeated command ("+l([r,i])+") is dropped");else if(0!==r||0!==i){if(u.log("DATA","["+l([t[o],t[o+1]])+"] -> ("+l([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)if(a=this.parseChars(r,i))if(this.currChNr&&this.currChNr>=0)this.channels[this.currChNr-1].insertChars(a);else u.log("WARNING","No channel found yet. TEXT-MODE?");n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,u.log("WARNING","Couldn't parse cleaned data "+l([r,i])+" orig: "+l([t[o],t[o+1]])))}else this.dataCounters.padding+=2},parseCmd:function(e,t){var n=null;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 u.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),u.log("DEBUG","MIDROW ("+l([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,s=null;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,s=64<=t&&t<=95?1===n?r[e]:a[e]:1===n?i[e]:o[e];var u=this.interpretPAC(s,t);return this.channels[n-1].setPAC(u),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n=t,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=t;o=17===a?t+80:18===a?t+112:t+144,u.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=l(i);u.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=s[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<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}};e.logger=u,e.PenState=f,e.CaptionScreen=h,e.Cea608Parser=p,e.findCea608Nalus=function(e,t,n){for(var r=0,i=t,a=[],o=function(e,t,n,r){if(4!==e||t<8)return null;var i=n.getUint8(r),a=n.getUint16(r+1),o=n.getUint32(r+3),s=n.getUint8(r+7);return 181==i&&49==a&&1195456820==o&&3==s};i<t+n;){if(r=e.getUint32(i),6===(31&e.getUint8(i+4)))for(var s=i+5,u=-1;s<i+4+r-1;){u=0;for(var l=255;255===l;)u+=l=e.getUint8(s),s++;var f=0;for(l=255;255===l;)f+=l=e.getUint8(s),s++;o(u,f,e,s)&&a.push([s,f]),s+=f}i+=r+4}return a},e.extractCea608DataFromRange=function(e,t){var n=t[0],r=[[],[]];n+=8;var i=31&e.getUint8(n);n+=2;for(var a=0;a<i;a++){var o=e.getUint8(n),s=4&o,u=3&o;n++;var l=e.getUint8(n);n++;var f=e.getUint8(n);n++,s&&(127&l)+(127&f)!=0&&(0===u?(r[0].push(l),r[0].push(f)):1===u&&(r[1].push(l),r[1].push(f)))}return r}}(t)})),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var f=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()}return l(e,[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.FRAGMENTED_TEXT="fragmentedText",this.EMBEDDED_TEXT="embeddedText",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",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.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.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_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_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"}}]),e}()),d=Object.defineProperty({default:f},"__esModule",{value:!0}),c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var h=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()}return c(e,[{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.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.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.PATCH_LOCATION="PatchLocation",this.PUBLISH_TIME="publishTime",this.ORIGINAL_PUBLISH_TIME="originalPublishTime",this.ORIGINAL_MPD_ID="mpdId"}}]),e}()),g=Object.defineProperty({default:h},"__esModule",{value:!0}),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var m=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()}return p(e,[{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"}}]),e}()),_=Object.defineProperty({default:m},"__esModule",{value:!0}),E=function(){var e=void 0,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=void 0,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=void 0;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)}}}(),y=Object.defineProperty({default:E},"__esModule",{value:!0}),v=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var T,A=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return v(e,[{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])}}}]),e}(),S=Object.defineProperty({default:A},"__esModule",{value:!0});var b=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.AST_IN_FUTURE="astInFuture",e.BUFFER_EMPTY="bufferStalled",e.BUFFER_LOADED="bufferLoaded",e.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",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_COMPLETED="periodSwitchCompleted",e.PERIOD_SWITCH_STARTED="periodSwitchStarted",e.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",e.QUALITY_CHANGE_RENDERED="qualityChangeRendered",e.TRACK_CHANGE_RENDERED="trackChangeRendered",e.SOURCE_INITIALIZED="sourceInitialized",e.STREAM_INITIALIZING="streamInitializing",e.STREAM_UPDATED="streamUpdated",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.PLAYBACK_ENDED="playbackEnded",e.PLAYBACK_ERROR="playbackError",e.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",e.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",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_SEEK_ASKED="playbackSeekAsked",e.PLAYBACK_STALLED="playbackStalled",e.PLAYBACK_STARTED="playbackStarted",e.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",e.PLAYBACK_WAITING="playbackWaiting",e.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",e.GAP_CAUSED_SEEK_TO_PERIOD_END="gapCausedSeekToPeriodEnd",e.GAP_CAUSED_INTERNAL_SEEK="gapCausedInternalSeek",e.EVENT_MODE_ON_START="eventModeOnStart",e.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",e.CONFORMANCE_VIOLATION="conformanceViolation",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((T=S)&&T.__esModule?T:{default:T}).default)),I=Object.defineProperty({default:b},"__esModule",{value:!0}),R=N(y),w=N(I);function N(e){return e&&e.__esModule?e:{default:e}}function M(){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}return{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===w.default.EVENT_MODE_ON_RECEIVE)))})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}}}M.__dashjs_factory_name="EventBus";var C=R.default.getSingletonFactory(M);C.EVENT_PRIORITY_LOW=0,C.EVENT_PRIORITY_HIGH=5e3,R.default.updateSingletonFactory(M.__dashjs_factory_name,C);var D=C,O=Object.defineProperty({default:D},"__esModule",{value:!0});var P=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",e.BUFFERING_COMPLETED="bufferingCompleted",e.BUFFER_CLEARED="bufferCleared",e.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",e.BYTES_APPENDED="bytesAppended",e.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",e.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",e.CURRENT_TRACK_CHANGED="currentTrackChanged",e.DATA_UPDATE_COMPLETED="dataUpdateCompleted",e.DATA_UPDATE_STARTED="dataUpdateStarted",e.INBAND_EVENTS="inbandEvents",e.INITIALIZATION_LOADED="initializationLoaded",e.INIT_FRAGMENT_LOADED="initFragmentLoaded",e.INIT_FRAGMENT_NEEDED="initFragmentNeeded",e.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",e.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",e.LIVE_EDGE_SEARCH_COMPLETED="liveEdgeSearchCompleted",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.REPRESENTATION_UPDATE_STARTED="representationUpdateStarted",e.REPRESENTATION_UPDATE_COMPLETED="representationUpdateCompleted",e.SEGMENTS_LOADED="segmentsLoaded",e.SERVICE_LOCATION_BLACKLIST_ADD="serviceLocationBlacklistAdd",e.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",e.SOURCEBUFFER_REMOVE_COMPLETED="sourceBufferRemoveCompleted",e.STREAMS_COMPOSED="streamsComposed",e.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",e.STREAM_COMPLETED="streamCompleted",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.SEGMENTBASE_INIT_REQUEST_NEEDED="segmentBaseInitRequestNeeded",e.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED="segmentBaseSegmentsListRequestNeeded",e.SEEK_TARGET="seekTarget",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(S).default);function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var x=new(function(e){function t(){return L(this,t),F(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(Object.defineProperty({default:P},"__esModule",{value:!0})).default)),U=Object.defineProperty({default:x},"__esModule",{value:!0}),B=j(O),k=j(U),G=j(y);function j(e){return e&&e.__esModule?e:{default:e}}var Y=1,q=2,H=3,K=4,V=5;function z(e){e=e||{};var t,n=this.context,r=(0,B.default)(n).getInstance(),i=e.settings,a=[],o=void 0,s=void 0,u=void 0;function l(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function f(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];p.apply(void 0,[Y,this].concat(t))}function d(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];p.apply(void 0,[q,this].concat(t))}function c(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];p.apply(void 0,[H,this].concat(t))}function h(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];p.apply(void 0,[K,this].concat(t))}function g(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];p.apply(void 0,[V,this].concat(t))}function p(e,t){var n="",l=null;o&&(l=(new Date).getTime(),n+="["+(l-u)+"]"),s&&t&&t.getClassName&&(n+="["+t.getClassName()+"]",t.getType&&(n+="["+t.getType()+"]")),n.length>0&&(n+=" ");for(var f=arguments.length,d=Array(f>2?f-2:0),c=2;c<f;c++)d[c-2]=arguments[c];Array.apply(null,d).forEach((function(e){n+=e+" "})),a[e]&&i.get().debug.logLevel>=e&&a[e](n),i&&i.get().debug.dispatchEvent&&r.trigger(k.default.LOG,{message:n,level:e})}return t={getLogger:function(e){return{fatal:f.bind(e),error:d.bind(e),warn:c.bind(e),info:h.bind(e),debug:g.bind(e)}},setLogTimestampVisible:function(e){o=e},setCalleeNameVisible:function(e){s=e}},o=!0,s=!0,u=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(a[Y]=l(window.console.error),a[q]=l(window.console.error),a[H]=l(window.console.warn),a[K]=l(window.console.info),a[V]=l(window.console.debug)),t}z.__dashjs_factory_name="Debug";var W=G.default.getSingletonFactory(z);W.LOG_LEVEL_NONE=0,W.LOG_LEVEL_FATAL=Y,W.LOG_LEVEL_ERROR=q,W.LOG_LEVEL_WARNING=H,W.LOG_LEVEL_INFO=K,W.LOG_LEVEL_DEBUG=V,G.default.updateSingletonFactory(z.__dashjs_factory_name,W);var X=W,Q=Object.defineProperty({default:X},"__esModule",{value:!0}),Z=re(d),$=re(_),J=re(O),ee=re(U),te=re(y),ne=re(Q);function re(e){return e&&e.__esModule?e:{default:e}}function ie(){var e=this.context,t=(0,J.default)(e).getInstance(),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0;function R(e){if(!l||!isNaN(f)){var n=f;if(isNaN(n))if(g){n=e.liveStartTime;var i=a.getCurrentDVRInfo(),o=i?i.range:null;if(o){var u=j(!0);isNaN(u)||(r.info("Start time from URI parameters: "+u),n=Math.max(Math.min(n,u),o.start))}}else{n=h.start;var d=j(!1);!isNaN(d)&&d<n+h.duration&&(r.info("Start time from URI parameters: "+d),n=Math.max(n,d))}isNaN(n)||n===s.getTime()||(t.trigger(ee.default.PLAYBACK_SEEKING,{seekTime:n}),P(n,!1,!0))}}function w(){return parseFloat((N()-L()).toFixed(5))}function N(){return h.start+h.duration}function M(){h&&s&&s.getElement()?s.play():m=!0}function C(){return h&&s?s.isPaused():null}function D(){h&&s&&s.pause()}function O(){return h&&s?s.isSeeking():null}function P(e,n,i){h&&s&&(e!==(isNaN(y)?s.getTime():y)&&((v=!0===i)||(y=e,t.trigger(ee.default.PLAYBACK_SEEK_ASKED)),r.info("Requesting seek to time: "+e+(v?" (internal)":"")),s.setCurrentTime(e,n)))}function L(){return h&&s?s.getTime():null}function F(){var e=L();if(g&&!isNaN(E)){var t=E/1e3;e>t&&(e-=t)}return e}function x(){return h&&s?s.getPlaybackRate():null}function U(){return h&&s?s.getEnded():null}function B(){return g}function k(){if(!g||isNaN(E))return NaN;var e=F();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*u.getClientTimeOffset();return Math.max(((t-E-1e3*e)/1e3).toFixed(3),0)}function G(){m=!1,l=!1,f=NaN,c=0,E=0,y=NaN,s&&(t.off(ee.default.STREAM_INITIALIZED,R,this),t.off(ee.default.DATA_UPDATE_COMPLETED,K,this),t.off(ee.default.BUFFER_LEVEL_STATE_CHANGED,_e,this),t.off(ee.default.LOADING_PROGRESS,me,this),t.off(ee.default.PLAYBACK_PROGRESS,de,this),t.off(ee.default.PLAYBACK_TIME_UPDATED,de,this),t.off(ee.default.PLAYBACK_ENDED,le,this),t.off(ee.default.STREAM_INITIALIZING,ye,this),q(),s.removeEventListener("canplay",V),s.removeEventListener("play",z),s.removeEventListener("waiting",W),s.removeEventListener("playing",X),s.removeEventListener("pause",Q),s.removeEventListener("error",fe),s.removeEventListener("seeking",te),s.removeEventListener("seeked",re),s.removeEventListener("timeupdate",ie),s.removeEventListener("progress",ae),s.removeEventListener("ratechange",oe),s.removeEventListener("loadedmetadata",se),s.removeEventListener("stalled",Ee),s.removeEventListener("ended",ue)),d=null,s=null,h=null,g=null}function j(e){var t=b.getURIFragmentData();if(!t||!t.t)return NaN;var n=i.getStreams()[0].getStreamInfo().start;t.t=t.t.split(",")[0];var r=-1!==t.t.indexOf("posix:")?"now"===t.t.substring(6)?Date.now()/1e3:parseInt(t.t.substring(6)):NaN;return e&&!isNaN(r)?r-E/1e3:parseInt(t.t)+n}function Y(){if(null===d){d=setInterval((function(){var e;t.trigger(ee.default.WALLCLOCK_TIME_UPDATED,{isDynamic:g,time:new Date}),B()&&C()&&(e=Date.now(),(!_||e>_+500)&&(_=e,ie()))}),I.get().streaming.wallclockTimeUpdateInterval)}}function q(){clearInterval(d),d=null}function H(e){if(!C()&&g&&0!==s.getReadyState()){var t=F(),n=function(e,t){var n=a.getCurrentDVRInfo(t),i=n?n.range:null;return i?(r.debug("Checking DVR window for at "+e+" with DVR window range "+i.start+" - "+i.end),e>i.end?Math.max(i.end-c,i.start):e>0&&e+.25<i.start&&Math.abs(e-i.start)<31536e4?i.start:e):NaN}(t,e);!isNaN(n)&&n!==t&&!O()&&(r.debug("UpdateCurrentTime: Seek to actual time: "+n+" from currentTime: "+t),P(n))}}function K(e){if(!e.error){var t=o.convertDataToRepresentationInfo(e.currentRepresentation),n=t?t.mediaInfo.streamInfo:null;null!==n&&h.id===n.id&&(h=n,H())}}function V(){t.trigger(ee.default.CAN_PLAY)}function z(){r.info("Native video element event: play"),H(),Y(),t.trigger(ee.default.PLAYBACK_STARTED,{startTime:L()})}function W(){r.info("Native video element event: waiting"),t.trigger(ee.default.PLAYBACK_WAITING,{playingTime:L()})}function X(){r.info("Native video element event: playing"),t.trigger(ee.default.PLAYBACK_PLAYING,{playingTime:L()})}function Q(){r.info("Native video element event: pause"),t.trigger(ee.default.PLAYBACK_PAUSED,{ended:U()})}function te(){if(v)v=!1;else{var e=L();isNaN(y)||y===e||(e=y),y=NaN,r.info("Seeking to: "+e),Y(),t.trigger(ee.default.PLAYBACK_SEEKING,{seekTime:e})}}function re(){r.info("Native video element event: seeked"),t.trigger(ee.default.PLAYBACK_SEEKED)}function ie(){h&&t.trigger(ee.default.PLAYBACK_TIME_UPDATED,{timeToEnd:w(),time:L()})}function ae(){t.trigger(ee.default.PLAYBACK_PROGRESS)}function oe(){var e=x();r.info("Native video element event: ratechange: ",e),t.trigger(ee.default.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function se(){r.info("Native video element event: loadedmetadata"),t.trigger(ee.default.PLAYBACK_METADATA_LOADED),Y()}function ue(){r.info("Native video element event: ended"),D(),q();var e=i?i.getActiveStreamInfo():null;e&&t.trigger(ee.default.PLAYBACK_ENDED,{isLast:e.isLast})}function le(e){if(d&&e.isLast){r.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var t=e.seekTime?e.seekTime:N();s.setCurrentTime(t),D(),q()}}function fe(e){var n=e.target||e.srcElement;t.trigger(ee.default.PLAYBACK_ERROR,{error:n.error})}function de(){g&&ce()&&I.get().streaming.liveCatchup.playbackRate>0&&!C()&&!O()&&(function(){try{if(ce()&&I.get().streaming.liveCatchup.playbackRate>0&&L()>0){var e=ge(),t=k(),n=p.getLiveDelay(),r=p.getLiveCatchupLatencyThreshold(),i=I.get().streaming.liveCatchup.minDrift;if(e===Z.default.LIVE_CATCHUP_MODE_LOLP){var a=he(),o=I.get().streaming.liveCatchup.playbackBufferMin;return function(e,t,n,r,i,a){try{var o=Math.abs(e-t);return(isNaN(a)||e<=a)&&(o>n||r<i)}catch(e){return!1}}(t,n,i,a,o,r)}return function(e,t,n,r){try{return Math.abs(e-t)>r&&(isNaN(n)||e<=n)}catch(e){return!1}}(t,n,r,i)}}catch(e){return!1}}()?function(){if(s){var e=void 0,t=s.getPlaybackRate(),n=I.get().streaming.liveCatchup.playbackRate,i=k(),o=p.getLiveDelay(),u=he();if(ge()===Z.default.LIVE_CATCHUP_MODE_LOLP){I.get().streaming.liveCatchup.minDrift;var l=I.get().streaming.liveCatchup.playbackBufferMin;e=function(e,t,n,i,a,o,s){var u=e,l=void 0;if(o<a){var f=5*(o-a),d=2*u/(1+Math.pow(Math.E,-f));l=1-u+d,r.debug("[LoL+ playback control_buffer-based] bufferLevel: "+o+", newRate: "+l)}else{if(Math.abs(t-n)<=.02*n)l=1;else{var c=5*(t-n),h=2*u/(1+Math.pow(Math.E,-c));l=1-u+h}r.debug("[LoL+ playback control_latency-based] latency: "+t+", newRate: "+l)}A&&o>n/2&&(A=!1);Math.abs(s-l)<=S&&(l=null);return{newRate:l}}(n,i,o,0,l,u,t)}else e=function(e,t,n,r,i){var a=e,o=t-n,s=5*o,u=2*a/(1+Math.pow(Math.E,-s)),l=1-a+u;A&&(r>n/2?A=!1:o>0&&(l=1));Math.abs(i-l)<=S&&(l=null);return{newRate:l}}(n,i,o,u,t);var f=e.newRate;f&&s.setPlaybackRate(f);var d=i-o;I.get().streaming.liveCatchup.maxDrift>0&&!T&&d>I.get().streaming.liveCatchup.maxDrift?(r.info("Low Latency catchup mechanism. Latency too high, doing a seek to live point"),T=!0,P(((c=a.getCurrentDVRInfo())?c.range:null).end-p.getLiveDelay(),!0,!1)):T=!1}var c}():pe())}function ce(){return I.get().streaming.liveCatchup.enabled||I.get().streaming.lowLatencyEnabled}function he(){var e=null;return i.getActiveStreamProcessors().forEach((function(t){var n=t.getBufferLevel();e=null===e?n:Math.min(e,n)})),e}function ge(){var e=I.get().streaming.liveCatchup.playbackBufferMin;return I.get().streaming.liveCatchup.mode!==Z.default.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?Z.default.LIVE_CATCHUP_MODE_DEFAULT:Z.default.LIVE_CATCHUP_MODE_LOLP}function pe(){s&&s.setPlaybackRate(1)}function me(e){if(!1===e.stream&&I.get().streaming.lowLatencyEnabled&&!isNaN(e.request.duration)){var t=1.2*e.request.duration;if(t>p.getLiveDelay()){r.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",t.toFixed(2));var n={streaming:{liveDelay:t}};I.update(n)}}}function _e(e){e.streamId===h.id&&(ce()?e.state!==$.default.BUFFER_EMPTY||O()||A||(A=!0,pe()):s.setStallState(e.mediaType,e.state===$.default.BUFFER_EMPTY))}function Ee(e){t.trigger(ee.default.PLAYBACK_STALLED,{e:e})}function ye(e){!function(e,t){if(e&&e.manifestInfo&&e.manifestInfo.serviceDescriptions){for(var n=void 0,i=0;i<e.manifestInfo.serviceDescriptions.length;i++){var a=e.manifestInfo.serviceDescriptions[i];if(a.schemeIdUri===Z.default.SERVICE_DESCRIPTION_LL_SCHEME){n=a;break}}n&&t&&t.supplementalProperties&&"true"===t.supplementalProperties[Z.default.SUPPLEMENTAL_PROPERTY_LL_SCHEME]&&(n.latency&&n.latency.target>0&&(r.debug("Apply LL properties coming from service description. Target Latency (ms):",n.latency.target),I.update({streaming:{lowLatencyEnabled:!0,liveDelay:n.latency.target/1e3,liveCatchup:{minDrift:n.latency.max>n.latency.target?(n.latency.max-n.latency.target)/1e3:void 0}}})),n.playbackRate&&n.playbackRate.max>1&&(r.debug("Apply LL properties coming from service description. Max PlaybackRate:",n.playbackRate.max),I.update({streaming:{lowLatencyEnabled:!0,liveCatchup:{playbackRate:n.playbackRate.max-1}}})))}}(e.streamInfo,e.mediaInfo)}return n={initialize:function(e,n,r){h=e,s.addEventListener("canplay",V),s.addEventListener("play",z),s.addEventListener("waiting",W),s.addEventListener("playing",X),s.addEventListener("pause",Q),s.addEventListener("error",fe),s.addEventListener("seeking",te),s.addEventListener("seeked",re),s.addEventListener("timeupdate",ie),s.addEventListener("progress",ae),s.addEventListener("ratechange",oe),s.addEventListener("loadedmetadata",se),s.addEventListener("stalled",Ee),s.addEventListener("ended",ue),g=h.manifestInfo.isDynamic,T=!1,A=!1,l=!0===n,f=r,v=!1;var i="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",a=/safari/.test(i)&&!/chrome/.test(i);S=a?.25:.02,t.on(ee.default.STREAM_INITIALIZED,R,this),t.on(ee.default.DATA_UPDATE_COMPLETED,K,this),t.on(ee.default.LOADING_PROGRESS,me,this),t.on(ee.default.BUFFER_LEVEL_STATE_CHANGED,_e,this),t.on(ee.default.PLAYBACK_PROGRESS,de,this),t.on(ee.default.PLAYBACK_TIME_UPDATED,de,this),t.on(ee.default.PLAYBACK_ENDED,le,this,{priority:J.default.EVENT_PRIORITY_HIGH}),t.on(ee.default.STREAM_INITIALIZING,ye,this),m&&(m=!1,M())},setConfig:function(e){e&&(e.streamController&&(i=e.streamController),e.dashMetrics&&(a=e.dashMetrics),e.mediaPlayerModel&&(p=e.mediaPlayerModel),e.adapter&&(o=e.adapter),e.videoModel&&(s=e.videoModel),e.timelineConverter&&(u=e.timelineConverter),e.uriFragmentModel&&(b=e.uriFragmentModel),e.settings&&(I=e.settings))},getStartTimeFromUriParameters:j,getTimeToStreamEnd:w,getTime:L,getNormalizedTime:F,getPlaybackRate:x,getPlayedRanges:function(){return h&&s?s.getPlayedRanges():null},getEnded:U,getIsDynamic:B,getStreamController:function(){return i},computeAndSetLiveDelay:function(e,t,n){var r,i=void 0,a=void 0,s=!isNaN(e)&&isFinite(e)?e:NaN,u=o.getSuggestedPresentationDelay();if(i=I.get().streaming.lowLatencyEnabled?0:p.getLiveDelay()?p.getLiveDelay():null===I.get().streaming.liveDelayFragmentCount||isNaN(I.get().streaming.liveDelayFragmentCount)||isNaN(s)?!0===I.get().streaming.useSuggestedPresentationDelay&&null!==u&&!isNaN(u)&&u>0?u:isNaN(s)?isNaN(n)?4*h.manifestInfo.minBufferTime:4*n:4*s:s*I.get().streaming.liveDelayFragmentCount,null!==(r=o.getAvailabilityStartTime())&&(E=r),t>0){var l=Math.max(t-10,t/2);a=Math.min(i,l)}else a=i;return c=a,a},getLiveDelay:function(){return c},setLiveDelay:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&e<c||(c=e)},getCurrentLiveLatency:k,play:M,isPaused:C,pause:D,isSeeking:O,getStreamEndTime:N,seek:P,updateCurrentTime:H,reset:G},r=(0,ne.default)(e).getInstance().getLogger(n),G(),n}ie.__dashjs_factory_name="PlaybackController";var ae=te.default.getSingletonFactory(ie),oe=Object.defineProperty({default:ae},"__esModule",{value:!0});function se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ue=function e(){se(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._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null};ue.GET="GET",ue.HEAD="HEAD",ue.MPD_TYPE="MPD",ue.XLINK_EXPANSION_TYPE="XLinkExpansion",ue.INIT_SEGMENT_TYPE="InitializationSegment",ue.INDEX_SEGMENT_TYPE="IndexSegment",ue.MEDIA_SEGMENT_TYPE="MediaSegment",ue.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",ue.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",ue.LICENSE="license",ue.OTHER_TYPE="other";var le=ue,fe=function e(){se(this,e),this.s=null,this.d=null,this.b=[]},de=Object.defineProperty({HTTPRequest:le,HTTPRequestTrace:fe},"__esModule",{value:!0}),ce=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var he=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=e.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaStartTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=t||null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer",this.representationId=null}return ce(e,[{key:"isInitializationRequest",value:function(){return this.type&&this.type===de.HTTPRequest.INIT_SEGMENT_TYPE}},{key:"setInfo",value:function(e){this.type=e&&e.init?de.HTTPRequest.INIT_SEGMENT_TYPE:de.HTTPRequest.MEDIA_SEGMENT_TYPE,this.url=e&&e.url?e.url:null,this.range=e&&e.range?e.range.start+"-"+e.range.end:null,this.mediaType=e&&e.mediaType?e.mediaType:null}}]),e}();he.ACTION_DOWNLOAD="download",he.ACTION_COMPLETE="complete";var ge=he,pe=Object.defineProperty({default:ge},"__esModule",{value:!0}),me=Ee(y),_e=Ee(pe);function Ee(e){return e&&e.__esModule?e:{default:e}}function ye(e){var t=(e=e||{}).eventBus,n=e.events,r=e.dashMetrics,i=e.fragmentLoader,a=e.debug,o=e.streamInfo,s=e.type,u=void 0,l=void 0,f=void 0,d=void 0;function c(e){var t;return!!e&&(t=!1,f.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===_e.default.ACTION_COMPLETE&&e.action===t.action}(e,n))return t=!0;var r,i})),t)}function h(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function g(e){f=f.filter((function(t){var n=h(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-n}))}function p(e,t){t<=e+.5||(f=f.filter((function(n){var r=h(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r})))}function m(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)?h(i):n,!isNaN(a)&&!isNaN(o)&&t+n>=a&&t-n<o||isNaN(a)&&isNaN(t))return i}return null}function _(e,t){r.addSchedulingInfo(e,t),r.addRequestsQueue(e.mediaType,d,f)}function E(e){e.sender===i&&(d.splice(d.indexOf(e.request),1),e.response&&!e.error&&f.push(e.request),_(e.request,e.error?"failed":"executed"),t.trigger(n.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:o.id,mediaType:s}))}function y(e){e.sender===i&&t.trigger(n.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:o.id,mediaType:s})}function v(e){e.sender===i&&t.trigger(n.FRAGMENT_LOADING_ABANDONED,{request:e.request},{streamId:o.id,mediaType:s})}function T(){f=[],d=[]}return u={getStreamId:function(){return o.id},getType:function(){return s},getRequests:function(e){var t=e?e.state instanceof Array?e.state:[e.state]:[],n=[];return t.forEach((function(t){var r=function(e){var t=void 0;switch(e){case"loading":t=d;break;case"executed":t=f;break;default:t=[]}return t}(t);n=n.concat(function(e,t){if(t.hasOwnProperty("time"))return[m(e,t.time,t.threshold)];return e.filter((function(e){for(var n in t)if("state"!==n&&t.hasOwnProperty(n)&&e[n]!=t[n])return!1;return!0}))}(r,e))})),n},isFragmentLoaded:c,isFragmentLoadedOrPending:function(e){var t=!1,n=0,r=void 0;if(!(t=c(e)))for(n=0;n<d.length;n++)r=d[n],e.url===r.url&&e.startTime===r.startTime&&(t=!0);return t},removeExecutedRequestsBeforeTime:g,removeExecutedRequestsAfterTime:function(e){f=f.filter((function(t){return isNaN(t.startTime)||void 0!==e&&t.startTime<e}))},syncExecutedRequestsWithBufferedRange:function(e,t){if(e&&0!==e.length){for(var n=0,r=0,i=e.length;r<i;r++)p(n,e.start(r)),n=e.end(r);t>0&&p(n,t)}else g()},abortRequests:function(){l.debug("abort requests"),i.abort(),d=[]},executeRequest:function(e){switch(e.action){case _e.default.ACTION_COMPLETE:f.push(e),_(e,"executed"),l.debug("STREAM_COMPLETED"),t.trigger(n.STREAM_COMPLETED,{request:e},{streamId:e.mediaInfo.streamInfo.id,mediaType:e.mediaType});break;case _e.default.ACTION_DOWNLOAD:_(e,"loading"),d.push(e),function(e){t.trigger(n.FRAGMENT_LOADING_STARTED,{request:e},{streamId:o.id,mediaType:s}),i.load(e)}(e);break;default:l.warn("Unknown request action.")}},reset:function(){t.off(n.LOADING_COMPLETED,E,this),t.off(n.LOADING_DATA_PROGRESS,y,this),t.off(n.LOADING_ABANDONED,v,this),i&&i.reset(),T()},addExecutedRequest:function(e){f.push(e)}},l=a.getLogger(u),T(),t.on(n.LOADING_COMPLETED,E,u),t.on(n.LOADING_DATA_PROGRESS,y,u),t.on(n.LOADING_ABANDONED,v,u),u}ye.__dashjs_factory_name="FragmentModel";var ve=me.default.getClassFactory(ye);ve.FRAGMENT_MODEL_LOADING="loading",ve.FRAGMENT_MODEL_EXECUTED="executed",ve.FRAGMENT_MODEL_CANCELED="canceled",ve.FRAGMENT_MODEL_FAILED="failed",me.default.updateClassFactory(ye.__dashjs_factory_name,ve);var Te=ve,Ae=Object.defineProperty({default:Te},"__esModule",{value:!0});var Se=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},be=Object.defineProperty({default:Se},"__esModule",{value:!0});var Ie=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.captionData=null,this.label=null,this.lang=null,this.defaultTrack=!1,this.kind=null,this.isFragmented=!1,this.isEmbedded=!1},Re=Object.defineProperty({default:Ie},"__esModule",{value:!0}),we=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Ne=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<t.boxes.length;n++)this.boxes.push(new e(t.boxes[n]));switch(this.isComplete=!0,t.type){case"sidx":if(this.timescale=t.timescale,this.earliest_presentation_time=t.earliest_presentation_time,this.first_offset=t.first_offset,this.references=t.references,t.references){this.references=[];for(var r=0;r<t.references.length;r++){var i={reference_type:t.references[r].reference_type,referenced_size:t.references[r].referenced_size,subsegment_duration:t.references[r].subsegment_duration};this.references.push(i)}}break;case"emsg":this.id=t.id,this.version=1===t.version?1:0,this.value=t.value,this.timescale=t.timescale,this.scheme_id_uri=t.scheme_id_uri,this.presentation_time_delta=1===t.version?t.presentation_time:t.presentation_time_delta,this.event_duration=t.event_duration,this.message_data=t.message_data;break;case"mdhd":this.timescale=t.timescale;break;case"mfhd":this.sequence_number=t.sequence_number;break;case"subs":this.entry_count=t.entry_count,this.entries=t.entries;break;case"tfhd":this.base_data_offset=t.base_data_offset,this.sample_description_index=t.sample_description_index,this.default_sample_duration=t.default_sample_duration,this.default_sample_size=t.default_sample_size,this.default_sample_flags=t.default_sample_flags,this.flags=t.flags;break;case"tfdt":this.version=t.version,this.baseMediaDecodeTime=t.baseMediaDecodeTime,this.flags=t.flags;break;case"trun":if(this.sample_count=t.sample_count,this.first_sample_flags=t.first_sample_flags,this.data_offset=t.data_offset,this.flags=t.flags,this.samples=t.samples,t.samples){this.samples=[];for(var a=0,o=t.samples.length;a<o;a++){var s={sample_size:t.samples[a].sample_size,sample_duration:t.samples[a].sample_duration,sample_composition_time_offset:t.samples[a].sample_composition_time_offset};this.samples.push(s)}}}}return we(e,[{key:"getChildBox",value:function(e){for(var t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}},{key:"getChildBoxes",value:function(e){for(var t=[],n=0;n<this.boxes.length;n++)this.boxes[n].type===e&&t.push(this.boxes[n]);return t}}]),e}(),Me=De(Object.defineProperty({default:Ne},"__esModule",{value:!0})),Ce=De(y);function De(e){return e&&e.__esModule?e:{default:e}}function Oe(){var e=void 0;function t(t){var r=[];if(!t||!e||"function"!=typeof e.fetchAll)return r;for(var i=e.fetchAll(t),a=void 0,o=0,s=i.length;o<s;o++)(a=n(i[o]))&&r.push(a);return r}function n(e){if(!e)return null;var t=new Me.default(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}return{getBox:function(t){return t&&e&&e.boxes&&0!==e.boxes.length&&"function"==typeof e.fetch?n(e.fetch(t)):null},getBoxes:t,setData:function(t){e=t},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;var n=t(e.boxes[e.boxes.length-1].type);return n.length>0?n[n.length-1]:null}}}Oe.__dashjs_factory_name="IsoFile";var Pe=Ce.default.getClassFactory(Oe),Le=Object.defineProperty({default:Pe},"__esModule",{value:!0}),Fe=o((function(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<e.byteLength;){var a=e.getUint8(i++);a<128||(a<224?(a=(31&a)<<6,a|=63&e.getUint8(i++)):a<240?(a=(15&a)<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++)):(a=(7&a)<<18,a|=(63&e.getUint8(i++))<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++))),r.push(String.fromCharCode(a))}else for(;i<e.byteLength;)r.push(String.fromCharCode(e.getUint8(i++)));return r.join("")},n.Utils.utf8ToByteArray=function(e){var t,n;if("undefined"!=typeof TextEncoder)t=(new TextEncoder).encode(e);else for(t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>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<e.boxes.length;a++)if(r===e.boxes[a].type){i=a+1;break}}e.boxes.splice(i,0,t)}else e.boxes.push(t)},t.parseBuffer=n.parseBuffer,t.addBoxProcessor=n.addBoxProcessor,t.createFile=n.createFile,t.createBox=n.createBox,t.createFullBox=n.createFullBox,t.Utils=n.Utils,n.Cursor=function(e){this.offset=void 0===e?0:e};var r=function(e){this._cursor=new n.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};r.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},r.prototype.fetchAll=function(e,t){var n=[];return r._sweep.call(this,e,n,t),n},r.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=i.parse(this);if(void 0===e.type)break;this.boxes.push(e)}return this},r._sweep=function(e,t,n){for(var i in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;r._sweep.call(this.boxes[i],e,t,n)}},r.prototype.write=function(){var e,t=0;for(e=0;e<this.boxes.length;e++)t+=this.boxes[e].getLength(!1);var n=new Uint8Array(t);for(this._rawo=new DataView(n.buffer),this.bytes=n,this._cursor.offset=0,e=0;e<this.boxes.length;e++)this.boxes[e].write();return n.buffer},r.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)};var i=function(){this._cursor=new n.Cursor};i.parse=function(e){var t=new i;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},i.create=function(e){var t=new i;return t.type=e,t.boxes=[],t},i.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca"],i.prototype._boxProcessors={},i.prototype._procField=function(e,t,n){this._parsing?this[e]=this._readField(t,n):this._writeField(t,n,this[e])},i.prototype._procFieldArray=function(e,t,n,r){var i;if(this._parsing)for(this[e]=[],i=0;i<t;i++)this[e][i]=this._readField(n,r);else for(i=0;i<this[e].length;i++)this._writeField(n,r,this[e][i])},i.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},i.prototype._procEntries=function(e,t,n){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e].push({}),n.call(this,this[e][r]);else for(r=0;r<t;r++)n.call(this,this[e][r])},i.prototype._procSubEntries=function(e,t,n,r){var i;if(this._parsing)for(e[t]=[],i=0;i<n;i++)e[t].push({}),r.call(this,e[t][i]);else for(i=0;i<n;i++)r.call(this,e[t][i])},i.prototype._procEntryField=function(e,t,n,r){this._parsing?e[t]=this._readField(n,r):this._writeField(n,r,e[t])},i.prototype._procSubBoxes=function(e,t){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push(i.parse(this));else for(n=0;n<t;n++)this._rawo?this[e][n].write():this.size+=this[e][n].getLength()},i.prototype._readField=function(e,t){switch(e){case"uint":return this._readUint(t);case"int":return this._readInt(t);case"template":return this._readTemplate(t);case"string":return-1===t?this._readTerminatedString():this._readString(t);case"data":return this._readData(t);case"utf8":return this._readUTF8String();default:return-1}},i.prototype._readInt=function(e){var t=null,n=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(n);break;case 16:t=this._raw.getInt16(n);break;case 32:t=this._raw.getInt32(n);break;case 64:var r=this._raw.getInt32(n),i=this._raw.getInt32(n+4);t=r*Math.pow(2,32)+i}return this._cursor.offset+=e>>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;n<e;n++){var r=this._readUint(8);t+=String.fromCharCode(r)}return t},i.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/Math.pow(2,e/2)},i.prototype._readTerminatedString=function(){for(var e="";this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(0===t)break;e+=String.fromCharCode(t)}return e},i.prototype._readData=function(e){var t=e>0?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<this._raw.byteLength;)this.boxes.push(i.parse(this))},i.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)},i.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,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._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},i.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(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._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},i.prototype._writeInt=function(e,t){if(this._rawo){var n=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(n,t);break;case 16:this._rawo.setInt16(n,t);break;case 32:this._rawo.setInt32(n,t);break;case 64:var r=Math.floor(t/Math.pow(2,32)),i=t-r*Math.pow(2,32);this._rawo.setUint32(n,r),this._rawo.setUint32(n+4,i)}this._cursor.offset+=e>>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<e;n++)this._writeUint(8,t.charCodeAt(n))},i.prototype._writeTerminatedString=function(e){if(0!==e.length){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},i.prototype._writeTemplate=function(e,t){var n=Math.floor(t),r=(t-n)*Math.pow(2,e/2);this._writeUint(e/2,n),this._writeUint(e/2,r)},i.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,n=0;n<e.length;n++)this._rawo.setInt8(t+n,e[n]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},i.prototype._writeUTF8String=function(e){var t=n.Utils.utf8ToByteArray(e);if(this._rawo)for(var r=new DataView(this._rawo.buffer,this._cursor.offset,t.length),i=0;i<t.length;i++)r.setUint8(i,t[i]);else this.size+=t.length},i.prototype._writeField=function(e,t,n){switch(e){case"uint":this._writeUint(t,n);break;case"int":this._writeInt(t,n);break;case"template":this._writeTemplate(t,n);break;case"string":-1==t?this._writeTerminatedString(n):this._writeString(t,n);break;case"data":this._writeData(n);break;case"utf8":this._writeUTF8String(n)}},i.prototype._boxProcessors.avc1=i.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},i.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"segment_duration","uint",1===this.version?64:32),this._procEntryField(e,"media_time","int",1===this.version?64:32),this._procEntryField(e,"media_rate_integer","int",16),this._procEntryField(e,"media_rate_fraction","int",16)}))},i.prototype._boxProcessors.emsg=function(){this._procFullBox(),1==this.version?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},i.prototype._boxProcessors.free=i.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},i.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},i.prototype._boxProcessors.ftyp=i.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",e,"string",4)},i.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},i.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},i.prototype._boxProcessors.mdhd=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._parsing||"string"!=typeof this.language||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>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(){}}));var xe=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},Ue=Object.defineProperty({default:xe},"__esModule",{value:!0}),Be=qe(Q),ke=qe(Le),Ge=qe(y),je=qe(Fe),Ye=qe(Ue);function qe(e){return e&&e.__esModule?e:{default:e}}function He(){var e=void 0,t=void 0,n=this.context;function r(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=je.default.parseBuffer(e),r=(0,ke.default)(n).create();return r.setData(t),r}function i(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function a(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:r,findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new Ye.default(0,!1);for(var r=t instanceof ArrayBuffer?new Uint8Array(t):t,o=void 0,s=0;n<r.byteLength;){var u=i(r,n),l=a(r,n+4);if(0===u)break;n+u<=r.byteLength&&(e.indexOf(l)>=0?o=new Ye.default(n,!0,u):s=n+u),n+=u}return o||new Ye.default(s,!1)},getMediaTimescaleFromMoov:function(e){var t=r(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,i=r(e),a=i.getBoxes("moof"),o=i.getBoxes("mfhd"),s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0;n=i.getBoxes("moof").length,t=o[o.length-1].sequence_number,u=0,d=[];var T=-1,A=-1;for(m=0;m<a.length;m++){var S=a[m],b=S.getChildBoxes("traf");for(g=0;g<b.length;g++){var I=b[g],R=I.getChildBox("tfhd"),w=I.getChildBox("tfdt");f=w.baseMediaDecodeTime;var N=I.getChildBoxes("trun"),M=I.getChildBoxes("subs");for(p=0;p<N.length;p++){var C=N[p];for(u=C.sample_count,y=(R.base_data_offset||0)+(C.data_offset||0),h=0;h<u;h++){s=void 0!==(c=C.samples[h]).sample_duration?c.sample_duration:R.default_sample_duration,l=void 0!==c.sample_size?c.sample_size:R.default_sample_size;var D={dts:f,cts:f+(void 0!==c.sample_composition_time_offset?c.sample_composition_time_offset:0),duration:s,offset:S.offset+y,size:l,subSizes:[l]};if(M)for(_=0;_<M.length;_++){var O=M[_];if(T<O.entry_count-1&&h>A&&(T++,A+=O.entries[T].sample_delta),h==A){D.subSizes=[];var P=O.entries[T];for(E=0;E<P.subsample_count;E++)D.subSizes.push(P.subsamples[E].subsample_size)}}d.push(D),y+=l,f+=s}}v=f-w.baseMediaDecodeTime}}return{sampleList:d,lastSequenceNumber:t,totalDuration:v,numSequences:n}},findInitRange:function(t){var n=null,i=r(t);if(!i)return n;var a=i.getBox("ftyp"),o=i.getBox("moov");return e.debug("Searching for initialization."),o&&o.isComplete&&(n=(a?a.offset:o.offset)+"-"+(o.offset+o.size-1),e.debug("Found the initialization. Range: "+n)),n},parsePayload:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new Ye.default(0,!1);for(var r=t instanceof ArrayBuffer?new Uint8Array(t):t,o=void 0,s=0;n<r.byteLength;){var u=i(r,n),l=a(r,n+4);if(0===u)break;n+u<=r.byteLength&&(e.indexOf(l)>=0?o=new Ye.default(n,!0,u,l):s=n+u),n+=u}return o||new Ye.default(s,!1)}},e=(0,Be.default)(n).getInstance().getLogger(t),t}He.__dashjs_factory_name="BoxParser";var Ke=Ge.default.getSingletonFactory(He),Ve=Object.defineProperty({default:Ke},"__esModule",{value:!0}),ze="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},We=function(e,t){if((void 0===e?"undefined":ze(e))!==t)throw $e.default.BAD_ARGUMENT_ERROR},Xe=function(e){if(null===e||isNaN(e)||e%1!=0)throw $e.default.BAD_ARGUMENT_ERROR+" : argument is not an integer"},Qe=function(e,t,n){if(e<t||e>n)throw $e.default.BAD_ARGUMENT_ERROR+" : argument out of range"},Ze=function(e){if("string"!=typeof e||e!==$e.default.AUDIO&&e!==$e.default.VIDEO)throw $e.default.BAD_ARGUMENT_ERROR},$e=function(e){return e&&e.__esModule?e:{default:e}}(d);var Je=Object.defineProperty({checkParameterType:We,checkInteger:Xe,checkRange:Qe,checkIsVideoOrAudioType:Ze},"__esModule",{value:!0}),et=function(e){return e&&e.__esModule?e:{default:e}}(y);function tt(){return{customTimeRangeArray:[],length:0,add:function(e,t){var n=0;for(n=0;n<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n<this.customTimeRangeArray.length-1;n++)this.mergeRanges(n,n+1)&&n--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(e,t){for(var n=0;n<this.customTimeRangeArray.length;n++)if(e<=this.customTimeRangeArray[n].start&&t>=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end){this.customTimeRangeArray.splice(n+1,0,{start:t,end:this.customTimeRangeArray[n].end}),this.customTimeRangeArray[n].end=e;break}e>this.customTimeRangeArray[n].start&&e<this.customTimeRangeArray[n].end?this.customTimeRangeArray[n].end=e:t>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end&&(this.customTimeRangeArray[n].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){var n=this.customTimeRangeArray[e],r=this.customTimeRangeArray[t];return n.start<=r.start&&r.start<=n.end&&n.end<=r.end?(n.end=r.end,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&r.end<=n.end?(n.start=r.start,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&n.end<=r.end?(this.customTimeRangeArray.splice(e,1),!0):n.start<=r.start&&r.start<=n.end&&r.end<=n.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return(0,Je.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return(0,Je.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}tt.__dashjs_factory_name="CustomTimeRanges";var nt=et.default.getClassFactory(tt),rt=Object.defineProperty({default:nt},"__esModule",{value:!0}),it=o((function(e,t){!function(e){e.ns_tt="http://www.w3.org/ns/ttml",e.ns_tts="http://www.w3.org/ns/ttml#styling",e.ns_ttp="http://www.w3.org/ns/ttml#parameter",e.ns_xml="http://www.w3.org/XML/1998/namespace",e.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",e.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",e.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",e.ns_ebutts="urn:ebu:tt:style"}(t)})),at=o((function(e,t){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var a,o=null,s=i[e.toLowerCase()];return void 0!==s?o=s:null!==(a=t.exec(e))?o=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),void 0!==a[4]?parseInt(a[4],16):255]:null!==(a=n.exec(e))?o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),255]:null!==(a=r.exec(e))&&(o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseInt(a[4])]),o};var a=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;e.parseLength=function(e){var t,n=null;return null!==(t=a.exec(e))&&(n={value:parseFloat(t[1]),unit:t[2]}),n},e.parseTextShadow=function(t){for(var n=t.match(/([^\(,\)]|\([^\)]+\))+/g),r=[],i=0;i<n.length;i++){var a=n[i].split(" ");if(1===a.length&&"none"===a[0])return"none";if(a.length>1&&a.length<5){var o=[null,null,null,null],s=e.parseLength(a.shift());if(null===s)return null;if(o[0]=s,null===(s=e.parseLength(a.shift())))return null;if(o[1]=s,0===a.length){r.push(o);continue}if(null!==(s=e.parseLength(a[0]))&&(o[2]=s,a.shift()),0===a.length){r.push(o);continue}var u=e.parseColor(a[0]);if(null===u)return null;o[3]=u,r.push(o)}}return r},e.parsePosition=function(t){var n=t.split(" "),r=function(e){return"center"===e||"left"===e||"top"===e||"bottom"===e||"right"===e};if(n.length>4)return null;for(var i=0;i<n.length;i++)if(!r(n[i])){var a=e.parseLength(n[i]);if(null===a)return null;n[i]=a}for(var o={h:{edge:"left",offset:{value:50,unit:"%"}},v:{edge:"top",offset:{value:50,unit:"%"}}},s=0;s<n.length;){var u=n[s++];if(r(u)){var l={value:0,unit:"%"};2!==n.length&&s<n.length&&!r(n[s])&&(l=n[s++]),"right"===u?(o.h.edge=u,o.h.offset=l):"bottom"===u?(o.v.edge=u,o.v.offset=l):"left"===u?o.h.offset=l:"top"===u&&(o.v.offset=l)}else{if(1!==n.length&&2!==n.length)return null;1===s?o.h.offset=u:o.v.offset=u}}return o},e.ComputedLength=function(e,t){this.rw=e,this.rh=t},e.ComputedLength.prototype.toUsedLength=function(e,t){return e*this.rw+t*this.rh},e.ComputedLength.prototype.isZero=function(){return 0===this.rw&&0===this.rh},e.toComputedLength=function(t,n,r,i,a,o){return"%"===n&&i?new e.ComputedLength(i.rw*t/100,i.rh*t/100):"em"===n&&r?new e.ComputedLength(r.rw*t,r.rh*t):"c"===n&&a?new e.ComputedLength(t*a.rw,t*a.rh):"px"===n&&o?new e.ComputedLength(t*o.rw,t*o.rh):"rh"===n?new e.ComputedLength(0,t/100):"rw"===n?new e.ComputedLength(t/100,0):null}}(t)})),ot=o((function(e,t){!function(e,t,n){function r(e,t,n,r,i,a,o,s){this.name=t,this.ns=e,this.qname=e+" "+t,this.inherit=i,this.animatable=a,this.initial=n,this.applies=r,this.parse=o,this.compute=s}for(var i in e.all=[new r(t.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,n.parseColor,null),new r(t.ns_tts,"color","white",["span"],!0,!0,n.parseColor,null),new r(t.ns_tts,"direction","ltr",["p","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"displayAlign","before",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"extent","auto",["tt","region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,a){var o,s;if("auto"===i)o=new n.ComputedLength(0,1);else if(null===(o=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)s=new n.ComputedLength(1,0);else if(null===(s=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:o,w:s}})),new r(t.ns_tts,"fontFamily","default",["span","p"],!0,!0,(function(e){for(var t=e.split(","),n=[],r=0;r<t.length;r++)"'"!==t[r].charAt(0)&&'"'!==t[r].charAt(0)&&"default"===t[r]?n.push("monospaceSerif"):n.push(t[r]);return n}),null),new r(t.ns_tts,"shear","0%",["p"],!0,!0,n.parseLength,(function(e,t,n,r){return"%"!==r.unit?null:Math.abs(r.value)>100?100*Math.sign(r.value):r.value})),new r(t.ns_tts,"fontSize","1c",["span","p"],!0,!0,n.parseLength,(function(t,r,i,a,o){return n.toComputedLength(a.value,a.unit,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,t.cellLength.h,t.pxLength.h)})),new r(t.ns_tts,"fontStyle","normal",["span","p"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"fontWeight","normal",["span","p"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"lineHeight","normal",["p"],!0,!0,(function(e){return"normal"===e?e:n.parseLength(e)}),(function(t,r,i,a,o){var s;if("normal"===a)s=a;else if(null===(s=n.toComputedLength(a.value,a.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h)))return null;return s})),new r(t.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new r(t.ns_tts,"origin","auto",["region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,a){var o,s;if("auto"===i)o=new n.ComputedLength(0,0);else if(null===(o=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)s=new n.ComputedLength(0,0);else if(null===(s=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:o,w:s}})),new r(t.ns_tts,"overflow","hidden",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"padding","0px",["region"],!1,!0,(function(e){var t=e.split(" ");if(t.length>4)return null;for(var r=[],i=0;i<t.length;i++){var a=n.parseLength(t[i]);if(!a)return null;r.push(a)}return r}),(function(t,r,i,a,o){var s;if(1===a.length)s=[a[0],a[0],a[0],a[0]];else if(2===a.length)s=[a[0],a[1],a[0],a[1]];else if(3===a.length)s=[a[0],a[1],a[2],a[1]];else{if(4!==a.length)return null;s=[a[0],a[1],a[2],a[3]]}var u=i.styleAttrs[e.byName.writingMode.qname];if("lrtb"===u||"lr"===u)s=[s[0],s[3],s[2],s[1]];else if("rltb"===u||"rl"===u)s=[s[0],s[1],s[2],s[3]];else if("tblr"===u)s=[s[3],s[0],s[1],s[2]];else{if("tbrl"!==u&&"tb"!==u)return null;s=[s[3],s[2],s[1],s[0]]}for(var l=[],f=0;f<s.length;f++)if(0===s[f].value)l[f]=new n.ComputedLength(0,0);else if(l[f]=n.toComputedLength(s[f].value,s[f].unit,i.styleAttrs[e.byName.fontSize.qname],0===f||2===f?i.styleAttrs[e.byName.extent.qname].h:i.styleAttrs[e.byName.extent.qname].w,0===f||2===f?t.cellLength.h:t.cellLength.w,0===f||2===f?t.pxLength.h:t.pxLength.w),null===l[f])return null;return l})),new r(t.ns_tts,"position","top left",["region"],!1,!0,(function(e){return n.parsePosition(e)}),(function(t,r,i,a){var o,s;return null===(o=n.toComputedLength(a.v.offset.value,a.v.offset.unit,null,new n.ComputedLength(-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-i.styleAttrs[e.byName.extent.qname].h.rh),null,t.pxLength.h))?null:("bottom"===a.v.edge&&(o=new n.ComputedLength(-o.rw-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-o.rh-i.styleAttrs[e.byName.extent.qname].h.rh)),s=n.toComputedLength(a.h.offset.value,a.h.offset.unit,null,new n.ComputedLength(t.dimensions.w.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-i.styleAttrs[e.byName.extent.qname].w.rh),null,t.pxLength.w),null===o?null:("right"===a.h.edge&&(s=new n.ComputedLength(t.dimensions.w.rw-s.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-s.rh-i.styleAttrs[e.byName.extent.qname].w.rh)),{h:o,w:s}))})),new r(t.ns_tts,"ruby","none",["span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"rubyAlign","center",["span"],!0,!0,(function(e){return"center"!==e&&"spaceAround"!==e?null:e}),null),new r(t.ns_tts,"rubyPosition","outside",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"rubyReserve","none",["p"],!0,!0,(function(e){var t=e.split(" "),r=[null,null];if(0===t.length||t.length>2)return null;if("none"!==t[0]&&"both"!==t[0]&&"after"!==t[0]&&"before"!==t[0]&&"outside"!==t[0])return null;if(r[0]=t[0],2===t.length&&"none"!==t[0]){var i=n.parseLength(t[1]);if(!i)return null;r[1]=i}return r}),(function(t,r,i,a,o){if("none"===a[0])return a;var s=null;return null===(s=null===a[1]?new n.ComputedLength(.5*i.styleAttrs[e.byName.fontSize.qname].rw,.5*i.styleAttrs[e.byName.fontSize.qname].rh):n.toComputedLength(a[1].value,a[1].unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h))?null:[a[0],s]})),new r(t.ns_tts,"showBackground","always",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"textAlign","start",["p"],!0,!0,(function(e){return e}),(function(e,t,n,r,i){return"left"===r?"start":"right"===r?"end":r})),new r(t.ns_tts,"textCombine","none",["span"],!0,!0,(function(e){return"none"===e||"all"===e?e:null}),null),new r(t.ns_tts,"textDecoration","none",["span"],!0,!0,(function(e){return e.split(" ")}),null),new r(t.ns_tts,"textEmphasis","none",["span"],!0,!0,(function(e){for(var t=e.split(" "),r={style:null,symbol:null,color:null,position:null},i=0;i<t.length;i++)if("none"===t[i]||"auto"===t[i])r.style=t[i];else if("filled"===t[i]||"open"===t[i])r.style=t[i];else if("circle"===t[i]||"dot"===t[i]||"sesame"===t[i])r.symbol=t[i];else if("current"===t[i])r.color=t[i];else if("outside"===t[i]||"before"===t[i]||"after"===t[i])r.position=t[i];else if(r.color=n.parseColor(t[i]),null===r.color)return null;return null==r.style&&null==r.symbol?r.style="auto":(r.symbol=r.symbol||"circle",r.style=r.style||"filled"),r.position=r.position||"outside",r.color=r.color||"current",r}),null),new r(t.ns_tts,"textOutline","none",["span"],!0,!0,(function(e){if("none"===e)return e;var t={},r=e.split(" ");if(0===r.length||r.length>2)return null;var i=n.parseColor(r[0]);if(t.color=i,null!==i&&r.shift(),1!==r.length)return null;var a=n.parseLength(r[0]);return a?(t.thickness=a,t):null}),(function(t,r,i,a,o){if("none"===a)return a;var s={};return null===a.color?s.color=i.styleAttrs[e.byName.color.qname]:s.color=a.color,s.thickness=n.toComputedLength(a.thickness.value,a.thickness.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h),null===s.thickness?null:s})),new r(t.ns_tts,"textShadow","none",["span"],!0,!0,n.parseTextShadow,(function(t,r,i,a){if("none"===a)return a;for(var o=[],s=0;s<a.length;s++){var u={};if(u.x_off=n.toComputedLength(a[s][0].value,a[s][0].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.w),null===u.x_off)return null;if(u.y_off=n.toComputedLength(a[s][1].value,a[s][1].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===u.y_off)return null;if(null===a[s][2])u.b_radius=0;else if(u.b_radius=n.toComputedLength(a[s][2].value,a[s][2].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===u.b_radius)return null;null===a[s][3]?u.color=i.styleAttrs[e.byName.color.qname]:u.color=a[s][3],o.push(u)}return o})),new r(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"zIndex","auto",["region"],!1,!0,(function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t}),null),new r(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,n.parseLength,(function(e,t,r,i,a){return n.toComputedLength(i.value,i.unit,null,null,e.cellLength.w,null)})),new r(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(e){return e}),null),new r(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(e){return e}),null),new r(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(e){return"true"===e}),null),new r(t.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(e){return"true"===e}),null)],e.byQName={},e.all)e.byQName[e.all[i].qname]=e.all[i];for(var a in e.byName={},e.all)e.byName[e.all[a].name]=e.all[a]}(t,"undefined"==typeof imscNames?it:imscNames,"undefined"==typeof imscUtils?at:imscUtils)})),st=o((function(e,t){!function(e,t,n,r){e.generateISD=function(e,t,r){var i=new o(e),s={},u={},l={},f=e.head.styling.initials[n.byName.showBackground.qname],d=e.head.styling.initials[n.byName.backgroundColor.qname];for(var c in e.head.layout.regions)if(e.head.layout.regions.hasOwnProperty(c)){var h=e.head.layout.regions[c],g=h.styleAttrs[n.byName.showBackground.qname]||f,p=h.styleAttrs[n.byName.backgroundColor.qname]||d;l[h.id]=("always"===g||void 0===g)&&void 0!==p&&!(t<h.begin||t>=h.end)}for(var m in e.body&&e.body.regionID&&(l[e.body.regionID]=!0),u=null!==e.body?function e(t,n){if(n.contents){var r={};for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);return r.contents=[],n.contents.filter((function(e){return!(t<e.begin||t>=e.end)})).forEach((function(n){var i=e(t,n);i.regionID&&(l[i.regionID]=!0),null!==i&&r.contents.push(i)})),r}return n}(t,e.body):null,void 0!==l[""]&&(l[""]=!0),l)if(l[m]){var _=a(e,t,e.head.layout.regions[m],u,null,"",e.head.layout.regions[m],r,s);null!==_&&i.contents.push(_.element)}return i};var i=[n.byName.color.qname,n.byName.textCombine.qname,n.byName.textDecoration.qname,n.byName.textEmphasis.qname,n.byName.textOutline.qname,n.byName.textShadow.qname];function a(e,t,o,l,f,d,c,h,g){if(t<c.begin||t>=c.end)return null;var p="regionID"in c&&""!==c.regionID?c.regionID:d;if(null!==f&&p!==o.id&&(!("contents"in c)||"contents"in c&&0===c.contents.length||""!==p))return null;var m=new s(c);if("sets"in c)for(var _=0;_<c.sets.length;_++)t<c.sets[_].begin||t>=c.sets[_].end||(m.styleAttrs[c.sets[_].qname]=c.sets[_].value);var E={};for(var y in m.styleAttrs)if(m.styleAttrs.hasOwnProperty(y)&&(E[y]=!0,"region"===m.kind&&y===n.byName.writingMode.qname&&!(n.byName.direction.qname in m.styleAttrs))){var v=m.styleAttrs[y];"lrtb"===v||"lr"===v?m.styleAttrs[n.byName.direction.qname]="ltr":"rltb"!==v&&"rl"!==v||(m.styleAttrs[n.byName.direction.qname]="rtl")}if(null!==f)for(var T=0;T<n.all.length;T++){var A=n.all[T];if(A.qname===n.byName.textDecoration.qname){var S=f.styleAttrs[A.qname],b=m.styleAttrs[A.qname],I=[];void 0===b?I=S:-1===b.indexOf("none")?((-1===b.indexOf("noUnderline")&&-1!==S.indexOf("underline")||-1!==b.indexOf("underline"))&&I.push("underline"),(-1===b.indexOf("noLineThrough")&&-1!==S.indexOf("lineThrough")||-1!==b.indexOf("lineThrough"))&&I.push("lineThrough"),(-1===b.indexOf("noOverline")&&-1!==S.indexOf("overline")||-1!==b.indexOf("overline"))&&I.push("overline")):I.push("none"),m.styleAttrs[A.qname]=I}else if(A.qname!==n.byName.fontSize.qname||A.qname in m.styleAttrs||"span"!==m.kind||"textContainer"!==m.styleAttrs[n.byName.ruby.qname])if(A.qname!==n.byName.fontSize.qname||A.qname in m.styleAttrs||"span"!==m.kind||"text"!==m.styleAttrs[n.byName.ruby.qname])A.inherit&&A.qname in f.styleAttrs&&!(A.qname in m.styleAttrs)&&(m.styleAttrs[A.qname]=f.styleAttrs[A.qname]);else{var R=f.styleAttrs[n.byName.fontSize.qname];"textContainer"===f.styleAttrs[n.byName.ruby.qname]?m.styleAttrs[A.qname]=R:m.styleAttrs[A.qname]=new r.ComputedLength(.5*R.rw,.5*R.rh)}else{var w=f.styleAttrs[n.byName.fontSize.qname];m.styleAttrs[A.qname]=new r.ComputedLength(.5*w.rw,.5*w.rh)}}for(var N=0;N<n.all.length;N++){var M=n.all[N];if(!(M.qname in m.styleAttrs)&&!(M.qname===n.byName.position.qname&&n.byName.origin.qname in m.styleAttrs||M.qname===n.byName.origin.qname&&n.byName.position.qname in m.styleAttrs)){var C=e.head.styling.initials[M.qname]||M.initial;if(null!==C&&("region"===m.kind||!1===M.inherit&&null!==C)){var D=M.parse(C);null!==D?(m.styleAttrs[M.qname]=D,E[M.qname]=!0):u(h,"Invalid initial value for '"+M.qname+"' on element '"+m.kind)}}}for(var O=0;O<n.all.length;O++){var P=n.all[O];if(P.qname in E&&null!==P.compute){var L=P.compute(e,f,m,m.styleAttrs[P.qname],g);null!==L?m.styleAttrs[P.qname]=L:(m.styleAttrs[P.qname]=P.compute(e,f,m,P.parse(P.initial),g),u(h,"Style '"+P.qname+"' on element '"+m.kind+"' cannot be computed"))}}if("none"===m.styleAttrs[n.byName.display.qname])return null;var F=null;null===f?F=null===l?[]:[l]:"contents"in c&&(F=c.contents);for(var x=0;null!==F&&x<F.length;x++){var U=a(e,t,o,l,m,p,F[x],h,g);null!==U&&m.contents.push(U.element)}for(var B in m.styleAttrs)if(m.styleAttrs.hasOwnProperty(B)){var k=!1;if("span"===m.kind){var G=m.styleAttrs[n.byName.ruby.qname];(k=("container"===G||"textContainer"===G||"baseContainer"===G)&&-1!==i.indexOf(B))||(k="container"!==G&&B===n.byName.rubyAlign.qname),k||(k=!("textContainer"===G||"text"===G)&&B===n.byName.rubyPosition.qname)}if(!k){var j=n.byQName[B];"applies"in j&&(k=-1===j.applies.indexOf(m.kind))}k&&delete m.styleAttrs[B]}var Y=m.styleAttrs[n.byName.ruby.qname];if("p"===m.kind||"span"===m.kind&&("textContainer"===Y||"text"===Y)){var q=[];!function e(t,r){if(!("contents"in t))return;for(var i=0;i<t.contents.length;i++){var a=t.contents[i],o=a.styleAttrs[n.byName.ruby.qname];("span"!==a.kind||"textContainer"!==o&&"text"!==o)&&("contents"in a?e(a,r):("span"===a.kind&&0!==a.text.length||"br"===a.kind)&&r.push(a))}}(m,q),function(e){for(var t,n=0;n<e.length;)if("br"!==(t=e[n]).kind&&"preserve"!==t.space){var r=t.text.replace(/[\t\r\n ]+/g," ");/^[ ]/.test(r)&&(0===n||("br"===(i=e[n-1]).kind||/[\r\n\t ]$/.test(i.text)))&&(r=r.substring(1)),t.text=r,0===r.length?e.splice(n,1):n++}else n++;var i;for(n=0;n<e.length;n++)"br"!==(t=e[n]).kind&&"preserve"!==t.space?/[ ]$/.test(t.text)&&(n===e.length-1||("br"===(a=e[n+1]).kind||"preserve"===a.space&&/^[\r\n]/.test(a.text)))&&(t.text=t.text.slice(0,-1)):n++;var a}(q),function e(t){if("br"===t.kind)return!1;if("text"in t)return 0===t.text.length;if("contents"in t){for(var n=t.contents.length;n--;)e(t.contents[n])&&t.contents.splice(n,1);return 0===t.contents.length}}(m)}return"div"===m.kind&&n.byName.backgroundImage.qname in m.styleAttrs||"br"===m.kind||"image"===m.kind||"contents"in m&&m.contents.length>0||"span"===m.kind&&null!==m.text||"region"===m.kind&&"always"===m.styleAttrs[n.byName.showBackground.qname]?{region_id:p,element:m}:null}function o(e){this.contents=[],this.aspectRatio=e.aspectRatio,this.lang=e.lang}function s(e){for(var t in this.kind=e.kind||"region",this.lang=e.lang,e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)e.styleAttrs.hasOwnProperty(t)&&(this.styleAttrs[t]=e.styleAttrs[t]);"src"in e&&(this.src=e.src),"type"in e&&(this.type=e.type),"text"in e?this.text=e.text:("region"===this.kind||"contents"in e)&&(this.contents=[]),"space"in e&&(this.space=e.space)}function u(e,t){if(e&&e.error&&e.error(t))throw t}}(t,"undefined"==typeof imscNames||imscNames,"undefined"==typeof imscStyles?ot:imscStyles,"undefined"==typeof imscUtils?at:imscUtils)})),ut=[],lt=[],ft="undefined"!=typeof Uint8Array?Uint8Array:Array,dt=!1;function ct(){dt=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t<n;++t)ut[t]=e[t],lt[e.charCodeAt(t)]=t;lt["-".charCodeAt(0)]=62,lt["_".charCodeAt(0)]=63}function ht(e,t,n){for(var r,i,a=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],a.push(ut[(i=r)>>18&63]+ut[i>>12&63]+ut[i>>6&63]+ut[63&i]);return a.join("")}function gt(e){var t;dt||ct();for(var n=e.length,r=n%3,i="",a=[],o=0,s=n-r;o<s;o+=16383)a.push(ht(e,o,o+16383>s?s:o+16383));return 1===r?(t=e[n-1],i+=ut[t>>2],i+=ut[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=ut[t>>10],i+=ut[t>>4&63],i+=ut[t<<2&63],i+="="),a.push(i),a.join("")}function pt(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,l=u>>1,f=-7,d=n?i-1:0,c=n?-1:1,h=e[t+d];for(d+=c,a=h&(1<<-f)-1,h>>=-f,f+=s;f>0;a=256*a+e[t+d],d+=c,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=r;f>0;o=256*o+e[t+d],d+=c,f-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r),a-=l}return(h?-1:1)*o*Math.pow(2,a-r)}function mt(e,t,n,r,i,a){var o,s,u,l=8*a-i-1,f=(1<<l)-1,d=f>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,g=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=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+d>=1?c/u:c*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=f?(s=0,o=f):o+d>=1?(s=(t*u-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=g,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+h]=255&o,h+=g,o/=256,l-=8);e[n+h-g]|=128*p}var _t={}.toString,Et=Array.isArray||function(e){return"[object Array]"==_t.call(e)};function yt(){return Tt.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function vt(e,t){if(yt()<t)throw new RangeError("Invalid typed array length");return Tt.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Tt.prototype:(null===e&&(e=new Tt(t)),e.length=t),e}function Tt(e,t,n){if(!(Tt.TYPED_ARRAY_SUPPORT||this instanceof Tt))return new Tt(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return bt(this,e)}return At(this,e,t,n)}function At(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);Tt.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Tt.prototype:e=It(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!Tt.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Nt(t,n),i=(e=vt(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(wt(t)){var n=0|Rt(t.length);return 0===(e=vt(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?vt(e,0):It(e,t);if("Buffer"===t.type&&Et(t.data))return It(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function St(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function bt(e,t){if(St(t),e=vt(e,t<0?0:0|Rt(t)),!Tt.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function It(e,t){var n=t.length<0?0:0|Rt(t.length);e=vt(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function Rt(e){if(e>=yt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+yt().toString(16)+" bytes");return 0|e}function wt(e){return!(null==e||!e._isBuffer)}function Nt(e,t){if(wt(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return en(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return tn(e).length;default:if(r)return en(e).length;t=(""+t).toLowerCase(),r=!0}}function Mt(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 qt(this,t,n);case"utf8":case"utf-8":return Gt(this,t,n);case"ascii":return jt(this,t,n);case"latin1":case"binary":return Yt(this,t,n);case"base64":return kt(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ht(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Ct(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Dt(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),n=+n,isNaN(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=Tt.from(t,r)),wt(t))return 0===t.length?-1:Ot(e,t,n,r,i);if("number"==typeof t)return t&=255,Tt.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Ot(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function Ot(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 f=-1;for(a=n;a<s;a++)if(l(e,a)===l(t,-1===f?0:a-f)){if(-1===f&&(f=a),a-f+1===u)return f*o}else-1!==f&&(a-=a-f),f=-1}else for(n+u>s&&(n=s-u),a=n;a>=0;a--){for(var d=!0,c=0;c<u;c++)if(l(e,a+c)!==l(t,c)){d=!1;break}if(d)return a}return-1}function Pt(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function Lt(e,t,n,r){return nn(en(t,e.length-n),e,n,r)}function Ft(e,t,n,r){return nn(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function xt(e,t,n,r){return Ft(e,t,n,r)}function Ut(e,t,n,r){return nn(tn(t),e,n,r)}function Bt(e,t,n,r){return nn(function(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function kt(e,t,n){return 0===t&&n===e.length?gt(e):gt(e.slice(t,n))}function Gt(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,o,s,u,l=e[i],f=null,d=l>239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(f=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(f=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)&&(f=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&&(f=u)}null===f?(f=65533,d=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}Tt.TYPED_ARRAY_SUPPORT=void 0===n.TYPED_ARRAY_SUPPORT||n.TYPED_ARRAY_SUPPORT,yt(),Tt.poolSize=8192,Tt._augment=function(e){return e.__proto__=Tt.prototype,e},Tt.from=function(e,t,n){return At(null,e,t,n)},Tt.TYPED_ARRAY_SUPPORT&&(Tt.prototype.__proto__=Uint8Array.prototype,Tt.__proto__=Uint8Array),Tt.alloc=function(e,t,n){return function(e,t,n,r){return St(t),t<=0?vt(e,t):void 0!==n?"string"==typeof r?vt(e,t).fill(n,r):vt(e,t).fill(n):vt(e,t)}(null,e,t,n)},Tt.allocUnsafe=function(e){return bt(null,e)},Tt.allocUnsafeSlow=function(e){return bt(null,e)},Tt.isBuffer=function(e){return null!=e&&(!!e._isBuffer||rn(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&rn(e.slice(0,0))}(e))},Tt.compare=function(e,t){if(!wt(e)||!wt(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},Tt.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Tt.concat=function(e,t){if(!Et(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Tt.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=Tt.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!wt(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},Tt.byteLength=Nt,Tt.prototype._isBuffer=!0,Tt.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;t<e;t+=2)Ct(this,t,t+1);return this},Tt.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Ct(this,t,t+3),Ct(this,t+1,t+2);return this},Tt.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Ct(this,t,t+7),Ct(this,t+1,t+6),Ct(this,t+2,t+5),Ct(this,t+3,t+4);return this},Tt.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Gt(this,0,e):Mt.apply(this,arguments)},Tt.prototype.equals=function(e){if(!wt(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Tt.compare(this,e)},Tt.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Tt.prototype.compare=function(e,t,n,r,i){if(!wt(e))throw new TypeError("Argument must be a Buffer");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),u=this.slice(r,i),l=e.slice(t,n),f=0;f<s;++f)if(u[f]!==l[f]){a=u[f],o=l[f];break}return a<o?-1:o<a?1:0},Tt.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},Tt.prototype.indexOf=function(e,t,n){return Dt(this,e,t,n,!0)},Tt.prototype.lastIndexOf=function(e,t,n){return Dt(this,e,t,n,!1)},Tt.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=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 Pt(this,e,t,n);case"utf8":case"utf-8":return Lt(this,e,t,n);case"ascii":return Ft(this,e,t,n);case"latin1":case"binary":return xt(this,e,t,n);case"base64":return Ut(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bt(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},Tt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function jt(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function Yt(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function qt(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=Jt(e[a]);return i}function Ht(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function Kt(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function Vt(e,t,n,r,i,a){if(!wt(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function zt(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i<a;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Wt(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i<a;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function Xt(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 Qt(e,t,n,r,i){return i||Xt(e,0,n,4),mt(e,t,n,r,23,4),n+4}function Zt(e,t,n,r,i){return i||Xt(e,0,n,8),mt(e,t,n,r,52,8),n+8}Tt.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),Tt.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=Tt.prototype;else{var i=t-e;n=new Tt(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},Tt.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||Kt(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},Tt.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||Kt(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},Tt.prototype.readUInt8=function(e,t){return t||Kt(e,1,this.length),this[e]},Tt.prototype.readUInt16LE=function(e,t){return t||Kt(e,2,this.length),this[e]|this[e+1]<<8},Tt.prototype.readUInt16BE=function(e,t){return t||Kt(e,2,this.length),this[e]<<8|this[e+1]},Tt.prototype.readUInt32LE=function(e,t){return t||Kt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Tt.prototype.readUInt32BE=function(e,t){return t||Kt(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Tt.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||Kt(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},Tt.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||Kt(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},Tt.prototype.readInt8=function(e,t){return t||Kt(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Tt.prototype.readInt16LE=function(e,t){t||Kt(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Tt.prototype.readInt16BE=function(e,t){t||Kt(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Tt.prototype.readInt32LE=function(e,t){return t||Kt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Tt.prototype.readInt32BE=function(e,t){return t||Kt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Tt.prototype.readFloatLE=function(e,t){return t||Kt(e,4,this.length),pt(this,e,!0,23,4)},Tt.prototype.readFloatBE=function(e,t){return t||Kt(e,4,this.length),pt(this,e,!1,23,4)},Tt.prototype.readDoubleLE=function(e,t){return t||Kt(e,8,this.length),pt(this,e,!0,52,8)},Tt.prototype.readDoubleBE=function(e,t){return t||Kt(e,8,this.length),pt(this,e,!1,52,8)},Tt.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||Vt(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},Tt.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||Vt(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},Tt.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||Vt(this,e,t,1,255,0),Tt.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Tt.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||Vt(this,e,t,2,65535,0),Tt.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):zt(this,e,t,!0),t+2},Tt.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||Vt(this,e,t,2,65535,0),Tt.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):zt(this,e,t,!1),t+2},Tt.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||Vt(this,e,t,4,4294967295,0),Tt.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Wt(this,e,t,!0),t+4},Tt.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||Vt(this,e,t,4,4294967295,0),Tt.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Wt(this,e,t,!1),t+4},Tt.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Vt(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},Tt.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Vt(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},Tt.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||Vt(this,e,t,1,127,-128),Tt.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Tt.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||Vt(this,e,t,2,32767,-32768),Tt.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):zt(this,e,t,!0),t+2},Tt.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||Vt(this,e,t,2,32767,-32768),Tt.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):zt(this,e,t,!1),t+2},Tt.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||Vt(this,e,t,4,2147483647,-2147483648),Tt.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Wt(this,e,t,!0),t+4},Tt.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||Vt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Tt.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Wt(this,e,t,!1),t+4},Tt.prototype.writeFloatLE=function(e,t,n){return Qt(this,e,t,!0,n)},Tt.prototype.writeFloatBE=function(e,t,n){return Qt(this,e,t,!1,n)},Tt.prototype.writeDoubleLE=function(e,t,n){return Zt(this,e,t,!0,n)},Tt.prototype.writeDoubleBE=function(e,t,n){return Zt(this,e,t,!1,n)},Tt.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!Tt.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},Tt.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Tt.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var o=wt(e)?e:en(new Tt(e,r).toString()),s=o.length;for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var $t=/[^+\/0-9A-Za-z-_]/g;function Jt(e){return e<16?"0"+e.toString(16):e.toString(16)}function en(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&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 tn(e){return function(e){var t,n,r,i,a,o;dt||ct();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new ft(3*s/4-a),r=a>0?s-4:s;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=lt[e.charCodeAt(t)]<<18|lt[e.charCodeAt(t+1)]<<12|lt[e.charCodeAt(t+2)]<<6|lt[e.charCodeAt(t+3)],o[u++]=i>>16&255,o[u++]=i>>8&255,o[u++]=255&i;return 2===a?(i=lt[e.charCodeAt(t)]<<2|lt[e.charCodeAt(t+1)]>>4,o[u++]=255&i):1===a&&(i=lt[e.charCodeAt(t)]<<10|lt[e.charCodeAt(t+1)]<<4|lt[e.charCodeAt(t+2)]>>2,o[u++]=i>>8&255,o[u++]=255&i),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace($t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function nn(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function rn(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var an,on="object"==typeof Reflect?Reflect:null,sn=on&&"function"==typeof on.apply?on.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};an=on&&"function"==typeof on.ownKeys?on.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var un=Number.isNaN||function(e){return e!=e};function ln(){ln.init.call(this)}var fn=ln,dn=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))}Tn(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&Tn(e,"error",t,n)}(e,i,{once:!0})}))};ln.EventEmitter=ln,ln.prototype._events=void 0,ln.prototype._eventsCount=0,ln.prototype._maxListeners=void 0;var cn=10;function hn(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function gn(e){return void 0===e._maxListeners?ln.defaultMaxListeners:e._maxListeners}function pn(e,t,n,r){var i,a,o,s;if(hn(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=gn(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function mn(){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 _n(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=mn.bind(r);return i.listener=n,r.wrapFn=i,i}function En(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;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):vn(i,i.length)}function yn(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function vn(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function Tn(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){r.once&&e.removeEventListener(t,i),n(a)}))}}function An(){throw new Error("setTimeout has not been defined")}function Sn(){throw new Error("clearTimeout has not been defined")}Object.defineProperty(ln,"defaultMaxListeners",{enumerable:!0,get:function(){return cn},set:function(e){if("number"!=typeof e||e<0||un(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");cn=e}}),ln.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ln.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||un(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},ln.prototype.getMaxListeners=function(){return gn(this)},ln.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)sn(s,this,t);else{var u=s.length,l=vn(s,u);for(n=0;n<u;++n)sn(l[n],this,t)}return!0},ln.prototype.addListener=function(e,t){return pn(this,e,t,!1)},ln.prototype.on=ln.prototype.addListener,ln.prototype.prependListener=function(e,t){return pn(this,e,t,!0)},ln.prototype.once=function(e,t){return hn(t),this.on(e,_n(this,e,t)),this},ln.prototype.prependOnceListener=function(e,t){return hn(t),this.prependListener(e,_n(this,e,t)),this},ln.prototype.removeListener=function(e,t){var n,r,i,a,o;if(hn(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=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<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},ln.prototype.off=ln.prototype.removeListener,ln.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},ln.prototype.listeners=function(e){return En(this,e,!0)},ln.prototype.rawListeners=function(e){return En(this,e,!1)},ln.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):yn.call(e,t)},ln.prototype.listenerCount=yn,ln.prototype.eventNames=function(){return this._eventsCount>0?an(this._events):[]},fn.once=dn;var bn=An,In=Sn;function Rn(e){if(bn===setTimeout)return setTimeout(e,0);if((bn===An||!bn)&&setTimeout)return bn=setTimeout,setTimeout(e,0);try{return bn(e,0)}catch(t){try{return bn.call(null,e,0)}catch(t){return bn.call(this,e,0)}}}"function"==typeof n.setTimeout&&(bn=setTimeout),"function"==typeof n.clearTimeout&&(In=clearTimeout);var wn,Nn=[],Mn=!1,Cn=-1;function Dn(){Mn&&wn&&(Mn=!1,wn.length?Nn=wn.concat(Nn):Cn=-1,Nn.length&&On())}function On(){if(!Mn){var e=Rn(Dn);Mn=!0;for(var t=Nn.length;t;){for(wn=Nn,Nn=[];++Cn<t;)wn&&wn[Cn].run();Cn=-1,t=Nn.length}wn=null,Mn=!1,function(e){if(In===clearTimeout)return clearTimeout(e);if((In===Sn||!In)&&clearTimeout)return In=clearTimeout,clearTimeout(e);try{In(e)}catch(t){try{return In.call(null,e)}catch(t){return In.call(this,e)}}}(e)}}function Pn(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Nn.push(new Ln(e,t)),1!==Nn.length||Mn||Rn(On)}function Ln(e,t){this.fun=e,this.array=t}Ln.prototype.run=function(){this.fun.apply(null,this.array)};function Fn(){}var xn=Fn,Un=Fn,Bn=Fn,kn=Fn,Gn=Fn,jn=Fn,Yn=Fn;var qn=n.performance||{},Hn=qn.now||qn.mozNow||qn.msNow||qn.oNow||qn.webkitNow||function(){return(new Date).getTime()};var Kn=new Date;var Vn={nextTick:Pn,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:xn,addListener:Un,once:Bn,off:kn,removeListener:Gn,removeAllListeners:jn,emit:Yn,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*Hn.call(qn),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Kn)/1e3}},zn="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},Wn=/%[sdj%]/g;function Xn(e){if(!sr(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(Jn(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,a=String(e).replace(Wn,(function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),o=r[n];n<i;o=r[++n])or(o)||!fr(o)?a+=" "+o:a+=" "+Jn(o);return a}function Qn(e,t){if(ur(n.process))return function(){return Qn(e,t).apply(this,arguments)};if(!0===Vn.noDeprecation)return e;var r=!1;return function(){if(!r){if(Vn.throwDeprecation)throw new Error(t);Vn.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this,arguments)}}var Zn,$n={};function Jn(e,t){var n={seen:[],stylize:tr};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),ar(t)?n.showHidden=t:t&&pr(n,t),ur(n.showHidden)&&(n.showHidden=!1),ur(n.depth)&&(n.depth=2),ur(n.colors)&&(n.colors=!1),ur(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=er),nr(n,e,n.depth)}function er(e,t){var n=Jn.styles[t];return n?"["+Jn.colors[n][0]+"m"+e+"["+Jn.colors[n][1]+"m":e}function tr(e,t){return e}function nr(e,t,n){if(e.customInspect&&t&&hr(t.inspect)&&t.inspect!==Jn&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return sr(r)||(r=nr(e,r,n)),r}var i=function(e,t){if(ur(t))return e.stylize("undefined","undefined");if(sr(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(r=t,"number"==typeof r)return e.stylize(""+t,"number");var r;if(ar(t))return e.stylize(""+t,"boolean");if(or(t))return e.stylize("null","null")}(e,t);if(i)return i;var a=Object.keys(t),o=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),cr(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return rr(t);if(0===a.length){if(hr(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(lr(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(dr(t))return e.stylize(Date.prototype.toString.call(t),"date");if(cr(t))return rr(t)}var u,l,f="",d=!1,c=["{","}"];(u=t,Array.isArray(u)&&(d=!0,c=["[","]"]),hr(t))&&(f=" [Function"+(t.name?": "+t.name:"")+"]");return lr(t)&&(f=" "+RegExp.prototype.toString.call(t)),dr(t)&&(f=" "+Date.prototype.toUTCString.call(t)),cr(t)&&(f=" "+rr(t)),0!==a.length||d&&0!=t.length?n<0?lr(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=d?function(e,t,n,r,i){for(var a=[],o=0,s=t.length;o<s;++o)mr(t,String(o))?a.push(ir(e,t,n,r,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(ir(e,t,n,r,i,!0))})),a}(e,t,n,o,a):a.map((function(r){return ir(e,t,n,o,r,d)})),e.seen.pop(),function(e,t,n){if(e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(l,f,c)):c[0]+f+c[1]}function rr(e){return"["+Error.prototype.toString.call(e)+"]"}function ir(e,t,n,r,i,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),mr(r,i)||(o="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=or(n)?nr(e,u.value,null):nr(e,u.value,n-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),ur(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function ar(e){return"boolean"==typeof e}function or(e){return null===e}function sr(e){return"string"==typeof e}function ur(e){return void 0===e}function lr(e){return fr(e)&&"[object RegExp]"===gr(e)}function fr(e){return"object"==typeof e&&null!==e}function dr(e){return fr(e)&&"[object Date]"===gr(e)}function cr(e){return fr(e)&&("[object Error]"===gr(e)||e instanceof Error)}function hr(e){return"function"==typeof e}function gr(e){return Object.prototype.toString.call(e)}function pr(e,t){if(!t||!fr(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function mr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Jn.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Jn.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};for(var _r=function(e){var t=Rr(e),n=t[0],r=t[1];return 3*(n+r)/4-r},Er=function(e){var t,n,r=Rr(e),i=r[0],a=r[1],o=new Ar(function(e,t,n){return 3*(t+n)/4-n}(0,i,a)),s=0,u=a>0?i-4:i;for(n=0;n<u;n+=4)t=Tr[e.charCodeAt(n)]<<18|Tr[e.charCodeAt(n+1)]<<12|Tr[e.charCodeAt(n+2)]<<6|Tr[e.charCodeAt(n+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=255&t;2===a&&(t=Tr[e.charCodeAt(n)]<<2|Tr[e.charCodeAt(n+1)]>>4,o[s++]=255&t);1===a&&(t=Tr[e.charCodeAt(n)]<<10|Tr[e.charCodeAt(n+1)]<<4|Tr[e.charCodeAt(n+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t);return o},yr=function(e){for(var t,n=e.length,r=n%3,i=[],a=0,o=n-r;a<o;a+=16383)i.push(wr(e,a,a+16383>o?o:a+16383));1===r?(t=e[n-1],i.push(vr[t>>2]+vr[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(vr[t>>10]+vr[t>>4&63]+vr[t<<2&63]+"="));return i.join("")},vr=[],Tr=[],Ar="undefined"!=typeof Uint8Array?Uint8Array:Array,Sr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",br=0,Ir=Sr.length;br<Ir;++br)vr[br]=Sr[br],Tr[Sr.charCodeAt(br)]=br;function Rr(e){var t=e.length;if(t%4>0)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 wr(e,t,n){for(var r,i,a=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(vr[(i=r)>>18&63]+vr[i>>12&63]+vr[i>>6&63]+vr[63&i]);return a.join("")}Tr["-".charCodeAt(0)]=62,Tr["_".charCodeAt(0)]=63;var Nr={byteLength:_r,toByteArray:Er,fromByteArray:yr},Mr=function(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,l=u>>1,f=-7,d=n?i-1:0,c=n?-1:1,h=e[t+d];for(d+=c,a=h&(1<<-f)-1,h>>=-f,f+=s;f>0;a=256*a+e[t+d],d+=c,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=r;f>0;o=256*o+e[t+d],d+=c,f-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r),a-=l}return(h?-1:1)*o*Math.pow(2,a-r)},Cr=function(e,t,n,r,i,a){var o,s,u,l=8*a-i-1,f=(1<<l)-1,d=f>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,g=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=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+d>=1?c/u:c*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=f?(s=0,o=f):o+d>=1?(s=(t*u-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=255&s,h+=g,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+h]=255&o,h+=g,o/=256,l-=8);e[n+h-g]|=128*p},Dr=o((function(e,t){var n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=i,t.SlowBuffer=function(e){+e!=e&&(e=0);return i.alloc(+e)},t.INSPECT_MAX_BYTES=50;function r(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,i.prototype),t}function i(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 s(e)}return a(e,t,n)}function a(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!i.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|d(e,t),a=r(n),o=a.write(e,t);o!==n&&(a=a.slice(0,o));return a}(e,t);if(ArrayBuffer.isView(e))return function(e){if(x(e,Uint8Array)){var t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return u(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(x(e,ArrayBuffer)||e&&x(e.buffer,ArrayBuffer))return l(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(x(e,SharedArrayBuffer)||e&&x(e.buffer,SharedArrayBuffer)))return l(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var a=e.valueOf&&e.valueOf();if(null!=a&&a!==e)return i.from(a,t,n);var o=function(e){if(i.isBuffer(e)){var t=0|f(e.length),n=r(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||U(e.length)?r(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.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 o(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 s(e){return o(e),r(e<0?0:0|f(e))}function u(e){for(var t=e.length<0?0:0|f(e.length),n=r(t),i=0;i<t;i+=1)n[i]=255&e[i];return n}function l(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,i.prototype),r}function f(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function d(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||x(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 a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return L(e).length;default:if(a)return r?-1:P(e).length;t=(""+t).toLowerCase(),a=!0}}function c(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 I(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return S(this,t,n);case"latin1":case"binary":return b(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function h(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),U(n=+n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=i.from(t,r)),i.isBuffer(t))return 0===t.length?-1:p(e,t,n,r,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):p(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function p(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 f=-1;for(a=n;a<s;a++)if(l(e,a)===l(t,-1===f?0:a-f)){if(-1===f&&(f=a),a-f+1===u)return f*o}else-1!==f&&(a-=a-f),f=-1}else for(n+u>s&&(n=s-u),a=n;a>=0;a--){for(var d=!0,c=0;c<u;c++)if(l(e,a+c)!==l(t,c)){d=!1;break}if(d)return a}return-1}function m(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(U(s))return o;e[n+o]=s}return o}function _(e,t,n,r){return F(P(t,e.length-n),e,n,r)}function E(e,t,n,r){return F(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function y(e,t,n,r){return F(L(t),e,n,r)}function v(e,t,n,r){return F(function(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?Nr.fromByteArray(e):Nr.fromByteArray(e.slice(t,n))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,o,s,u,l=e[i],f=null,d=l>239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(f=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(f=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)&&(f=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&&(f=u)}null===f?(f=65533,d=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.kMaxLength=2147483647,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),i.poolSize=8192,i.from=function(e,t,n){return a(e,t,n)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array),i.alloc=function(e,t,n){return function(e,t,n){return o(e),e<=0?r(e):void 0!==t?"string"==typeof n?r(e).fill(t,n):r(e).fill(t):r(e)}(e,t,n)},i.allocUnsafe=function(e){return s(e)},i.allocUnsafeSlow=function(e){return s(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==i.prototype},i.compare=function(e,t){if(x(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),x(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,a=0,o=Math.min(n,r);a<o;++a)if(e[a]!==t[a]){n=e[a],r=t[a];break}return n<r?-1:r<n?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=i.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(x(o,Uint8Array))a+o.length>r.length?i.from(o).copy(r,a):Uint8Array.prototype.set.call(r,o,a);else{if(!i.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,a)}a+=o.length}return r},i.byteLength=d,i.prototype._isBuffer=!0,i.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;t<e;t+=2)h(this,t,t+1);return this},i.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)h(this,t,t+3),h(this,t+1,t+2);return this},i.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)h(this,t,t+7),h(this,t+1,t+6),h(this,t+2,t+5),h(this,t+3,t+4);return this},i.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):c.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},n&&(i.prototype[n]=i.prototype.inspect),i.prototype.compare=function(e,t,n,r,a){if(x(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.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===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),u=Math.min(o,s),l=this.slice(r,a),f=e.slice(t,n),d=0;d<u;++d)if(l[d]!==f[d]){o=l[d],s=f[d];break}return o<s?-1:s<o?1:0},i.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},i.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},i.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},i.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=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 m(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":case"latin1":case"binary":return E(this,e,t,n);case"base64":return y(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function b(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function I(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=B[e[a]];return i}function R(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length-1;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function w(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,a,o){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function M(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 C(e,t,n,r,i){return t=+t,n>>>=0,i||M(e,0,n,4),Cr(e,t,n,r,23,4),n+4}function D(e,t,n,r,i){return t=+t,n>>>=0,i||M(e,0,n,8),Cr(e,t,n,r,52,8),n+8}i.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<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,i.prototype),r},i.prototype.readUintLE=i.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||w(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},i.prototype.readUintBE=i.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||w(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},i.prototype.readUint8=i.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||w(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},i.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||w(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},i.prototype.readInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),Mr(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),Mr(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),Mr(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),Mr(this,e,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||N(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},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(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},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(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},i.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},i.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);N(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},i.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(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},i.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(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},i.prototype.writeFloatLE=function(e,t,n){return C(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){return C(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},i.prototype.copy=function(e,t,n,r){if(!i.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<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=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<r-n&&(r=e.length-t+n);var a=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),a},i.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!i.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var a=e.charCodeAt(0);("utf8"===r&&a<128||"latin1"===r)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=i.isBuffer(e)?e:i.from(e,r),u=s.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=s[o%u]}return this};var O=/[^+/0-9A-Za-z-_]/g;function P(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&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 L(e){return Nr.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function x(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function U(e){return e!=e}var B=function(){for(var e=new Array(256),t=0;t<16;++t)for(var n=16*t,r=0;r<16;++r)e[n+r]="0123456789abcdef"[t]+"0123456789abcdef"[r];return e}()}));
2
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function Or(){this.head=null,this.tail=null,this.length=0}Or.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},Or.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},Or.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},Or.prototype.clear=function(){this.head=this.tail=null,this.length=0},Or.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},Or.prototype.concat=function(e){if(0===this.length)return Dr.Buffer.alloc(0);if(1===this.length)return this.head.data;for(var t=Dr.Buffer.allocUnsafe(e>>>0),n=this.head,r=0;n;)n.data.copy(t,r),r+=n.data.length,n=n.next;return t};
3
3
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
4
- var Lr=u((function(e,t){var n=Or.Buffer;function r(e,t){for(var n in e)t[n]=e[n]}function i(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=Or:(r(Or,t),t.Buffer=i),i.prototype=Object.create(n.prototype),r(n,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Or.SlowBuffer(e)}})).Buffer,Fr=Lr.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var xr=Ur;function Ur(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(Lr.isEncoding===Fr||!Fr(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=Gr,this.end=jr,t=4;break;case"utf8":this.fillLast=kr,t=4;break;case"base64":this.text=Yr,this.end=qr,t=3;break;default:return this.write=Hr,void(this.end=Kr)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Lr.allocUnsafe(t)}function Br(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function kr(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function Gr(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function jr(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function Yr(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function qr(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Hr(e){return e.toString(this.encoding)}function Kr(e){return e&&e.length?this.write(e):""}Ur.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},Ur.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},Ur.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=Br(t[r]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=Br(t[r]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=Br(t[r]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},Ur.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var Vr={StringDecoder:xr};Xr.ReadableState=Wr;var zr=function(e){if(lr($n)&&($n=zn.env.NODE_DEBUG||""),e=e.toUpperCase(),!Jn[e])if(new RegExp("\\b"+e+"\\b","i").test($n)){Jn[e]=function(){var t=Qn.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else Jn[e]=function(){};return Jn[e]}("stream");function Wr(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Ai&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new Pr,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new xr(e.encoding),this.encoding=e.encoding)}function Xr(e){if(!(this instanceof Xr))return new Xr(e);this._readableState=new Wr(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),dn.call(this)}function Qr(e,t,n,r,i){var a=function(e,t){var n=null;At.isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));return n}(t,n);if(a)e.emit("error",a);else if(null===n)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,$r(e)}(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var u;!t.decoder||i||r||(n=t.decoder.write(n),u=!t.objectMode&&0===n.length),i||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&$r(e))),function(e,t){t.readingMore||(t.readingMore=!0,Ln(ei,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}Wn(Xr,dn),Xr.prototype.push=function(e,t){var n=this._readableState;return n.objectMode||"string"!=typeof e||(t=t||n.defaultEncoding)!==n.encoding&&(e=At.from(e,t),t=""),Qr(this,n,e,t,!1)},Xr.prototype.unshift=function(e){return Qr(this,this._readableState,e,"",!0)},Xr.prototype.isPaused=function(){return!1===this._readableState.flowing},Xr.prototype.setEncoding=function(e){return this._readableState.decoder=new xr(e),this._readableState.encoding=e,this};function Zr(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function $r(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(zr("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Ln(Jr,e):Jr(e))}function Jr(e){zr("emit readable"),e.emit("readable"),ri(e)}function ei(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(zr("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function ti(e){zr("readable nexttick read 0"),e.read(0)}function ni(e,t){t.reading||(zr("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),ri(e),t.flowing&&!t.reading&&e.read(0)}function ri(e){var t=e._readableState;for(zr("flow",t.flowing);t.flowing&&null!==e.read(););}function ii(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;e-=i.length;for(;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=At.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function ai(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Ln(oi,t,e))}function oi(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function si(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function ui(){}function li(e,t,n){this.chunk=e,this.encoding=t,this.callback=n,this.next=null}function fi(e,t){Object.defineProperty(this,"buffer",{get:Zn((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof Ai&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=!1===e.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?Ln(i,r):i(r);e._writableState.errorEmitted=!0,e.emit("error",r)}(e,n,r,t,i);else{var a=pi(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||gi(e,n),r?Ln(hi,e,n,a,i):hi(e,n,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Ei(this)}function di(e){if(!(this instanceof di||this instanceof Ai))return new di(e);this._writableState=new fi(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),dn.EventEmitter.call(this)}function ci(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function hi(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),_i(e,t)}function gi(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var o=0;n;)i[o]=n,n=n.next,o+=1;ci(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new Ei(t)}else{for(;n;){var s=n.chunk,u=n.encoding,l=n.callback;if(ci(e,t,!1,t.objectMode?1:s.length,s,u,l),n=n.next,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}function pi(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function mi(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function _i(e,t){var n=pi(t);return n&&(0===t.pendingcb?(mi(e,t),t.finished=!0,e.emit("finish")):mi(e,t)),n}function Ei(e){var t=this;this.next=null,this.entry=null,this.finish=function(n){var r=t.entry;for(t.entry=null;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}Xr.prototype.read=function(e){zr("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return zr("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ai(this):$r(this),null;if(0===(e=Zr(e,t))&&t.ended)return 0===t.length&&ai(this),null;var r,i=t.needReadable;return zr("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&zr("length less than watermark",i=!0),t.ended||t.reading?zr("reading or ended",i=!1):i&&(zr("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=Zr(n,t))),null===(r=e>0?ii(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&ai(this)),null!==r&&this.emit("data",r),r},Xr.prototype._read=function(e){this.emit("error",new Error("not implemented"))},Xr.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,zr("pipe count=%d opts=%j",r.pipesCount,t);var i=!t||!1!==t.end?o:l;function a(e){zr("onunpipe"),e===n&&l()}function o(){zr("onend"),e.end()}r.endEmitted?Ln(i):n.once("end",i),e.on("unpipe",a);var s=function(e){return function(){var t=e._readableState;zr("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,ri(e))}}(n);e.on("drain",s);var u=!1;function l(){zr("cleanup"),e.removeListener("close",h),e.removeListener("finish",g),e.removeListener("drain",s),e.removeListener("error",c),e.removeListener("unpipe",a),n.removeListener("end",o),n.removeListener("end",l),n.removeListener("data",d),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var f=!1;function d(t){zr("ondata"),f=!1,!1!==e.write(t)||f||((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==si(r.pipes,e))&&!u&&(zr("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,f=!0),n.pause())}function c(t){var n;zr("onerror",t),p(),e.removeListener("error",c),0===(n="error",e.listeners(n).length)&&e.emit("error",t)}function h(){e.removeListener("finish",g),p()}function g(){zr("onfinish"),e.removeListener("close",h),p()}function p(){zr("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",c),e.once("close",h),e.once("finish",g),e.emit("pipe",n),r.flowing||(zr("pipe resume"),n.resume()),e},Xr.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}var a=si(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this)),this},Xr.prototype.on=function(e,t){var n=dn.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&$r(this):Ln(ti,this))}return n},Xr.prototype.addListener=Xr.prototype.on,Xr.prototype.resume=function(){var e=this._readableState;return e.flowing||(zr("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Ln(ni,e,t))}(this,e)),this},Xr.prototype.pause=function(){return zr("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(zr("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Xr.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;for(var i in e.on("end",(function(){if(zr("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)})),e.on("data",(function(i){(zr("wrapped data"),t.decoder&&(i=t.decoder.write(i)),t.objectMode&&null==i)||(t.objectMode||i&&i.length)&&(r.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));return function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}(["error","close","destroy","pause","resume"],(function(t){e.on(t,r.emit.bind(r,t))})),r._read=function(t){zr("wrapped _read",t),n&&(n=!1,e.resume())},r},Xr._fromList=ii,di.WritableState=fi,Wn(di,dn.EventEmitter),fi.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},di.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},di.prototype.write=function(e,t,n){var r=this._writableState,i=!1;return"function"==typeof t&&(n=t,t=null),Or.Buffer.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=ui),r.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),Ln(t,n)}(this,n):function(e,t,n,r){var i=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):Or.Buffer.isBuffer(n)||"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),Ln(r,a),i=!1),i}(this,r,e,n)&&(r.pendingcb++,i=function(e,t,n,r,i){n=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=Or.Buffer.from(t,n));return t}(t,n,r),Or.Buffer.isBuffer(n)&&(r="buffer");var a=t.objectMode?1:n.length;t.length+=a;var o=t.length<t.highWaterMark;o||(t.needDrain=!0);if(t.writing||t.corked){var s=t.lastBufferedRequest;t.lastBufferedRequest=new li(n,r,i),s?s.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else ci(e,t,!1,a,n,r,i);return o}(this,r,e,t,n)),i},di.prototype.cork=function(){this._writableState.corked++},di.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||gi(this,e))},di.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},di.prototype._write=function(e,t,n){n(new Error("not implemented"))},di.prototype._writev=null,di.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,_i(e,t),n&&(t.finished?Ln(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Wn(Ai,Xr);for(var yi=Object.keys(di.prototype),vi=0;vi<yi.length;vi++){var Ti=yi[vi];Ai.prototype[Ti]||(Ai.prototype[Ti]=di.prototype[Ti])}function Ai(e){if(!(this instanceof Ai))return new Ai(e);Xr.call(this,e),di.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",Si)}function Si(){this.allowHalfOpen||this._writableState.ended||Ln(bi,this)}function bi(e){e.end()}function Ii(e){this.afterTransform=function(t,n){return function(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!=n&&e.push(n);i(t);var a=e._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&e._read(a.highWaterMark)}(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Ri(e){if(!(this instanceof Ri))return new Ri(e);Ai.call(this,e),this._transformState=new Ii(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(e){wi(t,e)})):wi(t)}))}function wi(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}function Ni(e){if(!(this instanceof Ni))return new Ni(e);Ri.call(this,e)}function Mi(){dn.call(this)}Wn(Ri,Ai),Ri.prototype.push=function(e,t){return this._transformState.needTransform=!1,Ai.prototype.push.call(this,e,t)},Ri.prototype._transform=function(e,t,n){throw new Error("Not implemented")},Ri.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Ri.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},Wn(Ni,Ri),Ni.prototype._transform=function(e,t,n){n(null,e)},Wn(Mi,dn),Mi.Readable=Xr,Mi.Writable=di,Mi.Duplex=Ai,Mi.Transform=Ri,Mi.PassThrough=Ni,Mi.Stream=Mi,Mi.prototype.pipe=function(e,t){var n=this;function r(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",o),n.on("close",s));var a=!1;function o(){a||(a=!0,e.end())}function s(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(l(),0===dn.listenerCount(this,"error"))throw e}function l(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",o),n.removeListener("close",s),n.removeListener("error",u),e.removeListener("error",u),n.removeListener("end",l),n.removeListener("close",l),e.removeListener("close",l)}return n.on("error",u),e.on("error",u),n.on("end",l),n.on("close",l),e.on("close",l),e.emit("pipe",n),e};var Ci=o(Object.freeze({__proto__:null,default:Mi,Readable:Xr,Writable:di,Duplex:Ai,Transform:Ri,PassThrough:Ni,Stream:Mi})),Di=u((function(e,t){!function(e){e.parser=function(e,t){return new r(e,t)},e.SAXParser=r,e.SAXStream=a,e.createStream=function(e,t){return new a(e,t)},e.MAX_BUFFER_LENGTH=65536;var t,n=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function r(t,i){if(!(this instanceof r))return new r(t,i);!function(e){for(var t=0,r=n.length;t<r;t++)e[n[t]]=""}(this),this.q=this.c="",this.bufferCheckPosition=e.MAX_BUFFER_LENGTH,this.opt=i||{},this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=!!t,this.noscript=!(!t&&!this.opt.noscript),this.state=S.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(c)),this.trackPosition=!1!==this.opt.position,this.trackPosition&&(this.position=this.line=this.column=0),I(this,"onready")}e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),r.prototype={end:function(){C(this)},write:function(t){if(this.error)throw this.error;if(this.closed)return M(this,"Cannot write after close. Assign an onready handler.");if(null===t)return C(this);"object"==typeof t&&(t=t.toString());var r=0,i="";for(;i=k(t,r++),this.c=i,i;)switch(this.trackPosition&&(this.position++,"\n"===i?(this.line++,this.column=0):this.column++),this.state){case S.BEGIN:if(this.state=S.BEGIN_WHITESPACE,"\ufeff"===i)continue;B(this,i);continue;case S.BEGIN_WHITESPACE:B(this,i);continue;case S.TEXT:if(this.sawRoot&&!this.closedRoot){for(var a=r-1;i&&"<"!==i&&"&"!==i;)(i=k(t,r++))&&this.trackPosition&&(this.position++,"\n"===i?(this.line++,this.column=0):this.column++);this.textNode+=t.substring(a,r-1)}"<"!==i||this.sawRoot&&this.closedRoot&&!this.strict?(!y(o,i)||this.sawRoot&&!this.closedRoot||D(this,"Text data outside of root node."),"&"===i?this.state=S.TEXT_ENTITY:this.textNode+=i):(this.state=S.OPEN_WAKA,this.startTagPosition=this.position);continue;case S.SCRIPT:"<"===i?this.state=S.SCRIPT_ENDING:this.script+=i;continue;case S.SCRIPT_ENDING:"/"===i?this.state=S.CLOSE_TAG:(this.script+="<"+i,this.state=S.SCRIPT);continue;case S.OPEN_WAKA:if("!"===i)this.state=S.SGML_DECL,this.sgmlDecl="";else if(E(o,i));else if(E(h,i))this.state=S.OPEN_TAG,this.tagName=i;else if("/"===i)this.state=S.CLOSE_TAG,this.tagName="";else if("?"===i)this.state=S.PROC_INST,this.procInstName=this.procInstBody="";else{if(D(this,"Unencoded <"),this.startTagPosition+1<this.position){var s=this.position-this.startTagPosition;i=new Array(s).join(" ")+i}this.textNode+="<"+i,this.state=S.TEXT}continue;case S.SGML_DECL:"[CDATA["===(this.sgmlDecl+i).toUpperCase()?(R(this,"onopencdata"),this.state=S.CDATA,this.sgmlDecl="",this.cdata=""):this.sgmlDecl+i==="--"?(this.state=S.COMMENT,this.comment="",this.sgmlDecl=""):"DOCTYPE"===(this.sgmlDecl+i).toUpperCase()?(this.state=S.DOCTYPE,(this.doctype||this.sawRoot)&&D(this,"Inappropriately located doctype declaration"),this.doctype="",this.sgmlDecl=""):">"===i?(R(this,"onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=S.TEXT):E(l,i)?(this.state=S.SGML_DECL_QUOTED,this.sgmlDecl+=i):this.sgmlDecl+=i;continue;case S.SGML_DECL_QUOTED:i===this.q&&(this.state=S.SGML_DECL,this.q=""),this.sgmlDecl+=i;continue;case S.DOCTYPE:">"===i?(this.state=S.TEXT,R(this,"ondoctype",this.doctype),this.doctype=!0):(this.doctype+=i,"["===i?this.state=S.DOCTYPE_DTD:E(l,i)&&(this.state=S.DOCTYPE_QUOTED,this.q=i));continue;case S.DOCTYPE_QUOTED:this.doctype+=i,i===this.q&&(this.q="",this.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:this.doctype+=i,"]"===i?this.state=S.DOCTYPE:E(l,i)&&(this.state=S.DOCTYPE_DTD_QUOTED,this.q=i);continue;case S.DOCTYPE_DTD_QUOTED:this.doctype+=i,i===this.q&&(this.state=S.DOCTYPE_DTD,this.q="");continue;case S.COMMENT:"-"===i?this.state=S.COMMENT_ENDING:this.comment+=i;continue;case S.COMMENT_ENDING:"-"===i?(this.state=S.COMMENT_ENDED,this.comment=N(this.opt,this.comment),this.comment&&R(this,"oncomment",this.comment),this.comment=""):(this.comment+="-"+i,this.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==i?(D(this,"Malformed comment"),this.comment+="--"+i,this.state=S.COMMENT):this.state=S.TEXT;continue;case S.CDATA:"]"===i?this.state=S.CDATA_ENDING:this.cdata+=i;continue;case S.CDATA_ENDING:"]"===i?this.state=S.CDATA_ENDING_2:(this.cdata+="]"+i,this.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===i?(this.cdata&&R(this,"oncdata",this.cdata),R(this,"onclosecdata"),this.cdata="",this.state=S.TEXT):"]"===i?this.cdata+="]":(this.cdata+="]]"+i,this.state=S.CDATA);continue;case S.PROC_INST:"?"===i?this.state=S.PROC_INST_ENDING:E(o,i)?this.state=S.PROC_INST_BODY:this.procInstName+=i;continue;case S.PROC_INST_BODY:if(!this.procInstBody&&E(o,i))continue;"?"===i?this.state=S.PROC_INST_ENDING:this.procInstBody+=i;continue;case S.PROC_INST_ENDING:">"===i?(R(this,"onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=S.TEXT):(this.procInstBody+="?"+i,this.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:E(g,i)?this.tagName+=i:(O(this),">"===i?F(this):"/"===i?this.state=S.OPEN_TAG_SLASH:(y(o,i)&&D(this,"Invalid character in tag name"),this.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===i?(F(this,!0),x(this)):(D(this,"Forward-slash in opening tag not followed by >"),this.state=S.ATTRIB);continue;case S.ATTRIB:if(E(o,i))continue;">"===i?F(this):"/"===i?this.state=S.OPEN_TAG_SLASH:E(h,i)?(this.attribName=i,this.attribValue="",this.state=S.ATTRIB_NAME):D(this,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===i?this.state=S.ATTRIB_VALUE:">"===i?(D(this,"Attribute without value"),this.attribValue=this.attribName,L(this),F(this)):E(o,i)?this.state=S.ATTRIB_NAME_SAW_WHITE:E(g,i)?this.attribName+=i:D(this,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===i)this.state=S.ATTRIB_VALUE;else{if(E(o,i))continue;D(this,"Attribute without value"),this.tag.attributes[this.attribName]="",this.attribValue="",R(this,"onattribute",{name:this.attribName,value:""}),this.attribName="",">"===i?F(this):E(h,i)?(this.attribName=i,this.state=S.ATTRIB_NAME):(D(this,"Invalid attribute name"),this.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(E(o,i))continue;E(l,i)?(this.q=i,this.state=S.ATTRIB_VALUE_QUOTED):(D(this,"Unquoted attribute value"),this.state=S.ATTRIB_VALUE_UNQUOTED,this.attribValue=i);continue;case S.ATTRIB_VALUE_QUOTED:if(i!==this.q){"&"===i?this.state=S.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=i;continue}L(this),this.q="",this.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:E(o,i)?this.state=S.ATTRIB:">"===i?F(this):"/"===i?this.state=S.OPEN_TAG_SLASH:E(h,i)?(D(this,"No whitespace between attributes"),this.attribName=i,this.attribValue="",this.state=S.ATTRIB_NAME):D(this,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(y(f,i)){"&"===i?this.state=S.ATTRIB_VALUE_ENTITY_U:this.attribValue+=i;continue}L(this),">"===i?F(this):this.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(this.tagName)">"===i?x(this):E(g,i)?this.tagName+=i:this.script?(this.script+="</"+this.tagName,this.tagName="",this.state=S.SCRIPT):(y(o,i)&&D(this,"Invalid tagname in closing tag"),this.state=S.CLOSE_TAG_SAW_WHITE);else{if(E(o,i))continue;y(h,i)?this.script?(this.script+="</"+i,this.state=S.SCRIPT):D(this,"Invalid tagname in closing tag."):this.tagName=i}continue;case S.CLOSE_TAG_SAW_WHITE:if(E(o,i))continue;">"===i?x(this):D(this,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var u,d;switch(this.state){case S.TEXT_ENTITY:u=S.TEXT,d="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:u=S.ATTRIB_VALUE_QUOTED,d="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:u=S.ATTRIB_VALUE_UNQUOTED,d="attribValue"}";"===i?(this[d]+=U(this),this.entity="",this.state=u):E(this.entity.length?m:p,i)?this.entity+=i:(D(this,"Invalid character in entity name"),this[d]+="&"+this.entity+i,this.entity="",this.state=u);continue;default:throw new Error(this,"Unknown state: "+this.state)}this.position>=this.bufferCheckPosition&&function(t){for(var r=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,a=0,o=n.length;a<o;a++){var s=t[n[a]].length;if(s>r)switch(n[a]){case"textNode":w(t);break;case"cdata":R(t,"oncdata",t.cdata),t.cdata="";break;case"script":R(t,"onscript",t.script),t.script="";break;default:M(t,"Max buffer length exceeded: "+n[a])}i=Math.max(i,s)}var u=e.MAX_BUFFER_LENGTH-i;t.bufferCheckPosition=u+t.position}(this);return this}
5
- /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(e){w(e),""!==e.cdata&&(R(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(R(e,"onscript",e.script),e.script="")}(this)}};try{t=Ci.Stream}catch(e){t=function(){}}var i=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function a(e,n){if(!(this instanceof a))return new a(e,n);t.apply(this),this._parser=new r(e,n),this.writable=!0,this.readable=!0;var o=this;this._parser.onend=function(){o.emit("end")},this._parser.onerror=function(e){o.emit("error",e),o._parser.error=null},this._decoder=null,i.forEach((function(e){Object.defineProperty(o,"on"+e,{get:function(){return o._parser["on"+e]},set:function(t){if(!t)return o.removeAllListeners(e),o._parser["on"+e]=t,t;o.on(e,t)},enumerable:!0,configurable:!1})}))}a.prototype=Object.create(t.prototype,{constructor:{value:a}}),a.prototype.write=function(e){if("function"==typeof At.isBuffer&&At.isBuffer(e)){if(!this._decoder){var t=Vr.StringDecoder;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},a.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},a.prototype.on=function(e,n){var r=this;return r._parser["on"+e]||-1===i.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),t.prototype.on.call(r,e,n)};var o="\r\n\t ",s="0124356789",u="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",l="'\"",f=o+">",d="http://www.w3.org/XML/1998/namespace",c={xml:d,xmlns:"http://www.w3.org/2000/xmlns/"};o=_(o),s=_(s),u=_(u);var h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,g=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,m=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function _(e){return e.split("").reduce((function(e,t){return e[t]=!0,e}),{})}function E(e,t){return function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)?!!t.match(e):e[t]}function y(e,t){return!E(e,t)}l=_(l),f=_(f);var v,T,A,S=0;for(var b in e.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach((function(t){var n=e.ENTITIES[t],r="number"==typeof n?String.fromCharCode(n):n;e.ENTITIES[t]=r})),e.STATE)e.STATE[e.STATE[b]]=b;function I(e,t,n){e[t]&&e[t](n)}function R(e,t,n){e.textNode&&w(e),I(e,t,n)}function w(e){e.textNode=N(e.opt,e.textNode),e.textNode&&I(e,"ontext",e.textNode),e.textNode=""}function N(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function M(e,t){return w(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,I(e,"onerror",t),e}function C(e){return e.sawRoot&&!e.closedRoot&&D(e,"Unclosed root tag"),e.state!==S.BEGIN&&e.state!==S.BEGIN_WHITESPACE&&e.state!==S.TEXT&&M(e,"Unexpected end"),w(e),e.c="",e.closed=!0,I(e,"onend"),r.call(e,e.strict,e.opt),e}function D(e,t){if("object"!=typeof e||!(e instanceof r))throw new Error("bad call to strictFail");e.strict&&M(e,t)}function O(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,R(e,"onopentagstart",n)}function P(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function L(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=P(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==d)D(e,"xml: prefix must be bound to "+d+"\nActual: "+e.attribValue);else if("xmlns"===r&&"http://www.w3.org/2000/xmlns/"!==e.attribValue)D(e,"xmlns: prefix must be bound to http://www.w3.org/2000/xmlns/\nActual: "+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,R(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function F(e,t){if(e.opt.xmlns){var n=e.tag,r=P(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(D(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){R(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var a=0,o=e.attribList.length;a<o;a++){var s=e.attribList[a],u=s[0],l=s[1],f=P(u,!0),d=f.prefix,c=f.local,h=""===d?"":n.ns[d]||"",g={name:u,value:l,prefix:d,local:c,uri:h};d&&"xmlns"!==d&&!h&&(D(e,"Unbound namespace prefix: "+JSON.stringify(d)),g.uri=d),e.tag.attributes[u]=g,R(e,"onattribute",g)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),R(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=S.TEXT:e.state=S.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function x(e){if(!e.tagName)return D(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=S.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=S.SCRIPT);R(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--;){if(e.tags[t].name===r)break;D(e,"Unexpected close tag")}if(t<0)return D(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=S.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,R(e,"onclosetag",e.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==u.ns&&Object.keys(a.ns).forEach((function(t){var n=a.ns[t];R(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=S.TEXT}function U(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),i.toLowerCase()!==n?(D(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function B(e,t){"<"===t?(e.state=S.OPEN_WAKA,e.startTagPosition=e.position):y(o,t)&&(D(e,"Non-whitespace before first tag."),e.textNode=t,e.state=S.TEXT)}function k(e,t){var n="";return t<e.length&&(n=e.charAt(t)),n}S=e.STATE,String.fromCodePoint||(v=String.fromCharCode,T=Math.floor,A=function(){var e,t,n=16384,r=[],i=-1,a=arguments.length;if(!a)return"";for(var o="";++i<a;){var s=Number(arguments[i]);if(!isFinite(s)||s<0||s>1114111||T(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?r.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,r.push(e,t)),(i+1===a||r.length>n)&&(o+=v.apply(null,r),r.length=0)}return o},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:A,configurable:!0,writable:!0}):String.fromCodePoint=A)}(t)})),Oi=u((function(e,t){!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;if("sets"in t)for(var l=0;l<t.sets.length;l++)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){if("contents"in t)for(var f=0;f<t.contents.length;f++)a(e,t.contents[f],u,t),s="seq"===t.timeContainer?t.contents[f].end:Math.max(s,t.contents[f].end),u=t.contents[f]}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=new u,this.body=null}function u(){this.styling=new l,this.layout=new c}function l(){this.styles={},this.initials={}}function f(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function d(){this.styleAttrs=null}function c(){this.regions={}}function h(e,t){g.call(this,"image"),this.src=e,this.type=t}function g(e){this.kind=e}function p(e){this.id=e}function m(e){this.regionID=e}function _(e){this.styleAttrs=e}function E(e){this.sets=e}function y(e){this.contents=e}function v(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function T(){g.call(this,"body")}function A(){g.call(this,"div")}function S(){g.call(this,"p")}function b(){g.call(this,"span")}function I(){g.call(this,"span")}function R(){g.call(this,"br")}function w(){}function N(){}function M(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function C(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function D(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&&U(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):B(t,"Cannot parse styling attribute "+a+" --\x3e "+e.attributes[i].value)}}return n}function O(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 P(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 L(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(L(e,e.styles[r],n),x(e.styles[r].styleAttrs,t.styleAttrs)):B(n,"Non-existant style id referenced")}}function F(e,t,n,r){for(var i=t.length-1;i>=0;i--){var a=t[i];a in e.styles?x(e.styles[a].styleAttrs,n):B(r,"Non-existant style id referenced")}}function x(e,t){for(var n in e)e.hasOwnProperty(n)&&(n in t||(t[n]=e[n]))}function U(e,t){if(e&&e.warn&&e.warn(t))throw t}function B(e,t){if(e&&e.error&&e.error(t))throw t}function k(e,t){throw e&&e.fatal&&e.fatal(t),t}function G(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=e[n=Math.floor((r+i)/2)];if(a<t)r=n+1;else{if(!(a>t))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,i,g){var p=t.parser(!0,{xmlns:!0}),m=[],_=[],E=[],y=0,v=null;p.onclosetag=function(e){if(m[0]instanceof w)null!==v.head&&null!==v.head.styling&&F(v.head.styling,m[0].styleRefs,m[0].styleAttrs,i),delete m[0].styleRefs;else if(m[0]instanceof l)for(var t in m[0].styles)m[0].styles.hasOwnProperty(t)&&L(m[0],m[0].styles[t],i);else if(m[0]instanceof S||m[0]instanceof b){if(m[0].contents.length>1){var r,a=[m[0].contents[0]];for(r=1;r<m[0].contents.length;r++)m[0].contents[r]instanceof I&&a[a.length-1]instanceof I?a[a.length-1].text+=m[0].contents[r].text:a.push(m[0].contents[r]);m[0].contents=a}m[0]instanceof b&&1===m[0].contents.length&&m[0].contents[0]instanceof I&&(m[0].text=m[0].contents[0].text,delete m[0].contents)}else m[0]instanceof o&&(m[0].node.uri===n.ns_tt&&"metadata"===m[0].node.local?y--:y>0&&g&&"onCloseTag"in g&&g.onCloseTag());E.shift(),_.shift(),m.shift()},p.ontext=function(e){if(void 0===m[0]);else if(m[0]instanceof b||m[0]instanceof S){if(m[0]instanceof b){var t=m[0].styleAttrs[r.byName.ruby.qname];if("container"===t||"textContainer"===t||"baseContainer"===t)return}var n=new I;n.initFromText(v,m[0],e,_[0],E[0],i),m[0].contents.push(n)}else m[0]instanceof o&&y>0&&g&&"onText"in g&&g.onText(e)},p.onopentag=function(e){var t=e.attributes["xml:space"];t?E.unshift(t.value):0===E.length?E.unshift("default"):E.unshift(E[0]);var a=e.attributes["xml:lang"];if(a?_.unshift(a.value):0===_.length?_.unshift(""):_.unshift(_[0]),e.uri===n.ns_tt)if("tt"===e.local)null!==v&&k(i,"Two <tt> elements at ("+this.line+","+this.column+")"),(v=new s).initFromNode(e,_[0],i),m.unshift(v);else if("head"===e.local)m[0]instanceof s||k(i,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),m.unshift(v.head);else if("styling"===e.local)m[0]instanceof u||k(i,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),m.unshift(v.head.styling);else if("style"===e.local){var p;m[0]instanceof l?((p=new f).initFromNode(e,i),p.id?v.head.styling.styles[p.id]=p:B(i,"<style> element missing @id attribute"),m.unshift(p)):m[0]instanceof w?((p=new f).initFromNode(e,i),x(p.styleAttrs,m[0].styleAttrs),m.unshift(p)):k(i,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if("initial"===e.local){var I;if(m[0]instanceof l){for(var M in(I=new d).initFromNode(e,i),I.styleAttrs)I.styleAttrs.hasOwnProperty(M)&&(v.head.styling.initials[M]=I.styleAttrs[M]);m.unshift(I)}else k(i,"Parent of <initial> element is not <styling> at ("+this.line+","+this.column+")")}else if("layout"===e.local)m[0]instanceof u||k(i,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),m.unshift(v.head.layout);else if("region"===e.local){m[0]instanceof c||k(i,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var C=new w;C.initFromNode(v,e,_[0],i),!C.id||C.id in v.head.layout.regions?B(i,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):v.head.layout.regions[C.id]=C,m.unshift(C)}else if("body"===e.local){m[0]instanceof s||k(i,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),null!==v.body&&k(i,"Second <body> element at "+this.line+","+this.column+")");var D=new T;D.initFromNode(v,e,_[0],i),v.body=D,m.unshift(D)}else if("div"===e.local){m[0]instanceof A||m[0]instanceof T||k(i,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var O=new A;O.initFromNode(v,m[0],e,_[0],i);var P=O.styleAttrs[r.byName.backgroundImage.qname];P&&(O.contents.push(new h(P)),delete O.styleAttrs[r.byName.backgroundImage.qname]),m[0].contents.push(O),m.unshift(O)}else if("image"===e.local){m[0]instanceof A||k(i,"Parent of <image> element is not <div> at "+this.line+","+this.column+")");var L=new h;L.initFromNode(v,m[0],e,_[0],i),m[0].contents.push(L),m.unshift(L)}else if("p"===e.local){m[0]instanceof A||k(i,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var F=new S;F.initFromNode(v,m[0],e,_[0],i),m[0].contents.push(F),m.unshift(F)}else if("span"===e.local){m[0]instanceof b||m[0]instanceof S||k(i,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var U=new b;U.initFromNode(v,m[0],e,_[0],E[0],i),m[0].contents.push(U),m.unshift(U)}else if("br"===e.local){m[0]instanceof b||m[0]instanceof S||k(i,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var G=new R;G.initFromNode(v,m[0],e,_[0],i),m[0].contents.push(G),m.unshift(G)}else if("set"===e.local){m[0]instanceof b||m[0]instanceof S||m[0]instanceof A||m[0]instanceof T||m[0]instanceof w||m[0]instanceof R||k(i,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var j=new N;j.initFromNode(v,m[0],e,i),m[0].sets.push(j),m.unshift(j)}else m.unshift(new o(e));else m.unshift(new o(e));if(m[0]instanceof o)if(e.uri===n.ns_tt&&"metadata"===e.local)y++;else if(y>0&&g&&"onOpenTag"in g){var Y=[];for(var q in e.attributes)Y[e.attributes[q].uri+" "+e.attributes[q].local]={uri:e.attributes[q].uri,local:e.attributes[q].local,value:e.attributes[q].value};g.onOpenTag(e.uri,e.local,Y)}},p.write(e).close(),delete v.head.styling.styles;var M=!1;for(var C in v.head.layout.regions)if(v.head.layout.regions.hasOwnProperty(C)){M=!0;break}if(!M){var D=w.prototype.createDefaultRegion(v.lang);v.head.layout.regions[D.id]=D}for(var O in v.head.layout.regions)v.head.layout.regions.hasOwnProperty(O)&&a(v,v.head.layout.regions[O],null,null);return v.body&&a(v,v.body,null,null),v.body&&function e(t){if(!("contents"in t))return;for(var n=("styleAttrs"in t?t.styleAttrs[r.byName.ruby.qname]:null),i="span"===t.kind&&("container"===n||"textContainer"===n||"baseContainer"===n),a=t.contents.length-1;a>=0;a--)!i||"styleAttrs"in t.contents[a]&&r.byName.ruby.qname in t.contents[a].styleAttrs?e(t.contents[a]):delete t.contents[a]}(v.body),v},s.prototype.initFromNode=function(e,t,r){var a=function(e,t){var r=O(e,n.ns_ttp,"cellResolution"),i=15,a=32;if(null!==r){var o=/(\d+) (\d+)/.exec(r);null!==o?(a=parseInt(o[1]),i=parseInt(o[2])):U(t,"Malformed cellResolution value (using initial value instead)")}return{w:a,h:i}}(e,r);this.cellLength={h:new i.ComputedLength(0,1/a.h),w:new i.ComputedLength(1/a.w,0)};var o=function(e,t){var r,i=O(e,n.ns_ttp,"frameRate"),a=30;if(null!==i){null!==(r=/(\d+)/.exec(i))?a=parseInt(r[1]):U(t,"Malformed frame rate attribute (using initial value instead)")}var o=O(e,n.ns_ttp,"frameRateMultiplier"),s=1;if(null!==o){null!==(r=/(\d+) (\d+)/.exec(o))?s=parseInt(r[1])/parseInt(r[2]):U(t,"Malformed frame rate multiplier attribute (using initial value instead)")}var u=s*a,l=1,f=O(e,n.ns_ttp,"tickRate");if(null===f)null!==i&&(l=u);else{null!==(r=/(\d+)/.exec(f))?l=parseInt(r[1]):U(t,"Malformed tick rate attribute (using initial value instead)")}return{effectiveFrameRate:u,tickRate:l}}(e,r);this.effectiveFrameRate=o.effectiveFrameRate,this.tickRate=o.tickRate,this.aspectRatio=function(e,t){var r=O(e,n.ns_ittp,"aspectRatio");null===r&&(r=O(e,n.ns_ttp,"displayAspectRatio"));var i=null;if(null!==r){var a=/(\d+)\s+(\d+)/.exec(r);if(null!==a){var o=parseInt(a[1]),s=parseInt(a[2]);0!==o&&0!==s?i=o/s:B(t,"Illegal aspectRatio values (ignoring)")}else B(t,"Malformed aspectRatio attribute (ignoring)")}return i}(e,r);var s=O(e,n.ns_ttp,"timeBase");null!==s&&"media"!==s&&k(r,"Unsupported time base");var u=function(e,t){var r=O(e,n.ns_tts,"extent");if(null===r)return null;var a=r.split(" ");if(2!==a.length)return U(t,"Malformed extent (ignoring)"),null;var o=i.parseLength(a[0]),s=i.parseLength(a[1]);if(!s||!o)return U(t,"Malformed extent values (ignoring)"),null;return{h:s,w:o}}(e,r);null===u?this.pxLength={h:null,w:null}:("px"===u.h.unit&&"px"===u.w.unit||k(r,"Extent on TT must be in px or absent"),this.pxLength={h:new i.ComputedLength(0,1/u.h.value),w:new i.ComputedLength(1/u.w.value,0)}),this.dimensions={h:new i.ComputedLength(0,1),w:new i.ComputedLength(1,0)},this.lang=t},s.prototype._registerEvent=function(e){if(!(e.end<=e.begin)){var t=G(this.events,e.begin);if(t.found||this.events.splice(t.index,0,e.begin),e.end!==Number.POSITIVE_INFINITY){var n=G(this.events,e.end);n.found||this.events.splice(n.index,0,e.end)}}},s.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},s.prototype.getMediaTimeEvents=function(){return this.events},f.prototype.initFromNode=function(e,t){this.id=M(e),this.styleAttrs=D(e,t),this.styleRefs=C(e)},d.prototype.initFromNode=function(e,t){for(var r in this.styleAttrs={},e.attributes)if(e.attributes[r].uri===n.ns_itts||e.attributes[r].uri===n.ns_ebutts||e.attributes[r].uri===n.ns_tts){var i=e.attributes[r].uri+" "+e.attributes[r].local;this.styleAttrs[i]=e.attributes[r].value}},h.prototype.initFromNode=function(e,t,n,r,i){this.src="src"in n.attributes?n.attributes.src.value:null,this.src||B(i,"Invalid image@src attribute"),this.type="type"in n.attributes?n.attributes.type.value:null,this.type||B(i,"Invalid image@type attribute"),_.prototype.initFromNode.call(this,e,t,n,i),v.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),m.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},p.prototype.initFromNode=function(e,t,n,r){this.id=M(n)},m.prototype.initFromNode=function(e,t,n,r){this.regionID=function(e){return e&&"region"in e.attributes?e.attributes.region.value:""}(n)},_.prototype.initFromNode=function(e,t,n,r){this.styleAttrs=D(n,r),null!==e.head&&null!==e.head.styling&&F(e.head.styling,C(n),this.styleAttrs,r)},E.prototype.initFromNode=function(e,t,n,r){this.sets=[]},y.prototype.initFromNode=function(e,t,n,r){this.contents=[]},v.prototype.initFromNode=function(e,t,n,r){var i=function(e,t,n,r){var i=null;n&&"begin"in n.attributes&&null===(i=P(e.tickRate,e.effectiveFrameRate,n.attributes.begin.value))&&U(r,"Malformed begin value "+n.attributes.begin.value+" (using 0)");var a=null;n&&"dur"in n.attributes&&null===(a=P(e.tickRate,e.effectiveFrameRate,n.attributes.dur.value))&&U(r,"Malformed dur value "+n.attributes.dur.value+" (ignoring)");var o=null;n&&"end"in n.attributes&&null===(o=P(e.tickRate,e.effectiveFrameRate,n.attributes.end.value))&&U(r,"Malformed end value (ignoring)");return{explicit_begin:i,explicit_end:o,explicit_dur:a}}(e,0,n,r);this.explicit_begin=i.explicit_begin,this.explicit_end=i.explicit_end,this.explicit_dur=i.explicit_dur,this.timeContainer=function(e,t){var n=e&&"timeContainer"in e.attributes?e.attributes.timeContainer.value:null;return n&&"par"!==n?"seq"===n?"seq":(B(t,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"}(n,r)},T.prototype.initFromNode=function(e,t,n,r){_.prototype.initFromNode.call(this,e,null,t,r),v.prototype.initFromNode.call(this,e,null,t,r),E.prototype.initFromNode.call(this,e,null,t,r),m.prototype.initFromNode.call(this,e,null,t,r),y.prototype.initFromNode.call(this,e,null,t,r),this.lang=n},A.prototype.initFromNode=function(e,t,n,r,i){_.prototype.initFromNode.call(this,e,t,n,i),v.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),m.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},S.prototype.initFromNode=function(e,t,n,r,i){_.prototype.initFromNode.call(this,e,t,n,i),v.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),m.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},b.prototype.initFromNode=function(e,t,n,r,i,a){_.prototype.initFromNode.call(this,e,t,n,a),v.prototype.initFromNode.call(this,e,t,n,a),E.prototype.initFromNode.call(this,e,t,n,a),m.prototype.initFromNode.call(this,e,t,n,a),y.prototype.initFromNode.call(this,e,t,n,a),this.space=i,this.lang=r},I.prototype.initFromText=function(e,t,n,r,i,a){v.prototype.initFromNode.call(this,e,t,null,a),this.text=n,this.space=i,this.lang=r},R.prototype.initFromNode=function(e,t,n,r,i){m.prototype.initFromNode.call(this,e,t,n,i),v.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},w.prototype.createDefaultRegion=function(e){var t=new w;return p.call(t,""),_.call(t,{}),E.call(t,[]),v.call(t,0,Number.POSITIVE_INFINITY,null),this.lang=e,t},w.prototype.initFromNode=function(e,t,n,r){p.prototype.initFromNode.call(this,e,null,t,r),v.prototype.initFromNode.call(this,e,null,t,r),E.prototype.initFromNode.call(this,e,null,t,r),this.styleAttrs=D(t,r),this.styleRefs=C(t),this.lang=n},N.prototype.initFromNode=function(e,t,n,r){v.prototype.initFromNode.call(this,e,t,n,r);var i=D(n,r);for(var a in this.qname=null,this.value=null,i)if(i.hasOwnProperty(a)){if(this.qname){B(r,"More than one style specified on set");break}this.qname=a,this.value=i[a]}}}(t,"undefined"==typeof sax?Di:sax,"undefined"==typeof imscNames?at:imscNames,"undefined"==typeof imscStyles?st:imscStyles,"undefined"==typeof imscUtils?ot:imscUtils)})),Pi=u((function(e,t){!function(e,t,n){function r(e,t,f,c){var h;if("region"===f.kind)(h=document.createElement("div")).style.position="absolute";else if("body"===f.kind)h=document.createElement("div");else if("div"===f.kind)h=document.createElement("div");else if("image"===f.kind){if(h=document.createElement("img"),null!==e.imgResolver&&null!==f.src){var m=e.imgResolver(f.src,h);m&&(h.src=m),h.height=e.regionH,h.width=e.regionW}}else if("p"===f.kind)h=document.createElement("p");else if("span"===f.kind)if("container"===f.styleAttrs[n.byName.ruby.qname])h=document.createElement("ruby"),e.ruby=!0;else if("base"===f.styleAttrs[n.byName.ruby.qname])h=document.createElement("rb");else if("text"===f.styleAttrs[n.byName.ruby.qname])h=document.createElement("rt");else if("baseContainer"===f.styleAttrs[n.byName.ruby.qname])h=document.createElement("rbc");else if("textContainer"===f.styleAttrs[n.byName.ruby.qname])h=document.createElement("rtc");else{if("delimiter"===f.styleAttrs[n.byName.ruby.qname])return;h=document.createElement("span")}else"br"===f.kind&&(h=document.createElement("br"));if(h){if(f.lang&&("region"!==f.kind&&f.lang===c.lang||(h.lang=f.lang)),t.appendChild(h),h.style.margin="0","region"===f.kind){var E=f.styleAttrs[n.byName.writingMode.qname];"lrtb"===E||"lr"===E?(e.ipd="lr",e.bpd="tb"):"rltb"===E||"rl"===E?(e.ipd="rl",e.bpd="tb"):"tblr"===E?(e.ipd="tb",e.bpd="lr"):"tbrl"!==E&&"tb"!==E||(e.ipd="tb",e.bpd="rl")}else if("p"===f.kind&&"tb"===e.bpd){var y=f.styleAttrs[n.byName.direction.qname];e.ipd="ltr"===y?"lr":"rl"}for(var v=0;v<d.length;v++){var T=d[v],A=f.styleAttrs[T.qname];void 0!==A&&null!==T.map&&T.map(e,h,f,A)}var S=h,b=f.styleAttrs[n.byName.linePadding.qname];if(b&&!b.isZero()){var I=b.toUsedLength(e.w,e.h);if(I>0){var R=Math.ceil(I)+"px";"tb"===e.bpd?(S.style.paddingLeft=R,S.style.paddingRight=R):(S.style.paddingTop=R,S.style.paddingBottom=R),e.lp=b}}var w=f.styleAttrs[n.byName.multiRowAlign.qname];if(w&&"auto"!==w){var N=document.createElement("span");N.style.display="inline-block",N.style.textAlign=w,h.appendChild(N),S=N,e.mra=w}var M=f.styleAttrs[n.byName.rubyReserve.qname];if(M&&"none"!==M[0]&&(e.rubyReserve=M),f.styleAttrs[n.byName.fillLineGap.qname]&&(e.flg=!0),"span"===f.kind&&f.text){var C=f.styleAttrs[n.byName.textEmphasis.qname];if(C&&"none"!==C.style&&(e.textEmphasis=!0),n.byName.textCombine.qname in f.styleAttrs&&"all"===f.styleAttrs[n.byName.textCombine.qname])h.textContent=f.text,C&&l(e,h,f,C);else for(var D="",O=0;O<f.text.length;O++){D+=f.text.charAt(O);var P=f.text.charCodeAt(O);if(P<55296||P>56319||O===f.text.length-1){var L=document.createElement("span");L.textContent=D,C&&l(e,L,f,C),h.appendChild(L),D="",L._isd_element=f}}}if("contents"in f)for(var F=0;F<f.contents.length;F++)r(e,S,f.contents[F],f);var x=[];if("p"===f.kind&&(u(e,S,x,null),e.rubyReserve&&(!function(e,t){for(var n=0;n<e.length;n++){var r,i,a=document.createElement("ruby"),o=document.createElement("rb");o.textContent="​",a.appendChild(o);var s,u=t.rubyReserve[1].toUsedLength(t.w,t.h)+"px";if("both"===t.rubyReserve[0]||"outside"===t.rubyReserve[0]&&1==e.length)(r=document.createElement("rtc")).style[p]=g?"after":"under",r.textContent="​",r.style.fontSize=u,(i=document.createElement("rtc")).style[p]=g?"before":"over",i.textContent="​",i.style.fontSize=u,a.appendChild(r),a.appendChild(i);else(r=document.createElement("rtc")).textContent="​",r.style.fontSize=u,s="after"===t.rubyReserve[0]||"outside"===t.rubyReserve[0]&&n>0?g?"after":"tb"===t.bpd||"rl"===t.bpd?"under":"over":g?"before":"tb"===t.bpd||"rl"===t.bpd?"over":"under",r.style[p]=s,a.appendChild(r);for(var l=null,f=0;f<e[n].rbc.length;f++)if("ruby"===e[n].rbc[f].localName){l=e[n].rbc[f];for(var d=0;d<l.style.length;d++)a.style.setProperty(l.style.item(d),l.style.getPropertyValue(l.style.item(d)));break}(l=l||e[n].elements[0].node).parentElement.insertBefore(a,l)}}(x,e),e.rubyReserve=null),(e.ruby||e.rubyReserve)&&(!function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].rbc.length;r++){var i;if(!e[n].rbc[r].style[p])i=g?0===n?"before":"after":"tb"===t.bpd||"rl"===t.bpd?0===n?"over":"under":0===n?"under":"over",e[n].rbc[r].style[p]=i}}(x,e),e.ruby=null),e.textEmphasis&&(!function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].te.length;r++){var i;if(!e[n].te[r].style[_]||"none"===e[n].te[r].style[_])i="tb"===t.bpd?0===n?"left over":"left under":"rl"===t.bpd?0===n?"right under":"left under":0===n?"left under":"right under",e[n].te[r].style[_]=i}}(x,e),e.textEmphasis=null),e.mra&&(!function(e){for(var t=0;t<e.length-1;t++){var n=e[t].elements.length;if(0!==n&&!1===e[t].br){var r=document.createElement("br"),i=e[t].elements[n-1].node;i.parentElement.insertBefore(r,i.nextSibling)}}}(x),e.mra=null),e.lp&&(!function(e,t,n){if(null===e)return;for(var r=0;r<e.length;r++){var i=e[r].elements.length,a=Math.ceil(t)+"px",o="-"+Math.ceil(t)+"px";if(0!==i){var s=e[r].elements[e[r].start_elem],u=e[r].elements[e[r].end_elem];if(s===u&&(elementBoundingRect=s.node.getBoundingClientRect(),0==elementBoundingRect.width||0==elementBoundingRect.height))continue;"lr"===n.ipd?(s.node.style.marginLeft=o,s.node.style.paddingLeft=a):"rl"===n.ipd?(s.node.style.paddingRight=a,s.node.style.marginRight=o):"tb"===n.ipd&&(s.node.style.paddingTop=a,s.node.style.marginTop=o),"lr"===n.ipd?(u.node.style.marginRight=o,u.node.style.paddingRight=a):"rl"===n.ipd?(u.node.style.paddingLeft=a,u.node.style.marginLeft=o):"tb"===n.ipd&&(u.node.style.paddingBottom=a,u.node.style.marginBottom=o)}}}(x,e.lp.toUsedLength(e.w,e.h),e),e.lp=null),function(e){for(var t=0;t<e.length;t++)for(var n=e[t],r=1;r<n.elements.length;){var o=n.elements[r-1],s=n.elements[r];a(o.node,s.node)?n.elements.splice(r,1):r++}for(var u,l,f=[],d=0;d<e.length;d++)for(var c=0;c<e[d].elements.length;c++)u=e[d].elements[c].node,(l=i(u,f,!1))&&(u.style.backgroundColor=l);for(var h=0;h<f.length;h++)f[h].style.backgroundColor=""}(x),e.flg)){var U=s(S.getBoundingClientRect(),e);!function(e,t,n,r,i){for(var a=Math.sign(n-t),o=0;o<=e.length;o++){var s,u,l,f;if(s=0===o?Math.round(t):o===e.length?Math.round(n):Math.round((e[o-1].after+e[o].before)/2),o>0&&e[o-1])for(l=0;l<e[o-1].elements.length;l++)f=e[o-1].elements[l],u=a*(s-f.after)+"px","lr"===r.bpd?f.node.style.paddingRight=u:"rl"===r.bpd?f.node.style.paddingLeft=u:"tb"===r.bpd&&(f.node.style.paddingBottom=u);if(o<e.length)for(l=0;l<e[o].elements.length;l++)f=e[o].elements[l],u=a*(f.before-s)+"px","lr"===r.bpd?f.node.style.paddingLeft=u:"rl"===r.bpd?f.node.style.paddingRight=u:"tb"===r.bpd&&(f.node.style.paddingTop=u)}}(x,U.before,U.after,e),e.flg=null}if("region"===f.kind&&"tb"===e.bpd&&e.enableRollUp&&f.contents.length>0&&"after"===f.styleAttrs[n.byName.displayAlign.qname]){u(e,S,x,null);var B=new o(""===f.id?"_":f.id,x);if(e.currentISDState[B.id]=B,e.previousISDState&&B.id in e.previousISDState&&e.previousISDState[B.id].plist.length>0&&B.plist.length>1&&B.plist[B.plist.length-2].text===e.previousISDState[B.id].plist[e.previousISDState[B.id].plist.length-1].text){var k=h.firstElementChild,G=B.plist[B.plist.length-1].after-B.plist[B.plist.length-1].before;k.style.bottom="-"+G+"px",k.style.transition="transform 0.4s",k.style.position="relative",k.style.transform="translateY(-"+G+"px)"}}}else!function(e,t){if(e&&e.error&&e.error(t))throw t}(e.errorHandler,"Error processing ISD element kind: "+f.kind)}function i(e,t,n){return e.style.backgroundColor?(n&&!t.includes(e)&&t.push(e),e.style.backgroundColor):"SPAN"===e.parentElement.nodeName?i(e.parentElement,t,!0):void 0}function a(e,t){if("SPAN"===e.tagName&&"SPAN"===t.tagName&&e._isd_element===t._isd_element){e.textContent+=t.textContent;for(var n=0;n<t.style.length;n++){var r=t.style[n];(r.indexOf("border")>=0||r.indexOf("padding")>=0||r.indexOf("margin")>=0)&&(e.style[r]=t.style[r])}return t.parentElement.removeChild(t),!0}return!1}function o(e,t){this.id=e,this.plist=t}function s(e,t){var n={before:null,after:null,start:null,end:null};return"tb"===t.bpd?(n.before=e.top,n.after=e.bottom,"lr"===t.ipd?(n.start=e.left,n.end=e.right):(n.start=e.right,n.end=e.left)):"lr"===t.bpd?(n.before=e.left,n.after=e.right,n.start=e.top,n.end=e.bottom):"rl"===t.bpd&&(n.before=e.right,n.after=e.left,n.start=e.top,n.end=e.bottom),n}function u(e,t,n,r){if("rt"!==t.localName&&"rtc"!==t.localName){var i,a,o,l,f=t.style.backgroundColor||r;if(0===t.childElementCount)if("span"===t.localName||"rb"===t.localName){var d=s(t.getBoundingClientRect(),e);if(0!==n.length&&(i=d.before,a=d.after,o=n[n.length-1].before,l=n[n.length-1].after,a<l&&i>o||l<=a&&o>=i)){var c=Math.sign(d.after-d.before),h=Math.sign(d.end-d.start);c*(d.before-n[n.length-1].before)<0&&(n[n.length-1].before=d.before),c*(d.after-n[n.length-1].after)>0&&(n[n.length-1].after=d.after),h*(d.start-n[n.length-1].start)<0&&(n[n.length-1].start=d.start,n[n.length-1].start_elem=n[n.length-1].elements.length),h*(d.end-n[n.length-1].end)>0&&(n[n.length-1].end=d.end,n[n.length-1].end_elem=n[n.length-1].elements.length)}else n.push({before:d.before,after:d.after,start:d.start,end:d.end,start_elem:0,end_elem:0,elements:[],rbc:[],te:[],text:"",br:!1});n[n.length-1].text+=t.textContent,n[n.length-1].elements.push({node:t,bgcolor:f,before:d.before,after:d.after})}else"br"===t.localName&&0!==n.length&&(n[n.length-1].br=!0);else for(var g=t.firstChild;g;)g.nodeType===Node.ELEMENT_NODE&&(u(e,g,n,f),"ruby"===g.localName||"rtc"===g.localName?n.length>0&&n[n.length-1].rbc.push(g):"span"===g.localName&&g.style[m]&&"none"!==g.style[m]&&n.length>0&&n[n.length-1].te.push(g)),g=g.nextSibling}}function l(e,t,n,r){var i;"none"!==r.style&&("auto"===r.style?t.style[m]="filled":t.style[m]=r.style+" "+r.symbol,("before"===r.position||"after"===r.position)&&(i="tb"===e.bpd?"before"===r.position?"left over":"left under":"rl"===e.bpd?"before"===r.position?"right under":"left under":"before"===r.position?"left under":"right under",t.style[_]=i))}function f(e,t){this.qname=e,this.map=t}e.render=function(e,t,n,i,a,o,s,u,l){var f=i||t.clientHeight,d=a||t.clientWidth;if(null!==e.aspectRatio){var c=f*e.aspectRatio;c>d?f=Math.round(d/e.aspectRatio):d=c}var h=document.createElement("div");h.style.position="relative",h.style.width=d+"px",h.style.height=f+"px",h.style.margin="auto",h.style.top=0,h.style.bottom=0,h.style.left=0,h.style.right=0,h.style.zIndex=0;var g={h:f,w:d,regionH:null,regionW:null,imgResolver:n,displayForcedOnlyMode:o||!1,isd:e,errorHandler:s,previousISDState:u,enableRollUp:l||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null,ruby:null,textEmphasis:null,rubyReserve:null};if(t.appendChild(h),"contents"in e)for(var p=0;p<e.contents.length;p++)r(g,h,e.contents[p],e);return g.currentISDState};for(var d=[new f("http://www.w3.org/ns/ttml#styling backgroundColor",(function(e,t,n,r){0!==r[3]&&(t.style.backgroundColor="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")")})),new f("http://www.w3.org/ns/ttml#styling color",(function(e,t,n,r){t.style.color="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")"})),new f("http://www.w3.org/ns/ttml#styling direction",(function(e,t,n,r){t.style.direction=r})),new f("http://www.w3.org/ns/ttml#styling display",(function(e,t,n,r){})),new f("http://www.w3.org/ns/ttml#styling displayAlign",(function(e,t,n,r){t.style.display="flex",t.style.flexDirection="column","before"===r?t.style.justifyContent="flex-start":"center"===r?t.style.justifyContent="center":"after"===r&&(t.style.justifyContent="flex-end")})),new f("http://www.w3.org/ns/ttml#styling extent",(function(e,t,n,r){e.regionH=r.h.toUsedLength(e.w,e.h),e.regionW=r.w.toUsedLength(e.w,e.h);var i=0,a=0,o=n.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];o&&(i=o[0].toUsedLength(e.w,e.h)+o[2].toUsedLength(e.w,e.h),a=o[1].toUsedLength(e.w,e.h)+o[3].toUsedLength(e.w,e.h)),t.style.height=e.regionH-i+"px",t.style.width=e.regionW-a+"px"})),new f("http://www.w3.org/ns/ttml#styling fontFamily",(function(e,t,n,r){for(var i=[],a=0;a<r.length;a++)"monospaceSerif"===r[a]?(i.push("Courier New"),i.push('"Liberation Mono"'),i.push("Courier"),i.push("monospace")):"proportionalSansSerif"===r[a]?(i.push("Arial"),i.push("Helvetica"),i.push('"Liberation Sans"'),i.push("sans-serif")):"monospace"===r[a]?i.push("monospace"):"sansSerif"===r[a]?i.push("sans-serif"):"serif"===r[a]?i.push("serif"):"monospaceSansSerif"===r[a]?(i.push("Consolas"),i.push("monospace")):"proportionalSerif"===r[a]?i.push("serif"):i.push(r[a]);if(i.length>0){for(var o=[i[0]],s=1;s<i.length;s++)-1==o.indexOf(i[s])&&o.push(i[s]);i=o}t.style.fontFamily=i.join(",")})),new f("http://www.w3.org/ns/ttml#styling shear",(function(e,t,n,r){if(0!==r){var i=-.9*r;"tb"===e.bpd?t.style.transform="skewX("+i+"deg)":t.style.transform="skewY("+i+"deg)"}})),new f("http://www.w3.org/ns/ttml#styling fontSize",(function(e,t,n,r){t.style.fontSize=r.toUsedLength(e.w,e.h)+"px"})),new f("http://www.w3.org/ns/ttml#styling fontStyle",(function(e,t,n,r){t.style.fontStyle=r})),new f("http://www.w3.org/ns/ttml#styling fontWeight",(function(e,t,n,r){t.style.fontWeight=r})),new f("http://www.w3.org/ns/ttml#styling lineHeight",(function(e,t,n,r){t.style.lineHeight="normal"===r?"normal":r.toUsedLength(e.w,e.h)+"px"})),new f("http://www.w3.org/ns/ttml#styling opacity",(function(e,t,n,r){t.style.opacity=r})),new f("http://www.w3.org/ns/ttml#styling origin",(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"})),new f("http://www.w3.org/ns/ttml#styling overflow",(function(e,t,n,r){t.style.overflow=r})),new f("http://www.w3.org/ns/ttml#styling padding",(function(e,t,n,r){var i=[];i[0]=r[0].toUsedLength(e.w,e.h)+"px",i[1]=r[3].toUsedLength(e.w,e.h)+"px",i[2]=r[2].toUsedLength(e.w,e.h)+"px",i[3]=r[1].toUsedLength(e.w,e.h)+"px",t.style.padding=i.join(" ")})),new f("http://www.w3.org/ns/ttml#styling position",(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"})),new f("http://www.w3.org/ns/ttml#styling rubyAlign",(function(e,t,n,r){t.style.rubyAlign="spaceAround"===r?"space-around":"center"})),new f("http://www.w3.org/ns/ttml#styling rubyPosition",(function(e,t,n,r){var i;"before"!==r&&"after"!==r||(i=g?r:"tb"===e.bpd||"rl"===e.bpd?"before"===r?"over":"under":"before"===r?"under":"over",t.parentElement.style[p]=i)})),new f("http://www.w3.org/ns/ttml#styling showBackground",null),new f("http://www.w3.org/ns/ttml#styling textAlign",(function(e,t,n,r){var i;i="start"===r?"rl"===e.ipd?"right":"left":"end"===r?"rl"===e.ipd?"left":"right":r,t.style.textAlign=i})),new f("http://www.w3.org/ns/ttml#styling textDecoration",(function(e,t,n,r){t.style.textDecoration=r.join(" ").replace("lineThrough","line-through")})),new f("http://www.w3.org/ns/ttml#styling textOutline",(function(e,t,n,r){})),new f("http://www.w3.org/ns/ttml#styling textShadow",(function(e,t,r,i){var a=r.styleAttrs[n.byName.textOutline.qname];if("none"===i&&"none"===a)t.style.textShadow="";else{var o=[];if("none"!==a){var s="rgba("+a.color[0].toString()+","+a.color[1].toString()+","+a.color[2].toString()+","+(a.color[3]/255).toString()+")";o.push("1px 1px 1px "+s),o.push("-1px 1px 1px "+s),o.push("1px -1px 1px "+s),o.push("-1px -1px 1px "+s)}if("none"!==i)for(var u=0;u<i.length;u++)o.push(i[u].x_off.toUsedLength(e.w,e.h)+"px "+i[u].y_off.toUsedLength(e.w,e.h)+"px "+i[u].b_radius.toUsedLength(e.w,e.h)+"px rgba("+i[u].color[0].toString()+","+i[u].color[1].toString()+","+i[u].color[2].toString()+","+(i[u].color[3]/255).toString()+")");t.style.textShadow=o.join(",")}})),new f("http://www.w3.org/ns/ttml#styling textCombine",(function(e,t,n,r){t.style.textCombineUpright=r})),new f("http://www.w3.org/ns/ttml#styling textEmphasis",(function(e,t,n,r){})),new f("http://www.w3.org/ns/ttml#styling unicodeBidi",(function(e,t,n,r){var i;i="bidiOverride"===r?"bidi-override":r,t.style.unicodeBidi=i})),new f("http://www.w3.org/ns/ttml#styling visibility",(function(e,t,n,r){t.style.visibility=r})),new f("http://www.w3.org/ns/ttml#styling wrapOption",(function(e,t,n,r){"wrap"===r?"preserve"===n.space?t.style.whiteSpace="pre-wrap":t.style.whiteSpace="normal":"preserve"===n.space?t.style.whiteSpace="pre":t.style.whiteSpace="noWrap"})),new f("http://www.w3.org/ns/ttml#styling writingMode",(function(e,t,n,r){"lrtb"===r||"lr"===r||"rltb"===r||"rl"===r?t.style.writingMode="horizontal-tb":"tblr"===r?t.style.writingMode="vertical-lr":"tbrl"!==r&&"tb"!==r||(t.style.writingMode="vertical-rl")})),new f("http://www.w3.org/ns/ttml#styling zIndex",(function(e,t,n,r){t.style.zIndex=r})),new f("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",(function(e,t,n,r){e.displayForcedOnlyMode&&!1===r&&(t.style.visibility="hidden")}))],c={},h=0;h<d.length;h++)c[d[h].qname]=d[h];var g="webkitRubyPosition"in window.getComputedStyle(document.documentElement),p=g?"webkitRubyPosition":"rubyPosition",m="webkitTextEmphasisStyle"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisStyle":"textEmphasisStyle",_="webkitTextEmphasisPosition"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisPosition":"textEmphasisPosition"}(t,"undefined"==typeof imscNames||imscNames,"undefined"==typeof imscStyles?st:imscStyles,"undefined"==typeof imscUtils||imscUtils)})),Li=ut.generateISD,Fi=Oi.fromXML,xi=Pi.render,Ui=Li,Bi=Fi,ki=xi,Gi=Ki(c),ji=Ki(P),Yi=Ki(B),qi=Ki(v),Hi=Ki(Z);function Ki(e){return e&&e.__esModule?e:{default:e}}function Vi(){var e=this.context,t=(0,ji.default)(e).getInstance(),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0;function v(e){var t=o[e].kind,n=void 0!==o[e].id?o[e].id:o[e].lang,r=o[e].lang,i=o[e].isTTML,s=o[e].isEmbedded;return a.addTextTrack(t,n,r,i,s)}function T(e,t,n,r,i,a){var o=0,s=0;e/t>n/r?o=(s=t)/r*n:s=(o=e)/n*r;var u,l,f=0,d=0;return o/s>i?(d=s,f=s*i):(f=o,d=o/i),u=(e-f)/2,l=(t-d)/2,a?{x:u+.1*f,y:l+.1*d,w:.8*f,h:.8*d}:{x:u,y:l,w:f,h:d}}function A(e,n){var r=a.getClientWidth(),i=a.getClientHeight(),o=a.getVideoWidth(),s=a.getVideoHeight(),u=a.getVideoRelativeOffsetTop(),g=a.getVideoRelativeOffsetLeft();if(0!==o&&0!==s){var _=o/s,y=!1;e.isFromCEA608&&(_=3.5/3,y=!0);var v=T.call(this,r,i,o,s,_,y),A=v.w,S=v.h,b=v.x,I=v.y;if(A!=d||S!=c||b!=l||I!=f||n){if(l=b+g,f=I+u,d=A,c=S,h){var R=h.style;R&&(R.left=l+"px",R.top=f+"px",R.width=d+"px",R.height=c+"px",R.zIndex=p&&document[p]||m?E:null,t.trigger(Yi.default.CAPTION_CONTAINER_RESIZE))}var w=e.activeCues;if(w)for(var N=w.length,M=0;M<N;++M){var C=w[M];C.scaleCue(C)}}}}function S(e){var t=d,n=c,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;if(e.cellResolution){var u=[t/e.cellResolution[0],n/e.cellResolution[1]];if(e.linePadding)for(r in e.linePadding)if(e.linePadding.hasOwnProperty(r)){i=(e.linePadding[r]*u[0]).toString();for(var l=document.getElementsByClassName("spanPadding"),f=0;f<l.length;f++)l[f].style.cssText=l[f].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i),l[f].style.cssText=l[f].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}if(e.fontSize){for(r in e.fontSize)if(e.fontSize.hasOwnProperty(r)){"%"===e.fontSize[r][0]?a=e.fontSize[r][1]/100:"c"===e.fontSize[r][0]&&(a=e.fontSize[r][1]),i=(a*u[1]).toString(),s="defaultFontSize"!==r?document.getElementsByClassName(r):document.getElementsByClassName("paragraph");for(var g=0;g<s.length;g++)s[g].style.cssText=s[g].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}if(e.lineHeight)for(r in e.lineHeight)if(e.lineHeight.hasOwnProperty(r)){"%"===e.lineHeight[r][0]?o=e.lineHeight[r][1]/100:"c"===e.fontSize[r][0]&&(o=e.lineHeight[r][1]),i=(o*u[1]).toString(),s=document.getElementsByClassName(r);for(var p=0;p<s.length;p++)s[p].style.cssText=s[p].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}}}if(e.isd){var m=document.getElementById(e.cueID);m&&h.removeChild(m),b(e)}}function b(e){if(h){var n=document.createElement("div");h.appendChild(n),_=ki(e.isd,n,(function(t){var n=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,r=/^#(.*)$/;if(n.test(t)){var i=n.exec(t),a=parseInt(i[4],10)-1;return"data:image/png;base64,"+btoa(e.images[a])}if(r.test(t)){var o=r.exec(t)[1];return"data:image/png;base64,"+e.embeddedImages[o]}return null}),h.clientHeight,h.clientWidth,!1,(function(e){r.info("renderCaption :",e)}),_,!0),n.id=e.cueID,t.trigger(Yi.default.CAPTION_RENDERED,{captionDiv:n,currentTrackIdx:u})}}function I(e){return e>=0&&o[e]?a.getTextTrack(o[e].kind,o[e].id,o[e].lang,o[e].isTTML,o[e].isEmbedded):null}function R(e){var t=this;if(e!==u){var n=I(u=e);w.call(this,n),g&&(clearInterval(g),g=null),n&&"html"===n.renderingType&&(A.call(this,n,!0),window.ResizeObserver?(y=new window.ResizeObserver((function(){A.call(t,n,!0)}))).observe(a.getElement()):g=setInterval(A.bind(this,n),500))}}function w(e){O.call(this),e&&"html"===e.renderingType?C.call(this):D.call(this)}function N(e,t,n){return(isNaN(t)||e.startTime>=t)&&(isNaN(n)||e.endTime<=n)}function M(e,t,n){if(e.cues)for(var r=e.cues,i=r.length-1;i>=0;i--)N(r[i],t,n)&&e.removeCue(r[i])}function C(){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,n=a.getElement();try{n&&(n.id?t.insertRule("#"+n.id+"::cue {background: transparent}",0):0!==n.classList.length?t.insertRule("."+n.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){r.info(""+e.message)}}}function D(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function O(){if(h)for(;h.firstChild;)h.removeChild(h.firstChild)}return n={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(i=window.VTTCue||window.TextTrackCue,o=[],s=[],u=-1,l=0,f=0,d=0,c=0,h=null,g=null,m=!1,E=2147483647,_=null,void 0!==document.fullscreenElement?p="fullscreenElement":void 0!==document.webkitIsFullScreen?p="webkitIsFullScreen":document.msFullscreenElement?p="msFullscreenElement":document.mozFullScreen&&(p="mozFullScreen"))},setDisplayCConTop:function(e){(0,et.checkParameterType)(e,"boolean"),m=e,h&&!document[p]&&(h.style.zIndex=e?E:null)},addTextTrack:function(e,n){if(o.length!==n){if(o.push(e),o.length===n){o.sort((function(e,t){return e.index-t.index})),h=a.getTTMLRenderingDiv();for(var i=-1,l=0;l<o.length;l++){var f=v.call(this,l);s.push(f),o[l].defaultTrack&&(f.default=!0,i=l);var d=I(l);d&&(d.mode=Gi.default.TEXT_SHOWING,h&&(o[l].isTTML||o[l].isEmbedded)?d.renderingType="html":d.renderingType="default"),this.addCaptions(l,0,o[l].captionData),t.trigger(Yi.default.TEXT_TRACK_ADDED)}if(R.call(this,i),i>=0){t.on(Yi.default.PLAYBACK_METADATA_LOADED,(function e(){var n=I(i);n&&A.call(this,n,!0),t.off(Yi.default.PLAYBACK_METADATA_LOADED,e,this)}),this);for(var c=0;c<o.length;c++){var g=I(c);g&&(g.mode=c===i?Gi.default.TEXT_SHOWING:Gi.default.TEXT_HIDDEN)}}t.trigger(Yi.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:u,tracks:o})}}else r.error("Trying to add too many tracks.")},addCaptions:function(e,n,a){var o=I(e),s=this;if(o&&Array.isArray(a)&&0!==a.length)for(var g=0;g<a.length;g++){var p=void 0,m=a[g];o.cellResolution=m.cellResolution,o.isFromCEA608=m.isFromCEA608,"html"===m.type&&h?((p=new i(m.start-n,m.end-n,"")).cueHTMLElement=m.cueHTMLElement,p.isd=m.isd,p.images=m.images,p.embeddedImages=m.embeddedImages,p.cueID=m.cueID,p.scaleCue=S.bind(s),p.cellResolution=m.cellResolution,p.lineHeight=m.lineHeight,p.linePadding=m.linePadding,p.fontSize=m.fontSize,h.style.left=l+"px",h.style.top=f+"px",h.style.width=d+"px",h.style.height=c+"px",p.onenter=function(){o.mode===Gi.default.TEXT_SHOWING&&(this.isd?(b(this),r.debug("Cue enter id:"+this.cueID)):(h.appendChild(this.cueHTMLElement),S.call(s,this),t.trigger(Yi.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:u})))},p.onexit=function(){if(h)for(var e=h.childNodes,t=0;t<e.length;++t)e[t].id===this.cueID&&(r.debug("Cue exit id:"+e[t].id),h.removeChild(e[t]),--t)}):m.data&&(p=new i(m.start-n,m.end-n,m.data),m.styles&&(void 0!==m.styles.align&&"align"in p&&(p.align=m.styles.align),void 0!==m.styles.line&&"line"in p&&(p.line=m.styles.line),void 0!==m.styles.position&&"position"in p&&(p.position=m.styles.position),void 0!==m.styles.size&&"size"in p&&(p.size=m.styles.size)),p.onenter=function(){o.mode===Gi.default.TEXT_SHOWING&&t.trigger(Yi.default.CAPTION_RENDERED,{currentTrackIdx:u})});try{p?o.addCue(p):r.error("impossible to display subtitles.")}catch(e){throw M(o),o.addCue(p),e}}},getCurrentTrackIdx:function(){return u},setCurrentTrackIdx:R,getTrackIdxForId:function(e){for(var t=-1,n=0;n<o.length;n++)if(o[n].id===e){t=n;break}return t},getCurrentTrackInfo:function(){return o[u]},setModeForTrackIdx:function(e,t){var n=I(e);n&&n.mode!==t&&(n.mode=t)},deleteCuesFromTrackIdx:function(e,t,n){var r=I(e);r&&M(r,t,n)},deleteAllTextTracks:function(){for(var e=s?s.length:0,t=0;t<e;t++){var n=I(t);n&&(M.call(this,n),n.mode="disabled")}s=[],o=[],g&&(clearInterval(g),g=null),y&&a&&(y.unobserve(a.getElement()),y=null),u=-1,O.call(this)},deleteTextTrack:function(e){a.removeChild(s[e]),s.splice(e,1)},setConfig:function(e){e&&e.videoModel&&(a=e.videoModel)}},r=(0,Hi.default)(e).getInstance().getLogger(n),n}Vi.__dashjs_factory_name="TextTracks";var zi=qi.default.getSingletonFactory(Vi),Wi=Object.defineProperty({default:zi},"__esModule",{value:!0}),Xi=function(e){return e&&e.__esModule?e:{default:e}}(v);function Qi(){var e=0;function t(e){for(var t="",n=0;n<e.length;++n){t+=e[n].uchar}return t.length-t.replace(/^\s+/,"").length}function n(e){return"left: "+3.125*e.x+"%; top: "+6.66*e.y1+"%; width: "+(100-3.125*e.x)+"%; height: "+6.66*Math.max(e.y2-1-e.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function r(e){return"red"===e?"rgb(255, 0, 0)":"green"===e?"rgb(0, 255, 0)":"blue"===e?"rgb(0, 0, 255)":"cyan"===e?"rgb(0, 255, 255)":"magenta"===e?"rgb(255, 0, 255)":"yellow"===e?"rgb(255, 255, 0)":"white"===e?"rgb(255, 255, 255)":"black"===e?"rgb(0, 0, 0)":e}function i(e,t){var n=e.videoHeight/15;return t?"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(t.foreground?r(t.foreground):"rgb(255, 255, 255)")+"; font-style: "+(t.italics?"italic":"normal")+"; text-decoration: "+(t.underline?"underline":"none")+"; white-space: pre; background-color: "+(t.background?r(t.background):"transparent")+";":"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function a(e){return e.replace(/^\s+/g,"")}function o(e){return e.replace(/\s+$/g,"")}return{createHTMLCaptionsFromScreen:function(r,s,u,l){var f=null,d=!1,c=-1,h={start:s,end:u,spans:[]},g="style_cea608_white_black",p={},m={},_=[],E=void 0,y=void 0;for(E=0;E<15;++E){var v=l.rows[E],T="",A=null;if(!1===v.isEmpty()){var S=t(v.chars);null===f&&(f={x:S,y1:E,y2:E+1,p:[]}),S!==c&&d&&(f.p.push(h),h={start:s,end:u,spans:[]},f.y2=E,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===p.hasOwnProperty(f.name)?(_.push(f),p[f.name]=f):p[f.name].p.contat(f.p),f={x:S,y1:E,y2:E+1,p:[]});for(var b=0;b<v.chars.length;++b){var I=v.chars[b],R=I.penState;if(null===A||!R.equals(A)){T.trim().length>0&&(h.spans.push({name:g,line:T,row:E}),T="");var w="style_cea608_"+R.foreground+"_"+R.background;R.underline&&(w+="_underline"),R.italics&&(w+="_italics"),m.hasOwnProperty(w)||(m[w]=JSON.parse(JSON.stringify(R))),A=R,g=w}T+=I.uchar}T.trim().length>0&&h.spans.push({name:g,line:T,row:E}),d=!0,c=S}else d=!1,c=-1,f&&(f.p.push(h),h={start:s,end:u,spans:[]},f.y2=E,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===p.hasOwnProperty(f.name)?(_.push(f),p[f.name]=f):p[f.name].p.contat(f.p),f=null)}f&&(f.p.push(h),f.y2=E+1,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===p.hasOwnProperty(f.name)?(_.push(f),p[f.name]=f):p[f.name].p.contat(f.p),f=null);var N=[];for(E=0;E<_.length;++E){var M=_[E],C="sub_cea608_"+e++,D=document.createElement("div");D.id=C;var O=n(M);D.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+O;var P=document.createElement("div");P.className="paragraph bodyStyle",P.style.cssText=i(r);var L=document.createElement("div");L.className="cueUniWrapper",L.style.cssText="unicode-bidi: normal; direction: ltr;";for(var F=0;F<M.p.length;++F){var x=M.p[F],U=0;for(y=0;y<x.spans.length;++y){var B=x.spans[y];if(B.line.length>0){if(0!==y&&U!=B.row){var k=document.createElement("br");k.className="lineBreak",L.appendChild(k)}var G=!1;U===B.row&&(G=!0),U=B.row;var j=m[B.name],Y=document.createElement("span");Y.className="spanPadding "+B.name+" customSpanColor",Y.style.cssText=i(r,j),0!==y&&G?y===x.spans.length-1?Y.textContent=o(B.line):Y.textContent=B.line:x.spans.length>1&&y<x.spans.length-1&&B.row===x.spans[y+1].row?Y.textContent=a(B.line):Y.textContent=B.line.trim(),L.appendChild(Y)}}}P.appendChild(L),D.appendChild(P);var q={bodyStyle:["%",90]};for(var H in m)m.hasOwnProperty(H)&&(q[H]=["%",90]);N.push({type:"html",start:s,end:u,cueHTMLElement:D,cueID:C,cellResolution:[32,15],isFromCEA608:!0,fontSize:q,lineHeight:{},linePadding:{}})}return N}}}Qi.__dashjs_factory_name="EmbeddedTextHtmlRender";var Zi=Xi.default.getSingletonFactory(Qi),$i=Object.defineProperty({default:Zi},"__esModule",{value:!0}),Ji=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var ea=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return Ji(e,[{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])}}}]),e}(),ta=Object.defineProperty({default:ea},"__esModule",{value:!0});var na=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,e.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,e.SEGMENTS_UPDATE_FAILED_ERROR_CODE=13,e.SEGMENTS_UNAVAILABLE_ERROR_CODE=14,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_CODEC_CODE=30,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 segments",e.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize 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="buffer is not defined",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 function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(ta).default)),ra=Object.defineProperty({default:na},"__esModule",{value:!0}),ia=Ea(c),aa=Ea(we),oa=Ea(ze),sa=Ea(it),ua=Ea(v),la=Ea(Z),fa=Ea(Wi),da=Ea($i),ca=Ea(xe),ha=Ea(l),ga=Ea(P),pa=Ea(B),ma=Ea(Ie),_a=Ea(ra);function Ea(e){return e&&e.__esModule?e:{default:e}}function ya(){var e=this.context,t=(0,ga.default)(e).getInstance(),n=!1,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0;function M(){p=null,_=NaN,E=[],T=null,m=!1}function C(){M(),h=[],f=null}function D(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&F(t.bytes,t)}function O(){S=[],(g=(0,fa.default)(e).getInstance()).setConfig({videoModel:y}),g.initialize(),a=(0,oa.default)(e).getInstance(),A=null,b=0,R=[],I=null,n=!0,w=(0,da.default)(e).getInstance();var r=v.getActiveStreamProcessors();for(var i in r)if("video"===r[i].getType()){N=r[i].getRepresentationInfo().MSETimeOffset;break}t.on(pa.default.VIDEO_CHUNK_RECEIVED,D,this),t.on(pa.default.BUFFER_CLEARED,U,this)}function P(e){A=e}function L(e,t){var n,r,i=new aa.default,a={subtitle:"subtitles",caption:"captions"};i.captionData=e,i.lang=t.lang,i.labels=t.labels,i.id=t.id?t.id:t.index,i.index=t.index,i.isTTML=(n=!1,t.codec&&t.codec.search(ia.default.STPP)>=0&&(n=!0),t.mimeType&&t.mimeType.search(ia.default.TTML)>=0&&(n=!0),n),i.defaultTrack=function(e){var t=!1;S.length>1&&e.isEmbedded?t=e.id&&e.id===ia.default.CC1:1===S.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===S.length&&(t=e.index===h[0].index);return t}(t),i.isFragmented=!s.getIsTextTrack(t.mimeType),i.isEmbedded=!!t.isEmbedded,i.kind=r=(r=t.roles.length>0?a[t.roles[0]]:a.caption)===a.caption||r===a.subtitle?r:a.caption,i.roles=t.roles,i.accessibility=t.accessibility;var o=(h?h.length:0)+S.length;g.addTextTrack(i,o)}function F(e,t){var n=void 0,r=void 0,s=void 0,l=void 0,d=void 0,c=void 0,h=void 0,E=t.mediaInfo,v=E.type,M=E.mimeType,C=E.codec||M;if(C){if(v===ia.default.FRAGMENTED_TEXT)if(m||"InitializationSegment"!==t.segmentType){if(!m)return;if(r=(c=a.getSamplesInfo(e)).sampleList,null===T&&r.length>0&&(T=r[0].cts-t.start*_),C.search(ia.default.STPP)>=0)for(f=null!==f?f:x(C),s=0;s<r.length;s++){var D=r[s],O=D.cts,P=O-T;this.buffered.add(P/_,(P+D.duration)/_);var F=new DataView(e,D.offset,D.subSizes[0]);h=ca.default.Utils.dataViewToString(F,ia.default.UTF8);var U=[],B=D.offset+D.subSizes[0];for(l=1;l<D.subSizes.length;l++){var k=new Uint8Array(e,B,D.subSizes[l]),G=String.fromCharCode.apply(null,k);U.push(G),B+=D.subSizes[l]}try{var j=u.getValue().ttmlTimeIsRelative?O/_:0;n=f.parse(h,j,O/_,(O+D.duration)/_,U),g.addCaptions(A,T/_,n)}catch(e){p.removeExecutedRequestsBeforeTime(),this.remove(),i.error("TTML parser error: "+e.message)}}else{var Y=[];for(s=0;s<r.length;s++){var q=r[s];q.cts-=T,this.buffered.add(q.cts/_,(q.cts+q.duration)/_);var H=e.slice(q.offset,q.offset+q.size),K=ca.default.parseBuffer(H);for(l=0;l<K.boxes.length;l++){var V=K.boxes[l];if(i.debug("VTT box1: "+V.type),"vtte"!==V.type&&"vttc"===V.type)for(i.debug("VTT vttc boxes.length = "+V.boxes.length),d=0;d<V.boxes.length;d++){var z=V.boxes[d];if(i.debug("VTT box2: "+z.type),"payl"===z.type){var W=z.cue_text;i.debug("VTT cue_text = "+W);var X=q.cts/_,Q=(q.cts+q.duration)/_;Y.push({start:X,end:Q,data:W,styles:{}}),i.debug("VTT "+X+"-"+Q+" : "+W)}}}}Y.length>0&&g.addCaptions(A,0,Y)}}else m=!0,_=a.getMediaTimescaleFromMoov(e);else if(v===ia.default.TEXT){var Z=new DataView(e,0,e.byteLength);h=ca.default.Utils.dataViewToString(Z,ia.default.UTF8);try{n=x(C).parse(h,0),g.addCaptions(g.getCurrentTrackIdx(),0,n)}catch(e){o.error(new ma.default(_a.default.TIMED_TEXT_ERROR_ID_PARSE_CODE,_a.default.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,h))}}else if(v===ia.default.VIDEO)if(t.segmentType===ce.HTTPRequest.INIT_SEGMENT_TYPE){if(0===b)for(b=a.getMediaTimescaleFromMoov(e),s=0;s<S.length;s++)L(null,S[s])}else{if(0===b)return void i.warn("CEA-608: No timescale for embeddedTextTrack yet");var $=function(e,t){return function(e,n,r){var i=null;i=y.getTTMLRenderingDiv()?w.createHTMLCaptionsFromScreen(y.getElement(),e,n,r):[{start:e,end:n,data:r.getDisplayText(),styles:{}}],i&&g.addCaptions(t,0,i)}},J=(c=a.getSamplesInfo(e)).lastSequenceNumber;if(!R[0]&&!R[1]){var ee=void 0,te=void 0;for(s=0;s<S.length;s++){if(S[s].id===ia.default.CC1?te=g.getTrackIdxForId(ia.default.CC1):S[s].id===ia.default.CC3&&(te=g.getTrackIdxForId(ia.default.CC3)),-1===te)return void i.warn("CEA-608: data before track is ready.");ee=$(0,te),R[s]=new ha.default.Cea608Parser(s+1,{newCue:ee},null)}}if(b){if(null!==I&&J!==I+c.numSequences)for(s=0;s<R.length;s++)R[s]&&R[s].reset();for(var ne=function(e,t){if(0===t.length)return null;for(var n={splits:[],fields:[[],[]]},r=new DataView(e),i=0;i<t.length;i++)for(var a=t[i],o=ha.default.findCea608Nalus(r,a.offset,a.size),s=null,u=0,l=0;l<o.length;l++)for(var f=ha.default.extractCea608DataFromRange(r,o[l]),d=0;d<2;d++)f[d].length>0&&(a.cts!==s?u=0:u+=1,n.fields[d].push([a.cts+N*b,f[d],u]),s=a.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,c.sampleList),re=0;re<R.length;re++){var ie=ne.fields[re],ae=R[re];if(ae)for(s=0;s<ie.length;s++)ae.addData(ie[s][0]/b,ie[s][1])}I=J}}}else i.error("No text type defined")}function x(e){var t=void 0;return e.search(ia.default.VTT)>=0?t=d:(e.search(ia.default.TTML)>=0||e.search(ia.default.STPP)>=0)&&(t=c),t}function U(e){S.forEach((function(t){var n=g.getTrackIdxForId(t.id);n>=0&&g.deleteCuesFromTrackIdx(n,e.from,e.to)}))}return r={initialize:function(t,i,o,u){n||O(),g.setConfig({videoModel:y}),g.initialize(),a||(a=(0,oa.default)(e).getInstance()),function(t,n,i,a){var o=!s.getIsTextTrack(t);if(h=h.concat(i),o){p=a,r.buffered=(0,sa.default)(e).create(),E=l.getTracksFor(ia.default.FRAGMENTED_TEXT,n);for(var u=l.getCurrentTrackFor(ia.default.FRAGMENTED_TEXT,n),f=0;f<E.length;f++)if(E[f]===u){P(f);break}}for(var d=0;d<h.length;d++)L(null,h[d])}(t,i,o,u)},append:F,abort:function(){g.deleteAllTextTracks(),M(),a=null,h=[]},addEmbeddedTrack:function(e){if(n||O(),e)if(e.id===ia.default.CC1||e.id===ia.default.CC3){for(var t=0;t<S.length;t++)if(S[t].id===e.id)return;S.push(e)}else i.warn("Embedded track "+e.id+" not supported!")},resetEmbedded:function(){t.off(pa.default.VIDEO_CHUNK_RECEIVED,D,this),t.off(pa.default.BUFFER_CLEARED,U,this),g&&g.deleteAllTextTracks(),n=!1,S=[],R=[null,null],I=null},setConfig:function(e){e&&(e.errHandler&&(o=e.errHandler),e.adapter&&(s=e.adapter),e.manifestModel&&(u=e.manifestModel),e.mediaController&&(l=e.mediaController),e.videoModel&&(y=e.videoModel),e.streamController&&(v=e.streamController),e.textTracks&&(g=e.textTracks),e.vttParser&&(d=e.vttParser),e.ttmlParser&&(c=e.ttmlParser))},getConfig:function(){return{fragmentModel:p,fragmentedTracks:E,videoModel:y}},setCurrentFragmentedTrackIdx:P,remove:function(e,t){void 0===e&&e===t&&(e=this.buffered.start(0),t=this.buffered.end(this.buffered.length-1)),this.buffered.remove(e,t)},reset:function(){C(),v=null,y=null,g=null}},i=(0,la.default)(e).getInstance().getLogger(r),C(),r}ya.__dashjs_factory_name="TextSourceBuffer";var va=ua.default.getSingletonFactory(ya),Ta=Object.defineProperty({default:va},"__esModule",{value:!0}),Aa=ba(v),Sa=ba(Z);function ba(e){return e&&e.__esModule?e:{default:e}}function Ia(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0;function s(e){var t=e.split(":"),n=t.length-1;return e=60*parseInt(t[n-1],10)+parseFloat(t[n]),2===n&&(e+=3600*parseInt(t[0],10)),e}function u(e){var t=e.split(i),n=t[1].split(o);return n.shift(),t[1]=n[0],n.shift(),{cuePoints:t,styles:l(n)}}function l(e){var t={};return e.forEach((function(e){if(e.split(/:/).length>1){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 f(e,t){for(var n,r=t,a="",o="";""!==e[r]&&r<e.length;)r++;if((n=r-t)>1)for(var s=0;s<n;s++){if((o=e[t+s]).match(i)){a="";break}a+=o,s!==n-1&&(a+="\n")}else(o=e[t]).match(i)||(a=o);return a}return t={parse:function(e){var t,o=[],l=void 0;if(!e)return o;t=(e=e.split(r)).length,l=-1;for(var d=0;d<t;d++){var c=e[d];if(c.length>0&&"WEBVTT"!==c&&c.match(i)){var h=u(c),g=h.cuePoints,p=h.styles,m=f(e,d+1),_=s(g[0].replace(a,"")),E=s(g[1].replace(a,""));!isNaN(_)&&!isNaN(E)&&_>=l&&E>_?""!==m?(l=_,o.push({start:_,end:E,data:m,styles:p})):n.error("Skipping cue due to empty/malformed cue text"):n.error("Skipping cue due to incorrect cue timing")}}return o}},n=(0,Sa.default)(e).getInstance().getLogger(t),r=/(?:\r\n|\r|\n)/gm,i=/-->/,a=/(^[\s]+|[\s]+$)/g,o=/\s\b/g,t}Ia.__dashjs_factory_name="VTTParser";var Ra=Aa.default.getSingletonFactory(Ia),wa=Object.defineProperty({default:Ra},"__esModule",{value:!0}),Na=Object.defineProperty({default:{LEVELS:{SUGGESTION:"Suggestion",WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'}}}},"__esModule",{value:!0}),Ma=Fa(v),Ca=Fa(Z),Da=Fa(P),Oa=Fa(B),Pa=Fa(R),La=Fa(Na);function Fa(e){return e&&e.__esModule?e:{default:e}}function xa(){var e=this.context,t=(0,Da.default)(e).getInstance(),n=void 0,r=void 0,i=0;return n={parse:function(e,n,a,o,s){var u="",l=[],f=void 0,d=void 0,c=void 0,h={},g={},p="",m="",_={onOpenTag:function(e,n,i){if(i[" imagetype"]&&!i[" imageType"]&&(t.trigger(Pa.default.CONFORMANCE_VIOLATION,{level:La.default.LEVELS.ERROR,event:La.default.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 r.warn("smpte-tt imageType != PNG. Discarded");p=i["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){p&&(g[p]=m.trim()),m="",p=""},onText:function(e){p&&(m+=e)}};if(!e)throw u="no ttml data to parse",new Error(u);h.data=e,t.trigger(Oa.default.TTML_TO_PARSE,h);var E=Bi(h.data,(function(e){u=e}),_);t.trigger(Oa.default.TTML_PARSED,{ttmlString:h.data,ttmlDoc:E});var y,v=E.getMediaTimeEvents();for(c=0;c<v.length;c++){var T=Ui(E,v[c],(function(e){u=e}));T.contents.some((function(e){return e.contents.length}))&&(f=v[c]+n<a?a:v[c]+n)<(d=v[c+1]+n>o?o:v[c+1]+n)&&l.push({start:f,end:d,type:"html",cueID:(y=void 0,y="cue_TTML_"+i,i++,y),isd:T,images:s,embeddedImages:g})}if(""!==u)throw r.error(u),new Error(u);return l}},r=(0,Ca.default)(e).getInstance().getLogger(n),n}xa.__dashjs_factory_name="TTMLParser";var Ua=Ma.default.getSingletonFactory(xa),Ba=Object.defineProperty({default:Ua},"__esModule",{value:!0}),ka=za(c),Ga=za(v),ja=za(Ta),Ya=za(Wi),qa=za(wa),Ha=za(Ba),Ka=za(P),Va=za(B);function za(e){return e&&e.__esModule?e:{default:e}}function Wa(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0;function A(e){void 0===T&&null!==e.fromStreamInfo&&(T=this.getCurrentTrackIdx())}function S(){void 0===T&&(T=this.getCurrentTrackIdx())}function b(){void 0!==T&&(this.setTextTrack(T),T=void 0)}function I(e){var t=this,n=e.tracks,r=e.index;h&&n.some((function(e,n){if(o.matchSettings(h,e))return t.setTextTrack(n),r=n,!0})),(!1===m||void 0===m&&!h||v)&&this.setTextTrack(-1),p=r,c.trigger(Va.default.TEXT_TRACKS_ADDED,{enabled:w(),index:r,tracks:n}),y=!0}function R(e){if(!g&&e&&e.newMediaInfo){var t=e.newMediaInfo;t.type===ka.default.FRAGMENTED_TEXT&&(h={lang:t.lang,role:t.roles[0],accessibility:t.accessibility[0]})}}function w(){var e=!0;return _&&!E&&(e=!1),e}function N(){_=!0,y=!1,v=!1}return t={setConfig:function(e){e&&(e.errHandler&&(r=e.errHandler),e.adapter&&(i=e.adapter),e.manifestModel&&(a=e.manifestModel),e.mediaController&&(o=e.mediaController),e.videoModel&&(s=e.videoModel),e.streamController&&(u=e.streamController),e.textTracks&&(l=e.textTracks),e.vttParser&&(f=e.vttParser),e.ttmlParser&&(d=e.ttmlParser),n.setConfig({errHandler:r,adapter:i,manifestModel:a,mediaController:o,videoModel:s,streamController:u,textTracks:l,vttParser:f,ttmlParser:d}))},getTextSourceBuffer:function(){return n},getAllTracksAreDisabled:function(){return _},addEmbeddedTrack:function(e){n.addEmbeddedTrack(e)},getTextDefaultLanguage:function(){return h&&h.lang||""},setTextDefaultLanguage:function(e){(0,et.checkParameterType)(e,"string"),h||(h={}),h.lang=e,g=!0},setTextDefaultEnabled:function(e){(0,et.checkParameterType)(e,"boolean"),(m=e)?_=!1:this.setTextTrack(-1)},getTextDefaultEnabled:function(){return void 0!==m&&m},setInitialSettings:function(e){h=e,g=!0},enableText:function(e){(0,et.checkParameterType)(e,"boolean"),!m&&e&&(m=!0),w()!==e&&(e&&this.setTextTrack(p),e||(p=this.getCurrentTrackIdx(),y?this.setTextTrack(-1):v=!0))},isTextEnabled:w,setTextTrack:function(e){var t=n.getConfig(),r=t.fragmentModel,i=t.fragmentedTracks,a=t.videoModel,s=void 0,f=void 0;_=-1===e;var d=l.getCurrentTrackIdx();if(d!==e){_&&o&&o.saveTextSettingsDisabled(),l.setModeForTrackIdx(d,ka.default.TEXT_HIDDEN),l.setCurrentTrackIdx(e),l.setModeForTrackIdx(e,ka.default.TEXT_SHOWING);var c=l.getCurrentTrackInfo();if(c&&c.isFragmented&&!c.isEmbedded)for(var h=0;h<i.length;h++){var g=i[h];if(c.lang===g.lang&&c.index===g.index&&(g.id?c.id===g.id:c.id===g.index))if(g!==o.getCurrentTrackFor(ka.default.FRAGMENTED_TEXT,u.getActiveStreamInfo()))r.abortRequests(),r.removeExecutedRequestsBeforeTime(),n.remove(),l.deleteCuesFromTrackIdx(d),o.setTrack(g),n.setCurrentFragmentedTrackIdx(h);else if(-1===d){for(var p=u.getActiveStreamProcessors(),m=0;m<p.length;m++)if(p[m].getType()===ka.default.FRAGMENTED_TEXT){f=p[m];break}f.setBufferingTime(a.getTime()),f.getScheduleController().start()}}else if(c&&!c.isFragmented){for(var E=u.getActiveStreamProcessors(),y=0;y<E.length;y++)if(E[y].getType()===ka.default.TEXT){s=(f=E[y]).getMediaInfoArr();break}if(f&&s)for(var v=0;v<s.length;v++)if(s[v].index===c.index&&s[v].lang===c.lang){f.selectMediaInfo(s[v]);break}}}},getCurrentTrackIdx:function(){return l.getCurrentTrackIdx()},enableForcedTextStreaming:function(e){(0,et.checkParameterType)(e,"boolean"),E=e},reset:function(){N(),n.resetEmbedded(),n.reset()}},h=null,p=-1,E=!1,y=!1,g=!1,v=!1,l=(0,Ya.default)(e).getInstance(),f=(0,qa.default)(e).getInstance(),d=(0,Ha.default)(e).getInstance(),n=(0,ja.default)(e).getInstance(),c=(0,Ka.default)(e).getInstance(),l.initialize(),c.on(Va.default.TEXT_TRACKS_QUEUE_INITIALIZED,I,t),c.on(Va.default.CURRENT_TRACK_CHANGED,R,t),c.on(Va.default.PERIOD_SWITCH_STARTED,A,t),c.on(Va.default.STREAM_COMPLETED,S,t),c.on(Va.default.PERIOD_SWITCH_COMPLETED,b,t),N(),t}Wa.__dashjs_factory_name="TextController";var Xa=Ga.default.getSingletonFactory(Wa),Qa=Object.defineProperty({default:Xa},"__esModule",{value:!0}),Za=io(Z),$a=io(Ie),Ja=io(P),eo=io(B),to=io(v),no=io(Qa),ro=io(ra);function io(e){return e&&e.__esModule?e:{default:e}}function ao(e,t,n,r){var i=this.context,a=(0,Ja.default)(i).getInstance(),o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=[],h=[],g=n;function p(){try{return l.buffered}catch(e){return u.error("getAllBufferRanges exception: "+e.message),null}}function m(t){l&&A((function(){try{var n=e.duration,r=0;t&&!isNaN(t.start)&&!isNaN(t.duration)&&isFinite(t.duration)&&(n=t.start+t.duration),t&&!isNaN(t.start)&&(r=t.start),l.appendWindowStart=0,l.appendWindowEnd=n,l.appendWindowStart=r,u.debug("Updated append window. Set start to "+l.appendWindowStart+" and end to "+l.appendWindowEnd)}catch(e){u.warn("Failed to set append window")}}))}function _(){var e=this;if(h.length>0){f=!0;var t=h[0];h.splice(0,1);var n=[],r=function(){var r=p();!function(e,t,n,r){t&&t.length>0&&t.length<n.length&&function(e,t){for(var n=0;n<e.length;n++){var r=Math.round(e.start(n)),i=Math.round(e.end(n));if(i===t.start||r===t.end||t.start>=r&&t.end<=i)return!0}return!1}(t,r)&&a.trigger(eo.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:e,from:n.end(n.length-2),to:n.start(n.length-1),unintended:!0})}(e,n,r,t),h.length>0?_.call(this):(f=!1,g&&g({chunk:t}))};try{0===t.bytes.length?r.call(this):(n=p(),l.appendBuffer?l.appendBuffer(t.bytes):l.append(t.bytes,t),A(r.bind(this)))}catch(e){u.fatal('SourceBuffer append failed "'+e+'"'),h.length>0?_():f=!1,g&&g({chunk:t,error:new $a.default(e.code,e.message)})}}}function E(){if(c.length>0){var e=c.shift();l.updating?A(e):(e(),E())}}function y(){l.updating||E()}function v(){l.updating||E()}function T(){u.error("SourceBufferSink error")}function A(e){c.push(e),l.updating||E()}return o={getType:function(){return s},getAllBufferRanges:p,getBuffer:function(){return l},append:function(e){e?(h.push(e),f||A(_.bind(this))):g({chunk:e,error:new $a.default(ro.default.APPEND_ERROR_CODE,ro.default.APPEND_ERROR_MESSAGE)})},remove:function(t,n,r){var i=this;A((function(){try{t>=0&&n>t&&(r||"ended"!==e.readyState)&&l.remove(t,n),A((function(){a.trigger(eo.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:i,from:t,to:n,unintended:!1})}))}catch(e){a.trigger(eo.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:i,from:t,to:n,unintended:!1,error:new $a.default(e.code,e.message)})}}))},abort:function(){try{("open"===e.readyState||l.setTextTrack&&"ended"===e.readyState)&&l.abort()}catch(e){u.error('SourceBuffer append abort failed: "'+e+'"')}h=[]},reset:function(t){if(l){if("function"==typeof l.removeEventListener&&(l.removeEventListener("updateend",v,!1),l.removeEventListener("error",T,!1),l.removeEventListener("abort",T,!1)),clearInterval(d),c=[],!t){try{l.getClassName&&"TextSourceBuffer"===l.getClassName()||(u.debug("Removing sourcebuffer from media source"),e.removeSourceBuffer(l))}catch(e){u.error("Failed to remove source buffer from media source.")}l=null}f=!1}h=[],g=null},updateTimestampOffset:function(e){l.timestampOffset===e||isNaN(e)||A((function(){e<0&&(e+=.001),l.timestampOffset=e}))},hasDiscontinuitiesAfter:function(e){try{var t=p();if(t&&t.length>1)for(var n=0,r=t.length;n<r;n++)if(n>0&&e<t.start(n)&&t.start(n)>t.end(n-1)+.1)return!0}catch(e){u.error("hasDiscontinuities exception: "+e.message)}return!1},waitForUpdateEnd:A,updateAppendWindow:m},function(){u=(0,Za.default)(i).getInstance().getLogger(o),f=!1,s=t.type;var n=t.codec;try{if(n.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))throw new Error("not really supported");(l=r||e.addSourceBuffer(n)).changeType&&r&&(u.debug("Doing period transition with changeType"),l.changeType(n)),m();if("function"==typeof l.addEventListener)try{l.addEventListener("updateend",v,!1),l.addEventListener("error",T,!1),l.addEventListener("abort",T,!1)}catch(e){d=setInterval(y,50)}else d=setInterval(y,50)}catch(e){if(!t.isText&&-1===n.indexOf('codecs="stpp')&&-1===n.indexOf('codecs="wvtt'))throw e;var a=(0,no.default)(i).getInstance();l=a.getTextSourceBuffer()}}(),o}ao.__dashjs_factory_name="SourceBufferSink";var oo=to.default.getClassFactory(ao),so=Object.defineProperty({default:oo},"__esModule",{value:!0}),uo=fo(Z),lo=fo(v);function fo(e){return e&&e.__esModule?e:{default:e}}function co(e){var t=this.context,n=void 0,r=void 0,i=void 0,a=[],o=e;function s(e,t){a=a.filter((function(n){return!((isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e))}))}return n={getAllBufferRanges:function(){for(var e=[],t=0;t<a.length;t++){var n=a[t];0===e.length||n.start>e[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){"InitializationSegment"!==e.segmentType?(a.push(e),a.sort((function(e,t){return e.start-t.start})),i=null):i=e,r.debug("PreBufferSink appended chunk s: "+e.start+"; e: "+e.end),o&&o({chunk:e})},remove:s,abort:function(){},discharge:function(e,t){var n=function(e,t){return a.filter((function(n){return(isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e)}))}(e,t);return i&&(n.push(i),i=null),s(e,t),n},reset:function(){a=[],i=null,o=null},updateTimestampOffset:function(){},hasDiscontinuitiesAfter:function(){return!1},waitForUpdateEnd:function(e){e()},getBuffer:function(){return this}},r=(0,uo.default)(t).getInstance().getLogger(n),n}co.__dashjs_factory_name="PreBufferSink";var ho=lo.default.getClassFactory(co),go=Object.defineProperty({default:ho},"__esModule",{value:!0}),po=function(e){return e&&e.__esModule?e:{default:e}}(v);var mo={DEFAULT:.5,STRONG:1,WEAK:0};function _o(e,t,n){return{quality:void 0===e?-1:e,reason:void 0===t?null:t,priority:function(e){var t=mo.DEFAULT;return e!==mo.DEFAULT&&e!==mo.STRONG&&e!==mo.WEAK||(t=e),t}(n)}}_o.__dashjs_factory_name="SwitchRequest";var Eo=po.default.getClassFactory(_o);Eo.NO_CHANGE=-1,Eo.PRIORITY=mo,po.default.updateClassFactory(_o.__dashjs_factory_name,Eo);var yo=Eo,vo=Object.defineProperty({default:yo},"__esModule",{value:!0}),To=Ro(v),Ao=Ro(Z),So=Ro(vo),bo=Ro(c),Io=Ro(E);function Ro(e){return e&&e.__esModule?e:{default:e}}function wo(e){e=e||{};var t=this.context,n=e.dashMetrics,r=void 0,i=void 0;return r={getMaxIndex:function(e){var r=(0,So.default)(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(bo.default.MISSING_CONFIG_ERROR)}();var a=e.getMediaInfo(),o=e.getMediaType(),s=n.getCurrentBufferState(o),u=e.getScheduleController(),l=e.getAbrController(),f=e.getStreamInfo(),d=f&&f.manifestInfo?f.manifestInfo.isDynamic:null,c=l.getThroughputHistory(),h=c.getSafeAverageThroughput(o,d),g=c.getAverageLatency(o),p=e.useBufferOccupancyABR();return isNaN(h)||!s||p||l.getAbandonmentStateFor(o)!==Io.default.ABANDON_LOAD&&(s.state===Io.default.BUFFER_LOADED||d)&&(r.quality=l.getQualityForBitrate(a,h,g),u.setTimeToLoadDelay(0),i.debug("["+o+"] requesting switch to index: ",r.quality,"Average throughput",Math.round(h),"kbps"),r.reason={throughput:h,latency:g}),r},reset:function(){}},i=(0,Ao.default)(t).getInstance().getLogger(r),r}wo.__dashjs_factory_name="ThroughputRule";var No=To.default.getClassFactory(wo),Mo=Object.defineProperty({default:No},"__esModule",{value:!0}),Co=Uo(P),Do=Uo(B),Oo=Uo(v),Po=Uo(Z),Lo=Uo(vo),Fo=Uo(c),xo=Uo(E);function Uo(e){return e&&e.__esModule?e:{default:e}}function Bo(e){e=e||{};var t=this.context,n=(0,Co.default)(t).getInstance(),r=e.dashMetrics,i=void 0,a=void 0,o=void 0;function s(){(o={})[Fo.default.VIDEO]={ignoreCount:2},o[Fo.default.AUDIO]={ignoreCount:2}}function u(){s()}function l(e){isNaN(e.startTime)||e.mediaType!==Fo.default.AUDIO&&e.mediaType!==Fo.default.VIDEO||o[e.mediaType].ignoreCount>0&&o[e.mediaType].ignoreCount--}return i={getMaxIndex:function(e){var n=(0,Lo.default)(t).create();if(!e||!e.hasOwnProperty("getMediaType"))return n;!function(){if(!r||!r.hasOwnProperty("getCurrentBufferLevel")||!r.hasOwnProperty("getCurrentBufferState"))throw new Error(Fo.default.MISSING_CONFIG_ERROR)}();var i=e.getMediaType(),s=r.getCurrentBufferState(i),u=e.getRepresentationInfo().fragmentDuration;if(function(e){return o[e].ignoreCount>0}(i)||!u)return n;if(s&&s.state===xo.default.BUFFER_EMPTY)a.debug("["+i+"] Switch to index 0; buffer is empty."),n.quality=0,n.reason="InsufficientBufferRule: Buffer is empty";else{var l=e.getMediaInfo(),f=e.getAbrController(),d=f.getThroughputHistory(),c=r.getCurrentBufferLevel(i),h=d.getAverageThroughput(i),g=d.getAverageLatency(i),p=h*(c/u)*.5;n.quality=f.getQualityForBitrate(l,p,g),n.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return n},reset:function(){s(),n.off(Do.default.PLAYBACK_SEEKING,u,i),n.off(Do.default.BYTES_APPENDED_END_FRAGMENT,l,i)}},a=(0,Po.default)(t).getInstance().getLogger(i),s(),n.on(Do.default.PLAYBACK_SEEKING,u,i),n.on(Do.default.BYTES_APPENDED_END_FRAGMENT,l,i),i}Bo.__dashjs_factory_name="InsufficientBufferRule";var ko=Oo.default.getClassFactory(Bo),Go=Object.defineProperty({default:ko},"__esModule",{value:!0}),jo=Ho(vo),Yo=Ho(v),qo=Ho(Z);function Ho(e){return e&&e.__esModule?e:{default:e}}function Ko(e){e=e||{};var t=this.context,n=e.mediaPlayerModel,r=e.dashMetrics,i=e.settings,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0;function f(){s={},u={},l=[]}return a={shouldAbandon:function(e){var a=(0,jo.default)(t).create(jo.default.NO_CHANGE,{name:Ko.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return a;var f,d,c=e.getMediaInfo(),h=e.getMediaType(),g=e.getCurrentRequest();if(!isNaN(g.index)){f=h,d=g.index,s[f]=s[f]||{},s[f][d]=s[f][d]||{};var p=n.getStableBufferTime();if(r.getCurrentBufferLevel(h)>p)return a;var m=s[h][g.index];if(null===m||null===g.firstByteDate||u.hasOwnProperty(m.id))return a;if(void 0===m.firstByteTime&&(l[h]=[],m.firstByteTime=g.firstByteDate.getTime(),m.segmentDuration=g.duration,m.bytesTotal=g.bytesTotal,m.id=g.index),m.bytesLoaded=g.bytesLoaded,m.elapsedTime=(new Date).getTime()-m.firstByteTime,m.bytesLoaded>0&&m.elapsedTime>0&&function(e,t){l[e]=l[e]||[],l[e].push(t)}(h,Math.round(8*m.bytesLoaded/m.elapsedTime)),l[h].length>=5&&m.elapsedTime>500&&m.bytesLoaded<m.bytesTotal){var _=l[h].reduce((function(e,t){return e+t}),0);if(m.measuredBandwidthInKbps=Math.round(_/l[h].length),m.estimatedTimeOfDownload=+(8*m.bytesTotal/m.measuredBandwidthInKbps/1e3).toFixed(2),m.estimatedTimeOfDownload<1.8*m.segmentDuration||0===e.getRepresentationInfo().quality)return a;if(!u.hasOwnProperty(m.id)){var E=e.getAbrController(),y=m.bytesTotal-m.bytesLoaded,v=E.getBitrateList(c),T=E.getQualityForBitrate(c,m.measuredBandwidthInKbps*i.get().streaming.abr.bandwidthSafetyFactor),A=E.getMinAllowedIndexFor(h),S=void 0!==A?Math.max(A,T):T;y>m.bytesTotal*v[S].bitrate/v[E.getQualityFor(h)].bitrate&&(a.quality=S,a.reason.throughput=m.measuredBandwidthInKbps,a.reason.fragmentID=m.id,u[m.id]=m,o.debug("["+h+"] frag id",m.id," is asking to abandon and switch to quality to ",S," measured bandwidth was",m.measuredBandwidthInKbps),delete s[h][m.id])}}else m.bytesLoaded===m.bytesTotal&&delete s[h][m.id]}return a},reset:f},o=(0,qo.default)(t).getInstance().getLogger(a),f(),a}Ko.__dashjs_factory_name="AbandonRequestsRule";var Vo=Yo.default.getClassFactory(Ko),zo=Object.defineProperty({default:Vo},"__esModule",{value:!0}),Wo=Zo(v),Xo=Zo(vo),Qo=Zo(Z);function Zo(e){return e&&e.__esModule?e:{default:e}}function $o(){var e=this.context,t=void 0,n=void 0;return t={getMaxIndex:function(t){var r=(0,Xo.default)(e).create();if(!t||!t.hasOwnProperty("getDroppedFramesHistory"))return r;var i=t.getDroppedFramesHistory();if(i){for(var a=i.getFrameHistory(),o=0,s=0,u=Xo.default.NO_CHANGE,l=1;l<a.length;l++)if(a[l]&&(o=a[l].droppedVideoFrames,(s=a[l].totalVideoFrames)>375&&o/s>.15)){u=l-1,n.debug("index: "+u+" Dropped Frames: "+o+" Total Frames: "+s);break}return(0,Xo.default)(e).create(u,{droppedFrames:o})}return r}},n=(0,Qo.default)(e).getInstance().getLogger(t),t}$o.__dashjs_factory_name="DroppedFramesRule";var Jo=Wo.default.getClassFactory($o),es=Object.defineProperty({default:Jo},"__esModule",{value:!0}),ts=is(v),ns=is(Z),rs=is(vo);function is(e){return e&&e.__esModule?e:{default:e}}function as(){var e=this.context,t=void 0,n=void 0;return t={getMaxIndex:function(t){for(var r=t?t.getSwitchHistory():null,i=r?r.getSwitchRequests():[],a=0,o=0,s=0,u=(0,rs.default)(e).create(),l=0;l<i.length;l++)if(void 0!==i[l]&&(a+=i[l].drops,o+=i[l].noDrops,s+=i[l].dropSize,a+o>=6&&a/o>.075)){u.quality=l>0&&i[l].drops>0?l-1:l,u.reason={index:u.quality,drops:a,noDrops:o,dropSize:s},n.debug("Switch history rule index: "+u.quality+" samples: "+(a+o)+" drops: "+a);break}return u}},n=(0,ns.default)(e).getInstance().getLogger(t),t}as.__dashjs_factory_name="SwitchHistoryRule";var os=ts.default.getClassFactory(as),ss=Object.defineProperty({default:os},"__esModule",{value:!0}),us=gs(E),ls=gs(vo),fs=gs(v),ds=gs(P),cs=gs(B),hs=gs(Z);function gs(e){return e&&e.__esModule?e:{default:e}}function ps(e){e=e||{};var t=this.context,n=e.dashMetrics,r=e.mediaPlayerModel,i=(0,ds.default)(t).getInstance(),a=void 0,o=void 0,s=void 0;function u(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,10+2*t.length),a=(n[r]-1)/(i/10-1);return{gp:a,Vp:10/a}}function l(e){var t={},n=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),i=function(e){return e.map((function(e){return Math.log(e)}))}(n);i=i.map((function(e){return e-i[0]+1}));var a=r.getStableBufferTime(),o=u(a,n,i);return o?(t.state=1,t.bitrates=n,t.utilities=i,t.stableBufferTime=a,t.Vp=o.Vp,t.gp=o.gp,t.lastQuality=0,f(t)):t.state=0,t}function f(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function d(e,t){var i=r.getStableBufferTime();if(e.stableBufferTime!==i){var a=u(i,e.bitrates,e.utilities);if(a.Vp!==e.Vp||a.gp!==e.gp){var o=n.getCurrentBufferLevel(t),s=o+e.placeholderBuffer;s-=10,s*=a.Vp/e.Vp,s+=10,e.stableBufferTime=i,e.Vp=a.Vp,e.gp=a.gp,e.placeholderBuffer=Math.max(0,s-o)}}}function c(e,t){return e.Vp*(e.utilities[t]+e.gp)}function h(e,t){for(var n=e.bitrates[t],r=e.utilities[t],i=0,a=t-1;a>=0;--a)if(e.utilities[a]<e.utilities[t]){var o=e.bitrates[a],s=e.utilities[a],u=e.Vp*(e.gp+(n*s-o*r)/(n-o));i=Math.max(i,u)}return i}function g(){for(var e in s)s.hasOwnProperty(e)&&2===s[e].state&&(s[e].placeholderBuffer=0)}function p(){for(var e in s)if(s.hasOwnProperty(e)){var t=s[e];0!==t.state&&(t.state=1,f(t))}}function m(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=s[e.chunk.mediaInfo.type];if(t&&0!==t.state){var n=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||n>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,E(t,e.chunk.mediaInfo.type)}}}function _(e){if(e&&e.metric===us.default.HTTP_REQUEST&&e.value&&e.value.type===ce.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=s[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),E(t,e.mediaType))}}function E(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var r=n.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),i=c(e,e.lastQuality),a=Math.max(0,i-r);e.placeholderBuffer=Math.min(a,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function y(e){if(e){var t=s[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function v(e){if(e){var t=s[e.mediaType];if(t&&0!==t.state){var r=n.getCurrentBufferLevel(e.mediaType),i=void 0;i=t.abrQuality>0?h(t,t.abrQuality):10;var a=Math.max(0,i-r);t.placeholderBuffer=Math.min(t.placeholderBuffer,a)}}}function T(){s={}}return a={getMaxIndex:function(e){var r=(0,ls.default)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return r;var i=e.getMediaInfo(),a=e.getMediaType(),u=e.getScheduleController(),g=e.getStreamInfo(),p=e.getAbrController(),m=p.getThroughputHistory(),_=g?g.id:null,E=g&&g.manifestInfo&&g.manifestInfo.isDynamic,y=e.useBufferOccupancyABR();if(r.reason=r.reason||{},!y)return r;u.setTimeToLoadDelay(0);var v=function(e){var t=e.getMediaType(),n=s[t];return n?0!==n.state&&d(n,t):(n=l(e),s[t]=n),n}(e);if(0===v.state)return r;var T=n.getCurrentBufferLevel(a),A=m.getAverageThroughput(a,E),S=m.getSafeAverageThroughput(a,E),b=m.getAverageLatency(a),I=void 0;if(r.reason.state=v.state,r.reason.throughput=A,r.reason.latency=b,isNaN(A))return r;switch(v.state){case 1:I=p.getQualityForBitrate(i,S,b),r.quality=I,r.reason.throughput=S,v.placeholderBuffer=Math.max(0,h(v,I)-T),v.lastQuality=I,!isNaN(v.lastSegmentDurationS)&&T>=v.lastSegmentDurationS&&(v.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,d(e,t)}(v,a),I=function(e,t){for(var n=e.bitrates.length,r=NaN,i=NaN,a=0;a<n;++a){var o=(e.Vp*(e.utilities[a]+e.gp)-t)/e.bitrates[a];(isNaN(i)||o>=i)&&(i=o,r=a)}return r}(v,T+v.placeholderBuffer);var R=p.getQualityForBitrate(i,S,b);I>v.lastQuality&&I>R&&(I=Math.max(R,v.lastQuality));var w=Math.max(0,T+v.placeholderBuffer-c(v,I));w<=v.placeholderBuffer?(v.placeholderBuffer-=w,w=0):(w-=v.placeholderBuffer,v.placeholderBuffer=0,I<p.getTopQualityIndexFor(a,_)?u.setTimeToLoadDelay(1e3*w):w=0),r.quality=I,r.reason.throughput=A,r.reason.latency=b,r.reason.bufferLevel=T,r.reason.placeholderBuffer=v.placeholderBuffer,r.reason.delay=w,v.lastQuality=I;break;default:o.debug("BOLA ABR rule invoked in bad state."),r.quality=p.getQualityForBitrate(i,S,b),r.reason.state=v.state,r.reason.throughput=S,r.reason.latency=b,v.state=1,f(v)}return r},reset:function(){T(),i.off(cs.default.BUFFER_EMPTY,g,a),i.off(cs.default.PLAYBACK_SEEKING,p,a),i.off(cs.default.MEDIA_FRAGMENT_LOADED,m,a),i.off(cs.default.METRIC_ADDED,_,a),i.off(cs.default.QUALITY_CHANGE_REQUESTED,y,a),i.off(cs.default.FRAGMENT_LOADING_ABANDONED,v,a)}},o=(0,hs.default)(t).getInstance().getLogger(a),T(),i.on(cs.default.BUFFER_EMPTY,g,a),i.on(cs.default.PLAYBACK_SEEKING,p,a),i.on(cs.default.MEDIA_FRAGMENT_LOADED,m,a),i.on(cs.default.METRIC_ADDED,_,a),i.on(cs.default.QUALITY_CHANGE_REQUESTED,y,a),i.on(cs.default.FRAGMENT_LOADING_ABANDONED,v,a),a}ps.__dashjs_factory_name="BolaRule";var ms=fs.default.getClassFactory(ps),_s=Object.defineProperty({default:ms},"__esModule",{value:!0}),Es=Is(E),ys=Is(vo),vs=Is(v),Ts=Is(P),As=Is(B),Ss=Is(Z),bs=Is(c);function Is(e){return e&&e.__esModule?e:{default:e}}function Rs(e){e=e||{};var t=this.context,n=e.dashMetrics,r=(0,Ts.default)(t).getInstance(),i=void 0,a=void 0,o=void 0,s=void 0;function u(e){var t={},n=e.getMediaInfo(),r=n.bitrateList.map((function(e){return e.bandwidth/1e3}));return t.state=1,t.bitrates=r,t.lastQuality=0,function(e){if(!e||!e.type)return;o[e.type]={},o[e.type].w=[],o[e.type].prev_w=[],o[e.type].Q=0,o[e.type].segment_request_start_s=0,o[e.type].segment_download_finish_s=0,o[e.type].B_target=1.5}(n),l(t),t}function l(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function f(){for(var e in a)if(a.hasOwnProperty(e)){var t=a[e];0!==t.state&&(t.state=1,l(t))}}function d(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=a[e.chunk.mediaInfo.type],n=o[e.chunk.mediaInfo.type];if(t&&0!==t.state){var r=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||r>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=r,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=r,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,h(t,n)}}}function c(e){if(e&&e.metric===Es.default.HTTP_REQUEST&&e.value&&e.value.type===ce.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=a[e.mediaType],n=o[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),h(t,n))}}function h(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 g(e){if(e&&e.mediaType){var t=a[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function p(e,t){if(e.length!==t.length)return-1;for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n}function m(){a={},o={}}return i={getMaxIndex:function(e){var r=(0,ys.default)(t).create(),i=Math.pow(4,.99),f=Math.max(Math.pow(4,1),i*Math.sqrt(4)),d=e.getMediaInfo(),c=e.getMediaType(),h=d.bitrateList.map((function(e){return e.bandwidth})),g=h.length,m=e.getScheduleController(),_=e.getStreamInfo(),E=e.getAbrController(),y=E.getThroughputHistory(),v=_&&_.manifestInfo&&_.manifestInfo.isDynamic,T=e.useL2AABR(),A=n.getCurrentBufferLevel(c,!0),S=y.getSafeAverageThroughput(c,v),b=y.getAverageThroughput(c,v),I=y.getAverageLatency(c),R=void 0,w=e.getVideoModel().getPlaybackRate();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useL2AABR")))return r;if(r.reason=r.reason||{},!T||c===bs.default.AUDIO)return r;m.setTimeToLoadDelay(0);var N=function(e){var t=e.getMediaType(),n=a[t];return n||(n=u(e),a[t]=n),n}(e);if(0===N.state)return r;var M=o[c];if(!M)return r;if(r.reason.state=N.state,r.reason.throughput=b,r.reason.latency=I,isNaN(b))return r;switch(N.state){case 1:if(R=E.getQualityForBitrate(d,S,I),r.quality=R,r.reason.throughput=S,N.lastQuality=R,!isNaN(N.lastSegmentDurationS)&&A>=M.B_target){N.state=2,M.Q=i;for(var C=0;C<g;++C)C===N.lastQuality?M.prev_w[C]=1:M.prev_w[C]=0}break;case 2:var D=[],O=n.getCurrentHttpRequest(c).trace.reduce((function(e,t){return e+t.d}),0),P=n.getCurrentHttpRequest(c).trace.reduce((function(e,t){return e+t.b[0]}),0),L=Math.round(8*P/O);L<1&&(L=1);for(var F=N.lastSegmentDurationS,x=1,U=0;U<g;++U)h[U]=h[U]/1e3,w*h[U]>L&&(x=-1),M.w[U]=M.prev_w[U]+x*(F/(2*f))*((M.Q+i)*(w*h[U]/L));M.w=function(e){for(var t=e.length,n=!1,r=[],i=0;i<t;++i)r[i]=e[i];for(var a=e.sort((function(e,t){return t-e})),o=0,s=0,u=[],l=0;l<t-1;++l)if((s=((o+=a[l])-1)/(l+1))>=a[l+1]){n=!0;break}n||(s=(o+a[t-1]-1)/t);for(var f=0;f<t;++f)u[f]=Math.max(r[f]-s,0);return u}(M.w);for(var B=0;B<g;++B)D[B]=M.w[B]-M.prev_w[B],M.prev_w[B]=M.w[B];M.Q=Math.max(0,M.Q-F+F*w*((p(h,M.prev_w)+p(h,D))/L));for(var k=[],G=0;G<g;++G)k[G]=Math.abs(h[G]-p(M.w,h));(R=k.indexOf(Math.min.apply(Math,k)))>N.lastQuality&&h[N.lastQuality+1]<=L&&(R=N.lastQuality+1),h[R]>=L&&(M.Q=2*Math.max(i,M.Q)),r.quality=R,r.reason.throughput=b,r.reason.latency=I,r.reason.bufferLevel=A,N.lastQuality=r.quality;break;default:s.debug("L2A ABR rule invoked in bad state."),r.quality=E.getQualityForBitrate(d,S,I),r.reason.state=N.state,r.reason.throughput=S,r.reason.latency=I,N.state=1,l(N)}return r},reset:function(){m(),r.off(As.default.PLAYBACK_SEEKING,f,i),r.off(As.default.MEDIA_FRAGMENT_LOADED,d,i),r.off(As.default.METRIC_ADDED,c,i),r.off(As.default.QUALITY_CHANGE_REQUESTED,g,i)}},s=(0,Ss.default)(t).getInstance().getLogger(i),m(),r.on(As.default.PLAYBACK_SEEKING,f,i),r.on(As.default.MEDIA_FRAGMENT_LOADED,d,i),r.on(As.default.METRIC_ADDED,c,i),r.on(As.default.QUALITY_CHANGE_REQUESTED,g,i),i}Rs.__dashjs_factory_name="L2ARule";var ws=vs.default.getClassFactory(Rs),Ns=Object.defineProperty({default:ws},"__esModule",{value:!0}),Ms=Ds(v),Cs=Ds(Z);function Ds(e){return e&&e.__esModule?e:{default:e}}var Os="manual_weight_selection",Ps="random_weight_selection",Ls="dynamic_weight_selection";function Fs(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0;function f(){r=null,i=1,a=100,o=0,s=null,u=null,l=Ls}function d(){var e=0;if(r)for(var t=0;t<r.length;t++){var n=r[t];n.state.throughput>e&&(e=n.state.throughput)}return e}function c(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 c([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 g(e,t,n){for(var r=0;r<t.length;r++){var i=t[r],a=h(i,e);p(i,n,Math.exp(-1*Math.pow(a,2)/(2*Math.pow(.1,2))))}}function p(e,t,n){var r=e.state,i=[.01,.01,.01,.01];r.throughput=r.throughput+(t[0]-r.throughput)*i[0]*n,r.latency=r.latency+(t[1]-r.latency)*i[1]*n,r.rebuffer=r.rebuffer+(t[2]-r.rebuffer)*i[2]*n,r.switch=r.switch+(t[3]-r.switch)*i[3]*n}function m(e,t,n,r,i,a,o){s||(s=u[u.length-1]);var l=e.findWeightVector(t,n,r,i,a,o);null!==l&&-1!==l&&(s=l)}return t={getNextQuality:function(e,t,f,h,p,_,E){var y=f,v=h,T=t,A=function(e){if(!r){r=[];var t=e.bitrateList,n=[];o=t[0].bandwidth,t.forEach((function(e){n.push(e.bandwidth),e.bandwidth<o&&(o=e.bandwidth)})),l=n.map((function(e){return Math.pow(e,2)})).reduce((function(e,t){return e+t})),i=Math.sqrt(l);for(var a=0;a<t.length;a++){var s={qualityIndex:a,bitrate:t[a].bandwidth,state:{throughput:t[a].bandwidth/i,latency:0,rebuffer:0,switch:0}};r.push(s)}u=function(e){var t=[],n=function(e){for(var t=[],n=0;n<e;n++){var r=[Math.random()*d(),Math.random(),Math.random(),Math.random()];t.push(r)}return t}(Math.pow(e.length,2));t.push(n[0]);for(var r=[1,1,1,1],i=1;i<e.length;i++){for(var a=null,o=null,s=0;s<n.length;s++){for(var u=n[s],l=null,f=0;f<t.length;f++){var h=c(u,t[f],r);(null===l||h<l)&&(l=h)}(null===o||l>o)&&(a=u,o=l)}t.push(a)}for(var g=null,p=null,m=0;m<t.length;m++){for(var _=0,E=0;E<t.length;E++)m!==E&&(_+=c(t[m],t[E],r));(null===g||_>g)&&(g=_,p=m)}var y=[];y.push(t[p]),t.splice(p,1);for(;t.length>0;){for(var v=null,T=null,A=0;A<t.length;A++){var S=c(y[0],t[A],r);(null===v||S<v)&&(v=S,T=A)}y.push(t[T]),t.splice(T,1)}return y}(r)}var l;return r}(e),S=t/i;S>1&&(S=d()),f/=a,n.debug("getNextQuality called throughput:"+S+" latency:"+f+" bufferSize:"+h+" currentQualityIndex:"+_+" playbackRate:"+p);var b=A[_],I=b.bitrate*E.getSegmentDuration()/T,R=Math.max(0,I-v);if(v-I<E.getMinBuffer())return n.debug("Buffer is low for bitrate= "+b.bitrate+" downloadTime="+I+" currentBuffer="+v+" rebuffer="+R),function(e,t){var n=0,i=e;if(r)for(var a=0;a<r.length;a++){var o=r[a];o.bitrate<e.bitrate&&o.bitrate>n&&t>o.bitrate&&(n=o.bitrate,i=o)}return i}(b,T).qualityIndex;switch(l){case Os:s=[.4,.4,.4,.4];break;case Ps:!function(e){s=function(e,t){for(var n=[],r=Math.sqrt(2/e),i=0;i<t;i++)n.push(Math.random()*r);return s=n}(e.length,4)}(A);break;case Ls:m(E,A,y,v,R,T,p);break;default:m(E,A,y,v,R,T,p)}for(var w=null,N=null,M=null,C=0;C<A.length;C++){var D=A[C],O=D.state,P=[O.throughput,O.latency,O.rebuffer,O.switch],L=s.slice(),F=E.getNextBufferWithBitrate(D.bitrate,v,T),x=F<E.getMinBuffer();x&&n.debug("Buffer is low for bitrate="+D.bitrate+" downloadTime="+I+" currentBuffer="+v+" nextBuffer="+F),(D.bitrate>t-1e4||x)&&D.bitrate!==o&&(L[0]=100);var U=c(P,[S,0,0,0],L);(null===w||U<w)&&(w=U,N=D.qualityIndex,M=D)}var B=Math.abs(b.bitrate-M.bitrate)/i;return g(b,A,[S,f,R,B]),g(M,A,[S,0,0,B]),N},reset:function(){f()}},n=(0,Cs.default)(e).getInstance().getLogger(t),f(),t}Fs.__dashjs_factory_name="LearningAbrController";var xs=Ms.default.getClassFactory(Fs),Us=Object.defineProperty({default:xs},"__esModule",{value:!0});var Bs=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},ks=Object.defineProperty({default:Bs},"__esModule",{value:!0}),Gs=Ys(v),js=Ys(ks);function Ys(e){return e&&e.__esModule?e:{default:e}}function qs(){var e,t=void 0,n=void 0,r=void 0,i=void 0;function a(){t=null,n=null,r=null,i=null}function o(e,t,n,r){var i=new js.default;return i.type=e,i.weights.bitrateReward=t||1,i.weights.bitrateSwitchPenalty=1,i.weights.rebufferPenalty=n||1e3,i.weights.latencyPenalty=[],i.weights.latencyPenalty.push({threshold:1.1,penalty:.05*r}),i.weights.latencyPenalty.push({threshold:1e8,penalty:.1*n}),i.weights.playbackSpeedPenalty=r||200,i}function s(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<i.weights.latencyPenalty.length;a++){var o=i.weights.latencyPenalty[a];if(n<=o.threshold){i.latencyWSum+=o.penalty*n;break}}i.playbackSpeedWSum+=i.weights.playbackSpeedPenalty*Math.abs(1-r),i.totalQoe=i.bitrateWSum-i.bitrateSwitchWSum-i.rebufferWSum-i.latencyWSum-i.playbackSpeedWSum}return e={setupPerSegmentQoe:function(e,a,s){t=o("segment",e,a,s),n=e,r=a,i=s},logSegmentMetrics:function(e,n,r,i){t&&s(e,n,r,i,t)},getPerSegmentQoe:function(){return t},calculateSingleUseQoe:function(e,t,a,u){var l=null;return n&&r&&i&&(l=o("segment",n,r,i)),l?(s(e,t,a,u,l),l.totalQoe):0},reset:function(){a()}},a(),e}qs.__dashjs_factory_name="LoLpQoeEvaluator";var Hs=Gs.default.getClassFactory(qs),Ks=Object.defineProperty({default:Hs},"__esModule",{value:!0}),Vs=function(e){return e&&e.__esModule?e:{default:e}}(v);function zs(e){var t,n,r,i=e.targetLatency,a=e.bufferMin,o=e.segmentDuration,s=e.qoeEvaluator,u=void 0,l=void 0;function f(){return o}function d(e,t){var n=f();return t>n?e-n:e+n-t}return t={getMinBuffer:function(){return a},getSegmentDuration:f,getNextBufferWithBitrate:function(e,t,n){return d(t,e*o/n)},getNextBuffer:d,findWeightVector:function(e,t,n,r,f,c){var h=null,g=null,p=null,m=Math.abs(t-l);return e.forEach((function(e){u.forEach((function(r){r[0];var u=r[1],l=r[2],_=(r[3],e.bitrate*o/f),E=d(n,_),y=(0===l?10:1/l)*Math.max(1e-5,_-E),v=(0===u?10:1/u)*e.state.latency,T=s.calculateSingleUseQoe(e.bitrate,y,v,c);(null===h||T>h)&&function(e,t,n){if(e>i+n)return!1;return t>=a}(t,E,m)&&(h=T,g=r,p=e.bitrate)}))})),null===g&&null===p&&(g=-1),l=t,g}},n=[.2,.4,.6,.8,1],r=4,u=function e(t,r,i){if(i===r)return t;for(var a=t.length,o=0;o<a;o++)for(var s=t.shift(),u=0;u<n.length;u++)t.push(s.concat(n[u]));return e(t,r,i+1)}(n.map((function(e){return[e]})),r,1),l=0,t}zs.__dashjs_factory_name="LoLpWeightSelector";var Ws=Vs.default.getClassFactory(zs),Xs=Object.defineProperty({default:Ws},"__esModule",{value:!0}),Qs=iu(Z),Zs=iu(v),$s=iu(Us),Js=iu(Ks),eu=iu(vo),tu=iu(E),nu=iu(Xs),ru=iu(c);function iu(e){return e&&e.__esModule?e:{default:e}}function au(e){var t=(e=e||{}).dashMetrics,n=this.context,r=void 0,i=void 0,a=void 0,o=void 0;return i={getMaxIndex:function(e){try{var i=(0,eu.default)(n).create(),s=e.getMediaInfo().type,u=e.getAbrController(),l=e.getStreamInfo(),f=u.getQualityFor(s,l),d=e.getMediaInfo(),c=t.getCurrentBufferState(s),h=e.getScheduleController(),g=t.getCurrentBufferLevel(s,!0),p=l&&l.manifestInfo?l.manifestInfo.isDynamic:null,m=h.getPlaybackController(),_=m.getCurrentLiveLatency();if(!e.useLoLPABR()||s===ru.default.AUDIO)return i;_||(_=0);var E=m.getPlaybackRate(),y=u.getThroughputHistory().getSafeAverageThroughput(s,p);if(r.debug("Throughput "+Math.round(y)+" kbps"),isNaN(y)||!c)return i;if(u.getAbandonmentStateFor(s)===tu.default.ABANDON_LOAD)return i;for(var v=d.bitrateList,T=e.getRepresentationInfo().fragmentDuration,A=v[0].bandwidth/1e3,S=v[v.length-1].bandwidth/1e3,b=0;b<v.length;b++){var I=v[b].bandwidth/1e3;I>S?S=I:I<A&&(A=I)}var R=v[f].bandwidth/1e3,w=t.getCurrentHttpRequest(s,!0),N=(w.tresponse.getTime()-w.trequest.getTime())/1e3,M=N>T?N-T:0;o.setupPerSegmentQoe(T,S,A),o.logSegmentMetrics(R,M,_,E);var C=(0,nu.default)(n).create({targetLatency:1.5,bufferMin:.3,segmentDuration:T,qoeEvaluator:o});return i.quality=a.getNextQuality(d,1e3*y,_,g,E,f,C),i.reason={throughput:y,latency:_},i.priority=eu.default.PRIORITY.STRONG,h.setTimeToLoadDelay(0),i.quality!==f&&console.log("[TgcLearningRule]["+s+"] requesting switch to index: ",i.quality,"Average throughput",Math.round(y),"kbps"),i}catch(e){throw e}},reset:function(){a.reset(),o.reset()}},r=(0,Qs.default)(n).getInstance().getLogger(i),a=(0,$s.default)(n).create(),o=(0,Js.default)(n).create(),i}au.__dashjs_factory_name="LoLPRule";var ou=Zs.default.getClassFactory(au),su=Object.defineProperty({default:ou},"__esModule",{value:!0}),uu=yu(Mo),lu=yu(Go),fu=yu(zo),du=yu(es),cu=yu(ss),hu=yu(_s),gu=yu(Ns),pu=yu(su),mu=yu(v),_u=yu(vo),Eu=yu(c);function yu(e){return e&&e.__esModule?e:{default:e}}function vu(e){e=e||{};var t=this.context,n=e.mediaPlayerModel,r=e.dashMetrics,i=e.settings,a=void 0,o=void 0;function s(e){return e.filter((function(e){return e.quality>_u.default.NO_CHANGE}))}function u(e){var n,r={},i=null,a=void 0,o=void 0,s=void 0,u=void 0;if(0!==e.length){for(r[_u.default.PRIORITY.STRONG]={quality:_u.default.NO_CHANGE,reason:null},r[_u.default.PRIORITY.WEAK]={quality:_u.default.NO_CHANGE,reason:null},r[_u.default.PRIORITY.DEFAULT]={quality:_u.default.NO_CHANGE,reason:null},a=0,n=e.length;a<n;a+=1)(o=e[a]).quality!==_u.default.NO_CHANGE&&(r[o.priority].quality===_u.default.NO_CHANGE||r[o.priority].quality>o.quality)&&(r[o.priority].quality=o.quality,r[o.priority].reason=o.reason||null);return r[_u.default.PRIORITY.WEAK].quality!==_u.default.NO_CHANGE&&(i=r[_u.default.PRIORITY.WEAK]),r[_u.default.PRIORITY.DEFAULT].quality!==_u.default.NO_CHANGE&&(i=r[_u.default.PRIORITY.DEFAULT]),r[_u.default.PRIORITY.STRONG].quality!==_u.default.NO_CHANGE&&(i=r[_u.default.PRIORITY.STRONG]),i&&(s=i.quality,u=i.reason),(0,_u.default)(t).create(s,u)}}return{initialize:function(){a=[],o=[],i.get().streaming.abr.useDefaultABRRules&&(i.get().streaming.abr.ABRStrategy===Eu.default.ABR_STRATEGY_L2A?a.push((0,gu.default)(t).create({dashMetrics:r,mediaPlayerModel:n,settings:i})):i.get().streaming.abr.ABRStrategy===Eu.default.ABR_STRATEGY_LoLP?a.push((0,pu.default)(t).create({dashMetrics:r})):(a.push((0,hu.default)(t).create({dashMetrics:r,mediaPlayerModel:n,settings:i})),a.push((0,uu.default)(t).create({dashMetrics:r})),a.push((0,lu.default)(t).create({dashMetrics:r})),a.push((0,cu.default)(t).create()),a.push((0,du.default)(t).create()),o.push((0,fu.default)(t).create({dashMetrics:r,mediaPlayerModel:n,settings:i})))),n.getABRCustomRules().forEach((function(e){"qualitySwitchRules"===e.type&&a.push(e.rule(t).create()),"abandonFragmentRules"===e.type&&o.push(e.rule(t).create())}))},reset:function(){[a,o].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),a=[],o=[]},getMaxQuality:function(e){return u(s(a.map((function(t){return t.getMaxIndex(e)}))))||(0,_u.default)(t).create()},getMinSwitchRequest:u,shouldAbandonFragment:function(e){return u(s(o.map((function(t){return t.shouldAbandon(e)}))))||(0,_u.default)(t).create()},getQualitySwitchRules:function(){return a}}}vu.__dashjs_factory_name="ABRRulesCollection";var Tu=mu.default.getClassFactory(vu);Tu.QUALITY_SWITCH_RULES="qualitySwitchRules",Tu.ABANDON_FRAGMENT_RULES="abandonFragmentRules",mu.default.updateSingletonFactory(vu.__dashjs_factory_name,Tu);var Au=Tu,Su=Object.defineProperty({default:Au},"__esModule",{value:!0});var bu=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},Iu=Object.defineProperty({default:bu},"__esModule",{value:!0}),Ru=function(e){return e&&e.__esModule?e:{default:e}}(v);function wu(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,f=e.videoModel?e.videoModel:null;function d(){return l?l.mediaInfo:null}return{getMediaType:function(){var e=d();return e?e.type:null},getMediaInfo:d,getDroppedFramesHistory:function(){return r},getCurrentRequest:function(){return i},getSwitchHistory:function(){return n},getStreamInfo:function(){var e=d();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 f}}}wu.__dashjs_factory_name="RulesContext";var Nu=Ru.default.getClassFactory(wu),Mu=Object.defineProperty({default:Nu},"__esModule",{value:!0}),Cu=Ou(v),Du=Ou(vo);function Ou(e){return e&&e.__esModule?e:{default:e}}function Pu(){var e=[],t=[];return{push:function(n){n.newValue===Du.default.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=[]}}}Pu.__dashjs_factory_name="SwitchRequestHistory";var Lu=Cu.default.getClassFactory(Pu),Fu=Object.defineProperty({default:Lu},"__esModule",{value:!0}),xu=function(e){return e&&e.__esModule?e:{default:e}}(v);function Uu(){var e=[],t=0,n=0;return{push:function(r,i){var a=i&&i.droppedVideoFrames?i.droppedVideoFrames:0,o=i&&i.totalVideoFrames?i.totalVideoFrames:0,s=a-t;t=a;var u=o-n;n=o,isNaN(r)||(e[r]?(e[r].droppedVideoFrames+=s,e[r].totalVideoFrames+=u):e[r]={droppedVideoFrames:s,totalVideoFrames:u})},getFrameHistory:function(){return e},reset:function(r){e=[],t=r.droppedVideoFrames,n=r.totalVideoFrames}}}Uu.__dashjs_factory_name="DroppedFramesHistory";var Bu=xu.default.getClassFactory(Uu),ku=Object.defineProperty({default:Bu},"__esModule",{value:!0}),Gu=Yu(c),ju=Yu(v);function Yu(e){return e&&e.__esModule?e:{default:e}}function qu(e){var t=(e=e||{}).settings,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0;function s(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 u(e,s,u){return t.get().streaming.abr.movingAverageMethod!==Gu.default.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var n=e?o.throughputHalfLife:o.latencyHalfLife,r=e?i[t]:a[t];if(!r||r.totalWeight<=0)return NaN;var s=r.fastEstimate/(1-Math.pow(.5,r.totalWeight/n.fast)),u=r.slowEstimate/(1-Math.pow(.5,r.totalWeight/n.slow));return e?Math.min(s,u):Math.max(s,u)}(e,s):function(e,t,i){var a=function(e,t,i){var a=void 0,o=void 0;if(e?(a=n[t],o=i?3:4):(a=r[t],o=4),a){if(o>=a.length)o=a.length;else if(e)for(var s=1;s<o;++s){var u=a[a.length-s]/a[a.length-s-1];if((u>=1.3||u<=1/1.3)&&(o+=1)===a.length)break}}else o=0;return o}(e,t,i),o=(e?n:r)[t];if(0===a||!o||0===o.length)return NaN;return(o=o.slice(-a)).reduce((function(e,t){return e+t}))/o.length}(e,s,u)}function l(e,t){return u(!0,e,t)}function f(e){n[e]=n[e]||[],r[e]=r[e]||[],i[e]=i[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},a[e]=a[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function d(){n={},r={},i={},a={}}var c={push:function(e,u,l){if(u.trace&&u.trace.length){var d=u.tresponse.getTime()-u.trequest.getTime()||1,c=u._tfinish.getTime()-u.tresponse.getTime()||1,h=u.trace.reduce((function(e,t){return e+t.b[0]}),0),g=void 0;g=t.get().streaming.lowLatencyEnabled?u.trace.reduce((function(e,t){return e+t.d}),0):l?c:d+c;var p=Math.round(8*h/g);if(f(e),function(e,n,r){return e===Gu.default.VIDEO?r<t.get().streaming.cacheLoadThresholds[Gu.default.VIDEO]:e===Gu.default.AUDIO?r<t.get().streaming.cacheLoadThresholds[Gu.default.AUDIO]:void 0}(e,0,c)){if(n[e].length>0&&!n[e].hasCachedEntries)return;n[e].hasCachedEntries=!0}else n[e]&&n[e].hasCachedEntries&&function(e){delete n[e],delete r[e],delete i[e],delete a[e],f(e)}(e);n[e].push(p),n[e].length>20&&n[e].shift(),r[e].push(d),r[e].length>20&&r[e].shift(),s(i[e],p,.001*c,o.throughputHalfLife),s(a[e],d,1,o.latencyHalfLife)}},getAverageThroughput:l,getSafeAverageThroughput:function(e,n){var r=l(e,n);return isNaN(r)||(r*=t.get().streaming.abr.bandwidthSafetyFactor),r},getAverageLatency:function(e){return u(!1,e)},reset:d};return o={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},d(),c}qu.__dashjs_factory_name="ThroughputHistory";var Hu=ju.default.getClassFactory(qu),Ku=Object.defineProperty({default:Hu},"__esModule",{value:!0}),Vu=ol(Su),zu=ol(c),Wu=ol(E),Xu=ol(Iu),Qu=ol(Se),Zu=ol(P),$u=ol(B),Ju=ol(v),el=ol(Mu),tl=ol(vo),nl=ol(Fu),rl=ol(ku),il=ol(Ku),al=ol(Z);function ol(e){return e&&e.__esModule?e:{default:e}}function sl(){var e=this.context,t=(0,al.default)(e).getInstance(),n=(0,Zu.default)(e).getInstance(),r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0;function N(){(a=(0,Vu.default)(e).create({dashMetrics:R,mediaPlayerModel:_,settings:w})).initialize()}function M(){s={},u={},f={},l={},v={},S={},b={},I={},void 0===c&&(c=!1),y=void 0,T=void 0,A=void 0,clearTimeout(d),d=null}function C(e){e.mediaType===zu.default.VIDEO&&(void 0!==y&&T.push(y,m.getPlaybackQuality()),y=e.newQuality)}function D(e){e.metric!==Wu.default.HTTP_REQUEST||!e.value||e.value.type!==ce.HTTPRequest.MEDIA_SEGMENT_TYPE||e.mediaType!==zu.default.AUDIO&&e.mediaType!==zu.default.VIDEO||A.push(e.mediaType,e.value,w.get().streaming.abr.useDeadTimeLatency),e.metric!==Wu.default.BUFFER_LEVEL||e.mediaType!==zu.default.AUDIO&&e.mediaType!==zu.default.VIDEO||function(e,t){var n=w.get().streaming.abr.ABRStrategy;if(n===zu.default.ABR_STRATEGY_L2A)return S[e]=!1,I[e]=!1,void(b[e]=!0);if(n===zu.default.ABR_STRATEGY_LoLP)return S[e]=!1,I[e]=!0,void(b[e]=!1);if(n===zu.default.ABR_STRATEGY_BOLA)return S[e]=!0,I[e]=!1,void(b[e]=!1);if(n===zu.default.ABR_STRATEGY_THROUGHPUT)return S[e]=!1,I[e]=!1,void(b[e]=!1);!function(e,t){var n=_.getStableBufferTime(),r=n,a=.5*n,o=S[e],s=t>(o?a:r);S[e]=s,s!==o&&(s?i.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+t.toFixed(3)+")."):i.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+t.toFixed(3)+")."))}(e,t)}(e.mediaType,.001*e.value.level)}function O(e,t){return s[t]=s[t]||{},s[t].hasOwnProperty(e)||(s[t][e]=0),function(e,t){if(t!==zu.default.VIDEO||!w.get().streaming.abr.limitBitrateByPortal||!l[t])return e;c||H();var n=p.getAdaptationForType(0,t).Representation,r=e;if(h>0&&g>0){for(;r>0&&n[r]&&h<n[r].width&&h-n[r-1].width<n[r].width-h;)r-=1;for(;r<n.length-1&&n[r].width===n[r+1].width;)r+=1}return r}(function(e,t,n){var r=w.get().streaming.abr.maxRepresentationRatio[t];if(isNaN(r)||r>=1||r<0)return e;return Math.min(e,Math.round(n*r))}(function(e,t){var n=e;if(!l[t])return n;var r=L(t);void 0!==r&&(n=Math.max(e,r));var i=P(t);void 0!==i&&(n=Math.min(n,i));return n}(s[t][e],e),e,s[t][e]),e)}function P(e){var t=function(e){return w.get().streaming.abr.maxBitrate[e]}(e);return t>-1?B(l[e].getMediaInfo(),t):void 0}function L(e){var t=function(e){return w.get().streaming.abr.minBitrate[e]}(e);if(t>-1){var n=l[e].getMediaInfo(),r=k(n),i=B(n,t);return r[i]&&i<r.length-1&&r[i].bitrate<1e3*t&&i++,i}}function F(e,t,n,r){var i=t.id,a=q(e);(0,et.checkInteger)(n);var o=O(e,i);n!==a&&n>=0&&n<=o&&x(e,a,n,o,r)}function x(e,t,r,a,o){if(e&&l[e]){var s=l[e].getStreamInfo(),f=s?s.id:null;if(w.get().debug.logLevel===al.default.LOG_LEVEL_DEBUG){var d=R.getCurrentBufferLevel(e);i.info("["+e+"] switch from "+t+" to "+r+"/"+a+" (buffer: "+d+") "+(o?JSON.stringify(o):"."))}!function(e,t,n){u[t]=u[t]||{},u[t][e]=n}(e,f,r),n.trigger($u.default.QUALITY_CHANGE_REQUESTED,{oldQuality:t,newQuality:r,reason:o},{streamId:s.id,mediaType:e});var c=A.getAverageThroughput(e);isNaN(c)||E.setSavedBitrateSettings(e,c)}}function U(e,t){f[e].state=t}function B(e,t,n){var r=e&&e.type?l[e.type].getRepresentationInfo():null;if(w.get().streaming.abr.useDeadTimeLatency&&n&&r&&r.fragmentDuration){n/=1e3;var i=r.fragmentDuration;if(n>i)return 0;t*=1-n/i}for(var a=k(e),o=a.length-1;o>=0;o--){if(1e3*t>=a[o].bitrate)return o}return 0}function k(e){var t=[];if(!e||!e.bitrateList)return t;for(var n=e.bitrateList,r=e.type,i=void 0,a=0,o=n.length;a<o;a++)(i=new Xu.default).mediaType=r,i.qualityIndex=a,i.bitrate=n[a].bandwidth,i.width=n[a].width,i.height=n[a].height,i.scanType=n[a].scanType,t.push(i);return t}function G(e){return S[e]}function j(e){return b[e]}function Y(e){return I[e]}function q(e){if(e&&l[e]){var t=l[e].getStreamInfo(),n=t?t.id:null;if(n)return u[n]=u[n]||{},u[n].hasOwnProperty(e)||(u[n][e]=0),u[n][e]}return 0}function H(){if(m){var e=w.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;h=m.getClientWidth()*e,g=m.getClientHeight()*e}}function K(t){var n=t.request.mediaType;if(w.get().streaming.abr.autoSwitchBitrate[n]){var i=l[n];if(!i)return;var s=(0,el.default)(e).create({abrController:r,streamProcessor:i,currentRequest:t.request,useBufferOccupancyABR:G(n),useL2AABR:j(n),useLoLPABR:Y(n),videoModel:m}),u=a.shouldAbandonFragment(s);if(u.quality>tl.default.NO_CHANGE){var f=i.getFragmentModel();f.getRequests({state:Qu.default.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(f.abortRequests(),U(n,Wu.default.ABANDON_LOAD),v[n].reset(),v[n].push({oldValue:q(n),newValue:u.quality,confidence:1,reason:u.reason}),F(n,o.getActiveStreamInfo(),u.quality,u.reason),clearTimeout(d),d=setTimeout((function(){U(n,Wu.default.ALLOW_LOAD),d=null}),w.get().streaming.abandonLoadTimeout))}}}return r={isPlayingAtTopQuality:function(e){var t=e?e.id:null,n=q(zu.default.AUDIO),r=q(zu.default.VIDEO);return n===O(zu.default.AUDIO,t)&&r===O(zu.default.VIDEO,t)},updateTopQualityIndex:function(e){var t=e.type,n=e.streamInfo.id,r=e.representationCount-1;return function(e,t,n){s[t]=s[t]||{},s[t][e]=n}(t,n,r),r},getThroughputHistory:function(){return A},getBitrateList:k,getQualityForBitrate:B,getTopBitrateInfoFor:function(e){if(e&&l&&l[e]){var t=l[e].getStreamInfo();if(t&&t.id){var n=O(e,t.id),r=k(l[e].getMediaInfo());return r[n]?r[n]:null}}return null},getMaxAllowedIndexFor:P,getMinAllowedIndexFor:L,getInitialBitrateFor:function(e){if(function(){if(!E||!E.hasOwnProperty("getSavedBitrateSettings"))throw new Error(zu.default.MISSING_CONFIG_ERROR)}(),e===zu.default.TEXT||e===zu.default.FRAGMENTED_TEXT)return NaN;var t=E.getSavedBitrateSettings(e),n=w.get().streaming.abr.initialBitrate[e],r=w.get().streaming.abr.initialRepresentationRatio[e];if(-1===n)if(r>-1){var i=p.getAdaptationForType(0,e).Representation;if(Array.isArray(i))n=i[Math.max(Math.round(i.length*r)-1,0)].bandwidth;else n=0}else n=isNaN(t)?e===zu.default.VIDEO?1e3:100:t;return n},getQualityFor:q,getAbandonmentStateFor:function(e){return f[e]?f[e].state:null},setPlaybackQuality:F,checkPlaybackQuality:function(t){if(t&&l&&l[t]){var n=l[t].getStreamInfo(),o=n?n.id:null,s=q(t),u=(0,el.default)(e).create({abrController:r,streamProcessor:l[t],currentValue:s,switchHistory:v[t],droppedFramesHistory:T,useBufferOccupancyABR:G(t),useL2AABR:j(t),useLoLPABR:Y(t),videoModel:m});if(T){var d=m.getPlaybackQuality();d&&T.push(y,d)}if(w.get().streaming.abr.autoSwitchBitrate[t]){var c=L(t),h=O(t,o),g=a.getMaxQuality(u),p=g.quality;if(void 0!==c&&(p>tl.default.NO_CHANGE?p:s)<c&&(p=c),p>h&&(p=h),v[t].push({oldValue:s,newValue:p}),p>tl.default.NO_CHANGE&&p!=s)(f[t].state===Wu.default.ALLOW_LOAD||p>s)&&x(t,s,p,h,g.reason);else if(w.get().debug.logLevel===al.default.LOG_LEVEL_DEBUG){var _=R.getCurrentBufferLevel(t,!0);i.debug("["+t+"] stay on "+s+"/"+h+" (buffer: "+_+")")}}}},getTopQualityIndexFor:O,setElementSize:H,setWindowResizeEventCalled:function(e){c=e},createAbrRulesCollection:N,registerStreamType:function(t,i){v[t]=v[t]||(0,nl.default)(e).create(),l[t]=i,f[t]=f[t]||{},f[t].state=Wu.default.ALLOW_LOAD,S[t]=!1,b[t]=!1,I[t]=!1,n.on($u.default.LOADING_PROGRESS,K,r),t===zu.default.VIDEO&&(n.on($u.default.QUALITY_CHANGE_RENDERED,C,r),T=T||(0,rl.default)(e).create(),H()),n.on($u.default.METRIC_ADDED,D,r),n.on($u.default.PERIOD_SWITCH_COMPLETED,N,r),A=A||(0,il.default)(e).create({settings:w})},unRegisterStreamType:function(e){delete l[e]},setConfig:function(e){e&&(e.streamController&&(o=e.streamController),e.domStorage&&(E=e.domStorage),e.mediaPlayerModel&&(_=e.mediaPlayerModel),e.dashMetrics&&(R=e.dashMetrics),e.adapter&&(p=e.adapter),e.videoModel&&(m=e.videoModel),e.settings&&(w=e.settings))},reset:function(){M(),n.off($u.default.LOADING_PROGRESS,K,r),n.off($u.default.QUALITY_CHANGE_RENDERED,C,r),n.off($u.default.METRIC_ADDED,D,r),n.off($u.default.PERIOD_SWITCH_COMPLETED,N,r),a&&a.reset()}},i=t.getLogger(r),M(),r}sl.__dashjs_factory_name="AbrController";var ul=Ju.default.getSingletonFactory(sl);ul.QUALITY_DEFAULT=0,Ju.default.updateSingletonFactory(sl.__dashjs_factory_name,ul);var ll=ul,fl=Object.defineProperty({default:ll},"__esModule",{value:!0}),dl=function(e){return e&&e.__esModule?e:{default:e}}(v);function cl(){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={}}}}cl.__dashjs_factory_name="InitCache";var hl=dl.default.getSingletonFactory(cl),gl=Object.defineProperty({default:hl},"__esModule",{value:!0}),pl=Nl(c),ml=Nl(E),_l=Nl(Se),El=Nl(so),yl=Nl(go),vl=Nl(fl),Tl=Nl(P),Al=Nl(B),Sl=Nl(v),bl=Nl(Z),Il=Nl(gl),Rl=Nl(Ie),wl=Nl(ra);function Nl(e){return e&&e.__esModule?e:{default:e}}function Ml(e){e=e||{};var t=this.context,n=(0,Tl.default)(t).getInstance(),r=e.errHandler,i=e.fragmentModel,a=e.representationController,o=e.mediaController,s=e.adapter,u=e.textController,l=e.abrController,f=e.playbackController,d=e.streamInfo,c=e.type,h=e.settings,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0,M=void 0,C=void 0,D=void 0,O=void 0,P=void 0,L=void 0,F=void 0,x=void 0;function U(e){return s.convertDataToRepresentationInfo(a.getRepresentationForQuality(e))}function B(e,n){if(!D||!e)return null;var a=e[0];if(v)try{S=n&&n[c]?(0,El.default)(t).create(v,a,q.bind(this),n[c]):(0,El.default)(t).create(v,a,q.bind(this),null),h.get().streaming.useAppendWindow&&S.updateAppendWindow(d),"function"==typeof S.getBuffer().initialize&&S.getBuffer().initialize(c,d,e,i)}catch(e){p.fatal("Caught error on create SourceBuffer: "+e),r.error(new Rl.default(wl.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,wl.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+c))}else S=(0,yl.default)(t).create(q.bind(this));return ae(U(m)),S}function k(e){p.info("Init fragment finished loading saving to",c+"'s init cache"),D.save(e.chunk),p.debug("Append Init fragment",c," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),j(e.chunk)}function G(e){var t=e.chunk;if(F){x=t;var n=S&&S.getAllBufferRanges();n&&n.length>0&&f.getTimeToStreamEnd()>h.get().streaming.stallThreshold&&(p.debug("Clearing buffer because track changed - "+(n.end(n.length-1)+.5)),ne([{start:0,end:n.end(n.length-1)+.5,force:!0}]))}else j(t)}function j(e){S.append(e),e.mediaInfo.type===pl.default.VIDEO&&pe(Al.default.VIDEO_CHUNK_RECEIVED,{chunk:e})}function Y(e){if(e&&e.length>0)for(var t=0,n=e.length;t<n;t++)p.debug("Buffered range: "+e.start(t)+" - "+e.end(t)+", currentTime = ",f.getTime())}function q(e){if(e.error){if(22===e.error.code&&(C=!0,y=.8*he(),p.warn("Quota exceeded, Critical Buffer: "+y),y>0)){var t=Math.max(.2*y,1),n=y-t,r=Math.min(h.get().streaming.bufferTimeAtTopQuality,.9*n),i=Math.min(h.get().streaming.bufferTimeAtTopQualityLongForm,.9*n),o={streaming:{bufferToKeep:parseFloat(t.toFixed(5)),bufferTimeAtTopQuality:parseFloat(r.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(i.toFixed(5))}};h.update(o)}22!==e.error.code&&ge()||(p.warn("Clearing playback buffer to overcome quota exceed situation"),pe(Al.default.QUOTA_EXCEEDED,{criticalBufferLevel:y,quotaExceededTime:e.chunk.start}),ne(te()))}else{C=!1,(w=e.chunk)&&!isNaN(w.index)&&(T=Math.max(w.index,T),$());var s=S.getAllBufferRanges();if(w.segmentType===ce.HTTPRequest.MEDIA_SEGMENT_TYPE)Y(s),z(),function(){if(c!==pl.default.AUDIO&&c!==pl.default.VIDEO)return;if(isNaN(O))return;var e=f.getTime(),t=Q(O,0);if(e===O&&t)return;var n=a.getCurrentRepresentation().segmentDuration;if(!(t=Q(O,n)))return;Math.abs(e-O)>n?O<=t.end&&(f.seek(Math.max(O,t.start),!1,!0),O=NaN):e<t.start&&(f.seek(t.start,!1,!0),O=NaN)}();else if(F){var u=f.getTime();p.debug("AppendToBuffer seek target should be "+u),pe(Al.default.SEEK_TARGET,{time:u})}var l=!1;I&&(I.indexOf(w)>0&&(l=!0),I=null),w&&!l&&pe(w.endFragment?Al.default.BYTES_APPENDED_END_FRAGMENT:Al.default.BYTES_APPENDED,{quality:w.quality,startTime:w.start,index:w.index,bufferedRanges:s,mediaType:c})}}function H(e){m!==e.newQuality&&(ae(this.getRepresentationInfo(e.newQuality)),m=e.newQuality)}function K(e){S&&(O=e.seekTime,_&&(P=!0,_=!1,A=Number.POSITIVE_INFINITY),c!==pl.default.FRAGMENTED_TEXT?function(){if(!S)return;S.waitForUpdateEnd((function(){var e=function(){if(!S)return;var e=[],t=S.getAllBufferRanges();if(!t||0===t.length)return e;var n=f.getTime(),r=t.end(t.length-1)+.5,a=i.getRequests({state:_l.default.FRAGMENT_MODEL_EXECUTED,time:n,threshold:.01})[0];if(a){var o={start:0,end:a.startTime-h.get().streaming.stallThreshold},s=i.getRequests({state:_l.default.FRAGMENT_MODEL_EXECUTED,time:a.startTime-a.duration/2,threshold:.01})[0];s&&s.startTime!=a.startTime&&(o.end=s.startTime),o.start<o.end&&o.end>t.start(0)&&e.push(o);var u={start:a.startTime+a.duration+h.get().streaming.stallThreshold,end:r},l=i.getRequests({state:_l.default.FRAGMENT_MODEL_EXECUTED,time:a.startTime+a.duration+h.get().streaming.stallThreshold,threshold:.01})[0];l&&l.startTime!==a.startTime&&(u.start=l.startTime+l.duration+h.get().streaming.stallThreshold),u.start<u.end&&u.start<r&&e.push(u)}else p.debug("getAllRangesWithSafetyFactor - No request found in current time position, removing full buffer 0 -",r),e.push({start:0,end:r});return e}();e&&0!==e.length||z(),ne(e)}))}():z())}function V(){O=NaN}function z(){(!F||c===pl.default.FRAGMENTED_TEXT&&u.isTextEnabled())&&Z()}function W(){J()}function X(){O=NaN,J()}function Q(e,t){var n=S.getAllBufferRanges(),r=0,i=0,a=null,o=null,s=0,u=void 0,l=void 0,f=isNaN(t)?.15:t;if(null!=n){for(l=0,u=n.length;l<u;l++)if(r=n.start(l),i=n.end(l),null===a)s=Math.abs(r-e),(e>=r&&e<i||s<=f)&&(a=r,o=i);else{if(!((s=r-o)<=f))break;o=i}if(null!==a)return{start:a,end:o}}return null}function Z(){var e,t,n;f&&(e=(isNaN(O)?f.getTime():O)||0,h.get().streaming.jumpGaps&&(t=h.get().streaming.smallGapLimit),E=null===(n=Q(e,t))?0:n.end-e,pe(Al.default.BUFFER_LEVEL_UPDATED,{bufferLevel:E}),J())}function $(){T>=A-1&&!_&&void 0===S.discharge&&(_=!0,p.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for "+c),pe(Al.default.BUFFERING_COMPLETED))}function J(){c!==pl.default.AUDIO&&c!==pl.default.VIDEO||(P&&!_&&E>0&&f&&f.getTimeToStreamEnd()-E<.1&&(P=!1,_=!0,p.debug("checkIfSufficientBuffer trigger BUFFERING_COMPLETED for type "+c),pe(Al.default.BUFFERING_COMPLETED)),(!h.get().streaming.lowLatencyEnabled&&E<h.get().streaming.stallThreshold||0===E)&&!_?ee(ml.default.BUFFER_EMPTY):(_||E>=d.manifestInfo.minBufferTime)&&ee(ml.default.BUFFER_LOADED))}function ee(e){R===e||e===ml.default.BUFFER_EMPTY&&0===f.getTime()||c===pl.default.FRAGMENTED_TEXT&&!u.isTextEnabled()||(R=e,pe(Al.default.BUFFER_LEVEL_STATE_CHANGED,{state:e}),pe(e===ml.default.BUFFER_LOADED?Al.default.BUFFER_LOADED:Al.default.BUFFER_EMPTY),p.debug(e===ml.default.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function te(){var e=[],t=S.getAllBufferRanges();if(!t||0===t.length)return e;var n=f.getTime(),r=Math.max(0,n-h.get().streaming.bufferToKeep),a=i.getRequests({state:_l.default.FRAGMENT_MODEL_EXECUTED,time:n,threshold:.01})[0];if(a)r=Math.min(a.startTime,r);else if(0===n&&f.getIsDynamic())return[];if(t.start(0)<=r){for(var o={start:0,end:r},s=0;s<t.length&&t.end(s)<=r;s++)o.end=t.end(s);o.start<o.end&&e.push(o)}return e}function ne(e){e&&S&&0!==e.length&&(L.push.apply(L,e),M||re())}function re(){if(0===L.length||!S)return p.debug("Nothing to prune, halt pruning"),L=[],void(M=!1);var e=S.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return p.debug("SourceBuffer is empty (or does not exist), halt pruning"),L=[],void(M=!1);var t=L.shift();p.debug("Removing buffer from:",t.start,"to",t.end),M=!0,f.getTime()<t.end&&(_=!1,T=0),S.remove(t.start,t.end,t.force)}function ie(e){S===e.buffer&&(p.debug("onRemoved buffer from:",e.from,"to",e.to),Y(S.getAllBufferRanges()),0===L.length&&(M=!1),e.unintended&&(p.warn("Detected unintended removal from:",e.from,"to",e.to,"setting index handler time to",e.from),pe(Al.default.SEEK_TARGET,{time:e.from,mediaType:c,streamId:d.id})),M?re():(F?(F=!1,x&&j(x)):Z(),pe(Al.default.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:ge(),quotaExceeded:C})))}function ae(e){e&&void 0!==e.MSETimeOffset&&S&&S.updateTimestampOffset&&S.updateTimestampOffset(e.MSETimeOffset)}function oe(e){e.error||_||ae(e.currentRepresentation)}function se(e){A=e.request.index,$()}function ue(e){if(e.newMediaInfo.streamInfo.id===d.id&&e.newMediaInfo.type===c){var t=S&&S.getAllBufferRanges();t&&(p.info("Track change asked"),o.getSwitchMode(c)===pl.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&t&&t.length>0&&f.getTimeToStreamEnd()>h.get().streaming.stallThreshold&&(_=!1,A=Number.POSITIVE_INFINITY))}}function le(){++N*(h.get().streaming.wallclockTimeUpdateInterval/1e3)>=h.get().streaming.bufferPruningInterval&&(N=0,S&&c!==pl.default.FRAGMENTED_TEXT&&(_||ne(te())))}function fe(){J()}function de(e,t){v=e,S&&t&&"function"==typeof S.discharge&&(b=S,B(t))}function he(){var e,t=S.getAllBufferRanges(),n=0,r=void 0;if(!t)return n;for(r=0,e=t.length;r<e;r++)n+=t.end(r)-t.start(r);return n}function ge(){return he()<y}function pe(e,t){var r=t||{};n.trigger(e,r,{streamId:d.id,mediaType:c})}function me(e,t){y=Number.POSITIVE_INFINITY,R=void 0,m=vl.default.QUALITY_DEFAULT,A=Number.POSITIVE_INFINITY,T=0,w=null,_=!1,M=!1,C=!1,P=!1,E=0,N=0,L=[],O=NaN,S&&(e||S.abort(),S.reset(t),S=null),F=!1}return g={initialize:function(e){de(e),m=l.getQualityFor(c),n.on(Al.default.DATA_UPDATE_COMPLETED,oe,this),n.on(Al.default.INIT_FRAGMENT_LOADED,k,this),n.on(Al.default.MEDIA_FRAGMENT_LOADED,G,this),n.on(Al.default.QUALITY_CHANGE_REQUESTED,H,this),n.on(Al.default.STREAM_COMPLETED,se,this),n.on(Al.default.PLAYBACK_PLAYING,X,this),n.on(Al.default.PLAYBACK_PROGRESS,z,this),n.on(Al.default.PLAYBACK_TIME_UPDATED,z,this),n.on(Al.default.PLAYBACK_RATE_CHANGED,fe,this),n.on(Al.default.PLAYBACK_SEEKING,K,this),n.on(Al.default.PLAYBACK_SEEKED,V,this),n.on(Al.default.PLAYBACK_STALLED,W,this),n.on(Al.default.WALLCLOCK_TIME_UPDATED,le,this),n.on(Al.default.CURRENT_TRACK_CHANGED,ue,this,{priority:Tl.default.EVENT_PRIORITY_HIGH}),n.on(Al.default.SOURCEBUFFER_REMOVE_COMPLETED,ie,this)},getStreamId:function(){return d.id},getType:function(){return c},getBufferControllerType:function(){return"BufferController"},getRepresentationInfo:U,createBuffer:B,dischargePreBuffer:function(){if(S&&b&&"function"==typeof b.discharge){var e=b.getAllBufferRanges();if(e.length>0){for(var t="Beginning "+c+"PreBuffer discharge, adding buffer for:",n=0;n<e.length;n++)t+=" start: "+e.start(n)+", end: "+e.end(n)+";";p.debug(t)}else p.debug("PreBuffer discharge requested, but there were no media segments in the PreBuffer.");I=[];for(var r=b.discharge(),i=null,a=0;a<r.length;a++){var o=r[a];if("InitializationSegment"!==o.segmentType){var s=D.extract(o.streamId,o.representationId);s&&i!==s&&(I.push(s),S.append(s),i=s)}I.push(o),S.append(o)}b.reset(),b=null}},getBuffer:function(){return S},setBuffer:function(e){S=e},getBufferLevel:function(){return E},getRangeAt:Q,setMediaSource:de,getMediaSource:function(){return v},appendInitSegment:function(e){var t=D.extract(d.id,e);return!!t&&(p.info("Append Init fragment",c," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),j(t),!0)},replaceBuffer:function(){F=!0},getIsBufferingCompleted:function(){return _},getIsPruningInProgress:function(){return M},reset:function(e,t){n.off(Al.default.DATA_UPDATE_COMPLETED,oe,this),n.off(Al.default.INIT_FRAGMENT_LOADED,k,this),n.off(Al.default.MEDIA_FRAGMENT_LOADED,G,this),n.off(Al.default.QUALITY_CHANGE_REQUESTED,H,this),n.off(Al.default.STREAM_COMPLETED,se,this),n.off(Al.default.PLAYBACK_PLAYING,X,this),n.off(Al.default.PLAYBACK_PROGRESS,z,this),n.off(Al.default.PLAYBACK_TIME_UPDATED,z,this),n.off(Al.default.PLAYBACK_RATE_CHANGED,fe,this),n.off(Al.default.PLAYBACK_SEEKING,K,this),n.off(Al.default.PLAYBACK_SEEKED,V,this),n.off(Al.default.PLAYBACK_STALLED,W,this),n.off(Al.default.WALLCLOCK_TIME_UPDATED,le,this),n.off(Al.default.CURRENT_TRACK_CHANGED,ue,this),n.off(Al.default.SOURCEBUFFER_REMOVE_COMPLETED,ie,this),me(e,t)},updateAppendWindow:function(){S&&!_&&S.updateAppendWindow(d)}},p=(0,bl.default)(t).getInstance().getLogger(g),D=(0,Il.default)(t).getInstance(),me(),g}Ml.__dashjs_factory_name="BufferController";var Cl=Sl.default.getClassFactory(Ml),Dl=Object.defineProperty({default:Cl},"__esModule",{value:!0}),Ol=jl(c),Pl=jl(P),Ll=jl(B),Fl=jl(v),xl=jl(gl),Ul=jl(so),Bl=jl(Qa),kl=jl(Ie),Gl=jl(ra);function jl(e){return e&&e.__esModule?e:{default:e}}function Yl(e){e=e||{};var t=this.context,n=(0,Pl.default)(t).getInstance(),r=(0,Bl.default)(t).getInstance(),i=e.errHandler,a=e.streamInfo,o=e.type,s=e.mimeType,u=e.fragmentModel,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0;function p(e){c=e}function m(e){null===g.extract(a.id,e.currentRepresentation.id)&&(f=!1,n.trigger(Ll.default.INIT_FRAGMENT_NEEDED,{representationId:e.currentRepresentation.id,sender:l},{streamId:a.id,mediaType:o}))}function _(e){e.chunk.bytes&&(g.save(e.chunk),h.append(e.chunk),f=!0,n.trigger(Ll.default.STREAM_COMPLETED,{request:e.request},{streamId:a.id,mediaType:o}))}return l={getBufferControllerType:function(){return"NotFragmentedTextBufferController"},initialize:function(e){p(e),g=(0,xl.default)(t).getInstance()},createBuffer:function(e){var n=e[0];try{if(h=(0,Ul.default)(t).create(c,n),!d){var l=h.getBuffer();l.hasOwnProperty(Ol.default.INITIALIZE)&&l.initialize(s,a,e,u),d=!0}return h}catch(e){if(n&&(n.isText||-1!==n.codec.indexOf('codecs="stpp')||-1!==n.codec.indexOf('codecs="wvtt')))try{h=r.getTextSourceBuffer()}catch(e){i.error(new kl.default(Gl.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,Gl.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+o+" : "+e.message))}else i.error(new kl.default(Gl.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,Gl.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+o))}},getStreamId:function(){return a.id},getType:function(){return o},getBuffer:function(){return h},getBufferLevel:function(){return 0},setMediaSource:p,getMediaSource:function(){return c},getIsBufferingCompleted:function(){return f},getIsPruningInProgress:function(){return!1},dischargePreBuffer:function(){},appendInitSegment:function(e){return null!==g.extract(a.id,e)},getRangeAt:function(){return null},reset:function(e){n.off(Ll.default.DATA_UPDATE_COMPLETED,m,l),n.off(Ll.default.INIT_FRAGMENT_LOADED,_,l),!e&&h&&(h.abort(),h.reset(),h=null)},updateTimestampOffset:function(e){h.timestampOffset===e||isNaN(e)||(h.timestampOffset=e)}},d=!1,c=null,f=!1,n.on(Ll.default.DATA_UPDATE_COMPLETED,m,l),n.on(Ll.default.INIT_FRAGMENT_LOADED,_,l),l}Yl.__dashjs_factory_name="NotFragmentedTextBufferController";var ql=Fl.default.getClassFactory(Yl),Hl=Object.defineProperty({default:ql},"__esModule",{value:!0}),Kl=Xl(c),Vl=Xl(v),zl=Xl(Dl),Wl=Xl(Hl);function Xl(e){return e&&e.__esModule?e:{default:e}}function Ql(e){e=e||{};var t,n=this.context,r=void 0;function i(){return r.getBuffer()}return t={getBufferControllerType:function(){return r.getBufferControllerType()},initialize:function(e,t){return r.initialize(e,t)},createBuffer:function(e,t){return r.createBuffer(e,t)},getType:function(){return r.getType()},getBuffer:i,setBuffer:function(e){r.setBuffer(e)},getBufferLevel:function(){return r.getBufferLevel()},setMediaSource:function(e){r.setMediaSource(e)},getMediaSource:function(){return r.getMediaSource()},getIsBufferingCompleted:function(){return r.getIsBufferingCompleted()},getIsPruningInProgress:function(){return r.getIsPruningInProgress()},dischargePreBuffer:function(){return r.dischargePreBuffer()},appendInitSegment:function(e){r.appendInitSegment(e)},getRangeAt:function(e){return r.getRangeAt(e)},reset:function(e){r.reset(e)},updateTimestampOffset:function(e){var t=i();t.timestampOffset===e||isNaN(e)||(t.timestampOffset=e)},updateAppendWindow:function(){r.updateAppendWindow()},getRepresentationInfo:function(e){return r.getRepresentationInfo(e)}},r=e.type===Kl.default.FRAGMENTED_TEXT?(0,zl.default)(n).create({streamInfo:e.streamInfo,type:e.type,mediaPlayerModel:e.mediaPlayerModel,manifestModel:e.manifestModel,fragmentModel:e.fragmentModel,errHandler:e.errHandler,mediaController:e.mediaController,representationController:e.representationController,adapter:e.adapter,textController:e.textController,abrController:e.abrController,playbackController:e.playbackController,settings:e.settings}):(0,Wl.default)(n).create({streamInfo:e.streamInfo,type:e.type,mimeType:e.mimeType,fragmentModel:e.fragmentModel,errHandler:e.errHandler}),t}Ql.__dashjs_factory_name="TextBufferController";var Zl=Vl.default.getClassFactory(Ql),$l=Object.defineProperty({default:Zl},"__esModule",{value:!0}),Jl=nf(c),ef=nf(v),tf=nf(E);function nf(e){return e&&e.__esModule?e:{default:e}}function rf(e){var t=(e=e||{}).dashMetrics,n=e.mediaPlayerModel,r=e.textController,i=e.abrController,a=e.settings;function o(e,o,s){var u=NaN;if(!e||!o)return u;if(e===Jl.default.FRAGMENTED_TEXT)if(r.isTextEnabled())if(isNaN(o.fragmentDuration)){var l=t.getCurrentSchedulingInfo(tf.default.SCHEDULING_INFO);u=l?l.duration:0}else u=o.fragmentDuration;else u=0;else if(e===Jl.default.AUDIO&&s){var f=t.getCurrentBufferLevel(Jl.default.VIDEO);u=isNaN(o.fragmentDuration)?f:Math.max(f,o.fragmentDuration)}else{var d=o.mediaInfo.streamInfo;if(i.isPlayingAtTopQuality(d))u=d.manifestInfo.duration>=a.get().streaming.longFormContentDurationThreshold?a.get().streaming.bufferTimeAtTopQualityLongForm:a.get().streaming.bufferTimeAtTopQuality;else u=n.getStableBufferTime()}return u}return{execute:function(e,n,r){return!e||!n||t.getCurrentBufferLevel(e)<o(e,n,r)},getBufferTarget:o}}rf.__dashjs_factory_name="BufferLevelRule";var af=ef.default.getClassFactory(rf),of=Object.defineProperty({default:af},"__esModule",{value:!0}),sf=pf(c),uf=pf(E),lf=pf(of),ff=pf(Se),df=pf(P),cf=pf(B),hf=pf(v),gf=pf(Z);function pf(e){return e&&e.__esModule?e:{default:e}}function mf(e){e=e||{};var t=this.context,n=(0,df.default)(t).getInstance(),r=e.adapter,i=e.dashMetrics,a=e.mediaPlayerModel,o=e.fragmentModel,s=e.abrController,u=e.playbackController,l=e.textController,f=e.type,d=e.mimeType,c=e.mediaController,h=e.bufferController,g=e.settings,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0,M=void 0,C=void 0,D=void 0,O=void 0,P=void 0,L=void 0;function F(){return!1===y}function x(){m&&(F()||E&&!h.getIsBufferingCompleted()&&(_.debug("Schedule Controller starts"),y=!1,i.createPlaylistTraceMetrics(E.id,1e3*u.getTime(),u.getPlaybackRate()),k(0)))}function U(){y||(_.debug("Schedule Controller stops"),_.debug(f+" Schedule Controller stops"),y=!0,clearTimeout(A))}function B(){if(m)if(y||v||u.isPaused()&&!g.get().streaming.scheduleWhilePaused||(f===sf.default.FRAGMENTED_TEXT||f===sf.default.TEXT)&&!l.isTextEnabled()||h.getIsBufferingCompleted())U();else{!function(){if(!isNaN(S))return;if(!N)return;var e=u.getTime(),t=1.5;if(isNaN(N.fragmentDuration)){var n=i.getCurrentSchedulingInfo(E.mediaInfo.type);t=n?1.5*n.duration:1.5}var a=o.getRequests({state:ff.default.FRAGMENT_MODEL_EXECUTED,time:e+t,threshold:0})[0];if(a&&-1===M.indexOf(a)&&!r.getIsTextTrack(d)){var l=g.get().streaming.fastSwitchEnabled,p=h.getBufferLevel(),m=s.getAbandonmentStateFor(f),y=!c.isCurrentTrack(a.mediaInfo)&&c.getSwitchMode(a.mediaInfo.type)===sf.default.TRACK_SWITCH_MODE_NEVER_REPLACE,v=a.quality<N.quality;l&&(y||v)&&p>=t&&m!==uf.default.ABANDON_LOAD?(j(a),L=!0,_.debug("Reloading outdated fragment at index: ",a.index)):a.quality>N.quality&&!D&&ne(u.getTime()+p)}}();var e=M.length>0,t=N?N.quality:NaN;if(D||isNaN(t)||C||e||function(e,t){w[t]=w[t]||{};var n=s.getTopQualityIndexFor(e,t);return w[t][e]!=n&&(_.info("Top quality "+e+" index has changed from "+w[t][e]+" to "+n),w[t][e]=n,!0)}(f,m.id)||I.execute(f,E,b)){G(!0),!e&&P&&s.checkPlaybackQuality(f),function(){if(E.quality===t&&!C||D){var e=M.shift();e&&e.isInitializationRequest()?(n.trigger(cf.default.INIT_FRAGMENT_NEEDED,{representationId:e.representationId,sender:p},{streamId:m.id,mediaType:f}),P=!1):(n.trigger(cf.default.MEDIA_FRAGMENT_NEEDED,{seekTarget:S,replacement:e},{streamId:m.id,mediaType:f}),P=!0)}else C?(_.debug("Switch track for "+f+", representation id = "+E.id),(D=c.getSwitchMode(f)===sf.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE)&&h.replaceBuffer&&h.replaceBuffer(),C=!1):_.debug("Quality has changed, get init request for representationid = "+E.id),n.trigger(cf.default.INIT_FRAGMENT_NEEDED,{representationId:E.id,sender:p},{streamId:m.id,mediaType:f}),P=!1}()}else k(500)}}function k(e){clearTimeout(A),A=setTimeout(B,e)}function G(e){v!==e?v=e:_.debug("isFragmentProcessingInProgress is already equal to",e)}function j(e){M.push(e)}function Y(e){if(u&&o){var t=o.getRequests({state:ff.default.FRAGMENT_MODEL_EXECUTED,time:u.getTime(),threshold:0})[0];t&&u.getTime()>=t.startTime&&((!R.mediaInfo||t.mediaInfo.type===R.mediaInfo.type&&t.mediaInfo.id!==R.mediaInfo.id)&&e&&n.trigger(cf.default.TRACK_CHANGE_RENDERED,{mediaType:f,oldMediaInfo:R.mediaInfo,newMediaInfo:t.mediaInfo}),t.quality===R.quality&&t.adaptationIndex===R.adaptationIndex||!e||n.trigger(cf.default.QUALITY_CHANGE_RENDERED,{mediaType:f,oldQuality:R.quality,newQuality:t.quality}),R={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function q(){U(),G(!1),_.info("Stream "+m.id+" is complete")}function H(e){e.request.mediaInfo.streamInfo.id===m.id&&e.request.mediaType===f&&(_.info("OnFragmentLoadingCompleted - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),r.getIsTextTrack(d)&&G(!1),e.error&&e.request.serviceLocation&&!y&&(j(e.request),G(!1),k(0)),D&&(O=e.request))}function K(){Y(!0)}function V(e){if(D&&!isNaN(e.startTime)&&(D=!1,o.addExecutedRequest(O)),G(!1),isNaN(e.index)&&(N=h.getRepresentationInfo(e.quality),_.info("["+f+"] lastInitializedRepresentationInfo changed to "+e.quality)),L&&!isNaN(e.startTime)){var t=u.getTime(),n=e.startTime+E.fragmentDuration,r=1.5*E.fragmentDuration;k(t+r>=n?0:1e3*(n-(t+r))),L=!1}else k(0)}function z(e){_.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),u.isSeeking()||C||(_.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),j(e.request)),G(!1),k(0)}function W(){}function X(){U()}function Q(e){D&&g.get().streaming.flushBufferAtTrackSwitch&&u.seek(u.getTime()+.001,!1,!0),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&x()}function Z(){U(),G(!1)}function $(){o.abortRequests(),U()}function J(){!y&&g.get().streaming.scheduleWhilePaused||x()}function ee(e){if(m){ne(e.seekTime),re(0),y&&x();var t=E&&E.DVRWindow&&u?E.DVRWindow.end-u.getTime():NaN;i.updateManifestUpdateInfo({latency:t}),v?o.abortRequests():k(0)}}function te(e){i.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function ne(e){S=e}function re(e){T=e}function ie(){P=!0,v=!1,T=0,S=NaN,N=void 0,R={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},w={},M=[],y=!0,C=!1,D=!1,O=null,L=!1}return p={initialize:function(e){b=e,I=(0,lf.default)(t).create({abrController:s,dashMetrics:i,mediaPlayerModel:a,textController:l,settings:g}),n.on(cf.default.DATA_UPDATE_STARTED,W,this),n.on(cf.default.FRAGMENT_LOADING_COMPLETED,H,this),n.on(cf.default.STREAM_COMPLETED,q,this),n.on(cf.default.BUFFER_CLEARED,Q,this),n.on(cf.default.BYTES_APPENDED_END_FRAGMENT,V,this),n.on(cf.default.QUOTA_EXCEEDED,Z,this),n.on(cf.default.PLAYBACK_SEEKING,ee,this),n.on(cf.default.PLAYBACK_STARTED,J,this),n.on(cf.default.PLAYBACK_RATE_CHANGED,te,this),n.on(cf.default.PLAYBACK_TIME_UPDATED,K,this),n.on(cf.default.URL_RESOLUTION_FAILED,$,this),n.on(cf.default.FRAGMENT_LOADING_ABANDONED,z,this),n.on(cf.default.BUFFERING_COMPLETED,X,this)},getType:function(){return f},getStreamId:function(){return m.id},setCurrentRepresentation:function(e){E=e},setSeekTarget:ne,setTimeToLoadDelay:re,getTimeToLoadDelay:function(){return T},switchTrackAsked:function(){C=!0},isStarted:F,start:x,stop:U,reset:function(){n.off(cf.default.DATA_UPDATE_STARTED,W,this),n.off(cf.default.FRAGMENT_LOADING_COMPLETED,H,this),n.off(cf.default.STREAM_COMPLETED,q,this),n.off(cf.default.BUFFER_CLEARED,Q,this),n.off(cf.default.BYTES_APPENDED_END_FRAGMENT,V,this),n.off(cf.default.QUOTA_EXCEEDED,Z,this),n.off(cf.default.PLAYBACK_SEEKING,ee,this),n.off(cf.default.PLAYBACK_STARTED,J,this),n.off(cf.default.PLAYBACK_RATE_CHANGED,te,this),n.off(cf.default.PLAYBACK_TIME_UPDATED,K,this),n.off(cf.default.URL_RESOLUTION_FAILED,$,this),n.off(cf.default.FRAGMENT_LOADING_ABANDONED,z,this),n.off(cf.default.BUFFERING_COMPLETED,X,this),U(),Y(!1),ie(),m=null},getBufferTarget:function(){return I.getBufferTarget(f,E,b)},processInitRequest:function(e){e&&(G(!0),o.executeRequest(e))},processMediaRequest:function(e){e?(_.debug("Next fragment request url is "+e.url),o.executeRequest(e)):(u.getIsDynamic()&&_.debug("Next fragment seems to be at the bleeding live edge and is not available yet. Rescheduling."),G(!1),k(g.get().streaming.lowLatencyEnabled?100:500))},getPlaybackController:function(){return u}},_=(0,gf.default)(t).getInstance().getLogger(p),ie(),m=e.streamInfo,p}mf.__dashjs_factory_name="ScheduleController";var _f=hf.default.getClassFactory(mf),Ef=Object.defineProperty({default:_f},"__esModule",{value:!0}),yf=Af(c),vf=Af(Ie),Tf=Af(v);function Af(e){return e&&e.__esModule?e:{default:e}}function Sf(e){var t=(e=e||{}).eventBus,n=e.events,r=e.errors,i=e.abrController,a=e.dashMetrics,o=e.playbackController,s=e.timelineConverter,u=e.type,l=e.streamInfo,f=e.dashConstants,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0;function m(){return u}function _(){if(!(i&&a&&o&&s))throw new Error(yf.default.MISSING_CONFIG_ERROR)}function E(){return h}function y(){return p}function v(){c=null,h=!0,g=[]}function T(){_();var e=new Date,t=y(),n=1e3*o.getTime();t&&a.addRepresentationSwitch(t.adaptation.type,e,n,t.id)}function A(e){return null==e||e>=g.length?null:g[e]}function S(e,t){var n;(e.segmentAvailabilityRange=s.calcSegmentAvailabilityRange(e,t),e.segmentAvailabilityRange.end<e.segmentAvailabilityRange.start)?R(new vf.default(r.SEGMENTS_UNAVAILABLE_ERROR_CODE,r.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE,{availabilityDelay:e.segmentAvailabilityRange.start-e.segmentAvailabilityRange.end})):t&&(n=e.segmentAvailabilityRange.end,s.setExpectedLiveEdge(n),a.updateManifestUpdateInfo({presentationStartTime:n}))}function b(e,r){_();for(var i=0,a=g.length;i<a;i++)S(g[i],e),r&&t.trigger(n.REPRESENTATION_UPDATE_STARTED,{representation:g[i]},{streamId:l.id,mediaType:u})}function I(){h=!0,t.trigger(n.DATA_UPDATE_STARTED,{},{streamId:l.id,mediaType:u})}function R(e){h=!1,t.trigger(n.DATA_UPDATE_COMPLETED,{data:c,currentRepresentation:p,error:e},{streamId:l.id,mediaType:u})}function w(e){var r=e;t.trigger(n.AST_IN_FUTURE,{delay:r}),setTimeout((function(){E()||(I(),g.forEach((function(e){e.segmentAvailabilityRange=null})),b(o.getIsDynamic(),!0))}),r)}function N(e){if(E())if(e.error)R(e.error);else{var t,n=e.representation,s=a.getCurrentManifestUpdate(),u=!1,d=0,c=void 0;if(n.adaptation.period.mpd.manifest.type===f.DYNAMIC&&!n.adaptation.period.mpd.manifest.ignorePostponeTimePeriod&&o.getStreamController().getStreams().length<=1&&(d=function(e){try{var t=o.getStreamController().getActiveStreamInfo(),n=e.segmentAvailabilityRange.start;t&&t.id&&t.id!==l.id&&(n=Math.min(o.getTime(),n));var r=e.segmentAvailabilityRange.end-n;return 1e3*(o.getLiveDelay()-r)}catch(e){return 0}}(n)),d>0)return w(d),void R(new vf.default(r.SEGMENTS_UPDATE_FAILED_ERROR_CODE,r.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE));if(s){for(var h=0;h<s.representationInfo.length;h++)if((c=s.representationInfo[h]).index===n.index&&c.mediaType===m()){u=!0;break}u||a.addManifestUpdateRepresentationInfo(n,m())}(function(){for(var e=0,t=g.length;e<t;e++){var n=g[e].segmentInfoType;if(null===g[e].segmentAvailabilityRange||!g[e].hasInitialization()||(n===f.SEGMENT_BASE||n===f.BASE_URL)&&!g[e].segments)return!1}return!0})()&&(i.setPlaybackQuality(m(),l,(t=p,g.indexOf(t))),a.updateManifestUpdateInfo({latency:p.segmentAvailabilityRange.end-o.getTime()}),a.getCurrentRepresentationSwitch(y().adaptation.type)||T(),R())}}function M(e){e.isDynamic&&b(e.isDynamic)}function C(e){p=A(e.newQuality),T()}function D(e){if(e.newDuration){var t=y();if(t&&t.adaptation.period)t.adaptation.period.duration=e.newDuration}}return d={getStreamId:function(){return l.id},getType:m,getData:function(){return c},isUpdating:E,updateData:function(e,t,n,r){_(),I(),g=t,p=A(r),c=e,n===yf.default.VIDEO||n===yf.default.AUDIO||n===yf.default.FRAGMENTED_TEXT?b(o.getIsDynamic(),!0):R()},updateRepresentation:S,getCurrentRepresentation:y,getRepresentationForQuality:A,reset:function(){t.off(n.QUALITY_CHANGE_REQUESTED,C,d),t.off(n.REPRESENTATION_UPDATE_COMPLETED,N,d),t.off(n.WALLCLOCK_TIME_UPDATED,M,d),t.off(n.MANIFEST_VALIDITY_CHANGED,D,d),v()}},v(),t.on(n.QUALITY_CHANGE_REQUESTED,C,d),t.on(n.REPRESENTATION_UPDATE_COMPLETED,N,d),t.on(n.WALLCLOCK_TIME_UPDATED,M,d),t.on(n.MANIFEST_VALIDITY_CHANGED,D,d),d}Sf.__dashjs_factory_name="RepresentationController";var bf=Tf.default.getClassFactory(Sf),If=Object.defineProperty({default:bf},"__esModule",{value:!0}),Rf=Nf(v),wf=Nf(c);function Nf(e){return e&&e.__esModule?e:{default:e}}function Mf(e){var t=(e=e||{}).timelineConverter;return{getLiveEdge:function(e){return function(){if(!t||!t.hasOwnProperty("getExpectedLiveEdge"))throw new Error(wf.default.MISSING_CONFIG_ERROR)}(),e.DVRWindow?e.DVRWindow.end:0},reset:function(){t=null}}}Mf.__dashjs_factory_name="LiveEdgeFinder";var Cf=Rf.default.getClassFactory(Mf),Df=Object.defineProperty({default:Cf},"__esModule",{value:!0});var Of=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.availabilityIdx=NaN,this.wallStartTime=NaN,this.representation=null},Pf=Object.defineProperty({default:Of},"__esModule",{value:!0}),Lf=function(e){return e?e.split("$$").join("$"):e},Ff=function(e,t){if(!t||!e||-1===e.indexOf("$RepresentationID$"))return e;var n=t.toString();return e.split("$RepresentationID$").join(n)},xf=jf,Uf=function(e,t,n,r){var i,a,o=void 0;o=n.segmentDuration,isNaN(o)&&(o=n.adaptation.period.duration);i=parseFloat((n.adaptation.period.start+r*o).toFixed(5)),a=parseFloat((i+o).toFixed(5));var s=Yf(n,o,i,e.calcMediaTimeFromPresentationTime(i,n),e.calcAvailabilityStartTimeFromPresentationTime(i,n.adaptation.period.mpd,t),e,a,t,r);if(!qf(e,n,s,t))return null;return s},Bf=function(e,t,n,r,i,a,o,s,u,l){var f,d,c=r/a,h=Math.min(i/a,n.adaptation.period.mpd.maxSegmentDuration),g=void 0;if(f=e.calcPresentationTimeFromMediaTime(c,n),d=f+h,g=Yf(n,h,f,c,n.adaptation.period.mpd.manifest.loadedTime,e,d,t,u),!qf(e,n,g,t))return null;return g.replacementTime=l||r,o=jf(o,"Number",g.replacementNumber),o=jf(o,"Time",g.replacementTime),g.media=o,g.mediaRange=s,g},kf=function(e){return e&&e.__esModule?e:{default:e}}(Pf);function Gf(e,t){for(;e.length<t;)e="0"+e;return e}function jf(e,t,n){var r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=t.length,f="%0".length;if(!e)return e;for(;;){if((r=e.indexOf("$"+t))<0)return e;if((i=e.indexOf("$",r+l))<0)return e;if((a=e.indexOf("%0",r+l))>r&&a<i)switch(o=e.charAt(i-1),s=parseInt(e.substring(a+f,i-1),10),o){case"d":case"i":case"u":u=Gf(n.toString(),s);break;case"x":u=Gf(n.toString(16),s);break;case"X":u=Gf(n.toString(16),s).toUpperCase();break;case"o":u=Gf(n.toString(8),s);break;default:return e}else u=n;e=e.substring(0,r)+u+e.substring(i+1)}}function Yf(e,t,n,r,i,a,o,s,u){var l,f=new kf.default;return f.representation=e,f.duration=t,f.presentationStartTime=n,f.mediaStartTime=r,f.availabilityStartTime=i,f.availabilityEndTime=a.calcAvailabilityEndTimeFromPresentationTime(o,e.adaptation.period.mpd,s),f.wallStartTime=a.calcWallTimeForSegment(f,s),f.replacementNumber=(l=u,f.representation.startNumber+l),f.availabilityIdx=u,f}function qf(e,t,n,r){var i=e.getPeriodEnd(t,r),a=e.calcPeriodRelativeTimeFromMpdRelativeTime(t,i);if(e.calcPeriodRelativeTimeFromMpdRelativeTime(t,n.presentationStartTime)>=a){if(!r)return!1;if(t.segmentAvailabilityRange&&n.presentationStartTime>=t.segmentAvailabilityRange.end)return!1}return!0}var Hf=Object.defineProperty({unescapeDollarsInTemplate:Lf,replaceIDForTemplate:Ff,replaceTokenForTemplate:xf,getIndexBasedSegment:Uf,getTimeBasedSegment:Bf},"__esModule",{value:!0}),Kf=zf(v),Vf=zf(c);function zf(e){return e&&e.__esModule?e:{default:e}}function Wf(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcMediaTimeFromPresentationTime")||!n.hasOwnProperty("calcSegmentAvailabilityRange"))throw new Error(Vf.default.MISSING_CONFIG_ERROR)}function i(e,r){var i,a,o,s=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,u=s.SegmentTimeline,l=s.SegmentURL_asArray,f=0,d=0,c=-1,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0;o=e.timescale;var y=!1;for(g=0,a=(i=u.S_asArray).length;g<a&&!y;g++){if(m=0,(h=i[g]).hasOwnProperty("r")&&(m=h.r),h.hasOwnProperty("t")&&(d=(f=h.t)/o),m<0){if((E=i[g+1])&&E.hasOwnProperty("t"))_=E.t/o;else{var v=e.segmentAvailabilityRange?e.segmentAvailabilityRange.end:n.calcSegmentAvailabilityRange(e,t).end;_=n.calcMediaTimeFromPresentationTime(v,e),e.segmentDuration=h.d/o}m=Math.ceil((_-d)/(h.d/o))-1}for(p=0;p<=m&&!y;p++)(y=r(f,d,s,l,h,o,++c,g))&&(e.segmentDuration=h.d/o,(p<m-1||g<a-1)&&c++),d=(f+=h.d)/o}e.availableSegmentsNumber=c}return{getSegmentByIndex:function(e,a,o){if(r(),!e)return null;var s=null,u=!1;return i(e,(function(r,i,a,l,f,d,c,h){if(u||o<0){var g=a.media,p=f.mediaRange;return l&&(g=l[h].media||"",p=l[h].mediaRange),s=(0,Hf.getTimeBasedSegment)(n,t,e,r,f.d,d,g,p,c,f.tManifest),!0}return i>=o-.5*f.d/d&&(u=!0),!1})),s},getSegmentByTime:function(e,a){if(r(),!e)return null;void 0===a&&(a=null);var o=null,s=n.calcMediaTimeFromPresentationTime(a,e);return i(e,(function(r,i,a,u,l,f,d,c){if(s<i+l.d/f){var h=a.media,g=l.mediaRange;return u&&(h=u[c].media||"",g=u[c].mediaRange),o=(0,Hf.getTimeBasedSegment)(n,t,e,r,l.d,f,h,g,d,l.tManifest),!0}return!1})),o}}}Wf.__dashjs_factory_name="TimelineSegmentsGetter";var Xf=Kf.default.getClassFactory(Wf),Qf=Object.defineProperty({default:Xf},"__esModule",{value:!0}),Zf=Jf(v),$f=Jf(c);function Jf(e){return e&&e.__esModule?e:{default:e}}function ed(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error($f.default.MISSING_CONFIG_ERROR)}function i(e,i){if(r(),!e)return null;var a=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 o=(0,Hf.getIndexBasedSegment)(n,t,e,i);if(o){o.replacementTime=Math.round((i-1)*e.segmentDuration*e.timescale,10);var s=a.media;s=(0,Hf.replaceTokenForTemplate)(s,"Number",o.replacementNumber),s=(0,Hf.replaceTokenForTemplate)(s,"Time",o.replacementTime),o.media=s}var u=e.segmentDuration,l=e.segmentAvailabilityRange;return isNaN(u)?e.availableSegmentsNumber=1:e.availableSegmentsNumber=Math.ceil((l.end-l.start)/u),o}return{getSegmentByIndex:i,getSegmentByTime:function(e,t){if(r(),!e)return null;var a=e.segmentDuration;if(isNaN(a))return null;var o=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return i(e,Math.floor(o/a))}}}ed.__dashjs_factory_name="TemplateSegmentsGetter";var td=Zf.default.getClassFactory(ed),nd=Object.defineProperty({default:td},"__esModule",{value:!0}),rd=ad(v),id=ad(c);function ad(e){return e&&e.__esModule?e:{default:e}}function od(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(id.default.MISSING_CONFIG_ERROR)}function i(e,i){if(r(),!e)return null;var a=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,o=a.SegmentURL_asArray.length,s=e&&!isNaN(e.startNumber)?e.startNumber:1,u=Math.max(s-1,0),l=Math.max(i-u,0),f=null;if(l<o){var d=a.SegmentURL_asArray[l];(f=(0,Hf.getIndexBasedSegment)(n,t,e,i))&&(f.replacementTime=(s+i-1)*e.segmentDuration,f.media=d.media?d.media:"",f.mediaRange=d.mediaRange,f.index=i,f.indexRange=d.indexRange)}return e.availableSegmentsNumber=o,f}return{getSegmentByIndex:i,getSegmentByTime:function(e,t){if(r(),!e)return null;var a=e.segmentDuration;if(isNaN(a))return null;var o=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return i(e,Math.floor(o/a))}}}od.__dashjs_factory_name="ListSegmentsGetter";var sd=rd.default.getClassFactory(od),ud=Object.defineProperty({default:sd},"__esModule",{value:!0}),ld=dd(v),fd=dd(c);function dd(e){return e&&e.__esModule?e:{default:e}}function cd(e){var t=(e=e||{}).timelineConverter;function n(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(fd.default.MISSING_CONFIG_ERROR)}function r(e,t){if(n(),!e)return null;var r=e.segments?e.segments.length:-1,i=void 0;if(t<r&&(i=e.segments[t])&&i.availabilityIdx===t)return i;for(var a=0;a<r;a++)if((i=e.segments[a])&&i.availabilityIdx===t)return i;return null}return{getSegmentByIndex:r,getSegmentByTime:function(e,t){return n(),r(e,function(e,t){if(!e)return-1;var n=e.segments,r=n?n.length:null,i=-1,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0;if(n&&r>0)for(l=0;l<r;l++)if(o=n[l],s=o.presentationStartTime,u=o.duration,t+(a=u/2)>=s&&t-a<s+u){i=o.availabilityIdx;break}return i}(e,t))}}}cd.__dashjs_factory_name="SegmentBaseGetter";var hd=ld.default.getClassFactory(cd),gd=Object.defineProperty({default:hd},"__esModule",{value:!0}),pd=vd(v),md=vd(Qf),_d=vd(nd),Ed=vd(ud),yd=vd(gd);function vd(e){return e&&e.__esModule?e:{default:e}}function Td(e){e=e||{};var t,n=this.context,r=e.events,i=e.eventBus,a=e.dashConstants,o=e.streamInfo,s=e.type,u=void 0;function l(e){return e?e.segments?u[a.SEGMENT_BASE]:u[e.segmentInfoType]:null}return t={initialize:function(t){u[a.SEGMENT_TIMELINE]=(0,md.default)(n).create(e,t),u[a.SEGMENT_TEMPLATE]=(0,_d.default)(n).create(e,t),u[a.SEGMENT_LIST]=(0,Ed.default)(n).create(e,t),u[a.SEGMENT_BASE]=(0,yd.default)(n).create(e,t)},update:function(e,t,n,a){n||i.trigger(r.SEGMENTBASE_INIT_REQUEST_NEEDED,{streamId:o.id,mediaType:s,mimeType:t,representation:e}),a||i.trigger(r.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,{streamId:o.id,mediaType:s,mimeType:t,representation:e})},getSegmentByIndex:function(e,t,n){var r=l(e);return r?r.getSegmentByIndex(e,t,n):null},getSegmentByTime:function(e,t){var n=l(e);return n?n.getSegmentByTime(e,t):null}},u={},t}Td.__dashjs_factory_name="SegmentsController";var Ad=pd.default.getClassFactory(Td),Sd=Object.defineProperty({default:Ad},"__esModule",{value:!0}),bd=wd(me),Id=wd(v),Rd=wd(Sd);function wd(e){return e&&e.__esModule?e:{default:e}}function Nd(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,i=e.debug,a=e.dashConstants,o=e.urlUtils,s=e.type,u=e.streamInfo,l=e.timelineConverter,f=e.dashMetrics,d=e.baseURLController,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0;function T(){return s}function A(){g=-1,p=null}function S(){A(),m=null,v=null,y=null}function b(e,t,n){var r=d.resolve(n.path),i=void 0,a=void 0;return r&&t!==r.url&&o.isRelative(t)?(i=r.url,a=r.serviceLocation,t&&(i=o.resolve(t,i))):i=t,!o.isRelative(i)&&(e.url=i,e.serviceLocation=a,!0)}function I(e){var t,i,a;t=e.representation,i=t.hasInitialization(),a=t.hasSegments(),i&&a?n.trigger(r.REPRESENTATION_UPDATE_COMPLETED,{representation:t},{streamId:u.id,mediaType:s}):v.update(t,y,i,a)}function R(e,t){if(null==t)return null;var n=new bd.default,r=t.representation,i=r.adaptation.period.mpd.manifest.Period_asArray[r.adaptation.period.index].AdaptationSet_asArray[r.adaptation.index].Representation_asArray[r.index].bandwidth,a=t.media;return a=(0,Hf.replaceTokenForTemplate)(a,"Number",t.replacementNumber),a=(0,Hf.replaceTokenForTemplate)(a,"Time",t.replacementTime),a=(0,Hf.replaceTokenForTemplate)(a,"Bandwidth",i),a=(0,Hf.replaceIDForTemplate)(a,r.id),a=(0,Hf.unescapeDollarsInTemplate)(a),n.mediaType=T(),n.type=ce.HTTPRequest.MEDIA_SEGMENT_TYPE,n.range=t.mediaRange,n.startTime=t.presentationStartTime,n.mediaStartTime=t.mediaStartTime,n.duration=t.duration,n.timescale=r.timescale,n.availabilityStartTime=t.availabilityStartTime,n.availabilityEndTime=t.availabilityEndTime,n.wallStartTime=t.wallStartTime,n.quality=r.index,n.index=t.availabilityIdx,n.mediaInfo=e,n.adaptationIndex=r.adaptation.index,n.representationId=r.id,b(n,a,r)?n:void 0}function w(e){var t=!1;if(!e)return t;if(_){if(E)t=!0;else if(p){var n=parseFloat((p.presentationStartTime-e.adaptation.period.start).toFixed(5));t=(p.duration>0?n+1.5*p.duration:n)>=e.adaptation.period.duration}}else g>=e.availableSegmentsNumber&&(t=!0);return t}function N(e){var t=e.representation;t.segments&&n.trigger(r.REPRESENTATION_UPDATE_COMPLETED,{representation:t},{streamId:u.id,mediaType:s})}function M(e){if(!e.error){var t,i=e.segments,a=e.representation,o=[],d=0,c=void 0,h=void 0,g=void 0;for(c=0,t=i?i.length:0;c<t;c++)h=i[c],(g=(0,Hf.getTimeBasedSegment)(l,_,a,h.startTime,h.duration,h.timescale,h.media,h.mediaRange,d))&&(o.push(g),g=null,d++);if(o.length>0)if(a.segmentAvailabilityRange={start:o[0].presentationStartTime,end:o[o.length-1].presentationStartTime},a.availableSegmentsNumber=o.length,a.segments=o,_)!function(e){l.setExpectedLiveEdge(e),f.updateManifestUpdateInfo({presentationStartTime:e})}(o[o.length-1].presentationStartTime-8);a.hasInitialization()&&n.trigger(r.REPRESENTATION_UPDATE_COMPLETED,{representation:a},{streamId:u.id,mediaType:s})}}function C(){h.debug("Dynamic stream complete"),E=!0}return c={initialize:function(e){_=e,E=!1,v.initialize(e)},getStreamId:function(){return u.id},getType:T,getStreamInfo:function(){return u},getInitRequest:function(e,t){return t?function(e,t,n){var r=new bd.default,i=t.adaptation.period,a=i.start;if(r.mediaType=n,r.type=ce.HTTPRequest.INIT_SEGMENT_TYPE,r.range=t.range,r.availabilityStartTime=l.calcAvailabilityStartTimeFromPresentationTime(a,i.mpd,_),r.availabilityEndTime=l.calcAvailabilityEndTimeFromPresentationTime(a+i.duration,i.mpd,_),r.quality=t.index,r.mediaInfo=e,r.representationId=t.id,b(r,t.initialization,t))return r.url=(0,Hf.replaceTokenForTemplate)(r.url,"Bandwidth",t.bandwidth),r}(e,t,T()):null},getRequestForSegment:R,getSegmentRequestForTime:function(e,t,n,r){var i=null;if(!t||!t.segmentInfoType)return i;var o=g,u=!!r&&r.keepIdx,l=!(!r||!r.ignoreIsFinished);m!==n&&(m=n,h.debug("Getting the request for time : "+n));var f=v.getSegmentByTime(t,n);return f?(g=f.availabilityIdx,p=f,h.debug("Index for time "+n+" is "+g),i=R(e,f)):!l&&w(t)&&((i=new bd.default).action=bd.default.ACTION_COMPLETE,i.index=g-1,i.mediaType=s,i.mediaInfo=e,h.debug("Signal complete in getSegmentRequestForTime")),u&&o>=0&&(g=t.segmentInfoType===a.SEGMENT_TIMELINE&&_?g:o),i},getNextSegmentRequest:function(e,t){var n=null;if(!t||!t.segmentInfoType)return null;m=null;var r=g+1;h.debug("Getting the next request at index: "+r);var i=v.getSegmentByIndex(t,r,p?p.mediaStartTime:-1);return i||!function(e){return!isFinite(e.adaptation.period.duration)}(t)||E?(i?(n=R(e,i),g=i.availabilityIdx):g=_?r-1:r,i?p=i:w(t)&&((n=new bd.default).action=bd.default.ACTION_COMPLETE,n.index=g-1,n.mediaType=T(),n.mediaInfo=e,h.debug("Signal complete")),n):(h.debug(T()+" No segment found at index: "+r+". Wait for next loop"),null)},setCurrentIndex:function(e){g=e},getCurrentIndex:function(){return g},isMediaFinished:w,reset:function(){S(),n.off(r.INITIALIZATION_LOADED,N,c),n.off(r.SEGMENTS_LOADED,M,c),n.off(r.REPRESENTATION_UPDATE_STARTED,I,c),n.off(r.DYNAMIC_TO_STATIC,C,c)},resetIndex:A,setMimeType:function(e){y=e},getNextSegmentRequestIdempotent:function(e,t){var n=g+1,r=v.getSegmentByIndex(t,n,p?p.mediaStartTime:-1);return r?R(e,r):null}},h=i.getLogger(c),S(),v=(0,Rd.default)(t).create(e),n.on(r.INITIALIZATION_LOADED,N,c),n.on(r.SEGMENTS_LOADED,M,c),n.on(r.REPRESENTATION_UPDATE_STARTED,I,c),n.on(r.DYNAMIC_TO_STATIC,C,c),c}Nd.__dashjs_factory_name="DashHandler";var Md=Id.default.getClassFactory(Nd),Cd=Object.defineProperty({default:Md},"__esModule",{value:!0}),Dd=function(e){return e&&e.__esModule?e:{default:e}}(v);function Od(){return{modifyRequestURL:function(e){return e},modifyRequestHeader:function(e){return e}}}Od.__dashjs_factory_name="RequestModifier";var Pd=Dd.default.getSingletonFactory(Od),Ld=Object.defineProperty({default:Pd},"__esModule",{value:!0}),Fd=function(e){return e&&e.__esModule?e:{default:e}}(v);function xd(){var e=void 0,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(!f(e))return e;d(e)&&(n=u),c(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 f(e){return!t.test(e)}function d(e){return f(e)&&"/"===e.charAt(0)}function c(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:f,isPathAbsolute:d,isSchemeRelative:c,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)}}}xd.__dashjs_factory_name="DefaultURLUtils";var Ud=Fd.default.getSingletonFactory(xd),Bd=Object.defineProperty({default:Ud},"__esModule",{value:!0}),kd=jd(v),Gd=jd(Bd);function jd(e){return e&&e.__esModule?e:{default:e}}function Yd(){var e=void 0,t=[],n=this.context;function r(n,r,i){var a=function(n){var r=void 0;for(r=0;r<t.length;r++){if(t[r].regex.test(n))return t[r].utils}return e}(i||r);return a&&"function"==typeof a[n]?a[n](r,i):e[n](r,i)}return e=(0,Gd.default)(n).getInstance(),{registerUrlRegex:function(e,n){t.push({regex:e,utils:n})},parseBaseUrl:function(e){return r("parseBaseUrl",e)},parseOrigin:function(e){return r("parseOrigin",e)},parseScheme:function(e){return r("parseScheme",e)},isRelative:function(e){return r("isRelative",e)},isPathAbsolute:function(e){return r("isPathAbsolute",e)},isSchemeRelative:function(e){return r("isSchemeRelative",e)},isHTTPURL:function(e){return r("isHTTPURL",e)},isHTTPS:function(e){return r("isHTTPS",e)},removeHostname:function(e){return r("removeHostname",e)},resolve:function(e,t){return r("resolve",e,t)}}}Yd.__dashjs_factory_name="URLUtils";var qd=kd.default.getSingletonFactory(Yd),Hd=Object.defineProperty({default:qd},"__esModule",{value:!0});function Kd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Vd=function e(){Kd(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};Vd.INITIAL_PLAYOUT_START_REASON="initial_playout",Vd.SEEK_START_REASON="seek",Vd.RESUME_FROM_PAUSE_START_REASON="resume",Vd.METRICS_COLLECTION_START_REASON="metrics_collection_start";var zd=function e(){Kd(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};zd.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",zd.REBUFFERING_REASON="rebuffering",zd.USER_REQUEST_STOP_REASON="user_request",zd.END_OF_PERIOD_STOP_REASON="end_of_period",zd.END_OF_CONTENT_STOP_REASON="end_of_content",zd.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",zd.FAILURE_STOP_REASON="failure";var Wd=Vd,Xd=zd,Qd=Object.defineProperty({PlayList:Wd,PlayListTrace:Xd},"__esModule",{value:!0}),Zd=_c(c),$d=_c(p),Jd=_c(E),ec=_c(Se),tc=_c(Dl),nc=_c($l),rc=_c(Ef),ic=_c(If),ac=_c(Df),oc=_c(v),sc=_c(P),uc=_c(B),lc=_c(Cd),fc=_c(ra),dc=_c(Ie),cc=_c(Z),hc=_c(Ld),gc=_c(Hd),pc=_c(ze),mc=_c(me);function _c(e){return e&&e.__esModule?e:{default:e}}function Ec(e){e=e||{};var t=this.context,n=(0,sc.default)(t).getInstance(),r=e.streamInfo,i=e.type,a=e.errHandler,o=e.mimeType,s=e.timelineConverter,u=e.adapter,l=e.manifestModel,f=e.mediaPlayerModel,d=e.fragmentModel,c=e.abrController,h=e.playbackController,g=e.mediaController,p=e.textController,m=e.dashMetrics,_=e.settings,E=e.boxParser,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0,M=void 0,C=void 0;function D(){return i}function O(){S=[],A=null,M=0}function P(e){(e.error||I.setCurrentRepresentation(u.convertDataToRepresentationInfo(e.currentRepresentation)),e.error&&e.error.code!==fc.default.SEGMENTS_UPDATE_FAILED_ERROR_CODE)||h.getStreamController().getActiveStreamInfo().id===r.id&&k()}function L(e){var t=q(e.newQuality);I.setCurrentRepresentation(t),m.pushPlayListTraceMetrics(new Date,Qd.PlayListTrace.REPRESENTATION_SWITCH_STOP_REASON),m.createPlaylistTraceMetrics(t.id,1e3*h.getTime(),h.getPlaybackRate())}function F(e){m.addBufferLevel(i,new Date,1e3*e.bufferLevel);var t=h.getStreamController().getActiveStreamInfo().id;l.getValue().doNotUpdateDVRWindowOnBufferUpdated||r.id!==t||k()}function x(e){m.addBufferState(i,e.state,I.getBufferTarget()),e.state!==Jd.default.BUFFER_EMPTY||h.isSeeking()||m.pushPlayListTraceMetrics(new Date,Qd.PlayListTrace.REBUFFERING_REASON)}function U(e){d.syncExecutedRequestsWithBufferedRange(b.getBuffer().getAllBufferRanges(),r.duration),e.from>h.getTime()&&(M=e.from,C=!0)}function B(e){M=e.quotaExceededTime,C=!0}function k(){var e=r.manifestInfo,t=e.isDynamic,n=s.calcSegmentAvailabilityRange(R.getCurrentRepresentation(),t);m.addDVRInfo(D(),h.getTime(),e,n)}function G(){return b?b.getBuffer():null}function j(){return S}function Y(){return A}function q(e){var t=void 0;return void 0!==e?((0,et.checkInteger)(e),t=R?R.getRepresentationForQuality(e):null):t=R?R.getCurrentRepresentation():null,u.convertDataToRepresentationInfo(t)}function H(e){if(e.sender&&(!u.getIsTextTrack(o)||p.isTextEnabled())&&b&&e.representationId&&!b.appendInitSegment(e.representationId)){var t=N?N.getInitRequest(Y(),R.getCurrentRepresentation()):null;I.processInitRequest(t)}}function K(e){var t=void 0;b.getIsPruningInProgress()||(t=function(e,t){var n=q(),r=!isNaN(e),i=h.getNormalizedTime(),a=r?e:M,o=!1,s=void 0;if(isNaN(a)||D()===Zd.default.FRAGMENTED_TEXT&&!p.isTextEnabled())return null;if(b){var u=b.getRangeAt(a),l=b.getRangeAt(i);if((null!==u||null!==l)&&!r)if(!u||l&&l.start!=u.start&&l.end!=u.end)b.getBuffer().hasDiscontinuitiesAfter(i)&&D()!==Zd.default.FRAGMENTED_TEXT&&(d.removeExecutedRequestsAfterTime(l.end),o=!0)}if(t)a=t.startTime+t.duration/2,s=W(n,a,{timeThreshold:0,ignoreIsFinished:!0});else{var f=r||C||o;for(s=W(n,f?a:void 0,{keepIdx:!f}),C=!1;s&&s.action!==mc.default.ACTION_COMPLETE&&d.isFragmentLoaded(s);)s=W(n)}return s}(e.seekTarget,e.replacement))&&(I.setSeekTarget(NaN),e.replacement||(isNaN(t.startTime+t.duration)||(M=t.startTime+t.duration),t.delayLoadingTime=(new Date).getTime()+I.getTimeToLoadDelay(),I.setTimeToLoadDelay(0))),I.processMediaRequest(t)}function V(e){var i=e.chunk,a=i.bytes,o=i.quality,s=q(o),l=R&&s?R.getRepresentationForQuality(s.quality):null,f=u.getEventsFor(s.mediaInfo),c=u.getEventsFor(s,l);if(f&&f.length>0||c&&c.length>0){var h=function(e,n,r,i){try{for(var a={},o=[],s=r.concat(i),l=0,f=s.length;l<f;l++)a[s[l].schemeIdUri+"/"+s[l].value]=s[l];var d=(0,pc.default)(t).getInstance().parse(e),c=d.getBoxes("emsg");if(!c||0===c.length)return o;for(var h=d.getBox("sidx"),g=!h||isNaN(h.earliest_presentation_time)||isNaN(h.timescale)?n&&!isNaN(n.mediaStartTime)?n.mediaStartTime:0:h.earliest_presentation_time/h.timescale,p=Math.max(g,0),m=R.getCurrentRepresentation(),_=0,E=c.length;_<E;_++){var y=u.getEvent(c[_],a,p,m);y&&o.push(y)}return o}catch(e){return[]}}(a,d.getRequests({state:ec.default.FRAGMENT_MODEL_EXECUTED,quality:o,index:i.index})[0],f,c);n.trigger(uc.default.INBAND_EVENTS,{events:h},{streamId:r.id})}}function z(e){M=e.time,I.setSeekTarget(e.time)}function W(e,t,n){var r=null;if(N){var i=R&&e?R.getRepresentationForQuality(e.quality):null;r=void 0!==t&&void 0!==n?N.getSegmentRequestForTime(Y(),i,t,n):N.getNextSegmentRequest(Y(),i)}return r}return y={initialize:function(v,A){N=(0,lc.default)(t).create({streamInfo:r,type:i,timelineConverter:s,dashMetrics:m,mediaPlayerModel:f,baseURLController:e.baseURLController,errHandler:a,settings:_,boxParser:E,events:uc.default,eventBus:n,errors:fc.default,debug:(0,cc.default)(t).getInstance(),requestModifier:(0,hc.default)(t).getInstance(),dashConstants:$d.default,constants:Zd.default,urlUtils:(0,gc.default)(t).getInstance()}),(T=r.manifestInfo.isDynamic)&&(w=(0,ac.default)(t).create({timelineConverter:s})),N.initialize(T),c.registerStreamType(i,y),R=(0,ic.default)(t).create({streamInfo:r,type:i,abrController:c,dashMetrics:m,playbackController:h,timelineConverter:s,dashConstants:$d.default,events:uc.default,eventBus:n,errors:fc.default}),(b=function(e){var n=null;if(!e)return a.error(new dc.default(fc.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,fc.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null;n=e===Zd.default.VIDEO||e===Zd.default.AUDIO?(0,tc.default)(t).create({streamInfo:r,type:e,mediaPlayerModel:f,manifestModel:l,fragmentModel:d,errHandler:a,mediaController:g,representationController:R,adapter:u,textController:p,abrController:c,playbackController:h,settings:_}):(0,nc.default)(t).create({streamInfo:r,type:e,mimeType:o,mediaPlayerModel:f,manifestModel:l,fragmentModel:d,errHandler:a,mediaController:g,representationController:R,adapter:u,textController:p,abrController:c,playbackController:h,settings:_});return n}(i))&&b.initialize(v),(I=(0,rc.default)(t).create({streamInfo:r,type:i,mimeType:o,adapter:u,dashMetrics:m,mediaPlayerModel:f,fragmentModel:d,abrController:c,playbackController:h,textController:p,mediaController:g,bufferController:b,settings:_})).initialize(A),M=0,C=!1},getStreamId:function(){return r.id},getType:D,isUpdating:function(){return!!R&&R.isUpdating()},getBufferController:function(){return b},getFragmentModel:function(){return d},getScheduleController:function(){return I},getRepresentationController:function(){return R},getRepresentationInfo:q,getBufferLevel:function(){return b?b.getBufferLevel():0},isBufferingCompleted:function(){return!!b&&b.getIsBufferingCompleted()},createBuffer:function(e){return G()||b?b.createBuffer(S,e):null},updateStreamInfo:function(e){r=e,_.get().streaming.useAppendWindow&&b.updateAppendWindow()},getStreamInfo:function(){return r},selectMediaInfo:function(e){e===A||e&&A&&e.type!==A.type||(A=e);var t=u.getRealAdaptation(r,A),n=u.getVoRepresentations(A);if(R){var a=R.getData(),o=c.getTopQualityIndexFor(i,r.id),s=c.getMinAllowedIndexFor(i),l=void 0,f=null;null!==a&&a.id==t.id||i===Zd.default.FRAGMENTED_TEXT?l=c.getQualityFor(i):(f=c.getThroughputHistory().getAverageThroughput(i)||c.getInitialBitrateFor(i),l=c.getQualityForBitrate(A,f)),void 0!==s&&l<s&&(l=s),l>o&&(l=o),N.setMimeType(A?A.mimeType:null),R.updateData(t,n,i,l)}},addMediaInfo:function(e,t){-1===S.indexOf(e)&&S.push(e),t&&this.selectMediaInfo(e)},getLiveStartTime:function(){if(!T)return NaN;if(!w)return NaN;var e=NaN,t=q(),n=w.getLiveEdge(t);if(isNaN(n))return NaN;var i=function(e,t){try{var n=null,i=h.getLiveDelay(),a=isNaN(r.manifestInfo.DVRWindowSize)?i:r.manifestInfo.DVRWindowSize,o=.1*a,s=void 0;if(!isFinite(a)||W(t,e-a+o,{ignoreIsFinished:!0}))for(;!n&&i<=a;)(n=W(t,s=e-i,{ignoreIsFinished:!0}))||(i+=1);return n&&h.setLiveDelay(i,!0),v.debug("live edge: "+e+", live delay: "+i+", live target: "+s),n}catch(e){return null}}(n,t);return i&&(e=_.get().streaming.lowLatencyEnabled?i.duration<f.getLiveDelay()?i.startTime:i.startTime+i.duration-f.getLiveDelay():i.startTime),e},switchTrackAsked:function(){I.switchTrackAsked()},getMediaInfoArr:j,getMediaInfo:Y,getMediaSource:function(){return b.getMediaSource()},setMediaSource:function(e){b.setMediaSource(e,j())},dischargePreBuffer:function(){b.dischargePreBuffer()},getBuffer:G,setBuffer:function(e){b.setBuffer(e)},setBufferingTime:function(e){M=e},resetIndexHandler:function(){N&&N.resetIndex()},getInitRequest:function(e){(0,et.checkInteger)(e);var t=R?R.getRepresentationForQuality(e):null;return N?N.getInitRequest(Y(),t):null},getFragmentRequest:W,finalisePlayList:function(e,t){m.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=q(),t=R&&e?R.getRepresentationForQuality(e.quality):null;return N.getNextSegmentRequestIdempotent(Y(),t)},reset:function(e,t){N&&N.reset(),b&&(b.reset(e,t),b=null),I&&(I.reset(),I=null),R&&(R.reset(),R=null),w&&(w.reset(),w=null),c&&!t&&c.unRegisterStreamType(i),n.off(uc.default.DATA_UPDATE_COMPLETED,P,y),n.off(uc.default.QUALITY_CHANGE_REQUESTED,L,y),n.off(uc.default.INIT_FRAGMENT_NEEDED,H,y),n.off(uc.default.MEDIA_FRAGMENT_NEEDED,K,y),n.off(uc.default.MEDIA_FRAGMENT_LOADED,V,y),n.off(uc.default.BUFFER_LEVEL_UPDATED,F,y),n.off(uc.default.BUFFER_LEVEL_STATE_CHANGED,x,y),n.off(uc.default.BUFFER_CLEARED,U,y),n.off(uc.default.SEEK_TARGET,z,y),O(),i=null,r=null}},v=(0,cc.default)(t).getInstance().getLogger(y),O(),n.on(uc.default.DATA_UPDATE_COMPLETED,P,y,{priority:sc.default.EVENT_PRIORITY_HIGH}),n.on(uc.default.QUALITY_CHANGE_REQUESTED,L,y),n.on(uc.default.INIT_FRAGMENT_NEEDED,H,y),n.on(uc.default.MEDIA_FRAGMENT_NEEDED,K,y),n.on(uc.default.MEDIA_FRAGMENT_LOADED,V,y),n.on(uc.default.BUFFER_LEVEL_UPDATED,F,y),n.on(uc.default.BUFFER_LEVEL_STATE_CHANGED,x,y),n.on(uc.default.BUFFER_CLEARED,U,y),n.on(uc.default.QUOTA_EXCEEDED,B,y),n.on(uc.default.SEEK_TARGET,z,y),y}Ec.__dashjs_factory_name="StreamProcessor";var yc=oc.default.getClassFactory(Ec),vc=Object.defineProperty({default:yc},"__esModule",{value:!0});var Tc=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},Ac=Object.defineProperty({default:Tc},"__esModule",{value:!0}),Sc=function(e){return e&&e.__esModule?e:{default:e}}(v);function bc(e){var t=(e=e||{}).requestModifier;return{load:function(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&&(i=t.modifyRequestHeader(i)),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},abort:function(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}}}bc.__dashjs_factory_name="XHRLoader";var Ic=Sc.default.getClassFactory(bc),Rc=Object.defineProperty({default:Ic},"__esModule",{value:!0}),wc="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},Nc=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Mc=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return Nc(e,null,[{key:"mixin",value:function(t,n,r){var i=void 0,a={};if(t)for(var o in n)n.hasOwnProperty(o)&&(i=n[o],o in t&&(t[o]===i||o in a&&a[o]===i)||("object"===wc(t[o])&&null!==t[o]?t[o]=e.mixin(t[o],i,r):t[o]=r(i)));return t}},{key:"clone",value:function(t){if(!t||"object"!==(void 0===t?"undefined":wc(t)))return t;var n=void 0;if(t instanceof Array){n=[];for(var r=0,i=t.length;r<i;++r)r in t&&n.push(e.clone(t[r]))}else n={};return e.mixin(n,t,e.clone)}},{key:"addAditionalQueryParameterToUrl",value:function(e,t){try{if(!t||0===t.length)return e;var n=new URL(e);return t.forEach((function(e){e.key&&e.value&&n.searchParams.set(e.key,e.value)})),n.href}catch(t){return e}}},{key:"parseHttpHeaders",value:function(e){var t={};if(!e)return t;for(var n=e.trim().split("\r\n"),r=0,i=n.length;r<i;r++){var a=n[r],o=a.indexOf(": ");o>0&&(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;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t|=0}return t}}]),e}(),Cc=Object.defineProperty({default:Mc},"__esModule",{value:!0}),Dc="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},Oc=xc(v),Pc=xc(Cc),Lc=xc(Z),Fc=xc(c);function xc(e){return e&&e.__esModule?e:{default:e}}function Uc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bc(){var e,t,n={debug:{logLevel:Lc.default.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{metricsMaxListDepth:1e3,abandonLoadTimeout:1e4,liveDelayFragmentCount:NaN,liveDelay:null,scheduleWhilePaused:!0,fastSwitchEnabled:!1,flushBufferAtTrackSwitch:!1,calcSegmentAvailabilityRangeFromTimeline:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,stableBufferTime:12,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,longFormContentDurationThreshold:600,wallclockTimeUpdateInterval:50,lowLatencyEnabled:!1,keepProtectionMediaKeys:!1,useManifestDateHeaderTimeSource:!0,useSuggestedPresentationDelay:!0,useAppendWindow:!0,manifestUpdateRetryInterval:100,stallThreshold:.5,filterUnsupportedEssentialProperties:!0,eventControllerRefreshDelay:100,utcSynchronization:{backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"http://time.akamai.com/?iso&ms"}},liveCatchup:{minDrift:.02,maxDrift:0,playbackRate:.5,latencyThreshold:60,playbackBufferMin:.5,enabled:!1,mode:Fc.default.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},cacheLoadThresholds:{video:50,audio:5},trackSwitchMode:{audio:Fc.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:Fc.default.TRACK_SWITCH_MODE_NEVER_REPLACE},selectionModeForInitialTrack:Fc.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE,fragmentRequestTimeout:0,retryIntervals:(e={},Uc(e,ce.HTTPRequest.MPD_TYPE,500),Uc(e,ce.HTTPRequest.XLINK_EXPANSION_TYPE,500),Uc(e,ce.HTTPRequest.MEDIA_SEGMENT_TYPE,1e3),Uc(e,ce.HTTPRequest.INIT_SEGMENT_TYPE,1e3),Uc(e,ce.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,1e3),Uc(e,ce.HTTPRequest.INDEX_SEGMENT_TYPE,1e3),Uc(e,ce.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,1e3),Uc(e,ce.HTTPRequest.OTHER_TYPE,1e3),Uc(e,"lowLatencyReductionFactor",10),e),retryAttempts:(t={},Uc(t,ce.HTTPRequest.MPD_TYPE,3),Uc(t,ce.HTTPRequest.XLINK_EXPANSION_TYPE,1),Uc(t,ce.HTTPRequest.MEDIA_SEGMENT_TYPE,3),Uc(t,ce.HTTPRequest.INIT_SEGMENT_TYPE,3),Uc(t,ce.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),Uc(t,ce.HTTPRequest.INDEX_SEGMENT_TYPE,3),Uc(t,ce.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,3),Uc(t,ce.HTTPRequest.OTHER_TYPE,3),Uc(t,"lowLatencyMultiplyFactor",5),t),abr:{movingAverageMethod:Fc.default.MOVING_AVERAGE_SLIDING_WINDOW,ABRStrategy:Fc.default.ABR_STRATEGY_DYNAMIC,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:Fc.default.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA},cmcd:{enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:Fc.default.CMCD_MODE_QUERY}}},r=Pc.default.clone(n);return{get:function(){return r},update:function(e){"object"===(void 0===e?"undefined":Dc(e))&&function e(t,n,r){for(var i in t)t.hasOwnProperty(i)&&n.hasOwnProperty(i)&&("object"===Dc(t[i])&&null!==t[i]?e(t[i],n[i],r.slice()+i+"."):n[i]=Pc.default.clone(t[i]))}(e,r,"")},reset:function(){r=Pc.default.clone(n)}}}Bc.__dashjs_factory_name="Settings";var kc=Oc.default.getSingletonFactory(Bc),Gc=Object.defineProperty({default:kc},"__esModule",{value:!0}),jc=Hc(v),Yc=Hc(Gc),qc=Hc(c);function Hc(e){return e&&e.__esModule?e:{default:e}}function Kc(e){e=e||{};var t=this.context,n=e.requestModifier,r=e.boxParser,i=(0,Yc.default)(t).getInstance();function a(e,t){e.reader.read().then(t).catch((function(t){e.onerror&&200===e.response.status&&e.onerror(t)}))}function o(e,t,n,r,i){switch(e){case qc.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING:return function(e,t){try{var n,r;n=e.filter((function(t,n){return n>0&&n<e.length-1})),r=t.filter((function(e,n){return n>0&&n<t.length-1}));var i=0;if(n.length>1){for(var a=0;a<n.length;a++)if(n[a]&&r[a]){var o=r[a].ts-n[a].ts;i+=o}return i}return null}catch(e){return null}}(t,n);case qc.default.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA:default:return s(r,i)}}function s(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<r?o:0}})),n}return null}catch(e){return null}}return{load:function(e){var t=new Date,s=e.request,u=new Headers;if(s.range&&u.append("Range","bytes="+s.range),e.headers)for(var l in e.headers){var f=e.headers[l];f&&u.append(l,f)}s.requestStartDate||(s.requestStartDate=t),n&&n.modifyRequestHeader({setRequestHeader:function(e,t){u.append(e,t)}});var d=void 0;"function"==typeof window.AbortController&&(d=new AbortController,e.abortController=d,d.signal.onabort=e.onabort);var c={method:e.method,headers:u,credentials:e.withCredentials?"include":void 0,signal:d?d.signal:void 0};fetch(e.url,c).then((function(t){e.response||(e.response={}),e.response.status=t.status,e.response.statusText=t.statusText,e.response.responseURL=t.url,t.ok||e.onerror();var n="",s=!0,u=!1,l=void 0;try{for(var f,d=t.headers.keys()[Symbol.iterator]();!(s=(f=d.next()).done);s=!0){var c=f.value;n+=c+": "+t.headers.get(c)+"\r\n"}}catch(e){u=!0,l=e}finally{try{!s&&d.return&&d.return()}finally{if(u)throw l}}if(e.response.responseHeaders=n,!t.body)return t.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=parseInt(t.headers.get("Content-Length"),10),g=0,p=!1,m=new Uint8Array,_=0;e.reader=t.body.getReader();var E=[],y=[],v=[],T=!0,A=i.get().streaming.abr.fetchThroughputCalculationMode;a(e,(function t(n){var i=n.value;if(n.done)return m&&(e.progress({loaded:g,total:isNaN(h)?g:h,lengthComputable:!0,time:o(A,y,v,E,g),stream:!0}),e.response.response=m.buffer),e.onload(),void e.onend();if(i&&i.length>0){if(m=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}(m,i),g+=i.length,E.push({ts:Date.now(),bytes:i.length}),A===qc.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&T)r.findLastTopIsoBoxCompleted(["moof"],m,_).found&&(T=!1,y.push({ts:performance.now(),bytes:i.length}));var s=r.findLastTopIsoBoxCompleted(["moov","mdat"],m,_);if(s.found){var u=s.lastCompletedOffset+s.size;A===qc.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&(T=!0,v.push({ts:performance.now(),bytes:m.length}));var l=void 0;u===m.length?(l=m,m=new Uint8Array):(l=new Uint8Array(m.subarray(0,u)),m=m.subarray(u)),e.progress({data:l.buffer,lengthComputable:!1,noTrace:!0}),_=0}else _=s.lastCompletedOffset,p||(e.progress({lengthComputable:!1,noTrace:!0}),p=!0)}a(e,t)}))})).catch((function(t){e.onerror&&e.onerror(t)}))},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:o}}Kc.__dashjs_factory_name="FetchLoader";var Vc=jc.default.getClassFactory(Kc),zc=Object.defineProperty({default:Vc},"__esModule",{value:!0});var Wc=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",e.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",e.CMCD_DATA_GENERATED="cmcdDataGenerated",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(b).default)),Xc=Object.defineProperty({default:Wc},"__esModule",{value:!0}),Qc=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Zc=function(e){return e&&e.__esModule?e:{default:e}}(p);var $c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.codecs=null,this.codecPrivateData=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.segmentAvailabilityRange=null,this.availableSegmentsNumber=0,this.bandwidth=NaN,this.width=NaN,this.height=NaN,this.scanType=null,this.maxPlayoutRate=NaN,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0}return Qc(e,[{key:"hasInitialization",value:function(){return null!==this.initialization||null!==this.range}},{key:"hasSegments",value:function(){return this.segmentInfoType!==Zc.default.BASE_URL&&this.segmentInfoType!==Zc.default.SEGMENT_BASE&&!this.indexRange}}]),e}(),Jc=Object.defineProperty({default:$c},"__esModule",{value:!0});var eh=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.period=null,this.index=-1,this.type=null},th=Object.defineProperty({default:eh},"__esModule",{value:!0});var nh=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null};nh.DEFAULT_ID="defaultId";var rh=nh,ih=Object.defineProperty({default:rh},"__esModule",{value:!0});var ah=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.publishTime=null,this.minimumUpdatePeriod=NaN,this.mediaPresentationDuration=NaN},oh=Object.defineProperty({default:ah},"__esModule",{value:!0});var sh=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=""},uh=Object.defineProperty({default:sh},"__esModule",{value:!0});var lh=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN},fh=Object.defineProperty({default:lh},"__esModule",{value:!0});var dh=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=n||t||"",this.dvb_priority=r||1,this.dvb_weight=i||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0};dh.DEFAULT_DVB_PRIORITY=1,dh.DEFAULT_DVB_WEIGHT=1;var ch=dh,hh=Object.defineProperty({default:ch},"__esModule",{value:!0});var gh=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0},ph=Object.defineProperty({default:gh},"__esModule",{value:!0}),mh=Array.isArray,_h=Object.keys,Eh=Object.prototype.hasOwnProperty,yh=Th(v),vh=Th((function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var r,i,a,o=mh(t),s=mh(n);if(o&&s){if((i=t.length)!=n.length)return!1;for(r=i;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(o!=s)return!1;var u=t instanceof Date,l=n instanceof Date;if(u!=l)return!1;if(u&&l)return t.getTime()==n.getTime();var f=t instanceof RegExp,d=n instanceof RegExp;if(f!=d)return!1;if(f&&d)return t.toString()==n.toString();var c=_h(t);if((i=c.length)!==_h(n).length)return!1;for(r=i;0!=r--;)if(!Eh.call(n,c[r]))return!1;for(r=i;0!=r--;)if(!e(t[a=c[r]],n[a]))return!1;return!0}return t!=t&&n!=n}));function Th(e){return e&&e.__esModule?e:{default:e}}function Ah(){return{areEqual:function(e,t){return(0,vh.default)(e,t)}}}Ah.__dashjs_factory_name="ObjectUtils";var Sh=yh.default.getSingletonFactory(Ah),bh=Object.defineProperty({default:Sh},"__esModule",{value:!0});var Ih=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=""},Rh=Object.defineProperty({default:Ih},"__esModule",{value:!0}),wh=u((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.THUMBNAILS_SCHEME_ID_URIS=void 0;var n=d(c),r=d(p),i=d(v),a=d(Rh),o=d(Hd),s=d(B),u=d(ze),l=d(Rc),f=d(Cd);function d(e){return e&&e.__esModule?e:{default:e}}var h=t.THUMBNAILS_SCHEME_ID_URIS=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];function g(e){var t,i=this.context,d=e.adapter,c=e.baseURLController,g=e.streamInfo,p=e.timelineConverter,m=e.debug,_=e.eventBus,E=e.events,y=e.dashConstants,v=(0,o.default)(i).getInstance(),T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0;function w(){M(),I=(0,l.default)(i).create({}),R=(0,u.default)(i).getInstance(),(A=(0,f.default)(i).create({streamInfo:g,timelineConverter:p,baseURLController:c,debug:m,eventBus:_,events:E,dashConstants:y,urlUtils:v})).initialize(!!d&&d.getIsDynamic()),function(){if(!g||!d)return;if(!(b=d.getMediaInfoForType(g,n.default.IMAGE)))return;var e=d.getVoRepresentations(b);e&&e.length>0&&e.forEach((function(e){(e.segmentInfoType===r.default.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===r.default.SEGMENT_TIMELINE)&&N(e),e.segmentInfoType===r.default.SEGMENT_BASE&&N(e,!0)}));T.length>0&&(T.sort((function(e,t){return e.bitrate-t.bitrate})),S=T.length-1)}()}function N(e,t){var r=new a.default;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(h.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?_.trigger(s.default.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,{streamId:g.id,mediaType:n.default.IMAGE,mimeType:b.mimeType,representation:e,callback:function(e,t,n,i){var a=[];n=function(e,t){var n,r=[],i=0,a=void 0,o=void 0,s=void 0;for(a=0,n=e.length;a<n;a++)o=e[a],(s=(0,Hf.getTimeBasedSegment)(p,d.getIsDynamic(),t,o.startTime,o.duration,o.timescale,o.media,o.mediaRange,i))&&(r.push(s),s=null,i++);return r}(n,i),r.segmentDuration=n[0].duration,r.readThumbnail=function(e,t){var r=null;a.some((function(t){if(t.start<=e&&t.end>e)return r=t.url,!0})),r?t(r):n.some((function(n){if(n.mediaStartTime<=e&&n.mediaStartTime+n.duration>e){var r=c.resolve(i.path);return I.load({method:"get",url:r.url,request:{range:n.mediaRange,responseType:"arraybuffer"},onload:function(e){var r=R.getSamplesInfo(e.target.response),i=new Blob([e.target.response.slice(r.sampleList[0].offset,r.sampleList[0].offset+r.sampleList[0].size)],{type:"image/jpeg"}),o=window.URL.createObjectURL(i);a.push({start:n.mediaStartTime,end:n.mediaStartTime+n.duration,url:o}),t&&t(o)}}),!0}}))}}}):(r.startNumber=e.startNumber,r.segmentDuration=e.segmentDuration,r.timescale=e.timescale,r.templateUrl=function(e){var t=v.isRelative(e.media)?v.resolve(e.media,c.resolve(e.path).url):e.media;if(!t)return"";return(0,Hf.replaceIDForTemplate)(t,e.id)}(e)),r.tilesHor>0&&r.tilesVert>0&&(r.widthPerTile=r.width/r.tilesHor,r.heightPerTile=r.height/r.tilesVert,T.push(r))}function M(){T=[],S=-1,b=null}return t={initialize:w,getTracks:function(){return T},reset:M,setTrackByIndex:function(e){T&&0!==T.length&&(e>=T.length&&(e=T.length-1),S=e)},getCurrentTrack:function(){return S<0?null:T[S]},getCurrentTrackIndex:function(){return S},getThumbnailRequestForTime:function(e){for(var t=void 0,n=d.getVoRepresentations(b),r=0;r<n.length;r++)if(T[S].id===n[r].id){t=n[r];break}return A.getSegmentRequestForTime(b,t,e)}},w(),t}g.__dashjs_factory_name="ThumbnailTracks",t.default=i.default.getClassFactory(g)})),Nh=Hh(c),Mh=Hh(p),Ch=Hh(Jc),Dh=Hh(th),Oh=Hh(ih),Ph=Hh(oh),Lh=Hh(uh),Fh=Hh(fh),xh=Hh(hh),Uh=Hh(ph),Bh=Hh(bh),kh=Hh(Hd),Gh=Hh(v),jh=Hh(Z),Yh=Hh(Ie),qh=Hh(ra);function Hh(e){return e&&e.__esModule?e:{default:e}}function Kh(){var e=void 0,t=void 0,n=void 0,r=void 0,i=this.context,a=(0,kh.default)(i).getInstance(),o=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function s(e,t){var n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=!1,l=!1;if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.hasOwnProperty("ContentComponent_asArray")&&(a=e.ContentComponent_asArray),o=t!==Nh.default.TEXT?new RegExp(t):new RegExp("(vtt|ttml)"),e.Representation_asArray&&e.Representation_asArray.length&&e.Representation_asArray.length>0){var f=E(e.Representation_asArray[0]);if(f&&f.length>0&&wh.THUMBNAILS_SCHEME_ID_URIS.indexOf(f[0].schemeIdUri)>=0)return t===Nh.default.IMAGE;if(e.Representation_asArray[0].hasOwnProperty(Mh.default.CODECS)&&(0===(s=e.Representation_asArray[0].codecs).search(Nh.default.STPP)||0===s.search(Nh.default.WVTT)))return t===Nh.default.FRAGMENTED_TEXT}if(a){if(a.length>1)return t===Nh.default.MUXED;a[0]&&a[0].contentType===t&&(u=!0,l=!0)}if(e.hasOwnProperty(Mh.default.MIME_TYPE)&&(u=o.test(e.mimeType),l=!0),!l)for(n=0,r=e.Representation_asArray&&e.Representation_asArray.length?e.Representation_asArray.length:0;!l&&n<r;)(i=e.Representation_asArray[n]).hasOwnProperty(Mh.default.MIME_TYPE)&&(u=o.test(i.mimeType),l=!0),n++;return u}function u(e){return s(e,Nh.default.AUDIO)}function l(e){return s(e,Nh.default.VIDEO)}function f(e){return s(e,Nh.default.FRAGMENTED_TEXT)}function d(e){return s(e,Nh.default.IMAGE)}function c(e){return"text/vtt"===e||"application/ttml+xml"===e}function h(){return function(e,t){return e.bandwidth-t.bandwidth}}function g(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort((function(e,t){return e.bandwidth-t.bandwidth})),e}function p(e,t){return e&&e.Period_asArray&&o(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function m(e){return e&&e.Period_asArray?e.Period_asArray:[]}function _(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===Mh.default.DYNAMIC),t}function E(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 y(e,t){if(!e)throw new Error("Period cannot be null or undefined");var n=Oh.default.DEFAULT_ID+"_"+t;return e.hasOwnProperty(Mh.default.ID)&&e.id.length>0&&"__proto__"!==e.id&&(n=e.id),n}function v(e,t){var n=[],r=void 0;if(!e)return n;for(r=0;r<e.length;r++){var i=new Uh.default;if(i.timescale=1,i.representation=t,!e[r].hasOwnProperty(Nh.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");i.schemeIdUri=e[r].schemeIdUri,e[r].hasOwnProperty(Mh.default.TIMESCALE)&&(i.timescale=e[r].timescale),e[r].hasOwnProperty(Mh.default.VALUE)&&(i.value=e[r].value),n.push(i)}return n}function T(e){var t=[],n=e.BaseURL_asArray||[e.baseUri],r=!1;return n.some((function(n){if(n){var i=new xh.default,o=n.__text||n;return a.isRelative(o)&&(r=!0,e.baseUri&&(o=a.resolve(o,e.baseUri))),i.url=o,n.hasOwnProperty(Mh.default.SERVICE_LOCATION)&&n.serviceLocation.length?i.serviceLocation=n.serviceLocation:i.serviceLocation=o,n.hasOwnProperty(Mh.default.DVB_PRIORITY)&&(i.dvb_priority=n[Mh.default.DVB_PRIORITY]),n.hasOwnProperty(Mh.default.DVB_WEIGHT)&&(i.dvb_weight=n[Mh.default.DVB_WEIGHT]),n.hasOwnProperty(Mh.default.AVAILABILITY_TIME_OFFSET)&&(i.availabilityTimeOffset=n[Mh.default.AVAILABILITY_TIME_OFFSET]),n.hasOwnProperty(Mh.default.AVAILABILITY_TIME_COMPLETE)&&(i.availabilityTimeComplete="false"!==n[Mh.default.AVAILABILITY_TIME_COMPLETE]),t.push(i),r}})),t}return e={getIsTypeOf:s,getIsTextTrack:c,getLanguageForAdaptation:function(e){var t="";return e&&e.hasOwnProperty(Mh.default.LANG)&&(t=e.lang.replace(/[^A-Za-z0-9-]/g,"")),t},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(Mh.default.VIEWPOINT)?e.Viewpoint:null},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(Mh.default.ROLE_ASARRAY)?e.Role_asArray:[]},getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(Mh.default.ACCESSIBILITY_ASARRAY)?e.Accessibility_asArray:[]},getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(Mh.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(Mh.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAdaptationForIndex:function(e,t,n){var r=p(t,n);return r.length>0&&o(e)?r[e]:null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;for(var r=p(t,n),a=0;a<r.length;a++){if((0,Bh.default)(i).getInstance().areEqual(r[a],e))return a}return-1},getAdaptationForId:function(e,t,n){var r,i=p(t,n),a=void 0;for(a=0,r=i.length;a<r;a++)if(i[a].hasOwnProperty(Mh.default.ID)&&i[a].id===e)return i[a];return null},getAdaptationsForType:function(e,t,n){var r,i=p(e,t),a=void 0,o=[];for(a=0,r=i.length;a<r;a++)s(i[a],n)&&o.push(g(i[a]));return o},getRealPeriods:m,getRealPeriodForIndex:function(e,t){var n=m(t);return n.length>0&&o(e)?n[e]:null},getCodec:function(e,t,n){var r=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var i=o(t)&&t>=0&&t<e.Representation_asArray.length?e.Representation_asArray[t]:e.Representation_asArray[0];i&&(r=i.mimeType+';codecs="'+i.codecs+'"',n&&void 0!==i.width&&(r+=';width="'+i.width+'";height="'+i.height+'"'))}return r&&(r=r.replace(/\sprofiles=[^;]*/g,"")),r},getMimeType:function(e){return e&&e.Representation_asArray&&e.Representation_asArray.length>0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(Mh.default.CENC_DEFAULT_KID)?e[Mh.default.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],n=0;n<e.Label_asArray.length;n++)t.push({lang:e.Label_asArray[n].lang,text:e.Label_asArray[n].__text||e.Label_asArray[n]});return t},getContentProtectionData:function(e){return e&&e.hasOwnProperty(Mh.default.CONTENTPROTECTION_ASARRAY)&&0!==e.ContentProtection_asArray.length?e.ContentProtection_asArray:null},getIsDynamic:_,getId:function(e){return e&&e[Mh.default.ID]||null},hasProfile:function(e,t){var n=!1;return e&&e.profiles&&e.profiles.length>0&&(n=-1!==e.profiles.indexOf(t)),n},getDuration:function(e){return e&&e.hasOwnProperty(Mh.default.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(Mh.default.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(Mh.default.PUBLISH_TIME)?new Date(e[Mh.default.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=g(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&&o(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,n,r,i,a,s=[],u=function(e){if(e&&e.period&&o(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&o(e.index))return g(t.AdaptationSet_asArray[e.index])}}(e),l=void 0,f=void 0;if(u&&u.Representation_asArray){if(e&&e.period&&o(e.period.index)){var d=T(e.period.mpd.manifest);d&&(f=d[0])}for(var h=0,p=u.Representation_asArray.length;h<p;++h){var m=u.Representation_asArray[h],_=new Ch.default;if(_.index=h,_.adaptation=e,m.hasOwnProperty(Mh.default.ID)&&(_.id=m.id),m.hasOwnProperty(Mh.default.CODECS)&&(_.codecs=m.codecs),m.hasOwnProperty(Mh.default.CODEC_PRIVATE_DATA)&&(_.codecPrivateData=m.codecPrivateData),m.hasOwnProperty(Mh.default.BANDWITH)&&(_.bandwidth=m.bandwidth),m.hasOwnProperty(Mh.default.WIDTH)&&(_.width=m.width),m.hasOwnProperty(Mh.default.HEIGHT)&&(_.height=m.height),m.hasOwnProperty(Mh.default.SCAN_TYPE)&&(_.scanType=m.scanType),m.hasOwnProperty(Mh.default.MAX_PLAYOUT_RATE)&&(_.maxPlayoutRate=m.maxPlayoutRate),m.hasOwnProperty(Mh.default.SEGMENT_BASE)?(l=m.SegmentBase,_.segmentInfoType=Mh.default.SEGMENT_BASE):m.hasOwnProperty(Mh.default.SEGMENT_LIST)?(l=m.SegmentList).hasOwnProperty(Mh.default.SEGMENT_TIMELINE)?_.segmentInfoType=Mh.default.SEGMENT_TIMELINE:_.segmentInfoType=Mh.default.SEGMENT_LIST:m.hasOwnProperty(Mh.default.SEGMENT_TEMPLATE)?((l=m.SegmentTemplate).hasOwnProperty(Mh.default.SEGMENT_TIMELINE)?_.segmentInfoType=Mh.default.SEGMENT_TIMELINE:_.segmentInfoType=Mh.default.SEGMENT_TEMPLATE,l.hasOwnProperty(Mh.default.INITIALIZATION_MINUS)&&(_.initialization=l.initialization.split("$Bandwidth$").join(m.bandwidth).split("$RepresentationID$").join(m.id))):_.segmentInfoType=Mh.default.BASE_URL,_.essentialProperties=E(m),l){if(l.hasOwnProperty(Mh.default.INITIALIZATION)){var y=l.Initialization;y.hasOwnProperty(Mh.default.SOURCE_URL)&&(_.initialization=y.sourceURL),y.hasOwnProperty(Mh.default.RANGE)&&(_.range=y.range)}else m.hasOwnProperty(Mh.default.MIME_TYPE)&&c(m.mimeType)&&(_.range=0);l.hasOwnProperty(Mh.default.TIMESCALE)&&(_.timescale=l.timescale),l.hasOwnProperty(Mh.default.DURATION)?_.segmentDuration=l.duration/_.timescale:m.hasOwnProperty(Mh.default.SEGMENT_TEMPLATE)&&(l=m.SegmentTemplate).hasOwnProperty(Mh.default.SEGMENT_TIMELINE)&&(_.segmentDuration=(r=l.SegmentTimeline,i=void 0,a=void 0,i=r.S_asArray[0],a=r.S_asArray[1],(i.hasOwnProperty("d")?i.d:a.t-i.t)/_.timescale)),l.hasOwnProperty(Mh.default.MEDIA)&&(_.media=l.media),l.hasOwnProperty(Mh.default.START_NUMBER)&&(_.startNumber=l.startNumber),l.hasOwnProperty(Mh.default.INDEX_RANGE)&&(_.indexRange=l.indexRange),l.hasOwnProperty(Mh.default.PRESENTATION_TIME_OFFSET)&&(_.presentationTimeOffset=l.presentationTimeOffset/_.timescale),l.hasOwnProperty(Mh.default.AVAILABILITY_TIME_OFFSET)?_.availabilityTimeOffset=l.availabilityTimeOffset:f&&void 0!==f.availabilityTimeOffset&&(_.availabilityTimeOffset=f.availabilityTimeOffset),l.hasOwnProperty(Mh.default.AVAILABILITY_TIME_COMPLETE)?_.availabilityTimeComplete="false"!==l.availabilityTimeComplete:f&&void 0!==f.availabilityTimeComplete&&(_.availabilityTimeComplete=f.availabilityTimeComplete)}_.MSETimeOffset=(n=void 0,void 0,n=(t=_).presentationTimeOffset,t.adaptation.period.start-n),_.path=[e.period.index,e.index,h],s.push(_)}}return s},getAdaptationsForPeriod:function(e){var t=e&&o(e.index)?e.mpd.manifest.Period_asArray[e.index]:null,n=[],r=void 0,i=void 0,a=void 0;if(t&&t.AdaptationSet_asArray)for(a=0;a<t.AdaptationSet_asArray.length;a++)i=t.AdaptationSet_asArray[a],r=new Dh.default,i.hasOwnProperty(Mh.default.ID)&&(r.id=i.id),r.index=a,r.period=e,s(i,Nh.default.MUXED)?r.type=Nh.default.MUXED:u(i)?r.type=Nh.default.AUDIO:l(i)?r.type=Nh.default.VIDEO:f(i)?r.type=Nh.default.FRAGMENTED_TEXT:d(i)?r.type=Nh.default.IMAGE:r.type=Nh.default.TEXT,n.push(r);return n},getRegularPeriods:function(e){var r,i=!!e&&_(e.manifest),a=[],o=null,s=null,u=null,l=null,f=void 0;for(f=0,r=e&&e.manifest&&e.manifest.Period_asArray?e.manifest.Period_asArray.length:0;f<r;f++)(s=e.manifest.Period_asArray[f]).hasOwnProperty(Mh.default.START)?(l=new Oh.default).start=s.start:null!==o&&o.hasOwnProperty(Mh.default.DURATION)&&null!==u?(l=new Oh.default).start=parseFloat((u.start+u.duration).toFixed(5)):0!==f||i||((l=new Oh.default).start=0),null!==u&&isNaN(u.duration)&&(null!==l?u.duration=parseFloat((l.start-u.start).toFixed(5)):t.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),null!==l&&(l.id=y(s,f),l.index=f,l.mpd=e,s.hasOwnProperty(Mh.default.DURATION)&&(l.duration=s.duration),a.push(l),o=s,u=l),s=null,l=null;return 0===a.length||null!==u&&isNaN(u.duration)&&(u.duration=parseFloat((function(e){!function(){if(!n||!n.hasOwnProperty("error"))throw new Error(Nh.default.MISSING_CONFIG_ERROR)}();var t=_(e.mpd.manifest),r=void 0;e.mpd.manifest.mediaPresentationDuration?r=e.mpd.manifest.mediaPresentationDuration:e.duration?r=e.duration:t?r=Number.POSITIVE_INFINITY:n.error(new Yh.default(qh.default.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",e));return r}(u)-u.start).toFixed(5))),a},getMpd:function(e){var t=new Ph.default;return e&&(t.manifest=e,e.hasOwnProperty(Mh.default.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(Mh.default.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(Mh.default.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(Mh.default.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(Mh.default.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(Mh.default.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(Mh.default.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration),e.hasOwnProperty(Mh.default.PUBLISH_TIME)&&(t.publishTime=new Date(e.publishTime))),t},getEventsForPeriod:function(e){var t=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,n=t?t.Period_asArray:null,i=n&&e&&o(e.index)?n[e.index].EventStream_asArray:null,a=[],s=void 0,u=void 0;if(i)for(s=0;s<i.length;s++){var l=new Uh.default;if(l.period=e,l.timescale=1,!i[s].hasOwnProperty(Nh.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(l.schemeIdUri=i[s][Nh.default.SCHEME_ID_URI],i[s].hasOwnProperty(Mh.default.TIMESCALE)&&(l.timescale=i[s][Mh.default.TIMESCALE]),i[s].hasOwnProperty(Mh.default.VALUE)&&(l.value=i[s][Mh.default.VALUE]),i[s].hasOwnProperty(Mh.default.PRESENTATION_TIME_OFFSET)&&(l.presentationTimeOffset=i[s][Mh.default.PRESENTATION_TIME_OFFSET]),u=0;i[s].Event_asArray&&u<i[s].Event_asArray.length;u++){var f=i[s].Event_asArray[u],d=new Fh.default;if(d.presentationTime=0,d.eventStream=l,f.hasOwnProperty(Mh.default.PRESENTATION_TIME)){d.presentationTime=f.presentationTime;var c=l.presentationTimeOffset?l.presentationTimeOffset/l.timescale:0;d.calculatedPresentationTime=d.presentationTime/l.timescale+e.start-c}f.hasOwnProperty(Mh.default.DURATION)&&(d.duration=f.duration/l.timescale),f.hasOwnProperty(Mh.default.ID)&&(d.id=f.id),f.Signal&&f.Signal.Binary?d.messageData=r.decodeArray(f.Signal.Binary.toString()):d.messageData=f.messageData||f.__text,a.push(d)}}return a},getEssentialPropertiesForRepresentation:E,getEventStreamForAdaptationSet:function(e,t){var n=void 0,r=void 0,i=void 0;return e&&e.Period_asArray&&t&&t.period&&o(t.period.index)&&(r=e.Period_asArray[t.period.index])&&r.AdaptationSet_asArray&&o(t.index)&&(i=r.AdaptationSet_asArray[t.index])&&(n=i.InbandEventStream_asArray),v(n,null)},getEventStreamForRepresentation:function(e,t){var n=void 0,r=void 0,i=void 0,a=void 0;return e&&e.Period_asArray&&t&&t.adaptation&&t.adaptation.period&&o(t.adaptation.period.index)&&(r=e.Period_asArray[t.adaptation.period.index])&&r.AdaptationSet_asArray&&o(t.adaptation.index)&&(i=r.AdaptationSet_asArray[t.adaptation.index])&&i.Representation_asArray&&o(t.index)&&(a=i.Representation_asArray[t.index])&&(n=a.InbandEventStream_asArray),v(n,t)},getUTCTimingSources:function(e){var t=_(e),n=!!e&&e.hasOwnProperty(Mh.default.AVAILABILITY_START_TIME),r=e?e.UTCTiming_asArray:null,i=[];return(t||n)&&r&&r.forEach((function(e){var t=new Lh.default;e.hasOwnProperty(Nh.default.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(Mh.default.VALUE)&&(t.value=e.value.toString(),i.push(t)))})),i},getBaseURLsFromElement:T,getRepresentationSortFunction:h,getLocation:function(e){if(e&&e.hasOwnProperty(Nh.default.LOCATION))return e.Location=e.Location_asArray[0],e.Location},getPatchLocation:function(e){if(e&&e.hasOwnProperty(Mh.default.PATCH_LOCATION))return e.PatchLocation=e.PatchLocation_asArray[0],e.PatchLocation},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(Mh.default.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(Mh.default.AVAILABILITY_START_TIME)&&null!==e.availabilityStartTime?e.availabilityStartTime.getTime():null},getServiceDescriptions:function(e){var t=[];if(e&&e.hasOwnProperty(Mh.default.SERVICE_DESCRIPTION)){var n=!0,r=!1,i=void 0;try{for(var a,o=e.ServiceDescription_asArray[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value,u=void 0,l=void 0,f=void 0,d=void 0;for(var c in s)s.hasOwnProperty(c)&&(c===Mh.default.ID?u=s[c]:c===Mh.default.SERVICE_DESCRIPTION_SCOPE?l=s[c].schemeIdUri:c===Mh.default.SERVICE_DESCRIPTION_LATENCY?f={target:s[c].target,max:s[c].max,min:s[c].min}:c===Mh.default.SERVICE_DESCRIPTION_PLAYBACK_RATE&&(d={max:s[c].max,min:s[c].min}));l===Nh.default.SERVICE_DESCRIPTION_LL_SCHEME&&(f||d)&&t.push({id:u,schemeIdUri:l,latency:f,playbackRate:d})}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}}return t},getSupplementalPropperties:function(e){var t={};if(e&&e.hasOwnProperty(Mh.default.SUPPLEMENTAL_PROPERTY)){var n=!0,r=!1,i=void 0;try{for(var a,o=e.SupplementalProperty_asArray[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.hasOwnProperty(Nh.default.SCHEME_ID_URI)&&s.hasOwnProperty(Mh.default.VALUE)&&(t[s[Nh.default.SCHEME_ID_URI]]=s[Mh.default.VALUE])}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}}return t},setConfig:function(e){e&&(e.errHandler&&(n=e.errHandler),e.BASE64&&(r=e.BASE64))}},t=(0,jh.default)(i).getInstance().getLogger(e),e}Kh.__dashjs_factory_name="DashManifestModel";var Vh=Gh.default.getSingletonFactory(Kh),zh=Object.defineProperty({default:Vh},"__esModule",{value:!0}),Wh=rg(P),Xh=rg(R),Qh=rg(Xc),Zh=rg(v),$h=rg(Z),Jh=rg(Gc),eg=rg(c),tg=rg(zh),ng=rg(Cc);function rg(e){return e&&e.__esModule?e:{default:e}}var ig="m",ag="a",og="v",sg="i",ug="c",lg="tt",fg="k",dg="o",cg="d",hg="s",gg="v",pg="l";function mg(){var e=void 0,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=this.context,d=(0,Wh.default)(f).getInstance(),c=(0,Jh.default)(f).getInstance();function h(){n={pr:1,nor:null,st:null,sf:null,sid:""+ng.default.generateUuid(),cid:null},u={},s={},l={},p()}function g(){p()}function p(){if(a){var e=a.getStreamController();if(e&&"function"==typeof e.getActiveStream){var t=e.getActiveStream();t&&(o=t.getProcessors())}}}function m(e,t){var n={},r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;e[u]&&(n[u]=e[u])}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}function _(e){try{return e.type===ce.HTTPRequest.MPD_TYPE?((t=E()).ot=""+ig,t):e.type===ce.HTTPRequest.MEDIA_SEGMENT_TYPE?(function(e){l.hasOwnProperty(e)||(l[e]=!1);s.hasOwnProperty(e)||(s[e]=!1);u.hasOwnProperty(e)||(u[e]=!1)}(e.mediaType),function(e){var t=E(),f=function(e){try{var t=e.quality,n=e.mediaInfo.bitrateList;return parseInt(n[t].bandwidth/1e3)}catch(e){return null}}(e),d=function(e){try{return isNaN(e.duration)?null:Math.round(1e3*e.duration)}catch(e){return null}}(e),h=function(e){try{return 100*parseInt(r.getThroughputHistory().getSafeAverageThroughput(e)/100)}catch(e){return null}}(e.mediaType),g=function(e){try{var t=n.pr,r=i.getCurrentBufferLevel(e);return isNaN(t)||isNaN(r)?null:100*parseInt(r/t*10)}catch(e){return null}}(e.mediaType),p=y(e.mediaType),m=function(e){try{var t=r.getTopBitrateInfoFor(e);return Math.round(t.bitrate/1e3)}catch(e){return null}}(e.mediaType),_=n.pr,v=function(e){if(!o||0===o.length)return;var t=!0,n=!1,r=void 0;try{for(var i,a=o[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var s=i.value;if(s.getType()===e)return s.probeNextRequest()}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}(e.mediaType),T=void 0;e.mediaType===eg.default.VIDEO&&(T=og);e.mediaType===eg.default.AUDIO&&(T=ag);e.mediaType===eg.default.FRAGMENTED_TEXT&&(T="application/mp4"===e.mediaInfo.mimeType?lg:ug);var A=c.get().streaming.cmcd.rtp;A||(A=function(e){var t=a.getPlaybackRate();t||(t=1);var n=e.quality,r=e.mediaType,i=e.mediaInfo,o=e.duration,s=y(r);0===s&&(s=500);var u=i.bitrateList[n].bandwidth*o/1e3/(s/t/1e3),l=c.get().streaming.cmcd.rtpSafetyFactor&&!isNaN(c.get().streaming.cmcd.rtpSafetyFactor)?c.get().streaming.cmcd.rtpSafetyFactor:5;return 100*(parseInt(u*l/100)+1)}(e));if(t.rtp=A,v)if(e.url!==v.url){var S=new URL(v.url);t.nor=S.pathname}else v.range&&(t.nrr=v.range);f&&(t.br=f);T&&(t.ot=T);isNaN(d)||(t.d=d);isNaN(h)||(t.mtp=h);isNaN(g)||(t.dl=g);isNaN(p)||(t.bl=p);isNaN(m)||(t.tb=m);isNaN(_)||1===_||(t.pr=_);u[e.mediaType]&&(t.bs=!0,u[e.mediaType]=!1);!s[e.mediaType]&&l[e.mediaType]||(t.su=!0,s[e.mediaType]=!1,l[e.mediaType]=!0);return t}(e)):e.type===ce.HTTPRequest.INIT_SEGMENT_TYPE?function(){var e=E();return e.ot=""+sg,e.su=!0,e}():e.type===ce.HTTPRequest.OTHER_TYPE||e.type===ce.HTTPRequest.XLINK_EXPANSION_TYPE?function(){var e=E();return e.ot=""+dg,e}():e.type===ce.HTTPRequest.LICENSE?function(e){var t=E();return t.ot=fg,t}():null}catch(e){return null}var t}function E(){var e={},t=c.get().streaming.cmcd.cid?c.get().streaming.cmcd.cid:n.cid;return e.v=1,e.sid=c.get().streaming.cmcd.sid?c.get().streaming.cmcd.sid:n.sid,e.sid=""+e.sid,t&&(e.cid=""+t),isNaN(n.pr)||1===n.pr||null===n.pr||(e.pr=n.pr),n.st&&(e.st=n.st),n.sf&&(e.sf=n.sf),e}function y(e){try{var t=i.getCurrentBufferLevel(e);return isNaN(t)?null:100*parseInt(10*t)}catch(e){return null}}function v(e){try{n.pr=e.playbackRate}catch(e){}}function T(t){try{var r=e.getIsDynamic(t.data)?""+pg:""+gg,i=t.protocol&&"MSS"===t.protocol?""+hg:""+cg;n.st=""+r,n.sf=""+i}catch(e){}}function A(e){try{e.state&&e.mediaType&&e.state===Xh.default.BUFFER_EMPTY&&(u[e.mediaType]||(u[e.mediaType]=!0),s[e.mediaType]||(s[e.mediaType]=!0))}catch(e){}}function S(){for(var e in u)u.hasOwnProperty(e)&&(u[e]=!0);for(var t in s)s.hasOwnProperty(t)&&(s[t]=!0)}function b(e){try{if(!e)return null;var t=Object.keys(e).sort((function(e,t){return e.localeCompare(t)})),n=t.length,r=t.reduce((function(t,r,i){if("v"===r&&1===e[r])return t;"string"!=typeof e[r]||"ot"===r&&"sf"===r&&"st"===r?t+=r+"="+e[r]:t+=r+'="'+e[r].replace(/"/g,'"')+'"';return i<n-1&&(t+=","),t}),"");return r=r.replace(/=true/g,"")}catch(e){return null}}return t={getQueryParameter:function(e){try{if(c.get().streaming.cmcd&&c.get().streaming.cmcd.enabled){var t=_(e),n=b(t);return d.trigger(Qh.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,cmcdString:n}),{key:"CMCD",value:n}}return null}catch(e){return null}},getHeaderParameters:function(e){try{if(c.get().streaming.cmcd&&c.get().streaming.cmcd.enabled){var t=_(e),n=m(t,["br","d","ot","tb"]),r=m(t,["bl","dl","mtp","nor","nrr","su"]),i=m(t,["bs","rtp"]),a=m(t,["cid","pr","sf","sid","st","v"]),o={"CMCD-Object":b(n),"CMCD-Request":b(r),"CMCD-Status":b(i),"CMCD-Session":b(a)};return d.trigger(Qh.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t}),o}return null}catch(e){return null}},setConfig:function(e){e&&(e.abrController&&(r=e.abrController),e.dashMetrics&&(i=e.dashMetrics),e.playbackController&&(a=e.playbackController))},reset:function(){d.off(Xh.default.PLAYBACK_RATE_CHANGED,v,this),d.off(Xh.default.MANIFEST_LOADED,T,this),d.off(Xh.default.BUFFER_LEVEL_STATE_CHANGED,A,t),d.off(Xh.default.PLAYBACK_SEEKED,S,t),h()},initialize:function(){d.on(Xh.default.PLAYBACK_RATE_CHANGED,v,t),d.on(Xh.default.MANIFEST_LOADED,T,t),d.on(Xh.default.BUFFER_LEVEL_STATE_CHANGED,A,t),d.on(Xh.default.PLAYBACK_SEEKED,S,t),d.on(Xh.default.PERIOD_SWITCH_COMPLETED,g,t)}},(0,$h.default)(f).getInstance().getLogger(t),e=(0,tg.default)(f).getInstance(),h(),t}mg.__dashjs_factory_name="CmcdModel";var _g=Zh.default.getSingletonFactory(mg),Eg=Object.defineProperty({default:_g},"__esModule",{value:!0}),yg=Cg(Rc),vg=Cg(zc),Tg=Cg(v),Ag=Cg(Ie),Sg=Cg(Eg),bg=Cg(Cc),Ig=Cg(Z),Rg=Cg(P),wg=Cg(B),Ng=Cg(Gc),Mg=Cg(c);function Cg(e){return e&&e.__esModule?e:{default:e}}function Dg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Og(e){e=e||{};var t,n=this.context,r=e.errHandler,i=e.dashMetrics,a=e.mediaPlayerModel,o=e.requestModifier,s=e.boxParser,u=e.useFetch||!1,l=e.errors,f=e.requestTimeout||0,d=(0,Rg.default)(n).getInstance(),c=(0,Ng.default)(n).getInstance(),h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0;function v(e,t){var l=e.request,h=[],T=!0,A=!0,S=new Date,b=S,I=0,R=void 0;if(!o||!i||!r)throw new Error("config object is not correct or missing");var w=function(e){A=!1,l.requestStartDate=S,l.requestEndDate=new Date,l.firstByteDate=l.firstByteDate||S,l.checkExistenceOnly||(i.addHttpRequest(l,R.response?R.response.responseURL:null,R.response?R.response.status:null,R.response&&R.response.getAllResponseHeaders?R.response.getAllResponseHeaders():R.response?R.response.responseHeaders:[],e?h:null),l.type===ce.HTTPRequest.MPD_TYPE&&i.addManifestUpdate(l))},N=function(){if(-1!==g.indexOf(R)&&(g.splice(g.indexOf(R),1),A))if(w(!1),t>0){try{if(c.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&l.type===ce.HTTPRequest.MEDIA_SEGMENT_TYPE)a.getRetryAttemptsForType(ce.HTTPRequest.MEDIA_SEGMENT_TYPE)===t&&d.trigger(wg.default.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var n={config:e};m.push(n),n.timeout=setTimeout((function(){-1!==m.indexOf(n)&&(m.splice(m.indexOf(n),1),v(e,t))}),a.getRetryIntervalsForType(l.type))}else{if(l.type===ce.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;r.error(new Ag.default(_[l.type],l.url+" is not available",{request:l,response:R.response})),e.error&&e.error(l,"error",R.response.statusText),e.complete&&e.complete(l,R.response.statusText)}},M=void 0;M=u&&window.fetch&&"arraybuffer"===l.responseType&&l.type===ce.HTTPRequest.MEDIA_SEGMENT_TYPE?(0,vg.default)(n).create({requestModifier:o,boxParser:s}):(0,yg.default)(n).create({requestModifier:o});var C=null,D=o.modifyRequestURL(l.url);if(c.get().streaming.cmcd&&c.get().streaming.cmcd.enabled){var O=c.get().streaming.cmcd.mode;if(O===Mg.default.CMCD_MODE_QUERY){var P=function(e){try{var t=[],n=E.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(l);D=bg.default.addAditionalQueryParameterToUrl(D,P)}else O===Mg.default.CMCD_MODE_HEADER&&(C=E.getHeaderParameters(l))}var L=l.checkExistenceOnly?ce.HTTPRequest.HEAD:ce.HTTPRequest.GET,F=a.getXHRWithCredentialsForType(l.type);R={url:D,method:L,withCredentials:F,request:l,onload:function(){R.response.status>=200&&R.response.status<=299&&(w(!0),e.success&&e.success(R.response.response,R.response.statusText,R.response.responseURL),e.complete&&e.complete(l,R.response.statusText))},onend:N,onerror:N,progress:function(t){var n=new Date;T&&(T=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(l.firstByteDate=n)),t.lengthComputable&&(l.bytesLoaded=t.loaded,l.bytesTotal=t.total),t.noTrace||(h.push({s:b,d:t.time?t.time:n.getTime()-b.getTime(),b:[t.loaded?t.loaded-I:0]}),b=n,I=t.loaded),e.progress&&t&&e.progress(t)},onabort:function(){e.abort&&e.abort(l)},ontimeout:function(e){var t=void 0;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";y.warn(t)},loader:M,timeout:f,headers:C};var x=(new Date).getTime();if(isNaN(l.delayLoadingTime)||x>=l.delayLoadingTime)g.push(R),M.load(R);else{var U={httpRequest:R};p.push(U),U.delayTimeout=setTimeout((function(){if(-1!==p.indexOf(U)){p.splice(p.indexOf(U),1);try{S=new Date,b=S,g.push(U.httpRequest),M.load(U.httpRequest)}catch(e){U.httpRequest.onerror()}}}),l.delayLoadingTime-x)}}return h={load:function(e){e.request?v(e,a.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){m.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),m=[],p.forEach((function(e){return clearTimeout(e.delayTimeout)})),p=[],g.forEach((function(e){e.request.type!==ce.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))})),g=[]}},y=(0,Ig.default)(n).getInstance().getLogger(h),g=[],p=[],m=[],E=(0,Sg.default)(n).getInstance(),Dg(t={},ce.HTTPRequest.MPD_TYPE,l.DOWNLOAD_ERROR_ID_MANIFEST_CODE),Dg(t,ce.HTTPRequest.XLINK_EXPANSION_TYPE,l.DOWNLOAD_ERROR_ID_XLINK_CODE),Dg(t,ce.HTTPRequest.INIT_SEGMENT_TYPE,l.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),Dg(t,ce.HTTPRequest.MEDIA_SEGMENT_TYPE,l.DOWNLOAD_ERROR_ID_CONTENT_CODE),Dg(t,ce.HTTPRequest.INDEX_SEGMENT_TYPE,l.DOWNLOAD_ERROR_ID_CONTENT_CODE),Dg(t,ce.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,l.DOWNLOAD_ERROR_ID_CONTENT_CODE),Dg(t,ce.HTTPRequest.OTHER_TYPE,l.DOWNLOAD_ERROR_ID_CONTENT_CODE),_=t,h}Og.__dashjs_factory_name="HTTPLoader";var Pg=Tg.default.getClassFactory(Og),Lg=Object.defineProperty({default:Pg},"__esModule",{value:!0}),Fg=Ug(v),xg=Ug(Lg);function Ug(e){return e&&e.__esModule?e:{default:e}}function Bg(){var e=void 0;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 xg.default},registerLoader:function(t,n){e[t]=n},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:n}}Bg.__dashjs_factory_name="SchemeLoaderFactory";var kg=Fg.default.getSingletonFactory(Bg),Gg=Object.defineProperty({default:kg},"__esModule",{value:!0}),jg=qg(v),Yg=qg(Gg);function qg(e){return e&&e.__esModule?e:{default:e}}function Hg(e){e=e||{};var t=this.context,n=void 0,r=void 0;return n=(0,Yg.default)(t).getInstance(),{load:function(i){var a=n.getLoader(i&&i.request?i.request.url:null);(r=a(t).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.useFetch||null,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})).load(i)},abort:function(){r&&r.abort()}}}Hg.__dashjs_factory_name="URLLoader";var Kg=jg.default.getClassFactory(Hg),Vg=Object.defineProperty({default:Kg},"__esModule",{value:!0});var zg=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.checkForExistenceOnly=!0,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(me).default),Wg=Object.defineProperty({default:zg},"__esModule",{value:!0}),Xg=ep(c),Qg=ep(Vg),Zg=ep(Wg),$g=ep(Ie),Jg=ep(v);function ep(e){return e&&e.__esModule?e:{default:e}}function tp(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,i=e.urlUtils,a=e.errors,o=void 0,s=void 0;return o={checkForExistence:function(e){var t=function(t){n.trigger(r.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){var i=new Zg.default(e.url);s.load({request:i,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){var t=function(t,i){n.trigger(r.LOADING_COMPLETED,{request:e,response:t||null,error:i||null,sender:o})};e?s.load({request:e,progress:function(t){n.trigger(r.LOADING_PROGRESS,{request:e,stream:t.stream}),t.data&&n.trigger(r.LOADING_DATA_PROGRESS,{request:e,response:t.data||null,error:null,sender:o})},success:function(e){t(e)},error:function(e,n,r){t(void 0,new $g.default(a.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,r,n))},abort:function(e){e&&n.trigger(r.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:o})}}):t(void 0,new $g.default(a.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,a.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){s&&s.abort()},reset:function(){s&&(s.abort(),s=null)}},s=(0,Qg.default)(t).create({errHandler:e.errHandler,errors:a,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings.get().streaming.lowLatencyEnabled,urlUtils:i,constants:Xg.default,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),o}tp.__dashjs_factory_name="FragmentLoader";var np=Jg.default.getClassFactory(tp),rp=Object.defineProperty({default:np},"__esModule",{value:!0}),ip=gp(c),ap=gp(Ac),op=gp(Se),sp=gp(rp),up=gp(Ld),lp=gp(P),fp=gp(B),dp=gp(ra),cp=gp(v),hp=gp(Z);function gp(e){return e&&e.__esModule?e:{default:e}}function pp(e){e=e||{};var t=this.context,n=(0,lp.default)(t).getInstance(),r=e.errHandler,i=e.mediaPlayerModel,a=e.dashMetrics,o=(0,hp.default)(t).getInstance(),s=e.streamInfo,u=void 0,l=void 0,f=void 0;function d(){for(var e in f)f[e].reset();f={}}function c(e){if(e.sender){var t=e.request,r=e.response,i=t.isInitializationRequest(),a=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType!==ip.default.AUDIO&&t.mediaType!==ip.default.VIDEO&&t.mediaType!==ip.default.FRAGMENTED_TEXT||n.trigger(fp.default.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation})),r&&a){var o=function(e,t,n,r){var i=new ap.default;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,s.id,e.type!==fp.default.FRAGMENT_LOADING_PROGRESS);n.trigger(i?fp.default.INIT_FRAGMENT_LOADED:fp.default.MEDIA_FRAGMENT_LOADED,{chunk:o,request:t},{streamId:a.id,mediaType:t.mediaType})}else l.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return u={getStreamId:function(){return s.id},getModel:function(u){var l=f[u];return l||(l=(0,op.default)(t).create({streamInfo:s,type:u,dashMetrics:a,fragmentLoader:(0,sp.default)(t).create({dashMetrics:a,mediaPlayerModel:i,errHandler:r,requestModifier:(0,up.default)(t).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:n,events:fp.default,errors:dp.default,dashConstants:e.dashConstants,urlUtils:e.urlUtils}),debug:o,eventBus:n,events:fp.default}),f[u]=l),l},reset:function(){n.off(fp.default.FRAGMENT_LOADING_COMPLETED,c,this),n.off(fp.default.FRAGMENT_LOADING_PROGRESS,c,this),d()}},l=o.getLogger(u),d(),n.on(fp.default.FRAGMENT_LOADING_COMPLETED,c,u),n.on(fp.default.FRAGMENT_LOADING_PROGRESS,c,u),u}pp.__dashjs_factory_name="FragmentController";var mp=cp.default.getClassFactory(pp),_p=Object.defineProperty({default:mp},"__esModule",{value:!0});var Ep=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},yp=Object.defineProperty({default:Ep},"__esModule",{value:!0}),vp=Ip(v),Tp=Ip(c),Ap=Ip(yp),Sp=Ip(wh),bp=Ip(Iu);function Ip(e){return e&&e.__esModule?e:{default:e}}function Rp(e){var t,n=this.context,r=e.streamInfo,i=void 0;function a(){i&&i.reset()}return t={getStreamId:function(){return r.id},provide:function(e,t){if("function"==typeof t){var n,r=i.getCurrentTrack(),a=void 0;if(!r||r.segmentDuration<=0||null==e)t(null);else{isNaN(r.segmentDuration)&&(a=i.getThumbnailRequestForTime(e))&&(r.segmentDuration=a.duration),n=e%r.segmentDuration;var o=Math.floor(n*r.tilesHor*r.tilesVert/r.segmentDuration),s=new Ap.default;if(s.width=Math.floor(r.widthPerTile),s.height=Math.floor(r.heightPerTile),s.x=Math.floor(o%r.tilesHor)*r.widthPerTile,s.y=Math.floor(o/r.tilesHor)*r.heightPerTile,"readThumbnail"in r)return r.readThumbnail(e,(function(e){s.url=e,t(s)}));if(a)s.url=a.url,r.segmentDuration=NaN;else{var u=Math.floor(e/r.segmentDuration);s.url=function(e,t){var n=t+e.startNumber,r=(0,Hf.replaceTokenForTemplate)(e.templateUrl,"Number",n);return r=(0,Hf.replaceTokenForTemplate)(r,"Time",(n-1)*e.segmentDuration*e.timescale),r=(0,Hf.replaceTokenForTemplate)(r,"Bandwidth",e.bandwidth),(0,Hf.unescapeDollarsInTemplate)(r)}(r,u)}t(s)}}},setTrackByIndex:function(e){i.setTrackByIndex(e)},getCurrentTrackIndex:function(){return i.getCurrentTrackIndex()},getBitrateList:function(){var e=i.getTracks(),t=0;return e.map((function(e){var n=new bp.default;return n.mediaType=Tp.default.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:a},a(),i=(0,Sp.default)(n).create({streamInfo:r,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants}),t}Rp.__dashjs_factory_name="ThumbnailController";var wp=vp.default.getClassFactory(Rp),Np=Object.defineProperty({default:wp},"__esModule",{value:!0}),Mp=Yp(c),Cp=Yp(p),Dp=Yp(vc),Op=Yp(_p),Pp=Yp(Np),Lp=Yp(P),Fp=Yp(B),xp=Yp(Z),Up=Yp(ra),Bp=Yp(v),kp=Yp(Ie),Gp=Yp(ze),jp=Yp(Hd);function Yp(e){return e&&e.__esModule?e:{default:e}}function qp(e){e=e||{};var t=this.context,n=(0,Lp.default)(t).getInstance(),r=(0,jp.default)(t).getInstance(),i=e.manifestModel,a=e.mediaPlayerModel,o=e.manifestUpdater,s=e.adapter,u=e.capabilities,l=e.capabilitiesFilter,f=e.errHandler,d=e.timelineConverter,c=e.dashMetrics,h=e.abrController,g=e.playbackController,p=e.eventController,m=e.mediaController,_=e.textController,E=e.protectionController,y=e.videoModel,v=e.settings,T=e.streamInfo,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0,M=void 0,C=void 0,D=void 0,O=void 0,P=void 0,L=void 0,F=void 0,x=void 0,U=void 0,B=void 0,k=void 0;function G(e){for(var t=b?b.length:0,r=0;r<t;r++){b[r].getFragmentModel().removeExecutedRequestsBeforeTime(H()+q()),b[r].reset(!1,e)}b=[],R=!1,w=!1,fe(!1),n.off(Fp.default.CURRENT_TRACK_CHANGED,Z,A)}function j(){G(),I=!1,N=!1,M=!1,C={},D=!1,x=!1,B=!1}function Y(){g&&g.pause(),O&&(O.reset(),O=null),T=null,j(),n.off(Fp.default.DATA_UPDATE_COMPLETED,re,A),n.off(Fp.default.BUFFERING_COMPLETED,ne,A),n.off(Fp.default.INBAND_EVENTS,ie,A),E&&(n.off(Fp.default.KEY_ERROR,X,A),n.off(Fp.default.SERVER_CERTIFICATE_UPDATED,X,A),n.off(Fp.default.LICENSE_REQUEST_COMPLETE,X,A),n.off(Fp.default.KEY_SYSTEM_SELECTED,X,A),n.off(Fp.default.KEY_SESSION_CREATED,X,A),n.off(Fp.default.KEY_STATUSES_CHANGED,X,A)),fe(!1)}function q(){return T?T.duration:NaN}function H(){return T?T.start:NaN}function K(){if(!T.manifestInfo.isDynamic)return NaN;for(var e=0;e<b.length;e++)if(b[e].getType()===Mp.default.AUDIO||b[e].getType()===Mp.default.VIDEO)return b[e].getLiveStartTime();return NaN}function V(){return T?T.id:null}function z(){return T}function W(){if(!(y&&h&&h.hasOwnProperty("getBitrateList")&&s&&s.hasOwnProperty("getAllMediaInfoForType")&&s.hasOwnProperty("getEventsFor")))throw new Error(Mp.default.MISSING_CONFIG_ERROR)}function X(e){e.error&&(f.error(e.error),S.fatal(e.error.message),Y())}function Q(e){var t,n=e?e.type:null,r=void 0;if(n===Mp.default.MUXED)return r="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",S.fatal(r),f.error(new kp.default(Up.default.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,r,i.getValue())),!1;if(n===Mp.default.TEXT||n===Mp.default.FRAGMENTED_TEXT||n===Mp.default.EMBEDDED_TEXT||n===Mp.default.IMAGE)return!0;if(t=e.codec,S.debug(n+" codec: "+t),e.contentProtection&&!u.supportsEncryptedMedia())f.error(new kp.default(Up.default.CAPABILITY_MEDIAKEYS_ERROR_CODE,Up.default.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE));else if(!u.supportsCodec(t))return r=n+"Codec ("+t+") is not supported.",S.error(r),!1;return!0}function Z(e){if(T&&e.newMediaInfo.streamInfo.id===T.id){var t=e.newMediaInfo,n=i.getValue();s.setCurrentMediaInfo(T.id,t.type,t);var r=ae(t);if(r){var a=g.getTime();S.info("Stream - Process track changed at current time "+a),S.debug("Stream - Update stream controller"),n.refreshManifestOnSwitchTrack?(S.debug("Stream - Refreshing manifest for switch track"),k=e,o.refreshManifest()):(r.selectMediaInfo(t),t.type!==Mp.default.FRAGMENTED_TEXT?(h.updateTopQualityIndex(t),r.switchTrackAsked(),r.getFragmentModel().abortRequests()):(r.getScheduleController().setSeekTarget(a),r.setBufferingTime(a),r.resetIndexHandler()))}}}function $(r,o){var u,l=s.getAllMediaInfoForType(T,r),c=null;if(l&&0!==l.length){r===Mp.default.VIDEO&&(N=!0),r===Mp.default.AUDIO&&(M=!0);for(var p=0,E=l.length;p<E;p++)if(c=l[p],r===Mp.default.EMBEDDED_TEXT)_.addEmbeddedTrack(c);else{if(!Q(c))continue;m.addTrack(c)}r!==Mp.default.EMBEDDED_TEXT&&0!==m.getTracksFor(r,T).length&&(r!==Mp.default.IMAGE?(m.checkInitialMediaSettingsForType(r,T),u=m.getCurrentTrackFor(r,T),n.trigger(Fp.default.STREAM_INITIALIZING,{streamInfo:T,mediaInfo:c}),function(n,r,o,u){var l=O.getModel(n?n.type:null),c=(0,Dp.default)(t).create({streamInfo:T,type:n?n.type:null,mimeType:n?n.mimeType:null,timelineConverter:d,adapter:s,manifestModel:i,mediaPlayerModel:a,fragmentModel:l,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,abrController:h,playbackController:g,mediaController:m,textController:_,errHandler:f,settings:v,boxParser:F});if(c.initialize(o,N),h.updateTopQualityIndex(n),u?(c.setBuffer(u.buffer),c.setBufferingTime(u.currentTime),b[u.replaceIdx]=c):b.push(c),!u||!u.ignoreMediaInfo)if(!n||n.type!==Mp.default.TEXT&&n.type!==Mp.default.FRAGMENTED_TEXT)c.addMediaInfo(n,!0);else{for(var p=void 0,E=0;E<r.length;E++)r[E].index===n.index&&(p=E),c.addMediaInfo(r[E]);c.selectMediaInfo(r[p])}}(u,l,o)):P=(0,Pp.default)(t).create({streamInfo:T,adapter:s,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:U,eventBus:n,events:Fp.default,dashConstants:Cp.default}))}else S.info("No "+r+" data.")}function J(){if(p){var e=s.getEventsFor(T);p.addInlineEvents(e)}}function ee(){for(var e=b.length,t=!!C.audio||!!C.video?new kp.default(Up.default.DATA_UPDATE_FAILED_ERROR_CODE,Up.default.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,r=0;r<e;r++)if(b[r].isUpdating()||D)return;if(w){if(E){E.clearMediaInfoArrayByStreamId(V());for(var i=0;i<e&&b[i];i++){var a=b[i].getType();if(a===Mp.default.AUDIO||a===Mp.default.VIDEO||a===Mp.default.FRAGMENTED_TEXT){var o=b[i].getMediaInfo();o&&E.initializeForMedia(o)}}}t?f.error(t):I||(I=!0,n.trigger(Fp.default.STREAM_INITIALIZED,{streamInfo:T,liveStartTime:L?NaN:K()}));for(var s=0;s<e&&b[s];s++)b[s].getScheduleController().start()}}function te(e){for(var t={},n=0,r=b.length;n<r;n++){var i=b[n].createBuffer(e);i&&(t[b[n].getType()]=i.getBuffer())}return t}function ne(){var e=oe(),t=e.length;if(0!==t){for(var r=0;r<t;r++)if(!e[r].isBufferingCompleted()&&(e[r].getType()===Mp.default.AUDIO||e[r].getType()===Mp.default.VIDEO))return void S.warn("onBufferingCompleted - One streamProcessor has finished but",e[r].getType(),"one is not buffering completed");S.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),n.trigger(Fp.default.STREAM_BUFFERING_COMPLETED,{streamInfo:T})}else S.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function re(e){C[e.mediaType]=e.error,ee()}function ie(e){!function(e){p&&p.addInbandEvents(e)}(e.events)}function ae(e){return e?oe().filter((function(t){return t.getType()===e.type}))[0]:null}function oe(){for(var e=[],t=void 0,n=void 0,r=0;r<b.length;r++)(t=(n=b[r]).getType())!==Mp.default.AUDIO&&t!==Mp.default.VIDEO&&t!==Mp.default.FRAGMENTED_TEXT&&t!==Mp.default.TEXT||e.push(n);return e}function se(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():z();if(!r||!i)return!1;var a=s.getAdaptationForType(r.index,t,r),o=s.getAdaptationForType(i.index,t,i);return a&&o?!(!ue(o)&&ue(a)):!a&&!o}function ue(e){return!!e&&!!(e.ContentProtection||e.Representation&&e.Representation.length>0&&e.Representation[0].ContentProtection)}function le(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():z();if(!r||!i)return!1;var a=s.getAdaptationForType(r.index,t,r),o=s.getAdaptationForType(i.index,t,i);if(!a||!o)return!a&&!o;var l=a&&o&&a.mimeType===o.mimeType,f=o.Representation_asArray.map((function(e){return e.codecs})),d=a.Representation_asArray.map((function(e){return e.codecs})),c=d.some((function(e){return f.indexOf(e)>-1})),h=d.some((function(e){return f.some((function(t){return u.codecRootCompatibleWithCodec(t,e)}))}));return c||h&&l}function fe(e){L=e}function de(){return L}return A={initialize:function(){n.on(Fp.default.BUFFERING_COMPLETED,ne,A),n.on(Fp.default.DATA_UPDATE_COMPLETED,re,A),n.on(Fp.default.INBAND_EVENTS,ie,A),E&&(n.on(Fp.default.KEY_ERROR,X,A),n.on(Fp.default.SERVER_CERTIFICATE_UPDATED,X,A),n.on(Fp.default.LICENSE_REQUEST_COMPLETE,X,A),n.on(Fp.default.KEY_SYSTEM_SELECTED,X,A),n.on(Fp.default.KEY_SESSION_CREATED,X,A),n.on(Fp.default.KEY_STATUSES_CHANGED,X,A)),n.trigger(Fp.default.STREAM_UPDATED,{streamInfo:T})},getStreamId:function(){return T?T.id:null},activate:function(e,t){if(!R){var r=void 0;return n.on(Fp.default.CURRENT_TRACK_CHANGED,Z,A),de()?(!function(){if(D=!0,W(),l.filterUnsupportedFeaturesOfPeriod(T),w=!0,D=!1,0===b.length){var e="No streams to play.";f.error(new kp.default(Up.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e,i.getValue())),S.debug(e)}else ee()}(),r=t):r=function(e,t){W();var n=y.getElement();J(),D=!0,l.filterUnsupportedFeaturesOfPeriod(T),(!n||n&&/^VIDEO$/i.test(n.nodeName))&&$(Mp.default.VIDEO,e);$(Mp.default.AUDIO,e),$(Mp.default.TEXT,e),$(Mp.default.FRAGMENTED_TEXT,e),$(Mp.default.EMBEDDED_TEXT,e),$(Mp.default.MUXED,e),$(Mp.default.IMAGE,e);var r=te(t);if(w=!0,D=!1,0===b.length){var a="No streams to play.";f.error(new kp.default(Up.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,a,i.getValue())),S.fatal(a)}else ee();return r}(e,t),R=!0,r}return t},deactivate:G,isActive:function(){return R},getDuration:q,getStartTime:H,getId:V,getStreamInfo:z,getHasAudioTrack:function(){return M},getHasVideoTrack:function(){return N},preload:function(e,t){if(!de()){J(),$(Mp.default.VIDEO,e),$(Mp.default.AUDIO,e),$(Mp.default.TEXT,e),$(Mp.default.FRAGMENTED_TEXT,e),$(Mp.default.EMBEDDED_TEXT,e),$(Mp.default.MUXED,e),$(Mp.default.IMAGE,e),te(t),n.on(Fp.default.CURRENT_TRACK_CHANGED,Z,A);for(var r=0;r<b.length&&b[r];r++)b[r].getScheduleController().start();fe(!0)}},getThumbnailController:function(){return P},getBitrateListFor:function(e){if(W(),e===Mp.default.IMAGE)return P?P.getBitrateList():[];var t=function(e){for(var t=null,n=0;n<b.length;n++)if((t=b[n]).getType()===e)return t.getMediaInfo();return null}(e);return h.getBitrateList(t)},updateData:function(e){S.info("Manifest updated... updating data system wide."),R=!1,D=!0,T=e,n.trigger(Fp.default.STREAM_UPDATED,{streamInfo:T}),p&&J(),l.filterUnsupportedFeaturesOfPeriod(T);for(var t=0,r=b.length;t<r;t++){var i=b[t];i.updateStreamInfo(T);var a=s.getMediaInfoForType(T,i.getType());a&&(h.updateTopQualityIndex(a),i.addMediaInfo(a,!0))}if(k&&k.newMediaInfo.type!==Mp.default.FRAGMENTED_TEXT){var o=ae(k.oldMediaInfo);if(!o)return;o.switchTrackAsked(),k=void 0}D=!1,ee()},reset:Y,getProcessors:oe,setMediaSource:function(e){for(var t=0;t<b.length;)Q(b[t].getMediaInfo())?(b[t].setMediaSource(e),t++):(b[t].reset(),b.splice(t,1));for(var n=0;n<b.length;n++)b[n].dischargePreBuffer();if(0===b.length){var r="No streams to play.";f.error(new kp.default(Up.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,r+"nostreams",i.getValue())),S.fatal(r)}},isMediaCodecCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return le(e,Mp.default.VIDEO,t)&&le(e,Mp.default.AUDIO,t)},isProtectionCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return se(e,Mp.default.VIDEO,t)&&se(e,Mp.default.AUDIO,t)},getPreloaded:de,getPreloadingScheduled:function(){return x},setPreloadingScheduled:function(e){x=e},getIsEndedEventSignaled:function(){return B},setIsEndedEventSignaled:function(e){B=e}},U=(0,xp.default)(t).getInstance(),S=U.getLogger(A),j(),F=(0,Gp.default)(t).getInstance(),O=(0,Op.default)(t).create({streamInfo:T,mediaPlayerModel:a,dashMetrics:c,errHandler:f,settings:v,boxParser:F,dashConstants:Cp.default,urlUtils:r}),A}qp.__dashjs_factory_name="Stream";var Hp=Bp.default.getClassFactory(qp),Kp=Object.defineProperty({default:Hp},"__esModule",{value:!0}),Vp=Jp(P),zp=Jp(B),Wp=Jp(v),Xp=Jp(Z),Qp=Jp(ra),Zp=Jp(p),$p=Jp(Hd);function Jp(e){return e&&e.__esModule?e:{default:e}}function em(){var e=this.context,t=(0,Vp.default)(e).getInstance(),n=(0,$p.default)(e).getInstance(),r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0;function p(){a=NaN,l=!1,s=!0,u=!1,m()}function m(){null!==o&&(clearTimeout(o),o=null)}function _(e){m(),u||(isNaN(e)&&!isNaN(a)&&(e=1e3*a),isNaN(e)||(i.debug("Refresh manifest in "+e+" milliseconds."),o=setTimeout(v,e)))}function E(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];l=!0;var t=d.getValue(),r=t.url,i=c.getPatchLocation(t),a=c.getLocation(t);i&&!e?r=i:a&&(r=a),n.isRelative(r)&&(r=n.resolve(r,t.url)),f.load(r)}function y(e){if(e){if(c.getIsPatch(e)){var n=e;e=d.getValue();var r=c.isPatchValid(e,n),o=r;if(r){var f=c.getPublishTime(e);o=c.applyPatchToManifest(e,n);var h=c.getPublishTime(e);o=f.getTime()!=h.getTime()}if(!o)return i.debug("Patch provided is invalid, performing full manifest refresh"),void E(!0);e.loadedTime=new Date}}else(e=d.getValue()).loadedTime=new Date;if(d.getValue()&&d.getValue().type===Zp.default.DYNAMIC&&e.type===Zp.default.STATIC)return t.trigger(zp.default.DYNAMIC_TO_STATIC),l=!1,void(u=!0);d.setValue(e);var g=new Date,p=(g.getTime()-e.loadedTime.getTime())/1e3;1e3*(a=c.getManifestUpdatePeriod(e,p))>2147483647&&(a=2147483.647),t.trigger(zp.default.MANIFEST_UPDATED,{manifest:e}),i.info("Manifest has been refreshed at "+g+"["+g.getTime()/1e3+"] "),s||_()}function v(){s||(l?_(g.get().streaming.manifestUpdateRetryInterval):E())}function T(e){e.error?e.error.code===Qp.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&h.error(e.error):y(e.manifest)}function A(){s=!1,_()}function S(){(s=!g.get().streaming.scheduleWhilePaused)&&m()}function b(){l=!1}return r={initialize:function(){p(),t.on(zp.default.STREAMS_COMPOSED,b,this),t.on(zp.default.PLAYBACK_STARTED,A,this),t.on(zp.default.PLAYBACK_PAUSED,S,this),t.on(zp.default.INTERNAL_MANIFEST_LOADED,T,this)},setManifest:function(e){y(e)},refreshManifest:E,setConfig:function(e){e&&(e.manifestModel&&(d=e.manifestModel),e.adapter&&(c=e.adapter),e.manifestLoader&&(f=e.manifestLoader),e.errHandler&&(h=e.errHandler),e.settings&&(g=e.settings))},reset:function(){t.off(zp.default.PLAYBACK_STARTED,A,this),t.off(zp.default.PLAYBACK_PAUSED,S,this),t.off(zp.default.STREAMS_COMPOSED,b,this),t.off(zp.default.INTERNAL_MANIFEST_LOADED,T,this),p()}},i=(0,Xp.default)(e).getInstance().getLogger(r),r}em.__dashjs_factory_name="ManifestUpdater";var tm=Wp.default.getClassFactory(em),nm=Object.defineProperty({default:tm},"__esModule",{value:!0}),rm=fm(Ie),im=fm(P),am=fm(B),om=fm(ra),sm=fm(v),um=fm(Z),lm=fm(Hd);function fm(e){return e&&e.__esModule?e:{default:e}}function dm(){var e=this.context,t=(0,im.default)(e).getInstance(),n=(0,lm.default)(e).getInstance(),r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0;function E(){f=[],d=[],c=null,h=null,p=null,g=NaN,a=!1,o=!1,m=s.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function y(){a||o||!p||!p.value||!p.schemeIdUri||isNaN(g)||isNaN(s.get().streaming.utcSynchronization.backgroundAttempts)||(h&&(Date.now()-h)/1e3<30||(f=[],o=!0,function e(t){try{if(t<=0)return void D();var n=Date.now();u[p.schemeIdUri](p.value,(function(r){var i=Date.now(),a=v(n,i,r);f.push(a),e(t-1)}),(function(){D()}))}catch(e){D()}}(isNaN(s.get().streaming.utcSynchronization.backgroundAttempts)?2:s.get().streaming.utcSynchronization.backgroundAttempts)))}function v(e,t,n){return n-(t-(t-e)/2)}function T(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,t=isNaN(e);t&&s.get().streaming.useManifestDateHeaderTimeSource?M():C(t,e)}function A(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t=void 0,n=void 0,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 S(e){return Date.parse(e)}function b(e){return Date.parse(e)}function I(e,t,n){n()}function R(e,t,n){var r=A(e);isNaN(r)?n():t(r)}function w(e,t,r,i,a){var o,s,u=!1,l=new XMLHttpRequest,f=a?ce.HTTPRequest.HEAD:ce.HTTPRequest.GET,d=t.match(/\S+/g);if(t=d.shift(),o=function(){u||(u=!0,d.length?w(e,d.join(" "),r,i,a):i())},s=function(){var t=void 0,n=void 0;200===l.status&&(t=a?l.getResponseHeader("Date"):l.response,n=e(t),isNaN(n)||(r(n),u=!0))},n.isRelative(t)){var c=_.resolve();c&&(t=n.resolve(t,c.url))}l.open(f,t),l.timeout=5e3,l.onload=s,l.onloadend=o,l.send()}function N(e,t,n){w(b,e,t,n,!0)}function M(){var e=l.getLatestMPDRequestHeaderValueByID("Date"),t=null!==e?new Date(e).getTime():Number.NaN;isNaN(t)?C(!0):C(!1,t-Date.now())}function C(e,n){if(isNaN(g)||isNaN(n)||e||function(e){try{var t=O(e),n=isNaN(m)?30:m,r=isNaN(s.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:s.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,a=isNaN(s.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:s.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,o=isNaN(s.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:s.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts,u=void 0;t?(u=Math.min(n*r,a),i.debug("Increasing timeBetweenSyncAttempts to "+u)):(u=Math.max(n/r,o),i.debug("Decreasing timeBetweenSyncAttempts to "+u)),m=u}catch(e){}}(n),!e&&!isNaN(n)){c=Date.now(),a=!1;var r=isNaN(g);g=n,r&&y(),i.debug("Completed UTC sync. Setting client - server offset to "+n)}e&&(p=null),t.trigger(am.default.UPDATE_TIME_SYNC_OFFSET,{offset:n,error:e?new rm.default(om.default.TIME_SYNC_FAILED_ERROR_CODE,om.default.TIME_SYNC_FAILED_ERROR_MESSAGE):null}),t.trigger(am.default.TIME_SYNCHRONIZATION_COMPLETED)}function D(){if(f&&0!==f.length){var e=f.reduce((function(e,t){return e+t}),0)/f.length;O(e)?i.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(i.debug("Completed background UTC sync. Setting client - server offset to "+e),g=e,t.trigger(am.default.UPDATE_TIME_SYNC_OFFSET,{offset:g})),o=!1,h=Date.now()}}function O(e){try{if(isNaN(g))return!0;var t=s.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(s.get().streaming.utcSynchronization.maximumAllowedDrift)?s.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=g-t&&e<=g+t}catch(e){return!0}}return r={initialize:function(){E(),u={"urn:mpeg:dash:utc:http-head:2014":N,"urn:mpeg:dash:utc:http-xsdate:2014":w.bind(null,A),"urn:mpeg:dash:utc:http-iso:2014":w.bind(null,S),"urn:mpeg:dash:utc:direct:2014":R,"urn:mpeg:dash:utc:http-head:2012":N,"urn:mpeg:dash:utc:http-xsdate:2012":w.bind(null,A),"urn:mpeg:dash:utc:http-iso:2012":w.bind(null,S),"urn:mpeg:dash:utc:direct:2012":R,"urn:mpeg:dash:utc:http-ntp:2014":I,"urn:mpeg:dash:utc:ntp:2014":I,"urn:mpeg:dash:utc:sntp:2014":I}},attemptSync:function(e){d=e,a||(!function(){try{var e=isNaN(m)?30:m;return!(c&&e&&!isNaN(e))||(Date.now()-c)/1e3>=e}catch(e){return!0}}()?t.trigger(am.default.TIME_SYNCHRONIZATION_COMPLETED):(a=!0,function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=t||0;if(!d||0===d.length||n>=d.length)return void T();var r=d[n];if(r)if(u.hasOwnProperty(r.schemeIdUri)){var i=(new Date).getTime();u[r.schemeIdUri](r.value,(function(e){var t=(new Date).getTime(),n=v(i,t,e);p=r,T(n)}),(function(){e(n+1)}))}else e(n+1);else T()}()))},setConfig:function(e){e&&(e.dashMetrics&&(l=e.dashMetrics),e.baseURLController&&(_=e.baseURLController),e.settings&&(s=e.settings))},reset:function(){E(),t.off(am.default.ATTEMPT_BACKGROUND_SYNC,y,r)}},i=(0,um.default)(e).getInstance().getLogger(r),t.on(am.default.ATTEMPT_BACKGROUND_SYNC,y,r),r}dm.__dashjs_factory_name="TimeSyncController";var cm=sm.default.getSingletonFactory(dm);cm.HTTP_TIMEOUT_MS=5e3,sm.default.updateSingletonFactory(dm.__dashjs_factory_name,cm);var hm=cm,gm=Object.defineProperty({default:hm},"__esModule",{value:!0}),pm=_m(v),mm=_m(Z);function _m(e){return e&&e.__esModule?e:{default:e}}function Em(){var e=void 0,t=void 0,n=this.context;return e={createMediaSource:function(){var e="WebKitMediaSource"in window;return"MediaSource"in window?new MediaSource:e?new WebKitMediaSource:null},attachMediaSource:function(e,t){var n=window.URL.createObjectURL(e);return t.setSource(n),n},detachMediaSource:function(e){e.setSource(null)},setDuration:function e(n,r){n&&"open"===n.readyState&&(null===r&&isNaN(r)||n.duration!==r&&(!function(e){for(var t=e.sourceBuffers,n=0;n<t.length;n++)if(t[n].updating)return!0;return!1}(n)?(t.info("Set MediaSource duration:"+r),n.duration=r):setTimeout(e.bind(null,n,r),50)))},setSeekable:function(e,t,n){e&&"function"==typeof e.setLiveSeekableRange&&"function"==typeof e.clearLiveSeekableRange&&"open"===e.readyState&&t>=0&&t<n&&(e.clearLiveSeekableRange(),e.setLiveSeekableRange(t,n))},signalEndOfStream:function(e){if(e&&"open"===e.readyState){for(var n=e.sourceBuffers,r=0;r<n.length;r++){if(n[r].updating)return;if(0===n[r].buffered.length)return}t.info("call to mediaSource endOfStream"),e.endOfStream()}}},t=(0,mm.default)(n).getInstance().getLogger(e),e}Em.__dashjs_factory_name="MediaSourceController";var ym=pm.default.getSingletonFactory(Em),vm=Object.defineProperty({default:ym},"__esModule",{value:!0}),Tm=Rm(v),Am=Rm(Z),Sm=Rm(P),bm=Rm(R),Im=Rm(Rc);function Rm(e){return e&&e.__esModule?e:{default:e}}function wm(){var e="discarded",t="updated",n="added",r=this.context,i=(0,Sm.default)(r).getInstance(),a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0;function m(){if(!d||!c)throw new Error("setConfig function has to be called previously")}function _(){p=!1,s={},u={},l=null,g=!1,f=Date.now()/1e3}function E(){try{null!==l&&p&&(clearInterval(l),l=null,p=!1,function(){try{S(u),S(s)}catch(e){}}())}catch(e){throw e}}function y(r,i){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r.eventStream.schemeIdUri,s=r.eventStream.value,u=r.id,l=e;i[o]||(i[o]=[]);var f=i[o].findIndex((function(e){return(!s||e.eventStream.value&&e.eventStream.value===s)&&e.id===u}));return-1===f?(i[o].push(r),l=n):a&&(i[o][f]=r,l=t),l}function v(e){try{if(1==e.eventStream.value){var t=e.calculatedPresentationTime,n=void 0;n=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,i.trigger(bm.default.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:t,newDuration:n,newManifestValidAfter:NaN},{mode:bm.default.EVENT_MODE_ON_START})}}catch(e){}}function T(){try{if(!g){g=!0;var e=c.getTime(),t=e-f;t=f>0?Math.max(0,t):0,A(u,t,e),A(s,t,e),f=e,g=!1}}catch(e){g=!1}}function A(e,t,n){try{b(e,(function(r){if(void 0!==r){var i=isNaN(r.duration)?0:r.duration;r.calculatedPresentationTime<=n&&r.calculatedPresentationTime+t+i>=n?I(r,e,bm.default.EVENT_MODE_ON_START):(function(e,t,n){try{return e-t>n}catch(e){return!1}}(n,i+t,r.calculatedPresentationTime)||function(e){try{var t=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>t}catch(e){return!1}}(r))&&(o.debug("Deleting event "+r.id+" as it is expired or invalid"),R(e,r))}}))}catch(e){}}function S(e){try{var t=c.getTime();b(e,function(n){var r=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.duration)?n.eventStream.period.duration:NaN,i=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.start)?n.eventStream.period.start:NaN;if(!isNaN(r)&&!isNaN(i)){var a=n.calculatedPresentationTime;Math.abs(a-t)<300&&I(n,e,bm.default.EVENT_MODE_ON_START)}}())}catch(e){}}function b(e,t){try{if(e)for(var n=Object.keys(e),r=0;r<n.length;r++){e[n[r]].forEach((function(e){void 0!==e&&t(e)}))}}catch(e){}}function I(e,t,n){try{var a=c.getTime(),s=e.id;if(n===bm.default.EVENT_MODE_ON_RECEIVE)return o.debug("Received event "+s),void i.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n});"urn:mpeg:dash:event:2012"===e.eventStream.schemeIdUri&&1===e.eventStream.value?0===e.duration&&0===e.presentationTimeDelta||(o.debug("Starting manifest refresh event "+s+" at "+a),R(t,e),function(){try{m(),d.refreshManifest()}catch(e){}}()):"urn:mpeg:dash:event:callback:2015"===e.eventStream.schemeIdUri&&1===e.eventStream.value?(o.debug("Starting callback event "+s+" at "+a),R(t,e),function(e){try{(0,Im.default)(r).create({}).load({method:"get",url:e,request:{responseType:"arraybuffer"}})}catch(e){throw e}}(e.messageData)):(o.debug("Starting event "+s+" at "+a),R(t,e),i.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n}))}catch(e){}}function R(e,t){var n=t.eventStream.schemeIdUri,r=t.eventStream.value,i=t.id;e[n]=e[n].filter((function(e){return r&&e.eventStream.value&&e.eventStream.value!==r||e.id!==i})),0===e[n].length&&delete e[n]}return a={addInlineEvents:function(e){try{if(m(),e)for(var r=0;r<e.length;r++){var i=e[r],a=y(i,s,!0);a===n?(o.debug("Added inline event with id "+i.id),I(i,e,bm.default.EVENT_MODE_ON_RECEIVE)):a===t&&o.debug("Updated inline event with id "+i.id)}o.debug("Added "+e.length+" inline events")}catch(e){throw e}},addInbandEvents:function(e){try{m();for(var t=0;t<e.length;t++){var r=e[t];y(r,u,!1)===n?("urn:mpeg:dash:event:2012"===r.eventStream.schemeIdUri&&void 0===u[r.id]&&v(r),o.debug("Added inband event with id "+r.id),I(r,e,bm.default.EVENT_MODE_ON_RECEIVE)):o.debug("Inband event with scheme_id_uri "+r.eventStream.schemeIdUri+", value "+r.eventStream.value+" and id "+r.id+" was ignored because it has been added before.")}T()}catch(e){throw e}},getInbandEvents:function(){return u},getInlineEvents:function(){return s},start:function(){try{m(),o.debug("Start Event Controller");var e=h.get().streaming.eventControllerRefreshDelay;p||isNaN(e)||(p=!0,l=setInterval(T,e))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(d=e.manifestUpdater),e.playbackController&&(c=e.playbackController),e.settings&&(h=e.settings)}catch(e){throw e}},reset:function(){E(),_()}},o=(0,Am.default)(r).getInstance().getLogger(a),_(),a}wm.__dashjs_factory_name="EventController";var Nm=Tm.default.getSingletonFactory(wm),Mm=Object.defineProperty({default:Nm},"__esModule",{value:!0}),Cm=zm(c),Dm=zm(E),Om=zm(Kp),Pm=zm(nm),Lm=zm(P),Fm=zm(B),xm=zm(v),Um=zm(Z),Bm=zm(gl),km=zm(Hd),Gm=zm(R),jm=zm(gm),Ym=zm(vm),qm=zm(Ie),Hm=zm(ra),Km=zm(Mm),Vm=zm(Na);function zm(e){return e&&e.__esModule?e:{default:e}}function Wm(){var e=this.context,t=(0,Lm.default)(e).getInstance(),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0,M=void 0,C=void 0,D=void 0,O=void 0,P=void 0,L=void 0,F=void 0,x=void 0,U=void 0,B=void 0,k=void 0,G=void 0,j=void 0;function Y(){if(fe()){var e=D.getPlaybackQuality();e&&f.addDroppedFrames(e)}}function q(e){var t=$(e.seekTime);t===S&&k&&k.length>0&&k.forEach((function(e){e.deactivate(!0)})),t&&t!==S?(ce(Qd.PlayListTrace.END_OF_PERIOD_STOP_REASON),ne(t,S,e.seekTime)):ce(Qd.PlayListTrace.USER_REQUEST_STOP_REASON),he(Qd.PlayList.SEEK_START_REASON)}function H(e){var t=te();ce(Qd.PlayListTrace.END_OF_PERIOD_STOP_REASON),ne(t,S,e.seekTime),he(Qd.PlayList.SEEK_START_REASON)}function K(){r.debug("[onPlaybackStarted]"),F?(F=!1,he(Qd.PlayList.INITIAL_PLAYOUT_START_REASON)):L&&(L=!1,he(Qd.PlayList.RESUME_FROM_PAUSE_START_REASON))}function V(e){r.debug("[onPlaybackPaused]"),e.ended||(L=!0,ce(Qd.PlayListTrace.USER_REQUEST_STOP_REASON))}function z(){x&&(clearInterval(x),x=null)}function W(){U||(U=setInterval((function(){!function(){if(!S||!X(S))return;var e=function(e){try{var t=e||(S||null);if(t){var n=t.getStreamInfo().start;return A.filter((function(e){return e.getStreamInfo().start>n}))}}catch(e){return[]}}(S),t=0,n=function(){var n=e[t],i=0===t?S:e[t-1];if(!n.getPreloadingScheduled()&&X(i)&&C){var a=[Cm.default.VIDEO,Cm.default.AUDIO],o=!0;a.forEach((function(e){var t=l.getMediaInfoForType(n.getStreamInfo(),e);l.getVoRepresentations(t).forEach((function(e){var t=l.getIsDynamic(),n=T.calcSegmentAvailabilityRange(e,t);n.end<n.start&&(o=!1)}))})),o&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(C&&!e.getPreloaded()){var n=Z(e,t);n&&(e.setPreloadingScheduled(!0),r.info("[onStreamCanLoadNext] Preloading next stream with id "+e.getId()),e.preload(C,B),k.push(e),e.getProcessors().forEach((function(t){t.setBufferingTime(e.getStartTime())})))}}(n,i)}t+=1};for(;t<e.length;)n()}()}),500))}function X(e){try{if(!e)return!1;var t=e.getProcessors().filter((function(e){return e.getType()===Cm.default.AUDIO||e.getType()===Cm.default.VIDEO}));if(!t||0===t.length)return!1;var n=t.filter((function(e){return!e.isBufferingCompleted()}));return n&&0===n.length}catch(e){return!1}}function Q(){var e=pe().isLast;C&&e&&(r.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),d.signalEndOfStream(C))}function Z(e,t){try{return j.get().streaming.reuseExistingSourceBuffers&&t.isProtectionCompatible(e,t)&&(G||t.isMediaCodecCompatible(e,t))&&!function(e){try{var t=e.getStreamInfo(),n=l.getAdaptationForType(t.index,Cm.default.FRAGMENTED_TEXT,t);return!!n&&(-1!==n.codecs.indexOf("stpp")||-1!==n.codecs.indexOf("wvtt"))}catch(e){return!1}}(e)}catch(e){return!1}}function $(e){if(isNaN(e))return null;var t=0,n=null,r=A.length;r>0&&(t+=A[0].getStartTime());for(var i=0;i<r;i++)if(n=A[i],e<(t=parseFloat((t+n.getDuration()).toFixed(5))))return n;return null}function J(){return S?S.getProcessors():[]}function ee(e){if(!S.getIsEndedEventSignaled()){S.setIsEndedEventSignaled(!0);var t=te();t?(r.debug("StreamController onEnded, found next stream with id "+t.getStreamInfo().id),ne(t,S,NaN)):(r.debug("StreamController no next stream found"),S.setIsEndedEventSignaled(!1)),ce(t?Qd.PlayListTrace.END_OF_PERIOD_STOP_REASON:Qd.PlayListTrace.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&z()}function te(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e||(S||null);if(t){for(var n=t.getStreamInfo().start,r=t.getStreamInfo().duration,i=parseFloat((n+r).toFixed(5)),a=0,o=-1,s=NaN;a<A.length;){var u=A[a],l=u.getStreamInfo().start-i;l>=0&&(isNaN(s)||l<s)&&(s=l,o=a),a+=1}return o>=0?A[o]:null}return null}function ne(e,n,i){if(!(w||!e||n===e&&e.isActive())){w=!0,t.trigger(Fm.default.PERIOD_SWITCH_STARTED,{fromStreamInfo:n?n.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});var a=!1;n&&(a=Z(e,n),n.deactivate(a)),i=isNaN(i)?!a&&n?e.getStreamInfo().start:NaN:i,r.info("Switch to stream "+e.getId()+". Seektime is "+i+", current playback time is "+O.getTime()),r.info("Seamless period switch is set to "+a),S=e,k=k.filter((function(e){return e.getId()!==S.getId()})),O.initialize(pe(),!!n,i),D.getElement()?re(i,null===n,!1,a):ie(i,a)}}function re(e,n,i,a){var o=void 0;function s(){C&&"open"===C.readyState&&(r.debug("MediaSource is open!"),window.URL.revokeObjectURL(o),C.removeEventListener("sourceopen",s),C.removeEventListener("webkitsourceopen",s),ae(),n||t.trigger(Fm.default.SOURCE_INITIALIZED),i?S.setMediaSource(C):ie(e,a))}C?a?(ie(e,a),n||t.trigger(Fm.default.SOURCE_INITIALIZED)):(d.detachMediaSource(D),C.addEventListener("sourceopen",s,!1),C.addEventListener("webkitsourceopen",s,!1),o=d.attachMediaSource(C,D),r.debug("MediaSource attached to element. Waiting on open...")):((C=d.createMediaSource()).addEventListener("sourceopen",s,!1),C.addEventListener("webkitsourceopen",s,!1),o=d.attachMediaSource(C,D),r.debug("MediaSource attached to element. Waiting on open..."))}function ie(e,n){if(B=S.activate(C,n?B:void 0)){var r=Object.keys(B);r.length>0&&B[r[0]].changeType&&(G=!0)}F||isNaN(e)||(e===O.getTime()?t.trigger(Fm.default.SEEK_TARGET,{time:e},{streamId:S.getId()}):O.seek(e)),!R&&F||O.play(),w=!1,t.trigger(Fm.default.PERIOD_SWITCH_COMPLETED,{toStreamInfo:pe()})}function ae(e){var t=e||pe().manifestInfo.duration;d.setDuration(C,t)}function oe(e){for(var t=0,n=A.length;t<n;t++)if(A[t].getId()===e.id)return A[t];return null}function se(){try{var n=l.getStreamsInfo();if(0===n.length)throw new Error("There are no streams");f.updateManifestUpdateInfo({currentTime:O.getTime(),buffered:D.getBufferRange(),presentationStartTime:n[0].start,clientTimeOffset:T.getClientTimeOffset()}),A.length>0&&(A=A.filter((function(e){var t=n.filter((function(t){return t.id===e.getId()})).length>0||e.getId()===S.getId();return t||r.debug("Removing stream "+e.getId()),t})));for(var s=0,d=n.length;s<d;s++){var c=n[s],E=oe(c);E?E.updateData(c):(E=(0,Om.default)(e).create({manifestModel:u,mediaPlayerModel:P,dashMetrics:f,manifestUpdater:o,adapter:l,timelineConverter:T,capabilities:i,capabilitiesFilter:a,errHandler:v,baseURLController:h,abrController:g,playbackController:O,eventController:m,mediaController:p,textController:_,protectionController:b,videoModel:D,streamInfo:c,settings:j}),A.push(E),E.initialize()),f.addManifestUpdateStreamInfo(c)}if(!S){if(l.getIsDynamic()&&A.length){var y=n[0].manifestInfo,I=function(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=[Cm.default.VIDEO,Cm.default.AUDIO,Cm.default.FRAGMENTED_TEXT].reduce((function(e,t){var n=l.getMediaInfoForType(r,t);return n&&e.push(n),e}),[]).reduce((function(e,t){var n=l.getVoRepresentations(t);return n&&n.length>0&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=l.convertDataToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(i))}return isFinite(n)?n:NaN}catch(e){return NaN}}(n,y);O.computeAndSetLiveDelay(I,y.DVRWindowSize,y.minBufferTime)}var R=null;!(R=$(O.getStartTimeFromUriParameters(l.getIsDynamic())))&&l.getIsDynamic()&&A.length&&(r.debug("Dynamic stream: Trying to find the correct starting period"),R=function(){try{var e=T.calcPresentationTimeFromWallTime(new Date,l.getRegularPeriods()[0]),t=O.getLiveDelay();return $(e-t)}catch(e){return null}}()),ne(null!==R?R:A[0],null,NaN),x||(x=setInterval((function(){!w&&O.getTimeToStreamEnd()<=0&&t.trigger(Fm.default.PLAYBACK_ENDED,{isLast:pe().isLast})}),200)),W()}t.trigger(Fm.default.STREAMS_COMPOSED)}catch(e){v.error(new qm.default(Hm.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+"nostreamscomposed",u.getValue())),M=!0,ye()}}function ue(){var e=u.getValue();b&&(t.trigger(Fm.default.PROTECTION_CREATED,{controller:b,manifest:e}),b.setMediaElement(D.getElement()),I&&b.setProtectionData(I)),se()}function le(e){if(e.error)M=!0,ye();else{var n=e.manifest;l.updatePeriods(n);var i=l.getUTCTimingSources();!l.getIsDynamic()||i&&0!==i.length||t.trigger(Gm.default.CONFORMANCE_VIOLATION,{level:Vm.default.LEVELS.WARNING,event:Vm.default.EVENTS.NO_UTC_TIMING_ELEMENT});var a=l.getIsDynamic()?i.concat(P.getUTCTimingSources()):i,o=y.isHTTPS(e.manifest.url);a.forEach((function(e){e.value.replace(/.*?:\/\//g,"")===P.getDefaultUtcTimingSource().value.replace(/.*?:\/\//g,"")&&(e.value=e.value.replace(o?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),o?"https://":"http://"),r.debug("Matching default timing source protocol to manifest protocol: ",e.value))})),h.initialize(n),c.attemptSync(a)}}function fe(){return!!S&&S.getHasVideoTrack()}function de(){return!!S&&S.getHasAudioTrack()}function ce(e,t){t=t||new Date,J().forEach((function(n){n.finalisePlayList(t,e)})),f.addPlayList()}function he(e){f.createPlaylistMetrics(1e3*O.getTime(),e)}function ge(e){if(e.error){var t="";switch(e.error.code){case 1:t="MEDIA_ERR_ABORTED";break;case 2:t="MEDIA_ERR_NETWORK";break;case 3:t="MEDIA_ERR_DECODE";break;case 4:t="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:t="MEDIA_ERR_ENCRYPTED";break;default:t="UNKNOWN"}N=!0,e.error.message&&(t+=" ("+e.error.message+")"),e.error.msExtendedCode&&(t+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),r.fatal("Video Element Error: "+t),e.error&&r.fatal(e.error),v.error(new qm.default(e.error.code,t)),ye()}}function pe(){return S?S.getStreamInfo():null}function me(){if(!(s&&s.hasOwnProperty("load")&&T&&T.hasOwnProperty("initialize")&&T.hasOwnProperty("reset")&&T.hasOwnProperty("getClientTimeOffset")&&u&&v&&f&&O))throw new Error(Cm.default.MISSING_CONFIG_ERROR)}function _e(e){isNaN(e.newDuration)||ae(e.newDuration)}function Ee(){A=[],b=null,w=!1,S=null,N=!1,M=!1,F=!0,L=!1,R=!0,x=null,U=null,k=[]}function ye(){me(),c.reset(),ce(N||M?Qd.PlayListTrace.FAILURE_STOP_REASON:Qd.PlayListTrace.USER_REQUEST_STOP_REASON);for(var e=0,r=A?A.length:0;e<r;e++){A[e].reset(N)}t.off(Fm.default.PLAYBACK_TIME_UPDATED,Y,n),t.off(Fm.default.PLAYBACK_SEEKING,q,n),t.off(Fm.default.GAP_CAUSED_SEEK_TO_PERIOD_END,H,n),t.off(Fm.default.PLAYBACK_ERROR,ge,n),t.off(Fm.default.PLAYBACK_STARTED,K,n),t.off(Fm.default.PLAYBACK_PAUSED,V,n),t.off(Fm.default.PLAYBACK_ENDED,ee,n),t.off(Fm.default.MANIFEST_UPDATED,le,n),t.off(Fm.default.STREAM_BUFFERING_COMPLETED,Q,n),t.off(Fm.default.MANIFEST_VALIDITY_CHANGED,_e,n),t.off(Fm.default.TIME_SYNCHRONIZATION_COMPLETED,ue,n),t.off(Gm.default.METRIC_ADDED,ve,n),h.reset(),o.reset(),m.reset(),f.clearAllCurrentMetrics(),u.setValue(null),s.reset(),T.reset(),E.reset(),C&&(d.detachMediaSource(D),C=null),D=null,b&&(b.setMediaElement(null),b=null,I=null,u.getValue()&&t.trigger(Fm.default.PROTECTION_DESTROYED,{data:u.getValue().url})),z(),clearInterval(U),U=null,t.trigger(Fm.default.STREAM_TEARDOWN_COMPLETE),Ee()}function ve(e){if(e.metric===Dm.default.DVR_INFO){var t=de()?Cm.default.AUDIO:Cm.default.VIDEO;e.mediaType===t&&d.setSeekable(C,e.value.range.start,e.value.range.end)}}return n={initialize:function(r,i){me(),R=r,I=i,T.initialize(),(o=(0,Pm.default)(e).create()).setConfig({manifestModel:u,adapter:l,manifestLoader:s,errHandler:v,settings:j}),o.initialize(),(m=(0,Km.default)(e).getInstance()).setConfig({manifestUpdater:o,playbackController:O,settings:j}),m.start(),c.setConfig({dashMetrics:f,baseURLController:h,settings:j}),c.initialize(),t.on(Fm.default.PLAYBACK_TIME_UPDATED,Y,n),t.on(Fm.default.PLAYBACK_SEEKING,q,n),t.on(Fm.default.GAP_CAUSED_SEEK_TO_PERIOD_END,H,n),t.on(Fm.default.PLAYBACK_ERROR,ge,n),t.on(Fm.default.PLAYBACK_STARTED,K,n),t.on(Fm.default.PLAYBACK_PAUSED,V,n),t.on(Fm.default.PLAYBACK_ENDED,ee,n,{priority:Lm.default.EVENT_PRIORITY_HIGH}),t.on(Fm.default.MANIFEST_UPDATED,le,n),t.on(Fm.default.STREAM_BUFFERING_COMPLETED,Q,n),t.on(Fm.default.MANIFEST_VALIDITY_CHANGED,_e,n),t.on(Fm.default.TIME_SYNCHRONIZATION_COMPLETED,ue,n),t.on(Gm.default.METRIC_ADDED,ve,n)},getActiveStreamInfo:pe,hasVideoTrack:fe,hasAudioTrack:de,switchToVideoElement:function(e){S&&(O.initialize(pe()),re(e,!1,!0,!1))},getStreamById:function(e){return A.filter((function(t){return t.getId()===e}))[0]},getStreamForTime:$,getTimeRelativeToStreamId:function(e,t){for(var n=null,r=0,i=0,a=null,o=0;o<A.length;o++){if(i=(n=A[o]).getStartTime(),a=n.getDuration(),Number.isFinite(i)&&(r=i),n.getId()===t)return e-r;Number.isFinite(a)&&(r+=a)}return null},load:function(e){me(),s.load(e)},loadWithManifest:function(e){!function(){if(!o||!o.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")}(),o.setManifest(e)},getActiveStreamProcessors:J,setConfig:function(e){e&&(e.capabilities&&(i=e.capabilities),e.capabilitiesFilter&&(a=e.capabilitiesFilter),e.manifestLoader&&(s=e.manifestLoader),e.manifestModel&&(u=e.manifestModel),e.mediaPlayerModel&&(P=e.mediaPlayerModel),e.protectionController&&(b=e.protectionController),e.adapter&&(l=e.adapter),e.dashMetrics&&(f=e.dashMetrics),e.errHandler&&(v=e.errHandler),e.timelineConverter&&(T=e.timelineConverter),e.videoModel&&(D=e.videoModel),e.playbackController&&(O=e.playbackController),e.abrController&&(g=e.abrController),e.mediaController&&(p=e.mediaController),e.textController&&(_=e.textController),e.settings&&(j=e.settings),e.baseURLController&&(h=e.baseURLController))},setProtectionData:function(e){I=e},getIsStreamSwitchInProgress:function(){return w},getHasMediaOrIntialisationError:function(){return N||M},hasStreamFinishedBuffering:X,getStreams:function(){return A},getActiveStream:function(){return S},reset:ye},r=(0,Um.default)(e).getInstance().getLogger(n),c=(0,jm.default)(e).getInstance(),d=(0,Ym.default)(e).getInstance(),E=(0,Bm.default)(e).getInstance(),y=(0,km.default)(e).getInstance(),Ee(),n}Wm.__dashjs_factory_name="StreamController";var Xm=xm.default.getSingletonFactory(Wm),Qm=Object.defineProperty({default:Xm},"__esModule",{value:!0}),Zm=t_(v),$m=t_(Z),Jm=t_(B),e_=t_(P);function t_(e){return e&&e.__esModule?e:{default:e}}function n_(){var e=this.context,t=(0,e_.default)(e).getInstance(),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0;function h(){c.debug("Stopping the gap controller"),o&&(clearInterval(o),o=null),function(){t.off(Jm.default.WALLCLOCK_TIME_UPDATED,m,this),t.off(Jm.default.PLAYBACK_SEEKING,p,this),t.off(Jm.default.BYTES_APPENDED_END_FRAGMENT,g,n)}(),o=null,s=NaN,a=0,d=null}function g(){o||function(){try{o||(c.debug("Starting the gap controller"),o=setInterval((function(){_()&&y(u.getTime())}),100))}catch(e){}}()}function p(){d&&(clearTimeout(d),d=null)}function m(){if(_()&&++a>=30){var e=u.getTime();r===e?y(e,!0):(r=e,s=NaN),a=0}}function _(){return i.get().streaming.jumpGaps&&l.getActiveStreamProcessors().length>0&&(!u.isSeeking()||l.hasStreamFinishedBuffering(l.getActiveStream()))&&!u.isPaused()&&!l.getIsStreamSwitchInProgress()&&!l.getHasMediaOrIntialisationError()}function E(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var n=NaN,r=0;isNaN(n)&&r<e.length;){var i=r>0?e.end(r-1):0;t<e.start(r)&&i-t<.1&&(n=r),r+=1}return n}catch(e){return null}}function y(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=i.get().streaming.smallGapLimit,a=i.get().streaming.jumpLargeGaps,o=f.getBufferRange(),l=void 0,h=NaN,g=!1;if(l=E(o,e),!isNaN(l)){var p=o.start(l),m=p-e;m>0&&(m<=r||a)&&(h=p)}var _=u.getTimeToStreamEnd();if(isNaN(h)&&n&&isFinite(_)&&!isNaN(_)&&_<r&&(h=parseFloat(u.getStreamEndTime().toFixed(5)),g=!0),h>0&&s!==h&&h>e&&!d){var y=h-e;if(g)c.warn("Jumping to end of stream because of gap from "+e+" to "+h+". Gap duration: "+y),t.trigger(Jm.default.GAP_CAUSED_SEEK_TO_PERIOD_END,{seekTime:h,duration:y});else{var v=u.getIsDynamic(),T=l>0?o.end(l-1):e,A=v?1e3*y:0;d=window.setTimeout((function(){u.seek(h,!0,!0),c.warn("Jumping gap starting at "+T+" and ending at "+h+". Jumping by: "+y),t.trigger(Jm.default.GAP_CAUSED_INTERNAL_SEEK,{seekTime:h,duration:y}),d=null}),A)}s=h}}return n={reset:h,setConfig:function(e){e&&(e.settings&&(i=e.settings),e.playbackController&&(u=e.playbackController),e.streamController&&(l=e.streamController),e.videoModel&&(f=e.videoModel),e.timelineConverter&&e.timelineConverter,e.adapter&&e.adapter)},initialize:function(){!function(){t.on(Jm.default.WALLCLOCK_TIME_UPDATED,m,this),t.on(Jm.default.PLAYBACK_SEEKING,p,this),t.on(Jm.default.BYTES_APPENDED_END_FRAGMENT,g,n)}()}},c=(0,$m.default)(e).getInstance().getLogger(n),h(),n}n_.__dashjs_factory_name="GapController";var r_=Zm.default.getSingletonFactory(n_),i_=Object.defineProperty({default:r_},"__esModule",{value:!0}),a_=f_(c),o_=f_(B),s_=f_(P),u_=f_(v),l_=f_(Z);function f_(e){return e&&e.__esModule?e:{default:e}}function d_(){var e=this.context,t=(0,s_.default)(e).getInstance(),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=[a_.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,a_.default.TRACK_SWITCH_MODE_NEVER_REPLACE],l=[a_.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE,a_.default.TRACK_SELECTION_MODE_FIRST_TRACK,a_.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY,a_.default.TRACK_SELECTION_MODE_WIDEST_RANGE];function f(e,t){if(!e||!t)return[];var n=t.id;return i[n]&&i[n][e]?i[n][e].list:[]}function d(e,t){return!e||!t||t&&!i[t.id]?null:i[t.id][e].current}function c(e,n){if(e&&e.streamInfo){var r=e.type,a=e.streamInfo,o=a.id,u=d(r,a);if(i[o]&&i[o][r]&&!E(e,u)&&(i[o][r].current=e,!i[o][r].current||n&&r===a_.default.FRAGMENTED_TEXT||t.trigger(o_.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:u,newMediaInfo:e,switchMode:p(r)}),!n)){var l=function(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}(e);if(!l||!i[o][r].storeLastSettings)return;l.roles&&(l.role=l.roles[0],delete l.roles),l.accessibility&&(l.accessibility=l.accessibility[0]),l.audioChannelConfiguration&&(l.audioChannelConfiguration=l.audioChannelConfiguration[0]),s.setSavedMediaSettings(r,l)}}}function h(e,t){e&&t&&(o[e]=t)}function g(e){return e?o[e]:null}function p(e){return a.get().streaming.trackSwitchMode[e]}function m(){return a.get().streaming.selectionModeForInitialTrack}function _(e){return e===a_.default.AUDIO||e===a_.default.VIDEO||e===a_.default.TEXT||e===a_.default.FRAGMENTED_TEXT||e===a_.default.IMAGE}function E(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.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),s=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&r&&i&&a&&o&&s}function y(){i={},o={audio:null,video:null,fragmentedText:null}}function v(e,t){var n=!e.lang||t.lang.match(e.lang),r=void 0===e.index||null===e.index||t.index===e.index,i=!e.viewpoint||e.viewpoint===t.viewpoint,a=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],o=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],s=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return n&&r&&i&&a&&o&&s}function T(e){var t=0,n=[],r=void 0;return e.forEach((function(e){(r=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))))>t?(t=r,n=[e]):r===t&&n.push(e)})),n}function A(e){var t=1/0,n=[],r=void 0;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);(r=i/e.bitrateList.length)<t?(t=r,n=[e]):r===t&&n.push(e)})),n}function S(e){var t=0,n=[],r=void 0;return e.forEach((function(e){(r=e.representationCount)>t?(t=r,n=[e]):r===t&&n.push(e)})),n}return n={checkInitialMediaSettingsForType:function(e,t){var n=g(e),r=f(e,t),i=[];n||h(e,n=s.getSavedMediaSettings(e)),r&&0!==r.length&&(n&&r.forEach((function(e){v(n,e)&&i.push(e)})),0===i.length?c(this.selectInitialTrack(e,r),!0):i.length>1?c(this.selectInitialTrack(e,i)):c(i[0]))},addTrack:function(e){if(e){var t=e.type;if(_(t)){var n=e.streamInfo.id;i[n]||(i[n]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},fragmentedText:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var r=i[n][t].list,a=0,o=r.length;a<o;++a)if(E(r[a],e))return;r.push(e);var s=g(t);s&&v(s,e)&&!d(t,e.streamInfo)&&c(e)}}},getTracksFor:f,getCurrentTrackFor:d,isCurrentTrack:function(e){if(!e)return!1;var t=e.type,n=e.streamInfo.id;return i[n]&&i[n][t]&&E(i[n][t].current,e)},setTrack:c,setInitialSettings:h,getInitialSettings:g,setSwitchMode:function(e,t){if(r.warn("deprecated: Please use updateSettings({streaming: { trackSwitchMode: mode } }) instead"),-1!==u.indexOf(t)){var n={};n[e]=t,a.update({streaming:{trackSwitchMode:n}})}else r.warn("Track switch mode is not supported: "+t)},getSwitchMode:p,selectInitialTrack:function(e,t){if(e===a_.default.FRAGMENTED_TEXT)return t[0];var n=m(),i=[];switch(n){case a_.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE:(i=T(t)).length>1&&(i=S(i));break;case a_.default.TRACK_SELECTION_MODE_FIRST_TRACK:i.push(t[0]);break;case a_.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:(i=A(t)).length>1&&(i=T(i));break;case a_.default.TRACK_SELECTION_MODE_WIDEST_RANGE:(i=S(t)).length>1&&(i=T(t));break;default:r.warn("Track selection mode is not supported: "+n)}return i[0]},getTracksWithHighestBitrate:T,getTracksWithHighestEfficiency:A,getTracksWithWidestRange:S,setSelectionModeForInitialTrack:function(e){r.warn("deprecated: Please use updateSettings({streaming: { selectionModeForInitialTrack: mode } }) instead"),-1!==l.indexOf(e)?a.update({streaming:{selectionModeForInitialTrack:e}}):r.warn("Track selection mode is not supported: "+e)},getSelectionModeForInitialTrack:m,isMultiTrackSupportedByType:_,isTracksEqual:E,matchSettings:v,saveTextSettingsDisabled:function(){s.setSavedMediaSettings(a_.default.FRAGMENTED_TEXT,null)},setConfig:function(e){e&&(e.domStorage&&(s=e.domStorage),e.settings&&(a=e.settings))},reset:y},r=(0,l_.default)(e).getInstance().getLogger(n),y(),n}d_.__dashjs_factory_name="MediaController";var c_=u_.default.getSingletonFactory(d_);u_.default.updateSingletonFactory(d_.__dashjs_factory_name,c_);var h_=c_,g_=Object.defineProperty({default:h_},"__esModule",{value:!0}),p_=__(bh),m_=__(v);function __(e){return e&&e.__esModule?e:{default:e}}var E_=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||NaN},this.children=[]};function y_(){var e,t=void 0,n=void 0,r=this.context,i=(0,p_.default)(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=NaN):e[t]=new E_(a)}function o(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=NaN),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)}))}))}))}function s(){t=new E_}return e={reset:s,update:function(e){o(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){!function e(n,r){var i=r||t;n(i.data),i.children&&i.children.forEach((function(t){return e(n,t)}))}((function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=NaN)}))},setConfig:function(e){e.adapter&&(n=e.adapter)}},s(),e}y_.__dashjs_factory_name="BaseURLTreeModel";var v_=m_.default.getClassFactory(y_),T_=Object.defineProperty({default:v_},"__esModule",{value:!0}),A_=b_(v),S_=b_(P);function b_(e){return e&&e.__esModule?e:{default:e}}function I_(e){e=e||{};var t=void 0,n=[],r=(0,S_.default)(this.context).getInstance(),i=e.updateEventName,a=e.addBlacklistEventName;function o(e){-1===n.indexOf(e)&&(n.push(e),r.trigger(i,{entry:e}))}function s(e){o(e.entry)}return t={add:o,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.indexOf(e)},reset:function(){n=[]}},a&&r.on(a,s,t),t}I_.__dashjs_factory_name="BlackListController";var R_=A_.default.getClassFactory(I_),w_=Object.defineProperty({default:R_},"__esModule",{value:!0}),N_=function(e){return e&&e.__esModule?e:{default:e}}(v);function M_(e){var t=(e=e||{}).blacklistController;return{select:function(e){return e&&function(e){var t=0,n=[],r=0,i=void 0,a=void 0;if((a=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 a.length>1&&(a.forEach((function(e){t+=e.dvb_weight,n.push(t)})),i=Math.floor(Math.random()*(t-1)),n.every((function(e,t){return r=t,!(i<e)}))),a[r]}((n=[],e.filter((function(e){return!t.contains(e.serviceLocation)||(e.dvb_priority&&n.push(e.dvb_priority),!1)})).filter((function(e){return!n.length||!e.dvb_priority||-1===n.indexOf(e.dvb_priority)}))));var n}}}M_.__dashjs_factory_name="DVBSelector";var C_=N_.default.getClassFactory(M_),D_=Object.defineProperty({default:C_},"__esModule",{value:!0}),O_=function(e){return e&&e.__esModule?e:{default:e}}(v);function P_(e){var t=(e=e||{}).blacklistController;return{select:function(e){var n=0,r=void 0;return e&&e.some((function(e,r){return n=r,!t.contains(e.serviceLocation)}))&&(r=e[n]),r}}}P_.__dashjs_factory_name="BasicSelector";var L_=O_.default.getClassFactory(P_),F_=Object.defineProperty({default:L_},"__esModule",{value:!0}),x_=H_(ra),U_=H_(P),B_=H_(B),k_=H_(w_),G_=H_(D_),j_=H_(F_),Y_=H_(v),q_=H_(Ie);function H_(e){return e&&e.__esModule?e:{default:e}}function K_(){var e,t=this.context,n=(0,U_.default)(t).getInstance(),r=void 0,i=void 0,a=void 0,o=void 0;function s(){r.reset()}return e={chooseSelector:function(e){(0,et.checkParameterType)(e,"boolean"),o=e?a:i},select:function(e){if(e){var t=e.baseUrls,r=e.selectedIdx;if(!isNaN(r))return t[r];var a=o.select(t);return a?(e.selectedIdx=t.indexOf(a),a):(n.trigger(B_.default.URL_RESOLUTION_FAILED,{error:new q_.default(x_.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,x_.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(o===i&&s()))}},reset:s,setConfig:function(e){e.selector&&(o=e.selector)}},r=(0,k_.default)(t).create({updateEventName:B_.default.SERVICE_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:B_.default.SERVICE_LOCATION_BLACKLIST_ADD}),i=(0,j_.default)(t).create({blacklistController:r}),a=(0,G_.default)(t).create({blacklistController:r}),o=i,e}K_.__dashjs_factory_name="BaseURLSelector";var V_=Y_.default.getClassFactory(K_),z_=Object.defineProperty({default:V_},"__esModule",{value:!0}),W_=tE(T_),X_=tE(z_),Q_=tE(Hd),Z_=tE(hh),$_=tE(v),J_=tE(P),eE=tE(B);function tE(e){return e&&e.__esModule?e:{default:e}}function nE(){var e=void 0,t=void 0,n=this.context,r=(0,J_.default)(n).getInstance(),i=(0,Q_.default)(n).getInstance(),a=void 0,o=void 0;function s(e){a.invalidateSelectedIndexes(e.entry)}return e={reset:function(){a.reset(),o.reset()},initialize:function(e){var n;a.setConfig({adapter:t}),n=e,a.update(n),o.chooseSelector(t.getIsDVB(n))},resolve:function(e){var t=a.getForPath(e).reduce((function(e,t){var n=o.select(t);return n?(i.isRelative(n.url)?e.url=i.resolve(n.url,e.url):(e.url=n.url,e.serviceLocation=n.serviceLocation),e.availabilityTimeOffset=n.availabilityTimeOffset,e.availabilityTimeComplete=n.availabilityTimeComplete,e):new Z_.default}),new Z_.default);if(!i.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(a=e.baseURLTreeModel),e.baseURLSelector&&(o=e.baseURLSelector),e.adapter&&(t=e.adapter)}},a=(0,W_.default)(n).create(),o=(0,X_.default)(n).create(),r.on(eE.default.SERVICE_LOCATION_BLACKLIST_CHANGED,s,e),e}nE.__dashjs_factory_name="BaseURLController";var rE=$_.default.getClassFactory(nE),iE=Object.defineProperty({default:rE},"__esModule",{value:!0}),aE=oE(c);function oE(e){return e&&e.__esModule?e:{default:e}}var sE=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.url=e||null,r.type=n||null,r.mediaType=aE.default.STREAM,r.responseType="",r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(oE(me).default),uE=Object.defineProperty({default:sE},"__esModule",{value:!0}),lE=mE(Ie),fE=mE(Vg),dE=mE(uE),cE=mE(P),hE=mE(B),gE=mE(v),pE=mE(ra);function mE(e){return e&&e.__esModule?e:{default:e}}function _E(e){e=e||{};var t=this.context,n=(0,cE.default)(t).getInstance(),r=(0,fE.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings?e.settings.get().streaming.lowLatencyEnabled:null,errors:pE.default});return{load:function(e,t,i){var a=function(r,a){t.resolved=!0,t.resolvedContent=r||null,n.trigger(hE.default.XLINK_ELEMENT_LOADED,{element:t,resolveObject:i,error:r||a?null:new lE.default(pE.default.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,pE.default.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if("urn:mpeg:dash:resolve-to-zero:2013"===e)a(null,!0);else{var o=new dE.default(e,ce.HTTPRequest.XLINK_EXPANSION_TYPE);r.load({request:o,success:function(e){a(e)},error:function(){a(null)}})}},reset:function(){r&&(r.abort(),r=null)}}}_E.__dashjs_factory_name="XlinkLoader";var EE=gE.default.getClassFactory(_E),yE=Object.defineProperty({default:EE},"__esModule",{value:!0});var vE=function(e){e=e||{},function(){void 0===e.escapeMode&&(e.escapeMode=!0);void 0===e.attributePrefix&&(e.attributePrefix="_");e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0);e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0);void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0);e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1);e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1);void 0===e.ignoreRoot&&(e.ignoreRoot=!1)}();var t=1,n=3,r=4,i=8,a=9;function o(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function s(e){return"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"):e}function u(e,t,n,r){for(var i=0;i<e.length;i++){var a=e[i];if("string"==typeof a){if(a==r)break}else if(a instanceof RegExp){if(a.test(r))break}else if("function"==typeof a&&a(t,n,r))break}return i!=e.length}function l(t,n,r){switch(e.arrayAccessForm){case"property":t[n]instanceof Array?t[n+"_asArray"]=t[n]:t[n+"_asArray"]=[t[n]]}!(t[n]instanceof Array)&&e.arrayAccessFormPaths.length>0&&u(e.arrayAccessFormPaths,t,n,r)&&(t[n]=[t[n]])}function f(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 d(n,r,i,a){return!(r==t&&e.xmlElementsFilter.length>0)||u(e.xmlElementsFilter,n,i,a)}function c(s,h){if(s.nodeType==a){for(var g=new Object,p=s.childNodes,m=0;m<p.length;m++){if((E=p[m]).nodeType==t)if(e.ignoreRoot)g=c(E);else(g={})[y=o(E)]=c(E)}return g}if(s.nodeType==t){(g=new Object).__cnt=0;var _=[];for(p=s.childNodes,m=0;m<p.length;m++){var E,y=o(E=p[m]);if(E.nodeType!=i){var v=h+"."+y;if(d(g,E.nodeType,y,v))if(g.__cnt++,null==g[y]){var T=c(E,v);if("#text"!=y||/[^\s]/.test(T))(A={})[y]=T,_.push(A);g[y]=T,l(g,y,v)}else{null!=g[y]&&(g[y]instanceof Array||(g[y]=[g[y]],l(g,y,v)));var A;T=c(E,v);if("#text"!=y||/[^\s]/.test(T))(A={})[y]=T,_.push(A);g[y][g[y].length]=T}}}g.__children=_;for(var S=o(s),b=0;b<s.attributes.length;b++){var I=s.attributes[b];g.__cnt++;for(var R=I.value,w=0,N=e.matchers.length;w<N;w++){var M=e.matchers[w];M.test(I,S)&&(R=M.converter(I.value))}g[e.attributePrefix+I.name]=R}var C=function(e){return e.prefix}(s);return null!=C&&""!=C&&(g.__cnt++,g.__prefix=C),null!=g["#text"]&&(g.__text=g["#text"],g.__text instanceof Array&&(g.__text=g.__text.join("\n")),e.stripWhitespaces&&(g.__text=g.__text.trim()),delete g["#text"],"property"==e.arrayAccessForm&&delete g["#text_asArray"],g.__text=function(t,n,r){if(e.datetimeAccessFormPaths.length>0){var i=r.split(".#")[0];return u(e.datetimeAccessFormPaths,t,n,i)?f(t):t}return t}(g.__text,y,h+"."+y)),null!=g["#cdata-section"]&&(g.__cdata=g["#cdata-section"],delete g["#cdata-section"],"property"==e.arrayAccessForm&&delete g["#cdata-section_asArray"]),0==g.__cnt&&"text"==e.emptyNodeForm?g="":1==g.__cnt&&null!=g.__text?g=g.__text:1!=g.__cnt||null==g.__cdata||e.keepCData?g.__cnt>1&&null!=g.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==g.__text||""==g.__text.trim())&&delete g.__text:g=g.__cdata,delete g.__cnt,!e.enableToStringFunc||null==g.__text&&null==g.__cdata||(g.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),g}if(s.nodeType==n||s.nodeType==r)return s.nodeValue}function h(t,n,r,i){var a="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=r)for(var o=0;o<r.length;o++){var u=r[o],l=t[u];e.escapeMode&&(l=s(l)),a+=" "+u.substr(e.attributePrefix.length)+"=",e.useDoubleQuotes?a+='"'+l+'"':a+="'"+l+"'"}return a+=i?"/>":">"}function g(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">"}function p(t,n){return"property"==e.arrayAccessForm&&(r=n.toString(),i="_asArray",-1!==r.indexOf(i,r.length-i.length))||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function;var r,i}function m(e){var t=0;if(e instanceof Object)for(var n in e)p(e,n)||t++;return t}function _(t,n,r){return 0==e.jsonPropertiesFilter.length||""==r||u(e.jsonPropertiesFilter,t,n,r)}function E(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 y(t){var n="";return t instanceof Object?n+=function(t){var n="";return null!=t.__cdata&&(n+="<![CDATA["+t.__cdata+"]]>"),null!=t.__text&&(e.escapeMode?n+=s(t.__text):n+=t.__text),n}(t):null!=t&&(e.escapeMode?n+=s(t):n+=t),n}function v(e,t){return""===e?t:e+"."+t}function T(e,t,n,r){var i="";if(0==e.length)i+=h(e,t,n,!0);else for(var a=0;a<e.length;a++)i+=h(e[a],t,E(e[a]),!1),i+=A(e[a],v(r,t)),i+=g(e[a],t);return i}function A(e,t){var n="";if(m(e)>0)for(var r in e)if(!p(e,r)&&(""==t||_(e,r,v(t,r)))){var i=e[r],a=E(i);if(null==i||null==i)n+=h(i,r,a,!0);else if(i instanceof Object)if(i instanceof Array)n+=T(i,r,a,t);else if(i instanceof Date)n+=h(i,r,a,!1),n+=i.toISOString(),n+=g(i,r);else{m(i)>0||null!=i.__text||null!=i.__cdata?(n+=h(i,r,a,!1),n+=A(i,v(t,r)),n+=g(i,r)):n+=h(i,r,a,!0)}else n+=h(i,r,a,!1),n+=y(i),n+=g(i,r)}return n+=y(e)}this.parseXmlString=function(e){if(void 0===e)return null;var t;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("<?")&&(e=e.substr(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?f(e):e},this.xml2json=function(e){return c(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return A(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}},TE=Object.defineProperty({default:vE},"__esModule",{value:!0}),AE=ME(yE),SE=ME(P),bE=ME(B),IE=ME(v),RE=ME(TE),wE=ME(Hd),NE=ME(p);function ME(e){return e&&e.__esModule?e:{default:e}}function CE(e){e=e||{};var t=this.context,n=(0,SE.default)(t).getInstance(),r=(0,wE.default)(t).getInstance(),i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0;function f(e,t,n){var i={},a=void 0,o=void 0;i.elements=e,i.type=t,i.resolveType=n,0===i.elements.length&&c(i);for(var s=0;s<i.elements.length;s++)a=i.elements[s],o=r.isHTTPURL(a.url)?a.url:a.originalContent.BaseURL+a.url,l.load(o,a,i)}function d(e){var t,n=void 0,r="";if(n=e.element,t=e.resolveObject,n.resolvedContent){var i=0;0===n.resolvedContent.indexOf("<?xml")&&(i=n.resolvedContent.indexOf("?>")+2),r=n.resolvedContent.substr(0,i)+"<response>"+n.resolvedContent.substr(i)+"</response>",n.resolvedContent=u.xml_str2json(r)}(function(e){var t=void 0;for(t=0;t<e.elements.length;t++)if(!1===e.elements[t].resolved)return!1;return!0})(t)&&c(t)}function c(e){var t=[],r=void 0,i=void 0;if(function(e){var t=[],n=void 0,r=void 0,i=void 0,a=void 0,u=void 0,l=void 0;for(a=e.elements.length-1;a>=0;a--){if(n=e.elements[a],r=n.type+"_asArray",n.resolvedContent){if(n.resolvedContent)for(u=0;u<n.resolvedContent[r].length;u++)i=n.resolvedContent[r][u],t.push(i)}else delete n.originalContent["xlink:actuate"],delete n.originalContent["xlink:href"],t.push(n.originalContent);for(n.parentElement[r].splice(n.index,1),l=0;l<t.length;l++)n.parentElement[r].splice(n.index+l,0,t[l]);t=[]}e.elements.length>0&&o.run(s)}(e),"onActuate"===e.resolveType&&n.trigger(bE.default.XLINK_READY,{manifest:s}),"onLoad"===e.resolveType)switch(e.type){case NE.default.PERIOD:for(r=0;r<s[NE.default.PERIOD+"_asArray"].length;r++)(i=s[NE.default.PERIOD+"_asArray"][r]).hasOwnProperty(NE.default.ADAPTATION_SET+"_asArray")&&(t=t.concat(h(i[NE.default.ADAPTATION_SET+"_asArray"],i,NE.default.ADAPTATION_SET,"onLoad"))),i.hasOwnProperty(NE.default.EVENT_STREAM+"_asArray")&&(t=t.concat(h(i[NE.default.EVENT_STREAM+"_asArray"],i,NE.default.EVENT_STREAM,"onLoad")));f(t,NE.default.ADAPTATION_SET,"onLoad");break;case NE.default.ADAPTATION_SET:n.trigger(bE.default.XLINK_READY,{manifest:s})}}function h(e,t,n,r){var i=[],a=void 0,o=void 0,s=void 0;for(o=e.length-1;o>=0;o--)(a=e[o]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===a["xlink:href"]&&e.splice(o,1);for(o=0;o<e.length;o++)(a=e[o]).hasOwnProperty("xlink:href")&&a.hasOwnProperty("xlink:actuate")&&a["xlink:actuate"]===r&&(s=g(a["xlink:href"],t,n,o,r,a),i.push(s));return i}function g(e,t,n,r,i,a){return{url:e,parentElement:t,type:n,index:r,resolveType:i,originalContent:a,resolvedContent:null,resolved:!1}}return i={resolveManifestOnLoad:function(e){u=new RE.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!1,ignoreRoot:!0,matchers:a}),(s=e).Period_asArray?f(h(s.Period_asArray,s,NE.default.PERIOD,"onLoad"),NE.default.PERIOD,"onLoad"):n.trigger(bE.default.XLINK_READY,{manifest:s})},setMatchers:function(e){e&&(a=e)},setIron:function(e){e&&(o=e)},reset:function(){n.off(bE.default.XLINK_ELEMENT_LOADED,d,i),l&&(l.reset(),l=null)}},n.on(bE.default.XLINK_ELEMENT_LOADED,d,i),l=(0,AE.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),i}CE.__dashjs_factory_name="XlinkController";var DE=IE.default.getClassFactory(CE),OE=Object.defineProperty({default:DE},"__esModule",{value:!0}),PE="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},LE=function(e){return e&&e.__esModule?e:{default:e}}(v);function FE(e){function t(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function n(e,n,r){for(var i=0,a=e.length;i<a;++i){var o=e[i];if(n[o.name])if(r[o.name]){if(o.merge){var s=n[o.name],u=r[o.name];"object"===(void 0===s?"undefined":PE(s))&&"object"===(void 0===u?"undefined":PE(u))?t(s,u):r[o.name]=s+u}}else r[o.name]=n[o.name]}}function r(e,t){for(var i=0,a=e.children.length;i<a;++i){var o=e.children[i],s=t[o.name+"_asArray"];if(s)for(var u=0,l=s.length;u<l;++u){var f=s[u];n(e.properties,t,f),r(o,f)}}}return{run:function(t){if(null===t||"object"!==(void 0===t?"undefined":PE(t)))return t;if(t.Period_asArray&&"period"in e)for(var n=e.period,i=t.Period_asArray,a=0,o=i.length;a<o;++a){var s=i[a];if(r(n,s),"adaptationset"in e){var u=s.AdaptationSet_asArray;if(u)for(var l=e.adaptationset,f=0,d=u.length;f<d;++f)r(l,u[f])}}return t}}}FE.__dashjs_factory_name="ObjectIron";var xE=LE.default.getClassFactory(FE),UE=Object.defineProperty({default:xE},"__esModule",{value:!0}),BE=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var kE=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._test=t,this._converter=n}return BE(e,[{key:"test",get:function(){return this._test}},{key:"converter",get:function(){return this._converter}}]),e}(),GE=Object.defineProperty({default:kE},"__esModule",{value:!0}),jE=qE(GE),YE=qE(p);function qE(e){return e&&e.__esModule?e:{default:e}}function HE(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var KE=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(function(e,t){var n,r=(HE(n={},YE.default.MPD,[YE.default.ID,YE.default.PROFILES]),HE(n,YE.default.PERIOD,[YE.default.ID]),HE(n,YE.default.BASE_URL,[YE.default.SERVICE_LOCATION,YE.default.BYTE_RANGE]),HE(n,YE.default.SEGMENT_BASE,[YE.default.INDEX_RANGE]),HE(n,YE.default.INITIALIZATION,[YE.default.RANGE]),HE(n,YE.default.REPRESENTATION_INDEX,[YE.default.RANGE]),HE(n,YE.default.SEGMENT_LIST,[YE.default.INDEX_RANGE]),HE(n,YE.default.BITSTREAM_SWITCHING,[YE.default.RANGE]),HE(n,YE.default.SEGMENT_URL,[YE.default.MEDIA_RANGE,YE.default.INDEX_RANGE]),HE(n,YE.default.SEGMENT_TEMPLATE,[YE.default.INDEX_RANGE,YE.default.MEDIA,YE.default.INDEX,YE.default.INITIALIZATION_MINUS,YE.default.BITSTREAM_SWITCHING_MINUS]),HE(n,YE.default.ASSET_IDENTIFIER,[YE.default.VALUE,YE.default.ID]),HE(n,YE.default.EVENT_STREAM,[YE.default.VALUE]),HE(n,YE.default.ADAPTATION_SET,[YE.default.PROFILES,YE.default.MIME_TYPE,YE.default.SEGMENT_PROFILES,YE.default.CODECS,YE.default.CONTENT_TYPE]),HE(n,YE.default.FRAME_PACKING,[YE.default.VALUE,YE.default.ID]),HE(n,YE.default.AUDIO_CHANNEL_CONFIGURATION,[YE.default.VALUE,YE.default.ID]),HE(n,YE.default.CONTENT_PROTECTION,[YE.default.VALUE,YE.default.ID]),HE(n,YE.default.ESSENTIAL_PROPERTY,[YE.default.VALUE,YE.default.ID]),HE(n,YE.default.SUPPLEMENTAL_PROPERTY,[YE.default.VALUE,YE.default.ID]),HE(n,YE.default.INBAND_EVENT_STREAM,[YE.default.VALUE,YE.default.ID]),HE(n,YE.default.ACCESSIBILITY,[YE.default.VALUE,YE.default.ID]),HE(n,YE.default.ROLE,[YE.default.VALUE,YE.default.ID]),HE(n,YE.default.RATING,[YE.default.VALUE,YE.default.ID]),HE(n,YE.default.VIEWPOINT,[YE.default.VALUE,YE.default.ID]),HE(n,YE.default.CONTENT_COMPONENT,[YE.default.CONTENT_TYPE]),HE(n,YE.default.REPRESENTATION,[YE.default.ID,YE.default.DEPENDENCY_ID,YE.default.MEDIA_STREAM_STRUCTURE_ID]),HE(n,YE.default.SUBSET,[YE.default.ID]),HE(n,YE.default.METRICS,[YE.default.METRICS_MINUS]),HE(n,YE.default.REPORTING,[YE.default.VALUE,YE.default.ID]),n);if(r.hasOwnProperty(t)){var i=r[t];return void 0!==i&&i.indexOf(e.name)>=0}return!1}),(function(e){return String(e)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(jE.default),VE=Object.defineProperty({default:KE},"__esModule",{value:!0}),zE=QE(GE),WE=QE(c),XE=QE(p);function QE(e){return e&&e.__esModule?e:{default:e}}var ZE=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,$E=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){for(var t=[XE.default.MIN_BUFFER_TIME,XE.default.MEDIA_PRESENTATION_DURATION,XE.default.MINIMUM_UPDATE_PERIOD,XE.default.TIMESHIFT_BUFFER_DEPTH,XE.default.MAX_SEGMENT_DURATION,XE.default.MAX_SUBSEGMENT_DURATION,XE.default.SUGGESTED_PRESENTATION_DELAY,XE.default.START,WE.default.START_TIME,XE.default.DURATION],n=t.length,r=0;r<n;r++)if(e.nodeName===t[r])return ZE.test(e.value);return!1}),(function(e){var t=ZE.exec(e),n=31536e3*parseFloat(t[3]||0)+2592e3*parseFloat(t[5]||0)+86400*parseFloat(t[7]||0)+3600*parseFloat(t[9]||0)+60*parseFloat(t[11]||0)+parseFloat(t[13]||0);return void 0!==t[1]&&(n=-n),n})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(zE.default),JE=Object.defineProperty({default:$E},"__esModule",{value:!0}),ey=function(e){return e&&e.__esModule?e:{default:e}}(GE);var ty=/^([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}))?/,ny=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){return ty.test(e.value)}),(function(e){var t=ty.exec(e),n=void 0;if(n=Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[4],10),parseInt(t[5],10),t[6]&&parseInt(t[6],10)||0,t[7]&&1e3*parseFloat(t[7])||0),t[9]&&t[10]){var r=60*parseInt(t[9],10)+parseInt(t[10],10);n+=("+"===t[8]?-1:1)*r*60*1e3}return new Date(n)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(ey.default),ry=Object.defineProperty({default:ny},"__esModule",{value:!0}),iy=function(e){return e&&e.__esModule?e:{default:e}}(GE);var ay=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,oy=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){return ay.test(e.value)}),(function(e){return parseFloat(e)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(iy.default),sy=Object.defineProperty({default:oy},"__esModule",{value:!0}),uy=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var ly=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n;this._name=t,this._merge=(n=t)&&n.length&&n.charAt(0)===n.charAt(0).toUpperCase()}return uy(e,[{key:"name",get:function(){return this._name}},{key:"merge",get:function(){return this._merge}}]),e}(),fy=Object.defineProperty({default:ly},"__esModule",{value:!0}),dy=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),cy=function(e){return e&&e.__esModule?e:{default:e}}(fy);var hy=function(){function e(t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t||"",this._properties=[],this._children=r||[],Array.isArray(n)&&n.forEach((function(e){i._properties.push(new cy.default(e))}))}return dy(e,[{key:"name",get:function(){return this._name}},{key:"children",get:function(){return this._children}},{key:"properties",get:function(){return this._properties}}]),e}(),gy=Object.defineProperty({default:hy},"__esModule",{value:!0}),py=_y(gy),my=_y(p);function _y(e){return e&&e.__esModule?e:{default:e}}var Ey=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=[my.default.PROFILES,my.default.WIDTH,my.default.HEIGHT,my.default.SAR,my.default.FRAMERATE,my.default.AUDIO_SAMPLING_RATE,my.default.MIME_TYPE,my.default.SEGMENT_PROFILES,my.default.CODECS,my.default.MAXIMUM_SAP_PERIOD,my.default.START_WITH_SAP,my.default.MAX_PLAYOUT_RATE,my.default.CODING_DEPENDENCY,my.default.SCAN_TYPE,my.default.FRAME_PACKING,my.default.AUDIO_CHANNEL_CONFIGURATION,my.default.CONTENT_PROTECTION,my.default.ESSENTIAL_PROPERTY,my.default.SUPPLEMENTAL_PROPERTY,my.default.INBAND_EVENT_STREAM];return function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,my.default.ADAPTATION_SET,e,[new py.default(my.default.REPRESENTATION,e,[new py.default(my.default.SUB_REPRESENTATION,e)])]))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(py.default),yy=Object.defineProperty({default:Ey},"__esModule",{value:!0}),vy=Ay(gy),Ty=Ay(p);function Ay(e){return e&&e.__esModule?e:{default:e}}var Sy=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=[Ty.default.SEGMENT_BASE,Ty.default.SEGMENT_TEMPLATE,Ty.default.SEGMENT_LIST];return function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Ty.default.PERIOD,e,[new vy.default(Ty.default.ADAPTATION_SET,e,[new vy.default(Ty.default.REPRESENTATION,e)])]))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(vy.default),by=Object.defineProperty({default:Sy},"__esModule",{value:!0}),Iy=Ly(v),Ry=Ly(UE),wy=Ly(TE),Ny=Ly(VE),My=Ly(JE),Cy=Ly(ry),Dy=Ly(sy),Oy=Ly(yy),Py=Ly(by);function Ly(e){return e&&e.__esModule?e:{default:e}}function Fy(e){e=e||{};var t=this.context,n=e.debug,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;return r={parse:function(e){var t=void 0,n=window.performance.now();if(!(t=o.xml_str2json(e)))throw new Error("parsing the manifest failed");var r=window.performance.now();t.Patch?((t=t.Patch).add_asArray&&t.add_asArray.forEach((function(e){return s.run(e)})),t.replace_asArray&&t.replace_asArray.forEach((function(e){return s.run(e)}))):(t=t.MPD,s.run(t));var a=window.performance.now();return i.info("Parsing complete: ( xml2json: "+(r-n).toPrecision(3)+"ms, objectiron: "+(a-r).toPrecision(3)+"ms, total: "+((a-n)/1e3).toPrecision(3)+"s)"),t.protocol="DASH",t},getMatchers:function(){return a},getIron:function(){return s}},i=n.getLogger(r),a=[new My.default,new Cy.default,new Dy.default,new Ny.default],o=new wy.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!0,ignoreRoot:!1,matchers:a}),s=(0,Ry.default)(t).create({adaptationset:new Oy.default,period:new Py.default}),r}Fy.__dashjs_factory_name="DashParser";var xy=Iy.default.getClassFactory(Fy),Uy=Object.defineProperty({default:xy},"__esModule",{value:!0}),By=Qy(c),ky=Qy(p),Gy=Qy(OE),jy=Qy(Vg),Yy=Qy(Hd),qy=Qy(uE),Hy=Qy(Ie),Ky=Qy(P),Vy=Qy(B),zy=Qy(ra),Wy=Qy(v),Xy=Qy(Uy);function Qy(e){return e&&e.__esModule?e:{default:e}}function Zy(e){e=e||{};var t=this.context,n=e.debug,r=(0,Ky.default)(t).getInstance(),i=(0,Yy.default)(t).getInstance(),a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=e.mssHandler,d=e.errHandler;function c(e){r.trigger(Vy.default.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}return a={load:function(e){var a=new qy.default(e,ce.HTTPRequest.MPD_TYPE);s.load({request:a,success:function(a,s,d){if(u){var c=void 0,h=void 0,g=void 0;if(d&&d!==e?(h=i.parseBaseUrl(d),c=d):(i.isRelative(e)&&(e=i.resolve(e,window.location.href)),h=i.parseBaseUrl(e)),"No Content"!=s)if(null===l&&(l=function(e){var r=null;return e.indexOf("SmoothStreamingMedia")>-1?(f&&(r=f.createMssParser(),f.registerEvents()),r):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?(0,Xy.default)(t).create({debug:n}):r}(a)),null!==l){u.setMatchers(l.getMatchers()),u.setIron(l.getIron());try{g=l.parse(a)}catch(t){return void r.trigger(Vy.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Hy.default(zy.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,zy.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)})}g?(g.url=c||e,g.originalUrl||(g.originalUrl=g.url),g.hasOwnProperty(By.default.LOCATION)&&(h=i.parseBaseUrl(g.Location_asArray[0]),o.debug("BaseURI set by Location to: "+h)),g.baseUri=h,g.loadedTime=new Date,u.resolveManifestOnLoad(g),r.trigger(Vy.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:a})):r.trigger(Vy.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Hy.default(zy.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,zy.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)})}else r.trigger(Vy.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Hy.default(zy.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,zy.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)});else r.trigger(Vy.default.INTERNAL_MANIFEST_LOADED,{manifest:null})}},error:function(t,n,i){r.trigger(Vy.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Hy.default(zy.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,zy.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+(e+", ")+i)})}})},reset:function(){r.off(Vy.default.XLINK_READY,c,a),f&&f.reset(),u&&(u.reset(),u=null),s&&(s.abort(),s=null)}},o=n.getLogger(a),r.on(Vy.default.XLINK_READY,c,a),s=(0,jy.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings.get().streaming.lowLatencyEnabled,urlUtils:i,constants:By.default,dashConstants:ky.default,errors:zy.default}),u=(0,Gy.default)(t).create({errHandler:d,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),l=null,a}Zy.__dashjs_factory_name="ManifestLoader";var $y=Wy.default.getClassFactory(Zy),Jy=Object.defineProperty({default:$y},"__esModule",{value:!0}),ev=rv(P),tv=rv(B),nv=rv(v);function rv(e){return e&&e.__esModule?e:{default:e}}function iv(){var e=this.context,t=(0,ev.default)(e).getInstance();return{error:function(e){t.trigger(tv.default.ERROR,{error:e})}}}iv.__dashjs_factory_name="ErrorHandler";var av=nv.default.getSingletonFactory(iv),ov=Object.defineProperty({default:av},"__esModule",{value:!0}),sv=fv,uv=function(e){return e&&e.__esModule?e:{default:e}}(v);var lv=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function fv(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t}function dv(){var e,t=void 0;return e={supportsMediaSource:fv,supportsEncryptedMedia:function(){return t},supportsCodec:function(e){return!(!("MediaSource"in window)||!MediaSource.isTypeSupported(e))||!(!("WebKitMediaSource"in window)||!WebKitMediaSource.isTypeSupported(e))},setEncryptedMediaSupported:function(e){t=e},supportsEssentialProperty:function(e){try{return-1!==wh.THUMBNAILS_SCHEME_ID_URIS.indexOf(e.schemeIdUri)}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var n=e.split(".")[0],r=0===t.indexOf(n),i=void 0,a=0;a<lv.length;a++)if(lv[a].codec===n){i=lv[a];break}return i?r||i.compatibleCodecs.some((function(e){return 0===t.indexOf(e)})):r}},t=!1,e}dv.__dashjs_factory_name="Capabilities";var cv=uv.default.getSingletonFactory(dv),hv=Object.defineProperty({supportsMediaSource:sv,default:cv},"__esModule",{value:!0}),gv=_v(v),pv=_v(Z),mv=_v(c);function _v(e){return e&&e.__esModule?e:{default:e}}function Ev(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0;function s(e,t){var i=n.getRealPeriodByIndex(t?t.index:null);i&&i.AdaptationSet_asArray&&0!==i.AdaptationSet_asArray.length&&(i.AdaptationSet_asArray=i.AdaptationSet_asArray.filter((function(t){return!t.Representation_asArray||0===t.Representation_asArray.length||!n.getIsTypeOf(t,e)||(t.Representation_asArray=t.Representation_asArray.filter((function(e,i){var o=n.getCodec(t,i,!0);return!!r.supportsCodec(o)||(a.error("[Stream] codec not supported: "+o),!1)})),t.Representation_asArray&&t.Representation_asArray.length>0)})))}return t={setConfig:function(e){e&&(e.adapter&&(n=e.adapter),e.capabilities&&(r=e.capabilities),e.settings&&(i=e.settings))},filterUnsupportedFeaturesOfPeriod:function(e){s(mv.default.VIDEO,e),s(mv.default.AUDIO,e),i.get().streaming.filterUnsupportedEssentialProperties&&function(e){var t=n.getRealPeriodByIndex(e?e.index:null);if(!t||!t.AdaptationSet_asArray||0===t.AdaptationSet_asArray.length)return;t.AdaptationSet_asArray=t.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){var t=n.getEssentialPropertiesForRepresentation(e);if(t&&t.length>0)for(var i=0;i<t.length;){if(!r.supportsEssentialProperty(t[i]))return a.debug("[Stream] EssentialProperty not supported: "+t[i].schemeIdUri),!1;i+=1}return!0})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}(e),function(e){if(!o||0===o.length)return;var t=n.getRealPeriodByIndex(e?e.index:null);if(!t||!t.AdaptationSet_asArray||0===t.AdaptationSet_asArray.length)return;t.AdaptationSet_asArray=t.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){return!o.some((function(t){return!t(e)}))})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}(e)},setCustomCapabilitiesFilters:function(e){o=e}},a=(0,pv.default)(e).getInstance().getLogger(t),t}Ev.__dashjs_factory_name="CapabilitiesFilter";var yv=gv.default.getSingletonFactory(Ev),vv=Object.defineProperty({default:yv},"__esModule",{value:!0});var Tv=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},Av=bv(Object.defineProperty({default:Tv},"__esModule",{value:!0})),Sv=bv(v);function bv(e){return e&&e.__esModule?e:{default:e}}function Iv(){var e=void 0;return{initialize:function(t){if(e=new Av.default,!t)return null;var n=t.indexOf("#");if(-1!==n)for(var r=t.substr(n+1).split("&"),i=0,a=r.length;i<a;++i){var o=r[i],s=o.indexOf("=");if(-1!==s){var u=o.substring(0,s);e.hasOwnProperty(u)&&(e[u]=o.substr(s+1))}}},getURIFragmentData:function(){return e}}}Iv.__dashjs_factory_name="URIFragmentModel";var Rv=Sv.default.getSingletonFactory(Iv),wv=Object.defineProperty({default:Rv},"__esModule",{value:!0}),Nv=Dv(P),Mv=Dv(B),Cv=Dv(v);function Dv(e){return e&&e.__esModule?e:{default:e}}function Ov(){var e=this.context,t=(0,Nv.default)(e).getInstance(),n=void 0;return{getValue:function(){return n},setValue:function(e){n=e,e&&t.trigger(Mv.default.MANIFEST_LOADED,{data:e})}}}Ov.__dashjs_factory_name="ManifestModel";var Pv=Cv.default.getSingletonFactory(Ov),Lv=Object.defineProperty({default:Pv},"__esModule",{value:!0}),Fv=Gv(uh),xv=Gv(v),Uv=Gv(c),Bv=Gv(Su),kv=Gv(Gc);function Gv(e){return e&&e.__esModule?e:{default:e}}function jv(){var e,t=void 0,n=void 0,r=void 0,i=this.context,a=(0,kv.default)(i).getInstance();function o(e){var t=void 0;for(t=0;t<r.length;t++)if(r[t].rulename===e)return t;return-1}function s(){return a.get().streaming.lowLatencyEnabled?a.get().streaming.liveDelay||3:a.get().streaming.liveDelay}function u(e,n){l(e,n);var r=new Fv.default;r.schemeIdUri=e,r.value=n,t.push(r)}function l(e,n){(0,et.checkParameterType)(e,"string"),(0,et.checkParameterType)(n,"string"),t.forEach((function(r,i){r.schemeIdUri===e&&r.value===n&&t.splice(i,1)}))}return e={getABRCustomRules:function(){return r},addABRCustomRule:function(e,t,n){if("string"!=typeof e||e!==Bv.default.ABANDON_FRAGMENT_RULES&&e!==Bv.default.QUALITY_SWITCH_RULES||"string"!=typeof t)throw Uv.default.BAD_ARGUMENT_ERROR;var i=o(t);-1===i?r.push({type:e,rulename:t,rule:n}):(r[i].type=e,r[i].rule=n)},removeABRCustomRule:function(e){if(e){var t=o(e);-1!==t&&r.splice(t,1)}else r=[]},getStableBufferTime:function(){if(a.get().streaming.lowLatencyEnabled)return.6*s();var e=a.get().streaming.stableBufferTime;return e>-1?e:a.get().streaming.fastSwitchEnabled?20:12},getRetryAttemptsForType:function(e){var t=isNaN(a.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:a.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return a.get().streaming.lowLatencyEnabled?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 a.get().streaming.lowLatencyEnabled?a.get().streaming.retryIntervals[e]/t:a.get().streaming.retryIntervals[e]},getLiveDelay:s,getLiveCatchupLatencyThreshold:function(){try{var e=a.get().streaming.liveCatchup.latencyThreshold,t=s();if(null!==e&&!isNaN(e))return Math.max(e,t);var n=a.get().streaming.liveCatchup.minDrift,r=!isNaN(t)&&t?isNaN(n)?s():a.get().streaming.liveCatchup.minDrift+s():NaN;return r&&!isNaN(r)?Math.max(4*r,5):NaN}catch(e){return NaN}},addUTCTimingSource:u,removeUTCTimingSource:l,getUTCTimingSources:function(){return t},clearDefaultUTCTimingSources:function(){t=[]},restoreDefaultUTCTimingSources:function(){var e=a.get().streaming.utcSynchronization.defaultTimingSource;u(e.scheme,e.value)},setXHRWithCredentialsForType:function e(t,r){t?n[t]=!!r:Object.keys(n).forEach((function(t){e(t,r)}))},getXHRWithCredentialsForType:function(e){var t=n[e];return void 0===t?n.default:t},getDefaultUtcTimingSource:function(){return a.get().streaming.utcSynchronization.defaultTimingSource},reset:function(){}},t=[],n={default:!1},r=[],e}jv.__dashjs_factory_name="MediaPlayerModel";var Yv=xv.default.getSingletonFactory(jv),qv=Object.defineProperty({default:Yv},"__esModule",{value:!0}),Hv=Wv(v),Kv=Wv(P),Vv=Wv(B),zv=Wv(Z);function Wv(e){return e&&e.__esModule?e:{default:e}}function Xv(){var e=void 0,t=void 0,n=void 0,r=void 0,i=void 0,a=this.context,o=(0,Kv.default)(a).getInstance(),s=[];function u(){n&&(n.playbackRate=i||1,n.removeEventListener("canplay",u))}function l(e){n&&(n.readyState<=2&&e>0?n.addEventListener("canplay",u):n.playbackRate=e)}function f(){return s.length>0}function d(e){var t=s.indexOf(e),r=void 0;null!==e&&(-1!==t&&s.splice(t,1),n&&!1===f()&&0===n.playbackRate&&(l(i||1),n.paused||((r=document.createEvent("Event")).initEvent("playing",!0,!1),n.dispatchEvent(r))))}function c(){if(n&&f()&&0===n.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}function h(){return n?n.buffered:null}function g(e,t,r,i,a){if(n)for(var o=0;o<n.textTracks.length;o++)if(n.textTracks[o].kind===e&&(!t||n.textTracks[o].label==t)&&n.textTracks[o].language===r&&n.textTracks[o].isTTML===i&&n.textTracks[o].isEmbedded===a)return n.textTracks[o];return null}return e={initialize:function(){o.on(Vv.default.PLAYBACK_PLAYING,c,this)},setCurrentTime:function(e,t){if(n){if(n.currentTime==e)return;try{e=t?function(e){var t=h(),n=e,r=9999999999;if(t)for(var i=0;i<t.length;i++){var a=t.start(i),o=t.end(i),s=Math.abs(a-e),u=Math.abs(o-e);if(e>=a&&e<=o)return e;s<r&&(r=s,n=a),u<r&&(r=u,n=o)}return n}(e):e,n.currentTime=e}catch(t){0===n.readyState&&t.code===t.INVALID_STATE_ERR&&setTimeout((function(){n.currentTime=e}),400)}}},play:function(){if(n){n.autoplay=!0;var e=n.play();e&&e.catch&&"undefined"!=typeof Promise&&e.catch((function(e){"NotAllowedError"===e.name&&o.trigger(Vv.default.PLAYBACK_NOT_ALLOWED),t.warn("Caught pending play exception - continuing ("+e+")")}))}},isPaused:function(){return n?n.paused:null},pause:function(){n&&(n.pause(),n.autoplay=!1)},isStalled:f,isSeeking:function(){return n?n.seeking:null},getTime:function(){return n?n.currentTime:null},getPlaybackRate:function(){return n?n.playbackRate:null},setPlaybackRate:l,getPlayedRanges:function(){return n?n.played:null},getEnded:function(){return n?n.ended:null},setStallState:function(e,t){!function(e,t){t?function(e){var t=void 0;if(null===e||!n||n.seeking||-1!==s.indexOf(e))return;s.push(e),n&&1===s.length&&((t=document.createEvent("Event")).initEvent("waiting",!0,!1),i=n.playbackRate,l(0),n.dispatchEvent(t))}(e):d(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 r},setTTMLRenderingDiv:function(e){(r=e).style.position="absolute",r.style.display="flex",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.top=0,r.style.left=0},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:function(e,t){n&&n.addEventListener(e,t)},removeEventListener:function(e,t){n&&n.removeEventListener(e,t)},getReadyState:function(){return n?n.readyState:NaN},getBufferRange:h,getClientWidth:function(){return n?n.clientWidth:NaN},getClientHeight:function(){return n?n.clientHeight:NaN},getTextTracks:function(){return n?n.textTracks:[]},getTextTrack:g,addTextTrack:function(e,t,r,i,a){if(!n)return null;var o=g(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},reset:function(){o.off(Vv.default.PLAYBACK_PLAYING,c,this)}},t=(0,zv.default)(a).getInstance().getLogger(e),e}Xv.__dashjs_factory_name="VideoModel";var Qv=Hv.default.getSingletonFactory(Xv),Zv=Object.defineProperty({default:Qv},"__esModule",{value:!0}),$v=tT(v),Jv=tT(Z),eT=tT(c);function tT(e){return e&&e.__esModule?e:{default:e}}var nT=[{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"}];function rT(e){e=e||{};var t=this.context,n=e.settings,r=void 0,i=void 0,a=void 0;function o(e){if(void 0!==a)return a;a=!1;var t=void 0;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return i.warn("DOMStorage access denied: "+e.message),a}if(!t||"localStorage"!==e&&"sessionStorage"!==e)return a;try{t.setItem("1","1"),t.removeItem("1"),a=!0}catch(e){i.warn("DOMStorage is supported, but cannot be used: "+e.message)}return a}function s(){return 6e5*Math.round((new Date).getTime()/6e5)}function u(e,t){return o(e)&&n.get().streaming[t+"CachingInfo"].enabled}function l(){if(!n)throw new Error(eT.default.MISSING_CONFIG_ERROR)}return r={getSavedBitrateSettings:function(e){var t=NaN;if(l(),u("localStorage","lastBitrate")){var r="dashjs_?_bitrate".replace(/\?/,e);try{var a=JSON.parse(localStorage.getItem(r))||{},o=(new Date).getTime()-parseInt(a.timestamp,10)>=n.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(a.bitrate);isNaN(s)||o?o&&localStorage.removeItem(r):(t=s,i.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(u("localStorage","lastBitrate")&&t){var n="dashjs_?_bitrate".replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({bitrate:t.toFixed(3),timestamp:s()}))}catch(e){i.error(e.message)}}},getSavedMediaSettings:function(e){var t=null;if(l(),u("localStorage","lastMediaSettings")){var r="dashjs_?_settings".replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=n.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=i.settings,a&&(localStorage.removeItem(r),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(u("localStorage","lastMediaSettings")){var n="dashjs_?_settings".replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({settings:t,timestamp:s()}))}catch(e){i.error(e.message)}}}},i=(0,Jv.default)(t).getInstance().getLogger(r),o("localStorage")&&nT.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){i.error(e.message)}}})),r}rT.__dashjs_factory_name="DOMStorage";var iT=$v.default.getSingletonFactory(rT),aT=Object.defineProperty({default:iT},"__esModule",{value:!0}),oT=function(){return"3.2.2"};var sT=Object.defineProperty({getVersionString:oT},"__esModule",{value:!0}),uT=hT(Pf),lT=hT(Ie),fT=hT(v),dT=hT(me),cT=hT(Vg);function hT(e){return e&&e.__esModule?e:{default:e}}function gT(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0;function _(){if(!m||!m.hasOwnProperty("resolve"))throw new Error("setConfig function has to be called previously")}function E(e){if(e.url){var t=new dT.default;return t.setInfo(e),t}}function y(e,t,n,r){d.trigger(f.SEGMENTS_LOADED,{segments:n,representation:r,error:n?void 0:new lT.default(c.SEGMENT_BASE_LOADER_ERROR_CODE,c.SEGMENT_BASE_LOADER_ERROR_MESSAGE)},{streamId:e,mediaType:t})}return t={setConfig:function(e){e.baseURLController&&(m=e.baseURLController),e.dashMetrics&&(o=e.dashMetrics),e.mediaPlayerModel&&(u=e.mediaPlayerModel),e.errHandler&&(r=e.errHandler),e.settings&&(s=e.settings),e.boxParser&&(i=e.boxParser),e.events&&(f=e.events),e.eventBus&&(d=e.eventBus),e.debug&&(n=e.debug.getLogger(t)),e.requestModifier&&(a=e.requestModifier),e.errors&&(c=e.errors),e.urlUtils&&(p=e.urlUtils),e.constants&&(h=e.constants),e.dashConstants&&(g=e.dashConstants)},initialize:function(){l=(0,cT.default)(e).create({errHandler:r,dashMetrics:o,mediaPlayerModel:u,requestModifier:a,useFetch:s?s.get().streaming.lowLatencyEnabled:null,boxParser:i,errors:c,urlUtils:p,constants:h,dashConstants:g})},loadInitialization:function e(t,r,a,o){_();var s=null,u=a?m.resolve(a.path):null,c=o||{init:!0,url:u?u.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:r};n.debug("Start searching for initialization.");var h=E(c);l.load({request:h,success:function(n){c.bytesLoaded=c.range.end,(s=i.findInitRange(n))?(a.range=s,d.trigger(f.INITIALIZATION_LOADED,{representation:a},{streamId:t,mediaType:r})):(c.range.end=c.bytesLoaded+c.bytesToLoad,e(t,r,a,c))},error:function(){d.trigger(f.INITIALIZATION_LOADED,{representation:a},{streamId:t,mediaType:r})}}),n.debug("Perform init search: "+c.url)},loadSegments:function e(t,r,a,o,s,u){if(_(),o&&(void 0===o.start||void 0===o.end)){var f=o?o.toString().split("-"):null;o=f?{start:parseFloat(f[0]),end:parseFloat(f[1])}:null}s=s||y;var d=null,c=null,h=!!o,g=a?m.resolve(a.path):null,p={init:!1,url:g?g.url:void 0,range:h?o:{start:0,end:1500},searching:!h,bytesLoaded:u?u.bytesLoaded:0,bytesToLoad:1500,mediaType:r},v=E(p);l.load({request:v,success:function(o){var u=p.bytesToLoad,l=o.byteLength;if(p.bytesLoaded=p.range.end-p.range.start,d=i.parse(o),(c=d.getBox("sidx"))&&c.isComplete){var f=c.references,h=void 0,g=void 0;if(null!=f&&f.length>0&&(h=1===f[0].reference_type),h){n.debug("Initiate multiple SIDX load."),p.range.end=p.range.start+c.size;var m=void 0,_=void 0,E=void 0,y=void 0,v=[],T=0,A=(c.offset||p.range.start)+c.size,S=function(e,t,n){n?(v=v.concat(n),++T>=_&&(v.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),s(e,t,v,a))):s(e,t,null,a)};for(m=0,_=f.length;m<_;m++)E=A,y=A+f[m].referenced_size-1,A+=f[m].referenced_size,e(t,r,a,{start:E,end:y},S,p)}else n.debug("Parsing segments from SIDX. representation "+r+" - id: "+a.id+" for range : "+p.range.start+" - "+p.range.end),g=function(e,t){for(var n=e.references,r=n.length,i=e.timescale,a=e.earliest_presentation_time,o=t.range.start+e.offset+e.first_offset+e.size,s=[],u=void 0,l=void 0,f=void 0,d=void 0,c=0;c<r;c++)f=n[c].subsegment_duration,d=n[c].referenced_size,(u=new uT.default).duration=f,u.startTime=a,u.timescale=i,l=o+d-1,u.mediaRange=o+"-"+l,s.push(u),a+=f,o+=d;return s}(c,p),s(t,r,g,a)}else{if(c)p.range.start=c.offset||p.range.start,p.range.end=p.range.start+(c.size||u);else{if(l<p.bytesLoaded)return void s(t,r,null,a);var b=d.getLastBox();b&&b.size?(p.range.start=b.offset+b.size,p.range.end=p.range.start+u):p.range.end+=u}e(t,r,a,p.range,s,p)}},error:function(){s(t,r,null,a)}}),n.debug("Perform SIDX load: "+p.url+" with range : "+p.range.start+" - "+p.range.end)},reset:function(){l.abort(),l=null,r=null,i=null,a=null}}}gT.__dashjs_factory_name="SegmentBaseLoader";var pT=fT.default.getSingletonFactory(gT),mT=Object.defineProperty({default:pT},"__esModule",{value:!0}),_T=function(e){return e&&e.__esModule?e:{default:e}}(v);function ET(e){e=e||{};var t=void 0,n=new DataView(e.data),r=0;function i(e,t){var i=!0,a=0;if(void 0===t&&(t=!1),e.tag>16777215?(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;u<a;u+=1,t+=1)o=o<<8|255&n.getUint8(r+t);return r+=t,o}return t={getPos:function(){return r},setPos:function(e){r=e},consumeTag:i,consumeTagAndSize:function(e,t){var n=i(e,t);return n&&a(),n},parseTag:function(e){var n;return i(e),n=a(),t[e.parse](n)},skipOverElement:function(e,t){var n=i(e,t),o=void 0;return n&&(o=a(),r+=o),n},getMatroskaCodedNum:a,getMatroskaFloat:function(e){var t=void 0;switch(e){case 4:t=n.getFloat32(r),r+=4;break;case 8:t=n.getFloat64(r),r+=8}return t},getMatroskaUint:function(e){for(var t=0,i=0;i<e;i+=1)t<<=8,t|=255&n.getUint8(r+i);return r+=e,t},moreData:function(){return r<n.byteLength}}}ET.__dashjs_factory_name="EBMLParser";var yT=_T.default.getClassFactory(ET),vT=wT(Object.defineProperty({default:yT},"__esModule",{value:!0})),TT=wT(c),AT=wT(v),ST=wT(Pf),bT=wT(me),IT=wT(Vg),RT=wT(Ie);function wT(e){return e&&e.__esModule?e:{default:e}}function NT(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0;function g(t,i,a,o){var s,u,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0;for(f=[],c=0,u=(s=function(t){var n=[],i=(0,vT.default)(e).create({data:t}),a=void 0,o=void 0;for(i.consumeTagAndSize(r.Segment.Cues);i.moreData()&&i.consumeTagAndSize(r.Segment.Cues.CuePoint,!0);){for((a={}).CueTime=i.parseTag(r.Segment.Cues.CuePoint.CueTime),a.CueTracks=[];i.moreData()&&i.consumeTag(r.Segment.Cues.CuePoint.CueTrackPositions,!0);){var s=i.getMatroskaCodedNum(),u=i.getPos();if((o={}).Track=i.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===o.Track)throw new Error("Cue track cannot be 0");o.ClusterPosition=i.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),a.CueTracks.push(o),i.setPos(u+s)}if(0===a.CueTracks.length)throw new Error("Mandatory cuetrack not found");n.push(a)}if(0===n.length)throw new Error("mandatory cuepoint not found");return n}(t)).length;c<u;c+=1)d=new ST.default,l=0,l=c<s.length-1?s[c+1].CueTime-s[c].CueTime:o-s[c].CueTime,d.duration=l,d.startTime=s[c].CueTime,d.timescale=1e3,h=s[c].CueTracks[0].ClusterPosition+i,g=c<s.length-1?s[c+1].CueTracks[0].ClusterPosition+i-1:a-1,d.mediaRange=h+"-"+g,f.push(d);return n.debug("Parsed cues: "+f.length+" cues."),f}function p(){if(!h||!h.hasOwnProperty("resolve"))throw new Error("setConfig function has to be called previously")}function m(e,t,n,r){f.trigger(d.SEGMENTS_LOADED,{segments:n,representation:r,error:n?void 0:new RT.default(c.SEGMENT_BASE_LOADER_ERROR_CODE,c.SEGMENT_BASE_LOADER_ERROR_MESSAGE)},{streamId:e,mediaType:t})}function _(e){var t=new bT.default;return t.setInfo(e),t}return t={setConfig:function(e){if(!(e.baseURLController&&e.dashMetrics&&e.mediaPlayerModel&&e.errHandler))throw new Error(TT.default.MISSING_CONFIG_ERROR);h=e.baseURLController,o=e.dashMetrics,s=e.mediaPlayerModel,i=e.errHandler,l=e.settings,d=e.events,f=e.eventBus,c=e.errors,n=e.debug.getLogger(t),a=e.requestModifier},initialize:function(){u=(0,IT.default)(e).create({errHandler:i,dashMetrics:o,mediaPlayerModel:s,requestModifier:a,useFetch:l?l.get().streaming.lowLatencyEnabled:null,errors:c})},loadInitialization:function(e,t,r,i){p();var a=null,o=r?h.resolve(r.path):null,s=r?r.range.split("-"):null,l=i||{range:{start:s?parseFloat(s[0]):null,end:s?parseFloat(s[1]):null},request:a,url:o?o.url:void 0,init:!0,mediaType:t};n.info("Start loading initialization."),a=_(l),u.load({request:a,success:function(){f.trigger(d.INITIALIZATION_LOADED,{representation:r},{streamId:e,mediaType:t})},error:function(){f.trigger(d.INITIALIZATION_LOADED,{representation:r},{streamId:e,mediaType:t})}}),n.debug("Perform init load: "+l.url)},loadSegments:function(t,i,a,o,s){p();var l=null,f=a?h.resolve(a.path):null,d=f?f.url:void 0;s=s||m,l=_({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:l,url:d,init:!1,mediaType:i}),n.debug("Parsing ebml header"),u.load({request:l,success:function(l){!function(t,i,a,o){if(t&&0!==t.byteLength){var s,l=(0,vT.default)(e).create({data:t}),f=void 0,d=void 0,c=void 0,h=a?a.split("-"):null,p=null,m={url:i,range:{start:h?parseFloat(h[0]):null,end:h?parseFloat(h[1]):null},request:p};for(n.debug("Parse EBML header: "+m.url),l.skipOverElement(r.EBML),l.consumeTag(r.Segment),c=l.getMatroskaCodedNum(),c+=l.getPos(),s=l.getPos();l.moreData()&&!l.consumeTagAndSize(r.Segment.Info,!0);)if(!(l.skipOverElement(r.Segment.SeekHead,!0)||l.skipOverElement(r.Segment.Tracks,!0)||l.skipOverElement(r.Segment.Cues,!0)||l.skipOverElement(r.Void,!0)))throw new Error("no valid top level element found");for(;void 0===f;){var E=l.getMatroskaCodedNum(!0),y=l.getMatroskaCodedNum();switch(E){case r.Segment.Info.Duration.tag:f=l[r.Segment.Info.Duration.parse](y);break;default:l.setPos(l.getPos()+y)}}p=_(m);u.load({request:p,success:function(e){d=g(e,s,c,f),o(d)},error:function(){n.error("Download Error: Cues "+m.url),o(null)}}),n.debug("Perform cues load: "+m.url+" bytes="+m.range.start+"-"+m.range.end)}else o(null)}(l,d,o,(function(e){s(t,i,e,a)}))},error:function(){s(t,i,null,a)}})},reset:function(){i=null,a=null}},r={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},t}NT.__dashjs_factory_name="WebmSegmentBaseLoader";var MT=AT.default.getSingletonFactory(NT),CT=Object.defineProperty({default:MT},"__esModule",{value:!0}),DT=LT(v),OT=LT(mT),PT=LT(CT);function LT(e){return e&&e.__esModule?e:{default:e}}function FT(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,i=e.dashMetrics,a=e.mediaPlayerModel,o=e.errHandler,s=e.baseURLController,u=e.debug,l=e.boxParser,f=e.requestModifier,d=e.errors,c=void 0,h=void 0,g=void 0;function p(e){return"webm"===(e?e.split("/")[1]:"").toLowerCase()}function m(e){p(e.mimeType)?g.loadInitialization(e.streamId,e.mediaType,e.representation):h.loadInitialization(e.streamId,e.mediaType,e.representation)}function _(e){p(e.mimeType)?g.loadSegments(e.streamId,e.mediaType,e.representation,e.representation?e.representation.indexRange:null,e.callback):h.loadSegments(e.streamId,e.mediaType,e.representation,e.representation?e.representation.indexRange:null,e.callback)}return c={initialize:function(){n.on(r.SEGMENTBASE_INIT_REQUEST_NEEDED,m,c),n.on(r.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,_,c),h.initialize(),g.initialize()},reset:function(){n.off(r.SEGMENTBASE_INIT_REQUEST_NEEDED,m,c),n.off(r.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,_,c)}},h=(0,OT.default)(t).getInstance(),g=(0,PT.default)(t).getInstance(),h.setConfig({baseURLController:s,dashMetrics:i,mediaPlayerModel:a,errHandler:o,eventBus:n,events:r,errors:d,debug:u,boxParser:l,requestModifier:f}),g.setConfig({baseURLController:s,dashMetrics:i,mediaPlayerModel:a,errHandler:o,eventBus:n,events:r,errors:d,debug:u,requestModifier:f}),c}FT.__dashjs_factory_name="SegmentBaseController";var xT=DT.default.getSingletonFactory(FT),UT=Object.defineProperty({default:xT},"__esModule",{value:!0});var BT=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.quality=null,this.DVRWindow=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null},kT=Object.defineProperty({default:BT},"__esModule",{value:!0});var GT=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.lang=null,this.viewpoint=null,this.accessibility=null,this.audioChannelConfiguration=null,this.roles=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.isText=!1,this.KID=null,this.bitrateList=null},jT=Object.defineProperty({default:GT},"__esModule",{value:!0});var YT=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0},qT=Object.defineProperty({default:YT},"__esModule",{value:!0});var HT=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.DVRWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null},KT=Object.defineProperty({default:HT},"__esModule",{value:!0}),VT=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var zT=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.valid="/"==t[0],this.path=t.split("/").filter((function(e){return 0!==e.length})).map((function(e){var t={name:e},r=e.indexOf("[");if(-1!=r){t.name=e.substring(0,r);var i=e.substring(r+1,e.length-1);n.valid=n.valid&&-1==i.indexOf("[");var a=i.indexOf("=");-1!=a?(t.attribute={name:i.substring(1,a),value:i.substring(a+1)},-1!=["'",'"'].indexOf(t.attribute.value[0])&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(i,10)-1}return t}))}return VT(e,[{key:"isValid",value:function(){return this.valid}},{key:"findsElement",value:function(){return!this.findsAttribute()}},{key:"findsAttribute",value:function(){return this.path[this.path.length-1].name.startsWith("@")}},{key:"getMpdTarget",value:function(e,t){for(var n=null,r=e,i=1,a="MPD";i<this.path.length&&null!==r;){n=r;var o=this.path[i];if(a=o.name,i!==this.path.length-1||!a.startsWith("@")){var s=n[a+"_asArray"]||[];0===s.length&&n[a]&&s.push(n[a]),o.position?r=s[o.position]||null:o.attribute?function(){var e=o.attribute;r=s.filter((function(t){return t[e.name]==e.value}))[0]||null}():r=s[0]||null}i++}return null===r?null:a.startsWith("@")?{name:a.substring(1),leaf:r,target:r}:{name:a,leaf:r,target:t?n:r}}}]),e}(),WT=Object.defineProperty({default:zT},"__esModule",{value:!0}),XT=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var QT=function(){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.action=t,this.xpath=n,this.value=r,this.position=null}return XT(e,[{key:"getMpdTarget",value:function(e){var t="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(e,t)}}]),e}(),ZT=Object.defineProperty({default:QT},"__esModule",{value:!0}),$T=rA(p),JT=rA(v),eA=rA(Z),tA=rA(WT),nA=rA(ZT);function rA(e){return e&&e.__esModule?e:{default:e}}function iA(){var e=void 0,t=void 0,n=this.context;return e={getIsPatch:function(e){return e&&e.hasOwnProperty($T.default.ORIGINAL_MPD_ID)||!1},getPublishTime:function(e){return e&&e.hasOwnProperty($T.default.PUBLISH_TIME)?new Date(e[$T.default.PUBLISH_TIME]):null},getOriginalPublishTime:function(e){return e&&e.hasOwnProperty($T.default.ORIGINAL_PUBLISH_TIME)?new Date(e[$T.default.ORIGINAL_PUBLISH_TIME]):null},getMpdId:function(e){return e&&e[$T.default.ORIGINAL_MPD_ID]||null},getPatchOperations:function(e){return e?(e.__children||[]).map((function(e){var n=Object.keys(e)[0];if("add"!==n&&"remove"!==n&&"replace"!==n)return t.warn("Ignoring node of invalid action: "+n),null;var r=e[n],i=r.sel;if("add"===n&&r.type){if(!r.type.startsWith("@"))return t.warn("Ignoring add action for prefixed namespace declaration: "+r.type+"="+r.__text),null;i=i+"/"+r.type}var a=new tA.default(i);if(!a.isValid())return t.warn("Ignoring action with invalid selector: "+n+" - "+i),null;var o=null;a.findsAttribute()?o=r.__text||"":"remove"!==n&&(o=r.__children.reduce((function(e,t){var n=Object.keys(t)[0];return"#text"!==n&&(e[n]=e[n]||[],e[n].push(t[n])),e}),{}));var s=new nA.default(n,a,o);return"add"===n&&(s.position=r.pos),s})).filter((function(e){return!!e})):[]}},t=(0,eA.default)(n).getInstance().getLogger(e),e}iA.__dashjs_factory_name="PatchManifestModel";var aA=JT.default.getSingletonFactory(iA),oA=Object.defineProperty({default:aA},"__esModule",{value:!0}),sA=mA(p),uA=mA(kT),lA=mA(jT),fA=mA(qT),dA=mA(KT),cA=mA(fh),hA=mA(v),gA=mA(zh),pA=mA(oA);function mA(e){return e&&e.__esModule?e:{default:e}}function _A(){var e,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=this.context;function l(e,n,i){var o,s=t.getAdaptationsForType(r[0].mpd.manifest,e,n);if(!s||0===s.length)return null;if(s.length>1&&i){var u=d(i,n);if(a[i.id]&&a[i.id][n])for(var l=0,c=s.length;l<c;l++)if(f(a[i.id][n],u[l]))return s[l];for(var h=0,g=s.length;h<g;h++)if(o=s[h],t.getRolesForAdaptation(o).filter((function(e){return e.value===sA.default.MAIN}))[0])return s[h]}return s[0]}function f(e,t){if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=e.lang===t.lang,a=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),s=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&r&&i&&a&&o&&s}function d(e,n,a){var s,u=r,l=a,f=[],d=void 0,h=void 0,g=void 0,p=void 0,m=void 0,v=void 0;if(l)T(),u=c(l);else{if(!(r.length>0))return f;l=r[0].mpd.manifest}var A=_(e,u);A&&(v=A.id);var S=t.getAdaptationsForType(l,e?e.index:null,n!==o.EMBEDDED_TEXT?n:o.VIDEO);if(!S||0===S.length)return f;for(i[v]=i[v]||t.getAdaptationsForPeriod(A),p=0,s=S.length;p<s;p++)if(d=S[p],g=t.getIndexForAdaptation(d,l,e.index),h=E(i[v][g]),n===o.EMBEDDED_TEXT){var b=h.accessibility.length;for(m=0;m<b;m++)if(h){var I=h.accessibility[m];if(0===I.indexOf("cea-608:")){var R=I.substring(8).split(";");if("CC"===R[0].substring(0,2))for(m=0;m<R.length;m++)h||(h=E.call(this,i[v][g])),y(h,R[m].substring(0,3),R[m].substring(4)),f.push(h),h=null;else for(m=0;m<R.length;m++)h||(h=E.call(this,i[v][g])),y(h,"CC"+(m+1),R[m]),f.push(h),h=null}else 0===I.indexOf("cea-608")&&(y(h,o.CC1,"eng"),f.push(h),h=null)}}else n===o.IMAGE?(h.type=o.IMAGE,f.push(h),h=null):h&&f.push(h);return f}function c(e){var n=h(e);return t.getRegularPeriods(n)}function h(e){var n=p(e);return t.getMpd(n)}function g(){r=[],i={},a={}}function p(e){return e||(r.length>0?r[0].mpd.manifest:null)}function m(e){return e&&e.streamInfo&&void 0!==e.streamInfo.id&&i[e.streamInfo.id]?i[e.streamInfo.id][e.index]:null}function _(e,t){for(var n=t.length,r=0;r<n;r++){var i=t[r];if(e&&e.id===i.id)return i}return null}function E(e){if(!e)return null;var n,r=new lA.default,i=e.period.mpd.manifest.Period_asArray[e.period.index].AdaptationSet_asArray[e.index];return r.id=e.id,r.index=e.index,r.type=e.type,r.streamInfo=v(e.period),r.representationCount=t.getRepresentationCount(i),r.labels=t.getLabelsForAdaptation(i),r.lang=t.getLanguageForAdaptation(i),n=t.getViewpointForAdaptation(i),r.viewpoint=n?n.value:void 0,r.accessibility=t.getAccessibilityForAdaptation(i).map((function(e){var t=e.value,n=t;return e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=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.contentProtection&&r.contentProtection.forEach((function(e){e.KID=t.getKID(e)})),r.isText=t.getIsTextTrack(r.mimeType),r.supplementalProperties=t.getSupplementalPropperties(i),r}function y(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=o.EMBEDDED_TEXT,e.codec="cea-608-in-SEI",e.isText=!0,e.isEmbedded=!0,e.lang=n,e.roles=["caption"]}function v(e){var n=new fA.default;return n.id=e.id,n.index=e.index,n.start=e.start,n.duration=e.duration,n.manifestInfo=function(e){var n=new dA.default;return n.DVRWindowSize=e.timeShiftBufferDepth,n.loadedTime=e.manifest.loadedTime,n.availableFrom=e.availabilityStartTime,n.minBufferTime=e.manifest.minBufferTime,n.maxFragmentDuration=e.maxSegmentDuration,n.duration=t.getDuration(e.manifest),n.isDynamic=t.getIsDynamic(e.manifest),n.serviceDescriptions=t.getServiceDescriptions(e.manifest),n.protocol=e.manifest.protocol,n}(e.mpd),n.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(n.start+n.duration-n.manifestInfo.duration)<1,n}function T(){if(!o)throw new Error("setConfig function has to be called previously")}function A(e){return r.length>0?r[0].mpd.manifest.Period_asArray[e]:null}function S(e,t,n){var r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;if(e)for(r=e.AdaptationSet_asArray,o=0;o<r.length;o+=1)for(a=r[o].Representation_asArray,s=0;s<a.length;s+=1)if(t===(i=a[s]).id)return n?s:i;return null}return e={getBandwidthForRepresentation:function(e,t){var n;return(n=S(A(t),e))?n.bandwidth:null},getIndexForRepresentation:function(e,t){return function(e,t){var n=S(e,t,!0);return null!==n?n:-1}(A(t),e)},getMaxIndexForBufferType:function(e,n){return function(e,n){var r,i=void 0,a=void 0,o=void 0;if(!e||!n)return-1;for(r=e.AdaptationSet_asArray,o=0;o<r.length;o+=1)if(i=r[o],a=i.Representation_asArray,t.getIsTypeOf(i,n))return a.length;return-1}(A(n),e)},convertDataToRepresentationInfo:function(e){if(e){var n=new uA.default,r=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],i=t.getRepresentationFor(e.index,r);return n.id=e.id,n.quality=e.index,n.bandwidth=t.getBandwidth(i),n.DVRWindow=e.segmentAvailabilityRange,n.fragmentDuration=e.segmentDuration||(e.segments&&e.segments.length>0?e.segments[0].duration:NaN),n.MSETimeOffset=e.MSETimeOffset,n.mediaInfo=E(e.adaptation),n}return null},getDataForMedia:m,getStreamsInfo:function(e,t){var n=[],i=r;if(e&&(T(),i=c(e)),i.length>0){(!t||t>i.length)&&(t=i.length);for(var a=0;a<t;a++)n.push(v(i[a]))}return n},getMediaInfoForType:function(e,n){if(0===r.length||!e)return null;var a=_(e,r);if(!a)return null;var o=a.id;i[o]=i[o]||t.getAdaptationsForPeriod(a);var s=l(e.index,n,e);if(!s)return null;var u=t.getIndexForAdaptation(s,r[0].mpd.manifest,e.index);return E(i[o][u])},getAllMediaInfoForType:d,getAdaptationForType:l,getRealAdaptation:function(e,n){var i,a=void 0,o=_(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},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=m(e);return t.getRepresentationsForAdaptation(n)},getEventsFor:function(e,n){var i=[];if(r.length>0){var a=r[0].mpd.manifest;e instanceof fA.default?i=t.getEventsForPeriod(_(e,r)):e instanceof lA.default?i=t.getEventStreamForAdaptationSet(a,m(e)):e instanceof uA.default&&(i=t.getEventStreamForRepresentation(a,n))}return i},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=new cA.default,s=e.timescale||1,u=r.adaptation.period.start,l=t[i+"/"+a],f=isNaN(r.presentationTimeOffset)?isNaN(l.presentationTimeOffset)?0:l.presentationTimeOffset:r.presentationTimeOffset,d=e.presentation_time_delta/s,c=void 0;c=0===e.version?u+n-f+d:u-f+d;var h=e.event_duration,g=e.id,p=e.message_data;return o.eventStream=l,o.eventStream.value=a,o.eventStream.timescale=s,o.duration=h,o.id=g,o.calculatedPresentationTime=c,o.messageData=p,o.presentationTimeDelta=d,o}catch(e){return null}},getMpd:h,setConfig:function(e){e&&(e.constants&&(o=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;T(),r=c(e),i={}},getIsTextTrack:function(e){return t.getIsTextTrack(e)},getUTCTimingSources:function(){var e=p();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=p(e);return t.getIsDynamic(n)},getDuration:function(e){var n=p(e);return t.getDuration(n)},getRegularPeriods:c,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)},getVoAdaptations:function(){return i},getVoPeriods:function(){return 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){a[e]=a[e]||{},a[e][t]=a[e][t]||{},a[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()<s.getTime())},applyPatchToManifest:function(e,t){n.getPatchOperations(t).forEach((function(t){var n=t.getMpdTarget(e);if(null!==n){var r=n.name,i=n.target,a=n.leaf;if(t.xpath.findsAttribute())switch(t.action){case"add":case"replace":i[r]=t.value;break;case"remove":delete i[r]}else{var o=(i[r+"_asArray"]||[]).indexOf(a),s="prepend"===t.position||"before"===t.position;if(("remove"===t.action||"replace"===t.action)&&(delete i[r],-1!=o)){var u=i[r+"_asArray"];u.splice(o,1),u.length>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}))}}}))},reset:g},t=(0,gA.default)(u).getInstance(),n=(0,pA.default)(u).getInstance(),g(),e}_A.__dashjs_factory_name="DashAdapter";var EA=hA.default.getSingletonFactory(_A),yA=Object.defineProperty({default:EA},"__esModule",{value:!0}),vA=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var TA=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return vA(e,null,[{key:"round10",value:function(e,t){return function(e,t,n){if(void 0===n||0==+n)return Math[e](t);if(n=+n,null===(t=+t)||isNaN(t)||!("number"==typeof n&&n%1==0))return NaN;return t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))}("round",e,t)}}]),e}();var AA=Object.defineProperty({default:TA},"__esModule",{value:!0});var SA=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]},bA=Object.defineProperty({default:SA},"__esModule",{value:!0});var IA=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.mt=null,this.to=null,this.lto=null},RA=Object.defineProperty({default:IA},"__esModule",{value:!0});var wA=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.level=null},NA=Object.defineProperty({default:wA},"__esModule",{value:!0}),MA=function(e){return e&&e.__esModule?e:{default:e}}(E);var CA=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=null,this.state=MA.default.BUFFER_EMPTY},DA=Object.defineProperty({default:CA},"__esModule",{value:!0});var OA=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.range=null,this.manifestInfo=null},PA=Object.defineProperty({default:OA},"__esModule",{value:!0});var LA=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.droppedFrames=null},FA=Object.defineProperty({default:LA},"__esModule",{value:!0});function xA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var UA=function e(){xA(this,e),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]},BA=function e(){xA(this,e),this.id=null,this.index=null,this.start=null,this.duration=null},kA=function e(){xA(this,e),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null},GA=Object.defineProperty({ManifestUpdate:UA,ManifestUpdateStreamInfo:BA,ManifestUpdateRepresentationInfo:kA},"__esModule",{value:!0});var jA=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.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null},YA=Object.defineProperty({default:jA},"__esModule",{value:!0});var qA=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadingRequests=[],this.executedRequests=[]},HA=Object.defineProperty({default:qA},"__esModule",{value:!0}),KA=iS(c),VA=iS(E),zA=iS(bA),WA=iS(RA),XA=iS(NA),QA=iS(DA),ZA=iS(PA),$A=iS(FA),JA=iS(YA),eS=iS(P),tS=iS(HA),nS=iS(B),rS=iS(v);function iS(e){return e&&e.__esModule?e:{default:e}}function aS(e){var t,n=(e=e||{}).settings,r=this.context,i=(0,eS.default)(r).getInstance(),a=void 0;function o(){i.trigger(nS.default.METRICS_CHANGED)}function s(e){i.trigger(nS.default.METRIC_CHANGED,{mediaType:e}),o()}function u(e,t,n){i.trigger(nS.default.METRIC_UPDATED,{mediaType:e,metric:t,value:n}),s(e)}function l(e,t,n){i.trigger(nS.default.METRIC_ADDED,{mediaType:e,metric:t,value:n}),s(e)}function f(e,t){var n=null;return e?(a.hasOwnProperty(e)?n=a[e]:t||(n=new zA.default,a[e]=n),n):n}function d(e,t,r){var i=f(e);null!==i&&(i[t].push(r),i[t].length>n.get().streaming.metricsMaxListDepth&&i[t].shift())}function c(e,t,n){d(e,t,n),l(e,t,n)}return t={clearCurrentMetricsForType:function(e){delete a[e],s(e)},clearAllCurrentMetrics:function(){a={},o()},getMetricsFor:f,addHttpRequest:function e(t,n,r,i,a,o,s,u,l,f,d,h,g,p,m){var _=new ce.HTTPRequest;o&&o!==i&&(e(t,null,r,i,a,null,null,u,l,null,null,null,g,null,null),_.actualurl=o),_.tcpid=n,_.type=r,_.url=i,_.range=u,_.trequest=l,_.tresponse=f,_.responsecode=h,_._tfinish=d,_._stream=t,_._mediaduration=g,_._quality=a,_._responseHeaders=p,_._serviceLocation=s,m?m.forEach((function(e){!function(e,t,n,r){var i=new ce.HTTPRequestTrace;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),c(t,VA.default.HTTP_REQUEST,_)},addRepresentationSwitch:function(e,t,n,r,i){var a=new WA.default;a.t=t,a.mt=n,a.to=r,i?a.lto=i:delete a.lto,c(e,VA.default.TRACK_SWITCH,a)},addBufferLevel:function(e,t,n){var r=new XA.default;r.t=t,r.level=n,c(e,VA.default.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){var r=new QA.default;r.target=n,r.state=t,c(e,VA.default.BUFFER_STATE,r)},addDVRInfo:function(e,t,n,r){var i=new ZA.default;i.time=t,i.range=r,i.manifestInfo=n,c(e,VA.default.DVR_INFO,i)},addDroppedFrames:function(e,t){var n=new $A.default,r=f(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||c(e,VA.default.DROPPED_FRAMES,n))},addSchedulingInfo:function(e,t,n,r,i,a,o,s,u){var l=new JA.default;l.mediaType=e,l.t=t,l.type=n,l.startTime=r,l.availabilityStartTime=i,l.duration=a,l.quality=o,l.range=s,l.state=u,c(e,VA.default.SCHEDULING_INFO,l)},addRequestsQueue:function(e,t,n){var r=new tS.default;r.loadingRequests=t,r.executedRequests=n,f(e).RequestsQueue=r,l(e,VA.default.REQUESTS_QUEUE,r)},addManifestUpdate:function(e,t,n,r,i,a,o,s,u,f){var c=new GA.ManifestUpdate;c.mediaType=e,c.type=t,c.requestTime=n,c.fetchTime=r,c.availabilityStartTime=i,c.presentationStartTime=a,c.clientTimeOffset=o,c.currentTime=s,c.buffered=u,c.latency=f,d(KA.default.STREAM,VA.default.MANIFEST_UPDATE,c),l(e,VA.default.MANIFEST_UPDATE,c)},updateManifestUpdateInfo:function(e,t){if(e){for(var n in t)e[n]=t[n];u(e.mediaType,VA.default.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,i){if(e){var a=new GA.ManifestUpdateStreamInfo;a.id=t,a.index=n,a.start=r,a.duration=i,e.streamInfo.push(a),u(e.mediaType,VA.default.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,n,r,i,a,o,s){if(e&&e.representationInfo){var l=new GA.ManifestUpdateRepresentationInfo;l.id=t,l.index=n,l.streamIndex=r,l.mediaType=i,l.startNumber=o,l.fragmentInfoType=s,l.presentationTimeOffset=a,e.representationInfo.push(l),u(e.mediaType,VA.default.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,c(KA.default.STREAM,VA.default.PLAY_LIST,e)},addDVBErrors:function(e){c(KA.default.STREAM,VA.default.DVB_ERRORS,e)}},a={},t}aS.__dashjs_factory_name="MetricsModel";var oS=rS.default.getSingletonFactory(aS),sS=Object.defineProperty({default:oS},"__esModule",{value:!0}),uS=gS(c),lS=gS(v),fS=gS(E),dS=gS(AA),cS=gS(sS),hS=gS(Cc);function gS(e){return e&&e.__esModule?e:{default:e}}function pS(e){e=e||{};var t,n=this.context,r=void 0,i=void 0,a=void 0,o=e.metricsModel;function s(e){var t=o.getMetricsFor(e,!0);if(!t)return null;var n=t.HttpList,r=null,i=void 0;if(!n||n.length<=0)return null;for(i=n.length-1;i>=0;){if(n[i].responsecode){r=n[i];break}i--}return r}function u(e){var t=o.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function l(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 l(o.getMetricsFor(e,!0),fS.default.TRACK_SWITCH)},getCurrentBufferState:function(e){return l(o.getMetricsFor(e,!0),fS.default.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=l(o.getMetricsFor(e,!0),fS.default.BUFFER_LEVEL);return t?dS.default.round10(t.level/1e3,-3):0},getCurrentHttpRequest:s,getHttpRequests:u,getCurrentDroppedFrames:function(){return l(o.getMetricsFor(uS.default.VIDEO,!0),fS.default.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return l(o.getMetricsFor(e,!0),fS.default.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return l(e?o.getMetricsFor(e,!0):o.getMetricsFor(uS.default.VIDEO,!0)||o.getMetricsFor(uS.default.AUDIO,!0),fS.default.DVR_INFO)},getCurrentManifestUpdate:function(){return l(o.getMetricsFor(uS.default.STREAM),fS.default.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){var n={},r=s(e);return r&&(n=hS.default.parseHttpHeaders(r._responseHeaders)),void 0===n[t]?null:n[t]},getLatestMPDRequestHeaderValueByID:function(e){var t,n={},r=void 0,i=void 0;for(i=(t=u(uS.default.STREAM)).length-1;i>=0;i--)if((r=t[i]).type===ce.HTTPRequest.MPD_TYPE){n=hS.default.parseHttpHeaders(r._responseHeaders);break}return void 0===n[e]?null:n[e]},addRepresentationSwitch:function(e,t,n,r,i){o.addRepresentationSwitch(e,t,n,r,i)},addDVRInfo:function(e,t,n,r){o.addDVRInfo(e,t,n,r)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();o.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();o.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var n=this.getCurrentManifestUpdate();o.addManifestUpdateRepresentationInfo(n,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){o.addManifestUpdate(uS.default.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,n,r,i){o.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)},addSchedulingInfo:function(e,t){o.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,n){o.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){o.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){o.addBufferState(e,t,n)},addDroppedFrames:function(e){o.addDroppedFrames(uS.default.VIDEO,e)},addPlayList:function(){a&&(o.addPlayList(a),a=null)},addDVBErrors:function(e){o.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(a=new Qd.PlayList).start=new Date,a.mstart=e,a.starttype=t},createPlaylistTraceMetrics:function(e,t,n){!0===r&&(r=!1,(i=new Qd.PlayListTrace).representationid=e,i.start=new Date,i.mstart=t,i.playbackspeed=null!==n?n.toString():null)},updatePlayListTraceMetrics:function(e){if(i)for(var t in i)i[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===r&&a&&i&&i.start){var n=i.start,o=e.getTime()-n.getTime();i.duration=o,i.stopreason=t,a.trace.push(i),r=!0}},clearAllCurrentMetrics:function(){o.clearAllCurrentMetrics()}},o=o||(0,cS.default)(n).getInstance({settings:e.settings}),r=!0,i=null,a=null,t}pS.__dashjs_factory_name="DashMetrics";var mS=lS.default.getSingletonFactory(pS),_S=Object.defineProperty({default:mS},"__esModule",{value:!0}),ES=bS(P),yS=bS(B),vS=bS(v),TS=bS(p),AS=bS(zh),SS=bS(Gc);function bS(e){return e&&e.__esModule?e:{default:e}}function IS(){var e,t=this.context,n=(0,ES.default)(t).getInstance(),r=(0,SS.default)(t).getInstance(),i=void 0,a=void 0,o=void 0,s=void 0;function u(e){a=e}function l(e,t,n,r){return r?n&&t.timeShiftBufferDepth!=Number.POSITIVE_INFINITY?new Date(t.availabilityStartTime.getTime()+1e3*(e+t.timeShiftBufferDepth)):t.availabilityEndTime:n?new Date(t.availabilityStartTime.getTime()+1e3*(e-a)):t.availabilityStartTime}function f(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*a)/1e3}function d(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function c(e){void 0!==e.offset&&(u(e.offset/1e3),o=!0)}function h(){a=0,o=!1,s=NaN}function g(){n.off(yS.default.UPDATE_TIME_SYNC_OFFSET,c,this),h()}return e={initialize:function(){h(),n.on(yS.default.UPDATE_TIME_SYNC_OFFSET,c,this)},getClientTimeOffset:function(){return a},setClientTimeOffset:u,getExpectedLiveEdge:function(){return s},setExpectedLiveEdge:function(e){s=e},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return l.call(this,e,t,n)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return l.call(this,e,t,n,!0)},calcPresentationTimeFromWallTime:f,calcPresentationTimeFromMediaTime:d,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcSegmentAvailabilityRange:function(e,t){var n=e.adaptation.period,a={start:n.start,end:n.start+n.duration};if(!t)return a;if(!o&&e.segmentAvailabilityRange)return e.segmentAvailabilityRange;var s=e.segmentDuration||(e.segments&&e.segments.length?e.segments[e.segments.length-1].duration:0);if(e.segmentInfoType===TS.default.SEGMENT_TIMELINE&&r.get().streaming.calcSegmentAvailabilityRangeFromTimeline)return function(e){var t,n=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],r=i.getRepresentationFor(e.index,n),a=r.SegmentTemplate.SegmentTimeline,o=r.SegmentTemplate.timescale,s=a.S_asArray,u={start:0,end:0},l=0,f=void 0,c=void 0,h=void 0;for(u.start=d(s[0].t/o,e),h=0,t=s.length;h<t;h++)f=s[h],c=0,f.hasOwnProperty("r")&&(c=f.r),l+=f.d/o*(1+c);return u.end=u.start+l,u}(e);var u=f(new Date,n),l=n.start+n.duration;a.start=Math.max(u-n.mpd.timeShiftBufferDepth,n.start);var c=void 0!==e.availabilityTimeOffset&&e.availabilityTimeOffset<s?s-e.availabilityTimeOffset:s;return a.end=u>=l&&u-c<l?l:u-c,a},getPeriodEnd:function(e,t){var n=e.adaptation.period;if(!t)return n.start+n.duration;if(!o&&e.segmentAvailabilityRange)return e.segmentAvailabilityRange;var r=e.segmentDuration||(e.segments&&e.segments.length?e.segments[e.segments.length-1].duration:0),i=f(new Date,n),a=n.start+n.duration,s=void 0!==e.availabilityTimeOffset&&e.availabilityTimeOffset<r?r-e.availabilityTimeOffset:r;return Math.min(i-s,a)},calcWallTimeForSegment:function(e,t){var n=void 0,r=void 0,i=void 0;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},reset:g},i=(0,AS.default)(t).getInstance(),g(),e}IS.__dashjs_factory_name="TimelineConverter";var RS=vS.default.getSingletonFactory(IS),wS=Object.defineProperty({default:RS},"__esModule",{value:!0}),NS=u((function(e,t){var n={encode:function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>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},decode:function(e){for(var t=[],n=0;n<e.length;){var r=e[n++];r<128||(r<224?(r=(31&r)<<6,r|=63&e[n++]):r<240?(r=(15&r)<<12,r|=(63&e[n++])<<6,r|=63&e[n++]):(r=(7&r)<<18,r|=(63&e[n++])<<12,r|=(63&e[n++])<<6,r|=63&e[n++])),t.push(String.fromCharCode(r))}return t.join("")}},r={};!function(e){var t=function(t){for(var n=0,r=[],i=0|t.length/3;0<i--;){var a=(t[n]<<16)+(t[n+1]<<8)+t[n+2];n+=3,r.push(e.charAt(63&a>>18)),r.push(e.charAt(63&a>>12)),r.push(e.charAt(63&a>>6)),r.push(e.charAt(63&a))}if(2==t.length-n){a=(t[n]<<16)+(t[n+1]<<8);r.push(e.charAt(63&a>>18)),r.push(e.charAt(63&a>>12)),r.push(e.charAt(63&a>>6)),r.push("=")}else if(1==t.length-n){a=t[n]<<16;r.push(e.charAt(63&a>>18)),r.push(e.charAt(63&a>>12)),r.push("==")}return r.join("")},i=function(){for(var t=[],n=0;n<e.length;++n)t[e.charCodeAt(n)]=n;return t["=".charCodeAt(0)]=0,t}(),o=function(e){for(var t=0,n=[],r=0|e.length/4;0<r--;){var a=(i[e.charCodeAt(t)]<<18)+(i[e.charCodeAt(t+1)]<<12)+(i[e.charCodeAt(t+2)]<<6)+i[e.charCodeAt(t+3)];n.push(255&a>>16),n.push(255&a>>8),n.push(255&a),t+=4}return n&&("="==e.charAt(t-2)?(n.pop(),n.pop()):"="==e.charAt(t-1)&&n.pop()),n},u={encode:function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")}};r.decodeArray=function(e){var t=o(e);return new Uint8Array(t)},r.encodeASCII=function(e){var n=u.encode(e);return t(n)},r.decodeASCII=function(e){var t=o(e);return u.decode(t)},r.encode=function(e){var r=n.encode(e);return t(r)},r.decode=function(e){var t=o(e);return n.decode(t)}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),t.decode=r.decode,t.decodeArray=r.decodeArray,t.encode=r.encode,t.encodeASCII=r.encodeASCII})),MS=mb(l),CS=mb(c),DS=mb(p),OS=mb(E),PS=mb(se),LS=mb(Qm),FS=mb(i_),xS=mb(g_),US=mb(iE),BS=mb(Jy),kS=mb(ov),GS=mb(hv),jS=mb(vv),YS=mb(Wi),qS=mb(Ld),HS=mb(Qa),KS=mb(wv),VS=mb(Lv),zS=mb(qv),WS=mb(fl),XS=mb(Gg),QS=mb(Zv),ZS=mb(Eg),$S=mb(aT),JS=mb(Z),eb=mb(ra),tb=mb(P),nb=mb(B),rb=mb(R),ib=mb(v),ab=mb(Gc),ob=mb(UT),sb=mb(yA),ub=mb(_S),lb=mb(wS),fb=mb(NS),db=mb(xe),cb=mb(Ie),hb=mb(nm),gb=mb(Hd),pb=mb(ze);function mb(e){return e&&e.__esModule?e:{default:e}}function _b(){var e="You must first call initialize() and set a source before calling this method",t="You must first call initialize() and set a valid source and view before calling this method",n="You must first call attachView() to set the video element before calling this method",r="You must first call attachSource() with a valid source before calling this method",i=this.context,a=(0,tb.default)(i).getInstance(),o=(0,ab.default)(i).getInstance(),s=(0,JS.default)(i).getInstance({settings:o}),u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0,M=void 0,C=void 0,D=void 0,O=void 0,P=void 0,L=void 0,F=void 0,x=void 0,U=void 0,B=void 0,k=void 0,G=void 0,j=void 0,Y=void 0,q=void 0;function H(){ie(null),te(null),d=null,v&&(v.reset(),v=null),T&&(T.reset(),T=null),G.reset(),o.reset(),S&&(S.reset(),S=null)}function K(){return!!f&&!!x.getElement()}function V(){return(0,sT.getVersionString)()}function z(){if(!g)throw t;return O.isPaused()}function W(e){var t=P.getCurrentDVRInfo();if(!t)return 0;var n=O.getLiveDelay(),r=t.range.start+e;return r>t.range.end-n&&(r=t.range.end-n),r}function X(e){if(!g)throw t;var n=ee().currentTime;if(void 0!==e)n=C.getTimeRelativeToStreamId(n,e);else if(O.getIsDynamic()){var r=P.getCurrentDVRInfo();n=null===r||0===n?0:Math.max(0,n-r.range.start)}return n}function Q(){if(!g)throw t;var e=ee().duration;if(O.getIsDynamic()){var n=P.getCurrentDVRInfo();e=n?n.range.end-n.range.start:0}return e}function Z(e){(0,et.checkParameterType)(e,"boolean"),p=e}function $(){I.restoreDefaultUTCTimingSources()}function J(){return P}function ee(){if(!x.getElement())throw n;return x.getElement()}function te(e){if(!c)throw"MediaPlayer not initialized!";x.setElement(e),e&&(ue(),function(){if(T)return;var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(i).create();T=t.createMetricsReporting({debug:s,eventBus:a,mediaElement:ee(),adapter:b,dashMetrics:P,events:nb.default,constants:CS.default,metricsConstants:OS.default})}}(),function(){if(A)return;var e=dashjs.MssHandler;"function"==typeof e&&(eb.default.extend(e.errors),A=e(i).create({eventBus:a,mediaPlayerModel:I,dashMetrics:P,manifestModel:L,playbackController:O,streamController:C,protectionController:v,baseURLController:w,errHandler:R,events:nb.default,constants:CS.default,debug:s,initSegmentType:ce.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:fb.default,ISOBoxer:db.default,settings:o}))}(),C&&C.switchToVideoElement()),g&&oe(),de()}function ne(t){if(!h)throw e;var n=C.getActiveStreamInfo();return y.getTracksFor(t,n)}function re(e,t){var n=-1;e.some((function(e,r){if(e===t)return n=r,!0})),n<0||e.splice(n,1)}function ie(e){if(!c)throw"MediaPlayer not initialized!";"string"==typeof e&&B.initialize(e),f=e,(h||g)&&oe(),K()&&de()}function ae(){if(!h)throw e;var t=C.getActiveStreamInfo();return t?C.getStreamById(t.id):null}function oe(){g=!1,h=!1,b.reset(),C.reset(),D.reset(),O.reset(),m.reset(),y.reset(),U.reset(),v&&(o.get().streaming.keepProtectionMediaKeys?v.stop():(v.reset(),v=null,ue())),F.reset()}function se(){return(0,BS.default)(i).create({debug:s,errHandler:R,dashMetrics:P,mediaPlayerModel:I,requestModifier:(0,qS.default)(i).getInstance(),mssHandler:A,settings:o})}function ue(){if(v)return v;var e=dashjs.Protection;if("function"==typeof e){var t=e(i).create();return nb.default.extend(e.events),rb.default.extend(e.events,{publicOnly:!0}),eb.default.extend(e.errors),N||(N=(0,GS.default)(i).getInstance()),(v=t.createProtectionSystem({debug:s,errHandler:R,videoModel:x,capabilities:N,eventBus:a,events:nb.default,BASE64:fb.default,constants:CS.default,cmcdModel:F,settings:o}))&&(v.setLicenseRequestFilters(j),v.setLicenseResponseFilters(Y)),v}return null}function le(){if(!c)throw"MediaPlayer not initialized!";if(S)return S;var e=dashjs.OfflineController;if("function"==typeof e){nb.default.extend(e.events),rb.default.extend(e.events,{publicOnly:!0}),eb.default.extend(e.errors);var t=se(),n=(0,hb.default)(i).create();return n.setConfig({manifestModel:L,adapter:b,manifestLoader:t,errHandler:R}),S=e(i).create({debug:s,manifestUpdater:n,baseURLController:w,manifestLoader:t,manifestModel:L,mediaPlayerModel:I,abrController:m,playbackController:O,adapter:b,errHandler:R,dashMetrics:P,timelineConverter:E,schemeLoaderFactory:_,eventBus:a,events:nb.default,errors:eb.default,constants:CS.default,settings:o,dashConstants:DS.default,urlUtils:(0,gb.default)(i).getInstance()})}return null}function fe(e){var t=P.getCurrentDVRInfo();return t?e+(t.manifestInfo.availableFrom.getTime()/1e3+t.range.start):0}function de(){var e;S&&S.resetRecords(),!h&&f&&(h=!0,l.info("Streaming Initialized"),e=se(),C||(C=(0,LS.default)(i).getInstance()),M.setConfig({capabilities:N,adapter:b,settings:o}),M.setCustomCapabilitiesFilters(q),C.setConfig({capabilities:N,capabilitiesFilter:M,manifestLoader:e,manifestModel:L,mediaPlayerModel:I,protectionController:v,adapter:b,dashMetrics:P,errHandler:R,timelineConverter:E,videoModel:x,playbackController:O,abrController:m,mediaController:y,textController:U,settings:o,baseURLController:w}),D.setConfig({settings:o,playbackController:O,streamController:C,videoModel:x,timelineConverter:E,adapter:b}),O.setConfig({streamController:C,dashMetrics:P,mediaPlayerModel:I,adapter:b,videoModel:x,timelineConverter:E,uriFragmentModel:B,settings:o}),m.setConfig({streamController:C,domStorage:k,mediaPlayerModel:I,dashMetrics:P,adapter:b,videoModel:x,settings:o}),U.setConfig({errHandler:R,manifestModel:L,adapter:b,mediaController:y,streamController:C,videoModel:x}),F.setConfig({abrController:m,dashMetrics:P,playbackController:O}),C.initialize(p,d),D.initialize(),F.initialize(),"string"==typeof f?C.load(f):C.loadWithManifest(f)),!g&&K()&&(g=!0,l.info("Playback Initialized"))}return u={initialize:function(e,t,n){N||(N=(0,GS.default)(i).getInstance()),R=(0,kS.default)(i).getInstance(),N.supportsMediaSource()?c||(c=!0,E=(0,lb.default)(i).getInstance(),m||(m=(0,WS.default)(i).getInstance()).setConfig({settings:o}),_||(_=(0,XS.default)(i).getInstance()),O||(O=(0,PS.default)(i).getInstance()),y||(y=(0,xS.default)(i).getInstance()),C||(C=(0,LS.default)(i).getInstance()),D||(D=(0,FS.default)(i).getInstance()),M||(M=(0,jS.default)(i).getInstance()),b=(0,sb.default)(i).getInstance(),L=(0,VS.default)(i).getInstance(),F=(0,ZS.default)(i).getInstance(),P=(0,ub.default)(i).getInstance({settings:o}),U=(0,HS.default)(i).getInstance(),k=(0,$S.default)(i).getInstance({settings:o}),b.setConfig({constants:CS.default,cea608parser:MS.default,errHandler:R,BASE64:fb.default}),w||(w=(0,US.default)(i).create()),w.setConfig({adapter:b}),(G=(0,ob.default)(i).getInstance({dashMetrics:P,mediaPlayerModel:I,errHandler:R,baseURLController:w,events:nb.default,eventBus:a,debug:s,boxParser:(0,pb.default)(i).getInstance(),requestModifier:(0,qS.default)(i).getInstance(),errors:eb.default})).initialize(),y.setConfig({domStorage:k,settings:o}),$(),Z(void 0===n||n),le(),e&&te(e),t&&ie(t),l.info("[dash.js "+V()+"] MediaPlayer has been initialized")):R.error(new cb.default(eb.default.CAPABILITY_MEDIASOURCE_ERROR_CODE,eb.default.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(N=e.capabilities),e.capabilitiesFilter&&(M=e.capabilitiesFilter),e.streamController&&(C=e.streamController),e.gapController&&(D=e.gapController),e.playbackController&&(O=e.playbackController),e.mediaPlayerModel&&(I=e.mediaPlayerModel),e.abrController&&(m=e.abrController),e.schemeLoaderFactory&&(_=e.schemeLoaderFactory),e.mediaController&&(y=e.mediaController),e.settings&&(o=e.settings))},on:function(e,t,n,r){a.on(e,t,n,r)},off:function(e,t,n){a.off(e,t,n)},extend:function(e,t,n){ib.default.extend(e,t,n,i)},attachView:te,attachSource:ie,isReady:K,preload:function(){if(x.getElement()||h)return!1;if(!f)throw r;de()},play:function(){if(!g)throw t;(!p||z()&&g)&&O.play()},isPaused:z,pause:function(){if(!g)throw t;O.pause()},isSeeking:function(){if(!g)throw t;return O.isSeeking()},isDynamic:function(){if(!g)throw t;return O.getIsDynamic()},seek:function(e){if(!g)throw t;if((0,et.checkParameterType)(e,"number"),isNaN(e))throw CS.default.BAD_ARGUMENT_ERROR;var n=O.getIsDynamic()?W(e):e;O.seek(n)},setPlaybackRate:function(e){ee().playbackRate=e},getPlaybackRate:function(){return ee().playbackRate},setMute:function(e){(0,et.checkParameterType)(e,"boolean"),ee().muted=e},isMuted:function(){return ee().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw CS.default.BAD_ARGUMENT_ERROR;ee().volume=e},getVolume:function(){return ee().volume},time:X,duration:Q,timeAsUTC:function(){if(!g)throw t;return X()<0?NaN:fe(X())},durationAsUTC:function(){if(!g)throw t;return fe(Q())},getActiveStream:ae,getDVRWindowSize:function(){var e=P.getCurrentDVRInfo();return e?e.manifestInfo.DVRWindowSize:0},getDVRSeekOffset:W,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:V,getDebug:function(){return s},getBufferLength:function(e){var t=[CS.default.VIDEO,CS.default.AUDIO,CS.default.FRAGMENTED_TEXT];if(e){if(-1!==t.indexOf(e)){var n=J().getCurrentBufferLevel(e);return n||NaN}return l.warn("getBufferLength requested for invalid type"),NaN}var r=t.map((function(e){return ne(e).length>0?J().getCurrentBufferLevel(e):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)}));return r===Number.MAX_VALUE?NaN:r},getTTMLRenderingDiv:function(){return x?x.getTTMLRenderingDiv():null},getVideoElement:ee,getSource:function(){if(!f)throw r;return f},getCurrentLiveLatency:function(){if(!c)throw"MediaPlayer not initialized!";return g?O.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(t){if(!h)throw e;return m.getTopBitrateInfoFor(t)},setAutoPlay:Z,getAutoPlay:function(){return p},getDashMetrics:J,getQualityFor:function(t){if(!h)throw e;if(t===CS.default.IMAGE){var n=ae();if(!n)return-1;var r=n.getThumbnailController();return r?r.getCurrentTrackIndex():-1}return m.getQualityFor(t)},setQualityFor:function(t,n){if(!h)throw e;if(t===CS.default.IMAGE){var r=ae();if(!r)return;var i=r.getThumbnailController();i&&i.setTrackByIndex(n)}m.setPlaybackQuality(t,C.getActiveStreamInfo(),n)},updatePortalSize:function(){m.setElementSize(),m.setWindowResizeEventCalled(!0)},setTextDefaultLanguage:function(e){l.warn('setTextDefaultLanguage is deprecated and will be removed in version 3.2.0. Please use setInitialMediaSettingsFor("fragmentedText", { lang: lang }) instead'),void 0===U&&(U=(0,HS.default)(i).getInstance()),U.setTextDefaultLanguage(e)},getTextDefaultLanguage:function(){return l.warn('getTextDefaultLanguage is deprecated and will be removed in version 3.2.0. Please use getInitialMediaSettingsFor("fragmentedText").lang instead'),void 0===U&&(U=(0,HS.default)(i).getInstance()),U.getTextDefaultLanguage()},setTextDefaultEnabled:function(e){void 0===U&&(U=(0,HS.default)(i).getInstance()),U.setTextDefaultEnabled(e)},getTextDefaultEnabled:function(){return void 0===U&&(U=(0,HS.default)(i).getInstance()),U.getTextDefaultEnabled()},enableText:function(e){void 0===U&&(U=(0,HS.default)(i).getInstance()),U.enableText(e)},enableForcedTextStreaming:function(e){void 0===U&&(U=(0,HS.default)(i).getInstance()),U.enableForcedTextStreaming(e)},isTextEnabled:function(){return void 0===U&&(U=(0,HS.default)(i).getInstance()),U.isTextEnabled()},setTextTrack:function(e){if(!g)throw t;void 0===U&&(U=(0,HS.default)(i).getInstance()),U.setTextTrack(e)},getBitrateInfoListFor:function(t){if(!h)throw e;var n=ae();return n?n.getBitrateListFor(t):[]},getStreamsFromManifest:function(t){if(!h)throw e;return b.getStreamsInfo(t)},getTracksFor:ne,getTracksForTypeFromManifest:function(t,n,r){if(!h)throw e;return(r=r||b.getStreamsInfo(n,1)[0])?b.getAllMediaInfoForType(r,t,n):[]},getCurrentTrackFor:function(t){if(!h)throw e;var n=C.getActiveStreamInfo();return y.getCurrentTrackFor(t,n)},setInitialMediaSettingsFor:function(e,t){if(!c)throw"MediaPlayer not initialized!";y.setInitialSettings(e,t),e===CS.default.FRAGMENTED_TEXT&&U.setInitialSettings(t)},getInitialMediaSettingsFor:function(e){if(!c)throw"MediaPlayer not initialized!";return y.getInitialSettings(e)},setCurrentTrack:function(t){if(!h)throw e;y.setTrack(t)},getTrackSwitchModeFor:function(e){if(!c)throw"MediaPlayer not initialized!";return y.getSwitchMode(e)},setTrackSwitchModeFor:function(e,t){if(!c)throw"MediaPlayer not initialized!";y.setSwitchMode(e,t)},setSelectionModeForInitialTrack:function(e){if(!c)throw"MediaPlayer not initialized!";y.setSelectionModeForInitialTrack(e)},getSelectionModeForInitialTrack:function(){if(!c)throw"MediaPlayer not initialized!";return y.getSelectionModeForInitialTrack()},addABRCustomRule:function(e,t,n){I.addABRCustomRule(e,t,n)},removeABRCustomRule:function(e){I.removeABRCustomRule(e)},removeAllABRCustomRule:function(){I.removeABRCustomRule()},getAverageThroughput:function(e){var t=m.getThroughputHistory();return t?t.getAverageThroughput(e):0},retrieveManifest:function(e,t){var n=se(),r=this;a.on(nb.default.INTERNAL_MANIFEST_LOADED,(function e(i){i.error?t(null,i.error):t(i.manifest),a.off(nb.default.INTERNAL_MANIFEST_LOADED,e,r),n.reset()}),r),B.initialize(e),n.load(e)},addUTCTimingSource:function(e,t){I.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){I.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){I.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:$,setXHRWithCredentialsForType:function(e,t){I.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return I.getXHRWithCredentialsForType(e)},getProtectionController:function(){return ue()},attachProtectionController:function(e){v=e},setProtectionData:function(e){d=e,C&&C.setProtectionData(d)},registerLicenseRequestFilter:function(e){j.push(e),v&&v.setLicenseRequestFilters(j)},registerLicenseResponseFilter:function(e){Y.push(e),v&&v.setLicenseResponseFilters(Y)},unregisterLicenseRequestFilter:function(e){re(j,e),v&&v.setLicenseRequestFilters(j)},unregisterLicenseResponseFilter:function(e){re(Y,e),v&&v.setLicenseResponseFilters(Y)},registerCustomCapabilitiesFilter:function(e){q.push(e),M&&M.setCustomCapabilitiesFilters(q)},unregisterCustomCapabilitiesFilter:function(e){re(q,e),M&&M.setCustomCapabilitiesFilters(q)},displayCaptionsOnTop:function(e){var t=(0,YS.default)(i).getInstance();t.setConfig({videoModel:x}),t.initialize(),t.setDisplayCConTop(e)},attachTTMLRenderingDiv:function(e){if(!x.getElement())throw n;x.setTTMLRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=NaN;return U&&(e=U.getCurrentTrackIdx()),e},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var n=O.getIsDynamic()?W(e):e,r=C.getStreamForTime(n);if(null!==r){var i=r.getThumbnailController();if(i){var a=C.getTimeRelativeToStreamId(n,r.getId());return i.provide(a,t)}t(null)}else t(null)}},getDashAdapter:function(){return b},getOfflineController:function(){return le()},getSettings:function(){return o.get()},updateSettings:function(e){o.update(e)},resetSettings:function(){o.reset()},reset:H,destroy:function(){H(),j=[],Y=[],q=[],ib.default.deleteSingletonInstances(i)}},l=s.getLogger(u),c=!1,g=!1,h=!1,p=!0,v=null,S=null,d=null,b=null,G=null,nb.default.extend(rb.default),I=(0,zS.default)(i).getInstance(),x=(0,QS.default)(i).getInstance(),B=(0,KS.default)(i).getInstance(),j=[],Y=[],q=[],u}_b.__dashjs_factory_name="MediaPlayer";var Eb=ib.default.getClassFactory(_b);Eb.events=rb.default,Eb.errors=eb.default,ib.default.updateClassFactory(_b.__dashjs_factory_name,Eb);var yb=Eb,vb=Object.defineProperty({default:yb},"__esModule",{value:!0}),Tb=u((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Debug=t.FactoryMaker=t.MediaPlayer=void 0;var n=o(vb),r=o(v),a=o(Z);function o(e){return e&&e.__esModule?e:{default:e}}var s="undefined"!=typeof window&&window||i,u=s.dashjs;u||(u=s.dashjs={}),u.MediaPlayer=n.default,u.FactoryMaker=r.default,u.Debug=a.default,u.Version=(0,sT.getVersionString)(),t.default=u,t.MediaPlayer=n.default,t.FactoryMaker=r.default,t.Debug=a.default}));var Ab=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};Ab.SSL_CONNECTION_FAILED_PREFIX="SSL",Ab.DNS_RESOLUTION_FAILED="C00",Ab.HOST_UNREACHABLE="C01",Ab.CONNECTION_REFUSED="C02",Ab.CONNECTION_ERROR="C03",Ab.CORRUPT_MEDIA_ISOBMFF="M00",Ab.CORRUPT_MEDIA_OTHER="M01",Ab.BASE_URL_CHANGED="F00",Ab.BECAME_REPORTER="S00";var Sb=Ab,bb=Rb(Object.defineProperty({default:Sb},"__esModule",{value:!0})),Ib=Rb(Xc);function Rb(e){return e&&e.__esModule?e:{default:e}}function wb(e){var t=void 0,n=void 0,r=(e=e||{}).eventBus,i=e.dashMetrics,a=e.metricsConstants,o=e.events;function s(e){var t=new bb.default;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),i.addDVBErrors(t)}}function u(e){e.error||(n=e.manifest)}function l(e){s({errorcode:bb.default.BASE_URL_CHANGED,servicelocation:e.entry})}function f(){s({errorcode:bb.default.BECAME_REPORTER})}function d(e){switch(e.metric){case a.HTTP_REQUEST:(0===(t=e.value).responsecode||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&s({errorcode:t.responsecode||bb.default.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}var t}function c(e){var t=void 0;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=bb.default.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=bb.default.CORRUPT_MEDIA_OTHER;break;default:return}s({errorcode:t})}function h(){r.on(o.MANIFEST_UPDATED,u,t),r.on(o.SERVICE_LOCATION_BLACKLIST_CHANGED,l,t),r.on(o.METRIC_ADDED,d,t),r.on(o.METRIC_UPDATED,d,t),r.on(o.PLAYBACK_ERROR,c,t),r.on(Ib.default.BECAME_REPORTING_PLAYER,f,t)}return t={initialise:h,reset:function(){r.off(o.MANIFEST_UPDATED,u,t),r.off(o.SERVICE_LOCATION_BLACKLIST_CHANGED,l,t),r.off(o.METRIC_ADDED,d,t),r.off(o.METRIC_UPDATED,d,t),r.off(o.PLAYBACK_ERROR,c,t),r.off(Ib.default.BECAME_REPORTING_PLAYER,f,t)}},h(),t}wb.__dashjs_factory_name="DVBErrorsTranslator";var Nb=dashjs.FactoryMaker.getSingletonFactory(wb),Mb=Object.defineProperty({default:Nb},"__esModule",{value:!0}),Cb=function(e){return e&&e.__esModule?e:{default:e}}(it);function Db(e){e=e||{};var t,n=!1,r=this.context,i=void 0,a=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((function(e){var t=e.starttime,n=t+e.duration;i.add(t,n)})),n=!!e[0]._useWallClockTime)},reset:function(){i.clear()},isEnabled:function(){var e,t=i.length;if(!t)return!0;e=n?(new Date).getTime()/1e3:a.currentTime;for(var r=0;r<t;r+=1){var o=i.start(r),s=i.end(r);if(o<=e&&e<s)return!0}return!1}},i=(0,Cb.default)(r).create(),t}Db.__dashjs_factory_name="RangeController";var Ob=dashjs.FactoryMaker.getClassFactory(Db),Pb=Object.defineProperty({default:Ob},"__esModule",{value:!0});function Lb(){return{serialise:function e(t){var n=[],r=[],i=void 0,a=void 0;for(i in t)if(t.hasOwnProperty(i)&&0!==i.indexOf("_")){if(null==(a=t[i])&&(a=""),Array.isArray(a)){if(!a.length)continue;r=[],a.forEach((function(t){var n="Object"!==Object.prototype.toString.call(t).slice(8,-1);r.push(n?t:e(t))})),a=r.map(encodeURIComponent).join(",")}else"string"==typeof a?a=encodeURIComponent(a):a instanceof Date?a=a.toISOString():"number"==typeof a&&(a=Math.round(a));n.push(i+"="+a)}return n.join("&")}}}Lb.__dashjs_factory_name="MetricSerialiser";var Fb=dashjs.FactoryMaker.getSingletonFactory(Lb),xb=Object.defineProperty({default:Fb},"__esModule",{value:!0});function Ub(){var e,t=window.crypto||window.msCrypto,n=Uint32Array,r=Math.pow(2,8*n.BYTES_PER_ELEMENT)-1,i=void 0,a=void 0;function o(){t&&(i||(i=new n(10)),t.getRandomValues(i),a=0)}return e={random:function(e,n){var s=void 0;return e||(e=0),n||(n=1),t?(a===i.length&&o(),s=i[a]/r,a+=1):s=Math.random(),s*(n-e)+e}},o(),e}Ub.__dashjs_factory_name="RNG";var Bb=dashjs.FactoryMaker.getSingletonFactory(Ub),kb=Object.defineProperty({default:Bb},"__esModule",{value:!0}),Gb=Yb(xb),jb=Yb(kb);function Yb(e){return e&&e.__esModule?e:{default:e}}function qb(e){e=e||{};var t,n=this.context,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=[],f=e.metricsConstants;function d(){a=!1,o=!1,s=null,u=null}return t={report:function(e,t){Array.isArray(t)||(t=[t]),o&&u.isEnabled()&&t.forEach((function(t){var n=r.serialise(t);e!==f.DVB_ERRORS&&(n="metricname="+e+"&"+n),function(e,t,n){var r=new XMLHttpRequest,i=function(){var e=l.indexOf(r);-1!==e&&(l.splice(e,1),r.status>=200&&r.status<300?t&&t():n&&n())};l.push(r);try{r.open("GET",e),r.onloadend=i,r.onerror=i,r.send()}catch(e){r.onerror()}}(n=s+"?"+n,null,(function(){o=!1}))}))},initialize:function(e,t){var n=void 0;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(){d()}},r=(0,Gb.default)(n).getInstance(),i=(0,jb.default)(n).getInstance(),d(),t}qb.__dashjs_factory_name="DVBReporting";var Hb=dashjs.FactoryMaker.getClassFactory(qb),Kb=function(e){return e&&e.__esModule?e:{default:e}}(Object.defineProperty({default:Hb},"__esModule",{value:!0}));function Vb(e){e=e||{};var t={"urn:dvb:dash:reporting:2014":Kb.default},n=this.context,r=void 0,i=e.debug?e.debug.getLogger(r):{},a=e.metricsConstants;return r={create:function(e,r){var o=void 0;try{(o=t[e.schemeIdUri](n).create({metricsConstants:a})).initialize(e,r)}catch(t){o=null,i.error("ReportingFactory: could not create Reporting with schemeIdUri "+e.schemeIdUri+" ("+t.message+")")}return o},register:function(e,n){t[e]=n},unregister:function(e){delete t[e]}}}Vb.__dashjs_factory_name="ReportingFactory";var zb=dashjs.FactoryMaker.getSingletonFactory(Vb),Wb=Object.defineProperty({default:zb},"__esModule",{value:!0}),Xb=function(e){return e&&e.__esModule?e:{default:e}}(Wb);function Qb(e){var t=[],n=(0,Xb.default)(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)}))}}}Qb.__dashjs_factory_name="ReportingController";var Zb=dashjs.FactoryMaker.getClassFactory(Qb),$b=Object.defineProperty({default:Zb},"__esModule",{value:!0});function Jb(){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}}}Jb.__dashjs_factory_name="HandlerHelpers";var eI=dashjs.FactoryMaker.getSingletonFactory(Jb),tI=Object.defineProperty({default:eI},"__esModule",{value:!0}),nI=function(e){return e&&e.__esModule?e:{default:e}}(tI);function rI(e){e=e||{};var t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=this.context,s=(0,nI.default)(o).getInstance(),u=[],l=e.metricsConstants;function f(){var e=function(){try{return Object.keys(u).map((function(e){return u[e]})).reduce((function(e,t){return e.level<t.level?e:t}))}catch(e){return}}();e&&a!==e.t&&(a=e.t,t.report(r,e))}return{initialize:function(e,a,o){a&&(n=s.validateN(o),t=a,r=s.reconstructFullMetricName(e,o),i=setInterval(f,n))},reset:function(){clearInterval(i),i=null,n=0,t=null,a=null},handleNewMetric:function(e,t,n){e===l.BUFFER_LEVEL&&(u[n]=t)}}}rI.__dashjs_factory_name="BufferLevelHandler";var iI=dashjs.FactoryMaker.getClassFactory(rI),aI=Object.defineProperty({default:iI},"__esModule",{value:!0}),oI=function(e){return e&&e.__esModule?e:{default:e}}(Xc);var sI=dashjs.FactoryMaker.getClassFactory((function(e){var t=void 0,n=(e=e||{}).eventBus,r=e.metricsConstants;function i(){n.off(oI.default.METRICS_INITIALISATION_COMPLETE,i,this),n.trigger(oI.default.BECAME_REPORTING_PLAYER)}return{initialize:function(e,r){r&&(t=r,n.on(oI.default.METRICS_INITIALISATION_COMPLETE,i,this))},reset:function(){t=null},handleNewMetric:function(e,n){e===r.DVB_ERRORS&&t&&t.report(e,n)}}})),uI=Object.defineProperty({default:sI},"__esModule",{value:!0}),lI=function(e){return e&&e.__esModule?e:{default:e}}(tI);function fI(e){e=e||{};var t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=[],s=(0,lI.default)(this.context).getInstance(),u=e.metricsConstants;function l(){var e=o;e.length&&t&&t.report(i,e),o=[]}return{initialize:function(e,o,u,f){o&&(n=s.validateN(u),t=o,f&&f.length&&(r=f),i=s.reconstructFullMetricName(e,u,f),a=setInterval(l,n))},reset:function(){clearInterval(a),a=null,n=null,r=null,o=[],t=null},handleNewMetric:function(e,t){e===u.HTTP_REQUEST&&(r&&r!==t.type||o.push(t))}}}fI.__dashjs_factory_name="HttpListHandler";var dI=dashjs.FactoryMaker.getClassFactory(fI),cI=Object.defineProperty({default:dI},"__esModule",{value:!0});function hI(){var e=void 0,t=void 0;return{initialize:function(n,r){e=n,t=r},reset:function(){t=null,e=void 0},handleNewMetric:function(n,r){n===e&&t&&t.report(e,r)}}}hI.__dashjs_factory_name="GenericMetricHandler";var gI=dashjs.FactoryMaker.getClassFactory(hI),pI=Object.defineProperty({default:gI},"__esModule",{value:!0}),mI=vI(aI),_I=vI(uI),EI=vI(cI),yI=vI(pI);function vI(e){return e&&e.__esModule?e:{default:e}}function TI(e){var t=void 0,n=(e=e||{}).debug?e.debug.getLogger(t):{},r=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,i=this.context,a={BufferLevel:mI.default,DVBErrors:_I.default,HttpList:EI.default,PlayList:yI.default,RepSwitchList:yI.default,TcpList:yI.default};return t={create:function(t,o){var s,u=t.match(r);if(u){try{(s=a[u[1]](i).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(u[1],o,u[3],u[5])}catch(e){s=null,n.error("MetricsHandlerFactory: Could not create handler for type "+u[1]+" with args "+u[3]+", "+u[5]+" ("+e.message+")")}return s}},register:function(e,t){a[e]=t},unregister:function(e){delete a[e]}}}TI.__dashjs_factory_name="MetricsHandlerFactory";var AI=dashjs.FactoryMaker.getSingletonFactory(TI),SI=Object.defineProperty({default:AI},"__esModule",{value:!0}),bI=function(e){return e&&e.__esModule?e:{default:e}}(SI);function II(e){e=e||{};var t=[],n=void 0,r=this.context,i=e.eventBus,a=e.events,o=(0,bI.default)(r).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});function s(e){t.forEach((function(t){t.handleNewMetric(e.metric,e.value,e.mediaType)}))}return n={initialize:function(e,r){e.split(",").forEach((function(e,n,i){var a;if(-1!==e.indexOf("(")&&-1===e.indexOf(")")){var s=i[n+1];s&&-1===s.indexOf("(")&&-1!==s.indexOf(")")&&(e+=","+s,delete i[n+1])}(a=o.create(e,r))&&t.push(a)})),i.on(a.METRIC_ADDED,s,n),i.on(a.METRIC_UPDATED,s,n)},reset:function(){i.off(a.METRIC_ADDED,s,n),i.off(a.METRIC_UPDATED,s,n),t.forEach((function(e){return e.reset()})),t=[]}}}II.__dashjs_factory_name="MetricsHandlersController";var RI=dashjs.FactoryMaker.getClassFactory(II),wI=Object.defineProperty({default:RI},"__esModule",{value:!0}),NI=DI(Pb),MI=DI($b),CI=DI(wI);function DI(e){return e&&e.__esModule?e:{default:e}}function OI(e){e=e||{};var t=void 0,n=void 0,r=void 0,i=this.context;function a(){t&&t.reset(),n&&n.reset(),r&&r.reset()}return{initialize:function(o){try{(r=(0,NI.default)(i).create({mediaElement:e.mediaElement})).initialize(o.Range),(n=(0,MI.default)(i).create({debug:e.debug,metricsConstants:e.metricsConstants})).initialize(o.Reporting,r),(t=(0,CI.default)(i).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events})).initialize(o.metrics,n)}catch(e){throw a(),e}},reset:a}}OI.__dashjs_factory_name="MetricsController";var PI=dashjs.FactoryMaker.getClassFactory(OI),LI=Object.defineProperty({default:PI},"__esModule",{value:!0});var FI=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metrics="",this.Range=[],this.Reporting=[]},xI=Object.defineProperty({default:FI},"__esModule",{value:!0});var UI=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.starttime=0,this.duration=1/0,this._useWallClockTime=!1},BI=Object.defineProperty({default:UI},"__esModule",{value:!0});var kI=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="",this.dvb_reportingUrl="",this.dvb_probability=1e3},GI=Object.defineProperty({default:kI},"__esModule",{value:!0}),jI=HI(xI),YI=HI(BI),qI=HI(GI);function HI(e){return e&&e.__esModule?e:{default:e}}function KI(e){var t=(e=e||{}).adapter,n=e.constants;return{getMetrics:function(e){var r=[];return e&&e.Metrics_asArray&&e.Metrics_asArray.forEach((function(i){var a=new jI.default,o=t.getIsDynamic(e);i.hasOwnProperty("metrics")&&(a.metrics=i.metrics,i.Range_asArray&&i.Range_asArray.forEach((function(r){var i=new YI.default;i.starttime=function(e,r,i){var a=void 0,o=void 0,s=0;return r?s=t.getAvailabilityStartTime(e)/1e3:(a=t.getRegularPeriods(e)).length&&(s=a[0].start),o=s,i&&i.hasOwnProperty(n.START_TIME)&&(o+=i.starttime),o}(e,o,r),r.hasOwnProperty("duration")?i.duration=r.duration:i.duration=t.getDuration(e),i._useWallClockTime=o,a.Range.push(i)})),i.Reporting_asArray&&(i.Reporting_asArray.forEach((function(e){var t=new qI.default;e.hasOwnProperty(n.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty("value")&&(t.value=e.value),e.hasOwnProperty(n.DVB_REPORTING_URL)&&(t.dvb_reportingUrl=e[n.DVB_REPORTING_URL]),e.hasOwnProperty(n.DVB_PROBABILITY)&&(t.dvb_probability=e[n.DVB_PROBABILITY]),a.Reporting.push(t))})),r.push(a)))})),r}}}KI.__dashjs_factory_name="ManifestParsing";var VI=dashjs.FactoryMaker.getSingletonFactory(KI),zI=Object.defineProperty({default:VI},"__esModule",{value:!0}),WI=ZI(LI),XI=ZI(zI),QI=ZI(Xc);function ZI(e){return e&&e.__esModule?e:{default:e}}function $I(e){e=e||{};var t=void 0,n={},r=this.context,i=e.eventBus,a=e.events;function o(t){if(!t.error){var a=Object.keys(n);(0,XI.default)(r).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach((function(t){var i=JSON.stringify(t);if(n.hasOwnProperty(i))a.splice(i,1);else try{var o=(0,WI.default)(r).create(e);o.initialize(t),n[i]=o}catch(e){}})),a.forEach((function(e){n[e].reset(),delete n[e]})),i.trigger(QI.default.METRICS_INITIALISATION_COMPLETE)}}function s(){Object.keys(n).forEach((function(e){n[e].reset()})),n={}}return t={reset:function(){i.off(a.MANIFEST_UPDATED,o,t),i.off(a.STREAM_TEARDOWN_COMPLETE,s,t)}},i.on(a.MANIFEST_UPDATED,o,t),i.on(a.STREAM_TEARDOWN_COMPLETE,s,t),t}$I.__dashjs_factory_name="MetricsCollectionController";var JI=dashjs.FactoryMaker.getClassFactory($I),eR=Object.defineProperty({default:JI},"__esModule",{value:!0}),tR=oR(Mb),nR=oR(Xc),rR=oR(eR),iR=oR(SI),aR=oR(Wb);function oR(e){return e&&e.__esModule?e:{default:e}}function sR(){var e=this.context;return{createMetricsReporting:function(t){return(0,tR.default)(e).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}),(0,rR.default)(e).create(t)},getReportingFactory:function(){return(0,aR.default)(e).getInstance()},getMetricsHandlerFactory:function(){return(0,iR.default)(e).getInstance()}}}sR.__dashjs_factory_name="MetricsReporting";var uR=dashjs.FactoryMaker.getClassFactory(sR);uR.events=nR.default,dashjs.FactoryMaker.updateClassFactory(sR.__dashjs_factory_name,uR);var lR=uR,fR=Object.defineProperty({default:lR},"__esModule",{value:!0}),dR=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var cR=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return dR(e,null,[{key:"findCencContentProtection",value:function(e){for(var t=null,n=0;n<e.length;++n){var r=e[n];"urn:mpeg:dash:mp4protection:2011"!==r.schemeIdUri.toLowerCase()||"cenc"!==r.value.toLowerCase()&&"cbcs"!==r.value.toLowerCase()||(t=r)}return t}},{key:"getPSSHData",value:function(e){var t=8,n=new DataView(e),r=n.getUint8(t);return t+=20,r>0&&(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,o=o.toLowerCase(),t.getUint32(r),r+=4,n[o]=t.buffer.slice(s,i),r=i}else r=i;else r=i}return n}}]),e}(),hR=Object.defineProperty({default:cR},"__esModule",{value:!0});var gR=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=n},pR=Object.defineProperty({default:gR},"__esModule",{value:!0});var mR=function e(t,n,r,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),n&&n.length&&(this.videoCapabilities=n),this.distinctiveIdentifier=r,this.persistentState=i,this.sessionTypes=a},_R=Object.defineProperty({default:mR},"__esModule",{value:!0});var ER=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.MEDIA_KEYERR_CODE=100,e.MEDIA_KEYERR_UNKNOWN_CODE=101,e.MEDIA_KEYERR_CLIENT_CODE=102,e.MEDIA_KEYERR_SERVICE_CODE=103,e.MEDIA_KEYERR_OUTPUT_CODE=104,e.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,e.MEDIA_KEYERR_DOMAIN_CODE=106,e.MEDIA_KEY_MESSAGE_ERROR_CODE=107,e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,e.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,e.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,e.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,e.KEY_SESSION_CREATED_ERROR_CODE=113,e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,e.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",e.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",e.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",e.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",e.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",e.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",e.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",e.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",e.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",e.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",e.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(ta).default)),yR=Object.defineProperty({default:ER},"__esModule",{value:!0});var vR=function e(t,n,r,i,a,o,s,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.method=n,this.responseType=r,this.headers=i,this.withCredentials=a,this.messageType=o,this.sessionId=s,this.data=u},TR=Object.defineProperty({default:vR},"__esModule",{value:!0});var AR=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.url=t,this.headers=n,this.data=r},SR=Object.defineProperty({default:AR},"__esModule",{value:!0}),bR="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},IR=LR(hR),RR=LR(pR),wR=LR(_R),NR=LR(yR),MR=LR(Ie),CR=LR(TR),DR=LR(SR),OR=LR(Cc),PR=LR(c);function LR(e){return e&&e.__esModule?e:{default:e}}function FR(e){var t=(e=e||{}).protectionKeyController,n=e.protectionModel,r=e.eventBus,i=e.events,a=e.debug,o=e.BASE64,s=e.constants,u=[],l=e.cmcdModel,f=e.settings,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0;function T(){if(!(r&&r.hasOwnProperty("on")&&t&&t.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function A(e,t){var a=IR.default.getPSSHForKeySystem(E,e),o=R(E);if(a){if(S(a))return;try{n.createKeySession(a,o,N(E),t)}catch(e){r.trigger(i.KEY_SESSION_CREATED,{data:null,error:new MR.default(NR.default.KEY_SESSION_CREATED_ERROR_CODE,NR.default.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e?n.createKeySession(e,o,N(E),t):r.trigger(i.KEY_SESSION_CREATED,{data:null,error:new MR.default(NR.default.KEY_SESSION_CREATED_ERROR_CODE,NR.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(E?E.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function S(e){if(!e)return!1;try{for(var r=n.getAllInitData(),i=0;i<r.length;i++)if(t.initDataEquals(e,r[i]))return c.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch(e){return!1}}function b(e,t){T(),n.loadKeySession(e,t,N(E))}function I(e){T(),e?(n.setMediaElement(e),r.on(i.NEED_KEY,P,this)):null===e&&(n.setMediaElement(e),r.off(i.NEED_KEY,P,this))}function R(e){var t=null;if(e){var n=e.systemString;p&&(t=n in p?p[n]:null)}return t}function w(e){var t=R(e),n=[],r=[],i=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:_,a=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:_,o=N(e),u=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",l=t&&t.persistentState?t.persistentState:"temporary"===o?"optional":"required";return g.forEach((function(e){e.type===s.AUDIO?n.push(new RR.default(e.codec,i)):e.type===s.VIDEO&&r.push(new RR.default(e.codec,a))})),new wR.default(n,r,u,l,[o])}function N(e){var t=R(e);return t&&t.sessionType?t.sessionType:m}function M(e,a){e=e.sort((function(t,n){return(p&&p[t.ks.systemString]&&p[t.ks.systemString].priority>=0?p[t.ks.systemString].priority:e.length)-(p&&p[n.ks.systemString]&&p[n.ks.systemString].priority>=0?p[n.ks.systemString].priority:e.length)})),void 0===E?function(e,a){var s=this,u=[],l=void 0;E=null,h.push(e);for(var f=0;f<e.length;f++)u.push({ks:e[f].ks,configs:[w(e[f].ks)]});var d=void 0,g=function e(t){r.off(i.KEY_SYSTEM_ACCESS_COMPLETE,e,s),t.error?(E=void 0,r.off(i.INTERNAL_KEY_SYSTEM_SELECTED,p,s),a||r.trigger(i.KEY_SYSTEM_SELECTED,{data:null,error:new MR.default(NR.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,NR.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+t.error)})):(d=t.data,c.info("DRM: KeySystem Access Granted ("+d.keySystem.systemString+")! Selecting key system..."),n.selectKeySystem(d))},p=function e(u){if(r.off(i.INTERNAL_KEY_SYSTEM_SELECTED,e,s),r.off(i.KEY_SYSTEM_ACCESS_COMPLETE,g,s),u.error)E=void 0,a||r.trigger(i.KEY_SYSTEM_SELECTED,{data:null,error:new MR.default(NR.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,NR.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+u.error)});else{if(!n)return;E=n.getKeySystem(),r.trigger(i.KEY_SYSTEM_SELECTED,{data:d});var f=R(E);f&&f.serverCertificate&&f.serverCertificate.length>0&&n.setServerCertificate(o.decodeArray(f.serverCertificate).buffer);for(var c=0;c<h.length;c++)for(l=0;l<h[c].length;l++)if(E===h[c][l].ks){if(t.isClearKey(E)&&f&&f.hasOwnProperty("clearkeys")){var p={kids:Object.keys(f.clearkeys)};h[c][l].initData=(new TextEncoder).encode(JSON.stringify(p))}h[c][l].sessionId?b(h[c][l].sessionId,h[c][l].initData):null!==h[c][l].initData&&A(h[c][l].initData,h[c][l].cdmData);break}}};r.on(i.INTERNAL_KEY_SYSTEM_SELECTED,p,s),r.on(i.KEY_SYSTEM_ACCESS_COMPLETE,g,s),n.requestKeySystemAccess(u)}(e,a):E?function(e,a){var o=this,s=[],u=e.findIndex((function(e){return e.ks===E}));if(-1===u||!e[u].initData)return;if(S(IR.default.getPSSHForKeySystem(E,e[u].initData)))return;s.push({ks:e[u].ks,configs:[w(E)]});r.on(i.KEY_SYSTEM_ACCESS_COMPLETE,(function n(s){if(r.off(i.KEY_SYSTEM_ACCESS_COMPLETE,n,o),s.error)a||r.trigger(i.KEY_SYSTEM_SELECTED,{error:new MR.default(NR.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,NR.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+s.error)});else{c.info("DRM: KeySystem Access Granted"),r.trigger(i.KEY_SYSTEM_SELECTED,{data:s.data});var l=R(E);if(t.isClearKey(E)&&l&&l.hasOwnProperty("clearkeys")){var f={kids:Object.keys(l.clearkeys)};e[u].initData=(new TextEncoder).encode(JSON.stringify(f))}e[u].sessionId?b(e[u].sessionId,e[u].initData):e[u].initData&&A(e[u].initData,e[u].cdmData)}}),o),n.requestKeySystemAccess(s)}(e,a):h.push(e)}function C(e,t){r.trigger(i.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function D(e){e.error?r.trigger(i.KEY_STATUSES_CHANGED,{data:null,error:e.error}):c.debug("DRM: key status = "+e.status)}function O(e){c.debug("DRM: onKeyMessage");var a=e.data;r.trigger(i.KEY_MESSAGE,{data:a});var o=a.messageType?a.messageType:"license-request",s=a.message,u=a.sessionToken,d=R(E),h=E?E.systemString:null,p=t.getLicenseServer(E,d,o),m={sessionToken:u,messageType:o};if(s&&0!==s.byteLength){if(!p)return c.debug("DRM: License server request not required for this message (type = "+e.data.messageType+"). Session ID = "+u.getSessionID()),void C(m);if(t.isClearKey(E)){var _=t.processClearKeyLicenseRequest(E,d,s);if(_)return c.debug("DRM: ClearKey license request handled by application!"),C(m),void n.updateKeySession(u,_)}var T=null;if(d&&d.serverURL){var A=d.serverURL;"string"==typeof A&&""!==A?T=A:"object"===(void 0===A?"undefined":bR(A))&&A.hasOwnProperty(o)&&(T=A[o])}else if(d&&d.laURL&&""!==d.laURL)T=d.laURL;else if(t.isClearKey(E))T=E.getLicenseServerUrlFromMediaInfo(g);else{var S=IR.default.getPSSHData(u.initData);(T=E.getLicenseServerURLFromInitData(S))||(T=e.data.laURL)}if(T=p.getServerURLFromMessage(T,s,o)){var b={},I=!1,w=function(e){if(e)for(var t in e)"authorization"===t.toLowerCase()&&(I=!0),b[t]=e[t]};d&&w(d.httpRequestHeaders),w(E.getRequestHeadersFromMessage(s)),d&&"boolean"==typeof d.withCredentials&&(I=d.withCredentials);var N=function(e,t,n,r){var i=e.response?p.getErrorResponse(e.response,n,r):"NONE";C(t,new MR.default(NR.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,NR.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+". Response is "+i))},M=function(e){if(n)if(200===e.status){var t=new DR.default(e.responseURL,OR.default.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),e.response);L(v,t).then((function(){var r=p.getLicenseMessage(t.data,h,o);null!==r?(C(m),n.updateKeySession(u,r)):N(e,m,h,o)}))}else N(e,m,h,o)},D=function(e){C(m,new MR.default(NR.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,NR.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+h+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},O=function(e){C(m,new MR.default(NR.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,NR.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+h+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},P=E.getLicenseRequestFromMessage(s),F=p.getHTTPMethod(o),x=p.getResponseType(h,o),U=d&&!isNaN(d.httpTimeout)?d.httpTimeout:8e3,B=u.getSessionID()||null,k=new CR.default(T,F,x,b,I,o,B,P);L(y,k).then((function(){!function e(t,n,a,o,s,u){var d=new XMLHttpRequest;if(f.get().streaming.cmcd&&f.get().streaming.cmcd.enabled){if(f.get().streaming.cmcd.mode===PR.default.CMCD_MODE_QUERY){var h=l.getQueryParameter({url:t.url,type:ce.HTTPRequest.LICENSE});h&&(t.url=OR.default.addAditionalQueryParameterToUrl(t.url,[h]))}}d.open(t.method,t.url,!0),d.responseType=t.responseType,d.withCredentials=t.withCredentials,a>0&&(d.timeout=a);for(var g in t.headers)d.setRequestHeader(g,t.headers[g]);if(f.get().streaming.cmcd&&f.get().streaming.cmcd.enabled){if(f.get().streaming.cmcd.mode===PR.default.CMCD_MODE_HEADER){var p=l.getHeaderParameters({url:t.url,type:ce.HTTPRequest.LICENSE});if(p)for(var m in p){var _=p[m];_&&d.setRequestHeader(m,_)}}}var E=function(){n--,setTimeout((function(){e(t,n,a,o,s,u)}),1e3)};d.onload=function(){200===this.status||n<=0?o(this):(c.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+n),E())},d.ontimeout=d.onerror=function(){n<=0?u(this):(c.warn("License request network request failed . Retrying it... Pending retries: "+n),E())},d.onabort=function(){s(this)},r.trigger(i.LICENSE_REQUEST_SENDING,{url:t.url,headers:t.headers,payload:t.data,sessionId:t.sessionId}),d.send(t.data)}(k,3,U,M,D,O)}))}else C(m,new MR.default(NR.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,NR.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}else C(m,new MR.default(NR.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,NR.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function P(e,n){if(c.debug("DRM: onNeedKey"),"cenc"===e.key.initDataType)if(0===g.length&&(c.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(n=void 0===n?1:n+1)<5))u.push(setTimeout((function(){P(e,n)}),500));else{var r=e.key.initData;if(ArrayBuffer.isView(r)&&(r=r.buffer),E){var i=IR.default.getPSSHForKeySystem(E,r);if(i&&S(i))return}c.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(r)));var a=t.getSupportedKeySystems(r,p);0!==a.length?M(a,!1):c.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!")}else c.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+e.key.initDataType)}function L(e,t){return e?e.reduce((function(e,n){return e.then((function(){return n(t)}))}),Promise.resolve()):Promise.resolve()}return d={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");T(),r.on(i.INTERNAL_KEY_MESSAGE,O,this),r.on(i.INTERNAL_KEY_STATUS_CHANGED,D,this),g.push(e);var n=t.getSupportedKeySystemsFromContentProtection(e.contentProtection);n&&n.length>0&&M(n,!0)},clearMediaInfoArrayByStreamId:function(e){g=g.filter((function(t){return t.streamInfo.id!==e}))},createKeySession:A,loadKeySession:b,removeKeySession:function(e){T(),n.removeKeySession(e)},closeKeySession:function(e){T(),n.closeKeySession(e)},setServerCertificate:function(e){T(),n.setServerCertificate(e)},setMediaElement:I,setSessionType:function(e){m=e},setRobustnessLevel:function(e){_=e},setProtectionData:function(e){p=e,t.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return T(),t.getSupportedKeySystemsFromContentProtection(e)},getKeySystems:function(){return t?t.getKeySystems():[]},setKeySystems:function(e){t&&t.setKeySystems(e)},setLicenseRequestFilters:function(e){y=e},setLicenseResponseFilters:function(e){v=e},stop:function(){n&&n.stop()},reset:function(){T(),y=[],v=[],r.off(i.INTERNAL_KEY_MESSAGE,O,this),r.off(i.INTERNAL_KEY_STATUS_CHANGED,D,this),I(null),E=void 0,n&&(n.reset(),n=null),u.forEach((function(e){return clearTimeout(e)})),u=[],g=[]}},c=a.getLogger(d),h=[],g=[],m="temporary",_="",y=[],v=[],d}FR.__dashjs_factory_name="ProtectionController";var xR=dashjs.FactoryMaker.getClassFactory(FR),UR=Object.defineProperty({default:xR},"__esModule",{value:!0});var BR=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},kR=Object.defineProperty({default:BR},"__esModule",{value:!0}),GR=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var jR=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n&&"persistent"!==n&&"temporary"!==n)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=n}return GR(e,[{key:"toJWK",value:function(){var e=void 0,t=this.keyPairs.length,n={keys:[]};for(e=0;e<t;e++){var r={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};n.keys.push(r)}this.type&&(n.type=this.type);var i=JSON.stringify(n),a=i.length,o=new ArrayBuffer(a),s=new Uint8Array(o);for(e=0;e<a;e++)s[e]=i.charCodeAt(e);return o}}]),e}(),YR=Object.defineProperty({default:jR},"__esModule",{value:!0}),qR=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var HR=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()}return qR(e,[{key:"init",value:function(){this.CLEARKEY_KEYSTEM_STRING="org.w3.clearkey",this.WIDEVINE_KEYSTEM_STRING="com.widevine.alpha",this.PLAYREADY_KEYSTEM_STRING="com.microsoft.playready"}}]),e}()),KR=Object.defineProperty({default:HR},"__esModule",{value:!0}),VR=QR(kR),zR=QR(YR),WR=QR(hR),XR=QR(KR);function QR(e){return e&&e.__esModule?e:{default:e}}var ZR="e2719d58-a985-b3c9-781a-b030af78d30e",$R=XR.default.CLEARKEY_KEYSTEM_STRING,JR="urn:uuid:"+ZR;function ew(e){var t=(e=e||{}).BASE64,n={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]};return{uuid:ZR,schemeIdURI:JR,systemString:$R,getInitData:function(e,n){try{var r=WR.default.parseInitDataFromContentProtection(e,t);if(!r&&n){var i={kids:[function(e){try{var t=e.replace(/-/g,"");return(t=btoa(t.match(/\w{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))).replace(/=/g,"")}catch(e){return null}}(n["cenc:default_KID"])]};r=(new TextEncoder).encode(JSON.stringify(i))}return r}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e)))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(){return null},getLicenseServerUrlFromMediaInfo:function(e){try{if(!e||0===e.length)return null;for(var t=0,r=null;t<e.length&&!r;){var i=e[t];if(i&&i.contentProtection&&i.contentProtection.length>0){var a=i.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===JR}));if(a&&a.length>0)for(var o=0;o<a.length&&!r;){for(var s=a[o],u=0;u<n.attributes.length&&!r;){for(var l=0,f=n.attributes[u];l<n.prefixes.length&&!r;){var d=n.prefixes[l];s[f]&&s[f].__prefix&&s[f].__prefix===d&&s[f].__text&&(r=s[f].__text),l+=1}u+=1}o+=1}}t+=1}return r}catch(e){return null}},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var r=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),i=[],a=0;a<r.kids.length;a++){var o=r.kids[a],s=e.clearkeys&&e.clearkeys.hasOwnProperty(o)?e.clearkeys[o]:null;if(!s)throw new Error("DRM: ClearKey keyID ("+o+") is not known!");i.push(new VR.default(o,s))}n=new zR.default(i)}return n}}}ew.__dashjs_factory_name="KeySystemClearKey";var tw=dashjs.FactoryMaker.getSingletonFactory(ew),nw=Object.defineProperty({default:tw},"__esModule",{value:!0}),rw=sw(kR),iw=sw(YR),aw=sw(hR),ow=sw(KR);function sw(e){return e&&e.__esModule?e:{default:e}}var uw="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",lw=ow.default.CLEARKEY_KEYSTEM_STRING;function fw(e){var t=void 0,n=e.BASE64,r=e.debug.getLogger(t);return t={uuid:uw,schemeIdURI:"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",systemString:lw,getInitData:function(e){return aw.default.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var i=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),a=[],o=0;o<i.kids.length;o++){var s=i.kids[o],u=e.clearkeys&&e.clearkeys.hasOwnProperty(s)?e.clearkeys[s]:null;if(!u)throw new Error("DRM: ClearKey keyID ("+s+") is not known!");a.push(new rw.default(s,u))}n=new iw.default(a),r.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return n}}}fw.__dashjs_factory_name="KeySystemW3CClearKey";var dw=dashjs.FactoryMaker.getSingletonFactory(fw),cw=Object.defineProperty({default:dw},"__esModule",{value:!0}),hw=pw(hR),gw=pw(KR);function pw(e){return e&&e.__esModule?e:{default:e}}var mw="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",_w=gw.default.WIDEVINE_KEYSTEM_STRING;function Ew(e){var t=null,n=(e=e||{}).BASE64;return{uuid:mw,schemeIdURI:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",systemString:_w,init:function(e){e&&(t=e)},getInitData:function(e){return hw.default.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(e){return t&&t.sessionId?t.sessionId:e&&e.sessionId?e.sessionId:null}}}Ew.__dashjs_factory_name="KeySystemWidevine";var yw=dashjs.FactoryMaker.getSingletonFactory(Ew),vw=Object.defineProperty({default:yw},"__esModule",{value:!0}),Tw=Sw(hR),Aw=Sw(KR);function Sw(e){return e&&e.__esModule?e:{default:e}}var bw="9a04f079-9840-4286-ab92-e65be0885f95",Iw=Aw.default.PLAYREADY_KEYSTEM_STRING,Rw=void 0;function ww(e){var t="utf-16",n=(e=e||{}).BASE64;function r(){if(!n||!n.hasOwnProperty("decodeArray")||!n.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return{uuid:bw,schemeIdURI:"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",systemString:Iw,getInitData:function(e){var t,i,a,o=new Uint8Array([112,115,115,104,0,0,0,0]),s=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),u=0,l=null,f=void 0,d=void 0;if(r(),!e)return null;if("pssh"in e)return Tw.default.parseInitDataFromContentProtection(e,n);if("pro"in e)l=n.decodeArray(e.pro.__text);else{if(!("prheader"in e))return null;l=n.decodeArray(e.prheader.__text)}return t=l.length,i=4+o.length+s.length+4+t,a=new ArrayBuffer(i),f=new Uint8Array(a),(d=new DataView(a)).setUint32(u,i),u+=4,f.set(o,u),u+=o.length,f.set(s,u),u+=s.length,d.setUint32(u,t),u+=4,f.set(l,u),u+=t,f.buffer},getRequestHeadersFromMessage:function(e){var n,r=void 0,i={},a=new DOMParser,o="utf-16"===t?new Uint16Array(e):new Uint8Array(e);n=String.fromCharCode.apply(null,o);for(var s=(r=a.parseFromString(n,"application/xml")).getElementsByTagName("name"),u=r.getElementsByTagName("value"),l=0;l<s.length;l++)i[s[l].childNodes[0].nodeValue]=u[l].childNodes[0].nodeValue;return i.hasOwnProperty("Content")&&(i["Content-Type"]=i.Content,delete i.Content),i.hasOwnProperty("Content-Type")||(i["Content-Type"]="text/xml; charset=utf-8"),i},getLicenseRequestFromMessage:function(e){var i=null,a=new DOMParser,o="utf-16"===t?new Uint16Array(e):new Uint8Array(e);r();var s=String.fromCharCode.apply(null,o),u=a.parseFromString(s,"application/xml");if(!u.getElementsByTagName("PlayReadyKeyMessage")[0])return e;var l=u.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;return l&&(i=n.decode(l)),i},getLicenseServerURLFromInitData:function(e){if(e)for(var t=new DataView(e),n=t.getUint16(4,!0),r=6,i=new DOMParser,a=0;a<n;a++){var o=t.getUint16(r,!0);r+=2;var s=t.getUint16(r,!0);if(r+=2,1===o){var u=e.slice(r,r+s),l=String.fromCharCode.apply(null,new Uint16Array(u)),f=i.parseFromString(l,"application/xml");if(f.getElementsByTagName("LA_URL")[0]){var d=f.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(d)return d}if(f.getElementsByTagName("LUI_URL")[0]){var c=f.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(c)return c}}else r+=s}return null},getCDMData:function(){var e=void 0,t=void 0,i=void 0,a=void 0;if(r(),Rw&&Rw.cdmData){for(e=[],a=0;a<Rw.cdmData.length;++a)e.push(Rw.cdmData.charCodeAt(a)),e.push(0);for(e=String.fromCharCode.apply(null,e),e=n.encode(e),t='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",e),i=[],a=0;a<t.length;++a)i.push(t.charCodeAt(a)),i.push(0);return new Uint8Array(i).buffer}return null},getSessionId:function(e){return Rw&&Rw.sessionId?Rw.sessionId:e&&e.sessionId?e.sessionId:null},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');t=e},init:function(e){e&&(Rw=e)}}}ww.__dashjs_factory_name="KeySystemPlayReady";var Nw=dashjs.FactoryMaker.getSingletonFactory(ww),Mw=Object.defineProperty({default:Nw},"__esModule",{value:!0}),Cw=function(e){return e&&e.__esModule?e:{default:e}}(KR);function Dw(e){var t=(e=e||{}).BASE64,n={};n[Cw.default.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},n[Cw.default.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}};return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return n[e].responseType},getLicenseMessage:function(e,r){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),n[r].getLicenseMessage(e)},getErrorResponse:function(e,t){return n[t].getErrorResponse(e)}}}Dw.__dashjs_factory_name="DRMToday";var Ow=dashjs.FactoryMaker.getSingletonFactory(Dw),Pw=Object.defineProperty({default:Ow},"__esModule",{value:!0});function Lw(){var e="http://schemas.xmlsoap.org/soap/envelope/";function t(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function n(n){if(window.DOMParser){var r=t(n),i=(new window.DOMParser).parseFromString(r,"text/xml"),a=i?i.getElementsByTagNameNS(e,"Envelope")[0]:null,o=a?a.getElementsByTagNameNS(e,"Body")[0]:null;if(o?o.getElementsByTagNameNS(e,"Fault")[0]:null)return null}return n}function r(n){var r="",i="",a="",o=-1,s=-1;if(window.DOMParser){var u=t(n),l=(new window.DOMParser).parseFromString(u,"text/xml"),f=l?l.getElementsByTagNameNS(e,"Envelope")[0]:null,d=f?f.getElementsByTagNameNS(e,"Body")[0]:null,c=d?d.getElementsByTagNameNS(e,"Fault")[0]:null,h=c?c.getElementsByTagName("detail")[0]:null,g=h?h.getElementsByTagName("Exception")[0]:null,p=null;if(null===c)return u;r=(p=c.getElementsByTagName("faultstring")[0].firstChild)?p.nodeValue:null,null!==g&&(i=(p=g.getElementsByTagName("StatusCode")[0])?p.firstChild.nodeValue:null,o=(a=(p=g.getElementsByTagName("Message")[0])?p.firstChild.nodeValue:null)?a.lastIndexOf("[")+1:-1,s=a?a.indexOf("]"):-1,a=a?a.substring(o,s):"")}var m="code: "+i+", name: "+r;return a&&(m+=", message: "+a),m}return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return n.call(this,e)},getErrorResponse:function(e){return r.call(this,e)}}}Lw.__dashjs_factory_name="PlayReady";var Fw=dashjs.FactoryMaker.getSingletonFactory(Lw),xw=Object.defineProperty({default:Fw},"__esModule",{value:!0});function Uw(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}Uw.__dashjs_factory_name="Widevine";var Bw=dashjs.FactoryMaker.getSingletonFactory(Uw),kw=Object.defineProperty({default:Bw},"__esModule",{value:!0}),Gw=Yw(kR),jw=Yw(YR);function Yw(e){return e&&e.__esModule?e:{default:e}}function qw(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;for(var t=[],n=0;n<e.keys.length;n++){var r=e.keys[n],i=r.kid.replace(/=/g,""),a=r.k.replace(/=/g,"");t.push(new Gw.default(i,a))}return new jw.default(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}qw.__dashjs_factory_name="ClearKey";var Hw=dashjs.FactoryMaker.getSingletonFactory(qw),Kw=Object.defineProperty({default:Hw},"__esModule",{value:!0}),Vw=nN(hR),zw=nN(nw),Ww=nN(cw),Xw=nN(vw),Qw=nN(Mw),Zw=nN(Pw),$w=nN(xw),Jw=nN(kw),eN=nN(Kw),tN=nN(KR);function nN(e){return e&&e.__esModule?e:{default:e}}function rN(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;return t={initialize:function(){i=[];var t=void 0;t=(0,Qw.default)(e).getInstance({BASE64:a}),i.push(t),t=(0,Xw.default)(e).getInstance({BASE64:a}),i.push(t),t=(0,zw.default)(e).getInstance({BASE64:a}),i.push(t),o=t,t=(0,Ww.default)(e).getInstance({BASE64:a,debug:n}),i.push(t),s=t},setProtectionData:function(e){for(var t=function(t){var n=null;return e&&(n=t in e?e[t]:null),n},n=0;n<i.length;n++){var r=i[n];r.hasOwnProperty("init")&&r.init(t(r.systemString))}},isClearKey:function(e){return e===o||e===s},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){for(var n=new Uint8Array(e),r=new Uint8Array(t),i=0;i<n.length;i++)if(n[i]!==r[i])return!1;return!0}return!1},getKeySystems:function(){return i},setKeySystems:function(e){i=e},getKeySystemBySystemString:function(e){for(var t=0;t<i.length;t++)if(i[t].systemString===e)return i[t];return null},getSupportedKeySystemsFromContentProtection:function(e){var t=void 0,n=void 0,r=void 0,a=void 0,o=[];if(e){var s=Vw.default.findCencContentProtection(e);for(r=0;r<i.length;++r)for(n=i[r],a=0;a<e.length;++a)if((t=e[a]).schemeIdUri.toLowerCase()===n.schemeIdURI){var u=n.getInitData(t,s);o.push({ks:i[r],initData:u,cdmData:n.getCDMData(),sessionId:n.getSessionId(t)})}}return o},getSupportedKeySystems:function(e,t){for(var n=[],r=Vw.default.parsePSSHList(e),a=void 0,o=void 0,s=void 0,u=0;u<i.length;++u)o=(a=i[u]).systemString,s=!t||o in t,a.uuid in r&&s&&n.push({ks:a,initData:r[a.uuid],cdmData:a.getCDMData(),sessionId:a.getSessionId()});return n},getLicenseServer:function(t,n,r){if("license-release"===r||"individualization-request"===r)return null;var i=null;return n&&n.hasOwnProperty("drmtoday")?i=(0,Zw.default)(e).getInstance({BASE64:a}):t.systemString===tN.default.WIDEVINE_KEYSTEM_STRING?i=(0,Jw.default)(e).getInstance():t.systemString===tN.default.PLAYREADY_KEYSTEM_STRING?i=(0,$w.default)(e).getInstance():t.systemString===tN.default.CLEARKEY_KEYSTEM_STRING&&(i=(0,eN.default)(e).getInstance()),i},processClearKeyLicenseRequest:function(e,t,n){try{return e.getClearKeysFromProtectionData(t,n)}catch(e){return r.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(e){e&&(e.debug&&(n=e.debug,r=n.getLogger(t)),e.BASE64&&(a=e.BASE64))}}}rN.__dashjs_factory_name="ProtectionKeyController";var iN=dashjs.FactoryMaker.getSingletonFactory(rN),aN=Object.defineProperty({default:iN},"__esModule",{value:!0});var oN=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.INTERNAL_KEY_MESSAGE="internalKeyMessage",e.INTERNAL_KEY_SYSTEM_SELECTED="internalKeySystemSelected",e.INTERNAL_KEY_STATUS_CHANGED="internalkeyStatusChanged",e.KEY_ADDED="public_keyAdded",e.KEY_ERROR="public_keyError",e.KEY_MESSAGE="public_keyMessage",e.KEY_SESSION_CLOSED="public_keySessionClosed",e.KEY_SESSION_CREATED="public_keySessionCreated",e.KEY_SESSION_REMOVED="public_keySessionRemoved",e.KEY_STATUSES_CHANGED="public_keyStatusesChanged",e.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",e.KEY_SYSTEM_SELECTED="public_keySystemSelected",e.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",e.LICENSE_REQUEST_SENDING="public_licenseRequestSending",e.NEED_KEY="needkey",e.PROTECTION_CREATED="public_protectioncreated",e.PROTECTION_DESTROYED="public_protectiondestroyed",e.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",e.TEARDOWN_COMPLETE="protectionTeardownComplete",e.VIDEO_ELEMENT_SELECTED="videoElementSelected",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(b).default)),sN=Object.defineProperty({default:oN},"__esModule",{value:!0});var uN=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initData=t,this.initDataType=n},lN=Object.defineProperty({default:uN},"__esModule",{value:!0});var fN=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sessionToken=t,this.message=n,this.defaultURL=r,this.messageType=i||"license-request"},dN=Object.defineProperty({default:fN},"__esModule",{value:!0});var cN=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keySystem=t,this.ksConfiguration=n},hN=Object.defineProperty({default:cN},"__esModule",{value:!0}),gN=TN(aN),pN=TN(lN),mN=TN(yR),_N=TN(Ie),EN=TN(dN),yN=TN(hN),vN=TN(KR);function TN(e){return e&&e.__esModule?e:{default:e}}function AN(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,i=e.debug,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0;function h(e){var t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function g(e){for(var t=0;t<f.length;t++)if(f[t]===e){f.splice(t,1);break}}function p(e){var t=void 0,n=void 0;return e&&e.length>0&&(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 m(e,t,i,a){var s={session:e,initData:t,sessionId:a,handleEvent:function(e){switch(e.type){case"keystatuseschange":n.trigger(r.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=p(arguments);switch(e.status){case"expired":n.trigger(r.INTERNAL_KEY_STATUS_CHANGED,{error:new _N.default(mN.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,mN.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)});break;default:n.trigger(r.INTERNAL_KEY_STATUS_CHANGED,e)}}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(r.INTERNAL_KEY_MESSAGE,{data:new EN.default(this,t,void 0,e.messageType)})}},getSessionID:function(){return e.sessionId},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){var e=p(arguments);"usable"===e.status&&(t=!0)})),t},getSessionType:function(){return i}};return e.addEventListener("keystatuseschange",s),e.addEventListener("message",s),e.closed.then((function(){g(s),o.debug("DRM: Session closed. SessionID = "+s.getSessionID()),n.trigger(r.KEY_SESSION_CLOSED,{data:s.getSessionID()})})),f.push(s),s}return a={getAllInitData:function(){for(var e=[],t=0;t<f.length;t++)f[t].initData&&e.push(f[t].initData);return e},requestKeySystemAccess:function(e){!function e(t,i){if(void 0===navigator.requestMediaKeySystemAccess||"function"!=typeof navigator.requestMediaKeySystemAccess)return void n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Insecure origins are not allowed"});!function(i){var a=t[i].ks,o=t[i].configs,s=a.systemString;s===vN.default.PLAYREADY_KEYSTEM_STRING&&"required"===o[0].persistentState&&(s+=".recommendation"),navigator.requestMediaKeySystemAccess(s,o).then((function(e){var t="function"==typeof e.getConfiguration?e.getConfiguration():null,i=new yN.default(a,t);i.mksa=e,n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{data:i})})).catch((function(a){++i<t.length?e(t,i):n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! "+a.message})}))}(i)}(e,0)},getKeySystem:function(){return s},selectKeySystem:function(e){e.mksa.createMediaKeys().then((function(t){s=e.keySystem,l=t,u?u.setMediaKeys(l).then((function(){n.trigger(r.INTERNAL_KEY_SYSTEM_SELECTED)})):n.trigger(r.INTERNAL_KEY_SYSTEM_SELECTED)})).catch((function(){n.trigger(r.INTERNAL_KEY_SYSTEM_SELECTED,{error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))},setMediaElement:function(e){u!==e&&(u&&(u.removeEventListener("encrypted",d),u.setMediaKeys&&u.setMediaKeys(null)),(u=e)&&(u.addEventListener("encrypted",d),u.setMediaKeys&&l&&u.setMediaKeys(l)))},setServerCertificate:function(e){if(!s||!l)throw new Error("Can not set server certificate until you have selected a key system");l.setServerCertificate(e).then((function(){o.info("DRM: License server certificate successfully updated."),n.trigger(r.SERVER_CERTIFICATE_UPDATED)})).catch((function(e){n.trigger(r.SERVER_CERTIFICATE_UPDATED,{error:new _N.default(mN.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,mN.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})}))},createKeySession:function(e,t,i){if(!s||!l)throw new Error("Can not create sessions until you have selected a key system");var a=l.createSession(i),u=m(a,e,i),f=this.getKeySystem().systemString===vN.default.CLEARKEY_KEYSTEM_STRING&&(e||t&&t.clearkeys)?"keyids":"cenc";a.generateRequest(f,e).then((function(){o.debug("DRM: Session created. SessionID = "+u.getSessionID()),n.trigger(r.KEY_SESSION_CREATED,{data:u})})).catch((function(e){g(u),n.trigger(r.KEY_SESSION_CREATED,{data:null,error:new _N.default(mN.default.KEY_SESSION_CREATED_ERROR_CODE,mN.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})}))},updateKeySession:function(e,t){var i=e.session;c.isClearKey(s)&&(t=t.toJWK()),i.update(t).catch((function(t){n.trigger(r.KEY_ERROR,{data:new _N.default(mN.default.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})}))},loadKeySession:function(e,t,i){if(!s||!l)throw new Error("Can not load sessions until you have selected a key system");for(var a=0;a<f.length;a++)if(e===f[a].sessionId)return void o.warn("DRM: Ignoring session ID because we have already seen it!");var u=l.createSession(i),d=m(u,t,i,e);u.load(e).then((function(t){t?(o.debug("DRM: Session loaded. SessionID = "+d.getSessionID()),n.trigger(r.KEY_SESSION_CREATED,{data:d})):(g(d),n.trigger(r.KEY_SESSION_CREATED,{data:null,error:new _N.default(mN.default.KEY_SESSION_CREATED_ERROR_CODE,mN.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+e+")")}))})).catch((function(t){g(d),n.trigger(r.KEY_SESSION_CREATED,{data:null,error:new _N.default(mN.default.KEY_SESSION_CREATED_ERROR_CODE,mN.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+e+")! "+t.name)})}))},removeKeySession:function(e){e.session.remove().then((function(){o.debug("DRM: Session removed. SessionID = "+e.getSessionID()),n.trigger(r.KEY_SESSION_REMOVED,{data:e.getSessionID()})}),(function(t){n.trigger(r.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionID()+"). "+t.name})}))},closeKeySession:function(e){h(e).catch((function(t){g(e),n.trigger(r.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionID()+") "+t.name})}))},stop:function(){for(var e=void 0,t=0;t<f.length;t++)(e=f[t]).getUsable()||h(e).catch((function(){g(e)}))},reset:function(){var e=f.length,t=void 0;0!==e?function(){for(var i=function(e){g(e),0===f.length&&(u?(u.removeEventListener("encrypted",d),u.setMediaKeys(null).then((function(){n.trigger(r.TEARDOWN_COMPLETE)}))):n.trigger(r.TEARDOWN_COMPLETE))},a=0;a<e;a++)!function(e){t.session.closed.then((function(){i(e)})),h(t).catch((function(){i(e)}))}(t=f[a])}():n.trigger(r.TEARDOWN_COMPLETE)}},o=i.getLogger(a),s=null,u=null,l=null,f=[],c=(0,gN.default)(t).getInstance(),d={handleEvent:function(e){switch(e.type){case"encrypted":if(e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(r.NEED_KEY,{key:new pN.default(t,e.initDataType)})}}}},a}AN.__dashjs_factory_name="ProtectionModel_21Jan2015";var SN=dashjs.FactoryMaker.getClassFactory(AN),bN=Object.defineProperty({default:SN},"__esModule",{value:!0}),IN=ON(aN),RN=ON(lN),wN=ON(Ie),NN=ON(yR),MN=ON(dN),CN=ON(_R),DN=ON(hN);function ON(e){return e&&e.__esModule?e:{default:e}}function PN(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,i=e.debug,a=e.api,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0;function p(){try{for(var e=0;e<c.length;e++)m(c[e]);u&&u.removeEventListener(a.needkey,h),n.trigger(r.TEARDOWN_COMPLETE)}catch(e){n.trigger(r.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function m(e){var t=e.session;t.removeEventListener(a.error,e),t.removeEventListener(a.message,e),t.removeEventListener(a.ready,e),t.removeEventListener(a.close,e);for(var n=0;n<c.length;n++)if(c[n]===e){c.splice(n,1);break}t[a.release]()}function _(){var e=null,t=function(){u.removeEventListener("loadedmetadata",e),u[a.setMediaKeys](f),n.trigger(r.VIDEO_ELEMENT_SELECTED)};u.readyState>=1?t():(e=t.bind(this),u.addEventListener("loadedmetadata",e))}return o={getAllInitData:function(){for(var e=[],t=0;t<c.length;t++)e.push(c[t].initData);return e},requestKeySystemAccess:function(e){for(var t=!1,i=0;i<e.length;i++)for(var o=e[i].ks.systemString,s=e[i].configs,u=null,l=null,f=0;f<s.length;f++){var d=s[f].audioCapabilities,c=s[f].videoCapabilities;if(d&&0!==d.length){u=[];for(var h=0;h<d.length;h++)window[a.MediaKeys].isTypeSupported(o,d[h].contentType)&&u.push(d[h])}if(c&&0!==c.length){l=[];for(var p=0;p<c.length;p++)window[a.MediaKeys].isTypeSupported(o,c[p].contentType)&&l.push(c[p])}if(!(!u&&!l||u&&0===u.length||l&&0===l.length)){t=!0;var m=new CN.default(u,l),_=g.getKeySystemBySystemString(o);n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{data:new DN.default(_,m)});break}}t||n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! -- No valid audio/video content configurations detected!"})},getKeySystem:function(){return l},selectKeySystem:function(e){try{f=e.mediaKeys=new window[a.MediaKeys](e.keySystem.systemString),l=e.keySystem,d=e,u&&_(),n.trigger(r.INTERNAL_KEY_SYSTEM_SELECTED)}catch(e){n.trigger(r.INTERNAL_KEY_SYSTEM_SELECTED,{error:"Error selecting keys system ("+l.systemString+")! Could not create MediaKeys -- TODO"})}},setMediaElement:function(e){u!==e&&(u&&u.removeEventListener(a.needkey,h),(u=e)&&(u.addEventListener(a.needkey,h),f&&_()))},createKeySession:function(e,t,i,o){if(!l||!f||!d)throw new Error("Can not create sessions until you have selected a key system");var u=null;if(d.ksConfiguration.videoCapabilities&&d.ksConfiguration.videoCapabilities.length>0&&(u=d.ksConfiguration.videoCapabilities[0]),null===u&&d.ksConfiguration.audioCapabilities&&d.ksConfiguration.audioCapabilities.length>0&&(u=d.ksConfiguration.audioCapabilities[0]),null===u)throw new Error("Can not create sessions for unknown content types.");var h=u.contentType,g=f.createSession(h,new Uint8Array(e),o?new Uint8Array(o):null),p=function(e,t){return{session:e,initData:t,getSessionID:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case a.error:n.trigger(r.KEY_ERROR,{data:new wN.default(NN.default.MEDIA_KEYERR_CODE,"KeyError",this)});break;case a.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(r.INTERNAL_KEY_MESSAGE,{data:new MN.default(this,t,e.destinationURL)});break;case a.ready:s.debug("DRM: Key added."),n.trigger(r.KEY_ADDED);break;case a.close:s.debug("DRM: Session closed. SessionID = "+this.getSessionID()),n.trigger(r.KEY_SESSION_CLOSED,{data:this.getSessionID()})}}}}(g,e);g.addEventListener(a.error,p),g.addEventListener(a.message,p),g.addEventListener(a.ready,p),g.addEventListener(a.close,p),c.push(p),s.debug("DRM: Session created. SessionID = "+p.getSessionID()),n.trigger(r.KEY_SESSION_CREATED,{data:p})},updateKeySession:function(e,t){var n=e.session;g.isClearKey(l)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t))},closeKeySession:m,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:p,reset:p},s=i.getLogger(o),u=null,l=null,f=null,d=null,c=[],g=(0,IN.default)(t).getInstance(),h={handleEvent:function(e){switch(e.type){case a.needkey:if(e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(r.NEED_KEY,{key:new RN.default(t,"cenc")})}}}},o}PN.__dashjs_factory_name="ProtectionModel_3Feb2014";var LN=dashjs.FactoryMaker.getClassFactory(PN),FN=Object.defineProperty({default:LN},"__esModule",{value:!0}),xN=qN(aN),UN=qN(lN),BN=qN(Ie),kN=qN(dN),GN=qN(_R),jN=qN(hN),YN=qN(yR);function qN(e){return e&&e.__esModule?e:{default:e}}function HN(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,i=e.debug,a=e.api,o=e.errHandler,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0;function m(){l&&y();for(var e=0;e<h.length;e++)_(h[e]);n.trigger(r.TEARDOWN_COMPLETE)}function _(e){try{l[a.cancelKeyRequest](f.systemString,e.sessionID)}catch(t){n.trigger(r.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionID+") "+t.message})}}function E(e,t){if(t&&e){for(var n=e.length,r=0;r<n;r++)if(e[r].sessionID==t)return e[r];return null}return null}function y(){l.removeEventListener(a.keyerror,p),l.removeEventListener(a.needkey,p),l.removeEventListener(a.keymessage,p),l.removeEventListener(a.keyadded,p)}return s={getAllInitData:function(){for(var e=[],t=0;t<c.length;t++)e.push(c[t].initData);for(var n=0;n<h.length;n++)e.push(h[n].initData);return e},requestKeySystemAccess:function(e){var t=l;t||(t=document.createElement("video"));for(var i=!1,a=0;a<e.length;a++)for(var o=e[a].ks.systemString,s=e[a].configs,u=null,f=0;f<s.length;f++){var c=s[f].videoCapabilities;if(c&&0!==c.length){u=[];for(var h=0;h<c.length;h++)""!==t.canPlayType(c[h].contentType,o)&&u.push(c[h])}if(u&&(!u||0!==u.length)){i=!0;var g=new GN.default(null,u),p=d.getKeySystemBySystemString(o);n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{data:new jN.default(p,g)});break}}i||n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! -- No valid audio/video content configurations detected!"})},getKeySystem:function(){return f},selectKeySystem:function(e){f=e.keySystem,n.trigger(r.INTERNAL_KEY_SYSTEM_SELECTED)},setMediaElement:function(e){if(l!==e){if(l){y();for(var t=0;t<h.length;t++)_(h[t]);h=[]}(l=e)&&(l.addEventListener(a.keyerror,p),l.addEventListener(a.needkey,p),l.addEventListener(a.keymessage,p),l.addEventListener(a.keyadded,p),n.trigger(r.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!f)throw new Error("Can not create sessions until you have selected a key system");if(g||0===h.length){var t={sessionID:null,initData:e,getSessionID:function(){return this.sessionID},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"}};return c.push(t),l[a.generateKeyRequest](f.systemString,new Uint8Array(e)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){var n=e.sessionID;if(d.isClearKey(f))for(var r=0;r<t.keyPairs.length;r++)l[a.addKey](f.systemString,t.keyPairs[r].key,t.keyPairs[r].keyID,n);else l[a.addKey](f.systemString,new Uint8Array(t),new Uint8Array(e.initData),n)},closeKeySession:_,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:m,reset:m},u=i.getLogger(s),l=null,f=null,c=[],h=[],d=(0,xN.default)(t).getInstance(),p={handleEvent:function(e){var t=null;switch(e.type){case a.needkey:var i=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(r.NEED_KEY,{key:new UN.default(i,"cenc")});break;case a.keyerror:if((t=E(h,e.sessionId))||(t=E(c,e.sessionId)),t){var s=YN.default.MEDIA_KEYERR_CODE,l="";switch(e.errorCode.code){case 1:s=YN.default.MEDIA_KEYERR_UNKNOWN_CODE,l+="MEDIA_KEYERR_UNKNOWN - "+YN.default.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:s=YN.default.MEDIA_KEYERR_CLIENT_CODE,l+="MEDIA_KEYERR_CLIENT - "+YN.default.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:s=YN.default.MEDIA_KEYERR_SERVICE_CODE,l+="MEDIA_KEYERR_SERVICE - "+YN.default.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:s=YN.default.MEDIA_KEYERR_OUTPUT_CODE,l+="MEDIA_KEYERR_OUTPUT - "+YN.default.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:s=YN.default.MEDIA_KEYERR_HARDWARECHANGE_CODE,l+="MEDIA_KEYERR_HARDWARECHANGE - "+YN.default.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:s=YN.default.MEDIA_KEYERR_DOMAIN_CODE,l+="MEDIA_KEYERR_DOMAIN - "+YN.default.MEDIA_KEYERR_DOMAIN_MESSAGE}l+=" System Code = "+e.systemCode,n.trigger(r.KEY_ERROR,{data:new BN.default(s,l,t)})}else u.error("No session token found for key error");break;case a.keyadded:(t=E(h,e.sessionId))||(t=E(c,e.sessionId)),t?(u.debug("DRM: Key added."),n.trigger(r.KEY_ADDED,{data:t})):u.debug("No session token found for key added");break;case a.keymessage:if((g=null!==e.sessionId&&void 0!==e.sessionId)?!(t=E(h,e.sessionId))&&c.length>0&&(t=c.shift(),h.push(t),t.sessionID=e.sessionId,n.trigger(r.KEY_SESSION_CREATED,{data:t})):c.length>0&&(t=c.shift(),h.push(t),0!==c.length&&o.error(new BN.default(YN.default.MEDIA_KEY_MESSAGE_ERROR_CODE,YN.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var f=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=f,n.trigger(r.INTERNAL_KEY_MESSAGE,{data:new kN.default(t,f,e.defaultURL)})}else u.warn("No session token found for key message")}}},s}HN.__dashjs_factory_name="ProtectionModel_01b";var KN=dashjs.FactoryMaker.getClassFactory(HN),VN=Object.defineProperty({default:KN},"__esModule",{value:!0}),zN=eM(UR),WN=eM(aN),XN=eM(sN),QN=eM(yR),ZN=eM(bN),$N=eM(FN),JN=eM(VN);function eM(e){return e&&e.__esModule?e:{default:e}}var tM=[{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"}],nM=[{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 rM(){var e=void 0,t=this.context;function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];if("function"==typeof e[r[Object.keys(r)[0]]])return r}return null}return e={createProtectionSystem:function(r){var i=null,a=(0,WN.default)(t).getInstance();a.setConfig({debug:r.debug,BASE64:r.BASE64}),a.initialize();var o=function(r){var i=r.debug,a=i.getLogger(e),o=r.eventBus,s=r.errHandler,u=r.videoModel?r.videoModel.getElement():null;return u&&void 0===u.onencrypted||u&&void 0===u.mediaKeys?n(u,nM)?(a.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),(0,$N.default)(t).create({debug:i,eventBus:o,events:r.events,api:n(u,nM)})):n(u,tM)?(a.info("EME detected on this user agent! (ProtectionModel_01b)"),(0,JN.default)(t).create({debug:i,eventBus:o,errHandler:s,events:r.events,api:n(u,tM)})):(a.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(a.info("EME detected on this user agent! (ProtectionModel_21Jan2015)"),(0,ZN.default)(t).create({debug:i,eventBus:o,events:r.events}))}(r);return!i&&o&&(i=(0,zN.default)(t).create({protectionModel:o,protectionKeyController:a,eventBus:r.eventBus,debug:r.debug,events:r.events,BASE64:r.BASE64,constants:r.constants,cmcdModel:r.cmcdModel,settings:r.settings}),r.capabilities.setEncryptedMediaSupported(!0)),i}}}rM.__dashjs_factory_name="Protection";var iM=dashjs.FactoryMaker.getClassFactory(rM);iM.events=XN.default,iM.errors=QN.default,dashjs.FactoryMaker.updateClassFactory(rM.__dashjs_factory_name,iM);var aM=iM,oM=Object.defineProperty({default:aM},"__esModule",{value:!0}),sM=function(e){return e&&e.__esModule?e:{default:e}}(vb);var uM=function(){var e=void 0;function t(t,n,r){if(!t||!/^VIDEO$/i.test(t.nodeName))return null;if(t._dashjs_player)return t._dashjs_player;var i=void 0,a=t.id||t.name||"video element";if(!(n=n||[].slice.call(t.querySelectorAll("source")).filter((function(e){return"application/dash+xml"==e.type}))[0])&&t.src)(n=document.createElement("source")).src=t.src;else if(!n&&!t.src)return null;return r=r||{},(i=(0,sM.default)(r).create()).initialize(t,n.src,t.autoplay),e||(e=i.getDebug().getLogger()),e.debug("Converted "+a+" to dash.js player and added content: "+n.src),t._dashjs_player=i,i}function n(e){return/^VIDEO$/i.test(e.nodeName)?e:n(e.parentNode)}return{create:t,createAll:function(e,r){var i=[];e=e||"[data-dashjs-player]";for(var a=(r=r||document).querySelectorAll(e),o=0;o<a.length;o++){var s=t(a[o],null);i.push(s)}for(var u=r.querySelectorAll('source[type="application/dash+xml"]'),l=0;l<u.length;l++){var f=t(n(u[l]),null);i.push(f)}return i}}}(),lM=void 0;!("undefined"!=typeof window&&window&&window.dashjs&&window.dashjs.skipAutoCreate)&&"undefined"!=typeof window&&window&&window.addEventListener&&("complete"===window.document.readyState?window.dashjs?uM.createAll():lM=window.setInterval((function(){window.dashjs&&(window.clearInterval(lM),uM.createAll())}),500):window.addEventListener("load",(function e(){window.removeEventListener("load",e),uM.createAll()})));var fM=uM,dM=Object.defineProperty({default:fM},"__esModule",{value:!0}),cM=u((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.supportsMediaSource=t.Debug=t.MediaPlayerFactory=t.MetricsReporting=t.Protection=t.MediaPlayer=void 0;var n=o(fR),r=o(oM),i=o(dM),a=o(Z);function o(e){return e&&e.__esModule?e:{default:e}}dashjs.Protection=r.default,dashjs.MetricsReporting=n.default,dashjs.MediaPlayerFactory=i.default,dashjs.Debug=a.default,dashjs.supportsMediaSource=hv.supportsMediaSource,t.default=dashjs,t.MediaPlayer=Tb.MediaPlayer,t.Protection=r.default,t.MetricsReporting=n.default,t.MediaPlayerFactory=i.default,t.Debug=a.default,t.supportsMediaSource=hv.supportsMediaSource})),hM="audio:set",gM="audio:update",pM="audio:tracks";function mM(e){var t;null===(t=e.dash)||void 0===t||t.destroy(),e.plugins.find(e=>e.constructor===Dash).dash=e.dash=void 0}function _M(e,t,n){if(n.code==cM.MediaPlayer.errors.DOWNLOAD_ERROR_ID_CONTENT_CODE)return;if(t.errored)return;if(t.recover_count<3)return t.recover_count+=1,void EM(e,e.original_src);t.errored=!0;const r=n.error||{message:"playback failed"};e.emit("error",r),mM(e)}function EM(e,t){const n=e.dash;n&&(n.setAutoPlay(!0),n.attachSource(t))}class Dash{init(e,t,n){n.on("recover",()=>EM(n,n.original_src)),n.on("src",e=>{const t=e.detail;!this.dash||t&&this.wants(t.src||"",t,n.opts)||mM(n)}),n.on("reap",()=>{mM(n)}),n.on("quality:set",(function(e){!function(e,t){var n;const r=e.dash;if(!r)return;const i=null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.qualityIndex;if(!i)return;const a={streaming:{abr:{autoSwitchBitrate:{video:-1===i}}}};r.updateSettings(a),-1!==i&&r.setQualityFor("video",i)}(n,e)})),n.on(hM,(function(e){!function(e,t){var n;t.data&&(null===(n=e.dash)||void 0===n||n.setCurrentTrack(t.data))}(n,e)}))}onload(e,t,n,{src:r}){if(this.dash){if(this.set_drm(n,e,this.dash))return;return r&&this.dash.attachSource(r)}this.dash=n.dash=cM.MediaPlayer().create(),this.set_drm(n,e,this.dash)||(n.setState("is-loading",!0),this.dash.initialize(n,r,!!e.autoplay),this.wireup(n,this.dash))}wants(e,t,r){return n(e,t)}set_drm(e,t,n){var r,i;if(null===(r=t.dash)||void 0===r?void 0:r.drm){if("https:"!==location.protocol&&"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname)return e.emit("error",{message:"Secure page required for DRM"});n.setProtectionData(null===(i=t.dash)||void 0===i?void 0:i.drm)}}wireup(e,t){const n={seek_timer:void 0,initial_stream_init:!0,errored:!1,recover_count:0};t.on(cM.MediaPlayer.events.STREAM_INITIALIZED,(function(){n.initial_stream_init=!0,n.recover_count=0,e.setOpts({live:t.isDynamic()});const r=function(e){const{dash:t}=e;if(!t)return;const n=(t.getBitrateInfoListFor("video")||[]).sort((e,t)=>t.width-e.width);return n.push({text:"AUTO",qualityIndex:-1}),e.emit("qualities",n),n}(e);!function(e,t){if(!t.initial_stream_init)return;if(!e.dash)return;t.initial_stream_init=!1;const n=(e.dash.getTracksFor("audio")||[]).map((function(e){return e.autoselect=!0,e}));e.emit(pM,n)}(e,n),!(null==r?void 0:r[0].mediaType)&&e.emit("audioonlysource"),t.isDynamic()&&t.on(cM.MediaPlayer.events.FRAGMENT_LOADING_COMPLETED,(function(){e.emit("dvr/window",t.getDVRWindowSize())}))})),t.on(cM.MediaPlayer.events.TRACK_CHANGE_RENDERED,(function(t){"audio"===t.mediaType&&t.newMediaInfo&&e.emit(gM,t.newMediaInfo)})),t.on("currentTrackChanged",(function(t){var n;"audio"===(null===(n=null==t?void 0:t.newMediaInfo)||void 0===n?void 0:n.type)&&e.emit(gM,t.newMediaInfo)})),t.on(cM.MediaPlayer.events.PLAYBACK_PROGRESS,(function(){!function(e){const{dash:t}=e;if(!t)return;const n=t.isDynamic();e.opt("live")==n||e.setOpts({live:n})}(e)})),t.on(cM.MediaPlayer.events.ERROR,(function(t){_M(e,n,t)})),t.on(cM.MediaPlayer.events.KEY_ERROR,(function(t){_M(e,n,t)}))}}return Dash.MediaPlayer=cM.MediaPlayer,"function"==typeof MediaSource&&function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;"function"==typeof n?n(t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t))}(window,Dash),Dash}));
4
+ var Pr=o((function(e,t){var n=Dr.Buffer;function r(e,t){for(var n in e)t[n]=e[n]}function i(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=Dr:(r(Dr,t),t.Buffer=i),i.prototype=Object.create(n.prototype),r(n,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Dr.SlowBuffer(e)}})).Buffer,Lr=Pr.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var Fr=xr;function xr(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(Pr.isEncoding===Lr||!Lr(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=kr,this.end=Gr,t=4;break;case"utf8":this.fillLast=Br,t=4;break;case"base64":this.text=jr,this.end=Yr,t=3;break;default:return this.write=qr,void(this.end=Hr)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Pr.allocUnsafe(t)}function Ur(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function Br(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function kr(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Gr(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function jr(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function Yr(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function qr(e){return e.toString(this.encoding)}function Hr(e){return e&&e.length?this.write(e):""}xr.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},xr.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},xr.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=Ur(t[r]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=Ur(t[r]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=Ur(t[r]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},xr.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var Kr={StringDecoder:Fr};Wr.ReadableState=zr;var Vr=function(e){if(ur(Zn)&&(Zn=Vn.env.NODE_DEBUG||""),e=e.toUpperCase(),!$n[e])if(new RegExp("\\b"+e+"\\b","i").test(Zn)){$n[e]=function(){var t=Xn.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else $n[e]=function(){};return $n[e]}("stream");function zr(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Ti&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new Or,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Fr(e.encoding),this.encoding=e.encoding)}function Wr(e){if(!(this instanceof Wr))return new Wr(e);this._readableState=new zr(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),fn.call(this)}function Xr(e,t,n,r,i){var a=function(e,t){var n=null;Tt.isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));return n}(t,n);if(a)e.emit("error",a);else if(null===n)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,Zr(e)}(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var u;!t.decoder||i||r||(n=t.decoder.write(n),u=!t.objectMode&&0===n.length),i||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&Zr(e))),function(e,t){t.readingMore||(t.readingMore=!0,Pn(Jr,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}zn(Wr,fn),Wr.prototype.push=function(e,t){var n=this._readableState;return n.objectMode||"string"!=typeof e||(t=t||n.defaultEncoding)!==n.encoding&&(e=Tt.from(e,t),t=""),Xr(this,n,e,t,!1)},Wr.prototype.unshift=function(e){return Xr(this,this._readableState,e,"",!0)},Wr.prototype.isPaused=function(){return!1===this._readableState.flowing},Wr.prototype.setEncoding=function(e){return this._readableState.decoder=new Fr(e),this._readableState.encoding=e,this};function Qr(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function Zr(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Vr("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Pn($r,e):$r(e))}function $r(e){Vr("emit readable"),e.emit("readable"),ni(e)}function Jr(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(Vr("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function ei(e){Vr("readable nexttick read 0"),e.read(0)}function ti(e,t){t.reading||(Vr("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),ni(e),t.flowing&&!t.reading&&e.read(0)}function ni(e){var t=e._readableState;for(Vr("flow",t.flowing);t.flowing&&null!==e.read(););}function ri(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;e-=i.length;for(;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=Tt.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function ii(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Pn(ai,t,e))}function ai(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function oi(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function si(){}function ui(e,t,n){this.chunk=e,this.encoding=t,this.callback=n,this.next=null}function li(e,t){Object.defineProperty(this,"buffer",{get:Qn((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof Ti&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=!1===e.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?Pn(i,r):i(r);e._writableState.errorEmitted=!0,e.emit("error",r)}(e,n,r,t,i);else{var a=gi(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||hi(e,n),r?Pn(ci,e,n,a,i):ci(e,n,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new _i(this)}function fi(e){if(!(this instanceof fi||this instanceof Ti))return new fi(e);this._writableState=new li(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),fn.EventEmitter.call(this)}function di(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function ci(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),mi(e,t)}function hi(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var o=0;n;)i[o]=n,n=n.next,o+=1;di(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new _i(t)}else{for(;n;){var s=n.chunk,u=n.encoding,l=n.callback;if(di(e,t,!1,t.objectMode?1:s.length,s,u,l),n=n.next,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}function gi(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function pi(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function mi(e,t){var n=gi(t);return n&&(0===t.pendingcb?(pi(e,t),t.finished=!0,e.emit("finish")):pi(e,t)),n}function _i(e){var t=this;this.next=null,this.entry=null,this.finish=function(n){var r=t.entry;for(t.entry=null;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}Wr.prototype.read=function(e){Vr("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return Vr("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ii(this):Zr(this),null;if(0===(e=Qr(e,t))&&t.ended)return 0===t.length&&ii(this),null;var r,i=t.needReadable;return Vr("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&Vr("length less than watermark",i=!0),t.ended||t.reading?Vr("reading or ended",i=!1):i&&(Vr("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=Qr(n,t))),null===(r=e>0?ri(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&ii(this)),null!==r&&this.emit("data",r),r},Wr.prototype._read=function(e){this.emit("error",new Error("not implemented"))},Wr.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,Vr("pipe count=%d opts=%j",r.pipesCount,t);var i=!t||!1!==t.end?o:l;function a(e){Vr("onunpipe"),e===n&&l()}function o(){Vr("onend"),e.end()}r.endEmitted?Pn(i):n.once("end",i),e.on("unpipe",a);var s=function(e){return function(){var t=e._readableState;Vr("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,ni(e))}}(n);e.on("drain",s);var u=!1;function l(){Vr("cleanup"),e.removeListener("close",h),e.removeListener("finish",g),e.removeListener("drain",s),e.removeListener("error",c),e.removeListener("unpipe",a),n.removeListener("end",o),n.removeListener("end",l),n.removeListener("data",d),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var f=!1;function d(t){Vr("ondata"),f=!1,!1!==e.write(t)||f||((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==oi(r.pipes,e))&&!u&&(Vr("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,f=!0),n.pause())}function c(t){var n;Vr("onerror",t),p(),e.removeListener("error",c),0===(n="error",e.listeners(n).length)&&e.emit("error",t)}function h(){e.removeListener("finish",g),p()}function g(){Vr("onfinish"),e.removeListener("close",h),p()}function p(){Vr("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",c),e.once("close",h),e.once("finish",g),e.emit("pipe",n),r.flowing||(Vr("pipe resume"),n.resume()),e},Wr.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}var a=oi(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this)),this},Wr.prototype.on=function(e,t){var n=fn.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&Zr(this):Pn(ei,this))}return n},Wr.prototype.addListener=Wr.prototype.on,Wr.prototype.resume=function(){var e=this._readableState;return e.flowing||(Vr("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Pn(ti,e,t))}(this,e)),this},Wr.prototype.pause=function(){return Vr("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(Vr("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Wr.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;for(var i in e.on("end",(function(){if(Vr("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)})),e.on("data",(function(i){(Vr("wrapped data"),t.decoder&&(i=t.decoder.write(i)),t.objectMode&&null==i)||(t.objectMode||i&&i.length)&&(r.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));return function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}(["error","close","destroy","pause","resume"],(function(t){e.on(t,r.emit.bind(r,t))})),r._read=function(t){Vr("wrapped _read",t),n&&(n=!1,e.resume())},r},Wr._fromList=ri,fi.WritableState=li,zn(fi,fn.EventEmitter),li.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},fi.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},fi.prototype.write=function(e,t,n){var r=this._writableState,i=!1;return"function"==typeof t&&(n=t,t=null),Dr.Buffer.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=si),r.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),Pn(t,n)}(this,n):function(e,t,n,r){var i=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):Dr.Buffer.isBuffer(n)||"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),Pn(r,a),i=!1),i}(this,r,e,n)&&(r.pendingcb++,i=function(e,t,n,r,i){n=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=Dr.Buffer.from(t,n));return t}(t,n,r),Dr.Buffer.isBuffer(n)&&(r="buffer");var a=t.objectMode?1:n.length;t.length+=a;var o=t.length<t.highWaterMark;o||(t.needDrain=!0);if(t.writing||t.corked){var s=t.lastBufferedRequest;t.lastBufferedRequest=new ui(n,r,i),s?s.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else di(e,t,!1,a,n,r,i);return o}(this,r,e,t,n)),i},fi.prototype.cork=function(){this._writableState.corked++},fi.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||hi(this,e))},fi.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},fi.prototype._write=function(e,t,n){n(new Error("not implemented"))},fi.prototype._writev=null,fi.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,mi(e,t),n&&(t.finished?Pn(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},zn(Ti,Wr);for(var Ei=Object.keys(fi.prototype),yi=0;yi<Ei.length;yi++){var vi=Ei[yi];Ti.prototype[vi]||(Ti.prototype[vi]=fi.prototype[vi])}function Ti(e){if(!(this instanceof Ti))return new Ti(e);Wr.call(this,e),fi.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",Ai)}function Ai(){this.allowHalfOpen||this._writableState.ended||Pn(Si,this)}function Si(e){e.end()}function bi(e){this.afterTransform=function(t,n){return function(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!=n&&e.push(n);i(t);var a=e._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&e._read(a.highWaterMark)}(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Ii(e){if(!(this instanceof Ii))return new Ii(e);Ti.call(this,e),this._transformState=new bi(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(e){Ri(t,e)})):Ri(t)}))}function Ri(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}function wi(e){if(!(this instanceof wi))return new wi(e);Ii.call(this,e)}function Ni(){fn.call(this)}zn(Ii,Ti),Ii.prototype.push=function(e,t){return this._transformState.needTransform=!1,Ti.prototype.push.call(this,e,t)},Ii.prototype._transform=function(e,t,n){throw new Error("Not implemented")},Ii.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Ii.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},zn(wi,Ii),wi.prototype._transform=function(e,t,n){n(null,e)},zn(Ni,fn),Ni.Readable=Wr,Ni.Writable=fi,Ni.Duplex=Ti,Ni.Transform=Ii,Ni.PassThrough=wi,Ni.Stream=Ni,Ni.prototype.pipe=function(e,t){var n=this;function r(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",o),n.on("close",s));var a=!1;function o(){a||(a=!0,e.end())}function s(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(l(),0===fn.listenerCount(this,"error"))throw e}function l(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",o),n.removeListener("close",s),n.removeListener("error",u),e.removeListener("error",u),n.removeListener("end",l),n.removeListener("close",l),e.removeListener("close",l)}return n.on("error",u),e.on("error",u),n.on("end",l),n.on("close",l),e.on("close",l),e.emit("pipe",n),e};var Mi=i(Object.freeze({__proto__:null,default:Ni,Readable:Wr,Writable:fi,Duplex:Ti,Transform:Ii,PassThrough:wi,Stream:Ni})),Ci=o((function(e,t){!function(e){e.parser=function(e,t){return new r(e,t)},e.SAXParser=r,e.SAXStream=a,e.createStream=function(e,t){return new a(e,t)},e.MAX_BUFFER_LENGTH=65536;var t,n=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function r(t,i){if(!(this instanceof r))return new r(t,i);!function(e){for(var t=0,r=n.length;t<r;t++)e[n[t]]=""}(this),this.q=this.c="",this.bufferCheckPosition=e.MAX_BUFFER_LENGTH,this.opt=i||{},this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=!!t,this.noscript=!(!t&&!this.opt.noscript),this.state=S.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(c)),this.trackPosition=!1!==this.opt.position,this.trackPosition&&(this.position=this.line=this.column=0),I(this,"onready")}e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),r.prototype={end:function(){C(this)},write:function(t){if(this.error)throw this.error;if(this.closed)return M(this,"Cannot write after close. Assign an onready handler.");if(null===t)return C(this);"object"==typeof t&&(t=t.toString());var r=0,i="";for(;i=k(t,r++),this.c=i,i;)switch(this.trackPosition&&(this.position++,"\n"===i?(this.line++,this.column=0):this.column++),this.state){case S.BEGIN:if(this.state=S.BEGIN_WHITESPACE,"\ufeff"===i)continue;B(this,i);continue;case S.BEGIN_WHITESPACE:B(this,i);continue;case S.TEXT:if(this.sawRoot&&!this.closedRoot){for(var a=r-1;i&&"<"!==i&&"&"!==i;)(i=k(t,r++))&&this.trackPosition&&(this.position++,"\n"===i?(this.line++,this.column=0):this.column++);this.textNode+=t.substring(a,r-1)}"<"!==i||this.sawRoot&&this.closedRoot&&!this.strict?(!y(o,i)||this.sawRoot&&!this.closedRoot||D(this,"Text data outside of root node."),"&"===i?this.state=S.TEXT_ENTITY:this.textNode+=i):(this.state=S.OPEN_WAKA,this.startTagPosition=this.position);continue;case S.SCRIPT:"<"===i?this.state=S.SCRIPT_ENDING:this.script+=i;continue;case S.SCRIPT_ENDING:"/"===i?this.state=S.CLOSE_TAG:(this.script+="<"+i,this.state=S.SCRIPT);continue;case S.OPEN_WAKA:if("!"===i)this.state=S.SGML_DECL,this.sgmlDecl="";else if(E(o,i));else if(E(h,i))this.state=S.OPEN_TAG,this.tagName=i;else if("/"===i)this.state=S.CLOSE_TAG,this.tagName="";else if("?"===i)this.state=S.PROC_INST,this.procInstName=this.procInstBody="";else{if(D(this,"Unencoded <"),this.startTagPosition+1<this.position){var s=this.position-this.startTagPosition;i=new Array(s).join(" ")+i}this.textNode+="<"+i,this.state=S.TEXT}continue;case S.SGML_DECL:"[CDATA["===(this.sgmlDecl+i).toUpperCase()?(R(this,"onopencdata"),this.state=S.CDATA,this.sgmlDecl="",this.cdata=""):this.sgmlDecl+i==="--"?(this.state=S.COMMENT,this.comment="",this.sgmlDecl=""):"DOCTYPE"===(this.sgmlDecl+i).toUpperCase()?(this.state=S.DOCTYPE,(this.doctype||this.sawRoot)&&D(this,"Inappropriately located doctype declaration"),this.doctype="",this.sgmlDecl=""):">"===i?(R(this,"onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=S.TEXT):E(l,i)?(this.state=S.SGML_DECL_QUOTED,this.sgmlDecl+=i):this.sgmlDecl+=i;continue;case S.SGML_DECL_QUOTED:i===this.q&&(this.state=S.SGML_DECL,this.q=""),this.sgmlDecl+=i;continue;case S.DOCTYPE:">"===i?(this.state=S.TEXT,R(this,"ondoctype",this.doctype),this.doctype=!0):(this.doctype+=i,"["===i?this.state=S.DOCTYPE_DTD:E(l,i)&&(this.state=S.DOCTYPE_QUOTED,this.q=i));continue;case S.DOCTYPE_QUOTED:this.doctype+=i,i===this.q&&(this.q="",this.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:this.doctype+=i,"]"===i?this.state=S.DOCTYPE:E(l,i)&&(this.state=S.DOCTYPE_DTD_QUOTED,this.q=i);continue;case S.DOCTYPE_DTD_QUOTED:this.doctype+=i,i===this.q&&(this.state=S.DOCTYPE_DTD,this.q="");continue;case S.COMMENT:"-"===i?this.state=S.COMMENT_ENDING:this.comment+=i;continue;case S.COMMENT_ENDING:"-"===i?(this.state=S.COMMENT_ENDED,this.comment=N(this.opt,this.comment),this.comment&&R(this,"oncomment",this.comment),this.comment=""):(this.comment+="-"+i,this.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==i?(D(this,"Malformed comment"),this.comment+="--"+i,this.state=S.COMMENT):this.state=S.TEXT;continue;case S.CDATA:"]"===i?this.state=S.CDATA_ENDING:this.cdata+=i;continue;case S.CDATA_ENDING:"]"===i?this.state=S.CDATA_ENDING_2:(this.cdata+="]"+i,this.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===i?(this.cdata&&R(this,"oncdata",this.cdata),R(this,"onclosecdata"),this.cdata="",this.state=S.TEXT):"]"===i?this.cdata+="]":(this.cdata+="]]"+i,this.state=S.CDATA);continue;case S.PROC_INST:"?"===i?this.state=S.PROC_INST_ENDING:E(o,i)?this.state=S.PROC_INST_BODY:this.procInstName+=i;continue;case S.PROC_INST_BODY:if(!this.procInstBody&&E(o,i))continue;"?"===i?this.state=S.PROC_INST_ENDING:this.procInstBody+=i;continue;case S.PROC_INST_ENDING:">"===i?(R(this,"onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=S.TEXT):(this.procInstBody+="?"+i,this.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:E(g,i)?this.tagName+=i:(O(this),">"===i?F(this):"/"===i?this.state=S.OPEN_TAG_SLASH:(y(o,i)&&D(this,"Invalid character in tag name"),this.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===i?(F(this,!0),x(this)):(D(this,"Forward-slash in opening tag not followed by >"),this.state=S.ATTRIB);continue;case S.ATTRIB:if(E(o,i))continue;">"===i?F(this):"/"===i?this.state=S.OPEN_TAG_SLASH:E(h,i)?(this.attribName=i,this.attribValue="",this.state=S.ATTRIB_NAME):D(this,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===i?this.state=S.ATTRIB_VALUE:">"===i?(D(this,"Attribute without value"),this.attribValue=this.attribName,L(this),F(this)):E(o,i)?this.state=S.ATTRIB_NAME_SAW_WHITE:E(g,i)?this.attribName+=i:D(this,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===i)this.state=S.ATTRIB_VALUE;else{if(E(o,i))continue;D(this,"Attribute without value"),this.tag.attributes[this.attribName]="",this.attribValue="",R(this,"onattribute",{name:this.attribName,value:""}),this.attribName="",">"===i?F(this):E(h,i)?(this.attribName=i,this.state=S.ATTRIB_NAME):(D(this,"Invalid attribute name"),this.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(E(o,i))continue;E(l,i)?(this.q=i,this.state=S.ATTRIB_VALUE_QUOTED):(D(this,"Unquoted attribute value"),this.state=S.ATTRIB_VALUE_UNQUOTED,this.attribValue=i);continue;case S.ATTRIB_VALUE_QUOTED:if(i!==this.q){"&"===i?this.state=S.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=i;continue}L(this),this.q="",this.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:E(o,i)?this.state=S.ATTRIB:">"===i?F(this):"/"===i?this.state=S.OPEN_TAG_SLASH:E(h,i)?(D(this,"No whitespace between attributes"),this.attribName=i,this.attribValue="",this.state=S.ATTRIB_NAME):D(this,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(y(f,i)){"&"===i?this.state=S.ATTRIB_VALUE_ENTITY_U:this.attribValue+=i;continue}L(this),">"===i?F(this):this.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(this.tagName)">"===i?x(this):E(g,i)?this.tagName+=i:this.script?(this.script+="</"+this.tagName,this.tagName="",this.state=S.SCRIPT):(y(o,i)&&D(this,"Invalid tagname in closing tag"),this.state=S.CLOSE_TAG_SAW_WHITE);else{if(E(o,i))continue;y(h,i)?this.script?(this.script+="</"+i,this.state=S.SCRIPT):D(this,"Invalid tagname in closing tag."):this.tagName=i}continue;case S.CLOSE_TAG_SAW_WHITE:if(E(o,i))continue;">"===i?x(this):D(this,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var u,d;switch(this.state){case S.TEXT_ENTITY:u=S.TEXT,d="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:u=S.ATTRIB_VALUE_QUOTED,d="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:u=S.ATTRIB_VALUE_UNQUOTED,d="attribValue"}";"===i?(this[d]+=U(this),this.entity="",this.state=u):E(this.entity.length?m:p,i)?this.entity+=i:(D(this,"Invalid character in entity name"),this[d]+="&"+this.entity+i,this.entity="",this.state=u);continue;default:throw new Error(this,"Unknown state: "+this.state)}this.position>=this.bufferCheckPosition&&function(t){for(var r=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,a=0,o=n.length;a<o;a++){var s=t[n[a]].length;if(s>r)switch(n[a]){case"textNode":w(t);break;case"cdata":R(t,"oncdata",t.cdata),t.cdata="";break;case"script":R(t,"onscript",t.script),t.script="";break;default:M(t,"Max buffer length exceeded: "+n[a])}i=Math.max(i,s)}var u=e.MAX_BUFFER_LENGTH-i;t.bufferCheckPosition=u+t.position}(this);return this}
5
+ /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(e){w(e),""!==e.cdata&&(R(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(R(e,"onscript",e.script),e.script="")}(this)}};try{t=Mi.Stream}catch(e){t=function(){}}var i=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function a(e,n){if(!(this instanceof a))return new a(e,n);t.apply(this),this._parser=new r(e,n),this.writable=!0,this.readable=!0;var o=this;this._parser.onend=function(){o.emit("end")},this._parser.onerror=function(e){o.emit("error",e),o._parser.error=null},this._decoder=null,i.forEach((function(e){Object.defineProperty(o,"on"+e,{get:function(){return o._parser["on"+e]},set:function(t){if(!t)return o.removeAllListeners(e),o._parser["on"+e]=t,t;o.on(e,t)},enumerable:!0,configurable:!1})}))}a.prototype=Object.create(t.prototype,{constructor:{value:a}}),a.prototype.write=function(e){if("function"==typeof Tt.isBuffer&&Tt.isBuffer(e)){if(!this._decoder){var t=Kr.StringDecoder;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},a.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},a.prototype.on=function(e,n){var r=this;return r._parser["on"+e]||-1===i.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),t.prototype.on.call(r,e,n)};var o="\r\n\t ",s="0124356789",u="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",l="'\"",f=o+">",d="http://www.w3.org/XML/1998/namespace",c={xml:d,xmlns:"http://www.w3.org/2000/xmlns/"};o=_(o),s=_(s),u=_(u);var h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,g=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,m=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function _(e){return e.split("").reduce((function(e,t){return e[t]=!0,e}),{})}function E(e,t){return function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)?!!t.match(e):e[t]}function y(e,t){return!E(e,t)}l=_(l),f=_(f);var v,T,A,S=0;for(var b in e.STATE={BEGIN:S++,BEGIN_WHITESPACE:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach((function(t){var n=e.ENTITIES[t],r="number"==typeof n?String.fromCharCode(n):n;e.ENTITIES[t]=r})),e.STATE)e.STATE[e.STATE[b]]=b;function I(e,t,n){e[t]&&e[t](n)}function R(e,t,n){e.textNode&&w(e),I(e,t,n)}function w(e){e.textNode=N(e.opt,e.textNode),e.textNode&&I(e,"ontext",e.textNode),e.textNode=""}function N(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function M(e,t){return w(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,I(e,"onerror",t),e}function C(e){return e.sawRoot&&!e.closedRoot&&D(e,"Unclosed root tag"),e.state!==S.BEGIN&&e.state!==S.BEGIN_WHITESPACE&&e.state!==S.TEXT&&M(e,"Unexpected end"),w(e),e.c="",e.closed=!0,I(e,"onend"),r.call(e,e.strict,e.opt),e}function D(e,t){if("object"!=typeof e||!(e instanceof r))throw new Error("bad call to strictFail");e.strict&&M(e,t)}function O(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,R(e,"onopentagstart",n)}function P(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function L(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=P(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==d)D(e,"xml: prefix must be bound to "+d+"\nActual: "+e.attribValue);else if("xmlns"===r&&"http://www.w3.org/2000/xmlns/"!==e.attribValue)D(e,"xmlns: prefix must be bound to http://www.w3.org/2000/xmlns/\nActual: "+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,R(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function F(e,t){if(e.opt.xmlns){var n=e.tag,r=P(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(D(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){R(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var a=0,o=e.attribList.length;a<o;a++){var s=e.attribList[a],u=s[0],l=s[1],f=P(u,!0),d=f.prefix,c=f.local,h=""===d?"":n.ns[d]||"",g={name:u,value:l,prefix:d,local:c,uri:h};d&&"xmlns"!==d&&!h&&(D(e,"Unbound namespace prefix: "+JSON.stringify(d)),g.uri=d),e.tag.attributes[u]=g,R(e,"onattribute",g)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),R(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=S.TEXT:e.state=S.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function x(e){if(!e.tagName)return D(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=S.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=S.SCRIPT);R(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--;){if(e.tags[t].name===r)break;D(e,"Unexpected close tag")}if(t<0)return D(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=S.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,R(e,"onclosetag",e.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==u.ns&&Object.keys(a.ns).forEach((function(t){var n=a.ns[t];R(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=S.TEXT}function U(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),i.toLowerCase()!==n?(D(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function B(e,t){"<"===t?(e.state=S.OPEN_WAKA,e.startTagPosition=e.position):y(o,t)&&(D(e,"Non-whitespace before first tag."),e.textNode=t,e.state=S.TEXT)}function k(e,t){var n="";return t<e.length&&(n=e.charAt(t)),n}S=e.STATE,String.fromCodePoint||(v=String.fromCharCode,T=Math.floor,A=function(){var e,t,n=16384,r=[],i=-1,a=arguments.length;if(!a)return"";for(var o="";++i<a;){var s=Number(arguments[i]);if(!isFinite(s)||s<0||s>1114111||T(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?r.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,r.push(e,t)),(i+1===a||r.length>n)&&(o+=v.apply(null,r),r.length=0)}return o},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:A,configurable:!0,writable:!0}):String.fromCodePoint=A)}(t)})),Di=o((function(e,t){!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;if("sets"in t)for(var l=0;l<t.sets.length;l++)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){if("contents"in t)for(var f=0;f<t.contents.length;f++)a(e,t.contents[f],u,t),s="seq"===t.timeContainer?t.contents[f].end:Math.max(s,t.contents[f].end),u=t.contents[f]}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=new u,this.body=null}function u(){this.styling=new l,this.layout=new c}function l(){this.styles={},this.initials={}}function f(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function d(){this.styleAttrs=null}function c(){this.regions={}}function h(e,t){g.call(this,"image"),this.src=e,this.type=t}function g(e){this.kind=e}function p(e){this.id=e}function m(e){this.regionID=e}function _(e){this.styleAttrs=e}function E(e){this.sets=e}function y(e){this.contents=e}function v(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function T(){g.call(this,"body")}function A(){g.call(this,"div")}function S(){g.call(this,"p")}function b(){g.call(this,"span")}function I(){g.call(this,"span")}function R(){g.call(this,"br")}function w(){}function N(){}function M(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function C(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function D(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&&U(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):B(t,"Cannot parse styling attribute "+a+" --\x3e "+e.attributes[i].value)}}return n}function O(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 P(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 L(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(L(e,e.styles[r],n),x(e.styles[r].styleAttrs,t.styleAttrs)):B(n,"Non-existant style id referenced")}}function F(e,t,n,r){for(var i=t.length-1;i>=0;i--){var a=t[i];a in e.styles?x(e.styles[a].styleAttrs,n):B(r,"Non-existant style id referenced")}}function x(e,t){for(var n in e)e.hasOwnProperty(n)&&(n in t||(t[n]=e[n]))}function U(e,t){if(e&&e.warn&&e.warn(t))throw t}function B(e,t){if(e&&e.error&&e.error(t))throw t}function k(e,t){throw e&&e.fatal&&e.fatal(t),t}function G(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=e[n=Math.floor((r+i)/2)];if(a<t)r=n+1;else{if(!(a>t))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,i,g){var p=t.parser(!0,{xmlns:!0}),m=[],_=[],E=[],y=0,v=null;p.onclosetag=function(e){if(m[0]instanceof w)null!==v.head&&null!==v.head.styling&&F(v.head.styling,m[0].styleRefs,m[0].styleAttrs,i),delete m[0].styleRefs;else if(m[0]instanceof l)for(var t in m[0].styles)m[0].styles.hasOwnProperty(t)&&L(m[0],m[0].styles[t],i);else if(m[0]instanceof S||m[0]instanceof b){if(m[0].contents.length>1){var r,a=[m[0].contents[0]];for(r=1;r<m[0].contents.length;r++)m[0].contents[r]instanceof I&&a[a.length-1]instanceof I?a[a.length-1].text+=m[0].contents[r].text:a.push(m[0].contents[r]);m[0].contents=a}m[0]instanceof b&&1===m[0].contents.length&&m[0].contents[0]instanceof I&&(m[0].text=m[0].contents[0].text,delete m[0].contents)}else m[0]instanceof o&&(m[0].node.uri===n.ns_tt&&"metadata"===m[0].node.local?y--:y>0&&g&&"onCloseTag"in g&&g.onCloseTag());E.shift(),_.shift(),m.shift()},p.ontext=function(e){if(void 0===m[0]);else if(m[0]instanceof b||m[0]instanceof S){if(m[0]instanceof b){var t=m[0].styleAttrs[r.byName.ruby.qname];if("container"===t||"textContainer"===t||"baseContainer"===t)return}var n=new I;n.initFromText(v,m[0],e,_[0],E[0],i),m[0].contents.push(n)}else m[0]instanceof o&&y>0&&g&&"onText"in g&&g.onText(e)},p.onopentag=function(e){var t=e.attributes["xml:space"];t?E.unshift(t.value):0===E.length?E.unshift("default"):E.unshift(E[0]);var a=e.attributes["xml:lang"];if(a?_.unshift(a.value):0===_.length?_.unshift(""):_.unshift(_[0]),e.uri===n.ns_tt)if("tt"===e.local)null!==v&&k(i,"Two <tt> elements at ("+this.line+","+this.column+")"),(v=new s).initFromNode(e,_[0],i),m.unshift(v);else if("head"===e.local)m[0]instanceof s||k(i,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),m.unshift(v.head);else if("styling"===e.local)m[0]instanceof u||k(i,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),m.unshift(v.head.styling);else if("style"===e.local){var p;m[0]instanceof l?((p=new f).initFromNode(e,i),p.id?v.head.styling.styles[p.id]=p:B(i,"<style> element missing @id attribute"),m.unshift(p)):m[0]instanceof w?((p=new f).initFromNode(e,i),x(p.styleAttrs,m[0].styleAttrs),m.unshift(p)):k(i,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if("initial"===e.local){var I;if(m[0]instanceof l){for(var M in(I=new d).initFromNode(e,i),I.styleAttrs)I.styleAttrs.hasOwnProperty(M)&&(v.head.styling.initials[M]=I.styleAttrs[M]);m.unshift(I)}else k(i,"Parent of <initial> element is not <styling> at ("+this.line+","+this.column+")")}else if("layout"===e.local)m[0]instanceof u||k(i,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),m.unshift(v.head.layout);else if("region"===e.local){m[0]instanceof c||k(i,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var C=new w;C.initFromNode(v,e,_[0],i),!C.id||C.id in v.head.layout.regions?B(i,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):v.head.layout.regions[C.id]=C,m.unshift(C)}else if("body"===e.local){m[0]instanceof s||k(i,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),null!==v.body&&k(i,"Second <body> element at "+this.line+","+this.column+")");var D=new T;D.initFromNode(v,e,_[0],i),v.body=D,m.unshift(D)}else if("div"===e.local){m[0]instanceof A||m[0]instanceof T||k(i,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var O=new A;O.initFromNode(v,m[0],e,_[0],i);var P=O.styleAttrs[r.byName.backgroundImage.qname];P&&(O.contents.push(new h(P)),delete O.styleAttrs[r.byName.backgroundImage.qname]),m[0].contents.push(O),m.unshift(O)}else if("image"===e.local){m[0]instanceof A||k(i,"Parent of <image> element is not <div> at "+this.line+","+this.column+")");var L=new h;L.initFromNode(v,m[0],e,_[0],i),m[0].contents.push(L),m.unshift(L)}else if("p"===e.local){m[0]instanceof A||k(i,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var F=new S;F.initFromNode(v,m[0],e,_[0],i),m[0].contents.push(F),m.unshift(F)}else if("span"===e.local){m[0]instanceof b||m[0]instanceof S||k(i,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var U=new b;U.initFromNode(v,m[0],e,_[0],E[0],i),m[0].contents.push(U),m.unshift(U)}else if("br"===e.local){m[0]instanceof b||m[0]instanceof S||k(i,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var G=new R;G.initFromNode(v,m[0],e,_[0],i),m[0].contents.push(G),m.unshift(G)}else if("set"===e.local){m[0]instanceof b||m[0]instanceof S||m[0]instanceof A||m[0]instanceof T||m[0]instanceof w||m[0]instanceof R||k(i,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var j=new N;j.initFromNode(v,m[0],e,i),m[0].sets.push(j),m.unshift(j)}else m.unshift(new o(e));else m.unshift(new o(e));if(m[0]instanceof o)if(e.uri===n.ns_tt&&"metadata"===e.local)y++;else if(y>0&&g&&"onOpenTag"in g){var Y=[];for(var q in e.attributes)Y[e.attributes[q].uri+" "+e.attributes[q].local]={uri:e.attributes[q].uri,local:e.attributes[q].local,value:e.attributes[q].value};g.onOpenTag(e.uri,e.local,Y)}},p.write(e).close(),delete v.head.styling.styles;var M=!1;for(var C in v.head.layout.regions)if(v.head.layout.regions.hasOwnProperty(C)){M=!0;break}if(!M){var D=w.prototype.createDefaultRegion(v.lang);v.head.layout.regions[D.id]=D}for(var O in v.head.layout.regions)v.head.layout.regions.hasOwnProperty(O)&&a(v,v.head.layout.regions[O],null,null);return v.body&&a(v,v.body,null,null),v.body&&function e(t){if(!("contents"in t))return;for(var n=("styleAttrs"in t?t.styleAttrs[r.byName.ruby.qname]:null),i="span"===t.kind&&("container"===n||"textContainer"===n||"baseContainer"===n),a=t.contents.length-1;a>=0;a--)!i||"styleAttrs"in t.contents[a]&&r.byName.ruby.qname in t.contents[a].styleAttrs?e(t.contents[a]):delete t.contents[a]}(v.body),v},s.prototype.initFromNode=function(e,t,r){var a=function(e,t){var r=O(e,n.ns_ttp,"cellResolution"),i=15,a=32;if(null!==r){var o=/(\d+) (\d+)/.exec(r);null!==o?(a=parseInt(o[1]),i=parseInt(o[2])):U(t,"Malformed cellResolution value (using initial value instead)")}return{w:a,h:i}}(e,r);this.cellLength={h:new i.ComputedLength(0,1/a.h),w:new i.ComputedLength(1/a.w,0)};var o=function(e,t){var r,i=O(e,n.ns_ttp,"frameRate"),a=30;if(null!==i){null!==(r=/(\d+)/.exec(i))?a=parseInt(r[1]):U(t,"Malformed frame rate attribute (using initial value instead)")}var o=O(e,n.ns_ttp,"frameRateMultiplier"),s=1;if(null!==o){null!==(r=/(\d+) (\d+)/.exec(o))?s=parseInt(r[1])/parseInt(r[2]):U(t,"Malformed frame rate multiplier attribute (using initial value instead)")}var u=s*a,l=1,f=O(e,n.ns_ttp,"tickRate");if(null===f)null!==i&&(l=u);else{null!==(r=/(\d+)/.exec(f))?l=parseInt(r[1]):U(t,"Malformed tick rate attribute (using initial value instead)")}return{effectiveFrameRate:u,tickRate:l}}(e,r);this.effectiveFrameRate=o.effectiveFrameRate,this.tickRate=o.tickRate,this.aspectRatio=function(e,t){var r=O(e,n.ns_ittp,"aspectRatio");null===r&&(r=O(e,n.ns_ttp,"displayAspectRatio"));var i=null;if(null!==r){var a=/(\d+)\s+(\d+)/.exec(r);if(null!==a){var o=parseInt(a[1]),s=parseInt(a[2]);0!==o&&0!==s?i=o/s:B(t,"Illegal aspectRatio values (ignoring)")}else B(t,"Malformed aspectRatio attribute (ignoring)")}return i}(e,r);var s=O(e,n.ns_ttp,"timeBase");null!==s&&"media"!==s&&k(r,"Unsupported time base");var u=function(e,t){var r=O(e,n.ns_tts,"extent");if(null===r)return null;var a=r.split(" ");if(2!==a.length)return U(t,"Malformed extent (ignoring)"),null;var o=i.parseLength(a[0]),s=i.parseLength(a[1]);if(!s||!o)return U(t,"Malformed extent values (ignoring)"),null;return{h:s,w:o}}(e,r);null===u?this.pxLength={h:null,w:null}:("px"===u.h.unit&&"px"===u.w.unit||k(r,"Extent on TT must be in px or absent"),this.pxLength={h:new i.ComputedLength(0,1/u.h.value),w:new i.ComputedLength(1/u.w.value,0)}),this.dimensions={h:new i.ComputedLength(0,1),w:new i.ComputedLength(1,0)},this.lang=t},s.prototype._registerEvent=function(e){if(!(e.end<=e.begin)){var t=G(this.events,e.begin);if(t.found||this.events.splice(t.index,0,e.begin),e.end!==Number.POSITIVE_INFINITY){var n=G(this.events,e.end);n.found||this.events.splice(n.index,0,e.end)}}},s.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},s.prototype.getMediaTimeEvents=function(){return this.events},f.prototype.initFromNode=function(e,t){this.id=M(e),this.styleAttrs=D(e,t),this.styleRefs=C(e)},d.prototype.initFromNode=function(e,t){for(var r in this.styleAttrs={},e.attributes)if(e.attributes[r].uri===n.ns_itts||e.attributes[r].uri===n.ns_ebutts||e.attributes[r].uri===n.ns_tts){var i=e.attributes[r].uri+" "+e.attributes[r].local;this.styleAttrs[i]=e.attributes[r].value}},h.prototype.initFromNode=function(e,t,n,r,i){this.src="src"in n.attributes?n.attributes.src.value:null,this.src||B(i,"Invalid image@src attribute"),this.type="type"in n.attributes?n.attributes.type.value:null,this.type||B(i,"Invalid image@type attribute"),_.prototype.initFromNode.call(this,e,t,n,i),v.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),m.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},p.prototype.initFromNode=function(e,t,n,r){this.id=M(n)},m.prototype.initFromNode=function(e,t,n,r){this.regionID=function(e){return e&&"region"in e.attributes?e.attributes.region.value:""}(n)},_.prototype.initFromNode=function(e,t,n,r){this.styleAttrs=D(n,r),null!==e.head&&null!==e.head.styling&&F(e.head.styling,C(n),this.styleAttrs,r)},E.prototype.initFromNode=function(e,t,n,r){this.sets=[]},y.prototype.initFromNode=function(e,t,n,r){this.contents=[]},v.prototype.initFromNode=function(e,t,n,r){var i=function(e,t,n,r){var i=null;n&&"begin"in n.attributes&&null===(i=P(e.tickRate,e.effectiveFrameRate,n.attributes.begin.value))&&U(r,"Malformed begin value "+n.attributes.begin.value+" (using 0)");var a=null;n&&"dur"in n.attributes&&null===(a=P(e.tickRate,e.effectiveFrameRate,n.attributes.dur.value))&&U(r,"Malformed dur value "+n.attributes.dur.value+" (ignoring)");var o=null;n&&"end"in n.attributes&&null===(o=P(e.tickRate,e.effectiveFrameRate,n.attributes.end.value))&&U(r,"Malformed end value (ignoring)");return{explicit_begin:i,explicit_end:o,explicit_dur:a}}(e,0,n,r);this.explicit_begin=i.explicit_begin,this.explicit_end=i.explicit_end,this.explicit_dur=i.explicit_dur,this.timeContainer=function(e,t){var n=e&&"timeContainer"in e.attributes?e.attributes.timeContainer.value:null;return n&&"par"!==n?"seq"===n?"seq":(B(t,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"}(n,r)},T.prototype.initFromNode=function(e,t,n,r){_.prototype.initFromNode.call(this,e,null,t,r),v.prototype.initFromNode.call(this,e,null,t,r),E.prototype.initFromNode.call(this,e,null,t,r),m.prototype.initFromNode.call(this,e,null,t,r),y.prototype.initFromNode.call(this,e,null,t,r),this.lang=n},A.prototype.initFromNode=function(e,t,n,r,i){_.prototype.initFromNode.call(this,e,t,n,i),v.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),m.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},S.prototype.initFromNode=function(e,t,n,r,i){_.prototype.initFromNode.call(this,e,t,n,i),v.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),m.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},b.prototype.initFromNode=function(e,t,n,r,i,a){_.prototype.initFromNode.call(this,e,t,n,a),v.prototype.initFromNode.call(this,e,t,n,a),E.prototype.initFromNode.call(this,e,t,n,a),m.prototype.initFromNode.call(this,e,t,n,a),y.prototype.initFromNode.call(this,e,t,n,a),this.space=i,this.lang=r},I.prototype.initFromText=function(e,t,n,r,i,a){v.prototype.initFromNode.call(this,e,t,null,a),this.text=n,this.space=i,this.lang=r},R.prototype.initFromNode=function(e,t,n,r,i){m.prototype.initFromNode.call(this,e,t,n,i),v.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},w.prototype.createDefaultRegion=function(e){var t=new w;return p.call(t,""),_.call(t,{}),E.call(t,[]),v.call(t,0,Number.POSITIVE_INFINITY,null),this.lang=e,t},w.prototype.initFromNode=function(e,t,n,r){p.prototype.initFromNode.call(this,e,null,t,r),v.prototype.initFromNode.call(this,e,null,t,r),E.prototype.initFromNode.call(this,e,null,t,r),this.styleAttrs=D(t,r),this.styleRefs=C(t),this.lang=n},N.prototype.initFromNode=function(e,t,n,r){v.prototype.initFromNode.call(this,e,t,n,r);var i=D(n,r);for(var a in this.qname=null,this.value=null,i)if(i.hasOwnProperty(a)){if(this.qname){B(r,"More than one style specified on set");break}this.qname=a,this.value=i[a]}}}(t,"undefined"==typeof sax?Ci:sax,"undefined"==typeof imscNames?it:imscNames,"undefined"==typeof imscStyles?ot:imscStyles,"undefined"==typeof imscUtils?at:imscUtils)})),Oi=o((function(e,t){!function(e,t,n){function r(e,t,f,c){var h;if("region"===f.kind)(h=document.createElement("div")).style.position="absolute";else if("body"===f.kind)h=document.createElement("div");else if("div"===f.kind)h=document.createElement("div");else if("image"===f.kind){if(h=document.createElement("img"),null!==e.imgResolver&&null!==f.src){var m=e.imgResolver(f.src,h);m&&(h.src=m),h.height=e.regionH,h.width=e.regionW}}else if("p"===f.kind)h=document.createElement("p");else if("span"===f.kind)if("container"===f.styleAttrs[n.byName.ruby.qname])h=document.createElement("ruby"),e.ruby=!0;else if("base"===f.styleAttrs[n.byName.ruby.qname])h=document.createElement("rb");else if("text"===f.styleAttrs[n.byName.ruby.qname])h=document.createElement("rt");else if("baseContainer"===f.styleAttrs[n.byName.ruby.qname])h=document.createElement("rbc");else if("textContainer"===f.styleAttrs[n.byName.ruby.qname])h=document.createElement("rtc");else{if("delimiter"===f.styleAttrs[n.byName.ruby.qname])return;h=document.createElement("span")}else"br"===f.kind&&(h=document.createElement("br"));if(h){if(f.lang&&("region"!==f.kind&&f.lang===c.lang||(h.lang=f.lang)),t.appendChild(h),h.style.margin="0","region"===f.kind){var E=f.styleAttrs[n.byName.writingMode.qname];"lrtb"===E||"lr"===E?(e.ipd="lr",e.bpd="tb"):"rltb"===E||"rl"===E?(e.ipd="rl",e.bpd="tb"):"tblr"===E?(e.ipd="tb",e.bpd="lr"):"tbrl"!==E&&"tb"!==E||(e.ipd="tb",e.bpd="rl")}else if("p"===f.kind&&"tb"===e.bpd){var y=f.styleAttrs[n.byName.direction.qname];e.ipd="ltr"===y?"lr":"rl"}for(var v=0;v<d.length;v++){var T=d[v],A=f.styleAttrs[T.qname];void 0!==A&&null!==T.map&&T.map(e,h,f,A)}var S=h,b=f.styleAttrs[n.byName.linePadding.qname];if(b&&!b.isZero()){var I=b.toUsedLength(e.w,e.h);if(I>0){var R=Math.ceil(I)+"px";"tb"===e.bpd?(S.style.paddingLeft=R,S.style.paddingRight=R):(S.style.paddingTop=R,S.style.paddingBottom=R),e.lp=b}}var w=f.styleAttrs[n.byName.multiRowAlign.qname];if(w&&"auto"!==w){var N=document.createElement("span");N.style.display="inline-block",N.style.textAlign=w,h.appendChild(N),S=N,e.mra=w}var M=f.styleAttrs[n.byName.rubyReserve.qname];if(M&&"none"!==M[0]&&(e.rubyReserve=M),f.styleAttrs[n.byName.fillLineGap.qname]&&(e.flg=!0),"span"===f.kind&&f.text){var C=f.styleAttrs[n.byName.textEmphasis.qname];if(C&&"none"!==C.style&&(e.textEmphasis=!0),n.byName.textCombine.qname in f.styleAttrs&&"all"===f.styleAttrs[n.byName.textCombine.qname])h.textContent=f.text,C&&l(e,h,f,C);else for(var D="",O=0;O<f.text.length;O++){D+=f.text.charAt(O);var P=f.text.charCodeAt(O);if(P<55296||P>56319||O===f.text.length-1){var L=document.createElement("span");L.textContent=D,C&&l(e,L,f,C),h.appendChild(L),D="",L._isd_element=f}}}if("contents"in f)for(var F=0;F<f.contents.length;F++)r(e,S,f.contents[F],f);var x=[];if("p"===f.kind&&(u(e,S,x,null),e.rubyReserve&&(!function(e,t){for(var n=0;n<e.length;n++){var r,i,a=document.createElement("ruby"),o=document.createElement("rb");o.textContent="​",a.appendChild(o);var s,u=t.rubyReserve[1].toUsedLength(t.w,t.h)+"px";if("both"===t.rubyReserve[0]||"outside"===t.rubyReserve[0]&&1==e.length)(r=document.createElement("rtc")).style[p]=g?"after":"under",r.textContent="​",r.style.fontSize=u,(i=document.createElement("rtc")).style[p]=g?"before":"over",i.textContent="​",i.style.fontSize=u,a.appendChild(r),a.appendChild(i);else(r=document.createElement("rtc")).textContent="​",r.style.fontSize=u,s="after"===t.rubyReserve[0]||"outside"===t.rubyReserve[0]&&n>0?g?"after":"tb"===t.bpd||"rl"===t.bpd?"under":"over":g?"before":"tb"===t.bpd||"rl"===t.bpd?"over":"under",r.style[p]=s,a.appendChild(r);for(var l=null,f=0;f<e[n].rbc.length;f++)if("ruby"===e[n].rbc[f].localName){l=e[n].rbc[f];for(var d=0;d<l.style.length;d++)a.style.setProperty(l.style.item(d),l.style.getPropertyValue(l.style.item(d)));break}(l=l||e[n].elements[0].node).parentElement.insertBefore(a,l)}}(x,e),e.rubyReserve=null),(e.ruby||e.rubyReserve)&&(!function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].rbc.length;r++){var i;if(!e[n].rbc[r].style[p])i=g?0===n?"before":"after":"tb"===t.bpd||"rl"===t.bpd?0===n?"over":"under":0===n?"under":"over",e[n].rbc[r].style[p]=i}}(x,e),e.ruby=null),e.textEmphasis&&(!function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].te.length;r++){var i;if(!e[n].te[r].style[_]||"none"===e[n].te[r].style[_])i="tb"===t.bpd?0===n?"left over":"left under":"rl"===t.bpd?0===n?"right under":"left under":0===n?"left under":"right under",e[n].te[r].style[_]=i}}(x,e),e.textEmphasis=null),e.mra&&(!function(e){for(var t=0;t<e.length-1;t++){var n=e[t].elements.length;if(0!==n&&!1===e[t].br){var r=document.createElement("br"),i=e[t].elements[n-1].node;i.parentElement.insertBefore(r,i.nextSibling)}}}(x),e.mra=null),e.lp&&(!function(e,t,n){if(null===e)return;for(var r=0;r<e.length;r++){var i=e[r].elements.length,a=Math.ceil(t)+"px",o="-"+Math.ceil(t)+"px";if(0!==i){var s=e[r].elements[e[r].start_elem],u=e[r].elements[e[r].end_elem];if(s===u&&(elementBoundingRect=s.node.getBoundingClientRect(),0==elementBoundingRect.width||0==elementBoundingRect.height))continue;"lr"===n.ipd?(s.node.style.marginLeft=o,s.node.style.paddingLeft=a):"rl"===n.ipd?(s.node.style.paddingRight=a,s.node.style.marginRight=o):"tb"===n.ipd&&(s.node.style.paddingTop=a,s.node.style.marginTop=o),"lr"===n.ipd?(u.node.style.marginRight=o,u.node.style.paddingRight=a):"rl"===n.ipd?(u.node.style.paddingLeft=a,u.node.style.marginLeft=o):"tb"===n.ipd&&(u.node.style.paddingBottom=a,u.node.style.marginBottom=o)}}}(x,e.lp.toUsedLength(e.w,e.h),e),e.lp=null),function(e){for(var t=0;t<e.length;t++)for(var n=e[t],r=1;r<n.elements.length;){var o=n.elements[r-1],s=n.elements[r];a(o.node,s.node)?n.elements.splice(r,1):r++}for(var u,l,f=[],d=0;d<e.length;d++)for(var c=0;c<e[d].elements.length;c++)u=e[d].elements[c].node,(l=i(u,f,!1))&&(u.style.backgroundColor=l);for(var h=0;h<f.length;h++)f[h].style.backgroundColor=""}(x),e.flg)){var U=s(S.getBoundingClientRect(),e);!function(e,t,n,r,i){for(var a=Math.sign(n-t),o=0;o<=e.length;o++){var s,u,l,f;if(s=0===o?Math.round(t):o===e.length?Math.round(n):Math.round((e[o-1].after+e[o].before)/2),o>0&&e[o-1])for(l=0;l<e[o-1].elements.length;l++)f=e[o-1].elements[l],u=a*(s-f.after)+"px","lr"===r.bpd?f.node.style.paddingRight=u:"rl"===r.bpd?f.node.style.paddingLeft=u:"tb"===r.bpd&&(f.node.style.paddingBottom=u);if(o<e.length)for(l=0;l<e[o].elements.length;l++)f=e[o].elements[l],u=a*(f.before-s)+"px","lr"===r.bpd?f.node.style.paddingLeft=u:"rl"===r.bpd?f.node.style.paddingRight=u:"tb"===r.bpd&&(f.node.style.paddingTop=u)}}(x,U.before,U.after,e),e.flg=null}if("region"===f.kind&&"tb"===e.bpd&&e.enableRollUp&&f.contents.length>0&&"after"===f.styleAttrs[n.byName.displayAlign.qname]){u(e,S,x,null);var B=new o(""===f.id?"_":f.id,x);if(e.currentISDState[B.id]=B,e.previousISDState&&B.id in e.previousISDState&&e.previousISDState[B.id].plist.length>0&&B.plist.length>1&&B.plist[B.plist.length-2].text===e.previousISDState[B.id].plist[e.previousISDState[B.id].plist.length-1].text){var k=h.firstElementChild,G=B.plist[B.plist.length-1].after-B.plist[B.plist.length-1].before;k.style.bottom="-"+G+"px",k.style.transition="transform 0.4s",k.style.position="relative",k.style.transform="translateY(-"+G+"px)"}}}else!function(e,t){if(e&&e.error&&e.error(t))throw t}(e.errorHandler,"Error processing ISD element kind: "+f.kind)}function i(e,t,n){return e.style.backgroundColor?(n&&!t.includes(e)&&t.push(e),e.style.backgroundColor):"SPAN"===e.parentElement.nodeName?i(e.parentElement,t,!0):void 0}function a(e,t){if("SPAN"===e.tagName&&"SPAN"===t.tagName&&e._isd_element===t._isd_element){e.textContent+=t.textContent;for(var n=0;n<t.style.length;n++){var r=t.style[n];(r.indexOf("border")>=0||r.indexOf("padding")>=0||r.indexOf("margin")>=0)&&(e.style[r]=t.style[r])}return t.parentElement.removeChild(t),!0}return!1}function o(e,t){this.id=e,this.plist=t}function s(e,t){var n={before:null,after:null,start:null,end:null};return"tb"===t.bpd?(n.before=e.top,n.after=e.bottom,"lr"===t.ipd?(n.start=e.left,n.end=e.right):(n.start=e.right,n.end=e.left)):"lr"===t.bpd?(n.before=e.left,n.after=e.right,n.start=e.top,n.end=e.bottom):"rl"===t.bpd&&(n.before=e.right,n.after=e.left,n.start=e.top,n.end=e.bottom),n}function u(e,t,n,r){if("rt"!==t.localName&&"rtc"!==t.localName){var i,a,o,l,f=t.style.backgroundColor||r;if(0===t.childElementCount)if("span"===t.localName||"rb"===t.localName){var d=s(t.getBoundingClientRect(),e);if(0!==n.length&&(i=d.before,a=d.after,o=n[n.length-1].before,l=n[n.length-1].after,a<l&&i>o||l<=a&&o>=i)){var c=Math.sign(d.after-d.before),h=Math.sign(d.end-d.start);c*(d.before-n[n.length-1].before)<0&&(n[n.length-1].before=d.before),c*(d.after-n[n.length-1].after)>0&&(n[n.length-1].after=d.after),h*(d.start-n[n.length-1].start)<0&&(n[n.length-1].start=d.start,n[n.length-1].start_elem=n[n.length-1].elements.length),h*(d.end-n[n.length-1].end)>0&&(n[n.length-1].end=d.end,n[n.length-1].end_elem=n[n.length-1].elements.length)}else n.push({before:d.before,after:d.after,start:d.start,end:d.end,start_elem:0,end_elem:0,elements:[],rbc:[],te:[],text:"",br:!1});n[n.length-1].text+=t.textContent,n[n.length-1].elements.push({node:t,bgcolor:f,before:d.before,after:d.after})}else"br"===t.localName&&0!==n.length&&(n[n.length-1].br=!0);else for(var g=t.firstChild;g;)g.nodeType===Node.ELEMENT_NODE&&(u(e,g,n,f),"ruby"===g.localName||"rtc"===g.localName?n.length>0&&n[n.length-1].rbc.push(g):"span"===g.localName&&g.style[m]&&"none"!==g.style[m]&&n.length>0&&n[n.length-1].te.push(g)),g=g.nextSibling}}function l(e,t,n,r){var i;"none"!==r.style&&("auto"===r.style?t.style[m]="filled":t.style[m]=r.style+" "+r.symbol,("before"===r.position||"after"===r.position)&&(i="tb"===e.bpd?"before"===r.position?"left over":"left under":"rl"===e.bpd?"before"===r.position?"right under":"left under":"before"===r.position?"left under":"right under",t.style[_]=i))}function f(e,t){this.qname=e,this.map=t}e.render=function(e,t,n,i,a,o,s,u,l){var f=i||t.clientHeight,d=a||t.clientWidth;if(null!==e.aspectRatio){var c=f*e.aspectRatio;c>d?f=Math.round(d/e.aspectRatio):d=c}var h=document.createElement("div");h.style.position="relative",h.style.width=d+"px",h.style.height=f+"px",h.style.margin="auto",h.style.top=0,h.style.bottom=0,h.style.left=0,h.style.right=0,h.style.zIndex=0;var g={h:f,w:d,regionH:null,regionW:null,imgResolver:n,displayForcedOnlyMode:o||!1,isd:e,errorHandler:s,previousISDState:u,enableRollUp:l||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null,ruby:null,textEmphasis:null,rubyReserve:null};if(t.appendChild(h),"contents"in e)for(var p=0;p<e.contents.length;p++)r(g,h,e.contents[p],e);return g.currentISDState};for(var d=[new f("http://www.w3.org/ns/ttml#styling backgroundColor",(function(e,t,n,r){0!==r[3]&&(t.style.backgroundColor="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")")})),new f("http://www.w3.org/ns/ttml#styling color",(function(e,t,n,r){t.style.color="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")"})),new f("http://www.w3.org/ns/ttml#styling direction",(function(e,t,n,r){t.style.direction=r})),new f("http://www.w3.org/ns/ttml#styling display",(function(e,t,n,r){})),new f("http://www.w3.org/ns/ttml#styling displayAlign",(function(e,t,n,r){t.style.display="flex",t.style.flexDirection="column","before"===r?t.style.justifyContent="flex-start":"center"===r?t.style.justifyContent="center":"after"===r&&(t.style.justifyContent="flex-end")})),new f("http://www.w3.org/ns/ttml#styling extent",(function(e,t,n,r){e.regionH=r.h.toUsedLength(e.w,e.h),e.regionW=r.w.toUsedLength(e.w,e.h);var i=0,a=0,o=n.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];o&&(i=o[0].toUsedLength(e.w,e.h)+o[2].toUsedLength(e.w,e.h),a=o[1].toUsedLength(e.w,e.h)+o[3].toUsedLength(e.w,e.h)),t.style.height=e.regionH-i+"px",t.style.width=e.regionW-a+"px"})),new f("http://www.w3.org/ns/ttml#styling fontFamily",(function(e,t,n,r){for(var i=[],a=0;a<r.length;a++)"monospaceSerif"===r[a]?(i.push("Courier New"),i.push('"Liberation Mono"'),i.push("Courier"),i.push("monospace")):"proportionalSansSerif"===r[a]?(i.push("Arial"),i.push("Helvetica"),i.push('"Liberation Sans"'),i.push("sans-serif")):"monospace"===r[a]?i.push("monospace"):"sansSerif"===r[a]?i.push("sans-serif"):"serif"===r[a]?i.push("serif"):"monospaceSansSerif"===r[a]?(i.push("Consolas"),i.push("monospace")):"proportionalSerif"===r[a]?i.push("serif"):i.push(r[a]);if(i.length>0){for(var o=[i[0]],s=1;s<i.length;s++)-1==o.indexOf(i[s])&&o.push(i[s]);i=o}t.style.fontFamily=i.join(",")})),new f("http://www.w3.org/ns/ttml#styling shear",(function(e,t,n,r){if(0!==r){var i=-.9*r;"tb"===e.bpd?t.style.transform="skewX("+i+"deg)":t.style.transform="skewY("+i+"deg)"}})),new f("http://www.w3.org/ns/ttml#styling fontSize",(function(e,t,n,r){t.style.fontSize=r.toUsedLength(e.w,e.h)+"px"})),new f("http://www.w3.org/ns/ttml#styling fontStyle",(function(e,t,n,r){t.style.fontStyle=r})),new f("http://www.w3.org/ns/ttml#styling fontWeight",(function(e,t,n,r){t.style.fontWeight=r})),new f("http://www.w3.org/ns/ttml#styling lineHeight",(function(e,t,n,r){t.style.lineHeight="normal"===r?"normal":r.toUsedLength(e.w,e.h)+"px"})),new f("http://www.w3.org/ns/ttml#styling opacity",(function(e,t,n,r){t.style.opacity=r})),new f("http://www.w3.org/ns/ttml#styling origin",(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"})),new f("http://www.w3.org/ns/ttml#styling overflow",(function(e,t,n,r){t.style.overflow=r})),new f("http://www.w3.org/ns/ttml#styling padding",(function(e,t,n,r){var i=[];i[0]=r[0].toUsedLength(e.w,e.h)+"px",i[1]=r[3].toUsedLength(e.w,e.h)+"px",i[2]=r[2].toUsedLength(e.w,e.h)+"px",i[3]=r[1].toUsedLength(e.w,e.h)+"px",t.style.padding=i.join(" ")})),new f("http://www.w3.org/ns/ttml#styling position",(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"})),new f("http://www.w3.org/ns/ttml#styling rubyAlign",(function(e,t,n,r){t.style.rubyAlign="spaceAround"===r?"space-around":"center"})),new f("http://www.w3.org/ns/ttml#styling rubyPosition",(function(e,t,n,r){var i;"before"!==r&&"after"!==r||(i=g?r:"tb"===e.bpd||"rl"===e.bpd?"before"===r?"over":"under":"before"===r?"under":"over",t.parentElement.style[p]=i)})),new f("http://www.w3.org/ns/ttml#styling showBackground",null),new f("http://www.w3.org/ns/ttml#styling textAlign",(function(e,t,n,r){var i;i="start"===r?"rl"===e.ipd?"right":"left":"end"===r?"rl"===e.ipd?"left":"right":r,t.style.textAlign=i})),new f("http://www.w3.org/ns/ttml#styling textDecoration",(function(e,t,n,r){t.style.textDecoration=r.join(" ").replace("lineThrough","line-through")})),new f("http://www.w3.org/ns/ttml#styling textOutline",(function(e,t,n,r){})),new f("http://www.w3.org/ns/ttml#styling textShadow",(function(e,t,r,i){var a=r.styleAttrs[n.byName.textOutline.qname];if("none"===i&&"none"===a)t.style.textShadow="";else{var o=[];if("none"!==a){var s="rgba("+a.color[0].toString()+","+a.color[1].toString()+","+a.color[2].toString()+","+(a.color[3]/255).toString()+")";o.push("1px 1px 1px "+s),o.push("-1px 1px 1px "+s),o.push("1px -1px 1px "+s),o.push("-1px -1px 1px "+s)}if("none"!==i)for(var u=0;u<i.length;u++)o.push(i[u].x_off.toUsedLength(e.w,e.h)+"px "+i[u].y_off.toUsedLength(e.w,e.h)+"px "+i[u].b_radius.toUsedLength(e.w,e.h)+"px rgba("+i[u].color[0].toString()+","+i[u].color[1].toString()+","+i[u].color[2].toString()+","+(i[u].color[3]/255).toString()+")");t.style.textShadow=o.join(",")}})),new f("http://www.w3.org/ns/ttml#styling textCombine",(function(e,t,n,r){t.style.textCombineUpright=r})),new f("http://www.w3.org/ns/ttml#styling textEmphasis",(function(e,t,n,r){})),new f("http://www.w3.org/ns/ttml#styling unicodeBidi",(function(e,t,n,r){var i;i="bidiOverride"===r?"bidi-override":r,t.style.unicodeBidi=i})),new f("http://www.w3.org/ns/ttml#styling visibility",(function(e,t,n,r){t.style.visibility=r})),new f("http://www.w3.org/ns/ttml#styling wrapOption",(function(e,t,n,r){"wrap"===r?"preserve"===n.space?t.style.whiteSpace="pre-wrap":t.style.whiteSpace="normal":"preserve"===n.space?t.style.whiteSpace="pre":t.style.whiteSpace="noWrap"})),new f("http://www.w3.org/ns/ttml#styling writingMode",(function(e,t,n,r){"lrtb"===r||"lr"===r||"rltb"===r||"rl"===r?t.style.writingMode="horizontal-tb":"tblr"===r?t.style.writingMode="vertical-lr":"tbrl"!==r&&"tb"!==r||(t.style.writingMode="vertical-rl")})),new f("http://www.w3.org/ns/ttml#styling zIndex",(function(e,t,n,r){t.style.zIndex=r})),new f("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",(function(e,t,n,r){e.displayForcedOnlyMode&&!1===r&&(t.style.visibility="hidden")}))],c={},h=0;h<d.length;h++)c[d[h].qname]=d[h];var g="webkitRubyPosition"in window.getComputedStyle(document.documentElement),p=g?"webkitRubyPosition":"rubyPosition",m="webkitTextEmphasisStyle"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisStyle":"textEmphasisStyle",_="webkitTextEmphasisPosition"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisPosition":"textEmphasisPosition"}(t,"undefined"==typeof imscNames||imscNames,"undefined"==typeof imscStyles?ot:imscStyles,"undefined"==typeof imscUtils||imscUtils)})),Pi=st.generateISD,Li=Di.fromXML,Fi=Oi.render,xi=Pi,Ui=Li,Bi=Fi,ki=Hi(d),Gi=Hi(O),ji=Hi(U),Yi=Hi(y),qi=Hi(Q);function Hi(e){return e&&e.__esModule?e:{default:e}}function Ki(){var e=this.context,t=(0,Gi.default)(e).getInstance(),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0;function v(e){var t=o[e].kind,n=void 0!==o[e].id?o[e].id:o[e].lang,r=o[e].lang,i=o[e].isTTML,s=o[e].isEmbedded;return a.addTextTrack(t,n,r,i,s)}function T(e,t,n,r,i,a){var o=0,s=0;e/t>n/r?o=(s=t)/r*n:s=(o=e)/n*r;var u,l,f=0,d=0;return o/s>i?(d=s,f=s*i):(f=o,d=o/i),u=(e-f)/2,l=(t-d)/2,a?{x:u+.1*f,y:l+.1*d,w:.8*f,h:.8*d}:{x:u,y:l,w:f,h:d}}function A(e,n){var r=a.getClientWidth(),i=a.getClientHeight(),o=a.getVideoWidth(),s=a.getVideoHeight(),u=a.getVideoRelativeOffsetTop(),g=a.getVideoRelativeOffsetLeft();if(0!==o&&0!==s){var _=o/s,y=!1;e.isFromCEA608&&(_=3.5/3,y=!0);var v=T.call(this,r,i,o,s,_,y),A=v.w,S=v.h,b=v.x,I=v.y;if(A!=d||S!=c||b!=l||I!=f||n){if(l=b+g,f=I+u,d=A,c=S,h){var R=h.style;R&&(R.left=l+"px",R.top=f+"px",R.width=d+"px",R.height=c+"px",R.zIndex=p&&document[p]||m?E:null,t.trigger(ji.default.CAPTION_CONTAINER_RESIZE))}var w=e.activeCues;if(w)for(var N=w.length,M=0;M<N;++M){var C=w[M];C.scaleCue(C)}}}}function S(e){var t=d,n=c,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;if(e.cellResolution){var u=[t/e.cellResolution[0],n/e.cellResolution[1]];if(e.linePadding)for(r in e.linePadding)if(e.linePadding.hasOwnProperty(r)){i=(e.linePadding[r]*u[0]).toString();for(var l=document.getElementsByClassName("spanPadding"),f=0;f<l.length;f++)l[f].style.cssText=l[f].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i),l[f].style.cssText=l[f].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}if(e.fontSize){for(r in e.fontSize)if(e.fontSize.hasOwnProperty(r)){"%"===e.fontSize[r][0]?a=e.fontSize[r][1]/100:"c"===e.fontSize[r][0]&&(a=e.fontSize[r][1]),i=(a*u[1]).toString(),s="defaultFontSize"!==r?document.getElementsByClassName(r):document.getElementsByClassName("paragraph");for(var g=0;g<s.length;g++)s[g].style.cssText=s[g].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}if(e.lineHeight)for(r in e.lineHeight)if(e.lineHeight.hasOwnProperty(r)){"%"===e.lineHeight[r][0]?o=e.lineHeight[r][1]/100:"c"===e.fontSize[r][0]&&(o=e.lineHeight[r][1]),i=(o*u[1]).toString(),s=document.getElementsByClassName(r);for(var p=0;p<s.length;p++)s[p].style.cssText=s[p].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}}}if(e.isd){var m=document.getElementById(e.cueID);m&&h.removeChild(m),b(e)}}function b(e){if(h){var n=document.createElement("div");h.appendChild(n),_=Bi(e.isd,n,(function(t){var n=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,r=/^#(.*)$/;if(n.test(t)){var i=n.exec(t),a=parseInt(i[4],10)-1;return"data:image/png;base64,"+btoa(e.images[a])}if(r.test(t)){var o=r.exec(t)[1];return"data:image/png;base64,"+e.embeddedImages[o]}return null}),h.clientHeight,h.clientWidth,!1,(function(e){r.info("renderCaption :",e)}),_,!0),n.id=e.cueID,t.trigger(ji.default.CAPTION_RENDERED,{captionDiv:n,currentTrackIdx:u})}}function I(e){return e>=0&&o[e]?a.getTextTrack(o[e].kind,o[e].id,o[e].lang,o[e].isTTML,o[e].isEmbedded):null}function R(e){var t=this;if(e!==u){var n=I(u=e);w.call(this,n),g&&(clearInterval(g),g=null),n&&"html"===n.renderingType&&(A.call(this,n,!0),window.ResizeObserver?(y=new window.ResizeObserver((function(){A.call(t,n,!0)}))).observe(a.getElement()):g=setInterval(A.bind(this,n),500))}}function w(e){O.call(this),e&&"html"===e.renderingType?C.call(this):D.call(this)}function N(e,t,n){return(isNaN(t)||e.startTime>=t)&&(isNaN(n)||e.endTime<=n)}function M(e,t,n){if(e.cues)for(var r=e.cues,i=r.length-1;i>=0;i--)N(r[i],t,n)&&e.removeCue(r[i])}function C(){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,n=a.getElement();try{n&&(n.id?t.insertRule("#"+n.id+"::cue {background: transparent}",0):0!==n.classList.length?t.insertRule("."+n.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){r.info(""+e.message)}}}function D(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function O(){if(h)for(;h.firstChild;)h.removeChild(h.firstChild)}return n={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(i=window.VTTCue||window.TextTrackCue,o=[],s=[],u=-1,l=0,f=0,d=0,c=0,h=null,g=null,m=!1,E=2147483647,_=null,void 0!==document.fullscreenElement?p="fullscreenElement":void 0!==document.webkitIsFullScreen?p="webkitIsFullScreen":document.msFullscreenElement?p="msFullscreenElement":document.mozFullScreen&&(p="mozFullScreen"))},setDisplayCConTop:function(e){(0,Je.checkParameterType)(e,"boolean"),m=e,h&&!document[p]&&(h.style.zIndex=e?E:null)},addTextTrack:function(e,n){if(o.length!==n){if(o.push(e),o.length===n){o.sort((function(e,t){return e.index-t.index})),h=a.getTTMLRenderingDiv();for(var i=-1,l=0;l<o.length;l++){var f=v.call(this,l);s.push(f),o[l].defaultTrack&&(f.default=!0,i=l);var d=I(l);d&&(d.mode=ki.default.TEXT_SHOWING,h&&(o[l].isTTML||o[l].isEmbedded)?d.renderingType="html":d.renderingType="default"),this.addCaptions(l,0,o[l].captionData),t.trigger(ji.default.TEXT_TRACK_ADDED)}if(R.call(this,i),i>=0){t.on(ji.default.PLAYBACK_METADATA_LOADED,(function e(){var n=I(i);n&&A.call(this,n,!0),t.off(ji.default.PLAYBACK_METADATA_LOADED,e,this)}),this);for(var c=0;c<o.length;c++){var g=I(c);g&&(g.mode=c===i?ki.default.TEXT_SHOWING:ki.default.TEXT_HIDDEN)}}t.trigger(ji.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:u,tracks:o})}}else r.error("Trying to add too many tracks.")},addCaptions:function(e,n,a){var o=I(e),s=this;if(o&&Array.isArray(a)&&0!==a.length)for(var g=0;g<a.length;g++){var p=void 0,m=a[g];o.cellResolution=m.cellResolution,o.isFromCEA608=m.isFromCEA608,"html"===m.type&&h?((p=new i(m.start-n,m.end-n,"")).cueHTMLElement=m.cueHTMLElement,p.isd=m.isd,p.images=m.images,p.embeddedImages=m.embeddedImages,p.cueID=m.cueID,p.scaleCue=S.bind(s),p.cellResolution=m.cellResolution,p.lineHeight=m.lineHeight,p.linePadding=m.linePadding,p.fontSize=m.fontSize,h.style.left=l+"px",h.style.top=f+"px",h.style.width=d+"px",h.style.height=c+"px",p.onenter=function(){o.mode===ki.default.TEXT_SHOWING&&(this.isd?(b(this),r.debug("Cue enter id:"+this.cueID)):(h.appendChild(this.cueHTMLElement),S.call(s,this),t.trigger(ji.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:u})))},p.onexit=function(){if(h)for(var e=h.childNodes,t=0;t<e.length;++t)e[t].id===this.cueID&&(r.debug("Cue exit id:"+e[t].id),h.removeChild(e[t]),--t)}):m.data&&(p=new i(m.start-n,m.end-n,m.data),m.styles&&(void 0!==m.styles.align&&"align"in p&&(p.align=m.styles.align),void 0!==m.styles.line&&"line"in p&&(p.line=m.styles.line),void 0!==m.styles.position&&"position"in p&&(p.position=m.styles.position),void 0!==m.styles.size&&"size"in p&&(p.size=m.styles.size)),p.onenter=function(){o.mode===ki.default.TEXT_SHOWING&&t.trigger(ji.default.CAPTION_RENDERED,{currentTrackIdx:u})});try{p?o.addCue(p):r.error("impossible to display subtitles.")}catch(e){throw M(o),o.addCue(p),e}}},getCurrentTrackIdx:function(){return u},setCurrentTrackIdx:R,getTrackIdxForId:function(e){for(var t=-1,n=0;n<o.length;n++)if(o[n].id===e){t=n;break}return t},getCurrentTrackInfo:function(){return o[u]},setModeForTrackIdx:function(e,t){var n=I(e);n&&n.mode!==t&&(n.mode=t)},deleteCuesFromTrackIdx:function(e,t,n){var r=I(e);r&&M(r,t,n)},deleteAllTextTracks:function(){for(var e=s?s.length:0,t=0;t<e;t++){var n=I(t);n&&(M.call(this,n),n.mode="disabled")}s=[],o=[],g&&(clearInterval(g),g=null),y&&a&&(y.unobserve(a.getElement()),y=null),u=-1,O.call(this)},deleteTextTrack:function(e){a.removeChild(s[e]),s.splice(e,1)},setConfig:function(e){e&&e.videoModel&&(a=e.videoModel)}},r=(0,qi.default)(e).getInstance().getLogger(n),n}Ki.__dashjs_factory_name="TextTracks";var Vi=Yi.default.getSingletonFactory(Ki),zi=Object.defineProperty({default:Vi},"__esModule",{value:!0}),Wi=function(e){return e&&e.__esModule?e:{default:e}}(y);function Xi(){var e=0;function t(e){for(var t="",n=0;n<e.length;++n){t+=e[n].uchar}return t.length-t.replace(/^\s+/,"").length}function n(e){return"left: "+3.125*e.x+"%; top: "+6.66*e.y1+"%; width: "+(100-3.125*e.x)+"%; height: "+6.66*Math.max(e.y2-1-e.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function r(e){return"red"===e?"rgb(255, 0, 0)":"green"===e?"rgb(0, 255, 0)":"blue"===e?"rgb(0, 0, 255)":"cyan"===e?"rgb(0, 255, 255)":"magenta"===e?"rgb(255, 0, 255)":"yellow"===e?"rgb(255, 255, 0)":"white"===e?"rgb(255, 255, 255)":"black"===e?"rgb(0, 0, 0)":e}function i(e,t){var n=e.videoHeight/15;return t?"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(t.foreground?r(t.foreground):"rgb(255, 255, 255)")+"; font-style: "+(t.italics?"italic":"normal")+"; text-decoration: "+(t.underline?"underline":"none")+"; white-space: pre; background-color: "+(t.background?r(t.background):"transparent")+";":"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function a(e){return e.replace(/^\s+/g,"")}function o(e){return e.replace(/\s+$/g,"")}return{createHTMLCaptionsFromScreen:function(r,s,u,l){var f=null,d=!1,c=-1,h={start:s,end:u,spans:[]},g="style_cea608_white_black",p={},m={},_=[],E=void 0,y=void 0;for(E=0;E<15;++E){var v=l.rows[E],T="",A=null;if(!1===v.isEmpty()){var S=t(v.chars);null===f&&(f={x:S,y1:E,y2:E+1,p:[]}),S!==c&&d&&(f.p.push(h),h={start:s,end:u,spans:[]},f.y2=E,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===p.hasOwnProperty(f.name)?(_.push(f),p[f.name]=f):p[f.name].p.contat(f.p),f={x:S,y1:E,y2:E+1,p:[]});for(var b=0;b<v.chars.length;++b){var I=v.chars[b],R=I.penState;if(null===A||!R.equals(A)){T.trim().length>0&&(h.spans.push({name:g,line:T,row:E}),T="");var w="style_cea608_"+R.foreground+"_"+R.background;R.underline&&(w+="_underline"),R.italics&&(w+="_italics"),m.hasOwnProperty(w)||(m[w]=JSON.parse(JSON.stringify(R))),A=R,g=w}T+=I.uchar}T.trim().length>0&&h.spans.push({name:g,line:T,row:E}),d=!0,c=S}else d=!1,c=-1,f&&(f.p.push(h),h={start:s,end:u,spans:[]},f.y2=E,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===p.hasOwnProperty(f.name)?(_.push(f),p[f.name]=f):p[f.name].p.contat(f.p),f=null)}f&&(f.p.push(h),f.y2=E+1,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===p.hasOwnProperty(f.name)?(_.push(f),p[f.name]=f):p[f.name].p.contat(f.p),f=null);var N=[];for(E=0;E<_.length;++E){var M=_[E],C="sub_cea608_"+e++,D=document.createElement("div");D.id=C;var O=n(M);D.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+O;var P=document.createElement("div");P.className="paragraph bodyStyle",P.style.cssText=i(r);var L=document.createElement("div");L.className="cueUniWrapper",L.style.cssText="unicode-bidi: normal; direction: ltr;";for(var F=0;F<M.p.length;++F){var x=M.p[F],U=0;for(y=0;y<x.spans.length;++y){var B=x.spans[y];if(B.line.length>0){if(0!==y&&U!=B.row){var k=document.createElement("br");k.className="lineBreak",L.appendChild(k)}var G=!1;U===B.row&&(G=!0),U=B.row;var j=m[B.name],Y=document.createElement("span");Y.className="spanPadding "+B.name+" customSpanColor",Y.style.cssText=i(r,j),0!==y&&G?y===x.spans.length-1?Y.textContent=o(B.line):Y.textContent=B.line:x.spans.length>1&&y<x.spans.length-1&&B.row===x.spans[y+1].row?Y.textContent=a(B.line):Y.textContent=B.line.trim(),L.appendChild(Y)}}}P.appendChild(L),D.appendChild(P);var q={bodyStyle:["%",90]};for(var H in m)m.hasOwnProperty(H)&&(q[H]=["%",90]);N.push({type:"html",start:s,end:u,cueHTMLElement:D,cueID:C,cellResolution:[32,15],isFromCEA608:!0,fontSize:q,lineHeight:{},linePadding:{}})}return N}}}Xi.__dashjs_factory_name="EmbeddedTextHtmlRender";var Qi=Wi.default.getSingletonFactory(Xi),Zi=Object.defineProperty({default:Qi},"__esModule",{value:!0}),$i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Ji=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return $i(e,[{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])}}}]),e}(),ea=Object.defineProperty({default:Ji},"__esModule",{value:!0});var ta=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,e.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,e.SEGMENTS_UPDATE_FAILED_ERROR_CODE=13,e.SEGMENTS_UNAVAILABLE_ERROR_CODE=14,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_CODEC_CODE=30,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 segments",e.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize 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="buffer is not defined",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 function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(ea).default)),na=Object.defineProperty({default:ta},"__esModule",{value:!0}),ra=_a(d),ia=_a(Re),aa=_a(Ve),oa=_a(rt),sa=_a(y),ua=_a(Q),la=_a(zi),fa=_a(Zi),da=_a(Fe),ca=_a(u),ha=_a(O),ga=_a(U),pa=_a(be),ma=_a(na);function _a(e){return e&&e.__esModule?e:{default:e}}function Ea(){var e=this.context,t=(0,ha.default)(e).getInstance(),n=!1,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0;function M(){p=null,_=NaN,E=[],T=null,m=!1}function C(){M(),h=[],f=null}function D(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&F(t.bytes,t)}function O(){S=[],(g=(0,la.default)(e).getInstance()).setConfig({videoModel:y}),g.initialize(),a=(0,aa.default)(e).getInstance(),A=null,b=0,R=[],I=null,n=!0,w=(0,fa.default)(e).getInstance();var r=v.getActiveStreamProcessors();for(var i in r)if("video"===r[i].getType()){N=r[i].getRepresentationInfo().MSETimeOffset;break}t.on(ga.default.VIDEO_CHUNK_RECEIVED,D,this),t.on(ga.default.BUFFER_CLEARED,U,this)}function P(e){A=e}function L(e,t){var n,r,i=new ia.default,a={subtitle:"subtitles",caption:"captions"};i.captionData=e,i.lang=t.lang,i.labels=t.labels,i.id=t.id?t.id:t.index,i.index=t.index,i.isTTML=(n=!1,t.codec&&t.codec.search(ra.default.STPP)>=0&&(n=!0),t.mimeType&&t.mimeType.search(ra.default.TTML)>=0&&(n=!0),n),i.defaultTrack=function(e){var t=!1;S.length>1&&e.isEmbedded?t=e.id&&e.id===ra.default.CC1:1===S.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===S.length&&(t=e.index===h[0].index);return t}(t),i.isFragmented=!s.getIsTextTrack(t.mimeType),i.isEmbedded=!!t.isEmbedded,i.kind=r=(r=t.roles.length>0?a[t.roles[0]]:a.caption)===a.caption||r===a.subtitle?r:a.caption,i.roles=t.roles,i.accessibility=t.accessibility;var o=(h?h.length:0)+S.length;g.addTextTrack(i,o)}function F(e,t){var n=void 0,r=void 0,s=void 0,l=void 0,d=void 0,c=void 0,h=void 0,E=t.mediaInfo,v=E.type,M=E.mimeType,C=E.codec||M;if(C){if(v===ra.default.FRAGMENTED_TEXT)if(m||"InitializationSegment"!==t.segmentType){if(!m)return;if(r=(c=a.getSamplesInfo(e)).sampleList,null===T&&r.length>0&&(T=r[0].cts-t.start*_),C.search(ra.default.STPP)>=0)for(f=null!==f?f:x(C),s=0;s<r.length;s++){var D=r[s],O=D.cts,P=O-T;this.buffered.add(P/_,(P+D.duration)/_);var F=new DataView(e,D.offset,D.subSizes[0]);h=da.default.Utils.dataViewToString(F,ra.default.UTF8);var U=[],B=D.offset+D.subSizes[0];for(l=1;l<D.subSizes.length;l++){var k=new Uint8Array(e,B,D.subSizes[l]),G=String.fromCharCode.apply(null,k);U.push(G),B+=D.subSizes[l]}try{var j=u.getValue().ttmlTimeIsRelative?O/_:0;n=f.parse(h,j,O/_,(O+D.duration)/_,U),g.addCaptions(A,T/_,n)}catch(e){p.removeExecutedRequestsBeforeTime(),this.remove(),i.error("TTML parser error: "+e.message)}}else{var Y=[];for(s=0;s<r.length;s++){var q=r[s];q.cts-=T,this.buffered.add(q.cts/_,(q.cts+q.duration)/_);var H=e.slice(q.offset,q.offset+q.size),K=da.default.parseBuffer(H);for(l=0;l<K.boxes.length;l++){var V=K.boxes[l];if(i.debug("VTT box1: "+V.type),"vtte"!==V.type&&"vttc"===V.type)for(i.debug("VTT vttc boxes.length = "+V.boxes.length),d=0;d<V.boxes.length;d++){var z=V.boxes[d];if(i.debug("VTT box2: "+z.type),"payl"===z.type){var W=z.cue_text;i.debug("VTT cue_text = "+W);var X=q.cts/_,Q=(q.cts+q.duration)/_;Y.push({start:X,end:Q,data:W,styles:{}}),i.debug("VTT "+X+"-"+Q+" : "+W)}}}}Y.length>0&&g.addCaptions(A,0,Y)}}else m=!0,_=a.getMediaTimescaleFromMoov(e);else if(v===ra.default.TEXT){var Z=new DataView(e,0,e.byteLength);h=da.default.Utils.dataViewToString(Z,ra.default.UTF8);try{n=x(C).parse(h,0),g.addCaptions(g.getCurrentTrackIdx(),0,n)}catch(e){o.error(new pa.default(ma.default.TIMED_TEXT_ERROR_ID_PARSE_CODE,ma.default.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,h))}}else if(v===ra.default.VIDEO)if(t.segmentType===de.HTTPRequest.INIT_SEGMENT_TYPE){if(0===b)for(b=a.getMediaTimescaleFromMoov(e),s=0;s<S.length;s++)L(null,S[s])}else{if(0===b)return void i.warn("CEA-608: No timescale for embeddedTextTrack yet");var $=function(e,t){return function(e,n,r){var i=null;i=y.getTTMLRenderingDiv()?w.createHTMLCaptionsFromScreen(y.getElement(),e,n,r):[{start:e,end:n,data:r.getDisplayText(),styles:{}}],i&&g.addCaptions(t,0,i)}},J=(c=a.getSamplesInfo(e)).lastSequenceNumber;if(!R[0]&&!R[1]){var ee=void 0,te=void 0;for(s=0;s<S.length;s++){if(S[s].id===ra.default.CC1?te=g.getTrackIdxForId(ra.default.CC1):S[s].id===ra.default.CC3&&(te=g.getTrackIdxForId(ra.default.CC3)),-1===te)return void i.warn("CEA-608: data before track is ready.");ee=$(0,te),R[s]=new ca.default.Cea608Parser(s+1,{newCue:ee},null)}}if(b){if(null!==I&&J!==I+c.numSequences)for(s=0;s<R.length;s++)R[s]&&R[s].reset();for(var ne=function(e,t){if(0===t.length)return null;for(var n={splits:[],fields:[[],[]]},r=new DataView(e),i=0;i<t.length;i++)for(var a=t[i],o=ca.default.findCea608Nalus(r,a.offset,a.size),s=null,u=0,l=0;l<o.length;l++)for(var f=ca.default.extractCea608DataFromRange(r,o[l]),d=0;d<2;d++)f[d].length>0&&(a.cts!==s?u=0:u+=1,n.fields[d].push([a.cts+N*b,f[d],u]),s=a.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,c.sampleList),re=0;re<R.length;re++){var ie=ne.fields[re],ae=R[re];if(ae)for(s=0;s<ie.length;s++)ae.addData(ie[s][0]/b,ie[s][1])}I=J}}}else i.error("No text type defined")}function x(e){var t=void 0;return e.search(ra.default.VTT)>=0?t=d:(e.search(ra.default.TTML)>=0||e.search(ra.default.STPP)>=0)&&(t=c),t}function U(e){S.forEach((function(t){var n=g.getTrackIdxForId(t.id);n>=0&&g.deleteCuesFromTrackIdx(n,e.from,e.to)}))}return r={initialize:function(t,i,o,u){n||O(),g.setConfig({videoModel:y}),g.initialize(),a||(a=(0,aa.default)(e).getInstance()),function(t,n,i,a){var o=!s.getIsTextTrack(t);if(h=h.concat(i),o){p=a,r.buffered=(0,oa.default)(e).create(),E=l.getTracksFor(ra.default.FRAGMENTED_TEXT,n);for(var u=l.getCurrentTrackFor(ra.default.FRAGMENTED_TEXT,n),f=0;f<E.length;f++)if(E[f]===u){P(f);break}}for(var d=0;d<h.length;d++)L(null,h[d])}(t,i,o,u)},append:F,abort:function(){g.deleteAllTextTracks(),M(),a=null,h=[]},addEmbeddedTrack:function(e){if(n||O(),e)if(e.id===ra.default.CC1||e.id===ra.default.CC3){for(var t=0;t<S.length;t++)if(S[t].id===e.id)return;S.push(e)}else i.warn("Embedded track "+e.id+" not supported!")},resetEmbedded:function(){t.off(ga.default.VIDEO_CHUNK_RECEIVED,D,this),t.off(ga.default.BUFFER_CLEARED,U,this),g&&g.deleteAllTextTracks(),n=!1,S=[],R=[null,null],I=null},setConfig:function(e){e&&(e.errHandler&&(o=e.errHandler),e.adapter&&(s=e.adapter),e.manifestModel&&(u=e.manifestModel),e.mediaController&&(l=e.mediaController),e.videoModel&&(y=e.videoModel),e.streamController&&(v=e.streamController),e.textTracks&&(g=e.textTracks),e.vttParser&&(d=e.vttParser),e.ttmlParser&&(c=e.ttmlParser))},getConfig:function(){return{fragmentModel:p,fragmentedTracks:E,videoModel:y}},setCurrentFragmentedTrackIdx:P,remove:function(e,t){void 0===e&&e===t&&(e=this.buffered.start(0),t=this.buffered.end(this.buffered.length-1)),this.buffered.remove(e,t)},reset:function(){C(),v=null,y=null,g=null}},i=(0,ua.default)(e).getInstance().getLogger(r),C(),r}Ea.__dashjs_factory_name="TextSourceBuffer";var ya=sa.default.getSingletonFactory(Ea),va=Object.defineProperty({default:ya},"__esModule",{value:!0}),Ta=Sa(y),Aa=Sa(Q);function Sa(e){return e&&e.__esModule?e:{default:e}}function ba(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0;function s(e){var t=e.split(":"),n=t.length-1;return e=60*parseInt(t[n-1],10)+parseFloat(t[n]),2===n&&(e+=3600*parseInt(t[0],10)),e}function u(e){var t=e.split(i),n=t[1].split(o);return n.shift(),t[1]=n[0],n.shift(),{cuePoints:t,styles:l(n)}}function l(e){var t={};return e.forEach((function(e){if(e.split(/:/).length>1){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 f(e,t){for(var n,r=t,a="",o="";""!==e[r]&&r<e.length;)r++;if((n=r-t)>1)for(var s=0;s<n;s++){if((o=e[t+s]).match(i)){a="";break}a+=o,s!==n-1&&(a+="\n")}else(o=e[t]).match(i)||(a=o);return a}return t={parse:function(e){var t,o=[],l=void 0;if(!e)return o;t=(e=e.split(r)).length,l=-1;for(var d=0;d<t;d++){var c=e[d];if(c.length>0&&"WEBVTT"!==c&&c.match(i)){var h=u(c),g=h.cuePoints,p=h.styles,m=f(e,d+1),_=s(g[0].replace(a,"")),E=s(g[1].replace(a,""));!isNaN(_)&&!isNaN(E)&&_>=l&&E>_?""!==m?(l=_,o.push({start:_,end:E,data:m,styles:p})):n.error("Skipping cue due to empty/malformed cue text"):n.error("Skipping cue due to incorrect cue timing")}}return o}},n=(0,Aa.default)(e).getInstance().getLogger(t),r=/(?:\r\n|\r|\n)/gm,i=/-->/,a=/(^[\s]+|[\s]+$)/g,o=/\s\b/g,t}ba.__dashjs_factory_name="VTTParser";var Ia=Ta.default.getSingletonFactory(ba),Ra=Object.defineProperty({default:Ia},"__esModule",{value:!0}),wa=Object.defineProperty({default:{LEVELS:{SUGGESTION:"Suggestion",WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'}}}},"__esModule",{value:!0}),Na=La(y),Ma=La(Q),Ca=La(O),Da=La(U),Oa=La(I),Pa=La(wa);function La(e){return e&&e.__esModule?e:{default:e}}function Fa(){var e=this.context,t=(0,Ca.default)(e).getInstance(),n=void 0,r=void 0,i=0;return n={parse:function(e,n,a,o,s){var u="",l=[],f=void 0,d=void 0,c=void 0,h={},g={},p="",m="",_={onOpenTag:function(e,n,i){if(i[" imagetype"]&&!i[" imageType"]&&(t.trigger(Oa.default.CONFORMANCE_VIOLATION,{level:Pa.default.LEVELS.ERROR,event:Pa.default.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 r.warn("smpte-tt imageType != PNG. Discarded");p=i["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){p&&(g[p]=m.trim()),m="",p=""},onText:function(e){p&&(m+=e)}};if(!e)throw u="no ttml data to parse",new Error(u);h.data=e,t.trigger(Da.default.TTML_TO_PARSE,h);var E=Ui(h.data,(function(e){u=e}),_);t.trigger(Da.default.TTML_PARSED,{ttmlString:h.data,ttmlDoc:E});var y,v=E.getMediaTimeEvents();for(c=0;c<v.length;c++){var T=xi(E,v[c],(function(e){u=e}));T.contents.some((function(e){return e.contents.length}))&&(f=v[c]+n<a?a:v[c]+n)<(d=v[c+1]+n>o?o:v[c+1]+n)&&l.push({start:f,end:d,type:"html",cueID:(y=void 0,y="cue_TTML_"+i,i++,y),isd:T,images:s,embeddedImages:g})}if(""!==u)throw r.error(u),new Error(u);return l}},r=(0,Ma.default)(e).getInstance().getLogger(n),n}Fa.__dashjs_factory_name="TTMLParser";var xa=Na.default.getSingletonFactory(Fa),Ua=Object.defineProperty({default:xa},"__esModule",{value:!0}),Ba=Va(d),ka=Va(y),Ga=Va(va),ja=Va(zi),Ya=Va(Ra),qa=Va(Ua),Ha=Va(O),Ka=Va(U);function Va(e){return e&&e.__esModule?e:{default:e}}function za(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0;function A(e){void 0===T&&null!==e.fromStreamInfo&&(T=this.getCurrentTrackIdx())}function S(){void 0===T&&(T=this.getCurrentTrackIdx())}function b(){void 0!==T&&(this.setTextTrack(T),T=void 0)}function I(e){var t=this,n=e.tracks,r=e.index;h&&n.some((function(e,n){if(o.matchSettings(h,e))return t.setTextTrack(n),r=n,!0})),(!1===m||void 0===m&&!h||v)&&this.setTextTrack(-1),p=r,c.trigger(Ka.default.TEXT_TRACKS_ADDED,{enabled:w(),index:r,tracks:n}),y=!0}function R(e){if(!g&&e&&e.newMediaInfo){var t=e.newMediaInfo;t.type===Ba.default.FRAGMENTED_TEXT&&(h={lang:t.lang,role:t.roles[0],accessibility:t.accessibility[0]})}}function w(){var e=!0;return _&&!E&&(e=!1),e}function N(){_=!0,y=!1,v=!1}return t={setConfig:function(e){e&&(e.errHandler&&(r=e.errHandler),e.adapter&&(i=e.adapter),e.manifestModel&&(a=e.manifestModel),e.mediaController&&(o=e.mediaController),e.videoModel&&(s=e.videoModel),e.streamController&&(u=e.streamController),e.textTracks&&(l=e.textTracks),e.vttParser&&(f=e.vttParser),e.ttmlParser&&(d=e.ttmlParser),n.setConfig({errHandler:r,adapter:i,manifestModel:a,mediaController:o,videoModel:s,streamController:u,textTracks:l,vttParser:f,ttmlParser:d}))},getTextSourceBuffer:function(){return n},getAllTracksAreDisabled:function(){return _},addEmbeddedTrack:function(e){n.addEmbeddedTrack(e)},getTextDefaultLanguage:function(){return h&&h.lang||""},setTextDefaultLanguage:function(e){(0,Je.checkParameterType)(e,"string"),h||(h={}),h.lang=e,g=!0},setTextDefaultEnabled:function(e){(0,Je.checkParameterType)(e,"boolean"),(m=e)?_=!1:this.setTextTrack(-1)},getTextDefaultEnabled:function(){return void 0!==m&&m},setInitialSettings:function(e){h=e,g=!0},enableText:function(e){(0,Je.checkParameterType)(e,"boolean"),!m&&e&&(m=!0),w()!==e&&(e&&this.setTextTrack(p),e||(p=this.getCurrentTrackIdx(),y?this.setTextTrack(-1):v=!0))},isTextEnabled:w,setTextTrack:function(e){var t=n.getConfig(),r=t.fragmentModel,i=t.fragmentedTracks,a=t.videoModel,s=void 0,f=void 0;_=-1===e;var d=l.getCurrentTrackIdx();if(d!==e){_&&o&&o.saveTextSettingsDisabled(),l.setModeForTrackIdx(d,Ba.default.TEXT_HIDDEN),l.setCurrentTrackIdx(e),l.setModeForTrackIdx(e,Ba.default.TEXT_SHOWING);var c=l.getCurrentTrackInfo();if(c&&c.isFragmented&&!c.isEmbedded)for(var h=0;h<i.length;h++){var g=i[h];if(c.lang===g.lang&&c.index===g.index&&(g.id?c.id===g.id:c.id===g.index))if(g!==o.getCurrentTrackFor(Ba.default.FRAGMENTED_TEXT,u.getActiveStreamInfo()))r.abortRequests(),r.removeExecutedRequestsBeforeTime(),n.remove(),l.deleteCuesFromTrackIdx(d),o.setTrack(g),n.setCurrentFragmentedTrackIdx(h);else if(-1===d){for(var p=u.getActiveStreamProcessors(),m=0;m<p.length;m++)if(p[m].getType()===Ba.default.FRAGMENTED_TEXT){f=p[m];break}f.setBufferingTime(a.getTime()),f.getScheduleController().start()}}else if(c&&!c.isFragmented){for(var E=u.getActiveStreamProcessors(),y=0;y<E.length;y++)if(E[y].getType()===Ba.default.TEXT){s=(f=E[y]).getMediaInfoArr();break}if(f&&s)for(var v=0;v<s.length;v++)if(s[v].index===c.index&&s[v].lang===c.lang){f.selectMediaInfo(s[v]);break}}}},getCurrentTrackIdx:function(){return l.getCurrentTrackIdx()},enableForcedTextStreaming:function(e){(0,Je.checkParameterType)(e,"boolean"),E=e},reset:function(){N(),n.resetEmbedded(),n.reset()}},h=null,p=-1,E=!1,y=!1,g=!1,v=!1,l=(0,ja.default)(e).getInstance(),f=(0,Ya.default)(e).getInstance(),d=(0,qa.default)(e).getInstance(),n=(0,Ga.default)(e).getInstance(),c=(0,Ha.default)(e).getInstance(),l.initialize(),c.on(Ka.default.TEXT_TRACKS_QUEUE_INITIALIZED,I,t),c.on(Ka.default.CURRENT_TRACK_CHANGED,R,t),c.on(Ka.default.PERIOD_SWITCH_STARTED,A,t),c.on(Ka.default.STREAM_COMPLETED,S,t),c.on(Ka.default.PERIOD_SWITCH_COMPLETED,b,t),N(),t}za.__dashjs_factory_name="TextController";var Wa=ka.default.getSingletonFactory(za),Xa=Object.defineProperty({default:Wa},"__esModule",{value:!0}),Qa=ro(Q),Za=ro(be),$a=ro(O),Ja=ro(U),eo=ro(y),to=ro(Xa),no=ro(na);function ro(e){return e&&e.__esModule?e:{default:e}}function io(e,t,n,r){var i=this.context,a=(0,$a.default)(i).getInstance(),o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=[],h=[],g=n;function p(){try{return l.buffered}catch(e){return u.error("getAllBufferRanges exception: "+e.message),null}}function m(t){l&&A((function(){try{var n=e.duration,r=0;t&&!isNaN(t.start)&&!isNaN(t.duration)&&isFinite(t.duration)&&(n=t.start+t.duration),t&&!isNaN(t.start)&&(r=t.start),l.appendWindowStart=0,l.appendWindowEnd=n,l.appendWindowStart=r,u.debug("Updated append window. Set start to "+l.appendWindowStart+" and end to "+l.appendWindowEnd)}catch(e){u.warn("Failed to set append window")}}))}function _(){var e=this;if(h.length>0){f=!0;var t=h[0];h.splice(0,1);var n=[],r=function(){var r=p();!function(e,t,n,r){t&&t.length>0&&t.length<n.length&&function(e,t){for(var n=0;n<e.length;n++){var r=Math.round(e.start(n)),i=Math.round(e.end(n));if(i===t.start||r===t.end||t.start>=r&&t.end<=i)return!0}return!1}(t,r)&&a.trigger(Ja.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:e,from:n.end(n.length-2),to:n.start(n.length-1),unintended:!0})}(e,n,r,t),h.length>0?_.call(this):(f=!1,g&&g({chunk:t}))};try{0===t.bytes.length?r.call(this):(n=p(),l.appendBuffer?l.appendBuffer(t.bytes):l.append(t.bytes,t),A(r.bind(this)))}catch(e){u.fatal('SourceBuffer append failed "'+e+'"'),h.length>0?_():f=!1,g&&g({chunk:t,error:new Za.default(e.code,e.message)})}}}function E(){if(c.length>0){var e=c.shift();l.updating?A(e):(e(),E())}}function y(){l.updating||E()}function v(){l.updating||E()}function T(){u.error("SourceBufferSink error")}function A(e){c.push(e),l.updating||E()}return o={getType:function(){return s},getAllBufferRanges:p,getBuffer:function(){return l},append:function(e){e?(h.push(e),f||A(_.bind(this))):g({chunk:e,error:new Za.default(no.default.APPEND_ERROR_CODE,no.default.APPEND_ERROR_MESSAGE)})},remove:function(t,n,r){var i=this;A((function(){try{t>=0&&n>t&&(r||"ended"!==e.readyState)&&l.remove(t,n),A((function(){a.trigger(Ja.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:i,from:t,to:n,unintended:!1})}))}catch(e){a.trigger(Ja.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:i,from:t,to:n,unintended:!1,error:new Za.default(e.code,e.message)})}}))},abort:function(){try{("open"===e.readyState||l.setTextTrack&&"ended"===e.readyState)&&l.abort()}catch(e){u.error('SourceBuffer append abort failed: "'+e+'"')}h=[]},reset:function(t){if(l){if("function"==typeof l.removeEventListener&&(l.removeEventListener("updateend",v,!1),l.removeEventListener("error",T,!1),l.removeEventListener("abort",T,!1)),clearInterval(d),c=[],!t){try{l.getClassName&&"TextSourceBuffer"===l.getClassName()||(u.debug("Removing sourcebuffer from media source"),e.removeSourceBuffer(l))}catch(e){u.error("Failed to remove source buffer from media source.")}l=null}f=!1}h=[],g=null},updateTimestampOffset:function(e){l.timestampOffset===e||isNaN(e)||A((function(){e<0&&(e+=.001),l.timestampOffset=e}))},hasDiscontinuitiesAfter:function(e){try{var t=p();if(t&&t.length>1)for(var n=0,r=t.length;n<r;n++)if(n>0&&e<t.start(n)&&t.start(n)>t.end(n-1)+.1)return!0}catch(e){u.error("hasDiscontinuities exception: "+e.message)}return!1},waitForUpdateEnd:A,updateAppendWindow:m},function(){u=(0,Qa.default)(i).getInstance().getLogger(o),f=!1,s=t.type;var n=t.codec;try{if(n.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))throw new Error("not really supported");(l=r||e.addSourceBuffer(n)).changeType&&r&&(u.debug("Doing period transition with changeType"),l.changeType(n)),m();if("function"==typeof l.addEventListener)try{l.addEventListener("updateend",v,!1),l.addEventListener("error",T,!1),l.addEventListener("abort",T,!1)}catch(e){d=setInterval(y,50)}else d=setInterval(y,50)}catch(e){if(!t.isText&&-1===n.indexOf('codecs="stpp')&&-1===n.indexOf('codecs="wvtt'))throw e;var a=(0,to.default)(i).getInstance();l=a.getTextSourceBuffer()}}(),o}io.__dashjs_factory_name="SourceBufferSink";var ao=eo.default.getClassFactory(io),oo=Object.defineProperty({default:ao},"__esModule",{value:!0}),so=lo(Q),uo=lo(y);function lo(e){return e&&e.__esModule?e:{default:e}}function fo(e){var t=this.context,n=void 0,r=void 0,i=void 0,a=[],o=e;function s(e,t){a=a.filter((function(n){return!((isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e))}))}return n={getAllBufferRanges:function(){for(var e=[],t=0;t<a.length;t++){var n=a[t];0===e.length||n.start>e[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){"InitializationSegment"!==e.segmentType?(a.push(e),a.sort((function(e,t){return e.start-t.start})),i=null):i=e,r.debug("PreBufferSink appended chunk s: "+e.start+"; e: "+e.end),o&&o({chunk:e})},remove:s,abort:function(){},discharge:function(e,t){var n=function(e,t){return a.filter((function(n){return(isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e)}))}(e,t);return i&&(n.push(i),i=null),s(e,t),n},reset:function(){a=[],i=null,o=null},updateTimestampOffset:function(){},hasDiscontinuitiesAfter:function(){return!1},waitForUpdateEnd:function(e){e()},getBuffer:function(){return this}},r=(0,so.default)(t).getInstance().getLogger(n),n}fo.__dashjs_factory_name="PreBufferSink";var co=uo.default.getClassFactory(fo),ho=Object.defineProperty({default:co},"__esModule",{value:!0}),go=function(e){return e&&e.__esModule?e:{default:e}}(y);var po={DEFAULT:.5,STRONG:1,WEAK:0};function mo(e,t,n){return{quality:void 0===e?-1:e,reason:void 0===t?null:t,priority:function(e){var t=po.DEFAULT;return e!==po.DEFAULT&&e!==po.STRONG&&e!==po.WEAK||(t=e),t}(n)}}mo.__dashjs_factory_name="SwitchRequest";var _o=go.default.getClassFactory(mo);_o.NO_CHANGE=-1,_o.PRIORITY=po,go.default.updateClassFactory(mo.__dashjs_factory_name,_o);var Eo=_o,yo=Object.defineProperty({default:Eo},"__esModule",{value:!0}),vo=Io(y),To=Io(Q),Ao=Io(yo),So=Io(d),bo=Io(_);function Io(e){return e&&e.__esModule?e:{default:e}}function Ro(e){e=e||{};var t=this.context,n=e.dashMetrics,r=void 0,i=void 0;return r={getMaxIndex:function(e){var r=(0,Ao.default)(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(So.default.MISSING_CONFIG_ERROR)}();var a=e.getMediaInfo(),o=e.getMediaType(),s=n.getCurrentBufferState(o),u=e.getScheduleController(),l=e.getAbrController(),f=e.getStreamInfo(),d=f&&f.manifestInfo?f.manifestInfo.isDynamic:null,c=l.getThroughputHistory(),h=c.getSafeAverageThroughput(o,d),g=c.getAverageLatency(o),p=e.useBufferOccupancyABR();return isNaN(h)||!s||p||l.getAbandonmentStateFor(o)!==bo.default.ABANDON_LOAD&&(s.state===bo.default.BUFFER_LOADED||d)&&(r.quality=l.getQualityForBitrate(a,h,g),u.setTimeToLoadDelay(0),i.debug("["+o+"] requesting switch to index: ",r.quality,"Average throughput",Math.round(h),"kbps"),r.reason={throughput:h,latency:g}),r},reset:function(){}},i=(0,To.default)(t).getInstance().getLogger(r),r}Ro.__dashjs_factory_name="ThroughputRule";var wo=vo.default.getClassFactory(Ro),No=Object.defineProperty({default:wo},"__esModule",{value:!0}),Mo=xo(O),Co=xo(U),Do=xo(y),Oo=xo(Q),Po=xo(yo),Lo=xo(d),Fo=xo(_);function xo(e){return e&&e.__esModule?e:{default:e}}function Uo(e){e=e||{};var t=this.context,n=(0,Mo.default)(t).getInstance(),r=e.dashMetrics,i=void 0,a=void 0,o=void 0;function s(){(o={})[Lo.default.VIDEO]={ignoreCount:2},o[Lo.default.AUDIO]={ignoreCount:2}}function u(){s()}function l(e){isNaN(e.startTime)||e.mediaType!==Lo.default.AUDIO&&e.mediaType!==Lo.default.VIDEO||o[e.mediaType].ignoreCount>0&&o[e.mediaType].ignoreCount--}return i={getMaxIndex:function(e){var n=(0,Po.default)(t).create();if(!e||!e.hasOwnProperty("getMediaType"))return n;!function(){if(!r||!r.hasOwnProperty("getCurrentBufferLevel")||!r.hasOwnProperty("getCurrentBufferState"))throw new Error(Lo.default.MISSING_CONFIG_ERROR)}();var i=e.getMediaType(),s=r.getCurrentBufferState(i),u=e.getRepresentationInfo().fragmentDuration;if(function(e){return o[e].ignoreCount>0}(i)||!u)return n;if(s&&s.state===Fo.default.BUFFER_EMPTY)a.debug("["+i+"] Switch to index 0; buffer is empty."),n.quality=0,n.reason="InsufficientBufferRule: Buffer is empty";else{var l=e.getMediaInfo(),f=e.getAbrController(),d=f.getThroughputHistory(),c=r.getCurrentBufferLevel(i),h=d.getAverageThroughput(i),g=d.getAverageLatency(i),p=h*(c/u)*.5;n.quality=f.getQualityForBitrate(l,p,g),n.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return n},reset:function(){s(),n.off(Co.default.PLAYBACK_SEEKING,u,i),n.off(Co.default.BYTES_APPENDED_END_FRAGMENT,l,i)}},a=(0,Oo.default)(t).getInstance().getLogger(i),s(),n.on(Co.default.PLAYBACK_SEEKING,u,i),n.on(Co.default.BYTES_APPENDED_END_FRAGMENT,l,i),i}Uo.__dashjs_factory_name="InsufficientBufferRule";var Bo=Do.default.getClassFactory(Uo),ko=Object.defineProperty({default:Bo},"__esModule",{value:!0}),Go=qo(yo),jo=qo(y),Yo=qo(Q);function qo(e){return e&&e.__esModule?e:{default:e}}function Ho(e){e=e||{};var t=this.context,n=e.mediaPlayerModel,r=e.dashMetrics,i=e.settings,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0;function f(){s={},u={},l=[]}return a={shouldAbandon:function(e){var a=(0,Go.default)(t).create(Go.default.NO_CHANGE,{name:Ho.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return a;var f,d,c=e.getMediaInfo(),h=e.getMediaType(),g=e.getCurrentRequest();if(!isNaN(g.index)){f=h,d=g.index,s[f]=s[f]||{},s[f][d]=s[f][d]||{};var p=n.getStableBufferTime();if(r.getCurrentBufferLevel(h)>p)return a;var m=s[h][g.index];if(null===m||null===g.firstByteDate||u.hasOwnProperty(m.id))return a;if(void 0===m.firstByteTime&&(l[h]=[],m.firstByteTime=g.firstByteDate.getTime(),m.segmentDuration=g.duration,m.bytesTotal=g.bytesTotal,m.id=g.index),m.bytesLoaded=g.bytesLoaded,m.elapsedTime=(new Date).getTime()-m.firstByteTime,m.bytesLoaded>0&&m.elapsedTime>0&&function(e,t){l[e]=l[e]||[],l[e].push(t)}(h,Math.round(8*m.bytesLoaded/m.elapsedTime)),l[h].length>=5&&m.elapsedTime>500&&m.bytesLoaded<m.bytesTotal){var _=l[h].reduce((function(e,t){return e+t}),0);if(m.measuredBandwidthInKbps=Math.round(_/l[h].length),m.estimatedTimeOfDownload=+(8*m.bytesTotal/m.measuredBandwidthInKbps/1e3).toFixed(2),m.estimatedTimeOfDownload<1.8*m.segmentDuration||0===e.getRepresentationInfo().quality)return a;if(!u.hasOwnProperty(m.id)){var E=e.getAbrController(),y=m.bytesTotal-m.bytesLoaded,v=E.getBitrateList(c),T=E.getQualityForBitrate(c,m.measuredBandwidthInKbps*i.get().streaming.abr.bandwidthSafetyFactor),A=E.getMinAllowedIndexFor(h),S=void 0!==A?Math.max(A,T):T;y>m.bytesTotal*v[S].bitrate/v[E.getQualityFor(h)].bitrate&&(a.quality=S,a.reason.throughput=m.measuredBandwidthInKbps,a.reason.fragmentID=m.id,u[m.id]=m,o.debug("["+h+"] frag id",m.id," is asking to abandon and switch to quality to ",S," measured bandwidth was",m.measuredBandwidthInKbps),delete s[h][m.id])}}else m.bytesLoaded===m.bytesTotal&&delete s[h][m.id]}return a},reset:f},o=(0,Yo.default)(t).getInstance().getLogger(a),f(),a}Ho.__dashjs_factory_name="AbandonRequestsRule";var Ko=jo.default.getClassFactory(Ho),Vo=Object.defineProperty({default:Ko},"__esModule",{value:!0}),zo=Qo(y),Wo=Qo(yo),Xo=Qo(Q);function Qo(e){return e&&e.__esModule?e:{default:e}}function Zo(){var e=this.context,t=void 0,n=void 0;return t={getMaxIndex:function(t){var r=(0,Wo.default)(e).create();if(!t||!t.hasOwnProperty("getDroppedFramesHistory"))return r;var i=t.getDroppedFramesHistory();if(i){for(var a=i.getFrameHistory(),o=0,s=0,u=Wo.default.NO_CHANGE,l=1;l<a.length;l++)if(a[l]&&(o=a[l].droppedVideoFrames,(s=a[l].totalVideoFrames)>375&&o/s>.15)){u=l-1,n.debug("index: "+u+" Dropped Frames: "+o+" Total Frames: "+s);break}return(0,Wo.default)(e).create(u,{droppedFrames:o})}return r}},n=(0,Xo.default)(e).getInstance().getLogger(t),t}Zo.__dashjs_factory_name="DroppedFramesRule";var $o=zo.default.getClassFactory(Zo),Jo=Object.defineProperty({default:$o},"__esModule",{value:!0}),es=rs(y),ts=rs(Q),ns=rs(yo);function rs(e){return e&&e.__esModule?e:{default:e}}function is(){var e=this.context,t=void 0,n=void 0;return t={getMaxIndex:function(t){for(var r=t?t.getSwitchHistory():null,i=r?r.getSwitchRequests():[],a=0,o=0,s=0,u=(0,ns.default)(e).create(),l=0;l<i.length;l++)if(void 0!==i[l]&&(a+=i[l].drops,o+=i[l].noDrops,s+=i[l].dropSize,a+o>=6&&a/o>.075)){u.quality=l>0&&i[l].drops>0?l-1:l,u.reason={index:u.quality,drops:a,noDrops:o,dropSize:s},n.debug("Switch history rule index: "+u.quality+" samples: "+(a+o)+" drops: "+a);break}return u}},n=(0,ts.default)(e).getInstance().getLogger(t),t}is.__dashjs_factory_name="SwitchHistoryRule";var as=es.default.getClassFactory(is),os=Object.defineProperty({default:as},"__esModule",{value:!0}),ss=hs(_),us=hs(yo),ls=hs(y),fs=hs(O),ds=hs(U),cs=hs(Q);function hs(e){return e&&e.__esModule?e:{default:e}}function gs(e){e=e||{};var t=this.context,n=e.dashMetrics,r=e.mediaPlayerModel,i=(0,fs.default)(t).getInstance(),a=void 0,o=void 0,s=void 0;function u(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,10+2*t.length),a=(n[r]-1)/(i/10-1);return{gp:a,Vp:10/a}}function l(e){var t={},n=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),i=function(e){return e.map((function(e){return Math.log(e)}))}(n);i=i.map((function(e){return e-i[0]+1}));var a=r.getStableBufferTime(),o=u(a,n,i);return o?(t.state=1,t.bitrates=n,t.utilities=i,t.stableBufferTime=a,t.Vp=o.Vp,t.gp=o.gp,t.lastQuality=0,f(t)):t.state=0,t}function f(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function d(e,t){var i=r.getStableBufferTime();if(e.stableBufferTime!==i){var a=u(i,e.bitrates,e.utilities);if(a.Vp!==e.Vp||a.gp!==e.gp){var o=n.getCurrentBufferLevel(t),s=o+e.placeholderBuffer;s-=10,s*=a.Vp/e.Vp,s+=10,e.stableBufferTime=i,e.Vp=a.Vp,e.gp=a.gp,e.placeholderBuffer=Math.max(0,s-o)}}}function c(e,t){return e.Vp*(e.utilities[t]+e.gp)}function h(e,t){for(var n=e.bitrates[t],r=e.utilities[t],i=0,a=t-1;a>=0;--a)if(e.utilities[a]<e.utilities[t]){var o=e.bitrates[a],s=e.utilities[a],u=e.Vp*(e.gp+(n*s-o*r)/(n-o));i=Math.max(i,u)}return i}function g(){for(var e in s)s.hasOwnProperty(e)&&2===s[e].state&&(s[e].placeholderBuffer=0)}function p(){for(var e in s)if(s.hasOwnProperty(e)){var t=s[e];0!==t.state&&(t.state=1,f(t))}}function m(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=s[e.chunk.mediaInfo.type];if(t&&0!==t.state){var n=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||n>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,E(t,e.chunk.mediaInfo.type)}}}function _(e){if(e&&e.metric===ss.default.HTTP_REQUEST&&e.value&&e.value.type===de.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=s[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),E(t,e.mediaType))}}function E(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var r=n.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),i=c(e,e.lastQuality),a=Math.max(0,i-r);e.placeholderBuffer=Math.min(a,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function y(e){if(e){var t=s[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function v(e){if(e){var t=s[e.mediaType];if(t&&0!==t.state){var r=n.getCurrentBufferLevel(e.mediaType),i=void 0;i=t.abrQuality>0?h(t,t.abrQuality):10;var a=Math.max(0,i-r);t.placeholderBuffer=Math.min(t.placeholderBuffer,a)}}}function T(){s={}}return a={getMaxIndex:function(e){var r=(0,us.default)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return r;var i=e.getMediaInfo(),a=e.getMediaType(),u=e.getScheduleController(),g=e.getStreamInfo(),p=e.getAbrController(),m=p.getThroughputHistory(),_=g?g.id:null,E=g&&g.manifestInfo&&g.manifestInfo.isDynamic,y=e.useBufferOccupancyABR();if(r.reason=r.reason||{},!y)return r;u.setTimeToLoadDelay(0);var v=function(e){var t=e.getMediaType(),n=s[t];return n?0!==n.state&&d(n,t):(n=l(e),s[t]=n),n}(e);if(0===v.state)return r;var T=n.getCurrentBufferLevel(a),A=m.getAverageThroughput(a,E),S=m.getSafeAverageThroughput(a,E),b=m.getAverageLatency(a),I=void 0;if(r.reason.state=v.state,r.reason.throughput=A,r.reason.latency=b,isNaN(A))return r;switch(v.state){case 1:I=p.getQualityForBitrate(i,S,b),r.quality=I,r.reason.throughput=S,v.placeholderBuffer=Math.max(0,h(v,I)-T),v.lastQuality=I,!isNaN(v.lastSegmentDurationS)&&T>=v.lastSegmentDurationS&&(v.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,d(e,t)}(v,a),I=function(e,t){for(var n=e.bitrates.length,r=NaN,i=NaN,a=0;a<n;++a){var o=(e.Vp*(e.utilities[a]+e.gp)-t)/e.bitrates[a];(isNaN(i)||o>=i)&&(i=o,r=a)}return r}(v,T+v.placeholderBuffer);var R=p.getQualityForBitrate(i,S,b);I>v.lastQuality&&I>R&&(I=Math.max(R,v.lastQuality));var w=Math.max(0,T+v.placeholderBuffer-c(v,I));w<=v.placeholderBuffer?(v.placeholderBuffer-=w,w=0):(w-=v.placeholderBuffer,v.placeholderBuffer=0,I<p.getTopQualityIndexFor(a,_)?u.setTimeToLoadDelay(1e3*w):w=0),r.quality=I,r.reason.throughput=A,r.reason.latency=b,r.reason.bufferLevel=T,r.reason.placeholderBuffer=v.placeholderBuffer,r.reason.delay=w,v.lastQuality=I;break;default:o.debug("BOLA ABR rule invoked in bad state."),r.quality=p.getQualityForBitrate(i,S,b),r.reason.state=v.state,r.reason.throughput=S,r.reason.latency=b,v.state=1,f(v)}return r},reset:function(){T(),i.off(ds.default.BUFFER_EMPTY,g,a),i.off(ds.default.PLAYBACK_SEEKING,p,a),i.off(ds.default.MEDIA_FRAGMENT_LOADED,m,a),i.off(ds.default.METRIC_ADDED,_,a),i.off(ds.default.QUALITY_CHANGE_REQUESTED,y,a),i.off(ds.default.FRAGMENT_LOADING_ABANDONED,v,a)}},o=(0,cs.default)(t).getInstance().getLogger(a),T(),i.on(ds.default.BUFFER_EMPTY,g,a),i.on(ds.default.PLAYBACK_SEEKING,p,a),i.on(ds.default.MEDIA_FRAGMENT_LOADED,m,a),i.on(ds.default.METRIC_ADDED,_,a),i.on(ds.default.QUALITY_CHANGE_REQUESTED,y,a),i.on(ds.default.FRAGMENT_LOADING_ABANDONED,v,a),a}gs.__dashjs_factory_name="BolaRule";var ps=ls.default.getClassFactory(gs),ms=Object.defineProperty({default:ps},"__esModule",{value:!0}),_s=bs(_),Es=bs(yo),ys=bs(y),vs=bs(O),Ts=bs(U),As=bs(Q),Ss=bs(d);function bs(e){return e&&e.__esModule?e:{default:e}}function Is(e){e=e||{};var t=this.context,n=e.dashMetrics,r=(0,vs.default)(t).getInstance(),i=void 0,a=void 0,o=void 0,s=void 0;function u(e){var t={},n=e.getMediaInfo(),r=n.bitrateList.map((function(e){return e.bandwidth/1e3}));return t.state=1,t.bitrates=r,t.lastQuality=0,function(e){if(!e||!e.type)return;o[e.type]={},o[e.type].w=[],o[e.type].prev_w=[],o[e.type].Q=0,o[e.type].segment_request_start_s=0,o[e.type].segment_download_finish_s=0,o[e.type].B_target=1.5}(n),l(t),t}function l(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function f(){for(var e in a)if(a.hasOwnProperty(e)){var t=a[e];0!==t.state&&(t.state=1,l(t))}}function d(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=a[e.chunk.mediaInfo.type],n=o[e.chunk.mediaInfo.type];if(t&&0!==t.state){var r=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||r>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=r,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=r,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,h(t,n)}}}function c(e){if(e&&e.metric===_s.default.HTTP_REQUEST&&e.value&&e.value.type===de.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=a[e.mediaType],n=o[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),h(t,n))}}function h(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 g(e){if(e&&e.mediaType){var t=a[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function p(e,t){if(e.length!==t.length)return-1;for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n}function m(){a={},o={}}return i={getMaxIndex:function(e){var r=(0,Es.default)(t).create(),i=Math.pow(4,.99),f=Math.max(Math.pow(4,1),i*Math.sqrt(4)),d=e.getMediaInfo(),c=e.getMediaType(),h=d.bitrateList.map((function(e){return e.bandwidth})),g=h.length,m=e.getScheduleController(),_=e.getStreamInfo(),E=e.getAbrController(),y=E.getThroughputHistory(),v=_&&_.manifestInfo&&_.manifestInfo.isDynamic,T=e.useL2AABR(),A=n.getCurrentBufferLevel(c,!0),S=y.getSafeAverageThroughput(c,v),b=y.getAverageThroughput(c,v),I=y.getAverageLatency(c),R=void 0,w=e.getVideoModel().getPlaybackRate();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useL2AABR")))return r;if(r.reason=r.reason||{},!T||c===Ss.default.AUDIO)return r;m.setTimeToLoadDelay(0);var N=function(e){var t=e.getMediaType(),n=a[t];return n||(n=u(e),a[t]=n),n}(e);if(0===N.state)return r;var M=o[c];if(!M)return r;if(r.reason.state=N.state,r.reason.throughput=b,r.reason.latency=I,isNaN(b))return r;switch(N.state){case 1:if(R=E.getQualityForBitrate(d,S,I),r.quality=R,r.reason.throughput=S,N.lastQuality=R,!isNaN(N.lastSegmentDurationS)&&A>=M.B_target){N.state=2,M.Q=i;for(var C=0;C<g;++C)C===N.lastQuality?M.prev_w[C]=1:M.prev_w[C]=0}break;case 2:var D=[],O=n.getCurrentHttpRequest(c).trace.reduce((function(e,t){return e+t.d}),0),P=n.getCurrentHttpRequest(c).trace.reduce((function(e,t){return e+t.b[0]}),0),L=Math.round(8*P/O);L<1&&(L=1);for(var F=N.lastSegmentDurationS,x=1,U=0;U<g;++U)h[U]=h[U]/1e3,w*h[U]>L&&(x=-1),M.w[U]=M.prev_w[U]+x*(F/(2*f))*((M.Q+i)*(w*h[U]/L));M.w=function(e){for(var t=e.length,n=!1,r=[],i=0;i<t;++i)r[i]=e[i];for(var a=e.sort((function(e,t){return t-e})),o=0,s=0,u=[],l=0;l<t-1;++l)if((s=((o+=a[l])-1)/(l+1))>=a[l+1]){n=!0;break}n||(s=(o+a[t-1]-1)/t);for(var f=0;f<t;++f)u[f]=Math.max(r[f]-s,0);return u}(M.w);for(var B=0;B<g;++B)D[B]=M.w[B]-M.prev_w[B],M.prev_w[B]=M.w[B];M.Q=Math.max(0,M.Q-F+F*w*((p(h,M.prev_w)+p(h,D))/L));for(var k=[],G=0;G<g;++G)k[G]=Math.abs(h[G]-p(M.w,h));(R=k.indexOf(Math.min.apply(Math,k)))>N.lastQuality&&h[N.lastQuality+1]<=L&&(R=N.lastQuality+1),h[R]>=L&&(M.Q=2*Math.max(i,M.Q)),r.quality=R,r.reason.throughput=b,r.reason.latency=I,r.reason.bufferLevel=A,N.lastQuality=r.quality;break;default:s.debug("L2A ABR rule invoked in bad state."),r.quality=E.getQualityForBitrate(d,S,I),r.reason.state=N.state,r.reason.throughput=S,r.reason.latency=I,N.state=1,l(N)}return r},reset:function(){m(),r.off(Ts.default.PLAYBACK_SEEKING,f,i),r.off(Ts.default.MEDIA_FRAGMENT_LOADED,d,i),r.off(Ts.default.METRIC_ADDED,c,i),r.off(Ts.default.QUALITY_CHANGE_REQUESTED,g,i)}},s=(0,As.default)(t).getInstance().getLogger(i),m(),r.on(Ts.default.PLAYBACK_SEEKING,f,i),r.on(Ts.default.MEDIA_FRAGMENT_LOADED,d,i),r.on(Ts.default.METRIC_ADDED,c,i),r.on(Ts.default.QUALITY_CHANGE_REQUESTED,g,i),i}Is.__dashjs_factory_name="L2ARule";var Rs=ys.default.getClassFactory(Is),ws=Object.defineProperty({default:Rs},"__esModule",{value:!0}),Ns=Cs(y),Ms=Cs(Q);function Cs(e){return e&&e.__esModule?e:{default:e}}var Ds="manual_weight_selection",Os="random_weight_selection",Ps="dynamic_weight_selection";function Ls(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0;function f(){r=null,i=1,a=100,o=0,s=null,u=null,l=Ps}function d(){var e=0;if(r)for(var t=0;t<r.length;t++){var n=r[t];n.state.throughput>e&&(e=n.state.throughput)}return e}function c(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 c([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 g(e,t,n){for(var r=0;r<t.length;r++){var i=t[r],a=h(i,e);p(i,n,Math.exp(-1*Math.pow(a,2)/(2*Math.pow(.1,2))))}}function p(e,t,n){var r=e.state,i=[.01,.01,.01,.01];r.throughput=r.throughput+(t[0]-r.throughput)*i[0]*n,r.latency=r.latency+(t[1]-r.latency)*i[1]*n,r.rebuffer=r.rebuffer+(t[2]-r.rebuffer)*i[2]*n,r.switch=r.switch+(t[3]-r.switch)*i[3]*n}function m(e,t,n,r,i,a,o){s||(s=u[u.length-1]);var l=e.findWeightVector(t,n,r,i,a,o);null!==l&&-1!==l&&(s=l)}return t={getNextQuality:function(e,t,f,h,p,_,E){var y=f,v=h,T=t,A=function(e){if(!r){r=[];var t=e.bitrateList,n=[];o=t[0].bandwidth,t.forEach((function(e){n.push(e.bandwidth),e.bandwidth<o&&(o=e.bandwidth)})),l=n.map((function(e){return Math.pow(e,2)})).reduce((function(e,t){return e+t})),i=Math.sqrt(l);for(var a=0;a<t.length;a++){var s={qualityIndex:a,bitrate:t[a].bandwidth,state:{throughput:t[a].bandwidth/i,latency:0,rebuffer:0,switch:0}};r.push(s)}u=function(e){var t=[],n=function(e){for(var t=[],n=0;n<e;n++){var r=[Math.random()*d(),Math.random(),Math.random(),Math.random()];t.push(r)}return t}(Math.pow(e.length,2));t.push(n[0]);for(var r=[1,1,1,1],i=1;i<e.length;i++){for(var a=null,o=null,s=0;s<n.length;s++){for(var u=n[s],l=null,f=0;f<t.length;f++){var h=c(u,t[f],r);(null===l||h<l)&&(l=h)}(null===o||l>o)&&(a=u,o=l)}t.push(a)}for(var g=null,p=null,m=0;m<t.length;m++){for(var _=0,E=0;E<t.length;E++)m!==E&&(_+=c(t[m],t[E],r));(null===g||_>g)&&(g=_,p=m)}var y=[];y.push(t[p]),t.splice(p,1);for(;t.length>0;){for(var v=null,T=null,A=0;A<t.length;A++){var S=c(y[0],t[A],r);(null===v||S<v)&&(v=S,T=A)}y.push(t[T]),t.splice(T,1)}return y}(r)}var l;return r}(e),S=t/i;S>1&&(S=d()),f/=a,n.debug("getNextQuality called throughput:"+S+" latency:"+f+" bufferSize:"+h+" currentQualityIndex:"+_+" playbackRate:"+p);var b=A[_],I=b.bitrate*E.getSegmentDuration()/T,R=Math.max(0,I-v);if(v-I<E.getMinBuffer())return n.debug("Buffer is low for bitrate= "+b.bitrate+" downloadTime="+I+" currentBuffer="+v+" rebuffer="+R),function(e,t){var n=0,i=e;if(r)for(var a=0;a<r.length;a++){var o=r[a];o.bitrate<e.bitrate&&o.bitrate>n&&t>o.bitrate&&(n=o.bitrate,i=o)}return i}(b,T).qualityIndex;switch(l){case Ds:s=[.4,.4,.4,.4];break;case Os:!function(e){s=function(e,t){for(var n=[],r=Math.sqrt(2/e),i=0;i<t;i++)n.push(Math.random()*r);return s=n}(e.length,4)}(A);break;case Ps:m(E,A,y,v,R,T,p);break;default:m(E,A,y,v,R,T,p)}for(var w=null,N=null,M=null,C=0;C<A.length;C++){var D=A[C],O=D.state,P=[O.throughput,O.latency,O.rebuffer,O.switch],L=s.slice(),F=E.getNextBufferWithBitrate(D.bitrate,v,T),x=F<E.getMinBuffer();x&&n.debug("Buffer is low for bitrate="+D.bitrate+" downloadTime="+I+" currentBuffer="+v+" nextBuffer="+F),(D.bitrate>t-1e4||x)&&D.bitrate!==o&&(L[0]=100);var U=c(P,[S,0,0,0],L);(null===w||U<w)&&(w=U,N=D.qualityIndex,M=D)}var B=Math.abs(b.bitrate-M.bitrate)/i;return g(b,A,[S,f,R,B]),g(M,A,[S,0,0,B]),N},reset:function(){f()}},n=(0,Ms.default)(e).getInstance().getLogger(t),f(),t}Ls.__dashjs_factory_name="LearningAbrController";var Fs=Ns.default.getClassFactory(Ls),xs=Object.defineProperty({default:Fs},"__esModule",{value:!0});var Us=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},Bs=Object.defineProperty({default:Us},"__esModule",{value:!0}),ks=js(y),Gs=js(Bs);function js(e){return e&&e.__esModule?e:{default:e}}function Ys(){var e,t=void 0,n=void 0,r=void 0,i=void 0;function a(){t=null,n=null,r=null,i=null}function o(e,t,n,r){var i=new Gs.default;return i.type=e,i.weights.bitrateReward=t||1,i.weights.bitrateSwitchPenalty=1,i.weights.rebufferPenalty=n||1e3,i.weights.latencyPenalty=[],i.weights.latencyPenalty.push({threshold:1.1,penalty:.05*r}),i.weights.latencyPenalty.push({threshold:1e8,penalty:.1*n}),i.weights.playbackSpeedPenalty=r||200,i}function s(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<i.weights.latencyPenalty.length;a++){var o=i.weights.latencyPenalty[a];if(n<=o.threshold){i.latencyWSum+=o.penalty*n;break}}i.playbackSpeedWSum+=i.weights.playbackSpeedPenalty*Math.abs(1-r),i.totalQoe=i.bitrateWSum-i.bitrateSwitchWSum-i.rebufferWSum-i.latencyWSum-i.playbackSpeedWSum}return e={setupPerSegmentQoe:function(e,a,s){t=o("segment",e,a,s),n=e,r=a,i=s},logSegmentMetrics:function(e,n,r,i){t&&s(e,n,r,i,t)},getPerSegmentQoe:function(){return t},calculateSingleUseQoe:function(e,t,a,u){var l=null;return n&&r&&i&&(l=o("segment",n,r,i)),l?(s(e,t,a,u,l),l.totalQoe):0},reset:function(){a()}},a(),e}Ys.__dashjs_factory_name="LoLpQoeEvaluator";var qs=ks.default.getClassFactory(Ys),Hs=Object.defineProperty({default:qs},"__esModule",{value:!0}),Ks=function(e){return e&&e.__esModule?e:{default:e}}(y);function Vs(e){var t,n,r,i=e.targetLatency,a=e.bufferMin,o=e.segmentDuration,s=e.qoeEvaluator,u=void 0,l=void 0;function f(){return o}function d(e,t){var n=f();return t>n?e-n:e+n-t}return t={getMinBuffer:function(){return a},getSegmentDuration:f,getNextBufferWithBitrate:function(e,t,n){return d(t,e*o/n)},getNextBuffer:d,findWeightVector:function(e,t,n,r,f,c){var h=null,g=null,p=null,m=Math.abs(t-l);return e.forEach((function(e){u.forEach((function(r){r[0];var u=r[1],l=r[2],_=(r[3],e.bitrate*o/f),E=d(n,_),y=(0===l?10:1/l)*Math.max(1e-5,_-E),v=(0===u?10:1/u)*e.state.latency,T=s.calculateSingleUseQoe(e.bitrate,y,v,c);(null===h||T>h)&&function(e,t,n){if(e>i+n)return!1;return t>=a}(t,E,m)&&(h=T,g=r,p=e.bitrate)}))})),null===g&&null===p&&(g=-1),l=t,g}},n=[.2,.4,.6,.8,1],r=4,u=function e(t,r,i){if(i===r)return t;for(var a=t.length,o=0;o<a;o++)for(var s=t.shift(),u=0;u<n.length;u++)t.push(s.concat(n[u]));return e(t,r,i+1)}(n.map((function(e){return[e]})),r,1),l=0,t}Vs.__dashjs_factory_name="LoLpWeightSelector";var zs=Ks.default.getClassFactory(Vs),Ws=Object.defineProperty({default:zs},"__esModule",{value:!0}),Xs=ru(Q),Qs=ru(y),Zs=ru(xs),$s=ru(Hs),Js=ru(yo),eu=ru(_),tu=ru(Ws),nu=ru(d);function ru(e){return e&&e.__esModule?e:{default:e}}function iu(e){var t=(e=e||{}).dashMetrics,n=this.context,r=void 0,i=void 0,a=void 0,o=void 0;return i={getMaxIndex:function(e){try{var i=(0,Js.default)(n).create(),s=e.getMediaInfo().type,u=e.getAbrController(),l=e.getStreamInfo(),f=u.getQualityFor(s,l),d=e.getMediaInfo(),c=t.getCurrentBufferState(s),h=e.getScheduleController(),g=t.getCurrentBufferLevel(s,!0),p=l&&l.manifestInfo?l.manifestInfo.isDynamic:null,m=h.getPlaybackController(),_=m.getCurrentLiveLatency();if(!e.useLoLPABR()||s===nu.default.AUDIO)return i;_||(_=0);var E=m.getPlaybackRate(),y=u.getThroughputHistory().getSafeAverageThroughput(s,p);if(r.debug("Throughput "+Math.round(y)+" kbps"),isNaN(y)||!c)return i;if(u.getAbandonmentStateFor(s)===eu.default.ABANDON_LOAD)return i;for(var v=d.bitrateList,T=e.getRepresentationInfo().fragmentDuration,A=v[0].bandwidth/1e3,S=v[v.length-1].bandwidth/1e3,b=0;b<v.length;b++){var I=v[b].bandwidth/1e3;I>S?S=I:I<A&&(A=I)}var R=v[f].bandwidth/1e3,w=t.getCurrentHttpRequest(s,!0),N=(w.tresponse.getTime()-w.trequest.getTime())/1e3,M=N>T?N-T:0;o.setupPerSegmentQoe(T,S,A),o.logSegmentMetrics(R,M,_,E);var C=(0,tu.default)(n).create({targetLatency:1.5,bufferMin:.3,segmentDuration:T,qoeEvaluator:o});return i.quality=a.getNextQuality(d,1e3*y,_,g,E,f,C),i.reason={throughput:y,latency:_},i.priority=Js.default.PRIORITY.STRONG,h.setTimeToLoadDelay(0),i.quality!==f&&console.log("[TgcLearningRule]["+s+"] requesting switch to index: ",i.quality,"Average throughput",Math.round(y),"kbps"),i}catch(e){throw e}},reset:function(){a.reset(),o.reset()}},r=(0,Xs.default)(n).getInstance().getLogger(i),a=(0,Zs.default)(n).create(),o=(0,$s.default)(n).create(),i}iu.__dashjs_factory_name="LoLPRule";var au=Qs.default.getClassFactory(iu),ou=Object.defineProperty({default:au},"__esModule",{value:!0}),su=Eu(No),uu=Eu(ko),lu=Eu(Vo),fu=Eu(Jo),du=Eu(os),cu=Eu(ms),hu=Eu(ws),gu=Eu(ou),pu=Eu(y),mu=Eu(yo),_u=Eu(d);function Eu(e){return e&&e.__esModule?e:{default:e}}function yu(e){e=e||{};var t=this.context,n=e.mediaPlayerModel,r=e.dashMetrics,i=e.settings,a=void 0,o=void 0;function s(e){return e.filter((function(e){return e.quality>mu.default.NO_CHANGE}))}function u(e){var n,r={},i=null,a=void 0,o=void 0,s=void 0,u=void 0;if(0!==e.length){for(r[mu.default.PRIORITY.STRONG]={quality:mu.default.NO_CHANGE,reason:null},r[mu.default.PRIORITY.WEAK]={quality:mu.default.NO_CHANGE,reason:null},r[mu.default.PRIORITY.DEFAULT]={quality:mu.default.NO_CHANGE,reason:null},a=0,n=e.length;a<n;a+=1)(o=e[a]).quality!==mu.default.NO_CHANGE&&(r[o.priority].quality===mu.default.NO_CHANGE||r[o.priority].quality>o.quality)&&(r[o.priority].quality=o.quality,r[o.priority].reason=o.reason||null);return r[mu.default.PRIORITY.WEAK].quality!==mu.default.NO_CHANGE&&(i=r[mu.default.PRIORITY.WEAK]),r[mu.default.PRIORITY.DEFAULT].quality!==mu.default.NO_CHANGE&&(i=r[mu.default.PRIORITY.DEFAULT]),r[mu.default.PRIORITY.STRONG].quality!==mu.default.NO_CHANGE&&(i=r[mu.default.PRIORITY.STRONG]),i&&(s=i.quality,u=i.reason),(0,mu.default)(t).create(s,u)}}return{initialize:function(){a=[],o=[],i.get().streaming.abr.useDefaultABRRules&&(i.get().streaming.abr.ABRStrategy===_u.default.ABR_STRATEGY_L2A?a.push((0,hu.default)(t).create({dashMetrics:r,mediaPlayerModel:n,settings:i})):i.get().streaming.abr.ABRStrategy===_u.default.ABR_STRATEGY_LoLP?a.push((0,gu.default)(t).create({dashMetrics:r})):(a.push((0,cu.default)(t).create({dashMetrics:r,mediaPlayerModel:n,settings:i})),a.push((0,su.default)(t).create({dashMetrics:r})),a.push((0,uu.default)(t).create({dashMetrics:r})),a.push((0,du.default)(t).create()),a.push((0,fu.default)(t).create()),o.push((0,lu.default)(t).create({dashMetrics:r,mediaPlayerModel:n,settings:i})))),n.getABRCustomRules().forEach((function(e){"qualitySwitchRules"===e.type&&a.push(e.rule(t).create()),"abandonFragmentRules"===e.type&&o.push(e.rule(t).create())}))},reset:function(){[a,o].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),a=[],o=[]},getMaxQuality:function(e){return u(s(a.map((function(t){return t.getMaxIndex(e)}))))||(0,mu.default)(t).create()},getMinSwitchRequest:u,shouldAbandonFragment:function(e){return u(s(o.map((function(t){return t.shouldAbandon(e)}))))||(0,mu.default)(t).create()},getQualitySwitchRules:function(){return a}}}yu.__dashjs_factory_name="ABRRulesCollection";var vu=pu.default.getClassFactory(yu);vu.QUALITY_SWITCH_RULES="qualitySwitchRules",vu.ABANDON_FRAGMENT_RULES="abandonFragmentRules",pu.default.updateSingletonFactory(yu.__dashjs_factory_name,vu);var Tu=vu,Au=Object.defineProperty({default:Tu},"__esModule",{value:!0});var Su=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},bu=Object.defineProperty({default:Su},"__esModule",{value:!0}),Iu=function(e){return e&&e.__esModule?e:{default:e}}(y);function Ru(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,f=e.videoModel?e.videoModel:null;function d(){return l?l.mediaInfo:null}return{getMediaType:function(){var e=d();return e?e.type:null},getMediaInfo:d,getDroppedFramesHistory:function(){return r},getCurrentRequest:function(){return i},getSwitchHistory:function(){return n},getStreamInfo:function(){var e=d();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 f}}}Ru.__dashjs_factory_name="RulesContext";var wu=Iu.default.getClassFactory(Ru),Nu=Object.defineProperty({default:wu},"__esModule",{value:!0}),Mu=Du(y),Cu=Du(yo);function Du(e){return e&&e.__esModule?e:{default:e}}function Ou(){var e=[],t=[];return{push:function(n){n.newValue===Cu.default.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=[]}}}Ou.__dashjs_factory_name="SwitchRequestHistory";var Pu=Mu.default.getClassFactory(Ou),Lu=Object.defineProperty({default:Pu},"__esModule",{value:!0}),Fu=function(e){return e&&e.__esModule?e:{default:e}}(y);function xu(){var e=[],t=0,n=0;return{push:function(r,i){var a=i&&i.droppedVideoFrames?i.droppedVideoFrames:0,o=i&&i.totalVideoFrames?i.totalVideoFrames:0,s=a-t;t=a;var u=o-n;n=o,isNaN(r)||(e[r]?(e[r].droppedVideoFrames+=s,e[r].totalVideoFrames+=u):e[r]={droppedVideoFrames:s,totalVideoFrames:u})},getFrameHistory:function(){return e},reset:function(r){e=[],t=r.droppedVideoFrames,n=r.totalVideoFrames}}}xu.__dashjs_factory_name="DroppedFramesHistory";var Uu=Fu.default.getClassFactory(xu),Bu=Object.defineProperty({default:Uu},"__esModule",{value:!0}),ku=ju(d),Gu=ju(y);function ju(e){return e&&e.__esModule?e:{default:e}}function Yu(e){var t=(e=e||{}).settings,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0;function s(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 u(e,s,u){return t.get().streaming.abr.movingAverageMethod!==ku.default.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var n=e?o.throughputHalfLife:o.latencyHalfLife,r=e?i[t]:a[t];if(!r||r.totalWeight<=0)return NaN;var s=r.fastEstimate/(1-Math.pow(.5,r.totalWeight/n.fast)),u=r.slowEstimate/(1-Math.pow(.5,r.totalWeight/n.slow));return e?Math.min(s,u):Math.max(s,u)}(e,s):function(e,t,i){var a=function(e,t,i){var a=void 0,o=void 0;if(e?(a=n[t],o=i?3:4):(a=r[t],o=4),a){if(o>=a.length)o=a.length;else if(e)for(var s=1;s<o;++s){var u=a[a.length-s]/a[a.length-s-1];if((u>=1.3||u<=1/1.3)&&(o+=1)===a.length)break}}else o=0;return o}(e,t,i),o=(e?n:r)[t];if(0===a||!o||0===o.length)return NaN;return(o=o.slice(-a)).reduce((function(e,t){return e+t}))/o.length}(e,s,u)}function l(e,t){return u(!0,e,t)}function f(e){n[e]=n[e]||[],r[e]=r[e]||[],i[e]=i[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},a[e]=a[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function d(){n={},r={},i={},a={}}var c={push:function(e,u,l){if(u.trace&&u.trace.length){var d=u.tresponse.getTime()-u.trequest.getTime()||1,c=u._tfinish.getTime()-u.tresponse.getTime()||1,h=u.trace.reduce((function(e,t){return e+t.b[0]}),0),g=void 0;g=t.get().streaming.lowLatencyEnabled?u.trace.reduce((function(e,t){return e+t.d}),0):l?c:d+c;var p=Math.round(8*h/g);if(f(e),function(e,n,r){return e===ku.default.VIDEO?r<t.get().streaming.cacheLoadThresholds[ku.default.VIDEO]:e===ku.default.AUDIO?r<t.get().streaming.cacheLoadThresholds[ku.default.AUDIO]:void 0}(e,0,c)){if(n[e].length>0&&!n[e].hasCachedEntries)return;n[e].hasCachedEntries=!0}else n[e]&&n[e].hasCachedEntries&&function(e){delete n[e],delete r[e],delete i[e],delete a[e],f(e)}(e);n[e].push(p),n[e].length>20&&n[e].shift(),r[e].push(d),r[e].length>20&&r[e].shift(),s(i[e],p,.001*c,o.throughputHalfLife),s(a[e],d,1,o.latencyHalfLife)}},getAverageThroughput:l,getSafeAverageThroughput:function(e,n){var r=l(e,n);return isNaN(r)||(r*=t.get().streaming.abr.bandwidthSafetyFactor),r},getAverageLatency:function(e){return u(!1,e)},reset:d};return o={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},d(),c}Yu.__dashjs_factory_name="ThroughputHistory";var qu=Gu.default.getClassFactory(Yu),Hu=Object.defineProperty({default:qu},"__esModule",{value:!0}),Ku=al(Au),Vu=al(d),zu=al(_),Wu=al(bu),Xu=al(Ae),Qu=al(O),Zu=al(U),$u=al(y),Ju=al(Nu),el=al(yo),tl=al(Lu),nl=al(Bu),rl=al(Hu),il=al(Q);function al(e){return e&&e.__esModule?e:{default:e}}function ol(){var e=this.context,t=(0,il.default)(e).getInstance(),n=(0,Qu.default)(e).getInstance(),r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0;function N(){(a=(0,Ku.default)(e).create({dashMetrics:R,mediaPlayerModel:_,settings:w})).initialize()}function M(){s={},u={},f={},l={},v={},S={},b={},I={},void 0===c&&(c=!1),y=void 0,T=void 0,A=void 0,clearTimeout(d),d=null}function C(e){e.mediaType===Vu.default.VIDEO&&(void 0!==y&&T.push(y,m.getPlaybackQuality()),y=e.newQuality)}function D(e){e.metric!==zu.default.HTTP_REQUEST||!e.value||e.value.type!==de.HTTPRequest.MEDIA_SEGMENT_TYPE||e.mediaType!==Vu.default.AUDIO&&e.mediaType!==Vu.default.VIDEO||A.push(e.mediaType,e.value,w.get().streaming.abr.useDeadTimeLatency),e.metric!==zu.default.BUFFER_LEVEL||e.mediaType!==Vu.default.AUDIO&&e.mediaType!==Vu.default.VIDEO||function(e,t){var n=w.get().streaming.abr.ABRStrategy;if(n===Vu.default.ABR_STRATEGY_L2A)return S[e]=!1,I[e]=!1,void(b[e]=!0);if(n===Vu.default.ABR_STRATEGY_LoLP)return S[e]=!1,I[e]=!0,void(b[e]=!1);if(n===Vu.default.ABR_STRATEGY_BOLA)return S[e]=!0,I[e]=!1,void(b[e]=!1);if(n===Vu.default.ABR_STRATEGY_THROUGHPUT)return S[e]=!1,I[e]=!1,void(b[e]=!1);!function(e,t){var n=_.getStableBufferTime(),r=n,a=.5*n,o=S[e],s=t>(o?a:r);S[e]=s,s!==o&&(s?i.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+t.toFixed(3)+")."):i.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+t.toFixed(3)+")."))}(e,t)}(e.mediaType,.001*e.value.level)}function O(e,t){return s[t]=s[t]||{},s[t].hasOwnProperty(e)||(s[t][e]=0),function(e,t){if(t!==Vu.default.VIDEO||!w.get().streaming.abr.limitBitrateByPortal||!l[t])return e;c||H();var n=p.getAdaptationForType(0,t).Representation,r=e;if(h>0&&g>0){for(;r>0&&n[r]&&h<n[r].width&&h-n[r-1].width<n[r].width-h;)r-=1;for(;r<n.length-1&&n[r].width===n[r+1].width;)r+=1}return r}(function(e,t,n){var r=w.get().streaming.abr.maxRepresentationRatio[t];if(isNaN(r)||r>=1||r<0)return e;return Math.min(e,Math.round(n*r))}(function(e,t){var n=e;if(!l[t])return n;var r=L(t);void 0!==r&&(n=Math.max(e,r));var i=P(t);void 0!==i&&(n=Math.min(n,i));return n}(s[t][e],e),e,s[t][e]),e)}function P(e){var t=function(e){return w.get().streaming.abr.maxBitrate[e]}(e);return t>-1?B(l[e].getMediaInfo(),t):void 0}function L(e){var t=function(e){return w.get().streaming.abr.minBitrate[e]}(e);if(t>-1){var n=l[e].getMediaInfo(),r=k(n),i=B(n,t);return r[i]&&i<r.length-1&&r[i].bitrate<1e3*t&&i++,i}}function F(e,t,n,r){var i=t.id,a=q(e);(0,Je.checkInteger)(n);var o=O(e,i);n!==a&&n>=0&&n<=o&&x(e,a,n,o,r)}function x(e,t,r,a,o){if(e&&l[e]){var s=l[e].getStreamInfo(),f=s?s.id:null;if(w.get().debug.logLevel===il.default.LOG_LEVEL_DEBUG){var d=R.getCurrentBufferLevel(e);i.info("["+e+"] switch from "+t+" to "+r+"/"+a+" (buffer: "+d+") "+(o?JSON.stringify(o):"."))}!function(e,t,n){u[t]=u[t]||{},u[t][e]=n}(e,f,r),n.trigger(Zu.default.QUALITY_CHANGE_REQUESTED,{oldQuality:t,newQuality:r,reason:o},{streamId:s.id,mediaType:e});var c=A.getAverageThroughput(e);isNaN(c)||E.setSavedBitrateSettings(e,c)}}function U(e,t){f[e].state=t}function B(e,t,n){var r=e&&e.type?l[e.type].getRepresentationInfo():null;if(w.get().streaming.abr.useDeadTimeLatency&&n&&r&&r.fragmentDuration){n/=1e3;var i=r.fragmentDuration;if(n>i)return 0;t*=1-n/i}for(var a=k(e),o=a.length-1;o>=0;o--){if(1e3*t>=a[o].bitrate)return o}return 0}function k(e){var t=[];if(!e||!e.bitrateList)return t;for(var n=e.bitrateList,r=e.type,i=void 0,a=0,o=n.length;a<o;a++)(i=new Wu.default).mediaType=r,i.qualityIndex=a,i.bitrate=n[a].bandwidth,i.width=n[a].width,i.height=n[a].height,i.scanType=n[a].scanType,t.push(i);return t}function G(e){return S[e]}function j(e){return b[e]}function Y(e){return I[e]}function q(e){if(e&&l[e]){var t=l[e].getStreamInfo(),n=t?t.id:null;if(n)return u[n]=u[n]||{},u[n].hasOwnProperty(e)||(u[n][e]=0),u[n][e]}return 0}function H(){if(m){var e=w.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;h=m.getClientWidth()*e,g=m.getClientHeight()*e}}function K(t){var n=t.request.mediaType;if(w.get().streaming.abr.autoSwitchBitrate[n]){var i=l[n];if(!i)return;var s=(0,Ju.default)(e).create({abrController:r,streamProcessor:i,currentRequest:t.request,useBufferOccupancyABR:G(n),useL2AABR:j(n),useLoLPABR:Y(n),videoModel:m}),u=a.shouldAbandonFragment(s);if(u.quality>el.default.NO_CHANGE){var f=i.getFragmentModel();f.getRequests({state:Xu.default.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(f.abortRequests(),U(n,zu.default.ABANDON_LOAD),v[n].reset(),v[n].push({oldValue:q(n),newValue:u.quality,confidence:1,reason:u.reason}),F(n,o.getActiveStreamInfo(),u.quality,u.reason),clearTimeout(d),d=setTimeout((function(){U(n,zu.default.ALLOW_LOAD),d=null}),w.get().streaming.abandonLoadTimeout))}}}return r={isPlayingAtTopQuality:function(e){var t=e?e.id:null,n=q(Vu.default.AUDIO),r=q(Vu.default.VIDEO);return n===O(Vu.default.AUDIO,t)&&r===O(Vu.default.VIDEO,t)},updateTopQualityIndex:function(e){var t=e.type,n=e.streamInfo.id,r=e.representationCount-1;return function(e,t,n){s[t]=s[t]||{},s[t][e]=n}(t,n,r),r},getThroughputHistory:function(){return A},getBitrateList:k,getQualityForBitrate:B,getTopBitrateInfoFor:function(e){if(e&&l&&l[e]){var t=l[e].getStreamInfo();if(t&&t.id){var n=O(e,t.id),r=k(l[e].getMediaInfo());return r[n]?r[n]:null}}return null},getMaxAllowedIndexFor:P,getMinAllowedIndexFor:L,getInitialBitrateFor:function(e){if(function(){if(!E||!E.hasOwnProperty("getSavedBitrateSettings"))throw new Error(Vu.default.MISSING_CONFIG_ERROR)}(),e===Vu.default.TEXT||e===Vu.default.FRAGMENTED_TEXT)return NaN;var t=E.getSavedBitrateSettings(e),n=w.get().streaming.abr.initialBitrate[e],r=w.get().streaming.abr.initialRepresentationRatio[e];if(-1===n)if(r>-1){var i=p.getAdaptationForType(0,e).Representation;if(Array.isArray(i))n=i[Math.max(Math.round(i.length*r)-1,0)].bandwidth;else n=0}else n=isNaN(t)?e===Vu.default.VIDEO?1e3:100:t;return n},getQualityFor:q,getAbandonmentStateFor:function(e){return f[e]?f[e].state:null},setPlaybackQuality:F,checkPlaybackQuality:function(t){if(t&&l&&l[t]){var n=l[t].getStreamInfo(),o=n?n.id:null,s=q(t),u=(0,Ju.default)(e).create({abrController:r,streamProcessor:l[t],currentValue:s,switchHistory:v[t],droppedFramesHistory:T,useBufferOccupancyABR:G(t),useL2AABR:j(t),useLoLPABR:Y(t),videoModel:m});if(T){var d=m.getPlaybackQuality();d&&T.push(y,d)}if(w.get().streaming.abr.autoSwitchBitrate[t]){var c=L(t),h=O(t,o),g=a.getMaxQuality(u),p=g.quality;if(void 0!==c&&(p>el.default.NO_CHANGE?p:s)<c&&(p=c),p>h&&(p=h),v[t].push({oldValue:s,newValue:p}),p>el.default.NO_CHANGE&&p!=s)(f[t].state===zu.default.ALLOW_LOAD||p>s)&&x(t,s,p,h,g.reason);else if(w.get().debug.logLevel===il.default.LOG_LEVEL_DEBUG){var _=R.getCurrentBufferLevel(t,!0);i.debug("["+t+"] stay on "+s+"/"+h+" (buffer: "+_+")")}}}},getTopQualityIndexFor:O,setElementSize:H,setWindowResizeEventCalled:function(e){c=e},createAbrRulesCollection:N,registerStreamType:function(t,i){v[t]=v[t]||(0,tl.default)(e).create(),l[t]=i,f[t]=f[t]||{},f[t].state=zu.default.ALLOW_LOAD,S[t]=!1,b[t]=!1,I[t]=!1,n.on(Zu.default.LOADING_PROGRESS,K,r),t===Vu.default.VIDEO&&(n.on(Zu.default.QUALITY_CHANGE_RENDERED,C,r),T=T||(0,nl.default)(e).create(),H()),n.on(Zu.default.METRIC_ADDED,D,r),n.on(Zu.default.PERIOD_SWITCH_COMPLETED,N,r),A=A||(0,rl.default)(e).create({settings:w})},unRegisterStreamType:function(e){delete l[e]},setConfig:function(e){e&&(e.streamController&&(o=e.streamController),e.domStorage&&(E=e.domStorage),e.mediaPlayerModel&&(_=e.mediaPlayerModel),e.dashMetrics&&(R=e.dashMetrics),e.adapter&&(p=e.adapter),e.videoModel&&(m=e.videoModel),e.settings&&(w=e.settings))},reset:function(){M(),n.off(Zu.default.LOADING_PROGRESS,K,r),n.off(Zu.default.QUALITY_CHANGE_RENDERED,C,r),n.off(Zu.default.METRIC_ADDED,D,r),n.off(Zu.default.PERIOD_SWITCH_COMPLETED,N,r),a&&a.reset()}},i=t.getLogger(r),M(),r}ol.__dashjs_factory_name="AbrController";var sl=$u.default.getSingletonFactory(ol);sl.QUALITY_DEFAULT=0,$u.default.updateSingletonFactory(ol.__dashjs_factory_name,sl);var ul=sl,ll=Object.defineProperty({default:ul},"__esModule",{value:!0}),fl=function(e){return e&&e.__esModule?e:{default:e}}(y);function dl(){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={}}}}dl.__dashjs_factory_name="InitCache";var cl=fl.default.getSingletonFactory(dl),hl=Object.defineProperty({default:cl},"__esModule",{value:!0}),gl=wl(d),pl=wl(_),ml=wl(Ae),_l=wl(oo),El=wl(ho),yl=wl(ll),vl=wl(O),Tl=wl(U),Al=wl(y),Sl=wl(Q),bl=wl(hl),Il=wl(be),Rl=wl(na);function wl(e){return e&&e.__esModule?e:{default:e}}function Nl(e){e=e||{};var t=this.context,n=(0,vl.default)(t).getInstance(),r=e.errHandler,i=e.fragmentModel,a=e.representationController,o=e.mediaController,s=e.adapter,u=e.textController,l=e.abrController,f=e.playbackController,d=e.streamInfo,c=e.type,h=e.settings,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0,M=void 0,C=void 0,D=void 0,O=void 0,P=void 0,L=void 0,F=void 0,x=void 0;function U(e){return s.convertDataToRepresentationInfo(a.getRepresentationForQuality(e))}function B(e,n){if(!D||!e)return null;var a=e[0];if(v)try{S=n&&n[c]?(0,_l.default)(t).create(v,a,q.bind(this),n[c]):(0,_l.default)(t).create(v,a,q.bind(this),null),h.get().streaming.useAppendWindow&&S.updateAppendWindow(d),"function"==typeof S.getBuffer().initialize&&S.getBuffer().initialize(c,d,e,i)}catch(e){p.fatal("Caught error on create SourceBuffer: "+e),r.error(new Il.default(Rl.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,Rl.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+c))}else S=(0,El.default)(t).create(q.bind(this));return ae(U(m)),S}function k(e){p.info("Init fragment finished loading saving to",c+"'s init cache"),D.save(e.chunk),p.debug("Append Init fragment",c," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),j(e.chunk)}function G(e){var t=e.chunk;if(F){x=t;var n=S&&S.getAllBufferRanges();n&&n.length>0&&f.getTimeToStreamEnd()>h.get().streaming.stallThreshold&&(p.debug("Clearing buffer because track changed - "+(n.end(n.length-1)+.5)),ne([{start:0,end:n.end(n.length-1)+.5,force:!0}]))}else j(t)}function j(e){S.append(e),e.mediaInfo.type===gl.default.VIDEO&&pe(Tl.default.VIDEO_CHUNK_RECEIVED,{chunk:e})}function Y(e){if(e&&e.length>0)for(var t=0,n=e.length;t<n;t++)p.debug("Buffered range: "+e.start(t)+" - "+e.end(t)+", currentTime = ",f.getTime())}function q(e){if(e.error){if(22===e.error.code&&(C=!0,y=.8*he(),p.warn("Quota exceeded, Critical Buffer: "+y),y>0)){var t=Math.max(.2*y,1),n=y-t,r=Math.min(h.get().streaming.bufferTimeAtTopQuality,.9*n),i=Math.min(h.get().streaming.bufferTimeAtTopQualityLongForm,.9*n),o={streaming:{bufferToKeep:parseFloat(t.toFixed(5)),bufferTimeAtTopQuality:parseFloat(r.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(i.toFixed(5))}};h.update(o)}22!==e.error.code&&ge()||(p.warn("Clearing playback buffer to overcome quota exceed situation"),pe(Tl.default.QUOTA_EXCEEDED,{criticalBufferLevel:y,quotaExceededTime:e.chunk.start}),ne(te()))}else{C=!1,(w=e.chunk)&&!isNaN(w.index)&&(T=Math.max(w.index,T),$());var s=S.getAllBufferRanges();if(w.segmentType===de.HTTPRequest.MEDIA_SEGMENT_TYPE)Y(s),z(),function(){if(c!==gl.default.AUDIO&&c!==gl.default.VIDEO)return;if(isNaN(O))return;var e=f.getTime(),t=Q(O,0);if(e===O&&t)return;var n=a.getCurrentRepresentation().segmentDuration;if(!(t=Q(O,n)))return;Math.abs(e-O)>n?O<=t.end&&(f.seek(Math.max(O,t.start),!1,!0),O=NaN):e<t.start&&(f.seek(t.start,!1,!0),O=NaN)}();else if(F){var u=f.getTime();p.debug("AppendToBuffer seek target should be "+u),pe(Tl.default.SEEK_TARGET,{time:u})}var l=!1;I&&(I.indexOf(w)>0&&(l=!0),I=null),w&&!l&&pe(w.endFragment?Tl.default.BYTES_APPENDED_END_FRAGMENT:Tl.default.BYTES_APPENDED,{quality:w.quality,startTime:w.start,index:w.index,bufferedRanges:s,mediaType:c})}}function H(e){m!==e.newQuality&&(ae(this.getRepresentationInfo(e.newQuality)),m=e.newQuality)}function K(e){S&&(O=e.seekTime,_&&(P=!0,_=!1,A=Number.POSITIVE_INFINITY),c!==gl.default.FRAGMENTED_TEXT?function(){if(!S)return;S.waitForUpdateEnd((function(){var e=function(){if(!S)return;var e=[],t=S.getAllBufferRanges();if(!t||0===t.length)return e;var n=f.getTime(),r=t.end(t.length-1)+.5,a=i.getRequests({state:ml.default.FRAGMENT_MODEL_EXECUTED,time:n,threshold:.01})[0];if(a){var o={start:0,end:a.startTime-h.get().streaming.stallThreshold},s=i.getRequests({state:ml.default.FRAGMENT_MODEL_EXECUTED,time:a.startTime-a.duration/2,threshold:.01})[0];s&&s.startTime!=a.startTime&&(o.end=s.startTime),o.start<o.end&&o.end>t.start(0)&&e.push(o);var u={start:a.startTime+a.duration+h.get().streaming.stallThreshold,end:r},l=i.getRequests({state:ml.default.FRAGMENT_MODEL_EXECUTED,time:a.startTime+a.duration+h.get().streaming.stallThreshold,threshold:.01})[0];l&&l.startTime!==a.startTime&&(u.start=l.startTime+l.duration+h.get().streaming.stallThreshold),u.start<u.end&&u.start<r&&e.push(u)}else p.debug("getAllRangesWithSafetyFactor - No request found in current time position, removing full buffer 0 -",r),e.push({start:0,end:r});return e}();e&&0!==e.length||z(),ne(e)}))}():z())}function V(){O=NaN}function z(){(!F||c===gl.default.FRAGMENTED_TEXT&&u.isTextEnabled())&&Z()}function W(){J()}function X(){O=NaN,J()}function Q(e,t){var n=S.getAllBufferRanges(),r=0,i=0,a=null,o=null,s=0,u=void 0,l=void 0,f=isNaN(t)?.15:t;if(null!=n){for(l=0,u=n.length;l<u;l++)if(r=n.start(l),i=n.end(l),null===a)s=Math.abs(r-e),(e>=r&&e<i||s<=f)&&(a=r,o=i);else{if(!((s=r-o)<=f))break;o=i}if(null!==a)return{start:a,end:o}}return null}function Z(){var e,t,n;f&&(e=(isNaN(O)?f.getTime():O)||0,h.get().streaming.jumpGaps&&(t=h.get().streaming.smallGapLimit),E=null===(n=Q(e,t))?0:n.end-e,pe(Tl.default.BUFFER_LEVEL_UPDATED,{bufferLevel:E}),J())}function $(){T>=A-1&&!_&&void 0===S.discharge&&(_=!0,p.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for "+c),pe(Tl.default.BUFFERING_COMPLETED))}function J(){c!==gl.default.AUDIO&&c!==gl.default.VIDEO||(P&&!_&&E>0&&f&&f.getTimeToStreamEnd()-E<.1&&(P=!1,_=!0,p.debug("checkIfSufficientBuffer trigger BUFFERING_COMPLETED for type "+c),pe(Tl.default.BUFFERING_COMPLETED)),(!h.get().streaming.lowLatencyEnabled&&E<h.get().streaming.stallThreshold||0===E)&&!_?ee(pl.default.BUFFER_EMPTY):(_||E>=d.manifestInfo.minBufferTime)&&ee(pl.default.BUFFER_LOADED))}function ee(e){R===e||e===pl.default.BUFFER_EMPTY&&0===f.getTime()||c===gl.default.FRAGMENTED_TEXT&&!u.isTextEnabled()||(R=e,pe(Tl.default.BUFFER_LEVEL_STATE_CHANGED,{state:e}),pe(e===pl.default.BUFFER_LOADED?Tl.default.BUFFER_LOADED:Tl.default.BUFFER_EMPTY),p.debug(e===pl.default.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function te(){var e=[],t=S.getAllBufferRanges();if(!t||0===t.length)return e;var n=f.getTime(),r=Math.max(0,n-h.get().streaming.bufferToKeep),a=i.getRequests({state:ml.default.FRAGMENT_MODEL_EXECUTED,time:n,threshold:.01})[0];if(a)r=Math.min(a.startTime,r);else if(0===n&&f.getIsDynamic())return[];if(t.start(0)<=r){for(var o={start:0,end:r},s=0;s<t.length&&t.end(s)<=r;s++)o.end=t.end(s);o.start<o.end&&e.push(o)}return e}function ne(e){e&&S&&0!==e.length&&(L.push.apply(L,e),M||re())}function re(){if(0===L.length||!S)return p.debug("Nothing to prune, halt pruning"),L=[],void(M=!1);var e=S.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return p.debug("SourceBuffer is empty (or does not exist), halt pruning"),L=[],void(M=!1);var t=L.shift();p.debug("Removing buffer from:",t.start,"to",t.end),M=!0,f.getTime()<t.end&&(_=!1,T=0),S.remove(t.start,t.end,t.force)}function ie(e){S===e.buffer&&(p.debug("onRemoved buffer from:",e.from,"to",e.to),Y(S.getAllBufferRanges()),0===L.length&&(M=!1),e.unintended&&(p.warn("Detected unintended removal from:",e.from,"to",e.to,"setting index handler time to",e.from),pe(Tl.default.SEEK_TARGET,{time:e.from,mediaType:c,streamId:d.id})),M?re():(F?(F=!1,x&&j(x)):Z(),pe(Tl.default.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:ge(),quotaExceeded:C})))}function ae(e){e&&void 0!==e.MSETimeOffset&&S&&S.updateTimestampOffset&&S.updateTimestampOffset(e.MSETimeOffset)}function oe(e){e.error||_||ae(e.currentRepresentation)}function se(e){A=e.request.index,$()}function ue(e){if(e.newMediaInfo.streamInfo.id===d.id&&e.newMediaInfo.type===c){var t=S&&S.getAllBufferRanges();t&&(p.info("Track change asked"),o.getSwitchMode(c)===gl.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&t&&t.length>0&&f.getTimeToStreamEnd()>h.get().streaming.stallThreshold&&(_=!1,A=Number.POSITIVE_INFINITY))}}function le(){++N*(h.get().streaming.wallclockTimeUpdateInterval/1e3)>=h.get().streaming.bufferPruningInterval&&(N=0,S&&c!==gl.default.FRAGMENTED_TEXT&&(_||ne(te())))}function fe(){J()}function ce(e,t){v=e,S&&t&&"function"==typeof S.discharge&&(b=S,B(t))}function he(){var e,t=S.getAllBufferRanges(),n=0,r=void 0;if(!t)return n;for(r=0,e=t.length;r<e;r++)n+=t.end(r)-t.start(r);return n}function ge(){return he()<y}function pe(e,t){var r=t||{};n.trigger(e,r,{streamId:d.id,mediaType:c})}function me(e,t){y=Number.POSITIVE_INFINITY,R=void 0,m=yl.default.QUALITY_DEFAULT,A=Number.POSITIVE_INFINITY,T=0,w=null,_=!1,M=!1,C=!1,P=!1,E=0,N=0,L=[],O=NaN,S&&(e||S.abort(),S.reset(t),S=null),F=!1}return g={initialize:function(e){ce(e),m=l.getQualityFor(c),n.on(Tl.default.DATA_UPDATE_COMPLETED,oe,this),n.on(Tl.default.INIT_FRAGMENT_LOADED,k,this),n.on(Tl.default.MEDIA_FRAGMENT_LOADED,G,this),n.on(Tl.default.QUALITY_CHANGE_REQUESTED,H,this),n.on(Tl.default.STREAM_COMPLETED,se,this),n.on(Tl.default.PLAYBACK_PLAYING,X,this),n.on(Tl.default.PLAYBACK_PROGRESS,z,this),n.on(Tl.default.PLAYBACK_TIME_UPDATED,z,this),n.on(Tl.default.PLAYBACK_RATE_CHANGED,fe,this),n.on(Tl.default.PLAYBACK_SEEKING,K,this),n.on(Tl.default.PLAYBACK_SEEKED,V,this),n.on(Tl.default.PLAYBACK_STALLED,W,this),n.on(Tl.default.WALLCLOCK_TIME_UPDATED,le,this),n.on(Tl.default.CURRENT_TRACK_CHANGED,ue,this,{priority:vl.default.EVENT_PRIORITY_HIGH}),n.on(Tl.default.SOURCEBUFFER_REMOVE_COMPLETED,ie,this)},getStreamId:function(){return d.id},getType:function(){return c},getBufferControllerType:function(){return"BufferController"},getRepresentationInfo:U,createBuffer:B,dischargePreBuffer:function(){if(S&&b&&"function"==typeof b.discharge){var e=b.getAllBufferRanges();if(e.length>0){for(var t="Beginning "+c+"PreBuffer discharge, adding buffer for:",n=0;n<e.length;n++)t+=" start: "+e.start(n)+", end: "+e.end(n)+";";p.debug(t)}else p.debug("PreBuffer discharge requested, but there were no media segments in the PreBuffer.");I=[];for(var r=b.discharge(),i=null,a=0;a<r.length;a++){var o=r[a];if("InitializationSegment"!==o.segmentType){var s=D.extract(o.streamId,o.representationId);s&&i!==s&&(I.push(s),S.append(s),i=s)}I.push(o),S.append(o)}b.reset(),b=null}},getBuffer:function(){return S},setBuffer:function(e){S=e},getBufferLevel:function(){return E},getRangeAt:Q,setMediaSource:ce,getMediaSource:function(){return v},appendInitSegment:function(e){var t=D.extract(d.id,e);return!!t&&(p.info("Append Init fragment",c," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),j(t),!0)},replaceBuffer:function(){F=!0},getIsBufferingCompleted:function(){return _},getIsPruningInProgress:function(){return M},reset:function(e,t){n.off(Tl.default.DATA_UPDATE_COMPLETED,oe,this),n.off(Tl.default.INIT_FRAGMENT_LOADED,k,this),n.off(Tl.default.MEDIA_FRAGMENT_LOADED,G,this),n.off(Tl.default.QUALITY_CHANGE_REQUESTED,H,this),n.off(Tl.default.STREAM_COMPLETED,se,this),n.off(Tl.default.PLAYBACK_PLAYING,X,this),n.off(Tl.default.PLAYBACK_PROGRESS,z,this),n.off(Tl.default.PLAYBACK_TIME_UPDATED,z,this),n.off(Tl.default.PLAYBACK_RATE_CHANGED,fe,this),n.off(Tl.default.PLAYBACK_SEEKING,K,this),n.off(Tl.default.PLAYBACK_SEEKED,V,this),n.off(Tl.default.PLAYBACK_STALLED,W,this),n.off(Tl.default.WALLCLOCK_TIME_UPDATED,le,this),n.off(Tl.default.CURRENT_TRACK_CHANGED,ue,this),n.off(Tl.default.SOURCEBUFFER_REMOVE_COMPLETED,ie,this),me(e,t)},updateAppendWindow:function(){S&&!_&&S.updateAppendWindow(d)}},p=(0,Sl.default)(t).getInstance().getLogger(g),D=(0,bl.default)(t).getInstance(),me(),g}Nl.__dashjs_factory_name="BufferController";var Ml=Al.default.getClassFactory(Nl),Cl=Object.defineProperty({default:Ml},"__esModule",{value:!0}),Dl=Gl(d),Ol=Gl(O),Pl=Gl(U),Ll=Gl(y),Fl=Gl(hl),xl=Gl(oo),Ul=Gl(Xa),Bl=Gl(be),kl=Gl(na);function Gl(e){return e&&e.__esModule?e:{default:e}}function jl(e){e=e||{};var t=this.context,n=(0,Ol.default)(t).getInstance(),r=(0,Ul.default)(t).getInstance(),i=e.errHandler,a=e.streamInfo,o=e.type,s=e.mimeType,u=e.fragmentModel,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0;function p(e){c=e}function m(e){null===g.extract(a.id,e.currentRepresentation.id)&&(f=!1,n.trigger(Pl.default.INIT_FRAGMENT_NEEDED,{representationId:e.currentRepresentation.id,sender:l},{streamId:a.id,mediaType:o}))}function _(e){e.chunk.bytes&&(g.save(e.chunk),h.append(e.chunk),f=!0,n.trigger(Pl.default.STREAM_COMPLETED,{request:e.request},{streamId:a.id,mediaType:o}))}return l={getBufferControllerType:function(){return"NotFragmentedTextBufferController"},initialize:function(e){p(e),g=(0,Fl.default)(t).getInstance()},createBuffer:function(e){var n=e[0];try{if(h=(0,xl.default)(t).create(c,n),!d){var l=h.getBuffer();l.hasOwnProperty(Dl.default.INITIALIZE)&&l.initialize(s,a,e,u),d=!0}return h}catch(e){if(n&&(n.isText||-1!==n.codec.indexOf('codecs="stpp')||-1!==n.codec.indexOf('codecs="wvtt')))try{h=r.getTextSourceBuffer()}catch(e){i.error(new Bl.default(kl.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,kl.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+o+" : "+e.message))}else i.error(new Bl.default(kl.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,kl.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+o))}},getStreamId:function(){return a.id},getType:function(){return o},getBuffer:function(){return h},getBufferLevel:function(){return 0},setMediaSource:p,getMediaSource:function(){return c},getIsBufferingCompleted:function(){return f},getIsPruningInProgress:function(){return!1},dischargePreBuffer:function(){},appendInitSegment:function(e){return null!==g.extract(a.id,e)},getRangeAt:function(){return null},reset:function(e){n.off(Pl.default.DATA_UPDATE_COMPLETED,m,l),n.off(Pl.default.INIT_FRAGMENT_LOADED,_,l),!e&&h&&(h.abort(),h.reset(),h=null)},updateTimestampOffset:function(e){h.timestampOffset===e||isNaN(e)||(h.timestampOffset=e)}},d=!1,c=null,f=!1,n.on(Pl.default.DATA_UPDATE_COMPLETED,m,l),n.on(Pl.default.INIT_FRAGMENT_LOADED,_,l),l}jl.__dashjs_factory_name="NotFragmentedTextBufferController";var Yl=Ll.default.getClassFactory(jl),ql=Object.defineProperty({default:Yl},"__esModule",{value:!0}),Hl=Wl(d),Kl=Wl(y),Vl=Wl(Cl),zl=Wl(ql);function Wl(e){return e&&e.__esModule?e:{default:e}}function Xl(e){e=e||{};var t,n=this.context,r=void 0;function i(){return r.getBuffer()}return t={getBufferControllerType:function(){return r.getBufferControllerType()},initialize:function(e,t){return r.initialize(e,t)},createBuffer:function(e,t){return r.createBuffer(e,t)},getType:function(){return r.getType()},getBuffer:i,setBuffer:function(e){r.setBuffer(e)},getBufferLevel:function(){return r.getBufferLevel()},setMediaSource:function(e){r.setMediaSource(e)},getMediaSource:function(){return r.getMediaSource()},getIsBufferingCompleted:function(){return r.getIsBufferingCompleted()},getIsPruningInProgress:function(){return r.getIsPruningInProgress()},dischargePreBuffer:function(){return r.dischargePreBuffer()},appendInitSegment:function(e){r.appendInitSegment(e)},getRangeAt:function(e){return r.getRangeAt(e)},reset:function(e){r.reset(e)},updateTimestampOffset:function(e){var t=i();t.timestampOffset===e||isNaN(e)||(t.timestampOffset=e)},updateAppendWindow:function(){r.updateAppendWindow()},getRepresentationInfo:function(e){return r.getRepresentationInfo(e)}},r=e.type===Hl.default.FRAGMENTED_TEXT?(0,Vl.default)(n).create({streamInfo:e.streamInfo,type:e.type,mediaPlayerModel:e.mediaPlayerModel,manifestModel:e.manifestModel,fragmentModel:e.fragmentModel,errHandler:e.errHandler,mediaController:e.mediaController,representationController:e.representationController,adapter:e.adapter,textController:e.textController,abrController:e.abrController,playbackController:e.playbackController,settings:e.settings}):(0,zl.default)(n).create({streamInfo:e.streamInfo,type:e.type,mimeType:e.mimeType,fragmentModel:e.fragmentModel,errHandler:e.errHandler}),t}Xl.__dashjs_factory_name="TextBufferController";var Ql=Kl.default.getClassFactory(Xl),Zl=Object.defineProperty({default:Ql},"__esModule",{value:!0}),$l=tf(d),Jl=tf(y),ef=tf(_);function tf(e){return e&&e.__esModule?e:{default:e}}function nf(e){var t=(e=e||{}).dashMetrics,n=e.mediaPlayerModel,r=e.textController,i=e.abrController,a=e.settings;function o(e,o,s){var u=NaN;if(!e||!o)return u;if(e===$l.default.FRAGMENTED_TEXT)if(r.isTextEnabled())if(isNaN(o.fragmentDuration)){var l=t.getCurrentSchedulingInfo(ef.default.SCHEDULING_INFO);u=l?l.duration:0}else u=o.fragmentDuration;else u=0;else if(e===$l.default.AUDIO&&s){var f=t.getCurrentBufferLevel($l.default.VIDEO);u=isNaN(o.fragmentDuration)?f:Math.max(f,o.fragmentDuration)}else{var d=o.mediaInfo.streamInfo;if(i.isPlayingAtTopQuality(d))u=d.manifestInfo.duration>=a.get().streaming.longFormContentDurationThreshold?a.get().streaming.bufferTimeAtTopQualityLongForm:a.get().streaming.bufferTimeAtTopQuality;else u=n.getStableBufferTime()}return u}return{execute:function(e,n,r){return!e||!n||t.getCurrentBufferLevel(e)<o(e,n,r)},getBufferTarget:o}}nf.__dashjs_factory_name="BufferLevelRule";var rf=Jl.default.getClassFactory(nf),af=Object.defineProperty({default:rf},"__esModule",{value:!0}),of=gf(d),sf=gf(_),uf=gf(af),lf=gf(Ae),ff=gf(O),df=gf(U),cf=gf(y),hf=gf(Q);function gf(e){return e&&e.__esModule?e:{default:e}}function pf(e){e=e||{};var t=this.context,n=(0,ff.default)(t).getInstance(),r=e.adapter,i=e.dashMetrics,a=e.mediaPlayerModel,o=e.fragmentModel,s=e.abrController,u=e.playbackController,l=e.textController,f=e.type,d=e.mimeType,c=e.mediaController,h=e.bufferController,g=e.settings,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0,M=void 0,C=void 0,D=void 0,O=void 0,P=void 0,L=void 0;function F(){return!1===y}function x(){m&&(F()||E&&!h.getIsBufferingCompleted()&&(_.debug("Schedule Controller starts"),y=!1,i.createPlaylistTraceMetrics(E.id,1e3*u.getTime(),u.getPlaybackRate()),k(0)))}function U(){y||(_.debug("Schedule Controller stops"),_.debug(f+" Schedule Controller stops"),y=!0,clearTimeout(A))}function B(){if(m)if(y||v||u.isPaused()&&!g.get().streaming.scheduleWhilePaused||(f===of.default.FRAGMENTED_TEXT||f===of.default.TEXT)&&!l.isTextEnabled()||h.getIsBufferingCompleted())U();else{!function(){if(!isNaN(S))return;if(!N)return;var e=u.getTime(),t=1.5;if(isNaN(N.fragmentDuration)){var n=i.getCurrentSchedulingInfo(E.mediaInfo.type);t=n?1.5*n.duration:1.5}var a=o.getRequests({state:lf.default.FRAGMENT_MODEL_EXECUTED,time:e+t,threshold:0})[0];if(a&&-1===M.indexOf(a)&&!r.getIsTextTrack(d)){var l=g.get().streaming.fastSwitchEnabled,p=h.getBufferLevel(),m=s.getAbandonmentStateFor(f),y=!c.isCurrentTrack(a.mediaInfo)&&c.getSwitchMode(a.mediaInfo.type)===of.default.TRACK_SWITCH_MODE_NEVER_REPLACE,v=a.quality<N.quality;l&&(y||v)&&p>=t&&m!==sf.default.ABANDON_LOAD?(j(a),L=!0,_.debug("Reloading outdated fragment at index: ",a.index)):a.quality>N.quality&&!D&&ne(u.getTime()+p)}}();var e=M.length>0,t=N?N.quality:NaN;if(D||isNaN(t)||C||e||function(e,t){w[t]=w[t]||{};var n=s.getTopQualityIndexFor(e,t);return w[t][e]!=n&&(_.info("Top quality "+e+" index has changed from "+w[t][e]+" to "+n),w[t][e]=n,!0)}(f,m.id)||I.execute(f,E,b)){G(!0),!e&&P&&s.checkPlaybackQuality(f),function(){if(E.quality===t&&!C||D){var e=M.shift();e&&e.isInitializationRequest()?(n.trigger(df.default.INIT_FRAGMENT_NEEDED,{representationId:e.representationId,sender:p},{streamId:m.id,mediaType:f}),P=!1):(n.trigger(df.default.MEDIA_FRAGMENT_NEEDED,{seekTarget:S,replacement:e},{streamId:m.id,mediaType:f}),P=!0)}else C?(_.debug("Switch track for "+f+", representation id = "+E.id),(D=c.getSwitchMode(f)===of.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE)&&h.replaceBuffer&&h.replaceBuffer(),C=!1):_.debug("Quality has changed, get init request for representationid = "+E.id),n.trigger(df.default.INIT_FRAGMENT_NEEDED,{representationId:E.id,sender:p},{streamId:m.id,mediaType:f}),P=!1}()}else k(500)}}function k(e){clearTimeout(A),A=setTimeout(B,e)}function G(e){v!==e?v=e:_.debug("isFragmentProcessingInProgress is already equal to",e)}function j(e){M.push(e)}function Y(e){if(u&&o){var t=o.getRequests({state:lf.default.FRAGMENT_MODEL_EXECUTED,time:u.getTime(),threshold:0})[0];t&&u.getTime()>=t.startTime&&((!R.mediaInfo||t.mediaInfo.type===R.mediaInfo.type&&t.mediaInfo.id!==R.mediaInfo.id)&&e&&n.trigger(df.default.TRACK_CHANGE_RENDERED,{mediaType:f,oldMediaInfo:R.mediaInfo,newMediaInfo:t.mediaInfo}),t.quality===R.quality&&t.adaptationIndex===R.adaptationIndex||!e||n.trigger(df.default.QUALITY_CHANGE_RENDERED,{mediaType:f,oldQuality:R.quality,newQuality:t.quality}),R={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function q(){U(),G(!1),_.info("Stream "+m.id+" is complete")}function H(e){e.request.mediaInfo.streamInfo.id===m.id&&e.request.mediaType===f&&(_.info("OnFragmentLoadingCompleted - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),r.getIsTextTrack(d)&&G(!1),e.error&&e.request.serviceLocation&&!y&&(j(e.request),G(!1),k(0)),D&&(O=e.request))}function K(){Y(!0)}function V(e){if(D&&!isNaN(e.startTime)&&(D=!1,o.addExecutedRequest(O)),G(!1),isNaN(e.index)&&(N=h.getRepresentationInfo(e.quality),_.info("["+f+"] lastInitializedRepresentationInfo changed to "+e.quality)),L&&!isNaN(e.startTime)){var t=u.getTime(),n=e.startTime+E.fragmentDuration,r=1.5*E.fragmentDuration;k(t+r>=n?0:1e3*(n-(t+r))),L=!1}else k(0)}function z(e){_.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),u.isSeeking()||C||(_.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),j(e.request)),G(!1),k(0)}function W(){}function X(){U()}function Q(e){D&&g.get().streaming.flushBufferAtTrackSwitch&&u.seek(u.getTime()+.001,!1,!0),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&x()}function Z(){U(),G(!1)}function $(){o.abortRequests(),U()}function J(){!y&&g.get().streaming.scheduleWhilePaused||x()}function ee(e){if(m){ne(e.seekTime),re(0),y&&x();var t=E&&E.DVRWindow&&u?E.DVRWindow.end-u.getTime():NaN;i.updateManifestUpdateInfo({latency:t}),v?o.abortRequests():k(0)}}function te(e){i.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function ne(e){S=e}function re(e){T=e}function ie(){P=!0,v=!1,T=0,S=NaN,N=void 0,R={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},w={},M=[],y=!0,C=!1,D=!1,O=null,L=!1}return p={initialize:function(e){b=e,I=(0,uf.default)(t).create({abrController:s,dashMetrics:i,mediaPlayerModel:a,textController:l,settings:g}),n.on(df.default.DATA_UPDATE_STARTED,W,this),n.on(df.default.FRAGMENT_LOADING_COMPLETED,H,this),n.on(df.default.STREAM_COMPLETED,q,this),n.on(df.default.BUFFER_CLEARED,Q,this),n.on(df.default.BYTES_APPENDED_END_FRAGMENT,V,this),n.on(df.default.QUOTA_EXCEEDED,Z,this),n.on(df.default.PLAYBACK_SEEKING,ee,this),n.on(df.default.PLAYBACK_STARTED,J,this),n.on(df.default.PLAYBACK_RATE_CHANGED,te,this),n.on(df.default.PLAYBACK_TIME_UPDATED,K,this),n.on(df.default.URL_RESOLUTION_FAILED,$,this),n.on(df.default.FRAGMENT_LOADING_ABANDONED,z,this),n.on(df.default.BUFFERING_COMPLETED,X,this)},getType:function(){return f},getStreamId:function(){return m.id},setCurrentRepresentation:function(e){E=e},setSeekTarget:ne,setTimeToLoadDelay:re,getTimeToLoadDelay:function(){return T},switchTrackAsked:function(){C=!0},isStarted:F,start:x,stop:U,reset:function(){n.off(df.default.DATA_UPDATE_STARTED,W,this),n.off(df.default.FRAGMENT_LOADING_COMPLETED,H,this),n.off(df.default.STREAM_COMPLETED,q,this),n.off(df.default.BUFFER_CLEARED,Q,this),n.off(df.default.BYTES_APPENDED_END_FRAGMENT,V,this),n.off(df.default.QUOTA_EXCEEDED,Z,this),n.off(df.default.PLAYBACK_SEEKING,ee,this),n.off(df.default.PLAYBACK_STARTED,J,this),n.off(df.default.PLAYBACK_RATE_CHANGED,te,this),n.off(df.default.PLAYBACK_TIME_UPDATED,K,this),n.off(df.default.URL_RESOLUTION_FAILED,$,this),n.off(df.default.FRAGMENT_LOADING_ABANDONED,z,this),n.off(df.default.BUFFERING_COMPLETED,X,this),U(),Y(!1),ie(),m=null},getBufferTarget:function(){return I.getBufferTarget(f,E,b)},processInitRequest:function(e){e&&(G(!0),o.executeRequest(e))},processMediaRequest:function(e){e?(_.debug("Next fragment request url is "+e.url),o.executeRequest(e)):(u.getIsDynamic()&&_.debug("Next fragment seems to be at the bleeding live edge and is not available yet. Rescheduling."),G(!1),k(g.get().streaming.lowLatencyEnabled?100:500))},getPlaybackController:function(){return u}},_=(0,hf.default)(t).getInstance().getLogger(p),ie(),m=e.streamInfo,p}pf.__dashjs_factory_name="ScheduleController";var mf=cf.default.getClassFactory(pf),_f=Object.defineProperty({default:mf},"__esModule",{value:!0}),Ef=Tf(d),yf=Tf(be),vf=Tf(y);function Tf(e){return e&&e.__esModule?e:{default:e}}function Af(e){var t=(e=e||{}).eventBus,n=e.events,r=e.errors,i=e.abrController,a=e.dashMetrics,o=e.playbackController,s=e.timelineConverter,u=e.type,l=e.streamInfo,f=e.dashConstants,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0;function m(){return u}function _(){if(!(i&&a&&o&&s))throw new Error(Ef.default.MISSING_CONFIG_ERROR)}function E(){return h}function y(){return p}function v(){c=null,h=!0,g=[]}function T(){_();var e=new Date,t=y(),n=1e3*o.getTime();t&&a.addRepresentationSwitch(t.adaptation.type,e,n,t.id)}function A(e){return null==e||e>=g.length?null:g[e]}function S(e,t){var n;(e.segmentAvailabilityRange=s.calcSegmentAvailabilityRange(e,t),e.segmentAvailabilityRange.end<e.segmentAvailabilityRange.start)?R(new yf.default(r.SEGMENTS_UNAVAILABLE_ERROR_CODE,r.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE,{availabilityDelay:e.segmentAvailabilityRange.start-e.segmentAvailabilityRange.end})):t&&(n=e.segmentAvailabilityRange.end,s.setExpectedLiveEdge(n),a.updateManifestUpdateInfo({presentationStartTime:n}))}function b(e,r){_();for(var i=0,a=g.length;i<a;i++)S(g[i],e),r&&t.trigger(n.REPRESENTATION_UPDATE_STARTED,{representation:g[i]},{streamId:l.id,mediaType:u})}function I(){h=!0,t.trigger(n.DATA_UPDATE_STARTED,{},{streamId:l.id,mediaType:u})}function R(e){h=!1,t.trigger(n.DATA_UPDATE_COMPLETED,{data:c,currentRepresentation:p,error:e},{streamId:l.id,mediaType:u})}function w(e){var r=e;t.trigger(n.AST_IN_FUTURE,{delay:r}),setTimeout((function(){E()||(I(),g.forEach((function(e){e.segmentAvailabilityRange=null})),b(o.getIsDynamic(),!0))}),r)}function N(e){if(E())if(e.error)R(e.error);else{var t,n=e.representation,s=a.getCurrentManifestUpdate(),u=!1,d=0,c=void 0;if(n.adaptation.period.mpd.manifest.type===f.DYNAMIC&&!n.adaptation.period.mpd.manifest.ignorePostponeTimePeriod&&o.getStreamController().getStreams().length<=1&&(d=function(e){try{var t=o.getStreamController().getActiveStreamInfo(),n=e.segmentAvailabilityRange.start;t&&t.id&&t.id!==l.id&&(n=Math.min(o.getTime(),n));var r=e.segmentAvailabilityRange.end-n;return 1e3*(o.getLiveDelay()-r)}catch(e){return 0}}(n)),d>0)return w(d),void R(new yf.default(r.SEGMENTS_UPDATE_FAILED_ERROR_CODE,r.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE));if(s){for(var h=0;h<s.representationInfo.length;h++)if((c=s.representationInfo[h]).index===n.index&&c.mediaType===m()){u=!0;break}u||a.addManifestUpdateRepresentationInfo(n,m())}(function(){for(var e=0,t=g.length;e<t;e++){var n=g[e].segmentInfoType;if(null===g[e].segmentAvailabilityRange||!g[e].hasInitialization()||(n===f.SEGMENT_BASE||n===f.BASE_URL)&&!g[e].segments)return!1}return!0})()&&(i.setPlaybackQuality(m(),l,(t=p,g.indexOf(t))),a.updateManifestUpdateInfo({latency:p.segmentAvailabilityRange.end-o.getTime()}),a.getCurrentRepresentationSwitch(y().adaptation.type)||T(),R())}}function M(e){e.isDynamic&&b(e.isDynamic)}function C(e){p=A(e.newQuality),T()}function D(e){if(e.newDuration){var t=y();if(t&&t.adaptation.period)t.adaptation.period.duration=e.newDuration}}return d={getStreamId:function(){return l.id},getType:m,getData:function(){return c},isUpdating:E,updateData:function(e,t,n,r){_(),I(),g=t,p=A(r),c=e,n===Ef.default.VIDEO||n===Ef.default.AUDIO||n===Ef.default.FRAGMENTED_TEXT?b(o.getIsDynamic(),!0):R()},updateRepresentation:S,getCurrentRepresentation:y,getRepresentationForQuality:A,reset:function(){t.off(n.QUALITY_CHANGE_REQUESTED,C,d),t.off(n.REPRESENTATION_UPDATE_COMPLETED,N,d),t.off(n.WALLCLOCK_TIME_UPDATED,M,d),t.off(n.MANIFEST_VALIDITY_CHANGED,D,d),v()}},v(),t.on(n.QUALITY_CHANGE_REQUESTED,C,d),t.on(n.REPRESENTATION_UPDATE_COMPLETED,N,d),t.on(n.WALLCLOCK_TIME_UPDATED,M,d),t.on(n.MANIFEST_VALIDITY_CHANGED,D,d),d}Af.__dashjs_factory_name="RepresentationController";var Sf=vf.default.getClassFactory(Af),bf=Object.defineProperty({default:Sf},"__esModule",{value:!0}),If=wf(y),Rf=wf(d);function wf(e){return e&&e.__esModule?e:{default:e}}function Nf(e){var t=(e=e||{}).timelineConverter;return{getLiveEdge:function(e){return function(){if(!t||!t.hasOwnProperty("getExpectedLiveEdge"))throw new Error(Rf.default.MISSING_CONFIG_ERROR)}(),e.DVRWindow?e.DVRWindow.end:0},reset:function(){t=null}}}Nf.__dashjs_factory_name="LiveEdgeFinder";var Mf=If.default.getClassFactory(Nf),Cf=Object.defineProperty({default:Mf},"__esModule",{value:!0});var Df=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.availabilityIdx=NaN,this.wallStartTime=NaN,this.representation=null},Of=Object.defineProperty({default:Df},"__esModule",{value:!0}),Pf=function(e){return e?e.split("$$").join("$"):e},Lf=function(e,t){if(!t||!e||-1===e.indexOf("$RepresentationID$"))return e;var n=t.toString();return e.split("$RepresentationID$").join(n)},Ff=Gf,xf=function(e,t,n,r){var i,a,o=void 0;o=n.segmentDuration,isNaN(o)&&(o=n.adaptation.period.duration);i=parseFloat((n.adaptation.period.start+r*o).toFixed(5)),a=parseFloat((i+o).toFixed(5));var s=jf(n,o,i,e.calcMediaTimeFromPresentationTime(i,n),e.calcAvailabilityStartTimeFromPresentationTime(i,n.adaptation.period.mpd,t),e,a,t,r);if(!Yf(e,n,s,t))return null;return s},Uf=function(e,t,n,r,i,a,o,s,u,l){var f,d,c=r/a,h=Math.min(i/a,n.adaptation.period.mpd.maxSegmentDuration),g=void 0;if(f=e.calcPresentationTimeFromMediaTime(c,n),d=f+h,g=jf(n,h,f,c,n.adaptation.period.mpd.manifest.loadedTime,e,d,t,u),!Yf(e,n,g,t))return null;return g.replacementTime=l||r,o=Gf(o,"Number",g.replacementNumber),o=Gf(o,"Time",g.replacementTime),g.media=o,g.mediaRange=s,g},Bf=function(e){return e&&e.__esModule?e:{default:e}}(Of);function kf(e,t){for(;e.length<t;)e="0"+e;return e}function Gf(e,t,n){var r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=t.length,f="%0".length;if(!e)return e;for(;;){if((r=e.indexOf("$"+t))<0)return e;if((i=e.indexOf("$",r+l))<0)return e;if((a=e.indexOf("%0",r+l))>r&&a<i)switch(o=e.charAt(i-1),s=parseInt(e.substring(a+f,i-1),10),o){case"d":case"i":case"u":u=kf(n.toString(),s);break;case"x":u=kf(n.toString(16),s);break;case"X":u=kf(n.toString(16),s).toUpperCase();break;case"o":u=kf(n.toString(8),s);break;default:return e}else u=n;e=e.substring(0,r)+u+e.substring(i+1)}}function jf(e,t,n,r,i,a,o,s,u){var l,f=new Bf.default;return f.representation=e,f.duration=t,f.presentationStartTime=n,f.mediaStartTime=r,f.availabilityStartTime=i,f.availabilityEndTime=a.calcAvailabilityEndTimeFromPresentationTime(o,e.adaptation.period.mpd,s),f.wallStartTime=a.calcWallTimeForSegment(f,s),f.replacementNumber=(l=u,f.representation.startNumber+l),f.availabilityIdx=u,f}function Yf(e,t,n,r){var i=e.getPeriodEnd(t,r),a=e.calcPeriodRelativeTimeFromMpdRelativeTime(t,i);if(e.calcPeriodRelativeTimeFromMpdRelativeTime(t,n.presentationStartTime)>=a){if(!r)return!1;if(t.segmentAvailabilityRange&&n.presentationStartTime>=t.segmentAvailabilityRange.end)return!1}return!0}var qf=Object.defineProperty({unescapeDollarsInTemplate:Pf,replaceIDForTemplate:Lf,replaceTokenForTemplate:Ff,getIndexBasedSegment:xf,getTimeBasedSegment:Uf},"__esModule",{value:!0}),Hf=Vf(y),Kf=Vf(d);function Vf(e){return e&&e.__esModule?e:{default:e}}function zf(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcMediaTimeFromPresentationTime")||!n.hasOwnProperty("calcSegmentAvailabilityRange"))throw new Error(Kf.default.MISSING_CONFIG_ERROR)}function i(e,r){var i,a,o,s=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,u=s.SegmentTimeline,l=s.SegmentURL_asArray,f=0,d=0,c=-1,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0;o=e.timescale;var y=!1;for(g=0,a=(i=u.S_asArray).length;g<a&&!y;g++){if(m=0,(h=i[g]).hasOwnProperty("r")&&(m=h.r),h.hasOwnProperty("t")&&(d=(f=h.t)/o),m<0){if((E=i[g+1])&&E.hasOwnProperty("t"))_=E.t/o;else{var v=e.segmentAvailabilityRange?e.segmentAvailabilityRange.end:n.calcSegmentAvailabilityRange(e,t).end;_=n.calcMediaTimeFromPresentationTime(v,e),e.segmentDuration=h.d/o}m=Math.ceil((_-d)/(h.d/o))-1}for(p=0;p<=m&&!y;p++)(y=r(f,d,s,l,h,o,++c,g))&&(e.segmentDuration=h.d/o,(p<m-1||g<a-1)&&c++),d=(f+=h.d)/o}e.availableSegmentsNumber=c}return{getSegmentByIndex:function(e,a,o){if(r(),!e)return null;var s=null,u=!1;return i(e,(function(r,i,a,l,f,d,c,h){if(u||o<0){var g=a.media,p=f.mediaRange;return l&&(g=l[h].media||"",p=l[h].mediaRange),s=(0,qf.getTimeBasedSegment)(n,t,e,r,f.d,d,g,p,c,f.tManifest),!0}return i>=o-.5*f.d/d&&(u=!0),!1})),s},getSegmentByTime:function(e,a){if(r(),!e)return null;void 0===a&&(a=null);var o=null,s=n.calcMediaTimeFromPresentationTime(a,e);return i(e,(function(r,i,a,u,l,f,d,c){if(s<i+l.d/f){var h=a.media,g=l.mediaRange;return u&&(h=u[c].media||"",g=u[c].mediaRange),o=(0,qf.getTimeBasedSegment)(n,t,e,r,l.d,f,h,g,d,l.tManifest),!0}return!1})),o}}}zf.__dashjs_factory_name="TimelineSegmentsGetter";var Wf=Hf.default.getClassFactory(zf),Xf=Object.defineProperty({default:Wf},"__esModule",{value:!0}),Qf=$f(y),Zf=$f(d);function $f(e){return e&&e.__esModule?e:{default:e}}function Jf(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(Zf.default.MISSING_CONFIG_ERROR)}function i(e,i){if(r(),!e)return null;var a=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 o=(0,qf.getIndexBasedSegment)(n,t,e,i);if(o){o.replacementTime=Math.round((i-1)*e.segmentDuration*e.timescale,10);var s=a.media;s=(0,qf.replaceTokenForTemplate)(s,"Number",o.replacementNumber),s=(0,qf.replaceTokenForTemplate)(s,"Time",o.replacementTime),o.media=s}var u=e.segmentDuration,l=e.segmentAvailabilityRange;return isNaN(u)?e.availableSegmentsNumber=1:e.availableSegmentsNumber=Math.ceil((l.end-l.start)/u),o}return{getSegmentByIndex:i,getSegmentByTime:function(e,t){if(r(),!e)return null;var a=e.segmentDuration;if(isNaN(a))return null;var o=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return i(e,Math.floor(o/a))}}}Jf.__dashjs_factory_name="TemplateSegmentsGetter";var ed=Qf.default.getClassFactory(Jf),td=Object.defineProperty({default:ed},"__esModule",{value:!0}),nd=id(y),rd=id(d);function id(e){return e&&e.__esModule?e:{default:e}}function ad(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(rd.default.MISSING_CONFIG_ERROR)}function i(e,i){if(r(),!e)return null;var a=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,o=a.SegmentURL_asArray.length,s=e&&!isNaN(e.startNumber)?e.startNumber:1,u=Math.max(s-1,0),l=Math.max(i-u,0),f=null;if(l<o){var d=a.SegmentURL_asArray[l];(f=(0,qf.getIndexBasedSegment)(n,t,e,i))&&(f.replacementTime=(s+i-1)*e.segmentDuration,f.media=d.media?d.media:"",f.mediaRange=d.mediaRange,f.index=i,f.indexRange=d.indexRange)}return e.availableSegmentsNumber=o,f}return{getSegmentByIndex:i,getSegmentByTime:function(e,t){if(r(),!e)return null;var a=e.segmentDuration;if(isNaN(a))return null;var o=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return i(e,Math.floor(o/a))}}}ad.__dashjs_factory_name="ListSegmentsGetter";var od=nd.default.getClassFactory(ad),sd=Object.defineProperty({default:od},"__esModule",{value:!0}),ud=fd(y),ld=fd(d);function fd(e){return e&&e.__esModule?e:{default:e}}function dd(e){var t=(e=e||{}).timelineConverter;function n(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(ld.default.MISSING_CONFIG_ERROR)}function r(e,t){if(n(),!e)return null;var r=e.segments?e.segments.length:-1,i=void 0;if(t<r&&(i=e.segments[t])&&i.availabilityIdx===t)return i;for(var a=0;a<r;a++)if((i=e.segments[a])&&i.availabilityIdx===t)return i;return null}return{getSegmentByIndex:r,getSegmentByTime:function(e,t){return n(),r(e,function(e,t){if(!e)return-1;var n=e.segments,r=n?n.length:null,i=-1,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0;if(n&&r>0)for(l=0;l<r;l++)if(o=n[l],s=o.presentationStartTime,u=o.duration,t+(a=u/2)>=s&&t-a<s+u){i=o.availabilityIdx;break}return i}(e,t))}}}dd.__dashjs_factory_name="SegmentBaseGetter";var cd=ud.default.getClassFactory(dd),hd=Object.defineProperty({default:cd},"__esModule",{value:!0}),gd=yd(y),pd=yd(Xf),md=yd(td),_d=yd(sd),Ed=yd(hd);function yd(e){return e&&e.__esModule?e:{default:e}}function vd(e){e=e||{};var t,n=this.context,r=e.events,i=e.eventBus,a=e.dashConstants,o=e.streamInfo,s=e.type,u=void 0;function l(e){return e?e.segments?u[a.SEGMENT_BASE]:u[e.segmentInfoType]:null}return t={initialize:function(t){u[a.SEGMENT_TIMELINE]=(0,pd.default)(n).create(e,t),u[a.SEGMENT_TEMPLATE]=(0,md.default)(n).create(e,t),u[a.SEGMENT_LIST]=(0,_d.default)(n).create(e,t),u[a.SEGMENT_BASE]=(0,Ed.default)(n).create(e,t)},update:function(e,t,n,a){n||i.trigger(r.SEGMENTBASE_INIT_REQUEST_NEEDED,{streamId:o.id,mediaType:s,mimeType:t,representation:e}),a||i.trigger(r.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,{streamId:o.id,mediaType:s,mimeType:t,representation:e})},getSegmentByIndex:function(e,t,n){var r=l(e);return r?r.getSegmentByIndex(e,t,n):null},getSegmentByTime:function(e,t){var n=l(e);return n?n.getSegmentByTime(e,t):null}},u={},t}vd.__dashjs_factory_name="SegmentsController";var Td=gd.default.getClassFactory(vd),Ad=Object.defineProperty({default:Td},"__esModule",{value:!0}),Sd=Rd(pe),bd=Rd(y),Id=Rd(Ad);function Rd(e){return e&&e.__esModule?e:{default:e}}function wd(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,i=e.debug,a=e.dashConstants,o=e.urlUtils,s=e.type,u=e.streamInfo,l=e.timelineConverter,f=e.dashMetrics,d=e.baseURLController,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0;function T(){return s}function A(){g=-1,p=null}function S(){A(),m=null,v=null,y=null}function b(e,t,n){var r=d.resolve(n.path),i=void 0,a=void 0;return r&&t!==r.url&&o.isRelative(t)?(i=r.url,a=r.serviceLocation,t&&(i=o.resolve(t,i))):i=t,!o.isRelative(i)&&(e.url=i,e.serviceLocation=a,!0)}function I(e){var t,i,a;t=e.representation,i=t.hasInitialization(),a=t.hasSegments(),i&&a?n.trigger(r.REPRESENTATION_UPDATE_COMPLETED,{representation:t},{streamId:u.id,mediaType:s}):v.update(t,y,i,a)}function R(e,t){if(null==t)return null;var n=new Sd.default,r=t.representation,i=r.adaptation.period.mpd.manifest.Period_asArray[r.adaptation.period.index].AdaptationSet_asArray[r.adaptation.index].Representation_asArray[r.index].bandwidth,a=t.media;return a=(0,qf.replaceTokenForTemplate)(a,"Number",t.replacementNumber),a=(0,qf.replaceTokenForTemplate)(a,"Time",t.replacementTime),a=(0,qf.replaceTokenForTemplate)(a,"Bandwidth",i),a=(0,qf.replaceIDForTemplate)(a,r.id),a=(0,qf.unescapeDollarsInTemplate)(a),n.mediaType=T(),n.type=de.HTTPRequest.MEDIA_SEGMENT_TYPE,n.range=t.mediaRange,n.startTime=t.presentationStartTime,n.mediaStartTime=t.mediaStartTime,n.duration=t.duration,n.timescale=r.timescale,n.availabilityStartTime=t.availabilityStartTime,n.availabilityEndTime=t.availabilityEndTime,n.wallStartTime=t.wallStartTime,n.quality=r.index,n.index=t.availabilityIdx,n.mediaInfo=e,n.adaptationIndex=r.adaptation.index,n.representationId=r.id,b(n,a,r)?n:void 0}function w(e){var t=!1;if(!e)return t;if(_){if(E)t=!0;else if(p){var n=parseFloat((p.presentationStartTime-e.adaptation.period.start).toFixed(5));t=(p.duration>0?n+1.5*p.duration:n)>=e.adaptation.period.duration}}else g>=e.availableSegmentsNumber&&(t=!0);return t}function N(e){var t=e.representation;t.segments&&n.trigger(r.REPRESENTATION_UPDATE_COMPLETED,{representation:t},{streamId:u.id,mediaType:s})}function M(e){if(!e.error){var t,i=e.segments,a=e.representation,o=[],d=0,c=void 0,h=void 0,g=void 0;for(c=0,t=i?i.length:0;c<t;c++)h=i[c],(g=(0,qf.getTimeBasedSegment)(l,_,a,h.startTime,h.duration,h.timescale,h.media,h.mediaRange,d))&&(o.push(g),g=null,d++);if(o.length>0)if(a.segmentAvailabilityRange={start:o[0].presentationStartTime,end:o[o.length-1].presentationStartTime},a.availableSegmentsNumber=o.length,a.segments=o,_)!function(e){l.setExpectedLiveEdge(e),f.updateManifestUpdateInfo({presentationStartTime:e})}(o[o.length-1].presentationStartTime-8);a.hasInitialization()&&n.trigger(r.REPRESENTATION_UPDATE_COMPLETED,{representation:a},{streamId:u.id,mediaType:s})}}function C(){h.debug("Dynamic stream complete"),E=!0}return c={initialize:function(e){_=e,E=!1,v.initialize(e)},getStreamId:function(){return u.id},getType:T,getStreamInfo:function(){return u},getInitRequest:function(e,t){return t?function(e,t,n){var r=new Sd.default,i=t.adaptation.period,a=i.start;if(r.mediaType=n,r.type=de.HTTPRequest.INIT_SEGMENT_TYPE,r.range=t.range,r.availabilityStartTime=l.calcAvailabilityStartTimeFromPresentationTime(a,i.mpd,_),r.availabilityEndTime=l.calcAvailabilityEndTimeFromPresentationTime(a+i.duration,i.mpd,_),r.quality=t.index,r.mediaInfo=e,r.representationId=t.id,b(r,t.initialization,t))return r.url=(0,qf.replaceTokenForTemplate)(r.url,"Bandwidth",t.bandwidth),r}(e,t,T()):null},getRequestForSegment:R,getSegmentRequestForTime:function(e,t,n,r){var i=null;if(!t||!t.segmentInfoType)return i;var o=g,u=!!r&&r.keepIdx,l=!(!r||!r.ignoreIsFinished);m!==n&&(m=n,h.debug("Getting the request for time : "+n));var f=v.getSegmentByTime(t,n);return f?(g=f.availabilityIdx,p=f,h.debug("Index for time "+n+" is "+g),i=R(e,f)):!l&&w(t)&&((i=new Sd.default).action=Sd.default.ACTION_COMPLETE,i.index=g-1,i.mediaType=s,i.mediaInfo=e,h.debug("Signal complete in getSegmentRequestForTime")),u&&o>=0&&(g=t.segmentInfoType===a.SEGMENT_TIMELINE&&_?g:o),i},getNextSegmentRequest:function(e,t){var n=null;if(!t||!t.segmentInfoType)return null;m=null;var r=g+1;h.debug("Getting the next request at index: "+r);var i=v.getSegmentByIndex(t,r,p?p.mediaStartTime:-1);return i||!function(e){return!isFinite(e.adaptation.period.duration)}(t)||E?(i?(n=R(e,i),g=i.availabilityIdx):g=_?r-1:r,i?p=i:w(t)&&((n=new Sd.default).action=Sd.default.ACTION_COMPLETE,n.index=g-1,n.mediaType=T(),n.mediaInfo=e,h.debug("Signal complete")),n):(h.debug(T()+" No segment found at index: "+r+". Wait for next loop"),null)},setCurrentIndex:function(e){g=e},getCurrentIndex:function(){return g},isMediaFinished:w,reset:function(){S(),n.off(r.INITIALIZATION_LOADED,N,c),n.off(r.SEGMENTS_LOADED,M,c),n.off(r.REPRESENTATION_UPDATE_STARTED,I,c),n.off(r.DYNAMIC_TO_STATIC,C,c)},resetIndex:A,setMimeType:function(e){y=e},getNextSegmentRequestIdempotent:function(e,t){var n=g+1,r=v.getSegmentByIndex(t,n,p?p.mediaStartTime:-1);return r?R(e,r):null}},h=i.getLogger(c),S(),v=(0,Id.default)(t).create(e),n.on(r.INITIALIZATION_LOADED,N,c),n.on(r.SEGMENTS_LOADED,M,c),n.on(r.REPRESENTATION_UPDATE_STARTED,I,c),n.on(r.DYNAMIC_TO_STATIC,C,c),c}wd.__dashjs_factory_name="DashHandler";var Nd=bd.default.getClassFactory(wd),Md=Object.defineProperty({default:Nd},"__esModule",{value:!0}),Cd=function(e){return e&&e.__esModule?e:{default:e}}(y);function Dd(){return{modifyRequestURL:function(e){return e},modifyRequestHeader:function(e){return e}}}Dd.__dashjs_factory_name="RequestModifier";var Od=Cd.default.getSingletonFactory(Dd),Pd=Object.defineProperty({default:Od},"__esModule",{value:!0}),Ld=function(e){return e&&e.__esModule?e:{default:e}}(y);function Fd(){var e=void 0,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(!f(e))return e;d(e)&&(n=u),c(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 f(e){return!t.test(e)}function d(e){return f(e)&&"/"===e.charAt(0)}function c(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:f,isPathAbsolute:d,isSchemeRelative:c,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)}}}Fd.__dashjs_factory_name="DefaultURLUtils";var xd=Ld.default.getSingletonFactory(Fd),Ud=Object.defineProperty({default:xd},"__esModule",{value:!0}),Bd=Gd(y),kd=Gd(Ud);function Gd(e){return e&&e.__esModule?e:{default:e}}function jd(){var e=void 0,t=[],n=this.context;function r(n,r,i){var a=function(n){var r=void 0;for(r=0;r<t.length;r++){if(t[r].regex.test(n))return t[r].utils}return e}(i||r);return a&&"function"==typeof a[n]?a[n](r,i):e[n](r,i)}return e=(0,kd.default)(n).getInstance(),{registerUrlRegex:function(e,n){t.push({regex:e,utils:n})},parseBaseUrl:function(e){return r("parseBaseUrl",e)},parseOrigin:function(e){return r("parseOrigin",e)},parseScheme:function(e){return r("parseScheme",e)},isRelative:function(e){return r("isRelative",e)},isPathAbsolute:function(e){return r("isPathAbsolute",e)},isSchemeRelative:function(e){return r("isSchemeRelative",e)},isHTTPURL:function(e){return r("isHTTPURL",e)},isHTTPS:function(e){return r("isHTTPS",e)},removeHostname:function(e){return r("removeHostname",e)},resolve:function(e,t){return r("resolve",e,t)}}}jd.__dashjs_factory_name="URLUtils";var Yd=Bd.default.getSingletonFactory(jd),qd=Object.defineProperty({default:Yd},"__esModule",{value:!0});function Hd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Kd=function e(){Hd(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};Kd.INITIAL_PLAYOUT_START_REASON="initial_playout",Kd.SEEK_START_REASON="seek",Kd.RESUME_FROM_PAUSE_START_REASON="resume",Kd.METRICS_COLLECTION_START_REASON="metrics_collection_start";var Vd=function e(){Hd(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};Vd.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",Vd.REBUFFERING_REASON="rebuffering",Vd.USER_REQUEST_STOP_REASON="user_request",Vd.END_OF_PERIOD_STOP_REASON="end_of_period",Vd.END_OF_CONTENT_STOP_REASON="end_of_content",Vd.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",Vd.FAILURE_STOP_REASON="failure";var zd=Kd,Wd=Vd,Xd=Object.defineProperty({PlayList:zd,PlayListTrace:Wd},"__esModule",{value:!0}),Qd=mc(d),Zd=mc(g),$d=mc(_),Jd=mc(Ae),ec=mc(Cl),tc=mc(Zl),nc=mc(_f),rc=mc(bf),ic=mc(Cf),ac=mc(y),oc=mc(O),sc=mc(U),uc=mc(Md),lc=mc(na),fc=mc(be),dc=mc(Q),cc=mc(Pd),hc=mc(qd),gc=mc(Ve),pc=mc(pe);function mc(e){return e&&e.__esModule?e:{default:e}}function _c(e){e=e||{};var t=this.context,n=(0,oc.default)(t).getInstance(),r=e.streamInfo,i=e.type,a=e.errHandler,o=e.mimeType,s=e.timelineConverter,u=e.adapter,l=e.manifestModel,f=e.mediaPlayerModel,d=e.fragmentModel,c=e.abrController,h=e.playbackController,g=e.mediaController,p=e.textController,m=e.dashMetrics,_=e.settings,E=e.boxParser,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0,M=void 0,C=void 0;function D(){return i}function O(){S=[],A=null,M=0}function P(e){(e.error||I.setCurrentRepresentation(u.convertDataToRepresentationInfo(e.currentRepresentation)),e.error&&e.error.code!==lc.default.SEGMENTS_UPDATE_FAILED_ERROR_CODE)||h.getStreamController().getActiveStreamInfo().id===r.id&&k()}function L(e){var t=q(e.newQuality);I.setCurrentRepresentation(t),m.pushPlayListTraceMetrics(new Date,Xd.PlayListTrace.REPRESENTATION_SWITCH_STOP_REASON),m.createPlaylistTraceMetrics(t.id,1e3*h.getTime(),h.getPlaybackRate())}function F(e){m.addBufferLevel(i,new Date,1e3*e.bufferLevel);var t=h.getStreamController().getActiveStreamInfo().id;l.getValue().doNotUpdateDVRWindowOnBufferUpdated||r.id!==t||k()}function x(e){m.addBufferState(i,e.state,I.getBufferTarget()),e.state!==$d.default.BUFFER_EMPTY||h.isSeeking()||m.pushPlayListTraceMetrics(new Date,Xd.PlayListTrace.REBUFFERING_REASON)}function U(e){d.syncExecutedRequestsWithBufferedRange(b.getBuffer().getAllBufferRanges(),r.duration),e.from>h.getTime()&&(M=e.from,C=!0)}function B(e){M=e.quotaExceededTime,C=!0}function k(){var e=r.manifestInfo,t=e.isDynamic,n=s.calcSegmentAvailabilityRange(R.getCurrentRepresentation(),t);m.addDVRInfo(D(),h.getTime(),e,n)}function G(){return b?b.getBuffer():null}function j(){return S}function Y(){return A}function q(e){var t=void 0;return void 0!==e?((0,Je.checkInteger)(e),t=R?R.getRepresentationForQuality(e):null):t=R?R.getCurrentRepresentation():null,u.convertDataToRepresentationInfo(t)}function H(e){if(e.sender&&(!u.getIsTextTrack(o)||p.isTextEnabled())&&b&&e.representationId&&!b.appendInitSegment(e.representationId)){var t=N?N.getInitRequest(Y(),R.getCurrentRepresentation()):null;I.processInitRequest(t)}}function K(e){var t=void 0;b.getIsPruningInProgress()||(t=function(e,t){var n=q(),r=!isNaN(e),i=h.getNormalizedTime(),a=r?e:M,o=!1,s=void 0;if(isNaN(a)||D()===Qd.default.FRAGMENTED_TEXT&&!p.isTextEnabled())return null;if(b){var u=b.getRangeAt(a),l=b.getRangeAt(i);if((null!==u||null!==l)&&!r)if(!u||l&&l.start!=u.start&&l.end!=u.end)b.getBuffer().hasDiscontinuitiesAfter(i)&&D()!==Qd.default.FRAGMENTED_TEXT&&(d.removeExecutedRequestsAfterTime(l.end),o=!0)}if(t)a=t.startTime+t.duration/2,s=W(n,a,{timeThreshold:0,ignoreIsFinished:!0});else{var f=r||C||o;for(s=W(n,f?a:void 0,{keepIdx:!f}),C=!1;s&&s.action!==pc.default.ACTION_COMPLETE&&d.isFragmentLoaded(s);)s=W(n)}return s}(e.seekTarget,e.replacement))&&(I.setSeekTarget(NaN),e.replacement||(isNaN(t.startTime+t.duration)||(M=t.startTime+t.duration),t.delayLoadingTime=(new Date).getTime()+I.getTimeToLoadDelay(),I.setTimeToLoadDelay(0))),I.processMediaRequest(t)}function V(e){var i=e.chunk,a=i.bytes,o=i.quality,s=q(o),l=R&&s?R.getRepresentationForQuality(s.quality):null,f=u.getEventsFor(s.mediaInfo),c=u.getEventsFor(s,l);if(f&&f.length>0||c&&c.length>0){var h=function(e,n,r,i){try{for(var a={},o=[],s=r.concat(i),l=0,f=s.length;l<f;l++)a[s[l].schemeIdUri+"/"+s[l].value]=s[l];var d=(0,gc.default)(t).getInstance().parse(e),c=d.getBoxes("emsg");if(!c||0===c.length)return o;for(var h=d.getBox("sidx"),g=!h||isNaN(h.earliest_presentation_time)||isNaN(h.timescale)?n&&!isNaN(n.mediaStartTime)?n.mediaStartTime:0:h.earliest_presentation_time/h.timescale,p=Math.max(g,0),m=R.getCurrentRepresentation(),_=0,E=c.length;_<E;_++){var y=u.getEvent(c[_],a,p,m);y&&o.push(y)}return o}catch(e){return[]}}(a,d.getRequests({state:Jd.default.FRAGMENT_MODEL_EXECUTED,quality:o,index:i.index})[0],f,c);n.trigger(sc.default.INBAND_EVENTS,{events:h},{streamId:r.id})}}function z(e){M=e.time,I.setSeekTarget(e.time)}function W(e,t,n){var r=null;if(N){var i=R&&e?R.getRepresentationForQuality(e.quality):null;r=void 0!==t&&void 0!==n?N.getSegmentRequestForTime(Y(),i,t,n):N.getNextSegmentRequest(Y(),i)}return r}return y={initialize:function(v,A){N=(0,uc.default)(t).create({streamInfo:r,type:i,timelineConverter:s,dashMetrics:m,mediaPlayerModel:f,baseURLController:e.baseURLController,errHandler:a,settings:_,boxParser:E,events:sc.default,eventBus:n,errors:lc.default,debug:(0,dc.default)(t).getInstance(),requestModifier:(0,cc.default)(t).getInstance(),dashConstants:Zd.default,constants:Qd.default,urlUtils:(0,hc.default)(t).getInstance()}),(T=r.manifestInfo.isDynamic)&&(w=(0,ic.default)(t).create({timelineConverter:s})),N.initialize(T),c.registerStreamType(i,y),R=(0,rc.default)(t).create({streamInfo:r,type:i,abrController:c,dashMetrics:m,playbackController:h,timelineConverter:s,dashConstants:Zd.default,events:sc.default,eventBus:n,errors:lc.default}),(b=function(e){var n=null;if(!e)return a.error(new fc.default(lc.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,lc.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null;n=e===Qd.default.VIDEO||e===Qd.default.AUDIO?(0,ec.default)(t).create({streamInfo:r,type:e,mediaPlayerModel:f,manifestModel:l,fragmentModel:d,errHandler:a,mediaController:g,representationController:R,adapter:u,textController:p,abrController:c,playbackController:h,settings:_}):(0,tc.default)(t).create({streamInfo:r,type:e,mimeType:o,mediaPlayerModel:f,manifestModel:l,fragmentModel:d,errHandler:a,mediaController:g,representationController:R,adapter:u,textController:p,abrController:c,playbackController:h,settings:_});return n}(i))&&b.initialize(v),(I=(0,nc.default)(t).create({streamInfo:r,type:i,mimeType:o,adapter:u,dashMetrics:m,mediaPlayerModel:f,fragmentModel:d,abrController:c,playbackController:h,textController:p,mediaController:g,bufferController:b,settings:_})).initialize(A),M=0,C=!1},getStreamId:function(){return r.id},getType:D,isUpdating:function(){return!!R&&R.isUpdating()},getBufferController:function(){return b},getFragmentModel:function(){return d},getScheduleController:function(){return I},getRepresentationController:function(){return R},getRepresentationInfo:q,getBufferLevel:function(){return b?b.getBufferLevel():0},isBufferingCompleted:function(){return!!b&&b.getIsBufferingCompleted()},createBuffer:function(e){return G()||b?b.createBuffer(S,e):null},updateStreamInfo:function(e){r=e,_.get().streaming.useAppendWindow&&b.updateAppendWindow()},getStreamInfo:function(){return r},selectMediaInfo:function(e){e===A||e&&A&&e.type!==A.type||(A=e);var t=u.getRealAdaptation(r,A),n=u.getVoRepresentations(A);if(R){var a=R.getData(),o=c.getTopQualityIndexFor(i,r.id),s=c.getMinAllowedIndexFor(i),l=void 0,f=null;null!==a&&a.id==t.id||i===Qd.default.FRAGMENTED_TEXT?l=c.getQualityFor(i):(f=c.getThroughputHistory().getAverageThroughput(i)||c.getInitialBitrateFor(i),l=c.getQualityForBitrate(A,f)),void 0!==s&&l<s&&(l=s),l>o&&(l=o),N.setMimeType(A?A.mimeType:null),R.updateData(t,n,i,l)}},addMediaInfo:function(e,t){-1===S.indexOf(e)&&S.push(e),t&&this.selectMediaInfo(e)},getLiveStartTime:function(){if(!T)return NaN;if(!w)return NaN;var e=NaN,t=q(),n=w.getLiveEdge(t);if(isNaN(n))return NaN;var i=function(e,t){try{var n=null,i=h.getLiveDelay(),a=isNaN(r.manifestInfo.DVRWindowSize)?i:r.manifestInfo.DVRWindowSize,o=.1*a,s=void 0;if(!isFinite(a)||W(t,e-a+o,{ignoreIsFinished:!0}))for(;!n&&i<=a;)(n=W(t,s=e-i,{ignoreIsFinished:!0}))||(i+=1);return n&&h.setLiveDelay(i,!0),v.debug("live edge: "+e+", live delay: "+i+", live target: "+s),n}catch(e){return null}}(n,t);return i&&(e=_.get().streaming.lowLatencyEnabled?i.duration<f.getLiveDelay()?i.startTime:i.startTime+i.duration-f.getLiveDelay():i.startTime),e},switchTrackAsked:function(){I.switchTrackAsked()},getMediaInfoArr:j,getMediaInfo:Y,getMediaSource:function(){return b.getMediaSource()},setMediaSource:function(e){b.setMediaSource(e,j())},dischargePreBuffer:function(){b.dischargePreBuffer()},getBuffer:G,setBuffer:function(e){b.setBuffer(e)},setBufferingTime:function(e){M=e},resetIndexHandler:function(){N&&N.resetIndex()},getInitRequest:function(e){(0,Je.checkInteger)(e);var t=R?R.getRepresentationForQuality(e):null;return N?N.getInitRequest(Y(),t):null},getFragmentRequest:W,finalisePlayList:function(e,t){m.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=q(),t=R&&e?R.getRepresentationForQuality(e.quality):null;return N.getNextSegmentRequestIdempotent(Y(),t)},reset:function(e,t){N&&N.reset(),b&&(b.reset(e,t),b=null),I&&(I.reset(),I=null),R&&(R.reset(),R=null),w&&(w.reset(),w=null),c&&!t&&c.unRegisterStreamType(i),n.off(sc.default.DATA_UPDATE_COMPLETED,P,y),n.off(sc.default.QUALITY_CHANGE_REQUESTED,L,y),n.off(sc.default.INIT_FRAGMENT_NEEDED,H,y),n.off(sc.default.MEDIA_FRAGMENT_NEEDED,K,y),n.off(sc.default.MEDIA_FRAGMENT_LOADED,V,y),n.off(sc.default.BUFFER_LEVEL_UPDATED,F,y),n.off(sc.default.BUFFER_LEVEL_STATE_CHANGED,x,y),n.off(sc.default.BUFFER_CLEARED,U,y),n.off(sc.default.SEEK_TARGET,z,y),O(),i=null,r=null}},v=(0,dc.default)(t).getInstance().getLogger(y),O(),n.on(sc.default.DATA_UPDATE_COMPLETED,P,y,{priority:oc.default.EVENT_PRIORITY_HIGH}),n.on(sc.default.QUALITY_CHANGE_REQUESTED,L,y),n.on(sc.default.INIT_FRAGMENT_NEEDED,H,y),n.on(sc.default.MEDIA_FRAGMENT_NEEDED,K,y),n.on(sc.default.MEDIA_FRAGMENT_LOADED,V,y),n.on(sc.default.BUFFER_LEVEL_UPDATED,F,y),n.on(sc.default.BUFFER_LEVEL_STATE_CHANGED,x,y),n.on(sc.default.BUFFER_CLEARED,U,y),n.on(sc.default.QUOTA_EXCEEDED,B,y),n.on(sc.default.SEEK_TARGET,z,y),y}_c.__dashjs_factory_name="StreamProcessor";var Ec=ac.default.getClassFactory(_c),yc=Object.defineProperty({default:Ec},"__esModule",{value:!0});var vc=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},Tc=Object.defineProperty({default:vc},"__esModule",{value:!0}),Ac=function(e){return e&&e.__esModule?e:{default:e}}(y);function Sc(e){var t=(e=e||{}).requestModifier;return{load:function(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&&(i=t.modifyRequestHeader(i)),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},abort:function(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}}}Sc.__dashjs_factory_name="XHRLoader";var bc=Ac.default.getClassFactory(Sc),Ic=Object.defineProperty({default:bc},"__esModule",{value:!0}),Rc="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},wc=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Nc=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return wc(e,null,[{key:"mixin",value:function(t,n,r){var i=void 0,a={};if(t)for(var o in n)n.hasOwnProperty(o)&&(i=n[o],o in t&&(t[o]===i||o in a&&a[o]===i)||("object"===Rc(t[o])&&null!==t[o]?t[o]=e.mixin(t[o],i,r):t[o]=r(i)));return t}},{key:"clone",value:function(t){if(!t||"object"!==(void 0===t?"undefined":Rc(t)))return t;var n=void 0;if(t instanceof Array){n=[];for(var r=0,i=t.length;r<i;++r)r in t&&n.push(e.clone(t[r]))}else n={};return e.mixin(n,t,e.clone)}},{key:"addAditionalQueryParameterToUrl",value:function(e,t){try{if(!t||0===t.length)return e;var n=new URL(e);return t.forEach((function(e){e.key&&e.value&&n.searchParams.set(e.key,e.value)})),n.href}catch(t){return e}}},{key:"parseHttpHeaders",value:function(e){var t={};if(!e)return t;for(var n=e.trim().split("\r\n"),r=0,i=n.length;r<i;r++){var a=n[r],o=a.indexOf(": ");o>0&&(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;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t|=0}return t}}]),e}(),Mc=Object.defineProperty({default:Nc},"__esModule",{value:!0}),Cc="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},Dc=Fc(y),Oc=Fc(Mc),Pc=Fc(Q),Lc=Fc(d);function Fc(e){return e&&e.__esModule?e:{default:e}}function xc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uc(){var e,t,n={debug:{logLevel:Pc.default.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{metricsMaxListDepth:1e3,abandonLoadTimeout:1e4,liveDelayFragmentCount:NaN,liveDelay:null,scheduleWhilePaused:!0,fastSwitchEnabled:!1,flushBufferAtTrackSwitch:!1,calcSegmentAvailabilityRangeFromTimeline:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,stableBufferTime:12,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,longFormContentDurationThreshold:600,wallclockTimeUpdateInterval:50,lowLatencyEnabled:!1,keepProtectionMediaKeys:!1,useManifestDateHeaderTimeSource:!0,useSuggestedPresentationDelay:!0,useAppendWindow:!0,manifestUpdateRetryInterval:100,stallThreshold:.5,filterUnsupportedEssentialProperties:!0,eventControllerRefreshDelay:100,utcSynchronization:{backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"http://time.akamai.com/?iso&ms"}},liveCatchup:{minDrift:.02,maxDrift:0,playbackRate:.5,latencyThreshold:60,playbackBufferMin:.5,enabled:!1,mode:Lc.default.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},cacheLoadThresholds:{video:50,audio:5},trackSwitchMode:{audio:Lc.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:Lc.default.TRACK_SWITCH_MODE_NEVER_REPLACE},selectionModeForInitialTrack:Lc.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE,fragmentRequestTimeout:0,retryIntervals:(e={},xc(e,de.HTTPRequest.MPD_TYPE,500),xc(e,de.HTTPRequest.XLINK_EXPANSION_TYPE,500),xc(e,de.HTTPRequest.MEDIA_SEGMENT_TYPE,1e3),xc(e,de.HTTPRequest.INIT_SEGMENT_TYPE,1e3),xc(e,de.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,1e3),xc(e,de.HTTPRequest.INDEX_SEGMENT_TYPE,1e3),xc(e,de.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,1e3),xc(e,de.HTTPRequest.OTHER_TYPE,1e3),xc(e,"lowLatencyReductionFactor",10),e),retryAttempts:(t={},xc(t,de.HTTPRequest.MPD_TYPE,3),xc(t,de.HTTPRequest.XLINK_EXPANSION_TYPE,1),xc(t,de.HTTPRequest.MEDIA_SEGMENT_TYPE,3),xc(t,de.HTTPRequest.INIT_SEGMENT_TYPE,3),xc(t,de.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),xc(t,de.HTTPRequest.INDEX_SEGMENT_TYPE,3),xc(t,de.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,3),xc(t,de.HTTPRequest.OTHER_TYPE,3),xc(t,"lowLatencyMultiplyFactor",5),t),abr:{movingAverageMethod:Lc.default.MOVING_AVERAGE_SLIDING_WINDOW,ABRStrategy:Lc.default.ABR_STRATEGY_DYNAMIC,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:Lc.default.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA},cmcd:{enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:Lc.default.CMCD_MODE_QUERY}}},r=Oc.default.clone(n);return{get:function(){return r},update:function(e){"object"===(void 0===e?"undefined":Cc(e))&&function e(t,n,r){for(var i in t)t.hasOwnProperty(i)&&n.hasOwnProperty(i)&&("object"===Cc(t[i])&&null!==t[i]?e(t[i],n[i],r.slice()+i+"."):n[i]=Oc.default.clone(t[i]))}(e,r,"")},reset:function(){r=Oc.default.clone(n)}}}Uc.__dashjs_factory_name="Settings";var Bc=Dc.default.getSingletonFactory(Uc),kc=Object.defineProperty({default:Bc},"__esModule",{value:!0}),Gc=qc(y),jc=qc(kc),Yc=qc(d);function qc(e){return e&&e.__esModule?e:{default:e}}function Hc(e){e=e||{};var t=this.context,n=e.requestModifier,r=e.boxParser,i=(0,jc.default)(t).getInstance();function a(e,t){e.reader.read().then(t).catch((function(t){e.onerror&&200===e.response.status&&e.onerror(t)}))}function o(e,t,n,r,i){switch(e){case Yc.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING:return function(e,t){try{var n,r;n=e.filter((function(t,n){return n>0&&n<e.length-1})),r=t.filter((function(e,n){return n>0&&n<t.length-1}));var i=0;if(n.length>1){for(var a=0;a<n.length;a++)if(n[a]&&r[a]){var o=r[a].ts-n[a].ts;i+=o}return i}return null}catch(e){return null}}(t,n);case Yc.default.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA:default:return s(r,i)}}function s(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<r?o:0}})),n}return null}catch(e){return null}}return{load:function(e){var t=new Date,s=e.request,u=new Headers;if(s.range&&u.append("Range","bytes="+s.range),e.headers)for(var l in e.headers){var f=e.headers[l];f&&u.append(l,f)}s.requestStartDate||(s.requestStartDate=t),n&&n.modifyRequestHeader({setRequestHeader:function(e,t){u.append(e,t)}});var d=void 0;"function"==typeof window.AbortController&&(d=new AbortController,e.abortController=d,d.signal.onabort=e.onabort);var c={method:e.method,headers:u,credentials:e.withCredentials?"include":void 0,signal:d?d.signal:void 0};fetch(e.url,c).then((function(t){e.response||(e.response={}),e.response.status=t.status,e.response.statusText=t.statusText,e.response.responseURL=t.url,t.ok||e.onerror();var n="",s=!0,u=!1,l=void 0;try{for(var f,d=t.headers.keys()[Symbol.iterator]();!(s=(f=d.next()).done);s=!0){var c=f.value;n+=c+": "+t.headers.get(c)+"\r\n"}}catch(e){u=!0,l=e}finally{try{!s&&d.return&&d.return()}finally{if(u)throw l}}if(e.response.responseHeaders=n,!t.body)return t.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=parseInt(t.headers.get("Content-Length"),10),g=0,p=!1,m=new Uint8Array,_=0;e.reader=t.body.getReader();var E=[],y=[],v=[],T=!0,A=i.get().streaming.abr.fetchThroughputCalculationMode;a(e,(function t(n){var i=n.value;if(n.done)return m&&(e.progress({loaded:g,total:isNaN(h)?g:h,lengthComputable:!0,time:o(A,y,v,E,g),stream:!0}),e.response.response=m.buffer),e.onload(),void e.onend();if(i&&i.length>0){if(m=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}(m,i),g+=i.length,E.push({ts:Date.now(),bytes:i.length}),A===Yc.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&T)r.findLastTopIsoBoxCompleted(["moof"],m,_).found&&(T=!1,y.push({ts:performance.now(),bytes:i.length}));var s=r.findLastTopIsoBoxCompleted(["moov","mdat"],m,_);if(s.found){var u=s.lastCompletedOffset+s.size;A===Yc.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&(T=!0,v.push({ts:performance.now(),bytes:m.length}));var l=void 0;u===m.length?(l=m,m=new Uint8Array):(l=new Uint8Array(m.subarray(0,u)),m=m.subarray(u)),e.progress({data:l.buffer,lengthComputable:!1,noTrace:!0}),_=0}else _=s.lastCompletedOffset,p||(e.progress({lengthComputable:!1,noTrace:!0}),p=!0)}a(e,t)}))})).catch((function(t){e.onerror&&e.onerror(t)}))},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:o}}Hc.__dashjs_factory_name="FetchLoader";var Kc=Gc.default.getClassFactory(Hc),Vc=Object.defineProperty({default:Kc},"__esModule",{value:!0});var zc=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",e.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",e.CMCD_DATA_GENERATED="cmcdDataGenerated",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(S).default)),Wc=Object.defineProperty({default:zc},"__esModule",{value:!0}),Xc=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Qc=function(e){return e&&e.__esModule?e:{default:e}}(g);var Zc=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.codecs=null,this.codecPrivateData=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.segmentAvailabilityRange=null,this.availableSegmentsNumber=0,this.bandwidth=NaN,this.width=NaN,this.height=NaN,this.scanType=null,this.maxPlayoutRate=NaN,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0}return Xc(e,[{key:"hasInitialization",value:function(){return null!==this.initialization||null!==this.range}},{key:"hasSegments",value:function(){return this.segmentInfoType!==Qc.default.BASE_URL&&this.segmentInfoType!==Qc.default.SEGMENT_BASE&&!this.indexRange}}]),e}(),$c=Object.defineProperty({default:Zc},"__esModule",{value:!0});var Jc=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.period=null,this.index=-1,this.type=null},eh=Object.defineProperty({default:Jc},"__esModule",{value:!0});var th=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null};th.DEFAULT_ID="defaultId";var nh=th,rh=Object.defineProperty({default:nh},"__esModule",{value:!0});var ih=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.publishTime=null,this.minimumUpdatePeriod=NaN,this.mediaPresentationDuration=NaN},ah=Object.defineProperty({default:ih},"__esModule",{value:!0});var oh=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=""},sh=Object.defineProperty({default:oh},"__esModule",{value:!0});var uh=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN},lh=Object.defineProperty({default:uh},"__esModule",{value:!0});var fh=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=n||t||"",this.dvb_priority=r||1,this.dvb_weight=i||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0};fh.DEFAULT_DVB_PRIORITY=1,fh.DEFAULT_DVB_WEIGHT=1;var dh=fh,ch=Object.defineProperty({default:dh},"__esModule",{value:!0});var hh=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0},gh=Object.defineProperty({default:hh},"__esModule",{value:!0}),ph=Array.isArray,mh=Object.keys,_h=Object.prototype.hasOwnProperty,Eh=vh(y),yh=vh((function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var r,i,a,o=ph(t),s=ph(n);if(o&&s){if((i=t.length)!=n.length)return!1;for(r=i;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(o!=s)return!1;var u=t instanceof Date,l=n instanceof Date;if(u!=l)return!1;if(u&&l)return t.getTime()==n.getTime();var f=t instanceof RegExp,d=n instanceof RegExp;if(f!=d)return!1;if(f&&d)return t.toString()==n.toString();var c=mh(t);if((i=c.length)!==mh(n).length)return!1;for(r=i;0!=r--;)if(!_h.call(n,c[r]))return!1;for(r=i;0!=r--;)if(!e(t[a=c[r]],n[a]))return!1;return!0}return t!=t&&n!=n}));function vh(e){return e&&e.__esModule?e:{default:e}}function Th(){return{areEqual:function(e,t){return(0,yh.default)(e,t)}}}Th.__dashjs_factory_name="ObjectUtils";var Ah=Eh.default.getSingletonFactory(Th),Sh=Object.defineProperty({default:Ah},"__esModule",{value:!0});var bh=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=""},Ih=Object.defineProperty({default:bh},"__esModule",{value:!0}),Rh=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.THUMBNAILS_SCHEME_ID_URIS=void 0;var n=c(d),r=c(g),i=c(y),a=c(Ih),o=c(qd),s=c(U),u=c(Ve),l=c(Ic),f=c(Md);function c(e){return e&&e.__esModule?e:{default:e}}var h=t.THUMBNAILS_SCHEME_ID_URIS=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];function p(e){var t,i=this.context,d=e.adapter,c=e.baseURLController,g=e.streamInfo,p=e.timelineConverter,m=e.debug,_=e.eventBus,E=e.events,y=e.dashConstants,v=(0,o.default)(i).getInstance(),T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0;function w(){M(),I=(0,l.default)(i).create({}),R=(0,u.default)(i).getInstance(),(A=(0,f.default)(i).create({streamInfo:g,timelineConverter:p,baseURLController:c,debug:m,eventBus:_,events:E,dashConstants:y,urlUtils:v})).initialize(!!d&&d.getIsDynamic()),function(){if(!g||!d)return;if(!(b=d.getMediaInfoForType(g,n.default.IMAGE)))return;var e=d.getVoRepresentations(b);e&&e.length>0&&e.forEach((function(e){(e.segmentInfoType===r.default.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===r.default.SEGMENT_TIMELINE)&&N(e),e.segmentInfoType===r.default.SEGMENT_BASE&&N(e,!0)}));T.length>0&&(T.sort((function(e,t){return e.bitrate-t.bitrate})),S=T.length-1)}()}function N(e,t){var r=new a.default;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(h.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?_.trigger(s.default.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,{streamId:g.id,mediaType:n.default.IMAGE,mimeType:b.mimeType,representation:e,callback:function(e,t,n,i){var a=[];n=function(e,t){var n,r=[],i=0,a=void 0,o=void 0,s=void 0;for(a=0,n=e.length;a<n;a++)o=e[a],(s=(0,qf.getTimeBasedSegment)(p,d.getIsDynamic(),t,o.startTime,o.duration,o.timescale,o.media,o.mediaRange,i))&&(r.push(s),s=null,i++);return r}(n,i),r.segmentDuration=n[0].duration,r.readThumbnail=function(e,t){var r=null;a.some((function(t){if(t.start<=e&&t.end>e)return r=t.url,!0})),r?t(r):n.some((function(n){if(n.mediaStartTime<=e&&n.mediaStartTime+n.duration>e){var r=c.resolve(i.path);return I.load({method:"get",url:r.url,request:{range:n.mediaRange,responseType:"arraybuffer"},onload:function(e){var r=R.getSamplesInfo(e.target.response),i=new Blob([e.target.response.slice(r.sampleList[0].offset,r.sampleList[0].offset+r.sampleList[0].size)],{type:"image/jpeg"}),o=window.URL.createObjectURL(i);a.push({start:n.mediaStartTime,end:n.mediaStartTime+n.duration,url:o}),t&&t(o)}}),!0}}))}}}):(r.startNumber=e.startNumber,r.segmentDuration=e.segmentDuration,r.timescale=e.timescale,r.templateUrl=function(e){var t=v.isRelative(e.media)?v.resolve(e.media,c.resolve(e.path).url):e.media;if(!t)return"";return(0,qf.replaceIDForTemplate)(t,e.id)}(e)),r.tilesHor>0&&r.tilesVert>0&&(r.widthPerTile=r.width/r.tilesHor,r.heightPerTile=r.height/r.tilesVert,T.push(r))}function M(){T=[],S=-1,b=null}return t={initialize:w,getTracks:function(){return T},reset:M,setTrackByIndex:function(e){T&&0!==T.length&&(e>=T.length&&(e=T.length-1),S=e)},getCurrentTrack:function(){return S<0?null:T[S]},getCurrentTrackIndex:function(){return S},getThumbnailRequestForTime:function(e){for(var t=void 0,n=d.getVoRepresentations(b),r=0;r<n.length;r++)if(T[S].id===n[r].id){t=n[r];break}return A.getSegmentRequestForTime(b,t,e)}},w(),t}p.__dashjs_factory_name="ThumbnailTracks",t.default=i.default.getClassFactory(p)})),wh=qh(d),Nh=qh(g),Mh=qh($c),Ch=qh(eh),Dh=qh(rh),Oh=qh(ah),Ph=qh(sh),Lh=qh(lh),Fh=qh(ch),xh=qh(gh),Uh=qh(Sh),Bh=qh(qd),kh=qh(y),Gh=qh(Q),jh=qh(be),Yh=qh(na);function qh(e){return e&&e.__esModule?e:{default:e}}function Hh(){var e=void 0,t=void 0,n=void 0,r=void 0,i=this.context,a=(0,Bh.default)(i).getInstance(),o=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function s(e,t){var n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=!1,l=!1;if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.hasOwnProperty("ContentComponent_asArray")&&(a=e.ContentComponent_asArray),o=t!==wh.default.TEXT?new RegExp(t):new RegExp("(vtt|ttml)"),e.Representation_asArray&&e.Representation_asArray.length&&e.Representation_asArray.length>0){var f=E(e.Representation_asArray[0]);if(f&&f.length>0&&Rh.THUMBNAILS_SCHEME_ID_URIS.indexOf(f[0].schemeIdUri)>=0)return t===wh.default.IMAGE;if(e.Representation_asArray[0].hasOwnProperty(Nh.default.CODECS)&&(0===(s=e.Representation_asArray[0].codecs).search(wh.default.STPP)||0===s.search(wh.default.WVTT)))return t===wh.default.FRAGMENTED_TEXT}if(a){if(a.length>1)return t===wh.default.MUXED;a[0]&&a[0].contentType===t&&(u=!0,l=!0)}if(e.hasOwnProperty(Nh.default.MIME_TYPE)&&(u=o.test(e.mimeType),l=!0),!l)for(n=0,r=e.Representation_asArray&&e.Representation_asArray.length?e.Representation_asArray.length:0;!l&&n<r;)(i=e.Representation_asArray[n]).hasOwnProperty(Nh.default.MIME_TYPE)&&(u=o.test(i.mimeType),l=!0),n++;return u}function u(e){return s(e,wh.default.AUDIO)}function l(e){return s(e,wh.default.VIDEO)}function f(e){return s(e,wh.default.FRAGMENTED_TEXT)}function d(e){return s(e,wh.default.IMAGE)}function c(e){return"text/vtt"===e||"application/ttml+xml"===e}function h(){return function(e,t){return e.bandwidth-t.bandwidth}}function g(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort((function(e,t){return e.bandwidth-t.bandwidth})),e}function p(e,t){return e&&e.Period_asArray&&o(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function m(e){return e&&e.Period_asArray?e.Period_asArray:[]}function _(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===Nh.default.DYNAMIC),t}function E(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 y(e,t){if(!e)throw new Error("Period cannot be null or undefined");var n=Dh.default.DEFAULT_ID+"_"+t;return e.hasOwnProperty(Nh.default.ID)&&e.id.length>0&&"__proto__"!==e.id&&(n=e.id),n}function v(e,t){var n=[],r=void 0;if(!e)return n;for(r=0;r<e.length;r++){var i=new xh.default;if(i.timescale=1,i.representation=t,!e[r].hasOwnProperty(wh.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");i.schemeIdUri=e[r].schemeIdUri,e[r].hasOwnProperty(Nh.default.TIMESCALE)&&(i.timescale=e[r].timescale),e[r].hasOwnProperty(Nh.default.VALUE)&&(i.value=e[r].value),n.push(i)}return n}function T(e){var t=[],n=e.BaseURL_asArray||[e.baseUri],r=!1;return n.some((function(n){if(n){var i=new Fh.default,o=n.__text||n;return a.isRelative(o)&&(r=!0,e.baseUri&&(o=a.resolve(o,e.baseUri))),i.url=o,n.hasOwnProperty(Nh.default.SERVICE_LOCATION)&&n.serviceLocation.length?i.serviceLocation=n.serviceLocation:i.serviceLocation=o,n.hasOwnProperty(Nh.default.DVB_PRIORITY)&&(i.dvb_priority=n[Nh.default.DVB_PRIORITY]),n.hasOwnProperty(Nh.default.DVB_WEIGHT)&&(i.dvb_weight=n[Nh.default.DVB_WEIGHT]),n.hasOwnProperty(Nh.default.AVAILABILITY_TIME_OFFSET)&&(i.availabilityTimeOffset=n[Nh.default.AVAILABILITY_TIME_OFFSET]),n.hasOwnProperty(Nh.default.AVAILABILITY_TIME_COMPLETE)&&(i.availabilityTimeComplete="false"!==n[Nh.default.AVAILABILITY_TIME_COMPLETE]),t.push(i),r}})),t}return e={getIsTypeOf:s,getIsTextTrack:c,getLanguageForAdaptation:function(e){var t="";return e&&e.hasOwnProperty(Nh.default.LANG)&&(t=e.lang.replace(/[^A-Za-z0-9-]/g,"")),t},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(Nh.default.VIEWPOINT)?e.Viewpoint:null},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(Nh.default.ROLE_ASARRAY)?e.Role_asArray:[]},getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(Nh.default.ACCESSIBILITY_ASARRAY)?e.Accessibility_asArray:[]},getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(Nh.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(Nh.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAdaptationForIndex:function(e,t,n){var r=p(t,n);return r.length>0&&o(e)?r[e]:null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;for(var r=p(t,n),a=0;a<r.length;a++){if((0,Uh.default)(i).getInstance().areEqual(r[a],e))return a}return-1},getAdaptationForId:function(e,t,n){var r,i=p(t,n),a=void 0;for(a=0,r=i.length;a<r;a++)if(i[a].hasOwnProperty(Nh.default.ID)&&i[a].id===e)return i[a];return null},getAdaptationsForType:function(e,t,n){var r,i=p(e,t),a=void 0,o=[];for(a=0,r=i.length;a<r;a++)s(i[a],n)&&o.push(g(i[a]));return o},getRealPeriods:m,getRealPeriodForIndex:function(e,t){var n=m(t);return n.length>0&&o(e)?n[e]:null},getCodec:function(e,t,n){var r=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var i=o(t)&&t>=0&&t<e.Representation_asArray.length?e.Representation_asArray[t]:e.Representation_asArray[0];i&&(r=i.mimeType+';codecs="'+i.codecs+'"',n&&void 0!==i.width&&(r+=';width="'+i.width+'";height="'+i.height+'"'))}return r&&(r=r.replace(/\sprofiles=[^;]*/g,"")),r},getMimeType:function(e){return e&&e.Representation_asArray&&e.Representation_asArray.length>0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(Nh.default.CENC_DEFAULT_KID)?e[Nh.default.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],n=0;n<e.Label_asArray.length;n++)t.push({lang:e.Label_asArray[n].lang,text:e.Label_asArray[n].__text||e.Label_asArray[n]});return t},getContentProtectionData:function(e){return e&&e.hasOwnProperty(Nh.default.CONTENTPROTECTION_ASARRAY)&&0!==e.ContentProtection_asArray.length?e.ContentProtection_asArray:null},getIsDynamic:_,getId:function(e){return e&&e[Nh.default.ID]||null},hasProfile:function(e,t){var n=!1;return e&&e.profiles&&e.profiles.length>0&&(n=-1!==e.profiles.indexOf(t)),n},getDuration:function(e){return e&&e.hasOwnProperty(Nh.default.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(Nh.default.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(Nh.default.PUBLISH_TIME)?new Date(e[Nh.default.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=g(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&&o(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,n,r,i,a,s=[],u=function(e){if(e&&e.period&&o(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&o(e.index))return g(t.AdaptationSet_asArray[e.index])}}(e),l=void 0,f=void 0;if(u&&u.Representation_asArray){if(e&&e.period&&o(e.period.index)){var d=T(e.period.mpd.manifest);d&&(f=d[0])}for(var h=0,p=u.Representation_asArray.length;h<p;++h){var m=u.Representation_asArray[h],_=new Mh.default;if(_.index=h,_.adaptation=e,m.hasOwnProperty(Nh.default.ID)&&(_.id=m.id),m.hasOwnProperty(Nh.default.CODECS)&&(_.codecs=m.codecs),m.hasOwnProperty(Nh.default.CODEC_PRIVATE_DATA)&&(_.codecPrivateData=m.codecPrivateData),m.hasOwnProperty(Nh.default.BANDWITH)&&(_.bandwidth=m.bandwidth),m.hasOwnProperty(Nh.default.WIDTH)&&(_.width=m.width),m.hasOwnProperty(Nh.default.HEIGHT)&&(_.height=m.height),m.hasOwnProperty(Nh.default.SCAN_TYPE)&&(_.scanType=m.scanType),m.hasOwnProperty(Nh.default.MAX_PLAYOUT_RATE)&&(_.maxPlayoutRate=m.maxPlayoutRate),m.hasOwnProperty(Nh.default.SEGMENT_BASE)?(l=m.SegmentBase,_.segmentInfoType=Nh.default.SEGMENT_BASE):m.hasOwnProperty(Nh.default.SEGMENT_LIST)?(l=m.SegmentList).hasOwnProperty(Nh.default.SEGMENT_TIMELINE)?_.segmentInfoType=Nh.default.SEGMENT_TIMELINE:_.segmentInfoType=Nh.default.SEGMENT_LIST:m.hasOwnProperty(Nh.default.SEGMENT_TEMPLATE)?((l=m.SegmentTemplate).hasOwnProperty(Nh.default.SEGMENT_TIMELINE)?_.segmentInfoType=Nh.default.SEGMENT_TIMELINE:_.segmentInfoType=Nh.default.SEGMENT_TEMPLATE,l.hasOwnProperty(Nh.default.INITIALIZATION_MINUS)&&(_.initialization=l.initialization.split("$Bandwidth$").join(m.bandwidth).split("$RepresentationID$").join(m.id))):_.segmentInfoType=Nh.default.BASE_URL,_.essentialProperties=E(m),l){if(l.hasOwnProperty(Nh.default.INITIALIZATION)){var y=l.Initialization;y.hasOwnProperty(Nh.default.SOURCE_URL)&&(_.initialization=y.sourceURL),y.hasOwnProperty(Nh.default.RANGE)&&(_.range=y.range)}else m.hasOwnProperty(Nh.default.MIME_TYPE)&&c(m.mimeType)&&(_.range=0);l.hasOwnProperty(Nh.default.TIMESCALE)&&(_.timescale=l.timescale),l.hasOwnProperty(Nh.default.DURATION)?_.segmentDuration=l.duration/_.timescale:m.hasOwnProperty(Nh.default.SEGMENT_TEMPLATE)&&(l=m.SegmentTemplate).hasOwnProperty(Nh.default.SEGMENT_TIMELINE)&&(_.segmentDuration=(r=l.SegmentTimeline,i=void 0,a=void 0,i=r.S_asArray[0],a=r.S_asArray[1],(i.hasOwnProperty("d")?i.d:a.t-i.t)/_.timescale)),l.hasOwnProperty(Nh.default.MEDIA)&&(_.media=l.media),l.hasOwnProperty(Nh.default.START_NUMBER)&&(_.startNumber=l.startNumber),l.hasOwnProperty(Nh.default.INDEX_RANGE)&&(_.indexRange=l.indexRange),l.hasOwnProperty(Nh.default.PRESENTATION_TIME_OFFSET)&&(_.presentationTimeOffset=l.presentationTimeOffset/_.timescale),l.hasOwnProperty(Nh.default.AVAILABILITY_TIME_OFFSET)?_.availabilityTimeOffset=l.availabilityTimeOffset:f&&void 0!==f.availabilityTimeOffset&&(_.availabilityTimeOffset=f.availabilityTimeOffset),l.hasOwnProperty(Nh.default.AVAILABILITY_TIME_COMPLETE)?_.availabilityTimeComplete="false"!==l.availabilityTimeComplete:f&&void 0!==f.availabilityTimeComplete&&(_.availabilityTimeComplete=f.availabilityTimeComplete)}_.MSETimeOffset=(n=void 0,void 0,n=(t=_).presentationTimeOffset,t.adaptation.period.start-n),_.path=[e.period.index,e.index,h],s.push(_)}}return s},getAdaptationsForPeriod:function(e){var t=e&&o(e.index)?e.mpd.manifest.Period_asArray[e.index]:null,n=[],r=void 0,i=void 0,a=void 0;if(t&&t.AdaptationSet_asArray)for(a=0;a<t.AdaptationSet_asArray.length;a++)i=t.AdaptationSet_asArray[a],r=new Ch.default,i.hasOwnProperty(Nh.default.ID)&&(r.id=i.id),r.index=a,r.period=e,s(i,wh.default.MUXED)?r.type=wh.default.MUXED:u(i)?r.type=wh.default.AUDIO:l(i)?r.type=wh.default.VIDEO:f(i)?r.type=wh.default.FRAGMENTED_TEXT:d(i)?r.type=wh.default.IMAGE:r.type=wh.default.TEXT,n.push(r);return n},getRegularPeriods:function(e){var r,i=!!e&&_(e.manifest),a=[],o=null,s=null,u=null,l=null,f=void 0;for(f=0,r=e&&e.manifest&&e.manifest.Period_asArray?e.manifest.Period_asArray.length:0;f<r;f++)(s=e.manifest.Period_asArray[f]).hasOwnProperty(Nh.default.START)?(l=new Dh.default).start=s.start:null!==o&&o.hasOwnProperty(Nh.default.DURATION)&&null!==u?(l=new Dh.default).start=parseFloat((u.start+u.duration).toFixed(5)):0!==f||i||((l=new Dh.default).start=0),null!==u&&isNaN(u.duration)&&(null!==l?u.duration=parseFloat((l.start-u.start).toFixed(5)):t.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),null!==l&&(l.id=y(s,f),l.index=f,l.mpd=e,s.hasOwnProperty(Nh.default.DURATION)&&(l.duration=s.duration),a.push(l),o=s,u=l),s=null,l=null;return 0===a.length||null!==u&&isNaN(u.duration)&&(u.duration=parseFloat((function(e){!function(){if(!n||!n.hasOwnProperty("error"))throw new Error(wh.default.MISSING_CONFIG_ERROR)}();var t=_(e.mpd.manifest),r=void 0;e.mpd.manifest.mediaPresentationDuration?r=e.mpd.manifest.mediaPresentationDuration:e.duration?r=e.duration:t?r=Number.POSITIVE_INFINITY:n.error(new jh.default(Yh.default.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",e));return r}(u)-u.start).toFixed(5))),a},getMpd:function(e){var t=new Oh.default;return e&&(t.manifest=e,e.hasOwnProperty(Nh.default.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(Nh.default.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(Nh.default.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(Nh.default.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(Nh.default.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(Nh.default.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(Nh.default.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration),e.hasOwnProperty(Nh.default.PUBLISH_TIME)&&(t.publishTime=new Date(e.publishTime))),t},getEventsForPeriod:function(e){var t=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,n=t?t.Period_asArray:null,i=n&&e&&o(e.index)?n[e.index].EventStream_asArray:null,a=[],s=void 0,u=void 0;if(i)for(s=0;s<i.length;s++){var l=new xh.default;if(l.period=e,l.timescale=1,!i[s].hasOwnProperty(wh.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(l.schemeIdUri=i[s][wh.default.SCHEME_ID_URI],i[s].hasOwnProperty(Nh.default.TIMESCALE)&&(l.timescale=i[s][Nh.default.TIMESCALE]),i[s].hasOwnProperty(Nh.default.VALUE)&&(l.value=i[s][Nh.default.VALUE]),i[s].hasOwnProperty(Nh.default.PRESENTATION_TIME_OFFSET)&&(l.presentationTimeOffset=i[s][Nh.default.PRESENTATION_TIME_OFFSET]),u=0;i[s].Event_asArray&&u<i[s].Event_asArray.length;u++){var f=i[s].Event_asArray[u],d=new Lh.default;if(d.presentationTime=0,d.eventStream=l,f.hasOwnProperty(Nh.default.PRESENTATION_TIME)){d.presentationTime=f.presentationTime;var c=l.presentationTimeOffset?l.presentationTimeOffset/l.timescale:0;d.calculatedPresentationTime=d.presentationTime/l.timescale+e.start-c}f.hasOwnProperty(Nh.default.DURATION)&&(d.duration=f.duration/l.timescale),f.hasOwnProperty(Nh.default.ID)&&(d.id=f.id),f.Signal&&f.Signal.Binary?d.messageData=r.decodeArray(f.Signal.Binary.toString()):d.messageData=f.messageData||f.__text,a.push(d)}}return a},getEssentialPropertiesForRepresentation:E,getEventStreamForAdaptationSet:function(e,t){var n=void 0,r=void 0,i=void 0;return e&&e.Period_asArray&&t&&t.period&&o(t.period.index)&&(r=e.Period_asArray[t.period.index])&&r.AdaptationSet_asArray&&o(t.index)&&(i=r.AdaptationSet_asArray[t.index])&&(n=i.InbandEventStream_asArray),v(n,null)},getEventStreamForRepresentation:function(e,t){var n=void 0,r=void 0,i=void 0,a=void 0;return e&&e.Period_asArray&&t&&t.adaptation&&t.adaptation.period&&o(t.adaptation.period.index)&&(r=e.Period_asArray[t.adaptation.period.index])&&r.AdaptationSet_asArray&&o(t.adaptation.index)&&(i=r.AdaptationSet_asArray[t.adaptation.index])&&i.Representation_asArray&&o(t.index)&&(a=i.Representation_asArray[t.index])&&(n=a.InbandEventStream_asArray),v(n,t)},getUTCTimingSources:function(e){var t=_(e),n=!!e&&e.hasOwnProperty(Nh.default.AVAILABILITY_START_TIME),r=e?e.UTCTiming_asArray:null,i=[];return(t||n)&&r&&r.forEach((function(e){var t=new Ph.default;e.hasOwnProperty(wh.default.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(Nh.default.VALUE)&&(t.value=e.value.toString(),i.push(t)))})),i},getBaseURLsFromElement:T,getRepresentationSortFunction:h,getLocation:function(e){if(e&&e.hasOwnProperty(wh.default.LOCATION))return e.Location=e.Location_asArray[0],e.Location},getPatchLocation:function(e){if(e&&e.hasOwnProperty(Nh.default.PATCH_LOCATION))return e.PatchLocation=e.PatchLocation_asArray[0],e.PatchLocation},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(Nh.default.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(Nh.default.AVAILABILITY_START_TIME)&&null!==e.availabilityStartTime?e.availabilityStartTime.getTime():null},getServiceDescriptions:function(e){var t=[];if(e&&e.hasOwnProperty(Nh.default.SERVICE_DESCRIPTION)){var n=!0,r=!1,i=void 0;try{for(var a,o=e.ServiceDescription_asArray[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value,u=void 0,l=void 0,f=void 0,d=void 0;for(var c in s)s.hasOwnProperty(c)&&(c===Nh.default.ID?u=s[c]:c===Nh.default.SERVICE_DESCRIPTION_SCOPE?l=s[c].schemeIdUri:c===Nh.default.SERVICE_DESCRIPTION_LATENCY?f={target:s[c].target,max:s[c].max,min:s[c].min}:c===Nh.default.SERVICE_DESCRIPTION_PLAYBACK_RATE&&(d={max:s[c].max,min:s[c].min}));l===wh.default.SERVICE_DESCRIPTION_LL_SCHEME&&(f||d)&&t.push({id:u,schemeIdUri:l,latency:f,playbackRate:d})}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}}return t},getSupplementalPropperties:function(e){var t={};if(e&&e.hasOwnProperty(Nh.default.SUPPLEMENTAL_PROPERTY)){var n=!0,r=!1,i=void 0;try{for(var a,o=e.SupplementalProperty_asArray[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;s.hasOwnProperty(wh.default.SCHEME_ID_URI)&&s.hasOwnProperty(Nh.default.VALUE)&&(t[s[wh.default.SCHEME_ID_URI]]=s[Nh.default.VALUE])}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}}return t},setConfig:function(e){e&&(e.errHandler&&(n=e.errHandler),e.BASE64&&(r=e.BASE64))}},t=(0,Gh.default)(i).getInstance().getLogger(e),e}Hh.__dashjs_factory_name="DashManifestModel";var Kh=kh.default.getSingletonFactory(Hh),Vh=Object.defineProperty({default:Kh},"__esModule",{value:!0}),zh=ng(O),Wh=ng(I),Xh=ng(Wc),Qh=ng(y),Zh=ng(Q),$h=ng(kc),Jh=ng(d),eg=ng(Vh),tg=ng(Mc);function ng(e){return e&&e.__esModule?e:{default:e}}var rg="m",ig="a",ag="v",og="i",sg="c",ug="tt",lg="k",fg="o",dg="d",cg="s",hg="v",gg="l";function pg(){var e=void 0,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=this.context,d=(0,zh.default)(f).getInstance(),c=(0,$h.default)(f).getInstance();function h(){n={pr:1,nor:null,st:null,sf:null,sid:""+tg.default.generateUuid(),cid:null},u={},s={},l={},p()}function g(){p()}function p(){if(a){var e=a.getStreamController();if(e&&"function"==typeof e.getActiveStream){var t=e.getActiveStream();t&&(o=t.getProcessors())}}}function m(e,t){var n={},r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;e[u]&&(n[u]=e[u])}}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}function _(e){try{return e.type===de.HTTPRequest.MPD_TYPE?((t=E()).ot=""+rg,t):e.type===de.HTTPRequest.MEDIA_SEGMENT_TYPE?(function(e){l.hasOwnProperty(e)||(l[e]=!1);s.hasOwnProperty(e)||(s[e]=!1);u.hasOwnProperty(e)||(u[e]=!1)}(e.mediaType),function(e){var t=E(),f=function(e){try{var t=e.quality,n=e.mediaInfo.bitrateList;return parseInt(n[t].bandwidth/1e3)}catch(e){return null}}(e),d=function(e){try{return isNaN(e.duration)?null:Math.round(1e3*e.duration)}catch(e){return null}}(e),h=function(e){try{return 100*parseInt(r.getThroughputHistory().getSafeAverageThroughput(e)/100)}catch(e){return null}}(e.mediaType),g=function(e){try{var t=n.pr,r=i.getCurrentBufferLevel(e);return isNaN(t)||isNaN(r)?null:100*parseInt(r/t*10)}catch(e){return null}}(e.mediaType),p=y(e.mediaType),m=function(e){try{var t=r.getTopBitrateInfoFor(e);return Math.round(t.bitrate/1e3)}catch(e){return null}}(e.mediaType),_=n.pr,v=function(e){if(!o||0===o.length)return;var t=!0,n=!1,r=void 0;try{for(var i,a=o[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var s=i.value;if(s.getType()===e)return s.probeNextRequest()}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}(e.mediaType),T=void 0;e.mediaType===Jh.default.VIDEO&&(T=ag);e.mediaType===Jh.default.AUDIO&&(T=ig);e.mediaType===Jh.default.FRAGMENTED_TEXT&&(T="application/mp4"===e.mediaInfo.mimeType?ug:sg);var A=c.get().streaming.cmcd.rtp;A||(A=function(e){var t=a.getPlaybackRate();t||(t=1);var n=e.quality,r=e.mediaType,i=e.mediaInfo,o=e.duration,s=y(r);0===s&&(s=500);var u=i.bitrateList[n].bandwidth*o/1e3/(s/t/1e3),l=c.get().streaming.cmcd.rtpSafetyFactor&&!isNaN(c.get().streaming.cmcd.rtpSafetyFactor)?c.get().streaming.cmcd.rtpSafetyFactor:5;return 100*(parseInt(u*l/100)+1)}(e));if(t.rtp=A,v)if(e.url!==v.url){var S=new URL(v.url);t.nor=S.pathname}else v.range&&(t.nrr=v.range);f&&(t.br=f);T&&(t.ot=T);isNaN(d)||(t.d=d);isNaN(h)||(t.mtp=h);isNaN(g)||(t.dl=g);isNaN(p)||(t.bl=p);isNaN(m)||(t.tb=m);isNaN(_)||1===_||(t.pr=_);u[e.mediaType]&&(t.bs=!0,u[e.mediaType]=!1);!s[e.mediaType]&&l[e.mediaType]||(t.su=!0,s[e.mediaType]=!1,l[e.mediaType]=!0);return t}(e)):e.type===de.HTTPRequest.INIT_SEGMENT_TYPE?function(){var e=E();return e.ot=""+og,e.su=!0,e}():e.type===de.HTTPRequest.OTHER_TYPE||e.type===de.HTTPRequest.XLINK_EXPANSION_TYPE?function(){var e=E();return e.ot=""+fg,e}():e.type===de.HTTPRequest.LICENSE?function(e){var t=E();return t.ot=lg,t}():null}catch(e){return null}var t}function E(){var e={},t=c.get().streaming.cmcd.cid?c.get().streaming.cmcd.cid:n.cid;return e.v=1,e.sid=c.get().streaming.cmcd.sid?c.get().streaming.cmcd.sid:n.sid,e.sid=""+e.sid,t&&(e.cid=""+t),isNaN(n.pr)||1===n.pr||null===n.pr||(e.pr=n.pr),n.st&&(e.st=n.st),n.sf&&(e.sf=n.sf),e}function y(e){try{var t=i.getCurrentBufferLevel(e);return isNaN(t)?null:100*parseInt(10*t)}catch(e){return null}}function v(e){try{n.pr=e.playbackRate}catch(e){}}function T(t){try{var r=e.getIsDynamic(t.data)?""+gg:""+hg,i=t.protocol&&"MSS"===t.protocol?""+cg:""+dg;n.st=""+r,n.sf=""+i}catch(e){}}function A(e){try{e.state&&e.mediaType&&e.state===Wh.default.BUFFER_EMPTY&&(u[e.mediaType]||(u[e.mediaType]=!0),s[e.mediaType]||(s[e.mediaType]=!0))}catch(e){}}function S(){for(var e in u)u.hasOwnProperty(e)&&(u[e]=!0);for(var t in s)s.hasOwnProperty(t)&&(s[t]=!0)}function b(e){try{if(!e)return null;var t=Object.keys(e).sort((function(e,t){return e.localeCompare(t)})),n=t.length,r=t.reduce((function(t,r,i){if("v"===r&&1===e[r])return t;"string"!=typeof e[r]||"ot"===r&&"sf"===r&&"st"===r?t+=r+"="+e[r]:t+=r+'="'+e[r].replace(/"/g,'"')+'"';return i<n-1&&(t+=","),t}),"");return r=r.replace(/=true/g,"")}catch(e){return null}}return t={getQueryParameter:function(e){try{if(c.get().streaming.cmcd&&c.get().streaming.cmcd.enabled){var t=_(e),n=b(t);return d.trigger(Xh.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,cmcdString:n}),{key:"CMCD",value:n}}return null}catch(e){return null}},getHeaderParameters:function(e){try{if(c.get().streaming.cmcd&&c.get().streaming.cmcd.enabled){var t=_(e),n=m(t,["br","d","ot","tb"]),r=m(t,["bl","dl","mtp","nor","nrr","su"]),i=m(t,["bs","rtp"]),a=m(t,["cid","pr","sf","sid","st","v"]),o={"CMCD-Object":b(n),"CMCD-Request":b(r),"CMCD-Status":b(i),"CMCD-Session":b(a)};return d.trigger(Xh.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t}),o}return null}catch(e){return null}},setConfig:function(e){e&&(e.abrController&&(r=e.abrController),e.dashMetrics&&(i=e.dashMetrics),e.playbackController&&(a=e.playbackController))},reset:function(){d.off(Wh.default.PLAYBACK_RATE_CHANGED,v,this),d.off(Wh.default.MANIFEST_LOADED,T,this),d.off(Wh.default.BUFFER_LEVEL_STATE_CHANGED,A,t),d.off(Wh.default.PLAYBACK_SEEKED,S,t),h()},initialize:function(){d.on(Wh.default.PLAYBACK_RATE_CHANGED,v,t),d.on(Wh.default.MANIFEST_LOADED,T,t),d.on(Wh.default.BUFFER_LEVEL_STATE_CHANGED,A,t),d.on(Wh.default.PLAYBACK_SEEKED,S,t),d.on(Wh.default.PERIOD_SWITCH_COMPLETED,g,t)}},(0,Zh.default)(f).getInstance().getLogger(t),e=(0,eg.default)(f).getInstance(),h(),t}pg.__dashjs_factory_name="CmcdModel";var mg=Qh.default.getSingletonFactory(pg),_g=Object.defineProperty({default:mg},"__esModule",{value:!0}),Eg=Mg(Ic),yg=Mg(Vc),vg=Mg(y),Tg=Mg(be),Ag=Mg(_g),Sg=Mg(Mc),bg=Mg(Q),Ig=Mg(O),Rg=Mg(U),wg=Mg(kc),Ng=Mg(d);function Mg(e){return e&&e.__esModule?e:{default:e}}function Cg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dg(e){e=e||{};var t,n=this.context,r=e.errHandler,i=e.dashMetrics,a=e.mediaPlayerModel,o=e.requestModifier,s=e.boxParser,u=e.useFetch||!1,l=e.errors,f=e.requestTimeout||0,d=(0,Ig.default)(n).getInstance(),c=(0,wg.default)(n).getInstance(),h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0;function v(e,t){var l=e.request,h=[],T=!0,A=!0,S=new Date,b=S,I=0,R=void 0;if(!o||!i||!r)throw new Error("config object is not correct or missing");var w=function(e){A=!1,l.requestStartDate=S,l.requestEndDate=new Date,l.firstByteDate=l.firstByteDate||S,l.checkExistenceOnly||(i.addHttpRequest(l,R.response?R.response.responseURL:null,R.response?R.response.status:null,R.response&&R.response.getAllResponseHeaders?R.response.getAllResponseHeaders():R.response?R.response.responseHeaders:[],e?h:null),l.type===de.HTTPRequest.MPD_TYPE&&i.addManifestUpdate(l))},N=function(){if(-1!==g.indexOf(R)&&(g.splice(g.indexOf(R),1),A))if(w(!1),t>0){try{if(c.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&l.type===de.HTTPRequest.MEDIA_SEGMENT_TYPE)a.getRetryAttemptsForType(de.HTTPRequest.MEDIA_SEGMENT_TYPE)===t&&d.trigger(Rg.default.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var n={config:e};m.push(n),n.timeout=setTimeout((function(){-1!==m.indexOf(n)&&(m.splice(m.indexOf(n),1),v(e,t))}),a.getRetryIntervalsForType(l.type))}else{if(l.type===de.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;r.error(new Tg.default(_[l.type],l.url+" is not available",{request:l,response:R.response})),e.error&&e.error(l,"error",R.response.statusText),e.complete&&e.complete(l,R.response.statusText)}},M=void 0;M=u&&window.fetch&&"arraybuffer"===l.responseType&&l.type===de.HTTPRequest.MEDIA_SEGMENT_TYPE?(0,yg.default)(n).create({requestModifier:o,boxParser:s}):(0,Eg.default)(n).create({requestModifier:o});var C=null,D=o.modifyRequestURL(l.url);if(c.get().streaming.cmcd&&c.get().streaming.cmcd.enabled){var O=c.get().streaming.cmcd.mode;if(O===Ng.default.CMCD_MODE_QUERY){var P=function(e){try{var t=[],n=E.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(l);D=Sg.default.addAditionalQueryParameterToUrl(D,P)}else O===Ng.default.CMCD_MODE_HEADER&&(C=E.getHeaderParameters(l))}var L=l.checkExistenceOnly?de.HTTPRequest.HEAD:de.HTTPRequest.GET,F=a.getXHRWithCredentialsForType(l.type);R={url:D,method:L,withCredentials:F,request:l,onload:function(){R.response.status>=200&&R.response.status<=299&&(w(!0),e.success&&e.success(R.response.response,R.response.statusText,R.response.responseURL),e.complete&&e.complete(l,R.response.statusText))},onend:N,onerror:N,progress:function(t){var n=new Date;T&&(T=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(l.firstByteDate=n)),t.lengthComputable&&(l.bytesLoaded=t.loaded,l.bytesTotal=t.total),t.noTrace||(h.push({s:b,d:t.time?t.time:n.getTime()-b.getTime(),b:[t.loaded?t.loaded-I:0]}),b=n,I=t.loaded),e.progress&&t&&e.progress(t)},onabort:function(){e.abort&&e.abort(l)},ontimeout:function(e){var t=void 0;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";y.warn(t)},loader:M,timeout:f,headers:C};var x=(new Date).getTime();if(isNaN(l.delayLoadingTime)||x>=l.delayLoadingTime)g.push(R),M.load(R);else{var U={httpRequest:R};p.push(U),U.delayTimeout=setTimeout((function(){if(-1!==p.indexOf(U)){p.splice(p.indexOf(U),1);try{S=new Date,b=S,g.push(U.httpRequest),M.load(U.httpRequest)}catch(e){U.httpRequest.onerror()}}}),l.delayLoadingTime-x)}}return h={load:function(e){e.request?v(e,a.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){m.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),m=[],p.forEach((function(e){return clearTimeout(e.delayTimeout)})),p=[],g.forEach((function(e){e.request.type!==de.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))})),g=[]}},y=(0,bg.default)(n).getInstance().getLogger(h),g=[],p=[],m=[],E=(0,Ag.default)(n).getInstance(),Cg(t={},de.HTTPRequest.MPD_TYPE,l.DOWNLOAD_ERROR_ID_MANIFEST_CODE),Cg(t,de.HTTPRequest.XLINK_EXPANSION_TYPE,l.DOWNLOAD_ERROR_ID_XLINK_CODE),Cg(t,de.HTTPRequest.INIT_SEGMENT_TYPE,l.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),Cg(t,de.HTTPRequest.MEDIA_SEGMENT_TYPE,l.DOWNLOAD_ERROR_ID_CONTENT_CODE),Cg(t,de.HTTPRequest.INDEX_SEGMENT_TYPE,l.DOWNLOAD_ERROR_ID_CONTENT_CODE),Cg(t,de.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,l.DOWNLOAD_ERROR_ID_CONTENT_CODE),Cg(t,de.HTTPRequest.OTHER_TYPE,l.DOWNLOAD_ERROR_ID_CONTENT_CODE),_=t,h}Dg.__dashjs_factory_name="HTTPLoader";var Og=vg.default.getClassFactory(Dg),Pg=Object.defineProperty({default:Og},"__esModule",{value:!0}),Lg=xg(y),Fg=xg(Pg);function xg(e){return e&&e.__esModule?e:{default:e}}function Ug(){var e=void 0;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 Fg.default},registerLoader:function(t,n){e[t]=n},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:n}}Ug.__dashjs_factory_name="SchemeLoaderFactory";var Bg=Lg.default.getSingletonFactory(Ug),kg=Object.defineProperty({default:Bg},"__esModule",{value:!0}),Gg=Yg(y),jg=Yg(kg);function Yg(e){return e&&e.__esModule?e:{default:e}}function qg(e){e=e||{};var t=this.context,n=void 0,r=void 0;return n=(0,jg.default)(t).getInstance(),{load:function(i){var a=n.getLoader(i&&i.request?i.request.url:null);(r=a(t).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.useFetch||null,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})).load(i)},abort:function(){r&&r.abort()}}}qg.__dashjs_factory_name="URLLoader";var Hg=Gg.default.getClassFactory(qg),Kg=Object.defineProperty({default:Hg},"__esModule",{value:!0});var Vg=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.checkForExistenceOnly=!0,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(pe).default),zg=Object.defineProperty({default:Vg},"__esModule",{value:!0}),Wg=Jg(d),Xg=Jg(Kg),Qg=Jg(zg),Zg=Jg(be),$g=Jg(y);function Jg(e){return e&&e.__esModule?e:{default:e}}function ep(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,i=e.urlUtils,a=e.errors,o=void 0,s=void 0;return o={checkForExistence:function(e){var t=function(t){n.trigger(r.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){var i=new Qg.default(e.url);s.load({request:i,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){var t=function(t,i){n.trigger(r.LOADING_COMPLETED,{request:e,response:t||null,error:i||null,sender:o})};e?s.load({request:e,progress:function(t){n.trigger(r.LOADING_PROGRESS,{request:e,stream:t.stream}),t.data&&n.trigger(r.LOADING_DATA_PROGRESS,{request:e,response:t.data||null,error:null,sender:o})},success:function(e){t(e)},error:function(e,n,r){t(void 0,new Zg.default(a.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,r,n))},abort:function(e){e&&n.trigger(r.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:o})}}):t(void 0,new Zg.default(a.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,a.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){s&&s.abort()},reset:function(){s&&(s.abort(),s=null)}},s=(0,Xg.default)(t).create({errHandler:e.errHandler,errors:a,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings.get().streaming.lowLatencyEnabled,urlUtils:i,constants:Wg.default,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),o}ep.__dashjs_factory_name="FragmentLoader";var tp=$g.default.getClassFactory(ep),np=Object.defineProperty({default:tp},"__esModule",{value:!0}),rp=hp(d),ip=hp(Tc),ap=hp(Ae),op=hp(np),sp=hp(Pd),up=hp(O),lp=hp(U),fp=hp(na),dp=hp(y),cp=hp(Q);function hp(e){return e&&e.__esModule?e:{default:e}}function gp(e){e=e||{};var t=this.context,n=(0,up.default)(t).getInstance(),r=e.errHandler,i=e.mediaPlayerModel,a=e.dashMetrics,o=(0,cp.default)(t).getInstance(),s=e.streamInfo,u=void 0,l=void 0,f=void 0;function d(){for(var e in f)f[e].reset();f={}}function c(e){if(e.sender){var t=e.request,r=e.response,i=t.isInitializationRequest(),a=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType!==rp.default.AUDIO&&t.mediaType!==rp.default.VIDEO&&t.mediaType!==rp.default.FRAGMENTED_TEXT||n.trigger(lp.default.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation})),r&&a){var o=function(e,t,n,r){var i=new ip.default;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,s.id,e.type!==lp.default.FRAGMENT_LOADING_PROGRESS);n.trigger(i?lp.default.INIT_FRAGMENT_LOADED:lp.default.MEDIA_FRAGMENT_LOADED,{chunk:o,request:t},{streamId:a.id,mediaType:t.mediaType})}else l.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return u={getStreamId:function(){return s.id},getModel:function(u){var l=f[u];return l||(l=(0,ap.default)(t).create({streamInfo:s,type:u,dashMetrics:a,fragmentLoader:(0,op.default)(t).create({dashMetrics:a,mediaPlayerModel:i,errHandler:r,requestModifier:(0,sp.default)(t).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:n,events:lp.default,errors:fp.default,dashConstants:e.dashConstants,urlUtils:e.urlUtils}),debug:o,eventBus:n,events:lp.default}),f[u]=l),l},reset:function(){n.off(lp.default.FRAGMENT_LOADING_COMPLETED,c,this),n.off(lp.default.FRAGMENT_LOADING_PROGRESS,c,this),d()}},l=o.getLogger(u),d(),n.on(lp.default.FRAGMENT_LOADING_COMPLETED,c,u),n.on(lp.default.FRAGMENT_LOADING_PROGRESS,c,u),u}gp.__dashjs_factory_name="FragmentController";var pp=dp.default.getClassFactory(gp),mp=Object.defineProperty({default:pp},"__esModule",{value:!0});var _p=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},Ep=Object.defineProperty({default:_p},"__esModule",{value:!0}),yp=bp(y),vp=bp(d),Tp=bp(Ep),Ap=bp(Rh),Sp=bp(bu);function bp(e){return e&&e.__esModule?e:{default:e}}function Ip(e){var t,n=this.context,r=e.streamInfo,i=void 0;function a(){i&&i.reset()}return t={getStreamId:function(){return r.id},provide:function(e,t){if("function"==typeof t){var n,r=i.getCurrentTrack(),a=void 0;if(!r||r.segmentDuration<=0||null==e)t(null);else{isNaN(r.segmentDuration)&&(a=i.getThumbnailRequestForTime(e))&&(r.segmentDuration=a.duration),n=e%r.segmentDuration;var o=Math.floor(n*r.tilesHor*r.tilesVert/r.segmentDuration),s=new Tp.default;if(s.width=Math.floor(r.widthPerTile),s.height=Math.floor(r.heightPerTile),s.x=Math.floor(o%r.tilesHor)*r.widthPerTile,s.y=Math.floor(o/r.tilesHor)*r.heightPerTile,"readThumbnail"in r)return r.readThumbnail(e,(function(e){s.url=e,t(s)}));if(a)s.url=a.url,r.segmentDuration=NaN;else{var u=Math.floor(e/r.segmentDuration);s.url=function(e,t){var n=t+e.startNumber,r=(0,qf.replaceTokenForTemplate)(e.templateUrl,"Number",n);return r=(0,qf.replaceTokenForTemplate)(r,"Time",(n-1)*e.segmentDuration*e.timescale),r=(0,qf.replaceTokenForTemplate)(r,"Bandwidth",e.bandwidth),(0,qf.unescapeDollarsInTemplate)(r)}(r,u)}t(s)}}},setTrackByIndex:function(e){i.setTrackByIndex(e)},getCurrentTrackIndex:function(){return i.getCurrentTrackIndex()},getBitrateList:function(){var e=i.getTracks(),t=0;return e.map((function(e){var n=new Sp.default;return n.mediaType=vp.default.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:a},a(),i=(0,Ap.default)(n).create({streamInfo:r,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants}),t}Ip.__dashjs_factory_name="ThumbnailController";var Rp=yp.default.getClassFactory(Ip),wp=Object.defineProperty({default:Rp},"__esModule",{value:!0}),Np=jp(d),Mp=jp(g),Cp=jp(yc),Dp=jp(mp),Op=jp(wp),Pp=jp(O),Lp=jp(U),Fp=jp(Q),xp=jp(na),Up=jp(y),Bp=jp(be),kp=jp(Ve),Gp=jp(qd);function jp(e){return e&&e.__esModule?e:{default:e}}function Yp(e){e=e||{};var t=this.context,n=(0,Pp.default)(t).getInstance(),r=(0,Gp.default)(t).getInstance(),i=e.manifestModel,a=e.mediaPlayerModel,o=e.manifestUpdater,s=e.adapter,u=e.capabilities,l=e.capabilitiesFilter,f=e.errHandler,d=e.timelineConverter,c=e.dashMetrics,h=e.abrController,g=e.playbackController,p=e.eventController,m=e.mediaController,_=e.textController,E=e.protectionController,y=e.videoModel,v=e.settings,T=e.streamInfo,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0,M=void 0,C=void 0,D=void 0,O=void 0,P=void 0,L=void 0,F=void 0,x=void 0,U=void 0,B=void 0,k=void 0;function G(e){for(var t=b?b.length:0,r=0;r<t;r++){b[r].getFragmentModel().removeExecutedRequestsBeforeTime(H()+q()),b[r].reset(!1,e)}b=[],R=!1,w=!1,fe(!1),n.off(Lp.default.CURRENT_TRACK_CHANGED,Z,A)}function j(){G(),I=!1,N=!1,M=!1,C={},D=!1,x=!1,B=!1}function Y(){g&&g.pause(),O&&(O.reset(),O=null),T=null,j(),n.off(Lp.default.DATA_UPDATE_COMPLETED,re,A),n.off(Lp.default.BUFFERING_COMPLETED,ne,A),n.off(Lp.default.INBAND_EVENTS,ie,A),E&&(n.off(Lp.default.KEY_ERROR,X,A),n.off(Lp.default.SERVER_CERTIFICATE_UPDATED,X,A),n.off(Lp.default.LICENSE_REQUEST_COMPLETE,X,A),n.off(Lp.default.KEY_SYSTEM_SELECTED,X,A),n.off(Lp.default.KEY_SESSION_CREATED,X,A),n.off(Lp.default.KEY_STATUSES_CHANGED,X,A)),fe(!1)}function q(){return T?T.duration:NaN}function H(){return T?T.start:NaN}function K(){if(!T.manifestInfo.isDynamic)return NaN;for(var e=0;e<b.length;e++)if(b[e].getType()===Np.default.AUDIO||b[e].getType()===Np.default.VIDEO)return b[e].getLiveStartTime();return NaN}function V(){return T?T.id:null}function z(){return T}function W(){if(!(y&&h&&h.hasOwnProperty("getBitrateList")&&s&&s.hasOwnProperty("getAllMediaInfoForType")&&s.hasOwnProperty("getEventsFor")))throw new Error(Np.default.MISSING_CONFIG_ERROR)}function X(e){e.error&&(f.error(e.error),S.fatal(e.error.message),Y())}function Q(e){var t,n=e?e.type:null,r=void 0;if(n===Np.default.MUXED)return r="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",S.fatal(r),f.error(new Bp.default(xp.default.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,r,i.getValue())),!1;if(n===Np.default.TEXT||n===Np.default.FRAGMENTED_TEXT||n===Np.default.EMBEDDED_TEXT||n===Np.default.IMAGE)return!0;if(t=e.codec,S.debug(n+" codec: "+t),e.contentProtection&&!u.supportsEncryptedMedia())f.error(new Bp.default(xp.default.CAPABILITY_MEDIAKEYS_ERROR_CODE,xp.default.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE));else if(!u.supportsCodec(t))return r=n+"Codec ("+t+") is not supported.",S.error(r),!1;return!0}function Z(e){if(T&&e.newMediaInfo.streamInfo.id===T.id){var t=e.newMediaInfo,n=i.getValue();s.setCurrentMediaInfo(T.id,t.type,t);var r=ae(t);if(r){var a=g.getTime();S.info("Stream - Process track changed at current time "+a),S.debug("Stream - Update stream controller"),n.refreshManifestOnSwitchTrack?(S.debug("Stream - Refreshing manifest for switch track"),k=e,o.refreshManifest()):(r.selectMediaInfo(t),t.type!==Np.default.FRAGMENTED_TEXT?(h.updateTopQualityIndex(t),r.switchTrackAsked(),r.getFragmentModel().abortRequests()):(r.getScheduleController().setSeekTarget(a),r.setBufferingTime(a),r.resetIndexHandler()))}}}function $(r,o){var u,l=s.getAllMediaInfoForType(T,r),c=null;if(l&&0!==l.length){r===Np.default.VIDEO&&(N=!0),r===Np.default.AUDIO&&(M=!0);for(var p=0,E=l.length;p<E;p++)if(c=l[p],r===Np.default.EMBEDDED_TEXT)_.addEmbeddedTrack(c);else{if(!Q(c))continue;m.addTrack(c)}r!==Np.default.EMBEDDED_TEXT&&0!==m.getTracksFor(r,T).length&&(r!==Np.default.IMAGE?(m.checkInitialMediaSettingsForType(r,T),u=m.getCurrentTrackFor(r,T),n.trigger(Lp.default.STREAM_INITIALIZING,{streamInfo:T,mediaInfo:c}),function(n,r,o,u){var l=O.getModel(n?n.type:null),c=(0,Cp.default)(t).create({streamInfo:T,type:n?n.type:null,mimeType:n?n.mimeType:null,timelineConverter:d,adapter:s,manifestModel:i,mediaPlayerModel:a,fragmentModel:l,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,abrController:h,playbackController:g,mediaController:m,textController:_,errHandler:f,settings:v,boxParser:F});if(c.initialize(o,N),h.updateTopQualityIndex(n),u?(c.setBuffer(u.buffer),c.setBufferingTime(u.currentTime),b[u.replaceIdx]=c):b.push(c),!u||!u.ignoreMediaInfo)if(!n||n.type!==Np.default.TEXT&&n.type!==Np.default.FRAGMENTED_TEXT)c.addMediaInfo(n,!0);else{for(var p=void 0,E=0;E<r.length;E++)r[E].index===n.index&&(p=E),c.addMediaInfo(r[E]);c.selectMediaInfo(r[p])}}(u,l,o)):P=(0,Op.default)(t).create({streamInfo:T,adapter:s,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:U,eventBus:n,events:Lp.default,dashConstants:Mp.default}))}else S.info("No "+r+" data.")}function J(){if(p){var e=s.getEventsFor(T);p.addInlineEvents(e)}}function ee(){for(var e=b.length,t=!!C.audio||!!C.video?new Bp.default(xp.default.DATA_UPDATE_FAILED_ERROR_CODE,xp.default.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,r=0;r<e;r++)if(b[r].isUpdating()||D)return;if(w){if(E){E.clearMediaInfoArrayByStreamId(V());for(var i=0;i<e&&b[i];i++){var a=b[i].getType();if(a===Np.default.AUDIO||a===Np.default.VIDEO||a===Np.default.FRAGMENTED_TEXT){var o=b[i].getMediaInfo();o&&E.initializeForMedia(o)}}}t?f.error(t):I||(I=!0,n.trigger(Lp.default.STREAM_INITIALIZED,{streamInfo:T,liveStartTime:L?NaN:K()}));for(var s=0;s<e&&b[s];s++)b[s].getScheduleController().start()}}function te(e){for(var t={},n=0,r=b.length;n<r;n++){var i=b[n].createBuffer(e);i&&(t[b[n].getType()]=i.getBuffer())}return t}function ne(){var e=oe(),t=e.length;if(0!==t){for(var r=0;r<t;r++)if(!e[r].isBufferingCompleted()&&(e[r].getType()===Np.default.AUDIO||e[r].getType()===Np.default.VIDEO))return void S.warn("onBufferingCompleted - One streamProcessor has finished but",e[r].getType(),"one is not buffering completed");S.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),n.trigger(Lp.default.STREAM_BUFFERING_COMPLETED,{streamInfo:T})}else S.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function re(e){C[e.mediaType]=e.error,ee()}function ie(e){!function(e){p&&p.addInbandEvents(e)}(e.events)}function ae(e){return e?oe().filter((function(t){return t.getType()===e.type}))[0]:null}function oe(){for(var e=[],t=void 0,n=void 0,r=0;r<b.length;r++)(t=(n=b[r]).getType())!==Np.default.AUDIO&&t!==Np.default.VIDEO&&t!==Np.default.FRAGMENTED_TEXT&&t!==Np.default.TEXT||e.push(n);return e}function se(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():z();if(!r||!i)return!1;var a=s.getAdaptationForType(r.index,t,r),o=s.getAdaptationForType(i.index,t,i);return a&&o?!(!ue(o)&&ue(a)):!a&&!o}function ue(e){return!!e&&!!(e.ContentProtection||e.Representation&&e.Representation.length>0&&e.Representation[0].ContentProtection)}function le(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():z();if(!r||!i)return!1;var a=s.getAdaptationForType(r.index,t,r),o=s.getAdaptationForType(i.index,t,i);if(!a||!o)return!a&&!o;var l=a&&o&&a.mimeType===o.mimeType,f=o.Representation_asArray.map((function(e){return e.codecs})),d=a.Representation_asArray.map((function(e){return e.codecs})),c=d.some((function(e){return f.indexOf(e)>-1})),h=d.some((function(e){return f.some((function(t){return u.codecRootCompatibleWithCodec(t,e)}))}));return c||h&&l}function fe(e){L=e}function de(){return L}return A={initialize:function(){n.on(Lp.default.BUFFERING_COMPLETED,ne,A),n.on(Lp.default.DATA_UPDATE_COMPLETED,re,A),n.on(Lp.default.INBAND_EVENTS,ie,A),E&&(n.on(Lp.default.KEY_ERROR,X,A),n.on(Lp.default.SERVER_CERTIFICATE_UPDATED,X,A),n.on(Lp.default.LICENSE_REQUEST_COMPLETE,X,A),n.on(Lp.default.KEY_SYSTEM_SELECTED,X,A),n.on(Lp.default.KEY_SESSION_CREATED,X,A),n.on(Lp.default.KEY_STATUSES_CHANGED,X,A)),n.trigger(Lp.default.STREAM_UPDATED,{streamInfo:T})},getStreamId:function(){return T?T.id:null},activate:function(e,t){if(!R){var r=void 0;return n.on(Lp.default.CURRENT_TRACK_CHANGED,Z,A),de()?(!function(){if(D=!0,W(),l.filterUnsupportedFeaturesOfPeriod(T),w=!0,D=!1,0===b.length){var e="No streams to play.";f.error(new Bp.default(xp.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e,i.getValue())),S.debug(e)}else ee()}(),r=t):r=function(e,t){W();var n=y.getElement();J(),D=!0,l.filterUnsupportedFeaturesOfPeriod(T),(!n||n&&/^VIDEO$/i.test(n.nodeName))&&$(Np.default.VIDEO,e);$(Np.default.AUDIO,e),$(Np.default.TEXT,e),$(Np.default.FRAGMENTED_TEXT,e),$(Np.default.EMBEDDED_TEXT,e),$(Np.default.MUXED,e),$(Np.default.IMAGE,e);var r=te(t);if(w=!0,D=!1,0===b.length){var a="No streams to play.";f.error(new Bp.default(xp.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,a,i.getValue())),S.fatal(a)}else ee();return r}(e,t),R=!0,r}return t},deactivate:G,isActive:function(){return R},getDuration:q,getStartTime:H,getId:V,getStreamInfo:z,getHasAudioTrack:function(){return M},getHasVideoTrack:function(){return N},preload:function(e,t){if(!de()){J(),$(Np.default.VIDEO,e),$(Np.default.AUDIO,e),$(Np.default.TEXT,e),$(Np.default.FRAGMENTED_TEXT,e),$(Np.default.EMBEDDED_TEXT,e),$(Np.default.MUXED,e),$(Np.default.IMAGE,e),te(t),n.on(Lp.default.CURRENT_TRACK_CHANGED,Z,A);for(var r=0;r<b.length&&b[r];r++)b[r].getScheduleController().start();fe(!0)}},getThumbnailController:function(){return P},getBitrateListFor:function(e){if(W(),e===Np.default.IMAGE)return P?P.getBitrateList():[];var t=function(e){for(var t=null,n=0;n<b.length;n++)if((t=b[n]).getType()===e)return t.getMediaInfo();return null}(e);return h.getBitrateList(t)},updateData:function(e){S.info("Manifest updated... updating data system wide."),R=!1,D=!0,T=e,n.trigger(Lp.default.STREAM_UPDATED,{streamInfo:T}),p&&J(),l.filterUnsupportedFeaturesOfPeriod(T);for(var t=0,r=b.length;t<r;t++){var i=b[t];i.updateStreamInfo(T);var a=s.getMediaInfoForType(T,i.getType());a&&(h.updateTopQualityIndex(a),i.addMediaInfo(a,!0))}if(k&&k.newMediaInfo.type!==Np.default.FRAGMENTED_TEXT){var o=ae(k.oldMediaInfo);if(!o)return;o.switchTrackAsked(),k=void 0}D=!1,ee()},reset:Y,getProcessors:oe,setMediaSource:function(e){for(var t=0;t<b.length;)Q(b[t].getMediaInfo())?(b[t].setMediaSource(e),t++):(b[t].reset(),b.splice(t,1));for(var n=0;n<b.length;n++)b[n].dischargePreBuffer();if(0===b.length){var r="No streams to play.";f.error(new Bp.default(xp.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,r+"nostreams",i.getValue())),S.fatal(r)}},isMediaCodecCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return le(e,Np.default.VIDEO,t)&&le(e,Np.default.AUDIO,t)},isProtectionCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return se(e,Np.default.VIDEO,t)&&se(e,Np.default.AUDIO,t)},getPreloaded:de,getPreloadingScheduled:function(){return x},setPreloadingScheduled:function(e){x=e},getIsEndedEventSignaled:function(){return B},setIsEndedEventSignaled:function(e){B=e}},U=(0,Fp.default)(t).getInstance(),S=U.getLogger(A),j(),F=(0,kp.default)(t).getInstance(),O=(0,Dp.default)(t).create({streamInfo:T,mediaPlayerModel:a,dashMetrics:c,errHandler:f,settings:v,boxParser:F,dashConstants:Mp.default,urlUtils:r}),A}Yp.__dashjs_factory_name="Stream";var qp=Up.default.getClassFactory(Yp),Hp=Object.defineProperty({default:qp},"__esModule",{value:!0}),Kp=$p(O),Vp=$p(U),zp=$p(y),Wp=$p(Q),Xp=$p(na),Qp=$p(g),Zp=$p(qd);function $p(e){return e&&e.__esModule?e:{default:e}}function Jp(){var e=this.context,t=(0,Kp.default)(e).getInstance(),n=(0,Zp.default)(e).getInstance(),r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0;function p(){a=NaN,l=!1,s=!0,u=!1,m()}function m(){null!==o&&(clearTimeout(o),o=null)}function _(e){m(),u||(isNaN(e)&&!isNaN(a)&&(e=1e3*a),isNaN(e)||(i.debug("Refresh manifest in "+e+" milliseconds."),o=setTimeout(v,e)))}function E(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];l=!0;var t=d.getValue(),r=t.url,i=c.getPatchLocation(t),a=c.getLocation(t);i&&!e?r=i:a&&(r=a),n.isRelative(r)&&(r=n.resolve(r,t.url)),f.load(r)}function y(e){if(e){if(c.getIsPatch(e)){var n=e;e=d.getValue();var r=c.isPatchValid(e,n),o=r;if(r){var f=c.getPublishTime(e);o=c.applyPatchToManifest(e,n);var h=c.getPublishTime(e);o=f.getTime()!=h.getTime()}if(!o)return i.debug("Patch provided is invalid, performing full manifest refresh"),void E(!0);e.loadedTime=new Date}}else(e=d.getValue()).loadedTime=new Date;if(d.getValue()&&d.getValue().type===Qp.default.DYNAMIC&&e.type===Qp.default.STATIC)return t.trigger(Vp.default.DYNAMIC_TO_STATIC),l=!1,void(u=!0);d.setValue(e);var g=new Date,p=(g.getTime()-e.loadedTime.getTime())/1e3;1e3*(a=c.getManifestUpdatePeriod(e,p))>2147483647&&(a=2147483.647),t.trigger(Vp.default.MANIFEST_UPDATED,{manifest:e}),i.info("Manifest has been refreshed at "+g+"["+g.getTime()/1e3+"] "),s||_()}function v(){s||(l?_(g.get().streaming.manifestUpdateRetryInterval):E())}function T(e){e.error?e.error.code===Xp.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&h.error(e.error):y(e.manifest)}function A(){s=!1,_()}function S(){(s=!g.get().streaming.scheduleWhilePaused)&&m()}function b(){l=!1}return r={initialize:function(){p(),t.on(Vp.default.STREAMS_COMPOSED,b,this),t.on(Vp.default.PLAYBACK_STARTED,A,this),t.on(Vp.default.PLAYBACK_PAUSED,S,this),t.on(Vp.default.INTERNAL_MANIFEST_LOADED,T,this)},setManifest:function(e){y(e)},refreshManifest:E,setConfig:function(e){e&&(e.manifestModel&&(d=e.manifestModel),e.adapter&&(c=e.adapter),e.manifestLoader&&(f=e.manifestLoader),e.errHandler&&(h=e.errHandler),e.settings&&(g=e.settings))},reset:function(){t.off(Vp.default.PLAYBACK_STARTED,A,this),t.off(Vp.default.PLAYBACK_PAUSED,S,this),t.off(Vp.default.STREAMS_COMPOSED,b,this),t.off(Vp.default.INTERNAL_MANIFEST_LOADED,T,this),p()}},i=(0,Wp.default)(e).getInstance().getLogger(r),r}Jp.__dashjs_factory_name="ManifestUpdater";var em=zp.default.getClassFactory(Jp),tm=Object.defineProperty({default:em},"__esModule",{value:!0}),nm=lm(be),rm=lm(O),im=lm(U),am=lm(na),om=lm(y),sm=lm(Q),um=lm(qd);function lm(e){return e&&e.__esModule?e:{default:e}}function fm(){var e=this.context,t=(0,rm.default)(e).getInstance(),n=(0,um.default)(e).getInstance(),r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0;function E(){f=[],d=[],c=null,h=null,p=null,g=NaN,a=!1,o=!1,m=s.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function y(){a||o||!p||!p.value||!p.schemeIdUri||isNaN(g)||isNaN(s.get().streaming.utcSynchronization.backgroundAttempts)||(h&&(Date.now()-h)/1e3<30||(f=[],o=!0,function e(t){try{if(t<=0)return void D();var n=Date.now();u[p.schemeIdUri](p.value,(function(r){var i=Date.now(),a=v(n,i,r);f.push(a),e(t-1)}),(function(){D()}))}catch(e){D()}}(isNaN(s.get().streaming.utcSynchronization.backgroundAttempts)?2:s.get().streaming.utcSynchronization.backgroundAttempts)))}function v(e,t,n){return n-(t-(t-e)/2)}function T(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,t=isNaN(e);t&&s.get().streaming.useManifestDateHeaderTimeSource?M():C(t,e)}function A(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t=void 0,n=void 0,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 S(e){return Date.parse(e)}function b(e){return Date.parse(e)}function I(e,t,n){n()}function R(e,t,n){var r=A(e);isNaN(r)?n():t(r)}function w(e,t,r,i,a){var o,s,u=!1,l=new XMLHttpRequest,f=a?de.HTTPRequest.HEAD:de.HTTPRequest.GET,d=t.match(/\S+/g);if(t=d.shift(),o=function(){u||(u=!0,d.length?w(e,d.join(" "),r,i,a):i())},s=function(){var t=void 0,n=void 0;200===l.status&&(t=a?l.getResponseHeader("Date"):l.response,n=e(t),isNaN(n)||(r(n),u=!0))},n.isRelative(t)){var c=_.resolve();c&&(t=n.resolve(t,c.url))}l.open(f,t),l.timeout=5e3,l.onload=s,l.onloadend=o,l.send()}function N(e,t,n){w(b,e,t,n,!0)}function M(){var e=l.getLatestMPDRequestHeaderValueByID("Date"),t=null!==e?new Date(e).getTime():Number.NaN;isNaN(t)?C(!0):C(!1,t-Date.now())}function C(e,n){if(isNaN(g)||isNaN(n)||e||function(e){try{var t=O(e),n=isNaN(m)?30:m,r=isNaN(s.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:s.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,a=isNaN(s.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:s.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,o=isNaN(s.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:s.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts,u=void 0;t?(u=Math.min(n*r,a),i.debug("Increasing timeBetweenSyncAttempts to "+u)):(u=Math.max(n/r,o),i.debug("Decreasing timeBetweenSyncAttempts to "+u)),m=u}catch(e){}}(n),!e&&!isNaN(n)){c=Date.now(),a=!1;var r=isNaN(g);g=n,r&&y(),i.debug("Completed UTC sync. Setting client - server offset to "+n)}e&&(p=null),t.trigger(im.default.UPDATE_TIME_SYNC_OFFSET,{offset:n,error:e?new nm.default(am.default.TIME_SYNC_FAILED_ERROR_CODE,am.default.TIME_SYNC_FAILED_ERROR_MESSAGE):null}),t.trigger(im.default.TIME_SYNCHRONIZATION_COMPLETED)}function D(){if(f&&0!==f.length){var e=f.reduce((function(e,t){return e+t}),0)/f.length;O(e)?i.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(i.debug("Completed background UTC sync. Setting client - server offset to "+e),g=e,t.trigger(im.default.UPDATE_TIME_SYNC_OFFSET,{offset:g})),o=!1,h=Date.now()}}function O(e){try{if(isNaN(g))return!0;var t=s.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(s.get().streaming.utcSynchronization.maximumAllowedDrift)?s.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=g-t&&e<=g+t}catch(e){return!0}}return r={initialize:function(){E(),u={"urn:mpeg:dash:utc:http-head:2014":N,"urn:mpeg:dash:utc:http-xsdate:2014":w.bind(null,A),"urn:mpeg:dash:utc:http-iso:2014":w.bind(null,S),"urn:mpeg:dash:utc:direct:2014":R,"urn:mpeg:dash:utc:http-head:2012":N,"urn:mpeg:dash:utc:http-xsdate:2012":w.bind(null,A),"urn:mpeg:dash:utc:http-iso:2012":w.bind(null,S),"urn:mpeg:dash:utc:direct:2012":R,"urn:mpeg:dash:utc:http-ntp:2014":I,"urn:mpeg:dash:utc:ntp:2014":I,"urn:mpeg:dash:utc:sntp:2014":I}},attemptSync:function(e){d=e,a||(!function(){try{var e=isNaN(m)?30:m;return!(c&&e&&!isNaN(e))||(Date.now()-c)/1e3>=e}catch(e){return!0}}()?t.trigger(im.default.TIME_SYNCHRONIZATION_COMPLETED):(a=!0,function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=t||0;if(!d||0===d.length||n>=d.length)return void T();var r=d[n];if(r)if(u.hasOwnProperty(r.schemeIdUri)){var i=(new Date).getTime();u[r.schemeIdUri](r.value,(function(e){var t=(new Date).getTime(),n=v(i,t,e);p=r,T(n)}),(function(){e(n+1)}))}else e(n+1);else T()}()))},setConfig:function(e){e&&(e.dashMetrics&&(l=e.dashMetrics),e.baseURLController&&(_=e.baseURLController),e.settings&&(s=e.settings))},reset:function(){E(),t.off(im.default.ATTEMPT_BACKGROUND_SYNC,y,r)}},i=(0,sm.default)(e).getInstance().getLogger(r),t.on(im.default.ATTEMPT_BACKGROUND_SYNC,y,r),r}fm.__dashjs_factory_name="TimeSyncController";var dm=om.default.getSingletonFactory(fm);dm.HTTP_TIMEOUT_MS=5e3,om.default.updateSingletonFactory(fm.__dashjs_factory_name,dm);var cm=dm,hm=Object.defineProperty({default:cm},"__esModule",{value:!0}),gm=mm(y),pm=mm(Q);function mm(e){return e&&e.__esModule?e:{default:e}}function _m(){var e=void 0,t=void 0,n=this.context;return e={createMediaSource:function(){var e="WebKitMediaSource"in window;return"MediaSource"in window?new MediaSource:e?new WebKitMediaSource:null},attachMediaSource:function(e,t){var n=window.URL.createObjectURL(e);return t.setSource(n),n},detachMediaSource:function(e){e.setSource(null)},setDuration:function e(n,r){n&&"open"===n.readyState&&(null===r&&isNaN(r)||n.duration!==r&&(!function(e){for(var t=e.sourceBuffers,n=0;n<t.length;n++)if(t[n].updating)return!0;return!1}(n)?(t.info("Set MediaSource duration:"+r),n.duration=r):setTimeout(e.bind(null,n,r),50)))},setSeekable:function(e,t,n){e&&"function"==typeof e.setLiveSeekableRange&&"function"==typeof e.clearLiveSeekableRange&&"open"===e.readyState&&t>=0&&t<n&&(e.clearLiveSeekableRange(),e.setLiveSeekableRange(t,n))},signalEndOfStream:function(e){if(e&&"open"===e.readyState){for(var n=e.sourceBuffers,r=0;r<n.length;r++){if(n[r].updating)return;if(0===n[r].buffered.length)return}t.info("call to mediaSource endOfStream"),e.endOfStream()}}},t=(0,pm.default)(n).getInstance().getLogger(e),e}_m.__dashjs_factory_name="MediaSourceController";var Em=gm.default.getSingletonFactory(_m),ym=Object.defineProperty({default:Em},"__esModule",{value:!0}),vm=Im(y),Tm=Im(Q),Am=Im(O),Sm=Im(I),bm=Im(Ic);function Im(e){return e&&e.__esModule?e:{default:e}}function Rm(){var e="discarded",t="updated",n="added",r=this.context,i=(0,Am.default)(r).getInstance(),a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0;function m(){if(!d||!c)throw new Error("setConfig function has to be called previously")}function _(){p=!1,s={},u={},l=null,g=!1,f=Date.now()/1e3}function E(){try{null!==l&&p&&(clearInterval(l),l=null,p=!1,function(){try{S(u),S(s)}catch(e){}}())}catch(e){throw e}}function y(r,i){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r.eventStream.schemeIdUri,s=r.eventStream.value,u=r.id,l=e;i[o]||(i[o]=[]);var f=i[o].findIndex((function(e){return(!s||e.eventStream.value&&e.eventStream.value===s)&&e.id===u}));return-1===f?(i[o].push(r),l=n):a&&(i[o][f]=r,l=t),l}function v(e){try{if(1==e.eventStream.value){var t=e.calculatedPresentationTime,n=void 0;n=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,i.trigger(Sm.default.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:t,newDuration:n,newManifestValidAfter:NaN},{mode:Sm.default.EVENT_MODE_ON_START})}}catch(e){}}function T(){try{if(!g){g=!0;var e=c.getTime(),t=e-f;t=f>0?Math.max(0,t):0,A(u,t,e),A(s,t,e),f=e,g=!1}}catch(e){g=!1}}function A(e,t,n){try{b(e,(function(r){if(void 0!==r){var i=isNaN(r.duration)?0:r.duration;r.calculatedPresentationTime<=n&&r.calculatedPresentationTime+t+i>=n?I(r,e,Sm.default.EVENT_MODE_ON_START):(function(e,t,n){try{return e-t>n}catch(e){return!1}}(n,i+t,r.calculatedPresentationTime)||function(e){try{var t=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>t}catch(e){return!1}}(r))&&(o.debug("Deleting event "+r.id+" as it is expired or invalid"),R(e,r))}}))}catch(e){}}function S(e){try{var t=c.getTime();b(e,function(n){var r=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.duration)?n.eventStream.period.duration:NaN,i=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.start)?n.eventStream.period.start:NaN;if(!isNaN(r)&&!isNaN(i)){var a=n.calculatedPresentationTime;Math.abs(a-t)<300&&I(n,e,Sm.default.EVENT_MODE_ON_START)}}())}catch(e){}}function b(e,t){try{if(e)for(var n=Object.keys(e),r=0;r<n.length;r++){e[n[r]].forEach((function(e){void 0!==e&&t(e)}))}}catch(e){}}function I(e,t,n){try{var a=c.getTime(),s=e.id;if(n===Sm.default.EVENT_MODE_ON_RECEIVE)return o.debug("Received event "+s),void i.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n});"urn:mpeg:dash:event:2012"===e.eventStream.schemeIdUri&&1===e.eventStream.value?0===e.duration&&0===e.presentationTimeDelta||(o.debug("Starting manifest refresh event "+s+" at "+a),R(t,e),function(){try{m(),d.refreshManifest()}catch(e){}}()):"urn:mpeg:dash:event:callback:2015"===e.eventStream.schemeIdUri&&1===e.eventStream.value?(o.debug("Starting callback event "+s+" at "+a),R(t,e),function(e){try{(0,bm.default)(r).create({}).load({method:"get",url:e,request:{responseType:"arraybuffer"}})}catch(e){throw e}}(e.messageData)):(o.debug("Starting event "+s+" at "+a),R(t,e),i.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n}))}catch(e){}}function R(e,t){var n=t.eventStream.schemeIdUri,r=t.eventStream.value,i=t.id;e[n]=e[n].filter((function(e){return r&&e.eventStream.value&&e.eventStream.value!==r||e.id!==i})),0===e[n].length&&delete e[n]}return a={addInlineEvents:function(e){try{if(m(),e)for(var r=0;r<e.length;r++){var i=e[r],a=y(i,s,!0);a===n?(o.debug("Added inline event with id "+i.id),I(i,e,Sm.default.EVENT_MODE_ON_RECEIVE)):a===t&&o.debug("Updated inline event with id "+i.id)}o.debug("Added "+e.length+" inline events")}catch(e){throw e}},addInbandEvents:function(e){try{m();for(var t=0;t<e.length;t++){var r=e[t];y(r,u,!1)===n?("urn:mpeg:dash:event:2012"===r.eventStream.schemeIdUri&&void 0===u[r.id]&&v(r),o.debug("Added inband event with id "+r.id),I(r,e,Sm.default.EVENT_MODE_ON_RECEIVE)):o.debug("Inband event with scheme_id_uri "+r.eventStream.schemeIdUri+", value "+r.eventStream.value+" and id "+r.id+" was ignored because it has been added before.")}T()}catch(e){throw e}},getInbandEvents:function(){return u},getInlineEvents:function(){return s},start:function(){try{m(),o.debug("Start Event Controller");var e=h.get().streaming.eventControllerRefreshDelay;p||isNaN(e)||(p=!0,l=setInterval(T,e))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(d=e.manifestUpdater),e.playbackController&&(c=e.playbackController),e.settings&&(h=e.settings)}catch(e){throw e}},reset:function(){E(),_()}},o=(0,Tm.default)(r).getInstance().getLogger(a),_(),a}Rm.__dashjs_factory_name="EventController";var wm=vm.default.getSingletonFactory(Rm),Nm=Object.defineProperty({default:wm},"__esModule",{value:!0}),Mm=Vm(d),Cm=Vm(_),Dm=Vm(Hp),Om=Vm(tm),Pm=Vm(O),Lm=Vm(U),Fm=Vm(y),xm=Vm(Q),Um=Vm(hl),Bm=Vm(qd),km=Vm(I),Gm=Vm(hm),jm=Vm(ym),Ym=Vm(be),qm=Vm(na),Hm=Vm(Nm),Km=Vm(wa);function Vm(e){return e&&e.__esModule?e:{default:e}}function zm(){var e=this.context,t=(0,Pm.default)(e).getInstance(),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0,M=void 0,C=void 0,D=void 0,O=void 0,P=void 0,L=void 0,F=void 0,x=void 0,U=void 0,B=void 0,k=void 0,G=void 0,j=void 0;function Y(){if(fe()){var e=D.getPlaybackQuality();e&&f.addDroppedFrames(e)}}function q(e){var t=$(e.seekTime);t===S&&k&&k.length>0&&k.forEach((function(e){e.deactivate(!0)})),t&&t!==S?(ce(Xd.PlayListTrace.END_OF_PERIOD_STOP_REASON),ne(t,S,e.seekTime)):ce(Xd.PlayListTrace.USER_REQUEST_STOP_REASON),he(Xd.PlayList.SEEK_START_REASON)}function H(e){var t=te();ce(Xd.PlayListTrace.END_OF_PERIOD_STOP_REASON),ne(t,S,e.seekTime),he(Xd.PlayList.SEEK_START_REASON)}function K(){r.debug("[onPlaybackStarted]"),F?(F=!1,he(Xd.PlayList.INITIAL_PLAYOUT_START_REASON)):L&&(L=!1,he(Xd.PlayList.RESUME_FROM_PAUSE_START_REASON))}function V(e){r.debug("[onPlaybackPaused]"),e.ended||(L=!0,ce(Xd.PlayListTrace.USER_REQUEST_STOP_REASON))}function z(){x&&(clearInterval(x),x=null)}function W(){U||(U=setInterval((function(){!function(){if(!S||!X(S))return;var e=function(e){try{var t=e||(S||null);if(t){var n=t.getStreamInfo().start;return A.filter((function(e){return e.getStreamInfo().start>n}))}}catch(e){return[]}}(S),t=0,n=function(){var n=e[t],i=0===t?S:e[t-1];if(!n.getPreloadingScheduled()&&X(i)&&C){var a=[Mm.default.VIDEO,Mm.default.AUDIO],o=!0;a.forEach((function(e){var t=l.getMediaInfoForType(n.getStreamInfo(),e);l.getVoRepresentations(t).forEach((function(e){var t=l.getIsDynamic(),n=T.calcSegmentAvailabilityRange(e,t);n.end<n.start&&(o=!1)}))})),o&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(C&&!e.getPreloaded()){var n=Z(e,t);n&&(e.setPreloadingScheduled(!0),r.info("[onStreamCanLoadNext] Preloading next stream with id "+e.getId()),e.preload(C,B),k.push(e),e.getProcessors().forEach((function(t){t.setBufferingTime(e.getStartTime())})))}}(n,i)}t+=1};for(;t<e.length;)n()}()}),500))}function X(e){try{if(!e)return!1;var t=e.getProcessors().filter((function(e){return e.getType()===Mm.default.AUDIO||e.getType()===Mm.default.VIDEO}));if(!t||0===t.length)return!1;var n=t.filter((function(e){return!e.isBufferingCompleted()}));return n&&0===n.length}catch(e){return!1}}function Q(){var e=pe().isLast;C&&e&&(r.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),d.signalEndOfStream(C))}function Z(e,t){try{return j.get().streaming.reuseExistingSourceBuffers&&t.isProtectionCompatible(e,t)&&(G||t.isMediaCodecCompatible(e,t))&&!function(e){try{var t=e.getStreamInfo(),n=l.getAdaptationForType(t.index,Mm.default.FRAGMENTED_TEXT,t);return!!n&&(-1!==n.codecs.indexOf("stpp")||-1!==n.codecs.indexOf("wvtt"))}catch(e){return!1}}(e)}catch(e){return!1}}function $(e){if(isNaN(e))return null;var t=0,n=null,r=A.length;r>0&&(t+=A[0].getStartTime());for(var i=0;i<r;i++)if(n=A[i],e<(t=parseFloat((t+n.getDuration()).toFixed(5))))return n;return null}function J(){return S?S.getProcessors():[]}function ee(e){if(!S.getIsEndedEventSignaled()){S.setIsEndedEventSignaled(!0);var t=te();t?(r.debug("StreamController onEnded, found next stream with id "+t.getStreamInfo().id),ne(t,S,NaN)):(r.debug("StreamController no next stream found"),S.setIsEndedEventSignaled(!1)),ce(t?Xd.PlayListTrace.END_OF_PERIOD_STOP_REASON:Xd.PlayListTrace.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&z()}function te(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e||(S||null);if(t){for(var n=t.getStreamInfo().start,r=t.getStreamInfo().duration,i=parseFloat((n+r).toFixed(5)),a=0,o=-1,s=NaN;a<A.length;){var u=A[a],l=u.getStreamInfo().start-i;l>=0&&(isNaN(s)||l<s)&&(s=l,o=a),a+=1}return o>=0?A[o]:null}return null}function ne(e,n,i){if(!(w||!e||n===e&&e.isActive())){w=!0,t.trigger(Lm.default.PERIOD_SWITCH_STARTED,{fromStreamInfo:n?n.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});var a=!1;n&&(a=Z(e,n),n.deactivate(a)),i=isNaN(i)?!a&&n?e.getStreamInfo().start:NaN:i,r.info("Switch to stream "+e.getId()+". Seektime is "+i+", current playback time is "+O.getTime()),r.info("Seamless period switch is set to "+a),S=e,k=k.filter((function(e){return e.getId()!==S.getId()})),O.initialize(pe(),!!n,i),D.getElement()?re(i,null===n,!1,a):ie(i,a)}}function re(e,n,i,a){var o=void 0;function s(){C&&"open"===C.readyState&&(r.debug("MediaSource is open!"),window.URL.revokeObjectURL(o),C.removeEventListener("sourceopen",s),C.removeEventListener("webkitsourceopen",s),ae(),n||t.trigger(Lm.default.SOURCE_INITIALIZED),i?S.setMediaSource(C):ie(e,a))}C?a?(ie(e,a),n||t.trigger(Lm.default.SOURCE_INITIALIZED)):(d.detachMediaSource(D),C.addEventListener("sourceopen",s,!1),C.addEventListener("webkitsourceopen",s,!1),o=d.attachMediaSource(C,D),r.debug("MediaSource attached to element. Waiting on open...")):((C=d.createMediaSource()).addEventListener("sourceopen",s,!1),C.addEventListener("webkitsourceopen",s,!1),o=d.attachMediaSource(C,D),r.debug("MediaSource attached to element. Waiting on open..."))}function ie(e,n){if(B=S.activate(C,n?B:void 0)){var r=Object.keys(B);r.length>0&&B[r[0]].changeType&&(G=!0)}F||isNaN(e)||(e===O.getTime()?t.trigger(Lm.default.SEEK_TARGET,{time:e},{streamId:S.getId()}):O.seek(e)),!R&&F||O.play(),w=!1,t.trigger(Lm.default.PERIOD_SWITCH_COMPLETED,{toStreamInfo:pe()})}function ae(e){var t=e||pe().manifestInfo.duration;d.setDuration(C,t)}function oe(e){for(var t=0,n=A.length;t<n;t++)if(A[t].getId()===e.id)return A[t];return null}function se(){try{var n=l.getStreamsInfo();if(0===n.length)throw new Error("There are no streams");f.updateManifestUpdateInfo({currentTime:O.getTime(),buffered:D.getBufferRange(),presentationStartTime:n[0].start,clientTimeOffset:T.getClientTimeOffset()}),A.length>0&&(A=A.filter((function(e){var t=n.filter((function(t){return t.id===e.getId()})).length>0||e.getId()===S.getId();return t||r.debug("Removing stream "+e.getId()),t})));for(var s=0,d=n.length;s<d;s++){var c=n[s],E=oe(c);E?E.updateData(c):(E=(0,Dm.default)(e).create({manifestModel:u,mediaPlayerModel:P,dashMetrics:f,manifestUpdater:o,adapter:l,timelineConverter:T,capabilities:i,capabilitiesFilter:a,errHandler:v,baseURLController:h,abrController:g,playbackController:O,eventController:m,mediaController:p,textController:_,protectionController:b,videoModel:D,streamInfo:c,settings:j}),A.push(E),E.initialize()),f.addManifestUpdateStreamInfo(c)}if(!S){if(l.getIsDynamic()&&A.length){var y=n[0].manifestInfo,I=function(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=[Mm.default.VIDEO,Mm.default.AUDIO,Mm.default.FRAGMENTED_TEXT].reduce((function(e,t){var n=l.getMediaInfoForType(r,t);return n&&e.push(n),e}),[]).reduce((function(e,t){var n=l.getVoRepresentations(t);return n&&n.length>0&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=l.convertDataToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(i))}return isFinite(n)?n:NaN}catch(e){return NaN}}(n,y);O.computeAndSetLiveDelay(I,y.DVRWindowSize,y.minBufferTime)}var R=null;!(R=$(O.getStartTimeFromUriParameters(l.getIsDynamic())))&&l.getIsDynamic()&&A.length&&(r.debug("Dynamic stream: Trying to find the correct starting period"),R=function(){try{var e=T.calcPresentationTimeFromWallTime(new Date,l.getRegularPeriods()[0]),t=O.getLiveDelay();return $(e-t)}catch(e){return null}}()),ne(null!==R?R:A[0],null,NaN),x||(x=setInterval((function(){!w&&O.getTimeToStreamEnd()<=0&&t.trigger(Lm.default.PLAYBACK_ENDED,{isLast:pe().isLast})}),200)),W()}t.trigger(Lm.default.STREAMS_COMPOSED)}catch(e){v.error(new Ym.default(qm.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+"nostreamscomposed",u.getValue())),M=!0,ye()}}function ue(){var e=u.getValue();b&&(t.trigger(Lm.default.PROTECTION_CREATED,{controller:b,manifest:e}),b.setMediaElement(D.getElement()),I&&b.setProtectionData(I)),se()}function le(e){if(e.error)M=!0,ye();else{var n=e.manifest;l.updatePeriods(n);var i=l.getUTCTimingSources();!l.getIsDynamic()||i&&0!==i.length||t.trigger(km.default.CONFORMANCE_VIOLATION,{level:Km.default.LEVELS.WARNING,event:Km.default.EVENTS.NO_UTC_TIMING_ELEMENT});var a=l.getIsDynamic()?i.concat(P.getUTCTimingSources()):i,o=y.isHTTPS(e.manifest.url);a.forEach((function(e){e.value.replace(/.*?:\/\//g,"")===P.getDefaultUtcTimingSource().value.replace(/.*?:\/\//g,"")&&(e.value=e.value.replace(o?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),o?"https://":"http://"),r.debug("Matching default timing source protocol to manifest protocol: ",e.value))})),h.initialize(n),c.attemptSync(a)}}function fe(){return!!S&&S.getHasVideoTrack()}function de(){return!!S&&S.getHasAudioTrack()}function ce(e,t){t=t||new Date,J().forEach((function(n){n.finalisePlayList(t,e)})),f.addPlayList()}function he(e){f.createPlaylistMetrics(1e3*O.getTime(),e)}function ge(e){if(e.error){var t="";switch(e.error.code){case 1:t="MEDIA_ERR_ABORTED";break;case 2:t="MEDIA_ERR_NETWORK";break;case 3:t="MEDIA_ERR_DECODE";break;case 4:t="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:t="MEDIA_ERR_ENCRYPTED";break;default:t="UNKNOWN"}N=!0,e.error.message&&(t+=" ("+e.error.message+")"),e.error.msExtendedCode&&(t+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),r.fatal("Video Element Error: "+t),e.error&&r.fatal(e.error),v.error(new Ym.default(e.error.code,t)),ye()}}function pe(){return S?S.getStreamInfo():null}function me(){if(!(s&&s.hasOwnProperty("load")&&T&&T.hasOwnProperty("initialize")&&T.hasOwnProperty("reset")&&T.hasOwnProperty("getClientTimeOffset")&&u&&v&&f&&O))throw new Error(Mm.default.MISSING_CONFIG_ERROR)}function _e(e){isNaN(e.newDuration)||ae(e.newDuration)}function Ee(){A=[],b=null,w=!1,S=null,N=!1,M=!1,F=!0,L=!1,R=!0,x=null,U=null,k=[]}function ye(){me(),c.reset(),ce(N||M?Xd.PlayListTrace.FAILURE_STOP_REASON:Xd.PlayListTrace.USER_REQUEST_STOP_REASON);for(var e=0,r=A?A.length:0;e<r;e++){A[e].reset(N)}t.off(Lm.default.PLAYBACK_TIME_UPDATED,Y,n),t.off(Lm.default.PLAYBACK_SEEKING,q,n),t.off(Lm.default.GAP_CAUSED_SEEK_TO_PERIOD_END,H,n),t.off(Lm.default.PLAYBACK_ERROR,ge,n),t.off(Lm.default.PLAYBACK_STARTED,K,n),t.off(Lm.default.PLAYBACK_PAUSED,V,n),t.off(Lm.default.PLAYBACK_ENDED,ee,n),t.off(Lm.default.MANIFEST_UPDATED,le,n),t.off(Lm.default.STREAM_BUFFERING_COMPLETED,Q,n),t.off(Lm.default.MANIFEST_VALIDITY_CHANGED,_e,n),t.off(Lm.default.TIME_SYNCHRONIZATION_COMPLETED,ue,n),t.off(km.default.METRIC_ADDED,ve,n),h.reset(),o.reset(),m.reset(),f.clearAllCurrentMetrics(),u.setValue(null),s.reset(),T.reset(),E.reset(),C&&(d.detachMediaSource(D),C=null),D=null,b&&(b.setMediaElement(null),b=null,I=null,u.getValue()&&t.trigger(Lm.default.PROTECTION_DESTROYED,{data:u.getValue().url})),z(),clearInterval(U),U=null,t.trigger(Lm.default.STREAM_TEARDOWN_COMPLETE),Ee()}function ve(e){if(e.metric===Cm.default.DVR_INFO){var t=de()?Mm.default.AUDIO:Mm.default.VIDEO;e.mediaType===t&&d.setSeekable(C,e.value.range.start,e.value.range.end)}}return n={initialize:function(r,i){me(),R=r,I=i,T.initialize(),(o=(0,Om.default)(e).create()).setConfig({manifestModel:u,adapter:l,manifestLoader:s,errHandler:v,settings:j}),o.initialize(),(m=(0,Hm.default)(e).getInstance()).setConfig({manifestUpdater:o,playbackController:O,settings:j}),m.start(),c.setConfig({dashMetrics:f,baseURLController:h,settings:j}),c.initialize(),t.on(Lm.default.PLAYBACK_TIME_UPDATED,Y,n),t.on(Lm.default.PLAYBACK_SEEKING,q,n),t.on(Lm.default.GAP_CAUSED_SEEK_TO_PERIOD_END,H,n),t.on(Lm.default.PLAYBACK_ERROR,ge,n),t.on(Lm.default.PLAYBACK_STARTED,K,n),t.on(Lm.default.PLAYBACK_PAUSED,V,n),t.on(Lm.default.PLAYBACK_ENDED,ee,n,{priority:Pm.default.EVENT_PRIORITY_HIGH}),t.on(Lm.default.MANIFEST_UPDATED,le,n),t.on(Lm.default.STREAM_BUFFERING_COMPLETED,Q,n),t.on(Lm.default.MANIFEST_VALIDITY_CHANGED,_e,n),t.on(Lm.default.TIME_SYNCHRONIZATION_COMPLETED,ue,n),t.on(km.default.METRIC_ADDED,ve,n)},getActiveStreamInfo:pe,hasVideoTrack:fe,hasAudioTrack:de,switchToVideoElement:function(e){S&&(O.initialize(pe()),re(e,!1,!0,!1))},getStreamById:function(e){return A.filter((function(t){return t.getId()===e}))[0]},getStreamForTime:$,getTimeRelativeToStreamId:function(e,t){for(var n=null,r=0,i=0,a=null,o=0;o<A.length;o++){if(i=(n=A[o]).getStartTime(),a=n.getDuration(),Number.isFinite(i)&&(r=i),n.getId()===t)return e-r;Number.isFinite(a)&&(r+=a)}return null},load:function(e){me(),s.load(e)},loadWithManifest:function(e){!function(){if(!o||!o.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")}(),o.setManifest(e)},getActiveStreamProcessors:J,setConfig:function(e){e&&(e.capabilities&&(i=e.capabilities),e.capabilitiesFilter&&(a=e.capabilitiesFilter),e.manifestLoader&&(s=e.manifestLoader),e.manifestModel&&(u=e.manifestModel),e.mediaPlayerModel&&(P=e.mediaPlayerModel),e.protectionController&&(b=e.protectionController),e.adapter&&(l=e.adapter),e.dashMetrics&&(f=e.dashMetrics),e.errHandler&&(v=e.errHandler),e.timelineConverter&&(T=e.timelineConverter),e.videoModel&&(D=e.videoModel),e.playbackController&&(O=e.playbackController),e.abrController&&(g=e.abrController),e.mediaController&&(p=e.mediaController),e.textController&&(_=e.textController),e.settings&&(j=e.settings),e.baseURLController&&(h=e.baseURLController))},setProtectionData:function(e){I=e},getIsStreamSwitchInProgress:function(){return w},getHasMediaOrIntialisationError:function(){return N||M},hasStreamFinishedBuffering:X,getStreams:function(){return A},getActiveStream:function(){return S},reset:ye},r=(0,xm.default)(e).getInstance().getLogger(n),c=(0,Gm.default)(e).getInstance(),d=(0,jm.default)(e).getInstance(),E=(0,Um.default)(e).getInstance(),y=(0,Bm.default)(e).getInstance(),Ee(),n}zm.__dashjs_factory_name="StreamController";var Wm=Fm.default.getSingletonFactory(zm),Xm=Object.defineProperty({default:Wm},"__esModule",{value:!0}),Qm=e_(y),Zm=e_(Q),$m=e_(U),Jm=e_(O);function e_(e){return e&&e.__esModule?e:{default:e}}function t_(){var e=this.context,t=(0,Jm.default)(e).getInstance(),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0;function h(){c.debug("Stopping the gap controller"),o&&(clearInterval(o),o=null),function(){t.off($m.default.WALLCLOCK_TIME_UPDATED,m,this),t.off($m.default.PLAYBACK_SEEKING,p,this),t.off($m.default.BYTES_APPENDED_END_FRAGMENT,g,n)}(),o=null,s=NaN,a=0,d=null}function g(){o||function(){try{o||(c.debug("Starting the gap controller"),o=setInterval((function(){_()&&y(u.getTime())}),100))}catch(e){}}()}function p(){d&&(clearTimeout(d),d=null)}function m(){if(_()&&++a>=30){var e=u.getTime();r===e?y(e,!0):(r=e,s=NaN),a=0}}function _(){return i.get().streaming.jumpGaps&&l.getActiveStreamProcessors().length>0&&(!u.isSeeking()||l.hasStreamFinishedBuffering(l.getActiveStream()))&&!u.isPaused()&&!l.getIsStreamSwitchInProgress()&&!l.getHasMediaOrIntialisationError()}function E(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var n=NaN,r=0;isNaN(n)&&r<e.length;){var i=r>0?e.end(r-1):0;t<e.start(r)&&i-t<.1&&(n=r),r+=1}return n}catch(e){return null}}function y(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=i.get().streaming.smallGapLimit,a=i.get().streaming.jumpLargeGaps,o=f.getBufferRange(),l=void 0,h=NaN,g=!1;if(l=E(o,e),!isNaN(l)){var p=o.start(l),m=p-e;m>0&&(m<=r||a)&&(h=p)}var _=u.getTimeToStreamEnd();if(isNaN(h)&&n&&isFinite(_)&&!isNaN(_)&&_<r&&(h=parseFloat(u.getStreamEndTime().toFixed(5)),g=!0),h>0&&s!==h&&h>e&&!d){var y=h-e;if(g)c.warn("Jumping to end of stream because of gap from "+e+" to "+h+". Gap duration: "+y),t.trigger($m.default.GAP_CAUSED_SEEK_TO_PERIOD_END,{seekTime:h,duration:y});else{var v=u.getIsDynamic(),T=l>0?o.end(l-1):e,A=v?1e3*y:0;d=window.setTimeout((function(){u.seek(h,!0,!0),c.warn("Jumping gap starting at "+T+" and ending at "+h+". Jumping by: "+y),t.trigger($m.default.GAP_CAUSED_INTERNAL_SEEK,{seekTime:h,duration:y}),d=null}),A)}s=h}}return n={reset:h,setConfig:function(e){e&&(e.settings&&(i=e.settings),e.playbackController&&(u=e.playbackController),e.streamController&&(l=e.streamController),e.videoModel&&(f=e.videoModel),e.timelineConverter&&e.timelineConverter,e.adapter&&e.adapter)},initialize:function(){!function(){t.on($m.default.WALLCLOCK_TIME_UPDATED,m,this),t.on($m.default.PLAYBACK_SEEKING,p,this),t.on($m.default.BYTES_APPENDED_END_FRAGMENT,g,n)}()}},c=(0,Zm.default)(e).getInstance().getLogger(n),h(),n}t_.__dashjs_factory_name="GapController";var n_=Qm.default.getSingletonFactory(t_),r_=Object.defineProperty({default:n_},"__esModule",{value:!0}),i_=l_(d),a_=l_(U),o_=l_(O),s_=l_(y),u_=l_(Q);function l_(e){return e&&e.__esModule?e:{default:e}}function f_(){var e=this.context,t=(0,o_.default)(e).getInstance(),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=[i_.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,i_.default.TRACK_SWITCH_MODE_NEVER_REPLACE],l=[i_.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE,i_.default.TRACK_SELECTION_MODE_FIRST_TRACK,i_.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY,i_.default.TRACK_SELECTION_MODE_WIDEST_RANGE];function f(e,t){if(!e||!t)return[];var n=t.id;return i[n]&&i[n][e]?i[n][e].list:[]}function d(e,t){return!e||!t||t&&!i[t.id]?null:i[t.id][e].current}function c(e,n){if(e&&e.streamInfo){var r=e.type,a=e.streamInfo,o=a.id,u=d(r,a);if(i[o]&&i[o][r]&&!E(e,u)&&(i[o][r].current=e,!i[o][r].current||n&&r===i_.default.FRAGMENTED_TEXT||t.trigger(a_.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:u,newMediaInfo:e,switchMode:p(r)}),!n)){var l=function(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}(e);if(!l||!i[o][r].storeLastSettings)return;l.roles&&(l.role=l.roles[0],delete l.roles),l.accessibility&&(l.accessibility=l.accessibility[0]),l.audioChannelConfiguration&&(l.audioChannelConfiguration=l.audioChannelConfiguration[0]),s.setSavedMediaSettings(r,l)}}}function h(e,t){e&&t&&(o[e]=t)}function g(e){return e?o[e]:null}function p(e){return a.get().streaming.trackSwitchMode[e]}function m(){return a.get().streaming.selectionModeForInitialTrack}function _(e){return e===i_.default.AUDIO||e===i_.default.VIDEO||e===i_.default.TEXT||e===i_.default.FRAGMENTED_TEXT||e===i_.default.IMAGE}function E(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.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),s=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&r&&i&&a&&o&&s}function y(){i={},o={audio:null,video:null,fragmentedText:null}}function v(e,t){var n=!e.lang||t.lang.match(e.lang),r=void 0===e.index||null===e.index||t.index===e.index,i=!e.viewpoint||e.viewpoint===t.viewpoint,a=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],o=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],s=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return n&&r&&i&&a&&o&&s}function T(e){var t=0,n=[],r=void 0;return e.forEach((function(e){(r=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))))>t?(t=r,n=[e]):r===t&&n.push(e)})),n}function A(e){var t=1/0,n=[],r=void 0;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);(r=i/e.bitrateList.length)<t?(t=r,n=[e]):r===t&&n.push(e)})),n}function S(e){var t=0,n=[],r=void 0;return e.forEach((function(e){(r=e.representationCount)>t?(t=r,n=[e]):r===t&&n.push(e)})),n}return n={checkInitialMediaSettingsForType:function(e,t){var n=g(e),r=f(e,t),i=[];n||h(e,n=s.getSavedMediaSettings(e)),r&&0!==r.length&&(n&&r.forEach((function(e){v(n,e)&&i.push(e)})),0===i.length?c(this.selectInitialTrack(e,r),!0):i.length>1?c(this.selectInitialTrack(e,i)):c(i[0]))},addTrack:function(e){if(e){var t=e.type;if(_(t)){var n=e.streamInfo.id;i[n]||(i[n]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},fragmentedText:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var r=i[n][t].list,a=0,o=r.length;a<o;++a)if(E(r[a],e))return;r.push(e);var s=g(t);s&&v(s,e)&&!d(t,e.streamInfo)&&c(e)}}},getTracksFor:f,getCurrentTrackFor:d,isCurrentTrack:function(e){if(!e)return!1;var t=e.type,n=e.streamInfo.id;return i[n]&&i[n][t]&&E(i[n][t].current,e)},setTrack:c,setInitialSettings:h,getInitialSettings:g,setSwitchMode:function(e,t){if(r.warn("deprecated: Please use updateSettings({streaming: { trackSwitchMode: mode } }) instead"),-1!==u.indexOf(t)){var n={};n[e]=t,a.update({streaming:{trackSwitchMode:n}})}else r.warn("Track switch mode is not supported: "+t)},getSwitchMode:p,selectInitialTrack:function(e,t){if(e===i_.default.FRAGMENTED_TEXT)return t[0];var n=m(),i=[];switch(n){case i_.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE:(i=T(t)).length>1&&(i=S(i));break;case i_.default.TRACK_SELECTION_MODE_FIRST_TRACK:i.push(t[0]);break;case i_.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:(i=A(t)).length>1&&(i=T(i));break;case i_.default.TRACK_SELECTION_MODE_WIDEST_RANGE:(i=S(t)).length>1&&(i=T(t));break;default:r.warn("Track selection mode is not supported: "+n)}return i[0]},getTracksWithHighestBitrate:T,getTracksWithHighestEfficiency:A,getTracksWithWidestRange:S,setSelectionModeForInitialTrack:function(e){r.warn("deprecated: Please use updateSettings({streaming: { selectionModeForInitialTrack: mode } }) instead"),-1!==l.indexOf(e)?a.update({streaming:{selectionModeForInitialTrack:e}}):r.warn("Track selection mode is not supported: "+e)},getSelectionModeForInitialTrack:m,isMultiTrackSupportedByType:_,isTracksEqual:E,matchSettings:v,saveTextSettingsDisabled:function(){s.setSavedMediaSettings(i_.default.FRAGMENTED_TEXT,null)},setConfig:function(e){e&&(e.domStorage&&(s=e.domStorage),e.settings&&(a=e.settings))},reset:y},r=(0,u_.default)(e).getInstance().getLogger(n),y(),n}f_.__dashjs_factory_name="MediaController";var d_=s_.default.getSingletonFactory(f_);s_.default.updateSingletonFactory(f_.__dashjs_factory_name,d_);var c_=d_,h_=Object.defineProperty({default:c_},"__esModule",{value:!0}),g_=m_(Sh),p_=m_(y);function m_(e){return e&&e.__esModule?e:{default:e}}var __=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||NaN},this.children=[]};function E_(){var e,t=void 0,n=void 0,r=this.context,i=(0,g_.default)(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=NaN):e[t]=new __(a)}function o(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=NaN),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)}))}))}))}function s(){t=new __}return e={reset:s,update:function(e){o(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){!function e(n,r){var i=r||t;n(i.data),i.children&&i.children.forEach((function(t){return e(n,t)}))}((function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=NaN)}))},setConfig:function(e){e.adapter&&(n=e.adapter)}},s(),e}E_.__dashjs_factory_name="BaseURLTreeModel";var y_=p_.default.getClassFactory(E_),v_=Object.defineProperty({default:y_},"__esModule",{value:!0}),T_=S_(y),A_=S_(O);function S_(e){return e&&e.__esModule?e:{default:e}}function b_(e){e=e||{};var t=void 0,n=[],r=(0,A_.default)(this.context).getInstance(),i=e.updateEventName,a=e.addBlacklistEventName;function o(e){-1===n.indexOf(e)&&(n.push(e),r.trigger(i,{entry:e}))}function s(e){o(e.entry)}return t={add:o,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.indexOf(e)},reset:function(){n=[]}},a&&r.on(a,s,t),t}b_.__dashjs_factory_name="BlackListController";var I_=T_.default.getClassFactory(b_),R_=Object.defineProperty({default:I_},"__esModule",{value:!0}),w_=function(e){return e&&e.__esModule?e:{default:e}}(y);function N_(e){var t=(e=e||{}).blacklistController;return{select:function(e){return e&&function(e){var t=0,n=[],r=0,i=void 0,a=void 0;if((a=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 a.length>1&&(a.forEach((function(e){t+=e.dvb_weight,n.push(t)})),i=Math.floor(Math.random()*(t-1)),n.every((function(e,t){return r=t,!(i<e)}))),a[r]}((n=[],e.filter((function(e){return!t.contains(e.serviceLocation)||(e.dvb_priority&&n.push(e.dvb_priority),!1)})).filter((function(e){return!n.length||!e.dvb_priority||-1===n.indexOf(e.dvb_priority)}))));var n}}}N_.__dashjs_factory_name="DVBSelector";var M_=w_.default.getClassFactory(N_),C_=Object.defineProperty({default:M_},"__esModule",{value:!0}),D_=function(e){return e&&e.__esModule?e:{default:e}}(y);function O_(e){var t=(e=e||{}).blacklistController;return{select:function(e){var n=0,r=void 0;return e&&e.some((function(e,r){return n=r,!t.contains(e.serviceLocation)}))&&(r=e[n]),r}}}O_.__dashjs_factory_name="BasicSelector";var P_=D_.default.getClassFactory(O_),L_=Object.defineProperty({default:P_},"__esModule",{value:!0}),F_=q_(na),x_=q_(O),U_=q_(U),B_=q_(R_),k_=q_(C_),G_=q_(L_),j_=q_(y),Y_=q_(be);function q_(e){return e&&e.__esModule?e:{default:e}}function H_(){var e,t=this.context,n=(0,x_.default)(t).getInstance(),r=void 0,i=void 0,a=void 0,o=void 0;function s(){r.reset()}return e={chooseSelector:function(e){(0,Je.checkParameterType)(e,"boolean"),o=e?a:i},select:function(e){if(e){var t=e.baseUrls,r=e.selectedIdx;if(!isNaN(r))return t[r];var a=o.select(t);return a?(e.selectedIdx=t.indexOf(a),a):(n.trigger(U_.default.URL_RESOLUTION_FAILED,{error:new Y_.default(F_.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,F_.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(o===i&&s()))}},reset:s,setConfig:function(e){e.selector&&(o=e.selector)}},r=(0,B_.default)(t).create({updateEventName:U_.default.SERVICE_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:U_.default.SERVICE_LOCATION_BLACKLIST_ADD}),i=(0,G_.default)(t).create({blacklistController:r}),a=(0,k_.default)(t).create({blacklistController:r}),o=i,e}H_.__dashjs_factory_name="BaseURLSelector";var K_=j_.default.getClassFactory(H_),V_=Object.defineProperty({default:K_},"__esModule",{value:!0}),z_=eE(v_),W_=eE(V_),X_=eE(qd),Q_=eE(ch),Z_=eE(y),$_=eE(O),J_=eE(U);function eE(e){return e&&e.__esModule?e:{default:e}}function tE(){var e=void 0,t=void 0,n=this.context,r=(0,$_.default)(n).getInstance(),i=(0,X_.default)(n).getInstance(),a=void 0,o=void 0;function s(e){a.invalidateSelectedIndexes(e.entry)}return e={reset:function(){a.reset(),o.reset()},initialize:function(e){var n;a.setConfig({adapter:t}),n=e,a.update(n),o.chooseSelector(t.getIsDVB(n))},resolve:function(e){var t=a.getForPath(e).reduce((function(e,t){var n=o.select(t);return n?(i.isRelative(n.url)?e.url=i.resolve(n.url,e.url):(e.url=n.url,e.serviceLocation=n.serviceLocation),e.availabilityTimeOffset=n.availabilityTimeOffset,e.availabilityTimeComplete=n.availabilityTimeComplete,e):new Q_.default}),new Q_.default);if(!i.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(a=e.baseURLTreeModel),e.baseURLSelector&&(o=e.baseURLSelector),e.adapter&&(t=e.adapter)}},a=(0,z_.default)(n).create(),o=(0,W_.default)(n).create(),r.on(J_.default.SERVICE_LOCATION_BLACKLIST_CHANGED,s,e),e}tE.__dashjs_factory_name="BaseURLController";var nE=Z_.default.getClassFactory(tE),rE=Object.defineProperty({default:nE},"__esModule",{value:!0}),iE=aE(d);function aE(e){return e&&e.__esModule?e:{default:e}}var oE=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.url=e||null,r.type=n||null,r.mediaType=iE.default.STREAM,r.responseType="",r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(aE(pe).default),sE=Object.defineProperty({default:oE},"__esModule",{value:!0}),uE=pE(be),lE=pE(Kg),fE=pE(sE),dE=pE(O),cE=pE(U),hE=pE(y),gE=pE(na);function pE(e){return e&&e.__esModule?e:{default:e}}function mE(e){e=e||{};var t=this.context,n=(0,dE.default)(t).getInstance(),r=(0,lE.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings?e.settings.get().streaming.lowLatencyEnabled:null,errors:gE.default});return{load:function(e,t,i){var a=function(r,a){t.resolved=!0,t.resolvedContent=r||null,n.trigger(cE.default.XLINK_ELEMENT_LOADED,{element:t,resolveObject:i,error:r||a?null:new uE.default(gE.default.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,gE.default.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if("urn:mpeg:dash:resolve-to-zero:2013"===e)a(null,!0);else{var o=new fE.default(e,de.HTTPRequest.XLINK_EXPANSION_TYPE);r.load({request:o,success:function(e){a(e)},error:function(){a(null)}})}},reset:function(){r&&(r.abort(),r=null)}}}mE.__dashjs_factory_name="XlinkLoader";var _E=hE.default.getClassFactory(mE),EE=Object.defineProperty({default:_E},"__esModule",{value:!0});var yE=function(e){e=e||{},function(){void 0===e.escapeMode&&(e.escapeMode=!0);void 0===e.attributePrefix&&(e.attributePrefix="_");e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0);e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0);void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0);e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1);e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1);void 0===e.ignoreRoot&&(e.ignoreRoot=!1)}();var t=1,n=3,r=4,i=8,a=9;function o(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function s(e){return"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"):e}function u(e,t,n,r){for(var i=0;i<e.length;i++){var a=e[i];if("string"==typeof a){if(a==r)break}else if(a instanceof RegExp){if(a.test(r))break}else if("function"==typeof a&&a(t,n,r))break}return i!=e.length}function l(t,n,r){switch(e.arrayAccessForm){case"property":t[n]instanceof Array?t[n+"_asArray"]=t[n]:t[n+"_asArray"]=[t[n]]}!(t[n]instanceof Array)&&e.arrayAccessFormPaths.length>0&&u(e.arrayAccessFormPaths,t,n,r)&&(t[n]=[t[n]])}function f(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 d(n,r,i,a){return!(r==t&&e.xmlElementsFilter.length>0)||u(e.xmlElementsFilter,n,i,a)}function c(s,h){if(s.nodeType==a){for(var g=new Object,p=s.childNodes,m=0;m<p.length;m++){if((E=p[m]).nodeType==t)if(e.ignoreRoot)g=c(E);else(g={})[y=o(E)]=c(E)}return g}if(s.nodeType==t){(g=new Object).__cnt=0;var _=[];for(p=s.childNodes,m=0;m<p.length;m++){var E,y=o(E=p[m]);if(E.nodeType!=i){var v=h+"."+y;if(d(g,E.nodeType,y,v))if(g.__cnt++,null==g[y]){var T=c(E,v);if("#text"!=y||/[^\s]/.test(T))(A={})[y]=T,_.push(A);g[y]=T,l(g,y,v)}else{null!=g[y]&&(g[y]instanceof Array||(g[y]=[g[y]],l(g,y,v)));var A;T=c(E,v);if("#text"!=y||/[^\s]/.test(T))(A={})[y]=T,_.push(A);g[y][g[y].length]=T}}}g.__children=_;for(var S=o(s),b=0;b<s.attributes.length;b++){var I=s.attributes[b];g.__cnt++;for(var R=I.value,w=0,N=e.matchers.length;w<N;w++){var M=e.matchers[w];M.test(I,S)&&(R=M.converter(I.value))}g[e.attributePrefix+I.name]=R}var C=function(e){return e.prefix}(s);return null!=C&&""!=C&&(g.__cnt++,g.__prefix=C),null!=g["#text"]&&(g.__text=g["#text"],g.__text instanceof Array&&(g.__text=g.__text.join("\n")),e.stripWhitespaces&&(g.__text=g.__text.trim()),delete g["#text"],"property"==e.arrayAccessForm&&delete g["#text_asArray"],g.__text=function(t,n,r){if(e.datetimeAccessFormPaths.length>0){var i=r.split(".#")[0];return u(e.datetimeAccessFormPaths,t,n,i)?f(t):t}return t}(g.__text,y,h+"."+y)),null!=g["#cdata-section"]&&(g.__cdata=g["#cdata-section"],delete g["#cdata-section"],"property"==e.arrayAccessForm&&delete g["#cdata-section_asArray"]),0==g.__cnt&&"text"==e.emptyNodeForm?g="":1==g.__cnt&&null!=g.__text?g=g.__text:1!=g.__cnt||null==g.__cdata||e.keepCData?g.__cnt>1&&null!=g.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==g.__text||""==g.__text.trim())&&delete g.__text:g=g.__cdata,delete g.__cnt,!e.enableToStringFunc||null==g.__text&&null==g.__cdata||(g.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),g}if(s.nodeType==n||s.nodeType==r)return s.nodeValue}function h(t,n,r,i){var a="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=r)for(var o=0;o<r.length;o++){var u=r[o],l=t[u];e.escapeMode&&(l=s(l)),a+=" "+u.substr(e.attributePrefix.length)+"=",e.useDoubleQuotes?a+='"'+l+'"':a+="'"+l+"'"}return a+=i?"/>":">"}function g(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">"}function p(t,n){return"property"==e.arrayAccessForm&&(r=n.toString(),i="_asArray",-1!==r.indexOf(i,r.length-i.length))||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function;var r,i}function m(e){var t=0;if(e instanceof Object)for(var n in e)p(e,n)||t++;return t}function _(t,n,r){return 0==e.jsonPropertiesFilter.length||""==r||u(e.jsonPropertiesFilter,t,n,r)}function E(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 y(t){var n="";return t instanceof Object?n+=function(t){var n="";return null!=t.__cdata&&(n+="<![CDATA["+t.__cdata+"]]>"),null!=t.__text&&(e.escapeMode?n+=s(t.__text):n+=t.__text),n}(t):null!=t&&(e.escapeMode?n+=s(t):n+=t),n}function v(e,t){return""===e?t:e+"."+t}function T(e,t,n,r){var i="";if(0==e.length)i+=h(e,t,n,!0);else for(var a=0;a<e.length;a++)i+=h(e[a],t,E(e[a]),!1),i+=A(e[a],v(r,t)),i+=g(e[a],t);return i}function A(e,t){var n="";if(m(e)>0)for(var r in e)if(!p(e,r)&&(""==t||_(e,r,v(t,r)))){var i=e[r],a=E(i);if(null==i||null==i)n+=h(i,r,a,!0);else if(i instanceof Object)if(i instanceof Array)n+=T(i,r,a,t);else if(i instanceof Date)n+=h(i,r,a,!1),n+=i.toISOString(),n+=g(i,r);else{m(i)>0||null!=i.__text||null!=i.__cdata?(n+=h(i,r,a,!1),n+=A(i,v(t,r)),n+=g(i,r)):n+=h(i,r,a,!0)}else n+=h(i,r,a,!1),n+=y(i),n+=g(i,r)}return n+=y(e)}this.parseXmlString=function(e){if(void 0===e)return null;var t;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("<?")&&(e=e.substr(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?f(e):e},this.xml2json=function(e){return c(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return A(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}},vE=Object.defineProperty({default:yE},"__esModule",{value:!0}),TE=NE(EE),AE=NE(O),SE=NE(U),bE=NE(y),IE=NE(vE),RE=NE(qd),wE=NE(g);function NE(e){return e&&e.__esModule?e:{default:e}}function ME(e){e=e||{};var t=this.context,n=(0,AE.default)(t).getInstance(),r=(0,RE.default)(t).getInstance(),i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0;function f(e,t,n){var i={},a=void 0,o=void 0;i.elements=e,i.type=t,i.resolveType=n,0===i.elements.length&&c(i);for(var s=0;s<i.elements.length;s++)a=i.elements[s],o=r.isHTTPURL(a.url)?a.url:a.originalContent.BaseURL+a.url,l.load(o,a,i)}function d(e){var t,n=void 0,r="";if(n=e.element,t=e.resolveObject,n.resolvedContent){var i=0;0===n.resolvedContent.indexOf("<?xml")&&(i=n.resolvedContent.indexOf("?>")+2),r=n.resolvedContent.substr(0,i)+"<response>"+n.resolvedContent.substr(i)+"</response>",n.resolvedContent=u.xml_str2json(r)}(function(e){var t=void 0;for(t=0;t<e.elements.length;t++)if(!1===e.elements[t].resolved)return!1;return!0})(t)&&c(t)}function c(e){var t=[],r=void 0,i=void 0;if(function(e){var t=[],n=void 0,r=void 0,i=void 0,a=void 0,u=void 0,l=void 0;for(a=e.elements.length-1;a>=0;a--){if(n=e.elements[a],r=n.type+"_asArray",n.resolvedContent){if(n.resolvedContent)for(u=0;u<n.resolvedContent[r].length;u++)i=n.resolvedContent[r][u],t.push(i)}else delete n.originalContent["xlink:actuate"],delete n.originalContent["xlink:href"],t.push(n.originalContent);for(n.parentElement[r].splice(n.index,1),l=0;l<t.length;l++)n.parentElement[r].splice(n.index+l,0,t[l]);t=[]}e.elements.length>0&&o.run(s)}(e),"onActuate"===e.resolveType&&n.trigger(SE.default.XLINK_READY,{manifest:s}),"onLoad"===e.resolveType)switch(e.type){case wE.default.PERIOD:for(r=0;r<s[wE.default.PERIOD+"_asArray"].length;r++)(i=s[wE.default.PERIOD+"_asArray"][r]).hasOwnProperty(wE.default.ADAPTATION_SET+"_asArray")&&(t=t.concat(h(i[wE.default.ADAPTATION_SET+"_asArray"],i,wE.default.ADAPTATION_SET,"onLoad"))),i.hasOwnProperty(wE.default.EVENT_STREAM+"_asArray")&&(t=t.concat(h(i[wE.default.EVENT_STREAM+"_asArray"],i,wE.default.EVENT_STREAM,"onLoad")));f(t,wE.default.ADAPTATION_SET,"onLoad");break;case wE.default.ADAPTATION_SET:n.trigger(SE.default.XLINK_READY,{manifest:s})}}function h(e,t,n,r){var i=[],a=void 0,o=void 0,s=void 0;for(o=e.length-1;o>=0;o--)(a=e[o]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===a["xlink:href"]&&e.splice(o,1);for(o=0;o<e.length;o++)(a=e[o]).hasOwnProperty("xlink:href")&&a.hasOwnProperty("xlink:actuate")&&a["xlink:actuate"]===r&&(s=g(a["xlink:href"],t,n,o,r,a),i.push(s));return i}function g(e,t,n,r,i,a){return{url:e,parentElement:t,type:n,index:r,resolveType:i,originalContent:a,resolvedContent:null,resolved:!1}}return i={resolveManifestOnLoad:function(e){u=new IE.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!1,ignoreRoot:!0,matchers:a}),(s=e).Period_asArray?f(h(s.Period_asArray,s,wE.default.PERIOD,"onLoad"),wE.default.PERIOD,"onLoad"):n.trigger(SE.default.XLINK_READY,{manifest:s})},setMatchers:function(e){e&&(a=e)},setIron:function(e){e&&(o=e)},reset:function(){n.off(SE.default.XLINK_ELEMENT_LOADED,d,i),l&&(l.reset(),l=null)}},n.on(SE.default.XLINK_ELEMENT_LOADED,d,i),l=(0,TE.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),i}ME.__dashjs_factory_name="XlinkController";var CE=bE.default.getClassFactory(ME),DE=Object.defineProperty({default:CE},"__esModule",{value:!0}),OE="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},PE=function(e){return e&&e.__esModule?e:{default:e}}(y);function LE(e){function t(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function n(e,n,r){for(var i=0,a=e.length;i<a;++i){var o=e[i];if(n[o.name])if(r[o.name]){if(o.merge){var s=n[o.name],u=r[o.name];"object"===(void 0===s?"undefined":OE(s))&&"object"===(void 0===u?"undefined":OE(u))?t(s,u):r[o.name]=s+u}}else r[o.name]=n[o.name]}}function r(e,t){for(var i=0,a=e.children.length;i<a;++i){var o=e.children[i],s=t[o.name+"_asArray"];if(s)for(var u=0,l=s.length;u<l;++u){var f=s[u];n(e.properties,t,f),r(o,f)}}}return{run:function(t){if(null===t||"object"!==(void 0===t?"undefined":OE(t)))return t;if(t.Period_asArray&&"period"in e)for(var n=e.period,i=t.Period_asArray,a=0,o=i.length;a<o;++a){var s=i[a];if(r(n,s),"adaptationset"in e){var u=s.AdaptationSet_asArray;if(u)for(var l=e.adaptationset,f=0,d=u.length;f<d;++f)r(l,u[f])}}return t}}}LE.__dashjs_factory_name="ObjectIron";var FE=PE.default.getClassFactory(LE),xE=Object.defineProperty({default:FE},"__esModule",{value:!0}),UE=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var BE=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._test=t,this._converter=n}return UE(e,[{key:"test",get:function(){return this._test}},{key:"converter",get:function(){return this._converter}}]),e}(),kE=Object.defineProperty({default:BE},"__esModule",{value:!0}),GE=YE(kE),jE=YE(g);function YE(e){return e&&e.__esModule?e:{default:e}}function qE(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var HE=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(function(e,t){var n,r=(qE(n={},jE.default.MPD,[jE.default.ID,jE.default.PROFILES]),qE(n,jE.default.PERIOD,[jE.default.ID]),qE(n,jE.default.BASE_URL,[jE.default.SERVICE_LOCATION,jE.default.BYTE_RANGE]),qE(n,jE.default.SEGMENT_BASE,[jE.default.INDEX_RANGE]),qE(n,jE.default.INITIALIZATION,[jE.default.RANGE]),qE(n,jE.default.REPRESENTATION_INDEX,[jE.default.RANGE]),qE(n,jE.default.SEGMENT_LIST,[jE.default.INDEX_RANGE]),qE(n,jE.default.BITSTREAM_SWITCHING,[jE.default.RANGE]),qE(n,jE.default.SEGMENT_URL,[jE.default.MEDIA_RANGE,jE.default.INDEX_RANGE]),qE(n,jE.default.SEGMENT_TEMPLATE,[jE.default.INDEX_RANGE,jE.default.MEDIA,jE.default.INDEX,jE.default.INITIALIZATION_MINUS,jE.default.BITSTREAM_SWITCHING_MINUS]),qE(n,jE.default.ASSET_IDENTIFIER,[jE.default.VALUE,jE.default.ID]),qE(n,jE.default.EVENT_STREAM,[jE.default.VALUE]),qE(n,jE.default.ADAPTATION_SET,[jE.default.PROFILES,jE.default.MIME_TYPE,jE.default.SEGMENT_PROFILES,jE.default.CODECS,jE.default.CONTENT_TYPE]),qE(n,jE.default.FRAME_PACKING,[jE.default.VALUE,jE.default.ID]),qE(n,jE.default.AUDIO_CHANNEL_CONFIGURATION,[jE.default.VALUE,jE.default.ID]),qE(n,jE.default.CONTENT_PROTECTION,[jE.default.VALUE,jE.default.ID]),qE(n,jE.default.ESSENTIAL_PROPERTY,[jE.default.VALUE,jE.default.ID]),qE(n,jE.default.SUPPLEMENTAL_PROPERTY,[jE.default.VALUE,jE.default.ID]),qE(n,jE.default.INBAND_EVENT_STREAM,[jE.default.VALUE,jE.default.ID]),qE(n,jE.default.ACCESSIBILITY,[jE.default.VALUE,jE.default.ID]),qE(n,jE.default.ROLE,[jE.default.VALUE,jE.default.ID]),qE(n,jE.default.RATING,[jE.default.VALUE,jE.default.ID]),qE(n,jE.default.VIEWPOINT,[jE.default.VALUE,jE.default.ID]),qE(n,jE.default.CONTENT_COMPONENT,[jE.default.CONTENT_TYPE]),qE(n,jE.default.REPRESENTATION,[jE.default.ID,jE.default.DEPENDENCY_ID,jE.default.MEDIA_STREAM_STRUCTURE_ID]),qE(n,jE.default.SUBSET,[jE.default.ID]),qE(n,jE.default.METRICS,[jE.default.METRICS_MINUS]),qE(n,jE.default.REPORTING,[jE.default.VALUE,jE.default.ID]),n);if(r.hasOwnProperty(t)){var i=r[t];return void 0!==i&&i.indexOf(e.name)>=0}return!1}),(function(e){return String(e)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(GE.default),KE=Object.defineProperty({default:HE},"__esModule",{value:!0}),VE=XE(kE),zE=XE(d),WE=XE(g);function XE(e){return e&&e.__esModule?e:{default:e}}var QE=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,ZE=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){for(var t=[WE.default.MIN_BUFFER_TIME,WE.default.MEDIA_PRESENTATION_DURATION,WE.default.MINIMUM_UPDATE_PERIOD,WE.default.TIMESHIFT_BUFFER_DEPTH,WE.default.MAX_SEGMENT_DURATION,WE.default.MAX_SUBSEGMENT_DURATION,WE.default.SUGGESTED_PRESENTATION_DELAY,WE.default.START,zE.default.START_TIME,WE.default.DURATION],n=t.length,r=0;r<n;r++)if(e.nodeName===t[r])return QE.test(e.value);return!1}),(function(e){var t=QE.exec(e),n=31536e3*parseFloat(t[3]||0)+2592e3*parseFloat(t[5]||0)+86400*parseFloat(t[7]||0)+3600*parseFloat(t[9]||0)+60*parseFloat(t[11]||0)+parseFloat(t[13]||0);return void 0!==t[1]&&(n=-n),n})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(VE.default),$E=Object.defineProperty({default:ZE},"__esModule",{value:!0}),JE=function(e){return e&&e.__esModule?e:{default:e}}(kE);var ey=/^([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}))?/,ty=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){return ey.test(e.value)}),(function(e){var t=ey.exec(e),n=void 0;if(n=Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[4],10),parseInt(t[5],10),t[6]&&parseInt(t[6],10)||0,t[7]&&1e3*parseFloat(t[7])||0),t[9]&&t[10]){var r=60*parseInt(t[9],10)+parseInt(t[10],10);n+=("+"===t[8]?-1:1)*r*60*1e3}return new Date(n)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(JE.default),ny=Object.defineProperty({default:ty},"__esModule",{value:!0}),ry=function(e){return e&&e.__esModule?e:{default:e}}(kE);var iy=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,ay=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(function(e){return iy.test(e.value)}),(function(e){return parseFloat(e)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(ry.default),oy=Object.defineProperty({default:ay},"__esModule",{value:!0}),sy=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var uy=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n;this._name=t,this._merge=(n=t)&&n.length&&n.charAt(0)===n.charAt(0).toUpperCase()}return sy(e,[{key:"name",get:function(){return this._name}},{key:"merge",get:function(){return this._merge}}]),e}(),ly=Object.defineProperty({default:uy},"__esModule",{value:!0}),fy=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),dy=function(e){return e&&e.__esModule?e:{default:e}}(ly);var cy=function(){function e(t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t||"",this._properties=[],this._children=r||[],Array.isArray(n)&&n.forEach((function(e){i._properties.push(new dy.default(e))}))}return fy(e,[{key:"name",get:function(){return this._name}},{key:"children",get:function(){return this._children}},{key:"properties",get:function(){return this._properties}}]),e}(),hy=Object.defineProperty({default:cy},"__esModule",{value:!0}),gy=my(hy),py=my(g);function my(e){return e&&e.__esModule?e:{default:e}}var _y=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=[py.default.PROFILES,py.default.WIDTH,py.default.HEIGHT,py.default.SAR,py.default.FRAMERATE,py.default.AUDIO_SAMPLING_RATE,py.default.MIME_TYPE,py.default.SEGMENT_PROFILES,py.default.CODECS,py.default.MAXIMUM_SAP_PERIOD,py.default.START_WITH_SAP,py.default.MAX_PLAYOUT_RATE,py.default.CODING_DEPENDENCY,py.default.SCAN_TYPE,py.default.FRAME_PACKING,py.default.AUDIO_CHANNEL_CONFIGURATION,py.default.CONTENT_PROTECTION,py.default.ESSENTIAL_PROPERTY,py.default.SUPPLEMENTAL_PROPERTY,py.default.INBAND_EVENT_STREAM];return function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,py.default.ADAPTATION_SET,e,[new gy.default(py.default.REPRESENTATION,e,[new gy.default(py.default.SUB_REPRESENTATION,e)])]))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(gy.default),Ey=Object.defineProperty({default:_y},"__esModule",{value:!0}),yy=Ty(hy),vy=Ty(g);function Ty(e){return e&&e.__esModule?e:{default:e}}var Ay=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=[vy.default.SEGMENT_BASE,vy.default.SEGMENT_TEMPLATE,vy.default.SEGMENT_LIST];return function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,vy.default.PERIOD,e,[new yy.default(vy.default.ADAPTATION_SET,e,[new yy.default(vy.default.REPRESENTATION,e)])]))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(yy.default),Sy=Object.defineProperty({default:Ay},"__esModule",{value:!0}),by=Py(y),Iy=Py(xE),Ry=Py(vE),wy=Py(KE),Ny=Py($E),My=Py(ny),Cy=Py(oy),Dy=Py(Ey),Oy=Py(Sy);function Py(e){return e&&e.__esModule?e:{default:e}}function Ly(e){e=e||{};var t=this.context,n=e.debug,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;return r={parse:function(e){var t=void 0,n=window.performance.now();if(!(t=o.xml_str2json(e)))throw new Error("parsing the manifest failed");var r=window.performance.now();t.Patch?((t=t.Patch).add_asArray&&t.add_asArray.forEach((function(e){return s.run(e)})),t.replace_asArray&&t.replace_asArray.forEach((function(e){return s.run(e)}))):(t=t.MPD,s.run(t));var a=window.performance.now();return i.info("Parsing complete: ( xml2json: "+(r-n).toPrecision(3)+"ms, objectiron: "+(a-r).toPrecision(3)+"ms, total: "+((a-n)/1e3).toPrecision(3)+"s)"),t.protocol="DASH",t},getMatchers:function(){return a},getIron:function(){return s}},i=n.getLogger(r),a=[new Ny.default,new My.default,new Cy.default,new wy.default],o=new Ry.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!0,ignoreRoot:!1,matchers:a}),s=(0,Iy.default)(t).create({adaptationset:new Dy.default,period:new Oy.default}),r}Ly.__dashjs_factory_name="DashParser";var Fy=by.default.getClassFactory(Ly),xy=Object.defineProperty({default:Fy},"__esModule",{value:!0}),Uy=Xy(d),By=Xy(g),ky=Xy(DE),Gy=Xy(Kg),jy=Xy(qd),Yy=Xy(sE),qy=Xy(be),Hy=Xy(O),Ky=Xy(U),Vy=Xy(na),zy=Xy(y),Wy=Xy(xy);function Xy(e){return e&&e.__esModule?e:{default:e}}function Qy(e){e=e||{};var t=this.context,n=e.debug,r=(0,Hy.default)(t).getInstance(),i=(0,jy.default)(t).getInstance(),a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=e.mssHandler,d=e.errHandler;function c(e){r.trigger(Ky.default.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}return a={load:function(e){var a=new Yy.default(e,de.HTTPRequest.MPD_TYPE);s.load({request:a,success:function(a,s,d){if(u){var c=void 0,h=void 0,g=void 0;if(d&&d!==e?(h=i.parseBaseUrl(d),c=d):(i.isRelative(e)&&(e=i.resolve(e,window.location.href)),h=i.parseBaseUrl(e)),"No Content"!=s)if(null===l&&(l=function(e){var r=null;return e.indexOf("SmoothStreamingMedia")>-1?(f&&(r=f.createMssParser(),f.registerEvents()),r):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?(0,Wy.default)(t).create({debug:n}):r}(a)),null!==l){u.setMatchers(l.getMatchers()),u.setIron(l.getIron());try{g=l.parse(a)}catch(t){return void r.trigger(Ky.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new qy.default(Vy.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,Vy.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)})}g?(g.url=c||e,g.originalUrl||(g.originalUrl=g.url),g.hasOwnProperty(Uy.default.LOCATION)&&(h=i.parseBaseUrl(g.Location_asArray[0]),o.debug("BaseURI set by Location to: "+h)),g.baseUri=h,g.loadedTime=new Date,u.resolveManifestOnLoad(g),r.trigger(Ky.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:a})):r.trigger(Ky.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new qy.default(Vy.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,Vy.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)})}else r.trigger(Ky.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new qy.default(Vy.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,Vy.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)});else r.trigger(Ky.default.INTERNAL_MANIFEST_LOADED,{manifest:null})}},error:function(t,n,i){r.trigger(Ky.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new qy.default(Vy.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,Vy.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+(e+", ")+i)})}})},reset:function(){r.off(Ky.default.XLINK_READY,c,a),f&&f.reset(),u&&(u.reset(),u=null),s&&(s.abort(),s=null)}},o=n.getLogger(a),r.on(Ky.default.XLINK_READY,c,a),s=(0,Gy.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings.get().streaming.lowLatencyEnabled,urlUtils:i,constants:Uy.default,dashConstants:By.default,errors:Vy.default}),u=(0,ky.default)(t).create({errHandler:d,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),l=null,a}Qy.__dashjs_factory_name="ManifestLoader";var Zy=zy.default.getClassFactory(Qy),$y=Object.defineProperty({default:Zy},"__esModule",{value:!0}),Jy=nv(O),ev=nv(U),tv=nv(y);function nv(e){return e&&e.__esModule?e:{default:e}}function rv(){var e=this.context,t=(0,Jy.default)(e).getInstance();return{error:function(e){t.trigger(ev.default.ERROR,{error:e})}}}rv.__dashjs_factory_name="ErrorHandler";var iv=tv.default.getSingletonFactory(rv),av=Object.defineProperty({default:iv},"__esModule",{value:!0}),ov=lv,sv=function(e){return e&&e.__esModule?e:{default:e}}(y);var uv=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function lv(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t}function fv(){var e,t=void 0;return e={supportsMediaSource:lv,supportsEncryptedMedia:function(){return t},supportsCodec:function(e){return!(!("MediaSource"in window)||!MediaSource.isTypeSupported(e))||!(!("WebKitMediaSource"in window)||!WebKitMediaSource.isTypeSupported(e))},setEncryptedMediaSupported:function(e){t=e},supportsEssentialProperty:function(e){try{return-1!==Rh.THUMBNAILS_SCHEME_ID_URIS.indexOf(e.schemeIdUri)}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var n=e.split(".")[0],r=0===t.indexOf(n),i=void 0,a=0;a<uv.length;a++)if(uv[a].codec===n){i=uv[a];break}return i?r||i.compatibleCodecs.some((function(e){return 0===t.indexOf(e)})):r}},t=!1,e}fv.__dashjs_factory_name="Capabilities";var dv=sv.default.getSingletonFactory(fv),cv=Object.defineProperty({supportsMediaSource:ov,default:dv},"__esModule",{value:!0}),hv=mv(y),gv=mv(Q),pv=mv(d);function mv(e){return e&&e.__esModule?e:{default:e}}function _v(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0;function s(e,t){var i=n.getRealPeriodByIndex(t?t.index:null);i&&i.AdaptationSet_asArray&&0!==i.AdaptationSet_asArray.length&&(i.AdaptationSet_asArray=i.AdaptationSet_asArray.filter((function(t){return!t.Representation_asArray||0===t.Representation_asArray.length||!n.getIsTypeOf(t,e)||(t.Representation_asArray=t.Representation_asArray.filter((function(e,i){var o=n.getCodec(t,i,!0);return!!r.supportsCodec(o)||(a.error("[Stream] codec not supported: "+o),!1)})),t.Representation_asArray&&t.Representation_asArray.length>0)})))}return t={setConfig:function(e){e&&(e.adapter&&(n=e.adapter),e.capabilities&&(r=e.capabilities),e.settings&&(i=e.settings))},filterUnsupportedFeaturesOfPeriod:function(e){s(pv.default.VIDEO,e),s(pv.default.AUDIO,e),i.get().streaming.filterUnsupportedEssentialProperties&&function(e){var t=n.getRealPeriodByIndex(e?e.index:null);if(!t||!t.AdaptationSet_asArray||0===t.AdaptationSet_asArray.length)return;t.AdaptationSet_asArray=t.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){var t=n.getEssentialPropertiesForRepresentation(e);if(t&&t.length>0)for(var i=0;i<t.length;){if(!r.supportsEssentialProperty(t[i]))return a.debug("[Stream] EssentialProperty not supported: "+t[i].schemeIdUri),!1;i+=1}return!0})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}(e),function(e){if(!o||0===o.length)return;var t=n.getRealPeriodByIndex(e?e.index:null);if(!t||!t.AdaptationSet_asArray||0===t.AdaptationSet_asArray.length)return;t.AdaptationSet_asArray=t.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){return!o.some((function(t){return!t(e)}))})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}(e)},setCustomCapabilitiesFilters:function(e){o=e}},a=(0,gv.default)(e).getInstance().getLogger(t),t}_v.__dashjs_factory_name="CapabilitiesFilter";var Ev=hv.default.getSingletonFactory(_v),yv=Object.defineProperty({default:Ev},"__esModule",{value:!0});var vv=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},Tv=Sv(Object.defineProperty({default:vv},"__esModule",{value:!0})),Av=Sv(y);function Sv(e){return e&&e.__esModule?e:{default:e}}function bv(){var e=void 0;return{initialize:function(t){if(e=new Tv.default,!t)return null;var n=t.indexOf("#");if(-1!==n)for(var r=t.substr(n+1).split("&"),i=0,a=r.length;i<a;++i){var o=r[i],s=o.indexOf("=");if(-1!==s){var u=o.substring(0,s);e.hasOwnProperty(u)&&(e[u]=o.substr(s+1))}}},getURIFragmentData:function(){return e}}}bv.__dashjs_factory_name="URIFragmentModel";var Iv=Av.default.getSingletonFactory(bv),Rv=Object.defineProperty({default:Iv},"__esModule",{value:!0}),wv=Cv(O),Nv=Cv(U),Mv=Cv(y);function Cv(e){return e&&e.__esModule?e:{default:e}}function Dv(){var e=this.context,t=(0,wv.default)(e).getInstance(),n=void 0;return{getValue:function(){return n},setValue:function(e){n=e,e&&t.trigger(Nv.default.MANIFEST_LOADED,{data:e})}}}Dv.__dashjs_factory_name="ManifestModel";var Ov=Mv.default.getSingletonFactory(Dv),Pv=Object.defineProperty({default:Ov},"__esModule",{value:!0}),Lv=kv(sh),Fv=kv(y),xv=kv(d),Uv=kv(Au),Bv=kv(kc);function kv(e){return e&&e.__esModule?e:{default:e}}function Gv(){var e,t=void 0,n=void 0,r=void 0,i=this.context,a=(0,Bv.default)(i).getInstance();function o(e){var t=void 0;for(t=0;t<r.length;t++)if(r[t].rulename===e)return t;return-1}function s(){return a.get().streaming.lowLatencyEnabled?a.get().streaming.liveDelay||3:a.get().streaming.liveDelay}function u(e,n){l(e,n);var r=new Lv.default;r.schemeIdUri=e,r.value=n,t.push(r)}function l(e,n){(0,Je.checkParameterType)(e,"string"),(0,Je.checkParameterType)(n,"string"),t.forEach((function(r,i){r.schemeIdUri===e&&r.value===n&&t.splice(i,1)}))}return e={getABRCustomRules:function(){return r},addABRCustomRule:function(e,t,n){if("string"!=typeof e||e!==Uv.default.ABANDON_FRAGMENT_RULES&&e!==Uv.default.QUALITY_SWITCH_RULES||"string"!=typeof t)throw xv.default.BAD_ARGUMENT_ERROR;var i=o(t);-1===i?r.push({type:e,rulename:t,rule:n}):(r[i].type=e,r[i].rule=n)},removeABRCustomRule:function(e){if(e){var t=o(e);-1!==t&&r.splice(t,1)}else r=[]},getStableBufferTime:function(){if(a.get().streaming.lowLatencyEnabled)return.6*s();var e=a.get().streaming.stableBufferTime;return e>-1?e:a.get().streaming.fastSwitchEnabled?20:12},getRetryAttemptsForType:function(e){var t=isNaN(a.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:a.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return a.get().streaming.lowLatencyEnabled?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 a.get().streaming.lowLatencyEnabled?a.get().streaming.retryIntervals[e]/t:a.get().streaming.retryIntervals[e]},getLiveDelay:s,getLiveCatchupLatencyThreshold:function(){try{var e=a.get().streaming.liveCatchup.latencyThreshold,t=s();if(null!==e&&!isNaN(e))return Math.max(e,t);var n=a.get().streaming.liveCatchup.minDrift,r=!isNaN(t)&&t?isNaN(n)?s():a.get().streaming.liveCatchup.minDrift+s():NaN;return r&&!isNaN(r)?Math.max(4*r,5):NaN}catch(e){return NaN}},addUTCTimingSource:u,removeUTCTimingSource:l,getUTCTimingSources:function(){return t},clearDefaultUTCTimingSources:function(){t=[]},restoreDefaultUTCTimingSources:function(){var e=a.get().streaming.utcSynchronization.defaultTimingSource;u(e.scheme,e.value)},setXHRWithCredentialsForType:function e(t,r){t?n[t]=!!r:Object.keys(n).forEach((function(t){e(t,r)}))},getXHRWithCredentialsForType:function(e){var t=n[e];return void 0===t?n.default:t},getDefaultUtcTimingSource:function(){return a.get().streaming.utcSynchronization.defaultTimingSource},reset:function(){}},t=[],n={default:!1},r=[],e}Gv.__dashjs_factory_name="MediaPlayerModel";var jv=Fv.default.getSingletonFactory(Gv),Yv=Object.defineProperty({default:jv},"__esModule",{value:!0}),qv=zv(y),Hv=zv(O),Kv=zv(U),Vv=zv(Q);function zv(e){return e&&e.__esModule?e:{default:e}}function Wv(){var e=void 0,t=void 0,n=void 0,r=void 0,i=void 0,a=this.context,o=(0,Hv.default)(a).getInstance(),s=[];function u(){n&&(n.playbackRate=i||1,n.removeEventListener("canplay",u))}function l(e){n&&(n.readyState<=2&&e>0?n.addEventListener("canplay",u):n.playbackRate=e)}function f(){return s.length>0}function d(e){var t=s.indexOf(e),r=void 0;null!==e&&(-1!==t&&s.splice(t,1),n&&!1===f()&&0===n.playbackRate&&(l(i||1),n.paused||((r=document.createEvent("Event")).initEvent("playing",!0,!1),n.dispatchEvent(r))))}function c(){if(n&&f()&&0===n.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}function h(){return n?n.buffered:null}function g(e,t,r,i,a){if(n)for(var o=0;o<n.textTracks.length;o++)if(n.textTracks[o].kind===e&&(!t||n.textTracks[o].label==t)&&n.textTracks[o].language===r&&n.textTracks[o].isTTML===i&&n.textTracks[o].isEmbedded===a)return n.textTracks[o];return null}return e={initialize:function(){o.on(Kv.default.PLAYBACK_PLAYING,c,this)},setCurrentTime:function(e,t){if(n){if(n.currentTime==e)return;try{e=t?function(e){var t=h(),n=e,r=9999999999;if(t)for(var i=0;i<t.length;i++){var a=t.start(i),o=t.end(i),s=Math.abs(a-e),u=Math.abs(o-e);if(e>=a&&e<=o)return e;s<r&&(r=s,n=a),u<r&&(r=u,n=o)}return n}(e):e,n.currentTime=e}catch(t){0===n.readyState&&t.code===t.INVALID_STATE_ERR&&setTimeout((function(){n.currentTime=e}),400)}}},play:function(){if(n){n.autoplay=!0;var e=n.play();e&&e.catch&&"undefined"!=typeof Promise&&e.catch((function(e){"NotAllowedError"===e.name&&o.trigger(Kv.default.PLAYBACK_NOT_ALLOWED),t.warn("Caught pending play exception - continuing ("+e+")")}))}},isPaused:function(){return n?n.paused:null},pause:function(){n&&(n.pause(),n.autoplay=!1)},isStalled:f,isSeeking:function(){return n?n.seeking:null},getTime:function(){return n?n.currentTime:null},getPlaybackRate:function(){return n?n.playbackRate:null},setPlaybackRate:l,getPlayedRanges:function(){return n?n.played:null},getEnded:function(){return n?n.ended:null},setStallState:function(e,t){!function(e,t){t?function(e){var t=void 0;if(null===e||!n||n.seeking||-1!==s.indexOf(e))return;s.push(e),n&&1===s.length&&((t=document.createEvent("Event")).initEvent("waiting",!0,!1),i=n.playbackRate,l(0),n.dispatchEvent(t))}(e):d(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 r},setTTMLRenderingDiv:function(e){(r=e).style.position="absolute",r.style.display="flex",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.top=0,r.style.left=0},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:function(e,t){n&&n.addEventListener(e,t)},removeEventListener:function(e,t){n&&n.removeEventListener(e,t)},getReadyState:function(){return n?n.readyState:NaN},getBufferRange:h,getClientWidth:function(){return n?n.clientWidth:NaN},getClientHeight:function(){return n?n.clientHeight:NaN},getTextTracks:function(){return n?n.textTracks:[]},getTextTrack:g,addTextTrack:function(e,t,r,i,a){if(!n)return null;var o=g(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},reset:function(){o.off(Kv.default.PLAYBACK_PLAYING,c,this)}},t=(0,Vv.default)(a).getInstance().getLogger(e),e}Wv.__dashjs_factory_name="VideoModel";var Xv=qv.default.getSingletonFactory(Wv),Qv=Object.defineProperty({default:Xv},"__esModule",{value:!0}),Zv=eT(y),$v=eT(Q),Jv=eT(d);function eT(e){return e&&e.__esModule?e:{default:e}}var tT=[{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"}];function nT(e){e=e||{};var t=this.context,n=e.settings,r=void 0,i=void 0,a=void 0;function o(e){if(void 0!==a)return a;a=!1;var t=void 0;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return i.warn("DOMStorage access denied: "+e.message),a}if(!t||"localStorage"!==e&&"sessionStorage"!==e)return a;try{t.setItem("1","1"),t.removeItem("1"),a=!0}catch(e){i.warn("DOMStorage is supported, but cannot be used: "+e.message)}return a}function s(){return 6e5*Math.round((new Date).getTime()/6e5)}function u(e,t){return o(e)&&n.get().streaming[t+"CachingInfo"].enabled}function l(){if(!n)throw new Error(Jv.default.MISSING_CONFIG_ERROR)}return r={getSavedBitrateSettings:function(e){var t=NaN;if(l(),u("localStorage","lastBitrate")){var r="dashjs_?_bitrate".replace(/\?/,e);try{var a=JSON.parse(localStorage.getItem(r))||{},o=(new Date).getTime()-parseInt(a.timestamp,10)>=n.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(a.bitrate);isNaN(s)||o?o&&localStorage.removeItem(r):(t=s,i.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(u("localStorage","lastBitrate")&&t){var n="dashjs_?_bitrate".replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({bitrate:t.toFixed(3),timestamp:s()}))}catch(e){i.error(e.message)}}},getSavedMediaSettings:function(e){var t=null;if(l(),u("localStorage","lastMediaSettings")){var r="dashjs_?_settings".replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=n.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=i.settings,a&&(localStorage.removeItem(r),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(u("localStorage","lastMediaSettings")){var n="dashjs_?_settings".replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({settings:t,timestamp:s()}))}catch(e){i.error(e.message)}}}},i=(0,$v.default)(t).getInstance().getLogger(r),o("localStorage")&&tT.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){i.error(e.message)}}})),r}nT.__dashjs_factory_name="DOMStorage";var rT=Zv.default.getSingletonFactory(nT),iT=Object.defineProperty({default:rT},"__esModule",{value:!0}),aT=function(){return"3.2.2"};var oT=Object.defineProperty({getVersionString:aT},"__esModule",{value:!0}),sT=cT(Of),uT=cT(be),lT=cT(y),fT=cT(pe),dT=cT(Kg);function cT(e){return e&&e.__esModule?e:{default:e}}function hT(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0;function _(){if(!m||!m.hasOwnProperty("resolve"))throw new Error("setConfig function has to be called previously")}function E(e){if(e.url){var t=new fT.default;return t.setInfo(e),t}}function y(e,t,n,r){d.trigger(f.SEGMENTS_LOADED,{segments:n,representation:r,error:n?void 0:new uT.default(c.SEGMENT_BASE_LOADER_ERROR_CODE,c.SEGMENT_BASE_LOADER_ERROR_MESSAGE)},{streamId:e,mediaType:t})}return t={setConfig:function(e){e.baseURLController&&(m=e.baseURLController),e.dashMetrics&&(o=e.dashMetrics),e.mediaPlayerModel&&(u=e.mediaPlayerModel),e.errHandler&&(r=e.errHandler),e.settings&&(s=e.settings),e.boxParser&&(i=e.boxParser),e.events&&(f=e.events),e.eventBus&&(d=e.eventBus),e.debug&&(n=e.debug.getLogger(t)),e.requestModifier&&(a=e.requestModifier),e.errors&&(c=e.errors),e.urlUtils&&(p=e.urlUtils),e.constants&&(h=e.constants),e.dashConstants&&(g=e.dashConstants)},initialize:function(){l=(0,dT.default)(e).create({errHandler:r,dashMetrics:o,mediaPlayerModel:u,requestModifier:a,useFetch:s?s.get().streaming.lowLatencyEnabled:null,boxParser:i,errors:c,urlUtils:p,constants:h,dashConstants:g})},loadInitialization:function e(t,r,a,o){_();var s=null,u=a?m.resolve(a.path):null,c=o||{init:!0,url:u?u.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:r};n.debug("Start searching for initialization.");var h=E(c);l.load({request:h,success:function(n){c.bytesLoaded=c.range.end,(s=i.findInitRange(n))?(a.range=s,d.trigger(f.INITIALIZATION_LOADED,{representation:a},{streamId:t,mediaType:r})):(c.range.end=c.bytesLoaded+c.bytesToLoad,e(t,r,a,c))},error:function(){d.trigger(f.INITIALIZATION_LOADED,{representation:a},{streamId:t,mediaType:r})}}),n.debug("Perform init search: "+c.url)},loadSegments:function e(t,r,a,o,s,u){if(_(),o&&(void 0===o.start||void 0===o.end)){var f=o?o.toString().split("-"):null;o=f?{start:parseFloat(f[0]),end:parseFloat(f[1])}:null}s=s||y;var d=null,c=null,h=!!o,g=a?m.resolve(a.path):null,p={init:!1,url:g?g.url:void 0,range:h?o:{start:0,end:1500},searching:!h,bytesLoaded:u?u.bytesLoaded:0,bytesToLoad:1500,mediaType:r},v=E(p);l.load({request:v,success:function(o){var u=p.bytesToLoad,l=o.byteLength;if(p.bytesLoaded=p.range.end-p.range.start,d=i.parse(o),(c=d.getBox("sidx"))&&c.isComplete){var f=c.references,h=void 0,g=void 0;if(null!=f&&f.length>0&&(h=1===f[0].reference_type),h){n.debug("Initiate multiple SIDX load."),p.range.end=p.range.start+c.size;var m=void 0,_=void 0,E=void 0,y=void 0,v=[],T=0,A=(c.offset||p.range.start)+c.size,S=function(e,t,n){n?(v=v.concat(n),++T>=_&&(v.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),s(e,t,v,a))):s(e,t,null,a)};for(m=0,_=f.length;m<_;m++)E=A,y=A+f[m].referenced_size-1,A+=f[m].referenced_size,e(t,r,a,{start:E,end:y},S,p)}else n.debug("Parsing segments from SIDX. representation "+r+" - id: "+a.id+" for range : "+p.range.start+" - "+p.range.end),g=function(e,t){for(var n=e.references,r=n.length,i=e.timescale,a=e.earliest_presentation_time,o=t.range.start+e.offset+e.first_offset+e.size,s=[],u=void 0,l=void 0,f=void 0,d=void 0,c=0;c<r;c++)f=n[c].subsegment_duration,d=n[c].referenced_size,(u=new sT.default).duration=f,u.startTime=a,u.timescale=i,l=o+d-1,u.mediaRange=o+"-"+l,s.push(u),a+=f,o+=d;return s}(c,p),s(t,r,g,a)}else{if(c)p.range.start=c.offset||p.range.start,p.range.end=p.range.start+(c.size||u);else{if(l<p.bytesLoaded)return void s(t,r,null,a);var b=d.getLastBox();b&&b.size?(p.range.start=b.offset+b.size,p.range.end=p.range.start+u):p.range.end+=u}e(t,r,a,p.range,s,p)}},error:function(){s(t,r,null,a)}}),n.debug("Perform SIDX load: "+p.url+" with range : "+p.range.start+" - "+p.range.end)},reset:function(){l.abort(),l=null,r=null,i=null,a=null}}}hT.__dashjs_factory_name="SegmentBaseLoader";var gT=lT.default.getSingletonFactory(hT),pT=Object.defineProperty({default:gT},"__esModule",{value:!0}),mT=function(e){return e&&e.__esModule?e:{default:e}}(y);function _T(e){e=e||{};var t=void 0,n=new DataView(e.data),r=0;function i(e,t){var i=!0,a=0;if(void 0===t&&(t=!1),e.tag>16777215?(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;u<a;u+=1,t+=1)o=o<<8|255&n.getUint8(r+t);return r+=t,o}return t={getPos:function(){return r},setPos:function(e){r=e},consumeTag:i,consumeTagAndSize:function(e,t){var n=i(e,t);return n&&a(),n},parseTag:function(e){var n;return i(e),n=a(),t[e.parse](n)},skipOverElement:function(e,t){var n=i(e,t),o=void 0;return n&&(o=a(),r+=o),n},getMatroskaCodedNum:a,getMatroskaFloat:function(e){var t=void 0;switch(e){case 4:t=n.getFloat32(r),r+=4;break;case 8:t=n.getFloat64(r),r+=8}return t},getMatroskaUint:function(e){for(var t=0,i=0;i<e;i+=1)t<<=8,t|=255&n.getUint8(r+i);return r+=e,t},moreData:function(){return r<n.byteLength}}}_T.__dashjs_factory_name="EBMLParser";var ET=mT.default.getClassFactory(_T),yT=RT(Object.defineProperty({default:ET},"__esModule",{value:!0})),vT=RT(d),TT=RT(y),AT=RT(Of),ST=RT(pe),bT=RT(Kg),IT=RT(be);function RT(e){return e&&e.__esModule?e:{default:e}}function wT(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0;function g(t,i,a,o){var s,u,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0;for(f=[],c=0,u=(s=function(t){var n=[],i=(0,yT.default)(e).create({data:t}),a=void 0,o=void 0;for(i.consumeTagAndSize(r.Segment.Cues);i.moreData()&&i.consumeTagAndSize(r.Segment.Cues.CuePoint,!0);){for((a={}).CueTime=i.parseTag(r.Segment.Cues.CuePoint.CueTime),a.CueTracks=[];i.moreData()&&i.consumeTag(r.Segment.Cues.CuePoint.CueTrackPositions,!0);){var s=i.getMatroskaCodedNum(),u=i.getPos();if((o={}).Track=i.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===o.Track)throw new Error("Cue track cannot be 0");o.ClusterPosition=i.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),a.CueTracks.push(o),i.setPos(u+s)}if(0===a.CueTracks.length)throw new Error("Mandatory cuetrack not found");n.push(a)}if(0===n.length)throw new Error("mandatory cuepoint not found");return n}(t)).length;c<u;c+=1)d=new AT.default,l=0,l=c<s.length-1?s[c+1].CueTime-s[c].CueTime:o-s[c].CueTime,d.duration=l,d.startTime=s[c].CueTime,d.timescale=1e3,h=s[c].CueTracks[0].ClusterPosition+i,g=c<s.length-1?s[c+1].CueTracks[0].ClusterPosition+i-1:a-1,d.mediaRange=h+"-"+g,f.push(d);return n.debug("Parsed cues: "+f.length+" cues."),f}function p(){if(!h||!h.hasOwnProperty("resolve"))throw new Error("setConfig function has to be called previously")}function m(e,t,n,r){f.trigger(d.SEGMENTS_LOADED,{segments:n,representation:r,error:n?void 0:new IT.default(c.SEGMENT_BASE_LOADER_ERROR_CODE,c.SEGMENT_BASE_LOADER_ERROR_MESSAGE)},{streamId:e,mediaType:t})}function _(e){var t=new ST.default;return t.setInfo(e),t}return t={setConfig:function(e){if(!(e.baseURLController&&e.dashMetrics&&e.mediaPlayerModel&&e.errHandler))throw new Error(vT.default.MISSING_CONFIG_ERROR);h=e.baseURLController,o=e.dashMetrics,s=e.mediaPlayerModel,i=e.errHandler,l=e.settings,d=e.events,f=e.eventBus,c=e.errors,n=e.debug.getLogger(t),a=e.requestModifier},initialize:function(){u=(0,bT.default)(e).create({errHandler:i,dashMetrics:o,mediaPlayerModel:s,requestModifier:a,useFetch:l?l.get().streaming.lowLatencyEnabled:null,errors:c})},loadInitialization:function(e,t,r,i){p();var a=null,o=r?h.resolve(r.path):null,s=r?r.range.split("-"):null,l=i||{range:{start:s?parseFloat(s[0]):null,end:s?parseFloat(s[1]):null},request:a,url:o?o.url:void 0,init:!0,mediaType:t};n.info("Start loading initialization."),a=_(l),u.load({request:a,success:function(){f.trigger(d.INITIALIZATION_LOADED,{representation:r},{streamId:e,mediaType:t})},error:function(){f.trigger(d.INITIALIZATION_LOADED,{representation:r},{streamId:e,mediaType:t})}}),n.debug("Perform init load: "+l.url)},loadSegments:function(t,i,a,o,s){p();var l=null,f=a?h.resolve(a.path):null,d=f?f.url:void 0;s=s||m,l=_({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:l,url:d,init:!1,mediaType:i}),n.debug("Parsing ebml header"),u.load({request:l,success:function(l){!function(t,i,a,o){if(t&&0!==t.byteLength){var s,l=(0,yT.default)(e).create({data:t}),f=void 0,d=void 0,c=void 0,h=a?a.split("-"):null,p=null,m={url:i,range:{start:h?parseFloat(h[0]):null,end:h?parseFloat(h[1]):null},request:p};for(n.debug("Parse EBML header: "+m.url),l.skipOverElement(r.EBML),l.consumeTag(r.Segment),c=l.getMatroskaCodedNum(),c+=l.getPos(),s=l.getPos();l.moreData()&&!l.consumeTagAndSize(r.Segment.Info,!0);)if(!(l.skipOverElement(r.Segment.SeekHead,!0)||l.skipOverElement(r.Segment.Tracks,!0)||l.skipOverElement(r.Segment.Cues,!0)||l.skipOverElement(r.Void,!0)))throw new Error("no valid top level element found");for(;void 0===f;){var E=l.getMatroskaCodedNum(!0),y=l.getMatroskaCodedNum();switch(E){case r.Segment.Info.Duration.tag:f=l[r.Segment.Info.Duration.parse](y);break;default:l.setPos(l.getPos()+y)}}p=_(m);u.load({request:p,success:function(e){d=g(e,s,c,f),o(d)},error:function(){n.error("Download Error: Cues "+m.url),o(null)}}),n.debug("Perform cues load: "+m.url+" bytes="+m.range.start+"-"+m.range.end)}else o(null)}(l,d,o,(function(e){s(t,i,e,a)}))},error:function(){s(t,i,null,a)}})},reset:function(){i=null,a=null}},r={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},t}wT.__dashjs_factory_name="WebmSegmentBaseLoader";var NT=TT.default.getSingletonFactory(wT),MT=Object.defineProperty({default:NT},"__esModule",{value:!0}),CT=PT(y),DT=PT(pT),OT=PT(MT);function PT(e){return e&&e.__esModule?e:{default:e}}function LT(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,i=e.dashMetrics,a=e.mediaPlayerModel,o=e.errHandler,s=e.baseURLController,u=e.debug,l=e.boxParser,f=e.requestModifier,d=e.errors,c=void 0,h=void 0,g=void 0;function p(e){return"webm"===(e?e.split("/")[1]:"").toLowerCase()}function m(e){p(e.mimeType)?g.loadInitialization(e.streamId,e.mediaType,e.representation):h.loadInitialization(e.streamId,e.mediaType,e.representation)}function _(e){p(e.mimeType)?g.loadSegments(e.streamId,e.mediaType,e.representation,e.representation?e.representation.indexRange:null,e.callback):h.loadSegments(e.streamId,e.mediaType,e.representation,e.representation?e.representation.indexRange:null,e.callback)}return c={initialize:function(){n.on(r.SEGMENTBASE_INIT_REQUEST_NEEDED,m,c),n.on(r.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,_,c),h.initialize(),g.initialize()},reset:function(){n.off(r.SEGMENTBASE_INIT_REQUEST_NEEDED,m,c),n.off(r.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,_,c)}},h=(0,DT.default)(t).getInstance(),g=(0,OT.default)(t).getInstance(),h.setConfig({baseURLController:s,dashMetrics:i,mediaPlayerModel:a,errHandler:o,eventBus:n,events:r,errors:d,debug:u,boxParser:l,requestModifier:f}),g.setConfig({baseURLController:s,dashMetrics:i,mediaPlayerModel:a,errHandler:o,eventBus:n,events:r,errors:d,debug:u,requestModifier:f}),c}LT.__dashjs_factory_name="SegmentBaseController";var FT=CT.default.getSingletonFactory(LT),xT=Object.defineProperty({default:FT},"__esModule",{value:!0});var UT=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.quality=null,this.DVRWindow=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null},BT=Object.defineProperty({default:UT},"__esModule",{value:!0});var kT=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.lang=null,this.viewpoint=null,this.accessibility=null,this.audioChannelConfiguration=null,this.roles=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.isText=!1,this.KID=null,this.bitrateList=null},GT=Object.defineProperty({default:kT},"__esModule",{value:!0});var jT=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0},YT=Object.defineProperty({default:jT},"__esModule",{value:!0});var qT=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.DVRWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null},HT=Object.defineProperty({default:qT},"__esModule",{value:!0}),KT=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var VT=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.valid="/"==t[0],this.path=t.split("/").filter((function(e){return 0!==e.length})).map((function(e){var t={name:e},r=e.indexOf("[");if(-1!=r){t.name=e.substring(0,r);var i=e.substring(r+1,e.length-1);n.valid=n.valid&&-1==i.indexOf("[");var a=i.indexOf("=");-1!=a?(t.attribute={name:i.substring(1,a),value:i.substring(a+1)},-1!=["'",'"'].indexOf(t.attribute.value[0])&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(i,10)-1}return t}))}return KT(e,[{key:"isValid",value:function(){return this.valid}},{key:"findsElement",value:function(){return!this.findsAttribute()}},{key:"findsAttribute",value:function(){return this.path[this.path.length-1].name.startsWith("@")}},{key:"getMpdTarget",value:function(e,t){for(var n=null,r=e,i=1,a="MPD";i<this.path.length&&null!==r;){n=r;var o=this.path[i];if(a=o.name,i!==this.path.length-1||!a.startsWith("@")){var s=n[a+"_asArray"]||[];0===s.length&&n[a]&&s.push(n[a]),o.position?r=s[o.position]||null:o.attribute?function(){var e=o.attribute;r=s.filter((function(t){return t[e.name]==e.value}))[0]||null}():r=s[0]||null}i++}return null===r?null:a.startsWith("@")?{name:a.substring(1),leaf:r,target:r}:{name:a,leaf:r,target:t?n:r}}}]),e}(),zT=Object.defineProperty({default:VT},"__esModule",{value:!0}),WT=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var XT=function(){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.action=t,this.xpath=n,this.value=r,this.position=null}return WT(e,[{key:"getMpdTarget",value:function(e){var t="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(e,t)}}]),e}(),QT=Object.defineProperty({default:XT},"__esModule",{value:!0}),ZT=nA(g),$T=nA(y),JT=nA(Q),eA=nA(zT),tA=nA(QT);function nA(e){return e&&e.__esModule?e:{default:e}}function rA(){var e=void 0,t=void 0,n=this.context;return e={getIsPatch:function(e){return e&&e.hasOwnProperty(ZT.default.ORIGINAL_MPD_ID)||!1},getPublishTime:function(e){return e&&e.hasOwnProperty(ZT.default.PUBLISH_TIME)?new Date(e[ZT.default.PUBLISH_TIME]):null},getOriginalPublishTime:function(e){return e&&e.hasOwnProperty(ZT.default.ORIGINAL_PUBLISH_TIME)?new Date(e[ZT.default.ORIGINAL_PUBLISH_TIME]):null},getMpdId:function(e){return e&&e[ZT.default.ORIGINAL_MPD_ID]||null},getPatchOperations:function(e){return e?(e.__children||[]).map((function(e){var n=Object.keys(e)[0];if("add"!==n&&"remove"!==n&&"replace"!==n)return t.warn("Ignoring node of invalid action: "+n),null;var r=e[n],i=r.sel;if("add"===n&&r.type){if(!r.type.startsWith("@"))return t.warn("Ignoring add action for prefixed namespace declaration: "+r.type+"="+r.__text),null;i=i+"/"+r.type}var a=new eA.default(i);if(!a.isValid())return t.warn("Ignoring action with invalid selector: "+n+" - "+i),null;var o=null;a.findsAttribute()?o=r.__text||"":"remove"!==n&&(o=r.__children.reduce((function(e,t){var n=Object.keys(t)[0];return"#text"!==n&&(e[n]=e[n]||[],e[n].push(t[n])),e}),{}));var s=new tA.default(n,a,o);return"add"===n&&(s.position=r.pos),s})).filter((function(e){return!!e})):[]}},t=(0,JT.default)(n).getInstance().getLogger(e),e}rA.__dashjs_factory_name="PatchManifestModel";var iA=$T.default.getSingletonFactory(rA),aA=Object.defineProperty({default:iA},"__esModule",{value:!0}),oA=pA(g),sA=pA(BT),uA=pA(GT),lA=pA(YT),fA=pA(HT),dA=pA(lh),cA=pA(y),hA=pA(Vh),gA=pA(aA);function pA(e){return e&&e.__esModule?e:{default:e}}function mA(){var e,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=this.context;function l(e,n,i){var o,s=t.getAdaptationsForType(r[0].mpd.manifest,e,n);if(!s||0===s.length)return null;if(s.length>1&&i){var u=d(i,n);if(a[i.id]&&a[i.id][n])for(var l=0,c=s.length;l<c;l++)if(f(a[i.id][n],u[l]))return s[l];for(var h=0,g=s.length;h<g;h++)if(o=s[h],t.getRolesForAdaptation(o).filter((function(e){return e.value===oA.default.MAIN}))[0])return s[h]}return s[0]}function f(e,t){if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=e.lang===t.lang,a=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),s=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&r&&i&&a&&o&&s}function d(e,n,a){var s,u=r,l=a,f=[],d=void 0,h=void 0,g=void 0,p=void 0,m=void 0,v=void 0;if(l)T(),u=c(l);else{if(!(r.length>0))return f;l=r[0].mpd.manifest}var A=_(e,u);A&&(v=A.id);var S=t.getAdaptationsForType(l,e?e.index:null,n!==o.EMBEDDED_TEXT?n:o.VIDEO);if(!S||0===S.length)return f;for(i[v]=i[v]||t.getAdaptationsForPeriod(A),p=0,s=S.length;p<s;p++)if(d=S[p],g=t.getIndexForAdaptation(d,l,e.index),h=E(i[v][g]),n===o.EMBEDDED_TEXT){var b=h.accessibility.length;for(m=0;m<b;m++)if(h){var I=h.accessibility[m];if(0===I.indexOf("cea-608:")){var R=I.substring(8).split(";");if("CC"===R[0].substring(0,2))for(m=0;m<R.length;m++)h||(h=E.call(this,i[v][g])),y(h,R[m].substring(0,3),R[m].substring(4)),f.push(h),h=null;else for(m=0;m<R.length;m++)h||(h=E.call(this,i[v][g])),y(h,"CC"+(m+1),R[m]),f.push(h),h=null}else 0===I.indexOf("cea-608")&&(y(h,o.CC1,"eng"),f.push(h),h=null)}}else n===o.IMAGE?(h.type=o.IMAGE,f.push(h),h=null):h&&f.push(h);return f}function c(e){var n=h(e);return t.getRegularPeriods(n)}function h(e){var n=p(e);return t.getMpd(n)}function g(){r=[],i={},a={}}function p(e){return e||(r.length>0?r[0].mpd.manifest:null)}function m(e){return e&&e.streamInfo&&void 0!==e.streamInfo.id&&i[e.streamInfo.id]?i[e.streamInfo.id][e.index]:null}function _(e,t){for(var n=t.length,r=0;r<n;r++){var i=t[r];if(e&&e.id===i.id)return i}return null}function E(e){if(!e)return null;var n,r=new uA.default,i=e.period.mpd.manifest.Period_asArray[e.period.index].AdaptationSet_asArray[e.index];return r.id=e.id,r.index=e.index,r.type=e.type,r.streamInfo=v(e.period),r.representationCount=t.getRepresentationCount(i),r.labels=t.getLabelsForAdaptation(i),r.lang=t.getLanguageForAdaptation(i),n=t.getViewpointForAdaptation(i),r.viewpoint=n?n.value:void 0,r.accessibility=t.getAccessibilityForAdaptation(i).map((function(e){var t=e.value,n=t;return e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=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.contentProtection&&r.contentProtection.forEach((function(e){e.KID=t.getKID(e)})),r.isText=t.getIsTextTrack(r.mimeType),r.supplementalProperties=t.getSupplementalPropperties(i),r}function y(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=o.EMBEDDED_TEXT,e.codec="cea-608-in-SEI",e.isText=!0,e.isEmbedded=!0,e.lang=n,e.roles=["caption"]}function v(e){var n=new lA.default;return n.id=e.id,n.index=e.index,n.start=e.start,n.duration=e.duration,n.manifestInfo=function(e){var n=new fA.default;return n.DVRWindowSize=e.timeShiftBufferDepth,n.loadedTime=e.manifest.loadedTime,n.availableFrom=e.availabilityStartTime,n.minBufferTime=e.manifest.minBufferTime,n.maxFragmentDuration=e.maxSegmentDuration,n.duration=t.getDuration(e.manifest),n.isDynamic=t.getIsDynamic(e.manifest),n.serviceDescriptions=t.getServiceDescriptions(e.manifest),n.protocol=e.manifest.protocol,n}(e.mpd),n.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(n.start+n.duration-n.manifestInfo.duration)<1,n}function T(){if(!o)throw new Error("setConfig function has to be called previously")}function A(e){return r.length>0?r[0].mpd.manifest.Period_asArray[e]:null}function S(e,t,n){var r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;if(e)for(r=e.AdaptationSet_asArray,o=0;o<r.length;o+=1)for(a=r[o].Representation_asArray,s=0;s<a.length;s+=1)if(t===(i=a[s]).id)return n?s:i;return null}return e={getBandwidthForRepresentation:function(e,t){var n;return(n=S(A(t),e))?n.bandwidth:null},getIndexForRepresentation:function(e,t){return function(e,t){var n=S(e,t,!0);return null!==n?n:-1}(A(t),e)},getMaxIndexForBufferType:function(e,n){return function(e,n){var r,i=void 0,a=void 0,o=void 0;if(!e||!n)return-1;for(r=e.AdaptationSet_asArray,o=0;o<r.length;o+=1)if(i=r[o],a=i.Representation_asArray,t.getIsTypeOf(i,n))return a.length;return-1}(A(n),e)},convertDataToRepresentationInfo:function(e){if(e){var n=new sA.default,r=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],i=t.getRepresentationFor(e.index,r);return n.id=e.id,n.quality=e.index,n.bandwidth=t.getBandwidth(i),n.DVRWindow=e.segmentAvailabilityRange,n.fragmentDuration=e.segmentDuration||(e.segments&&e.segments.length>0?e.segments[0].duration:NaN),n.MSETimeOffset=e.MSETimeOffset,n.mediaInfo=E(e.adaptation),n}return null},getDataForMedia:m,getStreamsInfo:function(e,t){var n=[],i=r;if(e&&(T(),i=c(e)),i.length>0){(!t||t>i.length)&&(t=i.length);for(var a=0;a<t;a++)n.push(v(i[a]))}return n},getMediaInfoForType:function(e,n){if(0===r.length||!e)return null;var a=_(e,r);if(!a)return null;var o=a.id;i[o]=i[o]||t.getAdaptationsForPeriod(a);var s=l(e.index,n,e);if(!s)return null;var u=t.getIndexForAdaptation(s,r[0].mpd.manifest,e.index);return E(i[o][u])},getAllMediaInfoForType:d,getAdaptationForType:l,getRealAdaptation:function(e,n){var i,a=void 0,o=_(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},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=m(e);return t.getRepresentationsForAdaptation(n)},getEventsFor:function(e,n){var i=[];if(r.length>0){var a=r[0].mpd.manifest;e instanceof lA.default?i=t.getEventsForPeriod(_(e,r)):e instanceof uA.default?i=t.getEventStreamForAdaptationSet(a,m(e)):e instanceof sA.default&&(i=t.getEventStreamForRepresentation(a,n))}return i},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=new dA.default,s=e.timescale||1,u=r.adaptation.period.start,l=t[i+"/"+a],f=isNaN(r.presentationTimeOffset)?isNaN(l.presentationTimeOffset)?0:l.presentationTimeOffset:r.presentationTimeOffset,d=e.presentation_time_delta/s,c=void 0;c=0===e.version?u+n-f+d:u-f+d;var h=e.event_duration,g=e.id,p=e.message_data;return o.eventStream=l,o.eventStream.value=a,o.eventStream.timescale=s,o.duration=h,o.id=g,o.calculatedPresentationTime=c,o.messageData=p,o.presentationTimeDelta=d,o}catch(e){return null}},getMpd:h,setConfig:function(e){e&&(e.constants&&(o=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;T(),r=c(e),i={}},getIsTextTrack:function(e){return t.getIsTextTrack(e)},getUTCTimingSources:function(){var e=p();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=p(e);return t.getIsDynamic(n)},getDuration:function(e){var n=p(e);return t.getDuration(n)},getRegularPeriods:c,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)},getVoAdaptations:function(){return i},getVoPeriods:function(){return 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){a[e]=a[e]||{},a[e][t]=a[e][t]||{},a[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()<s.getTime())},applyPatchToManifest:function(e,t){n.getPatchOperations(t).forEach((function(t){var n=t.getMpdTarget(e);if(null!==n){var r=n.name,i=n.target,a=n.leaf;if(t.xpath.findsAttribute())switch(t.action){case"add":case"replace":i[r]=t.value;break;case"remove":delete i[r]}else{var o=(i[r+"_asArray"]||[]).indexOf(a),s="prepend"===t.position||"before"===t.position;if(("remove"===t.action||"replace"===t.action)&&(delete i[r],-1!=o)){var u=i[r+"_asArray"];u.splice(o,1),u.length>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}))}}}))},reset:g},t=(0,hA.default)(u).getInstance(),n=(0,gA.default)(u).getInstance(),g(),e}mA.__dashjs_factory_name="DashAdapter";var _A=cA.default.getSingletonFactory(mA),EA=Object.defineProperty({default:_A},"__esModule",{value:!0}),yA=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var vA=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return yA(e,null,[{key:"round10",value:function(e,t){return function(e,t,n){if(void 0===n||0==+n)return Math[e](t);if(n=+n,null===(t=+t)||isNaN(t)||!("number"==typeof n&&n%1==0))return NaN;return t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))}("round",e,t)}}]),e}();var TA=Object.defineProperty({default:vA},"__esModule",{value:!0});var AA=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]},SA=Object.defineProperty({default:AA},"__esModule",{value:!0});var bA=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.mt=null,this.to=null,this.lto=null},IA=Object.defineProperty({default:bA},"__esModule",{value:!0});var RA=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.level=null},wA=Object.defineProperty({default:RA},"__esModule",{value:!0}),NA=function(e){return e&&e.__esModule?e:{default:e}}(_);var MA=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=null,this.state=NA.default.BUFFER_EMPTY},CA=Object.defineProperty({default:MA},"__esModule",{value:!0});var DA=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.range=null,this.manifestInfo=null},OA=Object.defineProperty({default:DA},"__esModule",{value:!0});var PA=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.droppedFrames=null},LA=Object.defineProperty({default:PA},"__esModule",{value:!0});function FA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var xA=function e(){FA(this,e),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]},UA=function e(){FA(this,e),this.id=null,this.index=null,this.start=null,this.duration=null},BA=function e(){FA(this,e),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null},kA=Object.defineProperty({ManifestUpdate:xA,ManifestUpdateStreamInfo:UA,ManifestUpdateRepresentationInfo:BA},"__esModule",{value:!0});var GA=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.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null},jA=Object.defineProperty({default:GA},"__esModule",{value:!0});var YA=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadingRequests=[],this.executedRequests=[]},qA=Object.defineProperty({default:YA},"__esModule",{value:!0}),HA=rS(d),KA=rS(_),VA=rS(SA),zA=rS(IA),WA=rS(wA),XA=rS(CA),QA=rS(OA),ZA=rS(LA),$A=rS(jA),JA=rS(O),eS=rS(qA),tS=rS(U),nS=rS(y);function rS(e){return e&&e.__esModule?e:{default:e}}function iS(e){var t,n=(e=e||{}).settings,r=this.context,i=(0,JA.default)(r).getInstance(),a=void 0;function o(){i.trigger(tS.default.METRICS_CHANGED)}function s(e){i.trigger(tS.default.METRIC_CHANGED,{mediaType:e}),o()}function u(e,t,n){i.trigger(tS.default.METRIC_UPDATED,{mediaType:e,metric:t,value:n}),s(e)}function l(e,t,n){i.trigger(tS.default.METRIC_ADDED,{mediaType:e,metric:t,value:n}),s(e)}function f(e,t){var n=null;return e?(a.hasOwnProperty(e)?n=a[e]:t||(n=new VA.default,a[e]=n),n):n}function d(e,t,r){var i=f(e);null!==i&&(i[t].push(r),i[t].length>n.get().streaming.metricsMaxListDepth&&i[t].shift())}function c(e,t,n){d(e,t,n),l(e,t,n)}return t={clearCurrentMetricsForType:function(e){delete a[e],s(e)},clearAllCurrentMetrics:function(){a={},o()},getMetricsFor:f,addHttpRequest:function e(t,n,r,i,a,o,s,u,l,f,d,h,g,p,m){var _=new de.HTTPRequest;o&&o!==i&&(e(t,null,r,i,a,null,null,u,l,null,null,null,g,null,null),_.actualurl=o),_.tcpid=n,_.type=r,_.url=i,_.range=u,_.trequest=l,_.tresponse=f,_.responsecode=h,_._tfinish=d,_._stream=t,_._mediaduration=g,_._quality=a,_._responseHeaders=p,_._serviceLocation=s,m?m.forEach((function(e){!function(e,t,n,r){var i=new de.HTTPRequestTrace;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),c(t,KA.default.HTTP_REQUEST,_)},addRepresentationSwitch:function(e,t,n,r,i){var a=new zA.default;a.t=t,a.mt=n,a.to=r,i?a.lto=i:delete a.lto,c(e,KA.default.TRACK_SWITCH,a)},addBufferLevel:function(e,t,n){var r=new WA.default;r.t=t,r.level=n,c(e,KA.default.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){var r=new XA.default;r.target=n,r.state=t,c(e,KA.default.BUFFER_STATE,r)},addDVRInfo:function(e,t,n,r){var i=new QA.default;i.time=t,i.range=r,i.manifestInfo=n,c(e,KA.default.DVR_INFO,i)},addDroppedFrames:function(e,t){var n=new ZA.default,r=f(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||c(e,KA.default.DROPPED_FRAMES,n))},addSchedulingInfo:function(e,t,n,r,i,a,o,s,u){var l=new $A.default;l.mediaType=e,l.t=t,l.type=n,l.startTime=r,l.availabilityStartTime=i,l.duration=a,l.quality=o,l.range=s,l.state=u,c(e,KA.default.SCHEDULING_INFO,l)},addRequestsQueue:function(e,t,n){var r=new eS.default;r.loadingRequests=t,r.executedRequests=n,f(e).RequestsQueue=r,l(e,KA.default.REQUESTS_QUEUE,r)},addManifestUpdate:function(e,t,n,r,i,a,o,s,u,f){var c=new kA.ManifestUpdate;c.mediaType=e,c.type=t,c.requestTime=n,c.fetchTime=r,c.availabilityStartTime=i,c.presentationStartTime=a,c.clientTimeOffset=o,c.currentTime=s,c.buffered=u,c.latency=f,d(HA.default.STREAM,KA.default.MANIFEST_UPDATE,c),l(e,KA.default.MANIFEST_UPDATE,c)},updateManifestUpdateInfo:function(e,t){if(e){for(var n in t)e[n]=t[n];u(e.mediaType,KA.default.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,i){if(e){var a=new kA.ManifestUpdateStreamInfo;a.id=t,a.index=n,a.start=r,a.duration=i,e.streamInfo.push(a),u(e.mediaType,KA.default.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,n,r,i,a,o,s){if(e&&e.representationInfo){var l=new kA.ManifestUpdateRepresentationInfo;l.id=t,l.index=n,l.streamIndex=r,l.mediaType=i,l.startNumber=o,l.fragmentInfoType=s,l.presentationTimeOffset=a,e.representationInfo.push(l),u(e.mediaType,KA.default.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,c(HA.default.STREAM,KA.default.PLAY_LIST,e)},addDVBErrors:function(e){c(HA.default.STREAM,KA.default.DVB_ERRORS,e)}},a={},t}iS.__dashjs_factory_name="MetricsModel";var aS=nS.default.getSingletonFactory(iS),oS=Object.defineProperty({default:aS},"__esModule",{value:!0}),sS=hS(d),uS=hS(y),lS=hS(_),fS=hS(TA),dS=hS(oS),cS=hS(Mc);function hS(e){return e&&e.__esModule?e:{default:e}}function gS(e){e=e||{};var t,n=this.context,r=void 0,i=void 0,a=void 0,o=e.metricsModel;function s(e){var t=o.getMetricsFor(e,!0);if(!t)return null;var n=t.HttpList,r=null,i=void 0;if(!n||n.length<=0)return null;for(i=n.length-1;i>=0;){if(n[i].responsecode){r=n[i];break}i--}return r}function u(e){var t=o.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function l(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 l(o.getMetricsFor(e,!0),lS.default.TRACK_SWITCH)},getCurrentBufferState:function(e){return l(o.getMetricsFor(e,!0),lS.default.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=l(o.getMetricsFor(e,!0),lS.default.BUFFER_LEVEL);return t?fS.default.round10(t.level/1e3,-3):0},getCurrentHttpRequest:s,getHttpRequests:u,getCurrentDroppedFrames:function(){return l(o.getMetricsFor(sS.default.VIDEO,!0),lS.default.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return l(o.getMetricsFor(e,!0),lS.default.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return l(e?o.getMetricsFor(e,!0):o.getMetricsFor(sS.default.VIDEO,!0)||o.getMetricsFor(sS.default.AUDIO,!0),lS.default.DVR_INFO)},getCurrentManifestUpdate:function(){return l(o.getMetricsFor(sS.default.STREAM),lS.default.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){var n={},r=s(e);return r&&(n=cS.default.parseHttpHeaders(r._responseHeaders)),void 0===n[t]?null:n[t]},getLatestMPDRequestHeaderValueByID:function(e){var t,n={},r=void 0,i=void 0;for(i=(t=u(sS.default.STREAM)).length-1;i>=0;i--)if((r=t[i]).type===de.HTTPRequest.MPD_TYPE){n=cS.default.parseHttpHeaders(r._responseHeaders);break}return void 0===n[e]?null:n[e]},addRepresentationSwitch:function(e,t,n,r,i){o.addRepresentationSwitch(e,t,n,r,i)},addDVRInfo:function(e,t,n,r){o.addDVRInfo(e,t,n,r)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();o.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();o.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var n=this.getCurrentManifestUpdate();o.addManifestUpdateRepresentationInfo(n,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){o.addManifestUpdate(sS.default.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,n,r,i){o.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)},addSchedulingInfo:function(e,t){o.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,n){o.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){o.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){o.addBufferState(e,t,n)},addDroppedFrames:function(e){o.addDroppedFrames(sS.default.VIDEO,e)},addPlayList:function(){a&&(o.addPlayList(a),a=null)},addDVBErrors:function(e){o.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(a=new Xd.PlayList).start=new Date,a.mstart=e,a.starttype=t},createPlaylistTraceMetrics:function(e,t,n){!0===r&&(r=!1,(i=new Xd.PlayListTrace).representationid=e,i.start=new Date,i.mstart=t,i.playbackspeed=null!==n?n.toString():null)},updatePlayListTraceMetrics:function(e){if(i)for(var t in i)i[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===r&&a&&i&&i.start){var n=i.start,o=e.getTime()-n.getTime();i.duration=o,i.stopreason=t,a.trace.push(i),r=!0}},clearAllCurrentMetrics:function(){o.clearAllCurrentMetrics()}},o=o||(0,dS.default)(n).getInstance({settings:e.settings}),r=!0,i=null,a=null,t}gS.__dashjs_factory_name="DashMetrics";var pS=uS.default.getSingletonFactory(gS),mS=Object.defineProperty({default:pS},"__esModule",{value:!0}),_S=SS(O),ES=SS(U),yS=SS(y),vS=SS(g),TS=SS(Vh),AS=SS(kc);function SS(e){return e&&e.__esModule?e:{default:e}}function bS(){var e,t=this.context,n=(0,_S.default)(t).getInstance(),r=(0,AS.default)(t).getInstance(),i=void 0,a=void 0,o=void 0,s=void 0;function u(e){a=e}function l(e,t,n,r){return r?n&&t.timeShiftBufferDepth!=Number.POSITIVE_INFINITY?new Date(t.availabilityStartTime.getTime()+1e3*(e+t.timeShiftBufferDepth)):t.availabilityEndTime:n?new Date(t.availabilityStartTime.getTime()+1e3*(e-a)):t.availabilityStartTime}function f(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*a)/1e3}function d(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function c(e){void 0!==e.offset&&(u(e.offset/1e3),o=!0)}function h(){a=0,o=!1,s=NaN}function g(){n.off(ES.default.UPDATE_TIME_SYNC_OFFSET,c,this),h()}return e={initialize:function(){h(),n.on(ES.default.UPDATE_TIME_SYNC_OFFSET,c,this)},getClientTimeOffset:function(){return a},setClientTimeOffset:u,getExpectedLiveEdge:function(){return s},setExpectedLiveEdge:function(e){s=e},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return l.call(this,e,t,n)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return l.call(this,e,t,n,!0)},calcPresentationTimeFromWallTime:f,calcPresentationTimeFromMediaTime:d,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcSegmentAvailabilityRange:function(e,t){var n=e.adaptation.period,a={start:n.start,end:n.start+n.duration};if(!t)return a;if(!o&&e.segmentAvailabilityRange)return e.segmentAvailabilityRange;var s=e.segmentDuration||(e.segments&&e.segments.length?e.segments[e.segments.length-1].duration:0);if(e.segmentInfoType===vS.default.SEGMENT_TIMELINE&&r.get().streaming.calcSegmentAvailabilityRangeFromTimeline)return function(e){var t,n=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],r=i.getRepresentationFor(e.index,n),a=r.SegmentTemplate.SegmentTimeline,o=r.SegmentTemplate.timescale,s=a.S_asArray,u={start:0,end:0},l=0,f=void 0,c=void 0,h=void 0;for(u.start=d(s[0].t/o,e),h=0,t=s.length;h<t;h++)f=s[h],c=0,f.hasOwnProperty("r")&&(c=f.r),l+=f.d/o*(1+c);return u.end=u.start+l,u}(e);var u=f(new Date,n),l=n.start+n.duration;a.start=Math.max(u-n.mpd.timeShiftBufferDepth,n.start);var c=void 0!==e.availabilityTimeOffset&&e.availabilityTimeOffset<s?s-e.availabilityTimeOffset:s;return a.end=u>=l&&u-c<l?l:u-c,a},getPeriodEnd:function(e,t){var n=e.adaptation.period;if(!t)return n.start+n.duration;if(!o&&e.segmentAvailabilityRange)return e.segmentAvailabilityRange;var r=e.segmentDuration||(e.segments&&e.segments.length?e.segments[e.segments.length-1].duration:0),i=f(new Date,n),a=n.start+n.duration,s=void 0!==e.availabilityTimeOffset&&e.availabilityTimeOffset<r?r-e.availabilityTimeOffset:r;return Math.min(i-s,a)},calcWallTimeForSegment:function(e,t){var n=void 0,r=void 0,i=void 0;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},reset:g},i=(0,TS.default)(t).getInstance(),g(),e}bS.__dashjs_factory_name="TimelineConverter";var IS=yS.default.getSingletonFactory(bS),RS=Object.defineProperty({default:IS},"__esModule",{value:!0}),wS=o((function(e,t){var n={encode:function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>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},decode:function(e){for(var t=[],n=0;n<e.length;){var r=e[n++];r<128||(r<224?(r=(31&r)<<6,r|=63&e[n++]):r<240?(r=(15&r)<<12,r|=(63&e[n++])<<6,r|=63&e[n++]):(r=(7&r)<<18,r|=(63&e[n++])<<12,r|=(63&e[n++])<<6,r|=63&e[n++])),t.push(String.fromCharCode(r))}return t.join("")}},r={};!function(e){var t=function(t){for(var n=0,r=[],i=0|t.length/3;0<i--;){var a=(t[n]<<16)+(t[n+1]<<8)+t[n+2];n+=3,r.push(e.charAt(63&a>>18)),r.push(e.charAt(63&a>>12)),r.push(e.charAt(63&a>>6)),r.push(e.charAt(63&a))}if(2==t.length-n){a=(t[n]<<16)+(t[n+1]<<8);r.push(e.charAt(63&a>>18)),r.push(e.charAt(63&a>>12)),r.push(e.charAt(63&a>>6)),r.push("=")}else if(1==t.length-n){a=t[n]<<16;r.push(e.charAt(63&a>>18)),r.push(e.charAt(63&a>>12)),r.push("==")}return r.join("")},i=function(){for(var t=[],n=0;n<e.length;++n)t[e.charCodeAt(n)]=n;return t["=".charCodeAt(0)]=0,t}(),o=function(e){for(var t=0,n=[],r=0|e.length/4;0<r--;){var a=(i[e.charCodeAt(t)]<<18)+(i[e.charCodeAt(t+1)]<<12)+(i[e.charCodeAt(t+2)]<<6)+i[e.charCodeAt(t+3)];n.push(255&a>>16),n.push(255&a>>8),n.push(255&a),t+=4}return n&&("="==e.charAt(t-2)?(n.pop(),n.pop()):"="==e.charAt(t-1)&&n.pop()),n},u={encode:function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")}};r.decodeArray=function(e){var t=o(e);return new Uint8Array(t)},r.encodeASCII=function(e){var n=u.encode(e);return t(n)},r.decodeASCII=function(e){var t=o(e);return u.decode(t)},r.encode=function(e){var r=n.encode(e);return t(r)},r.decode=function(e){var t=o(e);return n.decode(t)}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),t.decode=r.decode,t.decodeArray=r.decodeArray,t.encode=r.encode,t.encodeASCII=r.encodeASCII})),NS=pb(u),MS=pb(d),CS=pb(g),DS=pb(_),OS=pb(oe),PS=pb(Xm),LS=pb(r_),FS=pb(h_),xS=pb(rE),US=pb($y),BS=pb(av),kS=pb(cv),GS=pb(yv),jS=pb(zi),YS=pb(Pd),qS=pb(Xa),HS=pb(Rv),KS=pb(Pv),VS=pb(Yv),zS=pb(ll),WS=pb(kg),XS=pb(Qv),QS=pb(_g),ZS=pb(iT),$S=pb(Q),JS=pb(na),eb=pb(O),tb=pb(U),nb=pb(I),rb=pb(y),ib=pb(kc),ab=pb(xT),ob=pb(EA),sb=pb(mS),ub=pb(RS),lb=pb(wS),fb=pb(Fe),db=pb(be),cb=pb(tm),hb=pb(qd),gb=pb(Ve);function pb(e){return e&&e.__esModule?e:{default:e}}function mb(){var e="You must first call initialize() and set a source before calling this method",t="You must first call initialize() and set a valid source and view before calling this method",n="You must first call attachView() to set the video element before calling this method",r="You must first call attachSource() with a valid source before calling this method",i=this.context,a=(0,eb.default)(i).getInstance(),o=(0,ib.default)(i).getInstance(),s=(0,$S.default)(i).getInstance({settings:o}),u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0,T=void 0,A=void 0,S=void 0,b=void 0,I=void 0,R=void 0,w=void 0,N=void 0,M=void 0,C=void 0,D=void 0,O=void 0,P=void 0,L=void 0,F=void 0,x=void 0,U=void 0,B=void 0,k=void 0,G=void 0,j=void 0,Y=void 0,q=void 0;function H(){ie(null),te(null),d=null,v&&(v.reset(),v=null),T&&(T.reset(),T=null),G.reset(),o.reset(),S&&(S.reset(),S=null)}function K(){return!!f&&!!x.getElement()}function V(){return(0,oT.getVersionString)()}function z(){if(!g)throw t;return O.isPaused()}function W(e){var t=P.getCurrentDVRInfo();if(!t)return 0;var n=O.getLiveDelay(),r=t.range.start+e;return r>t.range.end-n&&(r=t.range.end-n),r}function X(e){if(!g)throw t;var n=ee().currentTime;if(void 0!==e)n=C.getTimeRelativeToStreamId(n,e);else if(O.getIsDynamic()){var r=P.getCurrentDVRInfo();n=null===r||0===n?0:Math.max(0,n-r.range.start)}return n}function Q(){if(!g)throw t;var e=ee().duration;if(O.getIsDynamic()){var n=P.getCurrentDVRInfo();e=n?n.range.end-n.range.start:0}return e}function Z(e){(0,Je.checkParameterType)(e,"boolean"),p=e}function $(){I.restoreDefaultUTCTimingSources()}function J(){return P}function ee(){if(!x.getElement())throw n;return x.getElement()}function te(e){if(!c)throw"MediaPlayer not initialized!";x.setElement(e),e&&(ue(),function(){if(T)return;var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(i).create();T=t.createMetricsReporting({debug:s,eventBus:a,mediaElement:ee(),adapter:b,dashMetrics:P,events:tb.default,constants:MS.default,metricsConstants:DS.default})}}(),function(){if(A)return;var e=dashjs.MssHandler;"function"==typeof e&&(JS.default.extend(e.errors),A=e(i).create({eventBus:a,mediaPlayerModel:I,dashMetrics:P,manifestModel:L,playbackController:O,streamController:C,protectionController:v,baseURLController:w,errHandler:R,events:tb.default,constants:MS.default,debug:s,initSegmentType:de.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:lb.default,ISOBoxer:fb.default,settings:o}))}(),C&&C.switchToVideoElement()),g&&oe(),ce()}function ne(t){if(!h)throw e;var n=C.getActiveStreamInfo();return y.getTracksFor(t,n)}function re(e,t){var n=-1;e.some((function(e,r){if(e===t)return n=r,!0})),n<0||e.splice(n,1)}function ie(e){if(!c)throw"MediaPlayer not initialized!";"string"==typeof e&&B.initialize(e),f=e,(h||g)&&oe(),K()&&ce()}function ae(){if(!h)throw e;var t=C.getActiveStreamInfo();return t?C.getStreamById(t.id):null}function oe(){g=!1,h=!1,b.reset(),C.reset(),D.reset(),O.reset(),m.reset(),y.reset(),U.reset(),v&&(o.get().streaming.keepProtectionMediaKeys?v.stop():(v.reset(),v=null,ue())),F.reset()}function se(){return(0,US.default)(i).create({debug:s,errHandler:R,dashMetrics:P,mediaPlayerModel:I,requestModifier:(0,YS.default)(i).getInstance(),mssHandler:A,settings:o})}function ue(){if(v)return v;var e=dashjs.Protection;if("function"==typeof e){var t=e(i).create();return tb.default.extend(e.events),nb.default.extend(e.events,{publicOnly:!0}),JS.default.extend(e.errors),N||(N=(0,kS.default)(i).getInstance()),(v=t.createProtectionSystem({debug:s,errHandler:R,videoModel:x,capabilities:N,eventBus:a,events:tb.default,BASE64:lb.default,constants:MS.default,cmcdModel:F,settings:o}))&&(v.setLicenseRequestFilters(j),v.setLicenseResponseFilters(Y)),v}return null}function le(){if(!c)throw"MediaPlayer not initialized!";if(S)return S;var e=dashjs.OfflineController;if("function"==typeof e){tb.default.extend(e.events),nb.default.extend(e.events,{publicOnly:!0}),JS.default.extend(e.errors);var t=se(),n=(0,cb.default)(i).create();return n.setConfig({manifestModel:L,adapter:b,manifestLoader:t,errHandler:R}),S=e(i).create({debug:s,manifestUpdater:n,baseURLController:w,manifestLoader:t,manifestModel:L,mediaPlayerModel:I,abrController:m,playbackController:O,adapter:b,errHandler:R,dashMetrics:P,timelineConverter:E,schemeLoaderFactory:_,eventBus:a,events:tb.default,errors:JS.default,constants:MS.default,settings:o,dashConstants:CS.default,urlUtils:(0,hb.default)(i).getInstance()})}return null}function fe(e){var t=P.getCurrentDVRInfo();return t?e+(t.manifestInfo.availableFrom.getTime()/1e3+t.range.start):0}function ce(){var e;S&&S.resetRecords(),!h&&f&&(h=!0,l.info("Streaming Initialized"),e=se(),C||(C=(0,PS.default)(i).getInstance()),M.setConfig({capabilities:N,adapter:b,settings:o}),M.setCustomCapabilitiesFilters(q),C.setConfig({capabilities:N,capabilitiesFilter:M,manifestLoader:e,manifestModel:L,mediaPlayerModel:I,protectionController:v,adapter:b,dashMetrics:P,errHandler:R,timelineConverter:E,videoModel:x,playbackController:O,abrController:m,mediaController:y,textController:U,settings:o,baseURLController:w}),D.setConfig({settings:o,playbackController:O,streamController:C,videoModel:x,timelineConverter:E,adapter:b}),O.setConfig({streamController:C,dashMetrics:P,mediaPlayerModel:I,adapter:b,videoModel:x,timelineConverter:E,uriFragmentModel:B,settings:o}),m.setConfig({streamController:C,domStorage:k,mediaPlayerModel:I,dashMetrics:P,adapter:b,videoModel:x,settings:o}),U.setConfig({errHandler:R,manifestModel:L,adapter:b,mediaController:y,streamController:C,videoModel:x}),F.setConfig({abrController:m,dashMetrics:P,playbackController:O}),C.initialize(p,d),D.initialize(),F.initialize(),"string"==typeof f?C.load(f):C.loadWithManifest(f)),!g&&K()&&(g=!0,l.info("Playback Initialized"))}return u={initialize:function(e,t,n){N||(N=(0,kS.default)(i).getInstance()),R=(0,BS.default)(i).getInstance(),N.supportsMediaSource()?c||(c=!0,E=(0,ub.default)(i).getInstance(),m||(m=(0,zS.default)(i).getInstance()).setConfig({settings:o}),_||(_=(0,WS.default)(i).getInstance()),O||(O=(0,OS.default)(i).getInstance()),y||(y=(0,FS.default)(i).getInstance()),C||(C=(0,PS.default)(i).getInstance()),D||(D=(0,LS.default)(i).getInstance()),M||(M=(0,GS.default)(i).getInstance()),b=(0,ob.default)(i).getInstance(),L=(0,KS.default)(i).getInstance(),F=(0,QS.default)(i).getInstance(),P=(0,sb.default)(i).getInstance({settings:o}),U=(0,qS.default)(i).getInstance(),k=(0,ZS.default)(i).getInstance({settings:o}),b.setConfig({constants:MS.default,cea608parser:NS.default,errHandler:R,BASE64:lb.default}),w||(w=(0,xS.default)(i).create()),w.setConfig({adapter:b}),(G=(0,ab.default)(i).getInstance({dashMetrics:P,mediaPlayerModel:I,errHandler:R,baseURLController:w,events:tb.default,eventBus:a,debug:s,boxParser:(0,gb.default)(i).getInstance(),requestModifier:(0,YS.default)(i).getInstance(),errors:JS.default})).initialize(),y.setConfig({domStorage:k,settings:o}),$(),Z(void 0===n||n),le(),e&&te(e),t&&ie(t),l.info("[dash.js "+V()+"] MediaPlayer has been initialized")):R.error(new db.default(JS.default.CAPABILITY_MEDIASOURCE_ERROR_CODE,JS.default.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(N=e.capabilities),e.capabilitiesFilter&&(M=e.capabilitiesFilter),e.streamController&&(C=e.streamController),e.gapController&&(D=e.gapController),e.playbackController&&(O=e.playbackController),e.mediaPlayerModel&&(I=e.mediaPlayerModel),e.abrController&&(m=e.abrController),e.schemeLoaderFactory&&(_=e.schemeLoaderFactory),e.mediaController&&(y=e.mediaController),e.settings&&(o=e.settings))},on:function(e,t,n,r){a.on(e,t,n,r)},off:function(e,t,n){a.off(e,t,n)},extend:function(e,t,n){rb.default.extend(e,t,n,i)},attachView:te,attachSource:ie,isReady:K,preload:function(){if(x.getElement()||h)return!1;if(!f)throw r;ce()},play:function(){if(!g)throw t;(!p||z()&&g)&&O.play()},isPaused:z,pause:function(){if(!g)throw t;O.pause()},isSeeking:function(){if(!g)throw t;return O.isSeeking()},isDynamic:function(){if(!g)throw t;return O.getIsDynamic()},seek:function(e){if(!g)throw t;if((0,Je.checkParameterType)(e,"number"),isNaN(e))throw MS.default.BAD_ARGUMENT_ERROR;var n=O.getIsDynamic()?W(e):e;O.seek(n)},setPlaybackRate:function(e){ee().playbackRate=e},getPlaybackRate:function(){return ee().playbackRate},setMute:function(e){(0,Je.checkParameterType)(e,"boolean"),ee().muted=e},isMuted:function(){return ee().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw MS.default.BAD_ARGUMENT_ERROR;ee().volume=e},getVolume:function(){return ee().volume},time:X,duration:Q,timeAsUTC:function(){if(!g)throw t;return X()<0?NaN:fe(X())},durationAsUTC:function(){if(!g)throw t;return fe(Q())},getActiveStream:ae,getDVRWindowSize:function(){var e=P.getCurrentDVRInfo();return e?e.manifestInfo.DVRWindowSize:0},getDVRSeekOffset:W,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:V,getDebug:function(){return s},getBufferLength:function(e){var t=[MS.default.VIDEO,MS.default.AUDIO,MS.default.FRAGMENTED_TEXT];if(e){if(-1!==t.indexOf(e)){var n=J().getCurrentBufferLevel(e);return n||NaN}return l.warn("getBufferLength requested for invalid type"),NaN}var r=t.map((function(e){return ne(e).length>0?J().getCurrentBufferLevel(e):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)}));return r===Number.MAX_VALUE?NaN:r},getTTMLRenderingDiv:function(){return x?x.getTTMLRenderingDiv():null},getVideoElement:ee,getSource:function(){if(!f)throw r;return f},getCurrentLiveLatency:function(){if(!c)throw"MediaPlayer not initialized!";return g?O.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(t){if(!h)throw e;return m.getTopBitrateInfoFor(t)},setAutoPlay:Z,getAutoPlay:function(){return p},getDashMetrics:J,getQualityFor:function(t){if(!h)throw e;if(t===MS.default.IMAGE){var n=ae();if(!n)return-1;var r=n.getThumbnailController();return r?r.getCurrentTrackIndex():-1}return m.getQualityFor(t)},setQualityFor:function(t,n){if(!h)throw e;if(t===MS.default.IMAGE){var r=ae();if(!r)return;var i=r.getThumbnailController();i&&i.setTrackByIndex(n)}m.setPlaybackQuality(t,C.getActiveStreamInfo(),n)},updatePortalSize:function(){m.setElementSize(),m.setWindowResizeEventCalled(!0)},setTextDefaultLanguage:function(e){l.warn('setTextDefaultLanguage is deprecated and will be removed in version 3.2.0. Please use setInitialMediaSettingsFor("fragmentedText", { lang: lang }) instead'),void 0===U&&(U=(0,qS.default)(i).getInstance()),U.setTextDefaultLanguage(e)},getTextDefaultLanguage:function(){return l.warn('getTextDefaultLanguage is deprecated and will be removed in version 3.2.0. Please use getInitialMediaSettingsFor("fragmentedText").lang instead'),void 0===U&&(U=(0,qS.default)(i).getInstance()),U.getTextDefaultLanguage()},setTextDefaultEnabled:function(e){void 0===U&&(U=(0,qS.default)(i).getInstance()),U.setTextDefaultEnabled(e)},getTextDefaultEnabled:function(){return void 0===U&&(U=(0,qS.default)(i).getInstance()),U.getTextDefaultEnabled()},enableText:function(e){void 0===U&&(U=(0,qS.default)(i).getInstance()),U.enableText(e)},enableForcedTextStreaming:function(e){void 0===U&&(U=(0,qS.default)(i).getInstance()),U.enableForcedTextStreaming(e)},isTextEnabled:function(){return void 0===U&&(U=(0,qS.default)(i).getInstance()),U.isTextEnabled()},setTextTrack:function(e){if(!g)throw t;void 0===U&&(U=(0,qS.default)(i).getInstance()),U.setTextTrack(e)},getBitrateInfoListFor:function(t){if(!h)throw e;var n=ae();return n?n.getBitrateListFor(t):[]},getStreamsFromManifest:function(t){if(!h)throw e;return b.getStreamsInfo(t)},getTracksFor:ne,getTracksForTypeFromManifest:function(t,n,r){if(!h)throw e;return(r=r||b.getStreamsInfo(n,1)[0])?b.getAllMediaInfoForType(r,t,n):[]},getCurrentTrackFor:function(t){if(!h)throw e;var n=C.getActiveStreamInfo();return y.getCurrentTrackFor(t,n)},setInitialMediaSettingsFor:function(e,t){if(!c)throw"MediaPlayer not initialized!";y.setInitialSettings(e,t),e===MS.default.FRAGMENTED_TEXT&&U.setInitialSettings(t)},getInitialMediaSettingsFor:function(e){if(!c)throw"MediaPlayer not initialized!";return y.getInitialSettings(e)},setCurrentTrack:function(t){if(!h)throw e;y.setTrack(t)},getTrackSwitchModeFor:function(e){if(!c)throw"MediaPlayer not initialized!";return y.getSwitchMode(e)},setTrackSwitchModeFor:function(e,t){if(!c)throw"MediaPlayer not initialized!";y.setSwitchMode(e,t)},setSelectionModeForInitialTrack:function(e){if(!c)throw"MediaPlayer not initialized!";y.setSelectionModeForInitialTrack(e)},getSelectionModeForInitialTrack:function(){if(!c)throw"MediaPlayer not initialized!";return y.getSelectionModeForInitialTrack()},addABRCustomRule:function(e,t,n){I.addABRCustomRule(e,t,n)},removeABRCustomRule:function(e){I.removeABRCustomRule(e)},removeAllABRCustomRule:function(){I.removeABRCustomRule()},getAverageThroughput:function(e){var t=m.getThroughputHistory();return t?t.getAverageThroughput(e):0},retrieveManifest:function(e,t){var n=se(),r=this;a.on(tb.default.INTERNAL_MANIFEST_LOADED,(function e(i){i.error?t(null,i.error):t(i.manifest),a.off(tb.default.INTERNAL_MANIFEST_LOADED,e,r),n.reset()}),r),B.initialize(e),n.load(e)},addUTCTimingSource:function(e,t){I.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){I.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){I.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:$,setXHRWithCredentialsForType:function(e,t){I.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return I.getXHRWithCredentialsForType(e)},getProtectionController:function(){return ue()},attachProtectionController:function(e){v=e},setProtectionData:function(e){d=e,C&&C.setProtectionData(d)},registerLicenseRequestFilter:function(e){j.push(e),v&&v.setLicenseRequestFilters(j)},registerLicenseResponseFilter:function(e){Y.push(e),v&&v.setLicenseResponseFilters(Y)},unregisterLicenseRequestFilter:function(e){re(j,e),v&&v.setLicenseRequestFilters(j)},unregisterLicenseResponseFilter:function(e){re(Y,e),v&&v.setLicenseResponseFilters(Y)},registerCustomCapabilitiesFilter:function(e){q.push(e),M&&M.setCustomCapabilitiesFilters(q)},unregisterCustomCapabilitiesFilter:function(e){re(q,e),M&&M.setCustomCapabilitiesFilters(q)},displayCaptionsOnTop:function(e){var t=(0,jS.default)(i).getInstance();t.setConfig({videoModel:x}),t.initialize(),t.setDisplayCConTop(e)},attachTTMLRenderingDiv:function(e){if(!x.getElement())throw n;x.setTTMLRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=NaN;return U&&(e=U.getCurrentTrackIdx()),e},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var n=O.getIsDynamic()?W(e):e,r=C.getStreamForTime(n);if(null!==r){var i=r.getThumbnailController();if(i){var a=C.getTimeRelativeToStreamId(n,r.getId());return i.provide(a,t)}t(null)}else t(null)}},getDashAdapter:function(){return b},getOfflineController:function(){return le()},getSettings:function(){return o.get()},updateSettings:function(e){o.update(e)},resetSettings:function(){o.reset()},reset:H,destroy:function(){H(),j=[],Y=[],q=[],rb.default.deleteSingletonInstances(i)}},l=s.getLogger(u),c=!1,g=!1,h=!1,p=!0,v=null,S=null,d=null,b=null,G=null,tb.default.extend(nb.default),I=(0,VS.default)(i).getInstance(),x=(0,XS.default)(i).getInstance(),B=(0,HS.default)(i).getInstance(),j=[],Y=[],q=[],u}mb.__dashjs_factory_name="MediaPlayer";var _b=rb.default.getClassFactory(mb);_b.events=nb.default,_b.errors=JS.default,rb.default.updateClassFactory(mb.__dashjs_factory_name,_b);var Eb=_b,yb=Object.defineProperty({default:Eb},"__esModule",{value:!0}),vb=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Debug=t.FactoryMaker=t.MediaPlayer=void 0;var n=o(yb),i=o(y),a=o(Q);function o(e){return e&&e.__esModule?e:{default:e}}var s="undefined"!=typeof window&&window||r,u=s.dashjs;u||(u=s.dashjs={}),u.MediaPlayer=n.default,u.FactoryMaker=i.default,u.Debug=a.default,u.Version=(0,oT.getVersionString)(),t.default=u,t.MediaPlayer=n.default,t.FactoryMaker=i.default,t.Debug=a.default}));var Tb=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};Tb.SSL_CONNECTION_FAILED_PREFIX="SSL",Tb.DNS_RESOLUTION_FAILED="C00",Tb.HOST_UNREACHABLE="C01",Tb.CONNECTION_REFUSED="C02",Tb.CONNECTION_ERROR="C03",Tb.CORRUPT_MEDIA_ISOBMFF="M00",Tb.CORRUPT_MEDIA_OTHER="M01",Tb.BASE_URL_CHANGED="F00",Tb.BECAME_REPORTER="S00";var Ab=Tb,Sb=Ib(Object.defineProperty({default:Ab},"__esModule",{value:!0})),bb=Ib(Wc);function Ib(e){return e&&e.__esModule?e:{default:e}}function Rb(e){var t=void 0,n=void 0,r=(e=e||{}).eventBus,i=e.dashMetrics,a=e.metricsConstants,o=e.events;function s(e){var t=new Sb.default;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),i.addDVBErrors(t)}}function u(e){e.error||(n=e.manifest)}function l(e){s({errorcode:Sb.default.BASE_URL_CHANGED,servicelocation:e.entry})}function f(){s({errorcode:Sb.default.BECAME_REPORTER})}function d(e){switch(e.metric){case a.HTTP_REQUEST:(0===(t=e.value).responsecode||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&s({errorcode:t.responsecode||Sb.default.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}var t}function c(e){var t=void 0;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=Sb.default.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=Sb.default.CORRUPT_MEDIA_OTHER;break;default:return}s({errorcode:t})}function h(){r.on(o.MANIFEST_UPDATED,u,t),r.on(o.SERVICE_LOCATION_BLACKLIST_CHANGED,l,t),r.on(o.METRIC_ADDED,d,t),r.on(o.METRIC_UPDATED,d,t),r.on(o.PLAYBACK_ERROR,c,t),r.on(bb.default.BECAME_REPORTING_PLAYER,f,t)}return t={initialise:h,reset:function(){r.off(o.MANIFEST_UPDATED,u,t),r.off(o.SERVICE_LOCATION_BLACKLIST_CHANGED,l,t),r.off(o.METRIC_ADDED,d,t),r.off(o.METRIC_UPDATED,d,t),r.off(o.PLAYBACK_ERROR,c,t),r.off(bb.default.BECAME_REPORTING_PLAYER,f,t)}},h(),t}Rb.__dashjs_factory_name="DVBErrorsTranslator";var wb=dashjs.FactoryMaker.getSingletonFactory(Rb),Nb=Object.defineProperty({default:wb},"__esModule",{value:!0}),Mb=function(e){return e&&e.__esModule?e:{default:e}}(rt);function Cb(e){e=e||{};var t,n=!1,r=this.context,i=void 0,a=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((function(e){var t=e.starttime,n=t+e.duration;i.add(t,n)})),n=!!e[0]._useWallClockTime)},reset:function(){i.clear()},isEnabled:function(){var e,t=i.length;if(!t)return!0;e=n?(new Date).getTime()/1e3:a.currentTime;for(var r=0;r<t;r+=1){var o=i.start(r),s=i.end(r);if(o<=e&&e<s)return!0}return!1}},i=(0,Mb.default)(r).create(),t}Cb.__dashjs_factory_name="RangeController";var Db=dashjs.FactoryMaker.getClassFactory(Cb),Ob=Object.defineProperty({default:Db},"__esModule",{value:!0});function Pb(){return{serialise:function e(t){var n=[],r=[],i=void 0,a=void 0;for(i in t)if(t.hasOwnProperty(i)&&0!==i.indexOf("_")){if(null==(a=t[i])&&(a=""),Array.isArray(a)){if(!a.length)continue;r=[],a.forEach((function(t){var n="Object"!==Object.prototype.toString.call(t).slice(8,-1);r.push(n?t:e(t))})),a=r.map(encodeURIComponent).join(",")}else"string"==typeof a?a=encodeURIComponent(a):a instanceof Date?a=a.toISOString():"number"==typeof a&&(a=Math.round(a));n.push(i+"="+a)}return n.join("&")}}}Pb.__dashjs_factory_name="MetricSerialiser";var Lb=dashjs.FactoryMaker.getSingletonFactory(Pb),Fb=Object.defineProperty({default:Lb},"__esModule",{value:!0});function xb(){var e,t=window.crypto||window.msCrypto,n=Uint32Array,r=Math.pow(2,8*n.BYTES_PER_ELEMENT)-1,i=void 0,a=void 0;function o(){t&&(i||(i=new n(10)),t.getRandomValues(i),a=0)}return e={random:function(e,n){var s=void 0;return e||(e=0),n||(n=1),t?(a===i.length&&o(),s=i[a]/r,a+=1):s=Math.random(),s*(n-e)+e}},o(),e}xb.__dashjs_factory_name="RNG";var Ub=dashjs.FactoryMaker.getSingletonFactory(xb),Bb=Object.defineProperty({default:Ub},"__esModule",{value:!0}),kb=jb(Fb),Gb=jb(Bb);function jb(e){return e&&e.__esModule?e:{default:e}}function Yb(e){e=e||{};var t,n=this.context,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,u=void 0,l=[],f=e.metricsConstants;function d(){a=!1,o=!1,s=null,u=null}return t={report:function(e,t){Array.isArray(t)||(t=[t]),o&&u.isEnabled()&&t.forEach((function(t){var n=r.serialise(t);e!==f.DVB_ERRORS&&(n="metricname="+e+"&"+n),function(e,t,n){var r=new XMLHttpRequest,i=function(){var e=l.indexOf(r);-1!==e&&(l.splice(e,1),r.status>=200&&r.status<300?t&&t():n&&n())};l.push(r);try{r.open("GET",e),r.onloadend=i,r.onerror=i,r.send()}catch(e){r.onerror()}}(n=s+"?"+n,null,(function(){o=!1}))}))},initialize:function(e,t){var n=void 0;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(){d()}},r=(0,kb.default)(n).getInstance(),i=(0,Gb.default)(n).getInstance(),d(),t}Yb.__dashjs_factory_name="DVBReporting";var qb=dashjs.FactoryMaker.getClassFactory(Yb),Hb=function(e){return e&&e.__esModule?e:{default:e}}(Object.defineProperty({default:qb},"__esModule",{value:!0}));function Kb(e){e=e||{};var t={"urn:dvb:dash:reporting:2014":Hb.default},n=this.context,r=void 0,i=e.debug?e.debug.getLogger(r):{},a=e.metricsConstants;return r={create:function(e,r){var o=void 0;try{(o=t[e.schemeIdUri](n).create({metricsConstants:a})).initialize(e,r)}catch(t){o=null,i.error("ReportingFactory: could not create Reporting with schemeIdUri "+e.schemeIdUri+" ("+t.message+")")}return o},register:function(e,n){t[e]=n},unregister:function(e){delete t[e]}}}Kb.__dashjs_factory_name="ReportingFactory";var Vb=dashjs.FactoryMaker.getSingletonFactory(Kb),zb=Object.defineProperty({default:Vb},"__esModule",{value:!0}),Wb=function(e){return e&&e.__esModule?e:{default:e}}(zb);function Xb(e){var t=[],n=(0,Wb.default)(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)}))}}}Xb.__dashjs_factory_name="ReportingController";var Qb=dashjs.FactoryMaker.getClassFactory(Xb),Zb=Object.defineProperty({default:Qb},"__esModule",{value:!0});function $b(){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}}}$b.__dashjs_factory_name="HandlerHelpers";var Jb=dashjs.FactoryMaker.getSingletonFactory($b),eI=Object.defineProperty({default:Jb},"__esModule",{value:!0}),tI=function(e){return e&&e.__esModule?e:{default:e}}(eI);function nI(e){e=e||{};var t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=this.context,s=(0,tI.default)(o).getInstance(),u=[],l=e.metricsConstants;function f(){var e=function(){try{return Object.keys(u).map((function(e){return u[e]})).reduce((function(e,t){return e.level<t.level?e:t}))}catch(e){return}}();e&&a!==e.t&&(a=e.t,t.report(r,e))}return{initialize:function(e,a,o){a&&(n=s.validateN(o),t=a,r=s.reconstructFullMetricName(e,o),i=setInterval(f,n))},reset:function(){clearInterval(i),i=null,n=0,t=null,a=null},handleNewMetric:function(e,t,n){e===l.BUFFER_LEVEL&&(u[n]=t)}}}nI.__dashjs_factory_name="BufferLevelHandler";var rI=dashjs.FactoryMaker.getClassFactory(nI),iI=Object.defineProperty({default:rI},"__esModule",{value:!0}),aI=function(e){return e&&e.__esModule?e:{default:e}}(Wc);var oI=dashjs.FactoryMaker.getClassFactory((function(e){var t=void 0,n=(e=e||{}).eventBus,r=e.metricsConstants;function i(){n.off(aI.default.METRICS_INITIALISATION_COMPLETE,i,this),n.trigger(aI.default.BECAME_REPORTING_PLAYER)}return{initialize:function(e,r){r&&(t=r,n.on(aI.default.METRICS_INITIALISATION_COMPLETE,i,this))},reset:function(){t=null},handleNewMetric:function(e,n){e===r.DVB_ERRORS&&t&&t.report(e,n)}}})),sI=Object.defineProperty({default:oI},"__esModule",{value:!0}),uI=function(e){return e&&e.__esModule?e:{default:e}}(eI);function lI(e){e=e||{};var t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=[],s=(0,uI.default)(this.context).getInstance(),u=e.metricsConstants;function l(){var e=o;e.length&&t&&t.report(i,e),o=[]}return{initialize:function(e,o,u,f){o&&(n=s.validateN(u),t=o,f&&f.length&&(r=f),i=s.reconstructFullMetricName(e,u,f),a=setInterval(l,n))},reset:function(){clearInterval(a),a=null,n=null,r=null,o=[],t=null},handleNewMetric:function(e,t){e===u.HTTP_REQUEST&&(r&&r!==t.type||o.push(t))}}}lI.__dashjs_factory_name="HttpListHandler";var fI=dashjs.FactoryMaker.getClassFactory(lI),dI=Object.defineProperty({default:fI},"__esModule",{value:!0});function cI(){var e=void 0,t=void 0;return{initialize:function(n,r){e=n,t=r},reset:function(){t=null,e=void 0},handleNewMetric:function(n,r){n===e&&t&&t.report(e,r)}}}cI.__dashjs_factory_name="GenericMetricHandler";var hI=dashjs.FactoryMaker.getClassFactory(cI),gI=Object.defineProperty({default:hI},"__esModule",{value:!0}),pI=yI(iI),mI=yI(sI),_I=yI(dI),EI=yI(gI);function yI(e){return e&&e.__esModule?e:{default:e}}function vI(e){var t=void 0,n=(e=e||{}).debug?e.debug.getLogger(t):{},r=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,i=this.context,a={BufferLevel:pI.default,DVBErrors:mI.default,HttpList:_I.default,PlayList:EI.default,RepSwitchList:EI.default,TcpList:EI.default};return t={create:function(t,o){var s,u=t.match(r);if(u){try{(s=a[u[1]](i).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(u[1],o,u[3],u[5])}catch(e){s=null,n.error("MetricsHandlerFactory: Could not create handler for type "+u[1]+" with args "+u[3]+", "+u[5]+" ("+e.message+")")}return s}},register:function(e,t){a[e]=t},unregister:function(e){delete a[e]}}}vI.__dashjs_factory_name="MetricsHandlerFactory";var TI=dashjs.FactoryMaker.getSingletonFactory(vI),AI=Object.defineProperty({default:TI},"__esModule",{value:!0}),SI=function(e){return e&&e.__esModule?e:{default:e}}(AI);function bI(e){e=e||{};var t=[],n=void 0,r=this.context,i=e.eventBus,a=e.events,o=(0,SI.default)(r).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});function s(e){t.forEach((function(t){t.handleNewMetric(e.metric,e.value,e.mediaType)}))}return n={initialize:function(e,r){e.split(",").forEach((function(e,n,i){var a;if(-1!==e.indexOf("(")&&-1===e.indexOf(")")){var s=i[n+1];s&&-1===s.indexOf("(")&&-1!==s.indexOf(")")&&(e+=","+s,delete i[n+1])}(a=o.create(e,r))&&t.push(a)})),i.on(a.METRIC_ADDED,s,n),i.on(a.METRIC_UPDATED,s,n)},reset:function(){i.off(a.METRIC_ADDED,s,n),i.off(a.METRIC_UPDATED,s,n),t.forEach((function(e){return e.reset()})),t=[]}}}bI.__dashjs_factory_name="MetricsHandlersController";var II=dashjs.FactoryMaker.getClassFactory(bI),RI=Object.defineProperty({default:II},"__esModule",{value:!0}),wI=CI(Ob),NI=CI(Zb),MI=CI(RI);function CI(e){return e&&e.__esModule?e:{default:e}}function DI(e){e=e||{};var t=void 0,n=void 0,r=void 0,i=this.context;function a(){t&&t.reset(),n&&n.reset(),r&&r.reset()}return{initialize:function(o){try{(r=(0,wI.default)(i).create({mediaElement:e.mediaElement})).initialize(o.Range),(n=(0,NI.default)(i).create({debug:e.debug,metricsConstants:e.metricsConstants})).initialize(o.Reporting,r),(t=(0,MI.default)(i).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events})).initialize(o.metrics,n)}catch(e){throw a(),e}},reset:a}}DI.__dashjs_factory_name="MetricsController";var OI=dashjs.FactoryMaker.getClassFactory(DI),PI=Object.defineProperty({default:OI},"__esModule",{value:!0});var LI=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metrics="",this.Range=[],this.Reporting=[]},FI=Object.defineProperty({default:LI},"__esModule",{value:!0});var xI=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.starttime=0,this.duration=1/0,this._useWallClockTime=!1},UI=Object.defineProperty({default:xI},"__esModule",{value:!0});var BI=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="",this.dvb_reportingUrl="",this.dvb_probability=1e3},kI=Object.defineProperty({default:BI},"__esModule",{value:!0}),GI=qI(FI),jI=qI(UI),YI=qI(kI);function qI(e){return e&&e.__esModule?e:{default:e}}function HI(e){var t=(e=e||{}).adapter,n=e.constants;return{getMetrics:function(e){var r=[];return e&&e.Metrics_asArray&&e.Metrics_asArray.forEach((function(i){var a=new GI.default,o=t.getIsDynamic(e);i.hasOwnProperty("metrics")&&(a.metrics=i.metrics,i.Range_asArray&&i.Range_asArray.forEach((function(r){var i=new jI.default;i.starttime=function(e,r,i){var a=void 0,o=void 0,s=0;return r?s=t.getAvailabilityStartTime(e)/1e3:(a=t.getRegularPeriods(e)).length&&(s=a[0].start),o=s,i&&i.hasOwnProperty(n.START_TIME)&&(o+=i.starttime),o}(e,o,r),r.hasOwnProperty("duration")?i.duration=r.duration:i.duration=t.getDuration(e),i._useWallClockTime=o,a.Range.push(i)})),i.Reporting_asArray&&(i.Reporting_asArray.forEach((function(e){var t=new YI.default;e.hasOwnProperty(n.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty("value")&&(t.value=e.value),e.hasOwnProperty(n.DVB_REPORTING_URL)&&(t.dvb_reportingUrl=e[n.DVB_REPORTING_URL]),e.hasOwnProperty(n.DVB_PROBABILITY)&&(t.dvb_probability=e[n.DVB_PROBABILITY]),a.Reporting.push(t))})),r.push(a)))})),r}}}HI.__dashjs_factory_name="ManifestParsing";var KI=dashjs.FactoryMaker.getSingletonFactory(HI),VI=Object.defineProperty({default:KI},"__esModule",{value:!0}),zI=QI(PI),WI=QI(VI),XI=QI(Wc);function QI(e){return e&&e.__esModule?e:{default:e}}function ZI(e){e=e||{};var t=void 0,n={},r=this.context,i=e.eventBus,a=e.events;function o(t){if(!t.error){var a=Object.keys(n);(0,WI.default)(r).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach((function(t){var i=JSON.stringify(t);if(n.hasOwnProperty(i))a.splice(i,1);else try{var o=(0,zI.default)(r).create(e);o.initialize(t),n[i]=o}catch(e){}})),a.forEach((function(e){n[e].reset(),delete n[e]})),i.trigger(XI.default.METRICS_INITIALISATION_COMPLETE)}}function s(){Object.keys(n).forEach((function(e){n[e].reset()})),n={}}return t={reset:function(){i.off(a.MANIFEST_UPDATED,o,t),i.off(a.STREAM_TEARDOWN_COMPLETE,s,t)}},i.on(a.MANIFEST_UPDATED,o,t),i.on(a.STREAM_TEARDOWN_COMPLETE,s,t),t}ZI.__dashjs_factory_name="MetricsCollectionController";var $I=dashjs.FactoryMaker.getClassFactory(ZI),JI=Object.defineProperty({default:$I},"__esModule",{value:!0}),eR=aR(Nb),tR=aR(Wc),nR=aR(JI),rR=aR(AI),iR=aR(zb);function aR(e){return e&&e.__esModule?e:{default:e}}function oR(){var e=this.context;return{createMetricsReporting:function(t){return(0,eR.default)(e).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}),(0,nR.default)(e).create(t)},getReportingFactory:function(){return(0,iR.default)(e).getInstance()},getMetricsHandlerFactory:function(){return(0,rR.default)(e).getInstance()}}}oR.__dashjs_factory_name="MetricsReporting";var sR=dashjs.FactoryMaker.getClassFactory(oR);sR.events=tR.default,dashjs.FactoryMaker.updateClassFactory(oR.__dashjs_factory_name,sR);var uR=sR,lR=Object.defineProperty({default:uR},"__esModule",{value:!0}),fR=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var dR=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return fR(e,null,[{key:"findCencContentProtection",value:function(e){for(var t=null,n=0;n<e.length;++n){var r=e[n];"urn:mpeg:dash:mp4protection:2011"!==r.schemeIdUri.toLowerCase()||"cenc"!==r.value.toLowerCase()&&"cbcs"!==r.value.toLowerCase()||(t=r)}return t}},{key:"getPSSHData",value:function(e){var t=8,n=new DataView(e),r=n.getUint8(t);return t+=20,r>0&&(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,o=o.toLowerCase(),t.getUint32(r),r+=4,n[o]=t.buffer.slice(s,i),r=i}else r=i;else r=i}return n}}]),e}(),cR=Object.defineProperty({default:dR},"__esModule",{value:!0});var hR=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=n},gR=Object.defineProperty({default:hR},"__esModule",{value:!0});var pR=function e(t,n,r,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),n&&n.length&&(this.videoCapabilities=n),this.distinctiveIdentifier=r,this.persistentState=i,this.sessionTypes=a},mR=Object.defineProperty({default:pR},"__esModule",{value:!0});var _R=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.MEDIA_KEYERR_CODE=100,e.MEDIA_KEYERR_UNKNOWN_CODE=101,e.MEDIA_KEYERR_CLIENT_CODE=102,e.MEDIA_KEYERR_SERVICE_CODE=103,e.MEDIA_KEYERR_OUTPUT_CODE=104,e.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,e.MEDIA_KEYERR_DOMAIN_CODE=106,e.MEDIA_KEY_MESSAGE_ERROR_CODE=107,e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,e.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,e.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,e.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,e.KEY_SESSION_CREATED_ERROR_CODE=113,e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,e.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",e.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",e.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",e.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",e.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",e.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",e.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",e.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",e.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",e.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",e.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(ea).default)),ER=Object.defineProperty({default:_R},"__esModule",{value:!0});var yR=function e(t,n,r,i,a,o,s,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.method=n,this.responseType=r,this.headers=i,this.withCredentials=a,this.messageType=o,this.sessionId=s,this.data=u},vR=Object.defineProperty({default:yR},"__esModule",{value:!0});var TR=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.url=t,this.headers=n,this.data=r},AR=Object.defineProperty({default:TR},"__esModule",{value:!0}),SR="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},bR=PR(cR),IR=PR(gR),RR=PR(mR),wR=PR(ER),NR=PR(be),MR=PR(vR),CR=PR(AR),DR=PR(Mc),OR=PR(d);function PR(e){return e&&e.__esModule?e:{default:e}}function LR(e){var t=(e=e||{}).protectionKeyController,n=e.protectionModel,r=e.eventBus,i=e.events,a=e.debug,o=e.BASE64,s=e.constants,u=[],l=e.cmcdModel,f=e.settings,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0,m=void 0,_=void 0,E=void 0,y=void 0,v=void 0;function T(){if(!(r&&r.hasOwnProperty("on")&&t&&t.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function A(e,t){var a=bR.default.getPSSHForKeySystem(E,e),o=R(E);if(a){if(S(a))return;try{n.createKeySession(a,o,N(E),t)}catch(e){r.trigger(i.KEY_SESSION_CREATED,{data:null,error:new NR.default(wR.default.KEY_SESSION_CREATED_ERROR_CODE,wR.default.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e?n.createKeySession(e,o,N(E),t):r.trigger(i.KEY_SESSION_CREATED,{data:null,error:new NR.default(wR.default.KEY_SESSION_CREATED_ERROR_CODE,wR.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(E?E.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function S(e){if(!e)return!1;try{for(var r=n.getAllInitData(),i=0;i<r.length;i++)if(t.initDataEquals(e,r[i]))return c.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch(e){return!1}}function b(e,t){T(),n.loadKeySession(e,t,N(E))}function I(e){T(),e?(n.setMediaElement(e),r.on(i.NEED_KEY,P,this)):null===e&&(n.setMediaElement(e),r.off(i.NEED_KEY,P,this))}function R(e){var t=null;if(e){var n=e.systemString;p&&(t=n in p?p[n]:null)}return t}function w(e){var t=R(e),n=[],r=[],i=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:_,a=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:_,o=N(e),u=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",l=t&&t.persistentState?t.persistentState:"temporary"===o?"optional":"required";return g.forEach((function(e){e.type===s.AUDIO?n.push(new IR.default(e.codec,i)):e.type===s.VIDEO&&r.push(new IR.default(e.codec,a))})),new RR.default(n,r,u,l,[o])}function N(e){var t=R(e);return t&&t.sessionType?t.sessionType:m}function M(e,a){e=e.sort((function(t,n){return(p&&p[t.ks.systemString]&&p[t.ks.systemString].priority>=0?p[t.ks.systemString].priority:e.length)-(p&&p[n.ks.systemString]&&p[n.ks.systemString].priority>=0?p[n.ks.systemString].priority:e.length)})),void 0===E?function(e,a){var s=this,u=[],l=void 0;E=null,h.push(e);for(var f=0;f<e.length;f++)u.push({ks:e[f].ks,configs:[w(e[f].ks)]});var d=void 0,g=function e(t){r.off(i.KEY_SYSTEM_ACCESS_COMPLETE,e,s),t.error?(E=void 0,r.off(i.INTERNAL_KEY_SYSTEM_SELECTED,p,s),a||r.trigger(i.KEY_SYSTEM_SELECTED,{data:null,error:new NR.default(wR.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,wR.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+t.error)})):(d=t.data,c.info("DRM: KeySystem Access Granted ("+d.keySystem.systemString+")! Selecting key system..."),n.selectKeySystem(d))},p=function e(u){if(r.off(i.INTERNAL_KEY_SYSTEM_SELECTED,e,s),r.off(i.KEY_SYSTEM_ACCESS_COMPLETE,g,s),u.error)E=void 0,a||r.trigger(i.KEY_SYSTEM_SELECTED,{data:null,error:new NR.default(wR.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,wR.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+u.error)});else{if(!n)return;E=n.getKeySystem(),r.trigger(i.KEY_SYSTEM_SELECTED,{data:d});var f=R(E);f&&f.serverCertificate&&f.serverCertificate.length>0&&n.setServerCertificate(o.decodeArray(f.serverCertificate).buffer);for(var c=0;c<h.length;c++)for(l=0;l<h[c].length;l++)if(E===h[c][l].ks){if(t.isClearKey(E)&&f&&f.hasOwnProperty("clearkeys")){var p={kids:Object.keys(f.clearkeys)};h[c][l].initData=(new TextEncoder).encode(JSON.stringify(p))}h[c][l].sessionId?b(h[c][l].sessionId,h[c][l].initData):null!==h[c][l].initData&&A(h[c][l].initData,h[c][l].cdmData);break}}};r.on(i.INTERNAL_KEY_SYSTEM_SELECTED,p,s),r.on(i.KEY_SYSTEM_ACCESS_COMPLETE,g,s),n.requestKeySystemAccess(u)}(e,a):E?function(e,a){var o=this,s=[],u=e.findIndex((function(e){return e.ks===E}));if(-1===u||!e[u].initData)return;if(S(bR.default.getPSSHForKeySystem(E,e[u].initData)))return;s.push({ks:e[u].ks,configs:[w(E)]});r.on(i.KEY_SYSTEM_ACCESS_COMPLETE,(function n(s){if(r.off(i.KEY_SYSTEM_ACCESS_COMPLETE,n,o),s.error)a||r.trigger(i.KEY_SYSTEM_SELECTED,{error:new NR.default(wR.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,wR.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+s.error)});else{c.info("DRM: KeySystem Access Granted"),r.trigger(i.KEY_SYSTEM_SELECTED,{data:s.data});var l=R(E);if(t.isClearKey(E)&&l&&l.hasOwnProperty("clearkeys")){var f={kids:Object.keys(l.clearkeys)};e[u].initData=(new TextEncoder).encode(JSON.stringify(f))}e[u].sessionId?b(e[u].sessionId,e[u].initData):e[u].initData&&A(e[u].initData,e[u].cdmData)}}),o),n.requestKeySystemAccess(s)}(e,a):h.push(e)}function C(e,t){r.trigger(i.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function D(e){e.error?r.trigger(i.KEY_STATUSES_CHANGED,{data:null,error:e.error}):c.debug("DRM: key status = "+e.status)}function O(e){c.debug("DRM: onKeyMessage");var a=e.data;r.trigger(i.KEY_MESSAGE,{data:a});var o=a.messageType?a.messageType:"license-request",s=a.message,u=a.sessionToken,d=R(E),h=E?E.systemString:null,p=t.getLicenseServer(E,d,o),m={sessionToken:u,messageType:o};if(s&&0!==s.byteLength){if(!p)return c.debug("DRM: License server request not required for this message (type = "+e.data.messageType+"). Session ID = "+u.getSessionID()),void C(m);if(t.isClearKey(E)){var _=t.processClearKeyLicenseRequest(E,d,s);if(_)return c.debug("DRM: ClearKey license request handled by application!"),C(m),void n.updateKeySession(u,_)}var T=null;if(d&&d.serverURL){var A=d.serverURL;"string"==typeof A&&""!==A?T=A:"object"===(void 0===A?"undefined":SR(A))&&A.hasOwnProperty(o)&&(T=A[o])}else if(d&&d.laURL&&""!==d.laURL)T=d.laURL;else if(t.isClearKey(E))T=E.getLicenseServerUrlFromMediaInfo(g);else{var S=bR.default.getPSSHData(u.initData);(T=E.getLicenseServerURLFromInitData(S))||(T=e.data.laURL)}if(T=p.getServerURLFromMessage(T,s,o)){var b={},I=!1,w=function(e){if(e)for(var t in e)"authorization"===t.toLowerCase()&&(I=!0),b[t]=e[t]};d&&w(d.httpRequestHeaders),w(E.getRequestHeadersFromMessage(s)),d&&"boolean"==typeof d.withCredentials&&(I=d.withCredentials);var N=function(e,t,n,r){var i=e.response?p.getErrorResponse(e.response,n,r):"NONE";C(t,new NR.default(wR.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,wR.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+". Response is "+i))},M=function(e){if(n)if(200===e.status){var t=new CR.default(e.responseURL,DR.default.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),e.response);L(v,t).then((function(){var r=p.getLicenseMessage(t.data,h,o);null!==r?(C(m),n.updateKeySession(u,r)):N(e,m,h,o)}))}else N(e,m,h,o)},D=function(e){C(m,new NR.default(wR.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,wR.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+h+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},O=function(e){C(m,new NR.default(wR.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,wR.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+h+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},P=E.getLicenseRequestFromMessage(s),F=p.getHTTPMethod(o),x=p.getResponseType(h,o),U=d&&!isNaN(d.httpTimeout)?d.httpTimeout:8e3,B=u.getSessionID()||null,k=new MR.default(T,F,x,b,I,o,B,P);L(y,k).then((function(){!function e(t,n,a,o,s,u){var d=new XMLHttpRequest;if(f.get().streaming.cmcd&&f.get().streaming.cmcd.enabled){if(f.get().streaming.cmcd.mode===OR.default.CMCD_MODE_QUERY){var h=l.getQueryParameter({url:t.url,type:de.HTTPRequest.LICENSE});h&&(t.url=DR.default.addAditionalQueryParameterToUrl(t.url,[h]))}}d.open(t.method,t.url,!0),d.responseType=t.responseType,d.withCredentials=t.withCredentials,a>0&&(d.timeout=a);for(var g in t.headers)d.setRequestHeader(g,t.headers[g]);if(f.get().streaming.cmcd&&f.get().streaming.cmcd.enabled){if(f.get().streaming.cmcd.mode===OR.default.CMCD_MODE_HEADER){var p=l.getHeaderParameters({url:t.url,type:de.HTTPRequest.LICENSE});if(p)for(var m in p){var _=p[m];_&&d.setRequestHeader(m,_)}}}var E=function(){n--,setTimeout((function(){e(t,n,a,o,s,u)}),1e3)};d.onload=function(){200===this.status||n<=0?o(this):(c.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+n),E())},d.ontimeout=d.onerror=function(){n<=0?u(this):(c.warn("License request network request failed . Retrying it... Pending retries: "+n),E())},d.onabort=function(){s(this)},r.trigger(i.LICENSE_REQUEST_SENDING,{url:t.url,headers:t.headers,payload:t.data,sessionId:t.sessionId}),d.send(t.data)}(k,3,U,M,D,O)}))}else C(m,new NR.default(wR.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,wR.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}else C(m,new NR.default(wR.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,wR.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function P(e,n){if(c.debug("DRM: onNeedKey"),"cenc"===e.key.initDataType)if(0===g.length&&(c.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(n=void 0===n?1:n+1)<5))u.push(setTimeout((function(){P(e,n)}),500));else{var r=e.key.initData;if(ArrayBuffer.isView(r)&&(r=r.buffer),E){var i=bR.default.getPSSHForKeySystem(E,r);if(i&&S(i))return}c.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(r)));var a=t.getSupportedKeySystems(r,p);0!==a.length?M(a,!1):c.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!")}else c.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+e.key.initDataType)}function L(e,t){return e?e.reduce((function(e,n){return e.then((function(){return n(t)}))}),Promise.resolve()):Promise.resolve()}return d={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");T(),r.on(i.INTERNAL_KEY_MESSAGE,O,this),r.on(i.INTERNAL_KEY_STATUS_CHANGED,D,this),g.push(e);var n=t.getSupportedKeySystemsFromContentProtection(e.contentProtection);n&&n.length>0&&M(n,!0)},clearMediaInfoArrayByStreamId:function(e){g=g.filter((function(t){return t.streamInfo.id!==e}))},createKeySession:A,loadKeySession:b,removeKeySession:function(e){T(),n.removeKeySession(e)},closeKeySession:function(e){T(),n.closeKeySession(e)},setServerCertificate:function(e){T(),n.setServerCertificate(e)},setMediaElement:I,setSessionType:function(e){m=e},setRobustnessLevel:function(e){_=e},setProtectionData:function(e){p=e,t.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return T(),t.getSupportedKeySystemsFromContentProtection(e)},getKeySystems:function(){return t?t.getKeySystems():[]},setKeySystems:function(e){t&&t.setKeySystems(e)},setLicenseRequestFilters:function(e){y=e},setLicenseResponseFilters:function(e){v=e},stop:function(){n&&n.stop()},reset:function(){T(),y=[],v=[],r.off(i.INTERNAL_KEY_MESSAGE,O,this),r.off(i.INTERNAL_KEY_STATUS_CHANGED,D,this),I(null),E=void 0,n&&(n.reset(),n=null),u.forEach((function(e){return clearTimeout(e)})),u=[],g=[]}},c=a.getLogger(d),h=[],g=[],m="temporary",_="",y=[],v=[],d}LR.__dashjs_factory_name="ProtectionController";var FR=dashjs.FactoryMaker.getClassFactory(LR),xR=Object.defineProperty({default:FR},"__esModule",{value:!0});var UR=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},BR=Object.defineProperty({default:UR},"__esModule",{value:!0}),kR=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var GR=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n&&"persistent"!==n&&"temporary"!==n)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=n}return kR(e,[{key:"toJWK",value:function(){var e=void 0,t=this.keyPairs.length,n={keys:[]};for(e=0;e<t;e++){var r={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};n.keys.push(r)}this.type&&(n.type=this.type);var i=JSON.stringify(n),a=i.length,o=new ArrayBuffer(a),s=new Uint8Array(o);for(e=0;e<a;e++)s[e]=i.charCodeAt(e);return o}}]),e}(),jR=Object.defineProperty({default:GR},"__esModule",{value:!0}),YR=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var qR=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()}return YR(e,[{key:"init",value:function(){this.CLEARKEY_KEYSTEM_STRING="org.w3.clearkey",this.WIDEVINE_KEYSTEM_STRING="com.widevine.alpha",this.PLAYREADY_KEYSTEM_STRING="com.microsoft.playready"}}]),e}()),HR=Object.defineProperty({default:qR},"__esModule",{value:!0}),KR=XR(BR),VR=XR(jR),zR=XR(cR),WR=XR(HR);function XR(e){return e&&e.__esModule?e:{default:e}}var QR="e2719d58-a985-b3c9-781a-b030af78d30e",ZR=WR.default.CLEARKEY_KEYSTEM_STRING,$R="urn:uuid:"+QR;function JR(e){var t=(e=e||{}).BASE64,n={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]};return{uuid:QR,schemeIdURI:$R,systemString:ZR,getInitData:function(e,n){try{var r=zR.default.parseInitDataFromContentProtection(e,t);if(!r&&n){var i={kids:[function(e){try{var t=e.replace(/-/g,"");return(t=btoa(t.match(/\w{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))).replace(/=/g,"")}catch(e){return null}}(n["cenc:default_KID"])]};r=(new TextEncoder).encode(JSON.stringify(i))}return r}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e)))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(){return null},getLicenseServerUrlFromMediaInfo:function(e){try{if(!e||0===e.length)return null;for(var t=0,r=null;t<e.length&&!r;){var i=e[t];if(i&&i.contentProtection&&i.contentProtection.length>0){var a=i.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===$R}));if(a&&a.length>0)for(var o=0;o<a.length&&!r;){for(var s=a[o],u=0;u<n.attributes.length&&!r;){for(var l=0,f=n.attributes[u];l<n.prefixes.length&&!r;){var d=n.prefixes[l];s[f]&&s[f].__prefix&&s[f].__prefix===d&&s[f].__text&&(r=s[f].__text),l+=1}u+=1}o+=1}}t+=1}return r}catch(e){return null}},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var r=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),i=[],a=0;a<r.kids.length;a++){var o=r.kids[a],s=e.clearkeys&&e.clearkeys.hasOwnProperty(o)?e.clearkeys[o]:null;if(!s)throw new Error("DRM: ClearKey keyID ("+o+") is not known!");i.push(new KR.default(o,s))}n=new VR.default(i)}return n}}}JR.__dashjs_factory_name="KeySystemClearKey";var ew=dashjs.FactoryMaker.getSingletonFactory(JR),tw=Object.defineProperty({default:ew},"__esModule",{value:!0}),nw=ow(BR),rw=ow(jR),iw=ow(cR),aw=ow(HR);function ow(e){return e&&e.__esModule?e:{default:e}}var sw="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",uw=aw.default.CLEARKEY_KEYSTEM_STRING;function lw(e){var t=void 0,n=e.BASE64,r=e.debug.getLogger(t);return t={uuid:sw,schemeIdURI:"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",systemString:uw,getInitData:function(e){return iw.default.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var i=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),a=[],o=0;o<i.kids.length;o++){var s=i.kids[o],u=e.clearkeys&&e.clearkeys.hasOwnProperty(s)?e.clearkeys[s]:null;if(!u)throw new Error("DRM: ClearKey keyID ("+s+") is not known!");a.push(new nw.default(s,u))}n=new rw.default(a),r.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return n}}}lw.__dashjs_factory_name="KeySystemW3CClearKey";var fw=dashjs.FactoryMaker.getSingletonFactory(lw),dw=Object.defineProperty({default:fw},"__esModule",{value:!0}),cw=gw(cR),hw=gw(HR);function gw(e){return e&&e.__esModule?e:{default:e}}var pw="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",mw=hw.default.WIDEVINE_KEYSTEM_STRING;function _w(e){var t=null,n=(e=e||{}).BASE64;return{uuid:pw,schemeIdURI:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",systemString:mw,init:function(e){e&&(t=e)},getInitData:function(e){return cw.default.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(e){return t&&t.sessionId?t.sessionId:e&&e.sessionId?e.sessionId:null}}}_w.__dashjs_factory_name="KeySystemWidevine";var Ew=dashjs.FactoryMaker.getSingletonFactory(_w),yw=Object.defineProperty({default:Ew},"__esModule",{value:!0}),vw=Aw(cR),Tw=Aw(HR);function Aw(e){return e&&e.__esModule?e:{default:e}}var Sw="9a04f079-9840-4286-ab92-e65be0885f95",bw=Tw.default.PLAYREADY_KEYSTEM_STRING,Iw=void 0;function Rw(e){var t="utf-16",n=(e=e||{}).BASE64;function r(){if(!n||!n.hasOwnProperty("decodeArray")||!n.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return{uuid:Sw,schemeIdURI:"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",systemString:bw,getInitData:function(e){var t,i,a,o=new Uint8Array([112,115,115,104,0,0,0,0]),s=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),u=0,l=null,f=void 0,d=void 0;if(r(),!e)return null;if("pssh"in e)return vw.default.parseInitDataFromContentProtection(e,n);if("pro"in e)l=n.decodeArray(e.pro.__text);else{if(!("prheader"in e))return null;l=n.decodeArray(e.prheader.__text)}return t=l.length,i=4+o.length+s.length+4+t,a=new ArrayBuffer(i),f=new Uint8Array(a),(d=new DataView(a)).setUint32(u,i),u+=4,f.set(o,u),u+=o.length,f.set(s,u),u+=s.length,d.setUint32(u,t),u+=4,f.set(l,u),u+=t,f.buffer},getRequestHeadersFromMessage:function(e){var n,r=void 0,i={},a=new DOMParser,o="utf-16"===t?new Uint16Array(e):new Uint8Array(e);n=String.fromCharCode.apply(null,o);for(var s=(r=a.parseFromString(n,"application/xml")).getElementsByTagName("name"),u=r.getElementsByTagName("value"),l=0;l<s.length;l++)i[s[l].childNodes[0].nodeValue]=u[l].childNodes[0].nodeValue;return i.hasOwnProperty("Content")&&(i["Content-Type"]=i.Content,delete i.Content),i.hasOwnProperty("Content-Type")||(i["Content-Type"]="text/xml; charset=utf-8"),i},getLicenseRequestFromMessage:function(e){var i=null,a=new DOMParser,o="utf-16"===t?new Uint16Array(e):new Uint8Array(e);r();var s=String.fromCharCode.apply(null,o),u=a.parseFromString(s,"application/xml");if(!u.getElementsByTagName("PlayReadyKeyMessage")[0])return e;var l=u.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;return l&&(i=n.decode(l)),i},getLicenseServerURLFromInitData:function(e){if(e)for(var t=new DataView(e),n=t.getUint16(4,!0),r=6,i=new DOMParser,a=0;a<n;a++){var o=t.getUint16(r,!0);r+=2;var s=t.getUint16(r,!0);if(r+=2,1===o){var u=e.slice(r,r+s),l=String.fromCharCode.apply(null,new Uint16Array(u)),f=i.parseFromString(l,"application/xml");if(f.getElementsByTagName("LA_URL")[0]){var d=f.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(d)return d}if(f.getElementsByTagName("LUI_URL")[0]){var c=f.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(c)return c}}else r+=s}return null},getCDMData:function(){var e=void 0,t=void 0,i=void 0,a=void 0;if(r(),Iw&&Iw.cdmData){for(e=[],a=0;a<Iw.cdmData.length;++a)e.push(Iw.cdmData.charCodeAt(a)),e.push(0);for(e=String.fromCharCode.apply(null,e),e=n.encode(e),t='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",e),i=[],a=0;a<t.length;++a)i.push(t.charCodeAt(a)),i.push(0);return new Uint8Array(i).buffer}return null},getSessionId:function(e){return Iw&&Iw.sessionId?Iw.sessionId:e&&e.sessionId?e.sessionId:null},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');t=e},init:function(e){e&&(Iw=e)}}}Rw.__dashjs_factory_name="KeySystemPlayReady";var ww=dashjs.FactoryMaker.getSingletonFactory(Rw),Nw=Object.defineProperty({default:ww},"__esModule",{value:!0}),Mw=function(e){return e&&e.__esModule?e:{default:e}}(HR);function Cw(e){var t=(e=e||{}).BASE64,n={};n[Mw.default.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},n[Mw.default.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}};return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return n[e].responseType},getLicenseMessage:function(e,r){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),n[r].getLicenseMessage(e)},getErrorResponse:function(e,t){return n[t].getErrorResponse(e)}}}Cw.__dashjs_factory_name="DRMToday";var Dw=dashjs.FactoryMaker.getSingletonFactory(Cw),Ow=Object.defineProperty({default:Dw},"__esModule",{value:!0});function Pw(){var e="http://schemas.xmlsoap.org/soap/envelope/";function t(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function n(n){if(window.DOMParser){var r=t(n),i=(new window.DOMParser).parseFromString(r,"text/xml"),a=i?i.getElementsByTagNameNS(e,"Envelope")[0]:null,o=a?a.getElementsByTagNameNS(e,"Body")[0]:null;if(o?o.getElementsByTagNameNS(e,"Fault")[0]:null)return null}return n}function r(n){var r="",i="",a="",o=-1,s=-1;if(window.DOMParser){var u=t(n),l=(new window.DOMParser).parseFromString(u,"text/xml"),f=l?l.getElementsByTagNameNS(e,"Envelope")[0]:null,d=f?f.getElementsByTagNameNS(e,"Body")[0]:null,c=d?d.getElementsByTagNameNS(e,"Fault")[0]:null,h=c?c.getElementsByTagName("detail")[0]:null,g=h?h.getElementsByTagName("Exception")[0]:null,p=null;if(null===c)return u;r=(p=c.getElementsByTagName("faultstring")[0].firstChild)?p.nodeValue:null,null!==g&&(i=(p=g.getElementsByTagName("StatusCode")[0])?p.firstChild.nodeValue:null,o=(a=(p=g.getElementsByTagName("Message")[0])?p.firstChild.nodeValue:null)?a.lastIndexOf("[")+1:-1,s=a?a.indexOf("]"):-1,a=a?a.substring(o,s):"")}var m="code: "+i+", name: "+r;return a&&(m+=", message: "+a),m}return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return n.call(this,e)},getErrorResponse:function(e){return r.call(this,e)}}}Pw.__dashjs_factory_name="PlayReady";var Lw=dashjs.FactoryMaker.getSingletonFactory(Pw),Fw=Object.defineProperty({default:Lw},"__esModule",{value:!0});function xw(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}xw.__dashjs_factory_name="Widevine";var Uw=dashjs.FactoryMaker.getSingletonFactory(xw),Bw=Object.defineProperty({default:Uw},"__esModule",{value:!0}),kw=jw(BR),Gw=jw(jR);function jw(e){return e&&e.__esModule?e:{default:e}}function Yw(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;for(var t=[],n=0;n<e.keys.length;n++){var r=e.keys[n],i=r.kid.replace(/=/g,""),a=r.k.replace(/=/g,"");t.push(new kw.default(i,a))}return new Gw.default(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}Yw.__dashjs_factory_name="ClearKey";var qw=dashjs.FactoryMaker.getSingletonFactory(Yw),Hw=Object.defineProperty({default:qw},"__esModule",{value:!0}),Kw=tN(cR),Vw=tN(tw),zw=tN(dw),Ww=tN(yw),Xw=tN(Nw),Qw=tN(Ow),Zw=tN(Fw),$w=tN(Bw),Jw=tN(Hw),eN=tN(HR);function tN(e){return e&&e.__esModule?e:{default:e}}function nN(){var e=this.context,t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0;return t={initialize:function(){i=[];var t=void 0;t=(0,Xw.default)(e).getInstance({BASE64:a}),i.push(t),t=(0,Ww.default)(e).getInstance({BASE64:a}),i.push(t),t=(0,Vw.default)(e).getInstance({BASE64:a}),i.push(t),o=t,t=(0,zw.default)(e).getInstance({BASE64:a,debug:n}),i.push(t),s=t},setProtectionData:function(e){for(var t=function(t){var n=null;return e&&(n=t in e?e[t]:null),n},n=0;n<i.length;n++){var r=i[n];r.hasOwnProperty("init")&&r.init(t(r.systemString))}},isClearKey:function(e){return e===o||e===s},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){for(var n=new Uint8Array(e),r=new Uint8Array(t),i=0;i<n.length;i++)if(n[i]!==r[i])return!1;return!0}return!1},getKeySystems:function(){return i},setKeySystems:function(e){i=e},getKeySystemBySystemString:function(e){for(var t=0;t<i.length;t++)if(i[t].systemString===e)return i[t];return null},getSupportedKeySystemsFromContentProtection:function(e){var t=void 0,n=void 0,r=void 0,a=void 0,o=[];if(e){var s=Kw.default.findCencContentProtection(e);for(r=0;r<i.length;++r)for(n=i[r],a=0;a<e.length;++a)if((t=e[a]).schemeIdUri.toLowerCase()===n.schemeIdURI){var u=n.getInitData(t,s);o.push({ks:i[r],initData:u,cdmData:n.getCDMData(),sessionId:n.getSessionId(t)})}}return o},getSupportedKeySystems:function(e,t){for(var n=[],r=Kw.default.parsePSSHList(e),a=void 0,o=void 0,s=void 0,u=0;u<i.length;++u)o=(a=i[u]).systemString,s=!t||o in t,a.uuid in r&&s&&n.push({ks:a,initData:r[a.uuid],cdmData:a.getCDMData(),sessionId:a.getSessionId()});return n},getLicenseServer:function(t,n,r){if("license-release"===r||"individualization-request"===r)return null;var i=null;return n&&n.hasOwnProperty("drmtoday")?i=(0,Qw.default)(e).getInstance({BASE64:a}):t.systemString===eN.default.WIDEVINE_KEYSTEM_STRING?i=(0,$w.default)(e).getInstance():t.systemString===eN.default.PLAYREADY_KEYSTEM_STRING?i=(0,Zw.default)(e).getInstance():t.systemString===eN.default.CLEARKEY_KEYSTEM_STRING&&(i=(0,Jw.default)(e).getInstance()),i},processClearKeyLicenseRequest:function(e,t,n){try{return e.getClearKeysFromProtectionData(t,n)}catch(e){return r.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(e){e&&(e.debug&&(n=e.debug,r=n.getLogger(t)),e.BASE64&&(a=e.BASE64))}}}nN.__dashjs_factory_name="ProtectionKeyController";var rN=dashjs.FactoryMaker.getSingletonFactory(nN),iN=Object.defineProperty({default:rN},"__esModule",{value:!0});var aN=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.INTERNAL_KEY_MESSAGE="internalKeyMessage",e.INTERNAL_KEY_SYSTEM_SELECTED="internalKeySystemSelected",e.INTERNAL_KEY_STATUS_CHANGED="internalkeyStatusChanged",e.KEY_ADDED="public_keyAdded",e.KEY_ERROR="public_keyError",e.KEY_MESSAGE="public_keyMessage",e.KEY_SESSION_CLOSED="public_keySessionClosed",e.KEY_SESSION_CREATED="public_keySessionCreated",e.KEY_SESSION_REMOVED="public_keySessionRemoved",e.KEY_STATUSES_CHANGED="public_keyStatusesChanged",e.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",e.KEY_SYSTEM_SELECTED="public_keySystemSelected",e.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",e.LICENSE_REQUEST_SENDING="public_licenseRequestSending",e.NEED_KEY="needkey",e.PROTECTION_CREATED="public_protectioncreated",e.PROTECTION_DESTROYED="public_protectiondestroyed",e.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",e.TEARDOWN_COMPLETE="protectionTeardownComplete",e.VIDEO_ELEMENT_SELECTED="videoElementSelected",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){return e&&e.__esModule?e:{default:e}}(S).default)),oN=Object.defineProperty({default:aN},"__esModule",{value:!0});var sN=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initData=t,this.initDataType=n},uN=Object.defineProperty({default:sN},"__esModule",{value:!0});var lN=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sessionToken=t,this.message=n,this.defaultURL=r,this.messageType=i||"license-request"},fN=Object.defineProperty({default:lN},"__esModule",{value:!0});var dN=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keySystem=t,this.ksConfiguration=n},cN=Object.defineProperty({default:dN},"__esModule",{value:!0}),hN=vN(iN),gN=vN(uN),pN=vN(ER),mN=vN(be),_N=vN(fN),EN=vN(cN),yN=vN(HR);function vN(e){return e&&e.__esModule?e:{default:e}}function TN(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,i=e.debug,a=void 0,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0;function h(e){var t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function g(e){for(var t=0;t<f.length;t++)if(f[t]===e){f.splice(t,1);break}}function p(e){var t=void 0,n=void 0;return e&&e.length>0&&(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 m(e,t,i,a){var s={session:e,initData:t,sessionId:a,handleEvent:function(e){switch(e.type){case"keystatuseschange":n.trigger(r.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=p(arguments);switch(e.status){case"expired":n.trigger(r.INTERNAL_KEY_STATUS_CHANGED,{error:new mN.default(pN.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,pN.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)});break;default:n.trigger(r.INTERNAL_KEY_STATUS_CHANGED,e)}}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(r.INTERNAL_KEY_MESSAGE,{data:new _N.default(this,t,void 0,e.messageType)})}},getSessionID:function(){return e.sessionId},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){var e=p(arguments);"usable"===e.status&&(t=!0)})),t},getSessionType:function(){return i}};return e.addEventListener("keystatuseschange",s),e.addEventListener("message",s),e.closed.then((function(){g(s),o.debug("DRM: Session closed. SessionID = "+s.getSessionID()),n.trigger(r.KEY_SESSION_CLOSED,{data:s.getSessionID()})})),f.push(s),s}return a={getAllInitData:function(){for(var e=[],t=0;t<f.length;t++)f[t].initData&&e.push(f[t].initData);return e},requestKeySystemAccess:function(e){!function e(t,i){if(void 0===navigator.requestMediaKeySystemAccess||"function"!=typeof navigator.requestMediaKeySystemAccess)return void n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Insecure origins are not allowed"});!function(i){var a=t[i].ks,o=t[i].configs,s=a.systemString;s===yN.default.PLAYREADY_KEYSTEM_STRING&&"required"===o[0].persistentState&&(s+=".recommendation"),navigator.requestMediaKeySystemAccess(s,o).then((function(e){var t="function"==typeof e.getConfiguration?e.getConfiguration():null,i=new EN.default(a,t);i.mksa=e,n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{data:i})})).catch((function(a){++i<t.length?e(t,i):n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! "+a.message})}))}(i)}(e,0)},getKeySystem:function(){return s},selectKeySystem:function(e){e.mksa.createMediaKeys().then((function(t){s=e.keySystem,l=t,u?u.setMediaKeys(l).then((function(){n.trigger(r.INTERNAL_KEY_SYSTEM_SELECTED)})):n.trigger(r.INTERNAL_KEY_SYSTEM_SELECTED)})).catch((function(){n.trigger(r.INTERNAL_KEY_SYSTEM_SELECTED,{error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))},setMediaElement:function(e){u!==e&&(u&&(u.removeEventListener("encrypted",d),u.setMediaKeys&&u.setMediaKeys(null)),(u=e)&&(u.addEventListener("encrypted",d),u.setMediaKeys&&l&&u.setMediaKeys(l)))},setServerCertificate:function(e){if(!s||!l)throw new Error("Can not set server certificate until you have selected a key system");l.setServerCertificate(e).then((function(){o.info("DRM: License server certificate successfully updated."),n.trigger(r.SERVER_CERTIFICATE_UPDATED)})).catch((function(e){n.trigger(r.SERVER_CERTIFICATE_UPDATED,{error:new mN.default(pN.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,pN.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})}))},createKeySession:function(e,t,i){if(!s||!l)throw new Error("Can not create sessions until you have selected a key system");var a=l.createSession(i),u=m(a,e,i),f=this.getKeySystem().systemString===yN.default.CLEARKEY_KEYSTEM_STRING&&(e||t&&t.clearkeys)?"keyids":"cenc";a.generateRequest(f,e).then((function(){o.debug("DRM: Session created. SessionID = "+u.getSessionID()),n.trigger(r.KEY_SESSION_CREATED,{data:u})})).catch((function(e){g(u),n.trigger(r.KEY_SESSION_CREATED,{data:null,error:new mN.default(pN.default.KEY_SESSION_CREATED_ERROR_CODE,pN.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})}))},updateKeySession:function(e,t){var i=e.session;c.isClearKey(s)&&(t=t.toJWK()),i.update(t).catch((function(t){n.trigger(r.KEY_ERROR,{data:new mN.default(pN.default.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})}))},loadKeySession:function(e,t,i){if(!s||!l)throw new Error("Can not load sessions until you have selected a key system");for(var a=0;a<f.length;a++)if(e===f[a].sessionId)return void o.warn("DRM: Ignoring session ID because we have already seen it!");var u=l.createSession(i),d=m(u,t,i,e);u.load(e).then((function(t){t?(o.debug("DRM: Session loaded. SessionID = "+d.getSessionID()),n.trigger(r.KEY_SESSION_CREATED,{data:d})):(g(d),n.trigger(r.KEY_SESSION_CREATED,{data:null,error:new mN.default(pN.default.KEY_SESSION_CREATED_ERROR_CODE,pN.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+e+")")}))})).catch((function(t){g(d),n.trigger(r.KEY_SESSION_CREATED,{data:null,error:new mN.default(pN.default.KEY_SESSION_CREATED_ERROR_CODE,pN.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+e+")! "+t.name)})}))},removeKeySession:function(e){e.session.remove().then((function(){o.debug("DRM: Session removed. SessionID = "+e.getSessionID()),n.trigger(r.KEY_SESSION_REMOVED,{data:e.getSessionID()})}),(function(t){n.trigger(r.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionID()+"). "+t.name})}))},closeKeySession:function(e){h(e).catch((function(t){g(e),n.trigger(r.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionID()+") "+t.name})}))},stop:function(){for(var e=void 0,t=0;t<f.length;t++)(e=f[t]).getUsable()||h(e).catch((function(){g(e)}))},reset:function(){var e=f.length,t=void 0;0!==e?function(){for(var i=function(e){g(e),0===f.length&&(u?(u.removeEventListener("encrypted",d),u.setMediaKeys(null).then((function(){n.trigger(r.TEARDOWN_COMPLETE)}))):n.trigger(r.TEARDOWN_COMPLETE))},a=0;a<e;a++)!function(e){t.session.closed.then((function(){i(e)})),h(t).catch((function(){i(e)}))}(t=f[a])}():n.trigger(r.TEARDOWN_COMPLETE)}},o=i.getLogger(a),s=null,u=null,l=null,f=[],c=(0,hN.default)(t).getInstance(),d={handleEvent:function(e){switch(e.type){case"encrypted":if(e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(r.NEED_KEY,{key:new gN.default(t,e.initDataType)})}}}},a}TN.__dashjs_factory_name="ProtectionModel_21Jan2015";var AN=dashjs.FactoryMaker.getClassFactory(TN),SN=Object.defineProperty({default:AN},"__esModule",{value:!0}),bN=DN(iN),IN=DN(uN),RN=DN(be),wN=DN(ER),NN=DN(fN),MN=DN(mR),CN=DN(cN);function DN(e){return e&&e.__esModule?e:{default:e}}function ON(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,i=e.debug,a=e.api,o=void 0,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0;function p(){try{for(var e=0;e<c.length;e++)m(c[e]);u&&u.removeEventListener(a.needkey,h),n.trigger(r.TEARDOWN_COMPLETE)}catch(e){n.trigger(r.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function m(e){var t=e.session;t.removeEventListener(a.error,e),t.removeEventListener(a.message,e),t.removeEventListener(a.ready,e),t.removeEventListener(a.close,e);for(var n=0;n<c.length;n++)if(c[n]===e){c.splice(n,1);break}t[a.release]()}function _(){var e=null,t=function(){u.removeEventListener("loadedmetadata",e),u[a.setMediaKeys](f),n.trigger(r.VIDEO_ELEMENT_SELECTED)};u.readyState>=1?t():(e=t.bind(this),u.addEventListener("loadedmetadata",e))}return o={getAllInitData:function(){for(var e=[],t=0;t<c.length;t++)e.push(c[t].initData);return e},requestKeySystemAccess:function(e){for(var t=!1,i=0;i<e.length;i++)for(var o=e[i].ks.systemString,s=e[i].configs,u=null,l=null,f=0;f<s.length;f++){var d=s[f].audioCapabilities,c=s[f].videoCapabilities;if(d&&0!==d.length){u=[];for(var h=0;h<d.length;h++)window[a.MediaKeys].isTypeSupported(o,d[h].contentType)&&u.push(d[h])}if(c&&0!==c.length){l=[];for(var p=0;p<c.length;p++)window[a.MediaKeys].isTypeSupported(o,c[p].contentType)&&l.push(c[p])}if(!(!u&&!l||u&&0===u.length||l&&0===l.length)){t=!0;var m=new MN.default(u,l),_=g.getKeySystemBySystemString(o);n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{data:new CN.default(_,m)});break}}t||n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! -- No valid audio/video content configurations detected!"})},getKeySystem:function(){return l},selectKeySystem:function(e){try{f=e.mediaKeys=new window[a.MediaKeys](e.keySystem.systemString),l=e.keySystem,d=e,u&&_(),n.trigger(r.INTERNAL_KEY_SYSTEM_SELECTED)}catch(e){n.trigger(r.INTERNAL_KEY_SYSTEM_SELECTED,{error:"Error selecting keys system ("+l.systemString+")! Could not create MediaKeys -- TODO"})}},setMediaElement:function(e){u!==e&&(u&&u.removeEventListener(a.needkey,h),(u=e)&&(u.addEventListener(a.needkey,h),f&&_()))},createKeySession:function(e,t,i,o){if(!l||!f||!d)throw new Error("Can not create sessions until you have selected a key system");var u=null;if(d.ksConfiguration.videoCapabilities&&d.ksConfiguration.videoCapabilities.length>0&&(u=d.ksConfiguration.videoCapabilities[0]),null===u&&d.ksConfiguration.audioCapabilities&&d.ksConfiguration.audioCapabilities.length>0&&(u=d.ksConfiguration.audioCapabilities[0]),null===u)throw new Error("Can not create sessions for unknown content types.");var h=u.contentType,g=f.createSession(h,new Uint8Array(e),o?new Uint8Array(o):null),p=function(e,t){return{session:e,initData:t,getSessionID:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case a.error:n.trigger(r.KEY_ERROR,{data:new RN.default(wN.default.MEDIA_KEYERR_CODE,"KeyError",this)});break;case a.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(r.INTERNAL_KEY_MESSAGE,{data:new NN.default(this,t,e.destinationURL)});break;case a.ready:s.debug("DRM: Key added."),n.trigger(r.KEY_ADDED);break;case a.close:s.debug("DRM: Session closed. SessionID = "+this.getSessionID()),n.trigger(r.KEY_SESSION_CLOSED,{data:this.getSessionID()})}}}}(g,e);g.addEventListener(a.error,p),g.addEventListener(a.message,p),g.addEventListener(a.ready,p),g.addEventListener(a.close,p),c.push(p),s.debug("DRM: Session created. SessionID = "+p.getSessionID()),n.trigger(r.KEY_SESSION_CREATED,{data:p})},updateKeySession:function(e,t){var n=e.session;g.isClearKey(l)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t))},closeKeySession:m,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:p,reset:p},s=i.getLogger(o),u=null,l=null,f=null,d=null,c=[],g=(0,bN.default)(t).getInstance(),h={handleEvent:function(e){switch(e.type){case a.needkey:if(e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(r.NEED_KEY,{key:new IN.default(t,"cenc")})}}}},o}ON.__dashjs_factory_name="ProtectionModel_3Feb2014";var PN=dashjs.FactoryMaker.getClassFactory(ON),LN=Object.defineProperty({default:PN},"__esModule",{value:!0}),FN=YN(iN),xN=YN(uN),UN=YN(be),BN=YN(fN),kN=YN(mR),GN=YN(cN),jN=YN(ER);function YN(e){return e&&e.__esModule?e:{default:e}}function qN(e){e=e||{};var t=this.context,n=e.eventBus,r=e.events,i=e.debug,a=e.api,o=e.errHandler,s=void 0,u=void 0,l=void 0,f=void 0,d=void 0,c=void 0,h=void 0,g=void 0,p=void 0;function m(){l&&y();for(var e=0;e<h.length;e++)_(h[e]);n.trigger(r.TEARDOWN_COMPLETE)}function _(e){try{l[a.cancelKeyRequest](f.systemString,e.sessionID)}catch(t){n.trigger(r.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionID+") "+t.message})}}function E(e,t){if(t&&e){for(var n=e.length,r=0;r<n;r++)if(e[r].sessionID==t)return e[r];return null}return null}function y(){l.removeEventListener(a.keyerror,p),l.removeEventListener(a.needkey,p),l.removeEventListener(a.keymessage,p),l.removeEventListener(a.keyadded,p)}return s={getAllInitData:function(){for(var e=[],t=0;t<c.length;t++)e.push(c[t].initData);for(var n=0;n<h.length;n++)e.push(h[n].initData);return e},requestKeySystemAccess:function(e){var t=l;t||(t=document.createElement("video"));for(var i=!1,a=0;a<e.length;a++)for(var o=e[a].ks.systemString,s=e[a].configs,u=null,f=0;f<s.length;f++){var c=s[f].videoCapabilities;if(c&&0!==c.length){u=[];for(var h=0;h<c.length;h++)""!==t.canPlayType(c[h].contentType,o)&&u.push(c[h])}if(u&&(!u||0!==u.length)){i=!0;var g=new kN.default(null,u),p=d.getKeySystemBySystemString(o);n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{data:new GN.default(p,g)});break}}i||n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! -- No valid audio/video content configurations detected!"})},getKeySystem:function(){return f},selectKeySystem:function(e){f=e.keySystem,n.trigger(r.INTERNAL_KEY_SYSTEM_SELECTED)},setMediaElement:function(e){if(l!==e){if(l){y();for(var t=0;t<h.length;t++)_(h[t]);h=[]}(l=e)&&(l.addEventListener(a.keyerror,p),l.addEventListener(a.needkey,p),l.addEventListener(a.keymessage,p),l.addEventListener(a.keyadded,p),n.trigger(r.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!f)throw new Error("Can not create sessions until you have selected a key system");if(g||0===h.length){var t={sessionID:null,initData:e,getSessionID:function(){return this.sessionID},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"}};return c.push(t),l[a.generateKeyRequest](f.systemString,new Uint8Array(e)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){var n=e.sessionID;if(d.isClearKey(f))for(var r=0;r<t.keyPairs.length;r++)l[a.addKey](f.systemString,t.keyPairs[r].key,t.keyPairs[r].keyID,n);else l[a.addKey](f.systemString,new Uint8Array(t),new Uint8Array(e.initData),n)},closeKeySession:_,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:m,reset:m},u=i.getLogger(s),l=null,f=null,c=[],h=[],d=(0,FN.default)(t).getInstance(),p={handleEvent:function(e){var t=null;switch(e.type){case a.needkey:var i=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(r.NEED_KEY,{key:new xN.default(i,"cenc")});break;case a.keyerror:if((t=E(h,e.sessionId))||(t=E(c,e.sessionId)),t){var s=jN.default.MEDIA_KEYERR_CODE,l="";switch(e.errorCode.code){case 1:s=jN.default.MEDIA_KEYERR_UNKNOWN_CODE,l+="MEDIA_KEYERR_UNKNOWN - "+jN.default.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:s=jN.default.MEDIA_KEYERR_CLIENT_CODE,l+="MEDIA_KEYERR_CLIENT - "+jN.default.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:s=jN.default.MEDIA_KEYERR_SERVICE_CODE,l+="MEDIA_KEYERR_SERVICE - "+jN.default.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:s=jN.default.MEDIA_KEYERR_OUTPUT_CODE,l+="MEDIA_KEYERR_OUTPUT - "+jN.default.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:s=jN.default.MEDIA_KEYERR_HARDWARECHANGE_CODE,l+="MEDIA_KEYERR_HARDWARECHANGE - "+jN.default.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:s=jN.default.MEDIA_KEYERR_DOMAIN_CODE,l+="MEDIA_KEYERR_DOMAIN - "+jN.default.MEDIA_KEYERR_DOMAIN_MESSAGE}l+=" System Code = "+e.systemCode,n.trigger(r.KEY_ERROR,{data:new UN.default(s,l,t)})}else u.error("No session token found for key error");break;case a.keyadded:(t=E(h,e.sessionId))||(t=E(c,e.sessionId)),t?(u.debug("DRM: Key added."),n.trigger(r.KEY_ADDED,{data:t})):u.debug("No session token found for key added");break;case a.keymessage:if((g=null!==e.sessionId&&void 0!==e.sessionId)?!(t=E(h,e.sessionId))&&c.length>0&&(t=c.shift(),h.push(t),t.sessionID=e.sessionId,n.trigger(r.KEY_SESSION_CREATED,{data:t})):c.length>0&&(t=c.shift(),h.push(t),0!==c.length&&o.error(new UN.default(jN.default.MEDIA_KEY_MESSAGE_ERROR_CODE,jN.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var f=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=f,n.trigger(r.INTERNAL_KEY_MESSAGE,{data:new BN.default(t,f,e.defaultURL)})}else u.warn("No session token found for key message")}}},s}qN.__dashjs_factory_name="ProtectionModel_01b";var HN=dashjs.FactoryMaker.getClassFactory(qN),KN=Object.defineProperty({default:HN},"__esModule",{value:!0}),VN=JN(xR),zN=JN(iN),WN=JN(oN),XN=JN(ER),QN=JN(SN),ZN=JN(LN),$N=JN(KN);function JN(e){return e&&e.__esModule?e:{default:e}}var eM=[{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"}],tM=[{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 nM(){var e=void 0,t=this.context;function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];if("function"==typeof e[r[Object.keys(r)[0]]])return r}return null}return e={createProtectionSystem:function(r){var i=null,a=(0,zN.default)(t).getInstance();a.setConfig({debug:r.debug,BASE64:r.BASE64}),a.initialize();var o=function(r){var i=r.debug,a=i.getLogger(e),o=r.eventBus,s=r.errHandler,u=r.videoModel?r.videoModel.getElement():null;return u&&void 0===u.onencrypted||u&&void 0===u.mediaKeys?n(u,tM)?(a.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),(0,ZN.default)(t).create({debug:i,eventBus:o,events:r.events,api:n(u,tM)})):n(u,eM)?(a.info("EME detected on this user agent! (ProtectionModel_01b)"),(0,$N.default)(t).create({debug:i,eventBus:o,errHandler:s,events:r.events,api:n(u,eM)})):(a.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(a.info("EME detected on this user agent! (ProtectionModel_21Jan2015)"),(0,QN.default)(t).create({debug:i,eventBus:o,events:r.events}))}(r);return!i&&o&&(i=(0,VN.default)(t).create({protectionModel:o,protectionKeyController:a,eventBus:r.eventBus,debug:r.debug,events:r.events,BASE64:r.BASE64,constants:r.constants,cmcdModel:r.cmcdModel,settings:r.settings}),r.capabilities.setEncryptedMediaSupported(!0)),i}}}nM.__dashjs_factory_name="Protection";var rM=dashjs.FactoryMaker.getClassFactory(nM);rM.events=WN.default,rM.errors=XN.default,dashjs.FactoryMaker.updateClassFactory(nM.__dashjs_factory_name,rM);var iM=rM,aM=Object.defineProperty({default:iM},"__esModule",{value:!0}),oM=function(e){return e&&e.__esModule?e:{default:e}}(yb);var sM=function(){var e=void 0;function t(t,n,r){if(!t||!/^VIDEO$/i.test(t.nodeName))return null;if(t._dashjs_player)return t._dashjs_player;var i=void 0,a=t.id||t.name||"video element";if(!(n=n||[].slice.call(t.querySelectorAll("source")).filter((function(e){return"application/dash+xml"==e.type}))[0])&&t.src)(n=document.createElement("source")).src=t.src;else if(!n&&!t.src)return null;return r=r||{},(i=(0,oM.default)(r).create()).initialize(t,n.src,t.autoplay),e||(e=i.getDebug().getLogger()),e.debug("Converted "+a+" to dash.js player and added content: "+n.src),t._dashjs_player=i,i}function n(e){return/^VIDEO$/i.test(e.nodeName)?e:n(e.parentNode)}return{create:t,createAll:function(e,r){var i=[];e=e||"[data-dashjs-player]";for(var a=(r=r||document).querySelectorAll(e),o=0;o<a.length;o++){var s=t(a[o],null);i.push(s)}for(var u=r.querySelectorAll('source[type="application/dash+xml"]'),l=0;l<u.length;l++){var f=t(n(u[l]),null);i.push(f)}return i}}}(),uM=void 0;!("undefined"!=typeof window&&window&&window.dashjs&&window.dashjs.skipAutoCreate)&&"undefined"!=typeof window&&window&&window.addEventListener&&("complete"===window.document.readyState?window.dashjs?sM.createAll():uM=window.setInterval((function(){window.dashjs&&(window.clearInterval(uM),sM.createAll())}),500):window.addEventListener("load",(function e(){window.removeEventListener("load",e),sM.createAll()})));var lM=sM,fM=Object.defineProperty({default:lM},"__esModule",{value:!0}),dM=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.supportsMediaSource=t.Debug=t.MediaPlayerFactory=t.MetricsReporting=t.Protection=t.MediaPlayer=void 0;var n=o(lR),r=o(aM),i=o(fM),a=o(Q);function o(e){return e&&e.__esModule?e:{default:e}}dashjs.Protection=r.default,dashjs.MetricsReporting=n.default,dashjs.MediaPlayerFactory=i.default,dashjs.Debug=a.default,dashjs.supportsMediaSource=cv.supportsMediaSource,t.default=dashjs,t.MediaPlayer=vb.MediaPlayer,t.Protection=r.default,t.MetricsReporting=n.default,t.MediaPlayerFactory=i.default,t.Debug=a.default,t.supportsMediaSource=cv.supportsMediaSource})),cM="audio:set",hM="audio:update",gM="audio:tracks";function pM(e){var t;null===(t=e.dash)||void 0===t||t.destroy(),e.plugins.find(e=>e.constructor===Dash).dash=e.dash=void 0}function mM(e,t,n){if(n.code==dM.MediaPlayer.errors.DOWNLOAD_ERROR_ID_CONTENT_CODE)return;if(t.errored)return;if(t.recover_count<3)return t.recover_count+=1,void _M(e,e.original_src);t.errored=!0;const r=n.error||{message:"playback failed"};e.emit("error",r),pM(e)}function _M(e,t){const n=e.dash;n&&(n.setAutoPlay(!0),n.attachSource(t))}class Dash{init(e,t,n){n.on("recover",()=>_M(n,n.original_src)),n.on("src",e=>{const t=e.detail;!this.dash||t&&this.wants(t.src||"",t,n.opts)||pM(n)}),n.on("reap",()=>{pM(n)}),n.on(["beforeplay","viewenter"],t=>{var r;!n.hasState("is-loaded")&&("viewenter"!==t.type||e.autoplay&&"none"===e.preload)&&(null===(r=this.dash)||void 0===r||r.updateSettings({streaming:{scheduleWhilePaused:!0}}))}),n.on("quality:set",(function(e){!function(e,t){var n;const r=e.dash;if(!r)return;const i=null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.qualityIndex;if(!i)return;const a={streaming:{abr:{autoSwitchBitrate:{video:-1===i}}}};r.updateSettings(a),-1!==i&&r.setQualityFor("video",i)}(n,e)})),n.on(cM,(function(e){!function(e,t){var n;t.data&&(null===(n=e.dash)||void 0===n||n.setCurrentTrack(t.data))}(n,e)}))}onload(e,t,n,{src:r}){if(this.dash){if(this.dash.updateSettings({streaming:{scheduleWhilePaused:"none"!==e.preload||!!e.autoplay&&n.hasState("is-in-viewport")}}),this.set_drm(n,e,this.dash))return;return r&&this.dash.attachSource(r)}this.dash=n.dash=dM.MediaPlayer().create(),this.set_drm(n,e,this.dash)||(n.setState("is-loading",!0),this.dash.updateSettings({streaming:{scheduleWhilePaused:"none"!==e.preload||!!e.autoplay&&n.hasState("is-in-viewport")}}),this.dash.initialize(n,r,!1),this.wireup(n,this.dash))}wants(n,r,i){return function(n,r,i){return!(r.drm&&!Object.keys(r.drm).find(t=>e(t)))&&("application/dash+xml"==r.type||t(n))}(n,r)}set_drm(e,t,n){var r,i;if(null===(r=t.dash)||void 0===r?void 0:r.drm){if("https:"!==location.protocol&&"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname)return e.emit("error",{message:"Secure page required for DRM"});n.setProtectionData(null===(i=t.dash)||void 0===i?void 0:i.drm)}}wireup(e,t){const n={seek_timer:void 0,initial_stream_init:!0,errored:!1,recover_count:0};t.on(dM.MediaPlayer.events.STREAM_INITIALIZED,(function(){n.initial_stream_init=!0,n.recover_count=0,e.setOpts({live:t.isDynamic()});const r=function(e){const{dash:t}=e;if(!t)return;const n=(t.getBitrateInfoListFor("video")||[]).sort((e,t)=>t.width-e.width);return n.push({text:"AUTO",qualityIndex:-1}),e.emit("qualities",n),n}(e);!function(e,t){if(!t.initial_stream_init)return;if(!e.dash)return;t.initial_stream_init=!1;const n=(e.dash.getTracksFor("audio")||[]).map((function(e){return e.autoselect=!0,e}));e.emit(gM,n)}(e,n),!(null==r?void 0:r[0].mediaType)&&e.emit("audioonlysource"),t.isDynamic()&&t.on(dM.MediaPlayer.events.FRAGMENT_LOADING_COMPLETED,(function(){e.emit("dvr/window",t.getDVRWindowSize())}))})),t.on(dM.MediaPlayer.events.TRACK_CHANGE_RENDERED,(function(t){"audio"===t.mediaType&&t.newMediaInfo&&e.emit(hM,t.newMediaInfo)})),t.on("currentTrackChanged",(function(t){var n;"audio"===(null===(n=null==t?void 0:t.newMediaInfo)||void 0===n?void 0:n.type)&&e.emit(hM,t.newMediaInfo)})),t.on(dM.MediaPlayer.events.PLAYBACK_PROGRESS,(function(){!function(e){const{dash:t}=e;if(!t)return;const n=t.isDynamic();e.opt("live")==n||e.setOpts({live:n})}(e)})),t.on(dM.MediaPlayer.events.ERROR,(function(t){mM(e,n,t)})),t.on(dM.MediaPlayer.events.KEY_ERROR,(function(t){mM(e,n,t)}))}}return Dash.MediaPlayer=dM.MediaPlayer,"function"==typeof MediaSource&&function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;"function"==typeof n?n(t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t))}(window,Dash),Dash}));