@flowplayer/player 3.4.7-rc.0 → 3.4.7-rc.3

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,4 +1,4 @@
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)}}().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}()}));
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
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};
3
3
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
4
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}