You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Video__Detail__id.227794...

150 lines
1.1 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

(window.webpackJsonp=window.webpackJsonp||[]).push([[291,6,7,11],{"+QRC":function(rt,tt,he){"use strict";var Se=he("E9nw"),Z={"text/plain":"Text","text/html":"Url",default:"Text"},U="Copy to clipboard: #{key}, Enter";function b(E){var A=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return E.replace(/#{\s*key\s*}/g,A)}function L(E,A){var w,v,u,h,a,t,i=!1;A||(A={}),w=A.debug||!1;try{u=Se(),h=document.createRange(),a=document.getSelection(),t=document.createElement("span"),t.textContent=E,t.style.all="unset",t.style.position="fixed",t.style.top=0,t.style.clip="rect(0, 0, 0, 0)",t.style.whiteSpace="pre",t.style.webkitUserSelect="text",t.style.MozUserSelect="text",t.style.msUserSelect="text",t.style.userSelect="text",t.addEventListener("copy",function(c){if(c.stopPropagation(),A.format)if(c.preventDefault(),typeof c.clipboardData=="undefined"){w&&console.warn("unable to use e.clipboardData"),w&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=Z[A.format]||Z.default;window.clipboardData.setData(o,E)}else c.clipboardData.clearData(),c.clipboardData.setData(A.format,E);A.onCopy&&(c.preventDefault(),A.onCopy(c.clipboardData))}),document.body.appendChild(t),h.selectNodeContents(t),a.addRange(h);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");i=!0}catch(c){w&&console.error("unable to copy using execCommand: ",c),w&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(A.format||"text",E),A.onCopy&&A.onCopy(window.clipboardData),i=!0}catch(o){w&&console.error("unable to copy using clipboardData: ",o),w&&console.error("falling back to prompt"),v=b("message"in A?A.message:U),window.prompt(v,E)}}finally{a&&(typeof a.removeRange=="function"?a.removeRange(h):a.removeAllRanges()),t&&document.body.removeChild(t),u()}return i}rt.exports=L},"0r65":function(rt,tt){var he=arguments[3],Se=arguments[4],Z=arguments[5],U=JSON.stringify;rt.exports=function(b,L){for(var E,A=Object.keys(Z),w=0,v=A.length;w<v;w++){var u=A[w],h=Z[u].exports;if(h===b||h&&h.default===b){E=u;break}}if(!E){E=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var a={},w=0,v=A.length;w<v;w++){var u=A[w];a[u]=u}Se[E]=["function(require,module,exports){"+b+"(self); }",a]}var t=Math.floor(Math.pow(16,8)*Math.random()).toString(16),i={};i[E]=E,Se[t]=["function(require,module,exports){var f = require("+U(E)+");(f.default ? f.default : f)(self);}",i];var l={};c(t);function c(f){l[f]=!0;for(var g in Se[f][1]){var m=Se[f][1][g];l[m]||c(m)}}var o="("+he+")({"+Object.keys(l).map(function(f){return U(f)+":["+Se[f][0]+","+U(Se[f][1])+"]"}).join(",")+"},{},["+U(t)+"])",e=window.URL||window.webkitURL||window.mozURL||window.msURL,s=new Blob([o],{type:"text/javascript"});if(L&&L.bare)return s;var r=e.createObjectURL(s),d=new Worker(r);return d.objectURL=r,d}},"1ZF9":function(rt,tt,he){rt.exports=he.p+"static/Authorize.cc9c212f.png"},"4xil":function(rt,tt,he){rt.exports={watermark:"watermark___2DVjg",videovideo:"videovideo___3jScv",animate__loop:"animate__loop___36IZ1",upDown:"upDown___3FGkz",container:"container___GV_Ds","video-container":"video-container___35tqx","video-controls":"video-controls___u99fM",hide:"hide___2GDit","video-progress":"video-progress___2LKQJ",seek:"seek___3b-US","seek-tooltip":"seek-tooltip___bZ9sZ","bottom-controls":"bottom-controls___74sQw","left-controls":"left-controls___2kBb3","right-controls":"right-controls___3oxDi","volume-controls":"volume-controls___QLaWH","fullscreen-button":"fullscreen-button___2nHzc","fullscreen-button1":"fullscreen-button1___1murk","pip-button":"pip-button___18qQG","playback-animation":"playback-animation___gCL6X",volume:"volume___10eUe",hidden:"hidden___2JBJW"}},"55Ip":function(rt,tt,he){"use strict";he.d(tt,"a",function(){return s});var Se=he("Ty5D"),Z=he("dI71"),U=he("cDcd"),b=he.n(U),L=he("YS25"),E=he("17x9"),A=he.n(E),w=he("wx14"),v=he("zLVn"),u=he("9R94"),h=function(y){Object(Z.a)(n,y);function n(){for(var S,T=arguments.length,R=new Array(T),D=0;D<T;D++)R[D]=arguments[D];return S=y.call.apply(y,[this].concat(R))||this,S.history=Object(L.a)(S.props),S}var x=n.prototype;return x.render=function(){return b.a.createElement(Se.c,{history:this.history,children:this.props.children})},n}(b.a.Component),a=function(y){Object(Z.a)(n,y);function n(){for(var S,T=arguments.length,R=new Array(T),D=0;D<T;D++)R[D]=arguments[D];return S=y.call.apply(y,[this].concat(R))||this,S.history=Object(L.b)(S.props),S}var x=n.prototype;return x.render=function(){return b.a.createElement(Se.c,{history:this.history,children:this.props.children})},n}(b.a.Component),t=function(n,x){return typeof n=="function"?n(x):n},i=function(n,x){return typeof n=="string"?Object(L.c)(n,null,null,x):n},l=function(n){return n},c=b.a.forwardRef;typeof c=="undefined"&&(c=l);function o(y){return!!(y.metaKey||y.altKey||y.ctrlKey||y.shiftKey)}var e=c(function(y,n){var x=y.innerRef,S=y.navigate,T=y.onClick,R=Object(v.a)(y,["innerRef","navigate","onClick"]),D=R.target,I=Object(w.a)({},R,{onClick:function(G){try{T&&T(G)}catch(k){throw G.preventDefault(),k}!G.defaultPrevented&&G.button===0&&(!D||D==="_self")&&!o(G)&&(G.preventDefault(),S())}});return l!==c?I.ref=n||x:I.ref=x,b.a.createElement("a",I)}),s=c(function(y,n){var x=y.component,S=x===void 0?e:x,T=y.replace,R=y.to,D=y.innerRef,I=Object(v.a)(y,["component","replace","to","innerRef"]);return b.a.createElement(Se.e.Consumer,null,function(B){B||Object(u.a)(!1);var G=B.history,k=i(t(R,B.location),B.location),$=k?G.createHref(k):"",X=Object(w.a)({},I,{href:$,navigate:function(){var N=t(R,B.location),z=T?G.replace:G.push;z(N)}});return l!==c?X.ref=n||D:X.innerRef=D,b.a.createElement(S,X)})});if(!1)var r,d;var f=function(n){return n},g=b.a.forwardRef;typeof g=="undefined"&&(g=f);function m(){for(var y=arguments.length,n=new Array(y),x=0;x<y;x++)n[x]=arguments[x];return n.filter(function(S){return S}).join(" ")}var p=g(function(y,n){var x=y["aria-current"],S=x===void 0?"page":x,T=y.activeClassName,R=T===void 0?"active":T,D=y.activeStyle,I=y.className,B=y.exact,G=y.isActive,k=y.location,$=y.sensitive,X=y.strict,V=y.style,N=y.to,z=y.innerRef,q=Object(v.a)(y,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return b.a.createElement(Se.e.Consumer,null,function(ee){ee||Object(u.a)(!1);var fe=k||ee.location,ae=i(t(N,fe),fe),pe=ae.pathname,se=pe&&pe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ge=se?Object(Se.f)(fe.pathname,{path:se,exact:B,sensitive:$,strict:X}):null,ie=!!(G?G(ge,fe):ge),te=ie?m(I,R):I,Q=ie?Object(w.a)({},V,{},D):V,me=Object(w.a)({"aria-current":ie&&S||null,className:te,style:Q,to:ae},q);return f!==g?me.ref=n||z:me.innerRef=z,b.a.createElement(s,me)})});if(!1)var _},"7ixt":function(rt,tt,he){"use strict";he.d(tt,"a",function(){return U});var Se={adjustX:1,adjustY:1},Z=[0,0],U={left:{points:["cr","cl"],overflow:Se,offset:[-4,0],targetOffset:Z},right:{points:["cl","cr"],overflow:Se,offset:[4,0],targetOffset:Z},top:{points:["bc","tc"],overflow:Se,offset:[0,-4],targetOffset:Z},bottom:{points:["tc","bc"],overflow:Se,offset:[0,4],targetOffset:Z},topLeft:{points:["bl","tl"],overflow:Se,offset:[0,-4],targetOffset:Z},leftTop:{points:["tr","tl"],overflow:Se,offset:[-4,0],targetOffset:Z},topRight:{points:["br","tr"],overflow:Se,offset:[0,-4],targetOffset:Z},rightTop:{points:["tl","tr"],overflow:Se,offset:[4,0],targetOffset:Z},bottomRight:{points:["tr","br"],overflow:Se,offset:[0,4],targetOffset:Z},rightBottom:{points:["bl","br"],overflow:Se,offset:[4,0],targetOffset:Z},bottomLeft:{points:["tl","bl"],overflow:Se,offset:[0,4],targetOffset:Z},leftBottom:{points:["br","bl"],overflow:Se,offset:[-4,0],targetOffset:Z}},b=U},"8hTe":function(rt,tt,he){rt.exports={button:"button___1wy9m"}},"8mKB":function(rt,tt,he){"use strict";var Se=he("rePB"),Z=he("1OyB"),U=he("vuIU"),b=he("Ji7U"),L=he("md7G"),E=he("foSv"),A=he("cDcd"),w=he.n(A),v=he("m+aA"),u=he("TSYQ"),h=he.n(u),a=he("4IlW");function t(y){var n=y.pageXOffset,x="scrollLeft";if(typeof n!="number"){var S=y.document;n=S.documentElement[x],typeof n!="number"&&(n=S.body[x])}return n}function i(y){var n,x,S=y.ownerDocument,T=S.body,R=S&&S.documentElement,D=y.getBoundingClientRect();return n=D.left,x=D.top,n-=R.clientLeft||T.clientLeft||0,x-=R.clientTop||T.clientTop||0,{left:n,top:x}}function l(y){var n=i(y),x=y.ownerDocument,S=x.defaultView||x.parentWindow;return n.left+=t(S),n.left}function c(y){var n=o();return function(){var S=Object(E.a)(y),T;if(n){var R=Object(E.a)(this).constructor;T=Reflect.construct(S,arguments,R)}else T=S.apply(this,arguments);return Object(L.a)(this,T)}}function o(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(y){return!1}}var e=function(y){Object(b.a)(x,y);var n=c(x);function x(){var S;return Object(Z.a)(this,x),S=n.apply(this,arguments),S.onHover=function(T){var R=S.props,D=R.onHover,I=R.index;D(T,I)},S.onClick=function(T){var R=S.props,D=R.onClick,I=R.index;D(T,I)},S.onKeyDown=function(T){var R=S.props,D=R.onClick,I=R.index;T.keyCode===13&&D(T,I)},S}return Object(U.a)(x,[{key:"getClassName",value:function(){var T=this.props,R=T.prefixCls,D=T.index,I=T.value,B=T.allowHalf,G=T.focused,k=D+1,$=R;return I===0&&D===0&&G?$+=" ".concat(R,"-focused"):B&&I+.5>=k&&I<k?($+=" ".concat(R,"-half ").concat(R,"-active"),G&&($+=" ".concat(R,"-focused"))):($+=k<=I?" ".concat(R,"-full"):" ".concat(R,"-zero"),k===I&&G&&($+=" ".concat(R,"-focused"))),$}},{key:"render",value:function(){var T=this.onHover,R=this.onClick,D=this.onKeyDown,I=this.props,B=I.disabled,G=I.prefixCls,k=I.character,$=I.characterRender,X=I.index,V=I.count,N=I.value,z=typeof k=="function"?k(this.props):k,q=w.a.createElement("li",{className:this.getClassName()},w.a.createElement("div",{onClick:B?null:R,onKeyDown:B?null:D,onMouseMove:B?null:T,role:"radio","aria-checked":N>X?"true":"false","aria-posinset":X+1,"aria-setsize":V,tabIndex:B?-1:0},w.a.createElement("div",{className:"".concat(G,"-first")},z),w.a.createElement("div",{className:"".concat(G,"-second")},z)));return $&&(q=$(q,this.props)),q}}]),x}(w.a.Component);function s(y,n){var x=Object.keys(y);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(y);n&&(S=S.filter(function(T){return Object.getOwnPropertyDescriptor(y,T).enumerable})),x.push.apply(x,S)}return x}function r(y){for(var n=1;n<arguments.length;n++){var x=arguments[n]!=null?arguments[n]:{};n%2?s(Object(x),!0).forEach(function(S){Object(Se.a)(y,S,x[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(x)):s(Object(x)).forEach(function(S){Object.defineProperty(y,S,Object.getOwnPropertyDescriptor(x,S))})}return y}function d(y){var n=f();return function(){var S=Object(E.a)(y),T;if(n){var R=Object(E.a)(this).constructor;T=Reflect.construct(S,arguments,R)}else T=S.apply(this,arguments);return Object(L.a)(this,T)}}function f(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(y){return!1}}function g(){}var m=function(y){Object(b.a)(x,y);var n=d(x);function x(S){var T;Object(Z.a)(this,x),T=n.call(this,S),T.onHover=function(D,I){var B=T.props.onHoverChange,G=T.getStarValue(I,D.pageX),k=T.state.cleanedValue;G!==k&&T.setState({hoverValue:G,cleanedValue:null}),B(G)},T.onMouseLeave=function(){var D=T.props.onHoverChange;T.setState({hoverValue:void 0,cleanedValue:null}),D(void 0)},T.onClick=function(D,I){var B=T.props.allowClear,G=T.state.value,k=T.getStarValue(I,D.pageX),$=!1;B&&($=k===G),T.onMouseLeave(),T.changeValue($?0:k),T.setState({cleanedValue:$?k:null})},T.onFocus=function(){var D=T.props.onFocus;T.setState({focused:!0}),D&&D()},T.onBlur=function(){var D=T.props.onBlur;T.setState({focused:!1}),D&&D()},T.onKeyDown=function(D){var I=D.keyCode,B=T.props,G=B.count,k=B.allowHalf,$=B.onKeyDown,X=B.direction,V=X==="rtl",N=T.state.value;I===a.a.RIGHT&&N<G&&!V?(k?N+=.5:N+=1,T.changeValue(N),D.preventDefault()):I===a.a.LEFT&&N>0&&!V||I===a.a.RIGHT&&N>0&&V?(k?N-=.5:N-=1,T.changeValue(N),D.preventDefault()):I===a.a.LEFT&&N<G&&V&&(k?N+=.5:N+=1,T.changeValue(N),D.preventDefault()),$&&$(D)},T.saveRef=function(D){return function(I){T.stars[D]=I}},T.saveRate=function(D){T.rate=D};var R=S.value;return R===void 0&&(R=S.defaultValue),T.stars={},T.state={value:R,focused:!1,cleanedValue:null},T}return Object(U.a)(x,[{key:"componentDidMount",value:function(){var T=this.props,R=T.autoFocus,D=T.disabled;R&&!D&&this.focus()}},{key:"getStarDOM",value:function(T){return Object(v.a)(this.stars[T])}},{key:"getStarValue",value:function(T,R){var D=this.props,I=D.allowHalf,B=D.direction,G=B==="rtl",k=T+1;if(I){var $=this.getStarDOM(T),X=l($),V=$.clientWidth;(G&&R-X>V/2||!G&&R-X<V/2)&&(k-=.5)}return k}},{key:"focus",value:function(){var T=this.props.disabled;T||this.rate.focus()}},{key:"blur",value:function(){var T=this.props.disabled;T||this.rate.blur()}},{key:"changeValue",value:function(T){var R=this.props.onChange;"value"in this.props||this.setState({value:T}),R(T)}},{key:"render",value:function(){for(var T=this.props,R=T.count,D=T.allowHalf,I=T.style,B=T.prefixCls,G=T.disabled,k=T.className,$=T.character,X=T.characterRender,V=T.tabIndex,N=T.direction,z=this.state,q=z.value,ee=z.hoverValue,fe=z.focused,ae=[],pe=G?"".concat(B,"-disabled"):"",se=0;se<R;se+=1)ae.push(w.a.createElement(e,{ref:this.saveRef(se),index:se,count:R,disabled:G,prefixCls:"".concat(B,"-star"),allowHalf:D,value:ee===void 0?q:ee,onClick:this.onClick,onHover:this.onHover,key:se,character:$,characterRender:X,focused:fe}));var ge=h()(B,pe,k,Object(Se.a)({},"".concat(B,"-rtl"),N==="rtl"));return w.a.createElement("ul",{className:ge,style:I,onMouseLeave:G?null:this.onMouseLeave,tabIndex:G?-1:V,onFocus:G?null:this.onFocus,onBlur:G?null:this.onBlur,onKeyDown:G?null:this.onKeyDown,ref:this.saveRate,role:"radiogroup"},ae)}}],[{key:"getDerivedStateFromProps",value:function(T,R){return"value"in T&&T.value!==void 0?r(r({},R),{},{value:T.value}):R}}]),x}(w.a.Component);m.defaultProps={defaultValue:0,count:5,allowHalf:!1,allowClear:!0,style:{},prefixCls:"rc-rate",onChange:g,character:"\u2605",onHoverChange:g,tabIndex:0,direction:"ltr"};var p=m,_=tt.a=p},"96GE":function(rt,tt,he){"use strict";he.r(tt),he.d(tt,"formatQuery",function(){return Me});var Se=he("T2oS"),Z=he("W9HT"),U=he("k1fw"),b=he("PpiC"),L=he("cDcd"),E=he.n(L),A=he("9kvl"),w=he("JqQi"),v=he.n(w),u=he("pC0b"),h=he("GzdX"),a=he("9og8"),t=he("tJVT"),i=he("WmNS"),l=he.n(i),c=he("nUhQ"),o=he.n(c),e=he("2qtc"),s=he("kLXV"),r=he("7Kak"),d=he("9yH6"),f=he("miYZ"),g=he("tsqr"),m=he("5NDa"),p=he("5rEg"),_=he("Ty5D"),y=he("sWEp"),n=he.n(y),x=he("qdXH"),S=p.a.Search,T=function(Ve){var et,Ge=Ve.videoDetail,He=Ve.globalSetting,Ye=Ve.loading,Je=Ve.dispatch,ot=Object(b.a)(Ve,["videoDetail","globalSetting","loading","dispatch"]),dt=Object(_.i)(),ft=Object(_.h)(),lt=Object(L.useState)([]),vt=Object(t.a)(lt,2),gt=vt[0],bt=vt[1],Et=Object(L.useState)(""),ht=Object(t.a)(Et,2),pt=ht[0],ce=ht[1],ne=Object(L.useState)(),P=Object(t.a)(ne,2),W=P[0],K=P[1],Y=Object(L.useState)(!1),le=Object(t.a)(Y,2),Ae=le[0],Ce=le[1],Fe=Object(L.useState)(!1),We=Object(t.a)(Fe,2),je=We[0],Qe=We[1];Object(L.useEffect)(function(){Ge.actionTabs.key==="Banner-SendToClass"&&qe()},[Ge.actionTabs.key]);var qe=function(){var Xe=Object(a.a)(l.a.mark(function Be(){var it,ct;return l.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return ut.next=2,Object(x.h)({});case 2:if(ct=ut.sent,!(ct!=null&&(it=ct.courses)!==null&&it!==void 0&&it.length)){ut.next=8;break}bt((ct==null?void 0:ct.courses)||[]),Qe(!0),ut.next=11;break;case 8:return Ze(),g.b.info("\u60A8\u5F53\u524D\u6CA1\u6709\u7BA1\u7406\u4EFB\u4F55\u8BFE\u5802\uFF0C\u4E0D\u53EF\u53D1\u9001"),ut.abrupt("return");case 11:case"end":return ut.stop()}},Be)}));return function(){return Xe.apply(this,arguments)}}(),Ne=function(Be){bt(gt==null?void 0:gt.map(function(it){return Object(U.a)(Object(U.a)({},it),{},{hide:!it.course_name.includes(Be)})}))},$e=function(){var Xe=Object(a.a)(l.a.mark(function Be(){var it;return l.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:if(W){at.next=3;break}return Ce(!0),at.abrupt("return");case 3:return at.next=5,Object(x.m)({id:dt.videoId,course_id:W});case 5:it=at.sent,(it==null?void 0:it.status)===0&&(g.b.success("\u53D1\u9001\u6210\u529F"),Ze(),A.d===null||A.d===void 0||A.d.replace("/classrooms/".concat(W,"/shixun_homework")));case 7:case"end":return at.stop()}},Be)}));return function(){return Xe.apply(this,arguments)}}(),Ze=function(){ce(""),K(null),Ce(!1),Je({type:"videoDetail/setActionTabs",payload:{}}),Qe(!1)};return E.a.createElement(s.a,{centered:!0,keyboard:!1,closable:!1,title:"\u53D1\u9001\u81F3\u8BFE\u5802",visible:je,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:$e,onCancel:Ze},E.a.createElement("div",{className:n.a.wrap},E.a.createElement("div",{className:"mb10"},E.a.createElement(S,{placeholder:"\u8F93\u5165\u8BFE\u5802\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",value:pt,onChange:function(Be){return ce(Be.target.value)},onSearch:function(Be){ce(Be),Ne(Be)}})),E.a.createElement("div",{className:n.a.radioWrap},E.a.createElement(d.a.Group,{value:W,onChange:function(Be){K(Be.target.value),Ce(!1)}},gt==null||((et=gt.filter(function(Xe){return!(Xe!=null&&Xe.hide)}))===null||et===void 0)?void 0:et.map(function(Xe,Be){return E.a.createElement(d.a,{className:n.a.radio,value:Xe.course_id,key:Be},Xe.course_name)}))),Ae&&E.a.createElement("div",{className:n.a.colorFF0000},"\u8BF7\u9009\u62E9\u4F60\u8981\u53D1\u9001\u7684\u8BFE\u5802"),E.a.createElement("div",{className:n.a.title},"\u6E29\u99A8\u63D0\u793A\uFF1A\u5F53\u524D\u89C6\u9891\u9879\u76EE\u5C06\u4F1A\u53D1\u9001\u5230\u6307\u5B9A\u8BFE\u5802")))},R=Object(A.a)(function(nt){var Ve=nt.videoDetail,et=nt.loading,Ge=nt.globalSetting;return{videoDetail:Ve,globalSetting:Ge,loading:et.models.index}})(T),D=he("sBCT"),I=he("Mgx3"),B=he("1vsH"),G=he("NLgs"),k=he("Awhp"),$=he("KrTs"),X=he("+L6B"),V=he("2/Rp"),N=he("O3gP"),z=he("lrIw"),q=he("oBTY"),ee=he("eoI0"),fe=he.n(ee),ae=he("HBuW"),pe=function(Ve){var et,Ge,He=Ve.videoDetail,Ye=Ve.dispatch,Je=Ye===void 0?function(){}:Ye,ot=Ve.visible,dt=Ve.onClose,ft=dt===void 0?function(){}:dt,lt=He.queryParams,vt=He.queryParams,gt=vt.subject_id,bt=vt.videoId,Et={videoId:bt},ht=Object(L.useState)(0),pt=Object(t.a)(ht,2),ce=pt[0],ne=pt[1],P=Object(L.useState)(""),W=Object(t.a)(P,2),K=W[0],Y=W[1],le=Object(L.useState)([]),Ae=Object(t.a)(le,2),Ce=Ae[0],Fe=Ae[1],We=Object(L.useState)([]),je=Object(t.a)(We,2),Qe=je[0],qe=je[1];Object(L.useEffect)(function(){var Be,it,ct=((Be=He.detail)===null||Be===void 0||((it=Be.video_item)===null||it===void 0)?void 0:it.schools)||[];ne(ct!=null&&ct.length?1:0),qe(ct)},[(et=He.detail)===null||et===void 0||((Ge=et.video_item)===null||Ge===void 0)?void 0:Ge.schools]);var Ne=function(){var Be=Object(a.a)(l.a.mark(function it(ct){var at;return l.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,Object(ae.P)({q:ct});case 2:at=yt.sent,at&&Fe(at.shools_name||[]);case 4:case"end":return yt.stop()}},it)}));return function(ct){return Be.apply(this,arguments)}}(),$e=function(it){if(Qe.includes(it)){g.b.info("\u8BF7\u52FF\u6307\u5B9A\u76F8\u540C\u7684\u5355\u4F4D");return}Y(""),qe([].concat(Object(q.a)(Qe),[it]))},Ze=function(){var Be=Object(a.a)(l.a.mark(function it(){var ct;return l.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:if(!(ce===1&&!(Qe!=null&&Qe.length))){ut.next=2;break}return ut.abrupt("return",g.b.info("\u8BF7\u9009\u62E9\u6307\u5B9A\u5355\u4F4D\u516C\u5F00"));case 2:return ut.next=4,Object(x.a)(Object(U.a)(Object(U.a)({},lt),{},{id:Et.videoId,schools:ce===0?[]:Qe,is_public:!(ce===2)}));case 4:ct=ut.sent,(ct==null?void 0:ct.status)===0&&(g.b.success("\u8BBE\u7F6E\u6210\u529F"),Xe());case 6:case"end":return ut.stop()}},it)}));return function(){return Be.apply(this,arguments)}}(),Xe=function(){ft(),Je({type:"videoDetail/getVideoDetail",payload:Object(U.a)(Object(U.a)({},lt),{},{id:Et.videoId})})};return E.a.createElement(s.a,{centered:!0,maskClosable:!1,title:"\u6743\u9650\u8BBE\u7F6E",width:530,className:fe.a.modal,visible:ot,onOk:Ze,onCancel:Xe},E.a.createElement(E.a.Fragment,null,E.a.createElement(d.a.Group,{value:ce,onChange:function(it){return ne(it.target.value)}},E.a.createElement(d.a,{value:0},"\u5BF9\u6240\u6709\u5355\u4F4D\u516C\u5F00",E.a.createElement("span",null,"\uFF08\u9009\u4E2D\u540E\uFF0C\u5BF9\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),E.a.createElement(d.a,{value:1},"\u5BF9\u6307\u5B9A\u5355\u4F4D\u516C\u5F00",E.a.createElement("span",null,"\uFF08\u9009\u4E2D\u540E\uFF0C\u4EC5\u5BF9\u4E0B\u65B9\u6307\u5B9A\u5355\u4F4D\u7528\u6237\u53EF\u89C1\uFF09")),E.a.createElement(d.a,{value:2},"\u4E0D\u516C\u5F00",E.a.createElement("span",null,"\uFF08\u9009\u4E2D\u540E\uFF0C\u5BF9\u6240\u6709\u7528\u6237\u4E0D\u53EF\u89C1\uFF09"))),ce===1&&E.a.createElement(E.a.Fragment,null,E.a.createElement("div",{className:"mt10"},E.a.createElement(z.a,{showSearch:!0,className:fe.a.selectSchool,placeholder:"\u8BF7\u8F93\u5165\u5E76\u9009\u62E9\u5355\u4F4D\u540D\u79F0",value:K,onChange:function(it){Y(it),Ne(it)},onSelect:$e,options:Ce==null?void 0:Ce.map(function(Be){return{value:Be}})})),E.a.createElement("div",{className:"mt10"},Qe==null?void 0:Qe.map(function(Be,it){return E.a.createElement($.a,{count:E.a.createElement("span",{className:fe.a.delete,onClick:function(){return qe(Qe.filter(function(at){return at!==Be}))}},"x"),className:"mt10 mr20 current",key:it},E.a.createElement(V.a,{type:"primary",ghost:!0},Be))})))))},se=pe,ge=function(Ve){var et=Ve.user,Ge=Ve.videoDetail,He=Ve.dispatch,Ye=Ge.queryParams,Je=Ge.queryParams,ot=Je.subject_id,dt=Je.videoId,ft={videoId:dt},lt=Object(L.useState)(),vt=Object(t.a)(lt,2),gt=vt[0],bt=vt[1],Et=Object(L.useState)(),ht=Object(t.a)(Et,2),pt=ht[0],ce=ht[1],ne=Object(L.useState)(!1),P=Object(t.a)(ne,2),W=P[0],K=P[1],Y=Ge.detail||{},le=Y.video_item,Ae=Ge||{},Ce=Ae.stages,Fe=function(){He({type:"videoDetail/setActionTabs",payload:{key:"Banner-SendToClass"}})},We=function(){var Qe=Object(a.a)(l.a.mark(function qe(){var Ne,$e,Ze,Xe,Be,it;return l.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:if(!((Ne=et.userInfo)!==null&&Ne!==void 0&&Ne.admin||($e=et.userInfo)!==null&&$e!==void 0&&$e.is_teacher&&Object(G.d)())){at.next=9;break}return Xe=[],Ce.map(function(ut){ut.items.map(function(yt){Xe.push(yt)})}),Be=Xe.filter(function(ut){return ut.id===le.id}),at.next=6,Object(x.g)(Object(U.a)({id:Be==null||((Ze=Be[0])===null||Ze===void 0)?void 0:Ze.stage_item_id},Ye));case 6:it=at.sent,ce(it),bt(!0);case 9:case"end":return at.stop()}},qe)}));return function(){return Qe.apply(this,arguments)}}(),je=function(){var Qe=Object(a.a)(l.a.mark(function qe(Ne){var $e,Ze,Xe;return l.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:return it.next=2,Object(I.S)(Object(U.a)(Object(U.a)({id:pt==null?void 0:pt.id},Ne),{},{video_id:(Ne==null?void 0:Ne.video_id)||(pt==null||(($e=pt.video_item)===null||$e===void 0)?void 0:$e.video_id),link:(Ne==null?void 0:Ne.link)||(pt==null||((Ze=pt.video_item)===null||Ze===void 0)?void 0:Ze.link)}));case 2:return Xe=it.sent,Xe&&(bt(!1),He({type:"videoDetail/getVideoDetail",payload:Object(U.a)({id:ft.videoId},Ye)})),it.abrupt("return",Xe);case 5:case"end":return it.stop()}},qe)}));return function(Ne){return Qe.apply(this,arguments)}}();return E.a.createElement("aside",{className:o.a.banner},E.a.createElement("aside",{className:o.a.wrap},E.a.createElement("p",{className:o.a.title},le==null?void 0:le.name),E.a.createElement("div",{className:o.a.contentWrap},E.a.createElement("span",{className:"font14 c-white"},E.a.createElement("span",{className:"mr10"},"\u5B66\u4E60\u4EBA\u6570\uFF1A"),E.a.createElement("span",null,(le==null?void 0:le.study_video_items_count)||0),E.a.createElement("span",{className:"ml100 mr10"},"\u5B66\u5458\u8BC4\u5206\uFF1A"),E.a.createElement(h.a,{allowHalf:!0,value:Object(B.D)(le==null?void 0:le.star),disabled:!0,className:o.a.rating})))),E.a.createElement(R,null),E.a.createElement(D.a,{editData:pt,visible:gt,onCancel:function(){return bt(!1)},onOk:je,queryParams:Ye}),E.a.createElement(se,{dispatch:He,videoDetail:Ge,visible:W,onClose:function(){return K(!1)}}))},ie=Object(A.a)(function(nt){var Ve=nt.user,et=nt.videoDetail;return{user:Ve,videoDetail:et}})(ge),te=he("R9oj"),Q=he("ECub"),me=he("sRBo"),re=he("kaz8"),J=he("J66h"),be=he("hgre"),Ee=he("9Bee"),Le=he("vZDz"),H=he.n(Le),C=he("9VGf"),O=function(Ve){var et=Ve.videoDetail,Ge=Ve.globalSetting,He=Ve.loading,Ye=Ve.dispatch,Je=Object(b.a)(Ve,["videoDetail","globalSetting","loading","dispatch"]),ot=et.queryParams,dt=et.selectParams,ft=et.videoList,lt=ot.subject_id,vt=ot.videoId,gt=dt.checkBoxValue,bt=dt.radioValue,Et={videoId:vt},ht={query:ot},pt=Object(L.useRef)(),ce=Object(L.useRef)(),ne=Object(L.useRef)(),P=Object(L.useRef)(5),W=et.detail||{},K=W.video_item;Object(C.a)(Object(a.a)(l.a.mark(function qe(){return l.a.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:if(!ce.current){$e.next=5;break}return console.log("videoRef lastUpdatedTime: ",pt.current.getLastUpdatedTime()),console.log(pt.current),$e.next=5,Y();case 5:case"end":return $e.stop()}},qe)})),P.current*1e3);var Y=function(){var Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,$e=Ne?{is_f:1}:{};return Object(x.n)(Object(U.a)(Object(U.a)({},$e),{id:Et.videoId,point:pt.current.getLastUpdatedTime(),total:pt.current.getDuration()}))},le=function(Ne){return Ne.ed==="1"&&(ce.current=!1,Y(!0)),!ce.current&&!Ne.ed&&(ce.current=!0,P.current=pt.current.getDuration()<=5?1:5,Y()),Ye({type:"userDetail/logWatchHistory",payload:Ne})},Ae=function(){ce.current=!1},Ce=function(){ce.current=!0},Fe=function(){ne.current=5,s.a.confirm({width:600,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BF7\u7ED9\u672C\u89C6\u9891\u8BC4\u5206",content:E.a.createElement("div",{className:"tc font14"},E.a.createElement(h.a,{defaultValue:ne.current,onChange:function($e){return ne.current=$e},className:H.a.modalRating})),onOk:function(){var Ne=Object(a.a)(l.a.mark(function Ze(){var Xe,Be,it;return l.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:return at.next=2,Object(x.l)({id:Et.videoId,star:ne.current});case 2:Xe=at.sent,Xe.status===0&&(Be=Object(B.J)(),it=Be.course_id,Ye({type:"videoDetail/getVideoDetail",payload:{id:Et.videoId,videoId:Et.videoId,course_id:it}}));case 4:case"end":return at.stop()}},Ze)}));function $e(){return Ne.apply(this,arguments)}return $e}()})},We=function(Ne){var $e=window.filterVideoSign,Ze=$e.findIndex(function(ut){return ut.id===vt}),Xe=Ze===$e.length-1;if(Xe)return;var Be=$e[Ze+1].id,it=$e[Ze+1].can_view,ct=$e[Ze+1].link,at=$e[Ze+1].is_public;if(window.checkBoxValue){if(ct){window.open(ct);return}if(!it){s.a.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:E.a.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}if(!at){s.a.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:E.a.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}Ye({type:"videoDetail/handleListItemClick",payload:{videoId:Be}}),window.videoTimer=setTimeout(function(){Ne.current.play()},2e3)}},je=function(Ne,$e){if(Ne==="checkBox"){var Ze=$e.target.checked;window.checkBoxValue=Ze,Ye({type:"videoDetail/setSelectValue",payload:{radioValue:bt,checkBoxValue:Ze}});return}Ye({type:"videoDetail/setSelectValue",payload:{checkBoxValue:gt,radioValue:$e.target.value}})},Qe=function(){var Ne=ft.findIndex(function(Ze){return Ze.id===vt}),$e=Ne===ft.length-1;return $e?E.a.createElement("div",null,"\u5F53\u524D\u5DF2\u662F\u6700\u540E\u4E00\u4E2A\u89C6\u9891"):E.a.createElement(re.a,{onChange:function(Xe){je("checkBox",Xe)},checked:gt},"\u81EA\u52A8\u64AD\u653E\u4E0B\u4E00\u4E2A\u89C6\u9891")};return E.a.createElement("aside",{className:H.a.contentWrap},E.a.createElement("aside",{className:H.a.wrap},E.a.createElement("header",null,(K==null?void 0:K.description)&&E.a.createElement("span",{className:H.a.introName},"\u7B80\u4ECB"),Object(B.R)(K==null?void 0:K.my_star)?E.a.createElement(V.a,{type:"primary",ghost:!0,onClick:Fe},"\u8BC4\u5206"):E.a.createElement("span",null,E.a.createElement("span",{className:"ml100 mr10 font14"},"\u6211\u7684\u8BC4\u5206\uFF1A"),E.a.createElement(h.a,{value:K==null?void 0:K.my_star,disabled:!0,className:H.a.rating}))),E.a.createElement("div",{className:"mt20"},E.a.createElement(Ee.a,{value:(K==null?void 0:K.description)||""})),!(K!=null&&K.can_edit)&&!(K!=null&&K.is_public)?E.a.createElement(Q.a,{description:"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85"}):E.a.createElement(be.a,{ref:pt,startTime:K==null?void 0:K.last_point,src:K!=null&&K.is_link?K==null?void 0:K.link:(K==null?void 0:K.play_url)&&J.Base64.decode(K==null?void 0:K.play_url),videoId:K==null?void 0:K.video_id,logWatchHistory:le,handlePause:Ae,handlePlay:Ce,videoSpeed:bt,handlePlayEnded:We,toLog:function(){}}),!(K!=null&&K.can_edit)&&!(K!=null&&K.is_public)?null:E.a.createElement("div",{className:H.a.footer},E.a.createElement("div",{className:H.a.checkBox},Qe()),E.a.createElement("div",{className:H.a.radioGroup},E.a.createElement(d.a.Group,{onChange:function(Ne){je("radio",Ne)},value:bt},E.a.createElement(d.a,{value:1},"1.0X"),E.a.createElement(d.a,{value:1.5},"1.5X"),E.a.createElement(d.a,{value:2},"2.0X"))))))},j=Object(A.a)(function(nt){var Ve=nt.videoDetail,et=nt.loading,Ge=nt.globalSetting;return{videoDetail:Ve,globalSetting:Ge,loading:et}})(O),M=he("MRWH"),F=he.n(M),oe=he("V0Rq"),ve=he("m3rI"),ke=[{name:"\u5B9E\u8DF5\u9879\u76EE",type:"Shixun",icon:E.a.createElement("i",{className:"iconfont icon-shixun2 font20"})},{name:"\u89C6\u9891\u9879\u76EE",type:"VideoItem",icon:E.a.createElement("i",{className:"iconfont icon-shipin font20"})},{name:"\u6559\u5B66\u8BFE\u4EF6",type:"Attachment",icon:E.a.createElement("i",{className:"iconfont icon-jiaoxueanli font20"})},{name:"\u7A7A\u76EE\u5F55",type:"StageCatalog",icon:E.a.createElement("i",{className:"iconfont icon-kongbai font20"})}],Oe=function(Ve){var et=Ve.dispatch,Ge=Ve.videoDetail,He=Ve.user,Ye=Object(b.a)(Ve,["dispatch","videoDetail","user"]),Je=Ge.queryParams,ot=Ge.stages,dt=Ge.cust_seq,ft=Ge.active,lt=Je.subject_id,vt=Je.course_id;Object(L.useEffect)(function(){et(lt?{type:"videoDetail/getStageData",payload:{subject_id:lt}}:{type:"videoDetail/getCourseStageData",payload:{coursesId:vt}})},[]);var gt=function(){var P=Object(a.a)(l.a.mark(function W(K,Y){var le;return l.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:if(et({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF0C\u8BF7\u7A0D\u540E..."}}),!Y){Ce.next=7;break}return Ce.next=4,Object(ae.D)({id:K});case 4:Ce.t0=Ce.sent,Ce.next=10;break;case 7:return Ce.next=9,Object(ae.E)({id:K});case 9:Ce.t0=Ce.sent;case 10:if(le=Ce.t0,et({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),!(le!=null&&le.game_identifier||le!=null&&le.identifier)){Ce.next=15;break}return Object(B.U)(Y?"/tasks/".concat(le==null?void 0:le.identifier,"/jupyter"):"/tasks/".concat(le.game_identifier)),Ce.abrupt("return");case 15:(le==null?void 0:le.status)===2?Et(le==null?void 0:le.message):(le==null?void 0:le.status)===3&&bt(le==null?void 0:le.message);case 16:case"end":return Ce.stop()}},W)}));return function(K,Y){return P.apply(this,arguments)}}(),bt=function(W){s.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:E.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",W,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Et=function P(W){var K;W=(K=W)!==null&&K!==void 0&&K.includes(".json")?W:"".concat(W,".json"),s.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:E.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var Y=Object(a.a)(l.a.mark(function Ae(){var Ce,Fe;return l.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return je.next=2,Object(oe.T)({url:W});case 2:if(Ce=je.sent,Ce){je.next=5;break}return je.abrupt("return");case 5:return g.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),je.next=8,Object(ae.E)({id:Ce.shixun_identifier});case 8:if(Fe=je.sent,!(Fe!=null&&Fe.game_identifier)){je.next=12;break}return Object(B.U)("/tasks/".concat(Fe.game_identifier)),je.abrupt("return");case 12:(Fe==null?void 0:Fe.status)===2?P(Fe==null?void 0:Fe.message):(Fe==null?void 0:Fe.status)===3&&bt(Fe==null?void 0:Fe.message);case 13:case"end":return je.stop()}},Ae)}));function le(){return Y.apply(this,arguments)}return le}()})},ht=function(W){if((W==null?void 0:W.item_type)==="StageCatalog")return;clearTimeout(window.videoTimer);var K=W.id,Y=W.item_type,le=W.identifier,Ae=W.is_jupyter,Ce=W.url,Fe=W.link;if(Y==="VideoItem"&&!Fe){var We,je;if(!((We=He.userInfo)!==null&&We!==void 0&&We.admin)&&!((je=He.userInfo)!==null&&je!==void 0&&je.business)&&!W.can_view){s.a.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:E.a.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}et({type:"videoDetail/handleListItemClick",payload:{videoId:K}}),et({type:"videoDetail/getVideoDetail",payload:Object(U.a)(Object(U.a)({id:K},Je),{},{videoId:K}),callback:function(qe){if(qe&&qe.video_item&&!qe.video_item.can_edit&&!W.is_public){s.a.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:E.a.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}}});return}if(Y==="VideoItem"&&!!Fe){W.link&&Object(x.n)({is_f:1,id:W.id,point:0,total:0}),window.open(Fe);return}if(Y==="Shixun"){gt(le,Ae);return}if(Y==="Attachment"){Object(B.v)(W.name,ve.a.API_SERVER+W.url);return}window.open(ve.a.IMG_SERVER+Ce)},pt=function(W){var K=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],Y=["","\u5341","\u767E","\u5343","\u4E07"];W=parseInt(W);var le=function(We){for(var je=We.toString().split("").reverse(),Qe="",qe=0;qe<je.length;qe++)Qe=(qe==0&&je[qe]==0||qe>0&&je[qe]==0&&je[qe-1]==0?"":K[je[qe]]+(je[qe]==0?Y[0]:Y[qe]))+Qe;return Qe},Ae=Math.floor(W/1e4),Ce=W%1e4;return Ce.toString().length<4&&(Ce="0"+Ce),Ae?le(Ae)+"\u4E07"+le(Ce):le(W)},ce=function(W,K,Y,le){var Ae,Ce=W.name,Fe=W.item_type,We=W.id,je="".concat(K+1,"-").concat(Y+1,"-").concat(le+1),Qe=(Ae=ke.find(function($e){return $e.type===Fe}))===null||Ae===void 0?void 0:Ae.icon,qe=F.a.brght,Ne=ft.id===We?"".concat(qe," ").concat(F.a.active):qe;return E.a.createElement("div",{key:je,onClick:function(){return ht(W)},className:Ne,style:{paddingLeft:52}},E.a.createElement("span",{className:F.a.s1},Qe),!!dt&&E.a.createElement("span",{className:F.a.s2},je),E.a.createElement("span",{className:F.a.s3},"\u203B ",Ce))},ne=function(W,K,Y){var le,Ae=W.name,Ce=W.item_type,Fe=W.id,We=W.children,je="".concat(K+1,"-").concat(Y+1),Qe=(le=ke.find(function($e){return $e.type===Ce}))===null||le===void 0?void 0:le.icon,qe=F.a.brght,Ne=ft.id===Fe?"".concat(qe," ").concat(F.a.active):qe;return E.a.createElement(L.Fragment,{key:je},E.a.createElement("div",{onClick:function(){return ht(W)},className:Ne},E.a.createElement("span",{className:F.a.s1},Qe),!!dt&&E.a.createElement("span",{className:F.a.s2},je),E.a.createElement("span",{className:F.a.s3},"\u203B ",Ae)),!!We.length&&We.map(function($e,Ze){return ce($e,K,Y,Ze)}))};return E.a.createElement("aside",{className:F.a.list},ot.map(function(P,W){var K=P.stage_name,Y=P.items,le=Y===void 0?[]:Y;return E.a.createElement("aside",{key:W,className:F.a.box},E.a.createElement("div",{className:F.a.title},pt(W+1),"\u3001",K),le.map(function(Ae,Ce){return ne(Ae,W,Ce)}),W!==ot.length-1&&E.a.createElement("div",{className:F.a.line}))}))},De=Object(A.a)(function(nt){var Ve=nt.user,et=nt.videoDetail,Ge=nt.loading,He=nt.globalSetting;return{user:Ve,videoDetail:et,globalSetting:He,loading:Ge}})(Oe),Ue=he("lppi"),Ke=he.n(Ue),Pe=he("fWQN"),Re=function nt(){var Ve=this;Object(Pe.a)(this,nt),this.conversion_getDPI=function(){var et=new Array;if(window.screen.deviceXDPI)et[0]=window.screen.deviceXDPI,et[1]=window.screen.deviceXDPI;else{var Ge=document.createElement("DIV");Ge.style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(Ge),et[0]=parseInt(String(Ge.offsetWidth)),et[1]=parseInt(String(Ge.offsetHeight)),Ge.parentNode.removeChild(Ge)}return et},this.pxConversionMm=function(et){var Ge=et/Ve.conversion_getDPI()[0],He=Ge*25.4;return He},this.mmConversionPx=function(et){var Ge=et/25.4,He=Ge*Ve.conversion_getDPI()[0];return He}},xe=new Re,we=xe.mmConversionPx(297),Te=function(Ve){var et=Ve.url,Ge=Object(L.useState)(""),He=Object(t.a)(Ge,2),Ye=He[0],Je=He[1],ot=Object(L.useState)(!0),dt=Object(t.a)(ot,2),ft=dt[0],lt=dt[1];return Object(L.useEffect)(function(){var vt="".concat(ve.a.API_SERVER).concat(et);Ye!==vt&&(lt(!1),setTimeout(function(){lt(!0)},500)),Je(vt)},[et]),Ye?E.a.createElement("div",{className:Ke.a.pdfContainer},E.a.createElement("div",{className:Ke.a.loading},E.a.createElement(Z.a,{tip:"\u6B63\u5728\u52A0\u8F7D"})),ft&&E.a.createElement("embed",{src:Ye,height:we,width:"100%"})):E.a.createElement(E.a.Fragment,null)},ue=Te,de=he("b57q"),_e=he.n(de),ye=function(Ve){var et=Ve.url,Ge=Object(B.V)(et).filesize,He=1024*1024,Ye=10*He;return E.a.createElement("div",{className:_e.a.officeContainer},Ge>Ye&&E.a.createElement("div",{className:"tc mt100 font16"},"\u5F53\u524D\u6587\u4EF6(",parseInt(Ge/He),"MB)\uFF0C\u5DF2\u8D85\u51FA\u6700\u5927\u9650\u5236\uFF0C\u8BF7\u4E0B\u8F7D\u540E\u9884\u89C8\uFF01",E.a.createElement("br",null),E.a.createElement(V.a,{type:"primary",className:"mt20"},E.a.createElement("a",{href:"".concat(ve.a.IMG_SERVER).concat(et)},"\u70B9\u51FB\u4E0B\u8F7D"))),Ge<=Ye&&E.a.createElement("iframe",{frameBorder:0,width:"100%",height,src:"https://view.officeapps.live.com/op/view.aspx?src=".concat(encodeURIComponent("".concat(ve.a.IMG_SERVER).concat(et,"?disposition=inline")))}))},Ie=ye,Me=function(Ve){var et=Ve.subject_id;return{subject_id:et,course_id:et}},ze=function(Ve){var et=Ve.videoDetail,Ge=Ve.globalSetting,He=Ve.loading,Ye=Ve.dispatch,Je=Object(b.a)(Ve,["videoDetail","globalSetting","loading","dispatch"]),ot=et.queryParams,dt=et.videoList,ft=et.attachmentList,lt=et.active,vt=ot.subject_id,gt=ot.videoId,bt={videoId:gt};Object(L.useEffect)(function(){if(lt){var ht=lt.item_type,pt=lt.id;ht==="VideoItem"&&Ye({type:"videoDetail/getVideoDetail",payload:Object(U.a)(Object(U.a)({},ot),{},{id:pt})})}},[lt.id]),Object(L.useEffect)(function(){var ht,pt;Object(B.Z)((ht=et.detail)===null||ht===void 0||((pt=ht.video_item)===null||pt===void 0)?void 0:pt.name)},[et]);var Et={width:1200};return lt&&lt.item_type==="Attachment"&&lt.content_type==="application/pdf"&&(Et={width:1250,marginLeft:(document.body.clientWidth-1200)/2}),console.log("active:",lt),E.a.createElement(Z.a,{spinning:!1},E.a.createElement("section",{className:v.a.bg},E.a.createElement(ie,null),E.a.createElement("div",{className:v.a.container,style:Et},E.a.createElement(De,null),lt&&lt.item_type==="VideoItem"&&E.a.createElement(j,null),lt&&lt.item_type==="Attachment"&&lt.content_type==="application/pdf"&&lt.url&&E.a.createElement(ue,{url:lt.url}),lt&&lt.item_type==="Attachment"&&["application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(lt.content_type)&&lt.url&&E.a.createElement(Ie,{url:lt.url,name:lt.name}))))},st=tt.default=Object(A.a)(function(nt){var Ve=nt.videoDetail,et=nt.loading,Ge=nt.globalSetting;return{videoDetail:Ve,globalSetting:Ge,loading:et}})(ze)},"9Bee":function(rt,tt,he){"use strict";var Se=he("DYRE"),Z=he("zeV3"),U=he("+L6B"),b=he("2/Rp"),L=he("k1fw"),E=he("tJVT"),A=he("cDcd"),w=he.n(A),v=he("vg9a"),u=he("DlQD"),h=he.n(u),a=he("rUJ1");function t(fe,ae){var pe=fe.match(/^(\s+)(?:```)/);if(pe===null)return ae;var se=pe[1];return ae.split(`
`).map(function(ge){var ie=ge.match(/^\s+/);if(ie===null)return ge;var te=Object(E.a)(ie,1),Q=te[0];return Q.length>=se.length?ge.slice(se.length):ge}).join(`
`)}var i=[],l=["<ul>"],c=new h.a.Renderer,o=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function e(){i.length=0,l=["<ul>"]}var s={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function r(fe,ae,pe,se){if(ae>=fe.length||fe[ae].level<=pe)return ae;var ge=fe[ae];se.push("<li><a href='#"+ge.anchor+"'>"+ge.text+"</a>"),ae++;var ie=[];return ae=r(fe,ae,ge.level,ie),ie.length>0&&(se.push("<ul>"),ie.forEach(function(te){se.push(te)}),se.push("</ul>")),se.push("</li>"),ae=r(fe,ae,pe,se),ae}function d(){return r(i,0,0,l),l.push("</ul>"),l.join("")}var f={heading:function(ae){var pe=o.exec(ae);if(pe)return{type:"heading",raw:pe[0],depth:pe[1].length,text:pe[2]}},fences:function(ae){var pe=this.rules.block.fences.exec(ae);if(pe){var se=pe[0],ge=t(se,pe[3]||""),ie=pe[2]?pe[2].trim():pe[2];if(["latex","katex","math"].indexOf(ie)>=0){var te=p(),Q=ge;ge=te,_[te]={type:"block",expression:Q}}return{type:"code",raw:se,lang:ie,text:ge}}}},g=/(?:\${2})([^\n`]+?)(?:\${2})/gi,m=0,p=function(){return"__special_katext_id_".concat(m++,"__")},_={};function y(){return _}function n(){m=0,_={}}function x(fe){return fe=fe.replace(g,function(ae,pe){var se=p();return _[se]={type:"inline",expression:pe},se}),fe}var S=c.listitem;c.listitem=function(fe){return S(x(fe))};var T=c.paragraph;c.paragraph=function(fe){return T(x(fe))};var R=c.tablecell;c.tablecell=function(fe,ae){return R(x(fe),ae)},c.code=function(fe,ae,pe){var se=(ae||"").match(/\S*/)[0];return se?["latex","katex","math"].indexOf(se)>=0?"<p class='editormd-tex'>".concat(fe,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ae,'">').concat(pe?fe:Object(a.escape)(fe,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(pe?fe:Object(a.escape)(fe,!0))+"</code></pre>"},c.heading=function(fe,ae,pe){var se=this.options.headerPrefix+pe.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:se,level:ae,text:fe}),"<h"+ae+' id="'+se+'">'+fe+"</h"+ae+">"},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:f,renderer:c});var D=h.a,I=he("SJMd"),B=he("ulZh"),G=he.n(B),k=he("m3rI"),$=he("Oy/b"),X=he("p5ED"),V=he("8hTe"),N=he.n(V),z=/<pre[^>]*>/g;function q(fe){var ae=document.createElement("div");return ae.innerHTML=fe,ae.childNodes.length===0?"":ae.childNodes[0].nodeValue}var ee=tt.a=function(fe){var ae=fe.value,pe=ae===void 0?"":ae,se=fe.edit,ge=se===void 0?!1:se,ie=fe.className,te=fe.showTextOnly,Q=fe.showLines,me=fe.replaces,re=fe.zoomImg,J=fe.hasMask,be=fe.style,Ee=be===void 0?{}:be,Le=fe.stylesPrev,H=Le===void 0?{}:Le,C=String(pe),O=Object(A.useRef)(),j=Object(A.useRef)(),M=Object(A.useState)(""),F=Object(E.a)(M,2),oe=F[0],ve=F[1],ke=Object(A.useState)("office"),Oe=Object(E.a)(ke,2),De=Oe[0],Ue=Oe[1],Ke=Object(A.useMemo)(function(){try{var Te=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,ue=/\"\/api\/attachments\/|\"\/attachments\/download\//g,de=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;C=C.replace(Te,"("+k.a.API_SERVER+"/api/attachments/").replace(ue,'"'+k.a.API_SERVER+"/api/attachments/").replace(de,'"'+k.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(Me){}var _e=D(C),ye=y();if(C.match(/\[TOC\]/)&&(_e=_e.replace("<p>[TOC]</p>",d()),e()),_e=_e.replace(/(__special_katext_id_\d+__)/g,function(Me,ze){var st=ye[ze],nt=st.type,Ve=st.expression;return Object($.renderToString)(q(Ve)||"",{displayMode:nt==="block",throwOnError:!1,output:"html"})}),_e=_e.replace(/▁/g,"\u2581\u2581\u2581"),n(),te){var Ie=document.createElement("div");return Ie.innerHTML=_e,Ie.innerText}return setTimeout(function(){return xe()},500),_e},[C]),Pe=Object(A.useRef)();s.WebkitLineClamp=Q,Q&&(Ee=Object(L.a)(Object(L.a)({},Ee),s));function Re(Te){var ue=Te.target;if(ue.tagName.toUpperCase()==="IMG"){if(re){var de=ue.getAttribute("src");ve(de),Ue("image")}}else if(ue.tagName.toUpperCase()==="A"){var _e=ue.getAttribute("href");if(_e.indexOf("office")>-1)Te.preventDefault(),ve(_e),Ue("office");else if(_e.indexOf("application/pdf")>-1)Te.preventDefault(),ve(_e),Ue("pdf");else if(_e.indexOf("text/html")>-1)Te.preventDefault(),ve(_e),Ue("html");else if(_e.startsWith("#")){Te.preventDefault();var ye=document.getElementById(_e.replace("#",""));ye&&ye.scrollIntoView(!0)}}}var xe=function(){var ue,de=(ue=Pe.current)===null||ue===void 0?void 0:ue.querySelectorAll("video");de==null||de.forEach(function(_e){if(_e.oncontextmenu=function(){return!1},_e.src.indexOf(".m3u8")>-1&&!_e.canPlayType("application/vnd.apple.mpegurl")){if(G.a.isSupported()){var ye=new G.a;ye.loadSource(_e.src),ye.attachMedia(_e)}}})};Object(A.useEffect)(function(){if(Pe.current&&Ke&&(Ke.match(z)&&window.PR.prettyPrint()),Pe.current)return Pe.current.addEventListener("click",Re),function(){Pe.current.removeEventListener("click",Re),n(),e()}},[Ke,Pe.current,Re]);var we=function(ue){if(!ge)return;ue.target.nodeName==="IMG"?(O.current.style.display="flex",O.current.style.width=ue.target.clientWidth+"px",O.current.style.height=ue.target.clientHeight+"px",O.current.style.top=ue.target.offsetTop+"px",O.current.style.left=ue.target.offsetLeft+"px",j.current.src=ue.target.getAttribute("src")):O.current.style.display="none"};return w.a.createElement("div",{style:{position:"relative"}},w.a.createElement("div",{ref:Pe,style:Object(L.a)({},Ee),className:"".concat(ie||""," markdown-body ").concat(N.a.mdBody),onMouseOver:we,dangerouslySetInnerHTML:{__html:Ke}}),w.a.createElement("div",{ref:O,className:N.a.button},w.a.createElement(Z.a,null,w.a.createElement(b.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),w.a.createElement(b.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),w.a.createElement("img",{ref:j,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),w.a.createElement(X.a,{close:!0,data:oe,type:oe!=null&&oe.length?De:"",style:Object(L.a)({},H),onClose:function(){return ve("")}}))}},"9VGf":function(rt,tt,he){"use strict";he.d(tt,"a",function(){return U});var Se=he("cDcd"),Z=he.n(Se);function U(b,L){var E=Object(Se.useRef)();Object(Se.useEffect)(function(){E.current=b}),Object(Se.useEffect)(function(){function A(){E.current()}if(L!==null){var w=setInterval(A,L);return function(){return clearInterval(w)}}},[L])}},Aky1:function(rt,tt,he){"use strict";he.d(tt,"a",function(){return v});var Se=he("ErOA"),Z=he("ppsT"),U=he.n(Z),b="",L,E="";function A(u){w(u)}function w(u){L=new U.a.Vod({timeout:6e4,partSize:1048576,parallel:5,retryCount:3,retryDuration:2,region:"ap-southeast-1",userId:1829848226361863,enableUploadProgress:!1,addFileSuccess:function(a){console.log("addFileSuccess: "+a.file.name),u.addFileSuccess&&u.addFileSuccess(a),L.startUpload()},onUploadstarted:function(a){var t=a.file.name;if(a.videoId){var c="/api/users/".concat(b,"/video_auths.json");Object(Se.a)(c,{method:"put",body:{video_id:a.videoId,title:t,file_name:t,virtual_classroom_id:E}}).then(function(o){if(o.status==-1){u.onUploadError&&u.onUploadError(a);return}var e=o.data,s=e.UploadAuth,r=e.UploadAddress,d=e.VideoId;L.setUploadAuthAndAddress(a,s,r)}).catch(function(o){L.deleteFile(L._curIndex),L.nextUpload(),console.log(o)})}else{var i="/api/users/".concat(b,"/video_auths.json"),l="";Object(Se.a)(i,{method:"Post",body:{title:l+t,file_name:l+t,virtual_classroom_id:E}}).then(function(o){if(o){var e=o.data,s=e.UploadAuth,r=e.UploadAddress,d=e.VideoId;L.setUploadAuthAndAddress(a,s,r,d)}}).catch(function(o){L.deleteFile(L._curIndex),L.nextUpload(),console.log(o)}),console.log("\u6587\u4EF6\u5F00\u59CB\u4E0A\u4F20...")}},onUploadSucceed:function(a){u.onUploadSucceed&&u.onUploadSucceed(a),console.log("\u6587\u4EF6\u4E0A\u4F20\u6210\u529F!")},onUploadFailed:function(a,t,i){u.onUploadFailed&&u.onUploadFailed(a),console.log("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25!")},onUploadCanceled:function(a,t,i){console.log("\u6587\u4EF6\u4E0A\u4F20\u5DF2\u6682\u505C!")},onUploadProgress:function(a,t,i){u.onUploadProgress&&u.onUploadProgress(a,t,i);var l=Math.ceil(i*100);console.log("\u6587\u4EF6\u4E0A\u4F20\u4E2D...")},onUploadTokenExpired:function(a){console.log("\u6587\u4EF6\u4E0A\u4F20\u8D85\u65F6!");var t="/api/users/".concat(b,"/video_auths.json");Object(Se.a)(t,{method:"put",body:{video_id:a.videoId}}).then(function(i){var l=i.data,c=l.UploadAuth;L.resumeUploadWithAuth(c)}).catch(function(i){console.log(i)})},onUploadEnd:function(a){u.onUploadEnd&&u.onUploadEnd(a),console.log("onUploadEnd: uploaded all the files")}}),u.gotUploader&&u.gotUploader(L)}function v(u,h,a){u&&(b=u),h&&(E=h),A(a)}},DlQD:function(rt,tt,he){(function(Se,Z){rt.exports=Z()})(this,function(){"use strict";function Se(xe,we){for(var Te=0;Te<we.length;Te++){var ue=we[Te];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(xe,ue.key,ue)}}function Z(xe,we,Te){return we&&Se(xe.prototype,we),Te&&Se(xe,Te),xe}function U(xe,we){if(!xe)return;if(typeof xe=="string")return b(xe,we);var Te=Object.prototype.toString.call(xe).slice(8,-1);if(Te==="Object"&&xe.constructor&&(Te=xe.constructor.name),Te==="Map"||Te==="Set")return Array.from(xe);if(Te==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Te))return b(xe,we)}function b(xe,we){(we==null||we>xe.length)&&(we=xe.length);for(var Te=0,ue=new Array(we);Te<we;Te++)ue[Te]=xe[Te];return ue}function L(xe,we){var Te;if(typeof Symbol=="undefined"||xe[Symbol.iterator]==null){if(Array.isArray(xe)||(Te=U(xe))||we&&xe&&typeof xe.length=="number"){Te&&(xe=Te);var ue=0;return function(){return ue>=xe.length?{done:!0}:{done:!1,value:xe[ue++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Te=xe[Symbol.iterator](),Te.next.bind(Te)}function E(xe,we){return we={exports:{}},xe(we,we.exports),we.exports}var A=E(function(xe){function we(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Te(ue){xe.exports.defaults=ue}xe.exports={defaults:we(),getDefaults:we,changeDefaults:Te}}),w=A.defaults,v=A.getDefaults,u=A.changeDefaults,h=/[&<>"']/,a=/[&<>"']/g,t=/[<>"']|&(?!#?\w+;)/,i=/[<>"']|&(?!#?\w+;)/g,l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},c=function(we){return l[we]};function o(xe,we){if(we){if(h.test(xe))return xe.replace(a,c)}else if(t.test(xe))return xe.replace(i,c);return xe}var e=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(xe){return xe.replace(e,function(we,Te){return Te=Te.toLowerCase(),Te==="colon"?":":Te.charAt(0)==="#"?Te.charAt(1)==="x"?String.fromCharCode(parseInt(Te.substring(2),16)):String.fromCharCode(+Te.substring(1)):""})}var r=/(^|[^\[])\^/g;function d(xe,we){xe=xe.source||xe,we=we||"";var Te={replace:function(de,_e){return _e=_e.source||_e,_e=_e.replace(r,"$1"),xe=xe.replace(de,_e),Te},getRegex:function(){return new RegExp(xe,we)}};return Te}var f=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(xe,we,Te){if(xe){var ue;try{ue=decodeURIComponent(s(Te)).replace(f,"").toLowerCase()}catch(de){return null}if(ue.indexOf("javascript:")===0||ue.indexOf("vbscript:")===0||ue.indexOf("data:")===0)return null}we&&!g.test(Te)&&(Te=x(we,Te));try{Te=encodeURI(Te).replace(/%25/g,"%")}catch(de){return null}return Te}var p={},_=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,n=/^([^:]+:\/*[^/]*)[\s\S]*$/;function x(xe,we){p[" "+xe]||(_.test(xe)?p[" "+xe]=xe+"/":p[" "+xe]=D(xe,"/",!0)),xe=p[" "+xe];var Te=xe.indexOf(":")===-1;return we.substring(0,2)==="//"?Te?we:xe.replace(y,"$1")+we:we.charAt(0)==="/"?Te?we:xe.replace(n,"$1")+we:xe+we}var S={exec:function(){}};function T(xe){for(var we=1,Te,ue;we<arguments.length;we++){Te=arguments[we];for(ue in Te)Object.prototype.hasOwnProperty.call(Te,ue)&&(xe[ue]=Te[ue])}return xe}function R(xe,we){var Te=xe.replace(/\|/g,function(_e,ye,Ie){for(var Me=!1,ze=ye;--ze>=0&&Ie[ze]==="\\";)Me=!Me;return Me?"|":" |"}),ue=Te.split(/ \|/),de=0;if(ue.length>we)ue.splice(we);else for(;ue.length<we;)ue.push("");for(;de<ue.length;de++)ue[de]=ue[de].trim().replace(/\\\|/g,"|");return ue}function D(xe,we,Te){var ue=xe.length;if(ue===0)return"";for(var de=0;de<ue;){var _e=xe.charAt(ue-de-1);if(_e===we&&!Te)de++;else if(_e!==we&&Te)de++;else break}return xe.substr(0,ue-de)}function I(xe,we){if(xe.indexOf(we[1])===-1)return-1;for(var Te=xe.length,ue=0,de=0;de<Te;de++)if(xe[de]==="\\")de++;else if(xe[de]===we[0])ue++;else if(xe[de]===we[1]&&(ue--,ue<0))return de;return-1}function B(xe){xe&&xe.sanitize&&!xe.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var G={escape:o,unescape:s,edit:d,cleanUrl:m,resolveUrl:x,noopTest:S,merge:T,splitCells:R,rtrim:D,findClosingBracket:I,checkSanitizeDeprecation:B},k=A.defaults,$=G.rtrim,X=G.splitCells,V=G.escape,N=G.findClosingBracket;function z(xe,we,Te){var ue=we.href,de=we.title?V(we.title):null,_e=xe[1].replace(/\\([\[\]])/g,"$1");return xe[0].charAt(0)!=="!"?{type:"link",raw:Te,href:ue,title:de,text:_e}:{type:"image",raw:Te,href:ue,title:de,text:V(_e)}}function q(xe,we){var Te=xe.match(/^(\s+)(?:```)/);if(Te===null)return we;var ue=Te[1];return we.split(`
`).map(function(de){var _e=de.match(/^\s+/);if(_e===null)return de;var ye=_e[0];return ye.length>=ue.length?de.slice(ue.length):de}).join(`
`)}var ee=function(){function xe(Te){this.options=Te||k}var we=xe.prototype;return we.space=function(ue){var de=this.rules.block.newline.exec(ue);if(de)return de[0].length>1?{type:"space",raw:de[0]}:{raw:`
`}},we.code=function(ue,de){var _e=this.rules.block.code.exec(ue);if(_e){var ye=de[de.length-1];if(ye&&ye.type==="paragraph")return{raw:_e[0],text:_e[0].trimRight()};var Ie=_e[0].replace(/^ {4}/gm,"");return{type:"code",raw:_e[0],codeBlockStyle:"indented",text:this.options.pedantic?Ie:$(Ie,`
`)}}},we.fences=function(ue){var de=this.rules.block.fences.exec(ue);if(de){var _e=de[0],ye=q(_e,de[3]||"");return{type:"code",raw:_e,lang:de[2]?de[2].trim():de[2],text:ye}}},we.heading=function(ue){var de=this.rules.block.heading.exec(ue);if(de)return{type:"heading",raw:de[0],depth:de[1].length,text:de[2]}},we.nptable=function(ue){var de=this.rules.block.nptable.exec(ue);if(de){var _e={type:"table",header:X(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(`
`):[],raw:de[0]};if(_e.header.length===_e.align.length){var ye=_e.align.length,Ie;for(Ie=0;Ie<ye;Ie++)/^ *-+: *$/.test(_e.align[Ie])?_e.align[Ie]="right":/^ *:-+: *$/.test(_e.align[Ie])?_e.align[Ie]="center":/^ *:-+ *$/.test(_e.align[Ie])?_e.align[Ie]="left":_e.align[Ie]=null;for(ye=_e.cells.length,Ie=0;Ie<ye;Ie++)_e.cells[Ie]=X(_e.cells[Ie],_e.header.length);return _e}}},we.hr=function(ue){var de=this.rules.block.hr.exec(ue);if(de)return{type:"hr",raw:de[0]}},we.blockquote=function(ue){var de=this.rules.block.blockquote.exec(ue);if(de){var _e=de[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:de[0],text:_e}}},we.list=function(ue){var de=this.rules.block.list.exec(ue);if(de){for(var _e=de[0],ye=de[2],Ie=ye.length>1,Me=ye[ye.length-1]===")",ze={type:"list",raw:_e,ordered:Ie,start:Ie?+ye.slice(0,-1):"",loose:!1,items:[]},st=de[0].match(this.rules.block.item),nt=!1,Ve,et,Ge,He,Ye,Je,ot,dt=st.length,ft=0;ft<dt;ft++)Ve=st[ft],_e=Ve,et=Ve.length,Ve=Ve.replace(/^ *([*+-]|\d+[.)]) */,""),~Ve.indexOf(`
`)&&(et-=Ve.length,Ve=this.options.pedantic?Ve.replace(/^ {1,4}/gm,""):Ve.replace(new RegExp("^ {1,"+et+"}","gm"),"")),ft!==dt-1&&(Ge=this.rules.block.bullet.exec(st[ft+1])[0],(Ie?Ge.length===1||!Me&&Ge[Ge.length-1]===")":Ge.length>1||this.options.smartLists&&Ge!==ye)&&(He=st.slice(ft+1).join(`
`),ze.raw=ze.raw.substring(0,ze.raw.length-He.length),ft=dt-1)),Ye=nt||/\n\n(?!\s*$)/.test(Ve),ft!==dt-1&&(nt=Ve.charAt(Ve.length-1)===`
`,Ye||(Ye=nt)),Ye&&(ze.loose=!0),Je=/^\[[ xX]\] /.test(Ve),ot=void 0,Je&&(ot=Ve[1]!==" ",Ve=Ve.replace(/^\[[ xX]\] +/,"")),ze.items.push({type:"list_item",raw:_e,task:Je,checked:ot,loose:Ye,text:Ve});return ze}},we.html=function(ue){var de=this.rules.block.html.exec(ue);if(de)return{type:this.options.sanitize?"paragraph":"html",raw:de[0],pre:!this.options.sanitizer&&(de[1]==="pre"||de[1]==="script"||de[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):V(de[0]):de[0]}},we.def=function(ue){var de=this.rules.block.def.exec(ue);if(de){de[3]&&(de[3]=de[3].substring(1,de[3].length-1));var _e=de[1].toLowerCase().replace(/\s+/g," ");return{tag:_e,raw:de[0],href:de[2],title:de[3]}}},we.table=function(ue){var de=this.rules.block.table.exec(ue);if(de){var _e={type:"table",header:X(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(`
`):[]};if(_e.header.length===_e.align.length){_e.raw=de[0];var ye=_e.align.length,Ie;for(Ie=0;Ie<ye;Ie++)/^ *-+: *$/.test(_e.align[Ie])?_e.align[Ie]="right":/^ *:-+: *$/.test(_e.align[Ie])?_e.align[Ie]="center":/^ *:-+ *$/.test(_e.align[Ie])?_e.align[Ie]="left":_e.align[Ie]=null;for(ye=_e.cells.length,Ie=0;Ie<ye;Ie++)_e.cells[Ie]=X(_e.cells[Ie].replace(/^ *\| *| *\| *$/g,""),_e.header.length);return _e}}},we.lheading=function(ue){var de=this.rules.block.lheading.exec(ue);if(de)return{type:"heading",raw:de[0],depth:de[2].charAt(0)==="="?1:2,text:de[1]}},we.paragraph=function(ue){var de=this.rules.block.paragraph.exec(ue);if(de)return{type:"paragraph",raw:de[0],text:de[1].charAt(de[1].length-1)===`
`?de[1].slice(0,-1):de[1]}},we.text=function(ue,de){var _e=this.rules.block.text.exec(ue);if(_e){var ye=de[de.length-1];return ye&&ye.type==="text"?{raw:_e[0],text:_e[0]}:{type:"text",raw:_e[0],text:_e[0]}}},we.escape=function(ue){var de=this.rules.inline.escape.exec(ue);if(de)return{type:"escape",raw:de[0],text:V(de[1])}},we.tag=function(ue,de,_e){var ye=this.rules.inline.tag.exec(ue);if(ye)return!de&&/^<a /i.test(ye[0])?de=!0:de&&/^<\/a>/i.test(ye[0])&&(de=!1),!_e&&/^<(pre|code|kbd|script)(\s|>)/i.test(ye[0])?_e=!0:_e&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ye[0])&&(_e=!1),{type:this.options.sanitize?"text":"html",raw:ye[0],inLink:de,inRawBlock:_e,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ye[0]):V(ye[0]):ye[0]}},we.link=function(ue){var de=this.rules.inline.link.exec(ue);if(de){var _e=N(de[2],"()");if(_e>-1){var ye=de[0].indexOf("!")===0?5:4,Ie=ye+de[1].length+_e;de[2]=de[2].substring(0,_e),de[0]=de[0].substring(0,Ie).trim(),de[3]=""}var Me=de[2],ze="";if(this.options.pedantic){var st=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Me);st?(Me=st[1],ze=st[3]):ze=""}else ze=de[3]?de[3].slice(1,-1):"";Me=Me.trim().replace(/^<([\s\S]*)>$/,"$1");var nt=z(de,{href:Me&&Me.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},de[0]);return nt}},we.reflink=function(ue,de){var _e;if((_e=this.rules.inline.reflink.exec(ue))||(_e=this.rules.inline.nolink.exec(ue))){var ye=(_e[2]||_e[1]).replace(/\s+/g," ");if(ye=de[ye.toLowerCase()],!ye||!ye.href){var Ie=_e[0].charAt(0);return{type:"text",raw:Ie,text:Ie}}var Me=z(_e,ye,_e[0]);return Me}},we.strong=function(ue,de,_e){_e===void 0&&(_e="");var ye=this.rules.inline.strong.start.exec(ue);if(ye&&(!ye[1]||ye[1]&&(_e===""||this.rules.inline.punctuation.exec(_e)))){de=de.slice(-1*ue.length);var Ie=ye[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ie.lastIndex=0;for(var Me;(ye=Ie.exec(de))!=null;)if(Me=this.rules.inline.strong.middle.exec(de.slice(0,ye.index+3)),Me)return{type:"strong",raw:ue.slice(0,Me[0].length),text:ue.slice(2,Me[0].length-2)}}},we.em=function(ue,de,_e){_e===void 0&&(_e="");var ye=this.rules.inline.em.start.exec(ue);if(ye&&(!ye[1]||ye[1]&&(_e===""||this.rules.inline.punctuation.exec(_e)))){de=de.slice(-1*ue.length);var Ie=ye[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ie.lastIndex=0;for(var Me;(ye=Ie.exec(de))!=null;)if(Me=this.rules.inline.em.middle.exec(de.slice(0,ye.index+2)),Me)return{type:"em",raw:ue.slice(0,Me[0].length),text:ue.slice(1,Me[0].length-1)}}},we.codespan=function(ue){var de=this.rules.inline.code.exec(ue);if(de){var _e=de[2].replace(/\n/g," "),ye=/[^ ]/.test(_e),Ie=_e.startsWith(" ")&&_e.endsWith(" ");return ye&&Ie&&(_e=_e.substring(1,_e.length-1)),_e=V(_e,!0),{type:"codespan",raw:de[0],text:_e}}},we.br=function(ue){var de=this.rules.inline.br.exec(ue);if(de)return{type:"br",raw:de[0]}},we.del=function(ue){var de=this.rules.inline.del.exec(ue);if(de)return{type:"del",raw:de[0],text:de[1]}},we.autolink=function(ue,de){var _e=this.rules.inline.autolink.exec(ue);if(_e){var ye,Ie;return _e[2]==="@"?(ye=V(this.options.mangle?de(_e[1]):_e[1]),Ie="mailto:"+ye):(ye=V(_e[1]),Ie=ye),{type:"link",raw:_e[0],text:ye,href:Ie,tokens:[{type:"text",raw:ye,text:ye}]}}},we.url=function(ue,de){var _e;if(_e=this.rules.inline.url.exec(ue)){var ye,Ie;if(_e[2]==="@")ye=V(this.options.mangle?de(_e[0]):_e[0]),Ie="mailto:"+ye;else{var Me;do Me=_e[0],_e[0]=this.rules.inline._backpedal.exec(_e[0])[0];while(Me!==_e[0]);ye=V(_e[0]),_e[1]==="www."?Ie="http://"+ye:Ie=ye}return{type:"link",raw:_e[0],text:ye,href:Ie,tokens:[{type:"text",raw:ye,text:ye}]}}},we.inlineText=function(ue,de,_e){var ye=this.rules.inline.text.exec(ue);if(ye){var Ie;return de?Ie=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ye[0]):V(ye[0]):ye[0]:Ie=V(this.options.smartypants?_e(ye[0]):ye[0]),{type:"text",raw:ye[0],text:Ie}}},xe}(),fe=G.noopTest,ae=G.edit,pe=G.merge,se={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:fe,table:fe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,se.def=ae(se.def).replace("label",se._label).replace("title",se._title).getRegex(),se.bullet=/(?:[*+-]|\d{1,9}[.)])/,se.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,se.item=ae(se.item,"gm").replace(/bull/g,se.bullet).getRegex(),se.list=ae(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex(),se._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",se._comment=/<!--(?!-?>)[\s\S]*?-->/,se.html=ae(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),se.paragraph=ae(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex(),se.blockquote=ae(se.blockquote).replace("paragraph",se.paragraph).getRegex(),se.normal=pe({},se),se.gfm=pe({},se.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),se.gfm.nptable=ae(se.gfm.nptable).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex(),se.gfm.table=ae(se.gfm.table).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex(),se.pedantic=pe({},se.normal,{html:ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:fe,paragraph:ae(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ge={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:fe,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:fe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ge._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ge.punctuation=ae(ge.punctuation).replace(/punctuation/g,ge._punctuation).getRegex(),ge._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ge._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ge.em.start=ae(ge.em.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.middle=ae(ge.em.middle).replace(/punctuation/g,ge._punctuation).replace(/overlapSkip/g,ge._overlapSkip).getRegex(),ge.em.endAst=ae(ge.em.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.endUnd=ae(ge.em.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.start=ae(ge.strong.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.middle=ae(ge.strong.middle).replace(/punctuation/g,ge._punctuation).replace(/blockSkip/g,ge._blockSkip).getRegex(),ge.strong.endAst=ae(ge.strong.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.endUnd=ae(ge.strong.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.blockSkip=ae(ge._blockSkip,"g").getRegex(),ge.overlapSkip=ae(ge._overlapSkip,"g").getRegex(),ge._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ge._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ge._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ge.autolink=ae(ge.autolink).replace("scheme",ge._scheme).replace("email",ge._email).getRegex(),ge._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ge.tag=ae(ge.tag).replace("comment",se._comment).replace("attribute",ge._attribute).getRegex(),ge._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ge._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ge._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ge.link=ae(ge.link).replace("label",ge._label).replace("href",ge._href).replace("title",ge._title).getRegex(),ge.reflink=ae(ge.reflink).replace("label",ge._label).getRegex(),ge.reflinkSearch=ae(ge.reflinkSearch,"g").replace("reflink",ge.reflink).replace("nolink",ge.nolink).getRegex(),ge.normal=pe({},ge),ge.pedantic=pe({},ge.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:ae(/^!?\[(label)\]\((.*?)\)/).replace("label",ge._label).getRegex(),reflink:ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ge._label).getRegex()}),ge.gfm=pe({},ge.normal,{escape:ae(ge.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ge.gfm.url=ae(ge.gfm.url,"i").replace("email",ge.gfm._extended_email).getRegex(),ge.breaks=pe({},ge.gfm,{br:ae(ge.br).replace("{2,}","*").getRegex(),text:ae(ge.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ie={block:se,inline:ge},te=A.defaults,Q=ie.block,me=ie.inline;function re(xe){return xe.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function J(xe){var we="",Te,ue,de=xe.length;for(Te=0;Te<de;Te++)ue=xe.charCodeAt(Te),Math.random()>.5&&(ue="x"+ue.toString(16)),we+="&#"+ue+";";return we}var be=function(){function xe(Te){this.tokens=[],this.tokens.links=Object.create(null),this.options=Te||te,this.options.tokenizer=this.options.tokenizer||new ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ue={block:Q.normal,inline:me.normal};this.options.pedantic?(ue.block=Q.pedantic,ue.inline=me.pedantic):this.options.gfm&&(ue.block=Q.gfm,this.options.breaks?ue.inline=me.breaks:ue.inline=me.gfm),this.tokenizer.rules=ue}xe.lex=function(ue,de){var _e=new xe(de);return _e.lex(ue)};var we=xe.prototype;return we.lex=function(ue){return ue=ue.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ue,this.tokens,!0),this.inline(this.tokens),this.tokens},we.blockTokens=function(ue,de,_e){de===void 0&&(de=[]),_e===void 0&&(_e=!0),ue=ue.replace(/^ +$/gm,"");for(var ye,Ie,Me,ze;ue;){if(ye=this.tokenizer.space(ue)){ue=ue.substring(ye.raw.length),ye.type&&de.push(ye);continue}if(ye=this.tokenizer.code(ue,de)){ue=ue.substring(ye.raw.length),ye.type?de.push(ye):(ze=de[de.length-1],ze.raw+=`
`+ye.raw,ze.text+=`
`+ye.text);continue}if(ye=this.tokenizer.fences(ue)){ue=ue.substring(ye.raw.length),de.push(ye);continue}if(ye=this.tokenizer.heading(ue)){ue=ue.substring(ye.raw.length),de.push(ye);continue}if(ye=this.tokenizer.nptable(ue)){ue=ue.substring(ye.raw.length),de.push(ye);continue}if(ye=this.tokenizer.hr(ue)){ue=ue.substring(ye.raw.length),de.push(ye);continue}if(ye=this.tokenizer.blockquote(ue)){ue=ue.substring(ye.raw.length),ye.tokens=this.blockTokens(ye.text,[],_e),de.push(ye);continue}if(ye=this.tokenizer.list(ue)){for(ue=ue.substring(ye.raw.length),Me=ye.items.length,Ie=0;Ie<Me;Ie++)ye.items[Ie].tokens=this.blockTokens(ye.items[Ie].text,[],!1);de.push(ye);continue}if(ye=this.tokenizer.html(ue)){ue=ue.substring(ye.raw.length),de.push(ye);continue}if(_e&&(ye=this.tokenizer.def(ue))){ue=ue.substring(ye.raw.length),this.tokens.links[ye.tag]||(this.tokens.links[ye.tag]={href:ye.href,title:ye.title});continue}if(ye=this.tokenizer.table(ue)){ue=ue.substring(ye.raw.length),de.push(ye);continue}if(ye=this.tokenizer.lheading(ue)){ue=ue.substring(ye.raw.length),de.push(ye);continue}if(_e&&(ye=this.tokenizer.paragraph(ue))){ue=ue.substring(ye.raw.length),de.push(ye);continue}if(ye=this.tokenizer.text(ue,de)){ue=ue.substring(ye.raw.length),ye.type?de.push(ye):(ze=de[de.length-1],ze.raw+=`
`+ye.raw,ze.text+=`
`+ye.text);continue}if(ue){var st="Infinite loop on byte: "+ue.charCodeAt(0);if(this.options.silent){console.error(st);break}else throw new Error(st)}}return de},we.inline=function(ue){var de,_e,ye,Ie,Me,ze,st=ue.length;for(de=0;de<st;de++){ze=ue[de];switch(ze.type){case"paragraph":case"text":case"heading":{ze.tokens=[],this.inlineTokens(ze.text,ze.tokens);break}case"table":{for(ze.tokens={header:[],cells:[]},Ie=ze.header.length,_e=0;_e<Ie;_e++)ze.tokens.header[_e]=[],this.inlineTokens(ze.header[_e],ze.tokens.header[_e]);for(Ie=ze.cells.length,_e=0;_e<Ie;_e++)for(Me=ze.cells[_e],ze.tokens.cells[_e]=[],ye=0;ye<Me.length;ye++)ze.tokens.cells[_e][ye]=[],this.inlineTokens(Me[ye],ze.tokens.cells[_e][ye]);break}case"blockquote":{this.inline(ze.tokens);break}case"list":{for(Ie=ze.items.length,_e=0;_e<Ie;_e++)this.inline(ze.items[_e].tokens);break}}}return ue},we.inlineTokens=function(ue,de,_e,ye,Ie){de===void 0&&(de=[]),_e===void 0&&(_e=!1),ye===void 0&&(ye=!1),Ie===void 0&&(Ie="");var Me,ze=ue,st;if(this.tokens.links){var nt=Object.keys(this.tokens.links);if(nt.length>0)for(;(st=this.tokenizer.rules.inline.reflinkSearch.exec(ze))!=null;)nt.includes(st[0].slice(st[0].lastIndexOf("[")+1,-1))&&(ze=ze.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(st=this.tokenizer.rules.inline.blockSkip.exec(ze))!=null;)ze=ze.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ue;){if(Me=this.tokenizer.escape(ue)){ue=ue.substring(Me.raw.length),de.push(Me);continue}if(Me=this.tokenizer.tag(ue,_e,ye)){ue=ue.substring(Me.raw.length),_e=Me.inLink,ye=Me.inRawBlock,de.push(Me);continue}if(Me=this.tokenizer.link(ue)){ue=ue.substring(Me.raw.length),Me.type==="link"&&(Me.tokens=this.inlineTokens(Me.text,[],!0,ye)),de.push(Me);continue}if(Me=this.tokenizer.reflink(ue,this.tokens.links)){ue=ue.substring(Me.raw.length),Me.type==="link"&&(Me.tokens=this.inlineTokens(Me.text,[],!0,ye)),de.push(Me);continue}if(Me=this.tokenizer.strong(ue,ze,Ie)){ue=ue.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],_e,ye),de.push(Me);continue}if(Me=this.tokenizer.em(ue,ze,Ie)){ue=ue.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],_e,ye),de.push(Me);continue}if(Me=this.tokenizer.codespan(ue)){ue=ue.substring(Me.raw.length),de.push(Me);continue}if(Me=this.tokenizer.br(ue)){ue=ue.substring(Me.raw.length),de.push(Me);continue}if(Me=this.tokenizer.del(ue)){ue=ue.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],_e,ye),de.push(Me);continue}if(Me=this.tokenizer.autolink(ue,J)){ue=ue.substring(Me.raw.length),de.push(Me);continue}if(!_e&&(Me=this.tokenizer.url(ue,J))){ue=ue.substring(Me.raw.length),de.push(Me);continue}if(Me=this.tokenizer.inlineText(ue,ye,re)){ue=ue.substring(Me.raw.length),Ie=Me.raw.slice(-1),de.push(Me);continue}if(ue){var Ve="Infinite loop on byte: "+ue.charCodeAt(0);if(this.options.silent){console.error(Ve);break}else throw new Error(Ve)}}return de},Z(xe,null,[{key:"rules",get:function(){return{block:Q,inline:me}}}]),xe}(),Ee=A.defaults,Le=G.cleanUrl,H=G.escape,C=function(){function xe(Te){this.options=Te||Ee}var we=xe.prototype;return we.code=function(ue,de,_e){var ye=(de||"").match(/\S*/)[0];if(this.options.highlight){var Ie=this.options.highlight(ue,ye);Ie!=null&&Ie!==ue&&(_e=!0,ue=Ie)}return ye?'<pre><code class="'+this.options.langPrefix+H(ye,!0)+'">'+(_e?ue:H(ue,!0))+`</code></pre>
`:"<pre><code>"+(_e?ue:H(ue,!0))+`</code></pre>
`},we.blockquote=function(ue){return`<blockquote>
`+ue+`</blockquote>
`},we.html=function(ue){return ue},we.heading=function(ue,de,_e,ye){return this.options.headerIds?"<h"+de+' id="'+this.options.headerPrefix+ye.slug(_e)+'">'+ue+"</h"+de+`>
`:"<h"+de+">"+ue+"</h"+de+`>
`},we.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},we.list=function(ue,de,_e){var ye=de?"ol":"ul",Ie=de&&_e!==1?' start="'+_e+'"':"";return"<"+ye+Ie+`>
`+ue+"</"+ye+`>
`},we.listitem=function(ue){return"<li>"+ue+`</li>
`},we.checkbox=function(ue){return"<input "+(ue?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},we.paragraph=function(ue){return"<p>"+ue+`</p>
`},we.table=function(ue,de){return de&&(de="<tbody>"+de+"</tbody>"),`<table>
<thead>
`+ue+`</thead>
`+de+`</table>
`},we.tablerow=function(ue){return`<tr>
`+ue+`</tr>
`},we.tablecell=function(ue,de){var _e=de.header?"th":"td",ye=de.align?"<"+_e+' align="'+de.align+'">':"<"+_e+">";return ye+ue+"</"+_e+`>
`},we.strong=function(ue){return"<strong>"+ue+"</strong>"},we.em=function(ue){return"<em>"+ue+"</em>"},we.codespan=function(ue){return"<code>"+ue+"</code>"},we.br=function(){return this.options.xhtml?"<br/>":"<br>"},we.del=function(ue){return"<del>"+ue+"</del>"},we.link=function(ue,de,_e){if(ue=Le(this.options.sanitize,this.options.baseUrl,ue),ue===null)return _e;var ye='<a href="'+H(ue)+'"';return de&&(ye+=' title="'+de+'"'),ye+=">"+_e+"</a>",ye},we.image=function(ue,de,_e){if(ue=Le(this.options.sanitize,this.options.baseUrl,ue),ue===null)return _e;var ye='<img src="'+ue+'" alt="'+_e+'"';return de&&(ye+=' title="'+de+'"'),ye+=this.options.xhtml?"/>":">",ye},we.text=function(ue){return ue},xe}(),O=function(){function xe(){}var we=xe.prototype;return we.strong=function(ue){return ue},we.em=function(ue){return ue},we.codespan=function(ue){return ue},we.del=function(ue){return ue},we.html=function(ue){return ue},we.text=function(ue){return ue},we.link=function(ue,de,_e){return""+_e},we.image=function(ue,de,_e){return""+_e},we.br=function(){return""},xe}(),j=function(){function xe(){this.seen={}}var we=xe.prototype;return we.slug=function(ue){var de=ue.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(de)){var _e=de;do this.seen[_e]++,de=_e+"-"+this.seen[_e];while(this.seen.hasOwnProperty(de))}return this.seen[de]=0,de},xe}(),M=A.defaults,F=G.unescape,oe=function(){function xe(Te){this.options=Te||M,this.options.renderer=this.options.renderer||new C,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new O,this.slugger=new j}xe.parse=function(ue,de){var _e=new xe(de);return _e.parse(ue)};var we=xe.prototype;return we.parse=function(ue,de){de===void 0&&(de=!0);var _e="",ye,Ie,Me,ze,st,nt,Ve,et,Ge,He,Ye,Je,ot,dt,ft,lt,vt,gt,bt=ue.length;for(ye=0;ye<bt;ye++){He=ue[ye];switch(He.type){case"space":continue;case"hr":{_e+=this.renderer.hr();continue}case"heading":{_e+=this.renderer.heading(this.parseInline(He.tokens),He.depth,F(this.parseInline(He.tokens,this.textRenderer)),this.slugger);continue}case"code":{_e+=this.renderer.code(He.text,He.lang,He.escaped);continue}case"table":{for(et="",Ve="",ze=He.header.length,Ie=0;Ie<ze;Ie++)Ve+=this.renderer.tablecell(this.parseInline(He.tokens.header[Ie]),{header:!0,align:He.align[Ie]});for(et+=this.renderer.tablerow(Ve),Ge="",ze=He.cells.length,Ie=0;Ie<ze;Ie++){for(nt=He.tokens.cells[Ie],Ve="",st=nt.length,Me=0;Me<st;Me++)Ve+=this.renderer.tablecell(this.parseInline(nt[Me]),{header:!1,align:He.align[Me]});Ge+=this.renderer.tablerow(Ve)}_e+=this.renderer.table(et,Ge);continue}case"blockquote":{Ge=this.parse(He.tokens),_e+=this.renderer.blockquote(Ge);continue}case"list":{for(Ye=He.ordered,Je=He.start,ot=He.loose,ze=He.items.length,Ge="",Ie=0;Ie<ze;Ie++)ft=He.items[Ie],lt=ft.checked,vt=ft.task,dt="",ft.task&&(gt=this.renderer.checkbox(lt),ot?ft.tokens.length>0&&ft.tokens[0].type==="text"?(ft.tokens[0].text=gt+" "+ft.tokens[0].text,ft.tokens[0].tokens&&ft.tokens[0].tokens.length>0&&ft.tokens[0].tokens[0].type==="text"&&(ft.tokens[0].tokens[0].text=gt+" "+ft.tokens[0].tokens[0].text)):ft.tokens.unshift({type:"text",text:gt}):dt+=gt),dt+=this.parse(ft.tokens,ot),Ge+=this.renderer.listitem(dt,vt,lt);_e+=this.renderer.list(Ge,Ye,Je);continue}case"html":{_e+=this.renderer.html(He.text);continue}case"paragraph":{_e+=this.renderer.paragraph(this.parseInline(He.tokens));continue}case"text":{for(Ge=He.tokens?this.parseInline(He.tokens):He.text;ye+1<bt&&ue[ye+1].type==="text";)He=ue[++ye],Ge+=`
`+(He.tokens?this.parseInline(He.tokens):He.text);_e+=de?this.renderer.paragraph(Ge):Ge;continue}default:{var Et='Token with "'+He.type+'" type was not found.';if(this.options.silent){console.error(Et);return}else throw new Error(Et)}}}return _e},we.parseInline=function(ue,de){de=de||this.renderer;var _e="",ye,Ie,Me=ue.length;for(ye=0;ye<Me;ye++){Ie=ue[ye];switch(Ie.type){case"escape":{_e+=de.text(Ie.text);break}case"html":{_e+=de.html(Ie.text);break}case"link":{_e+=de.link(Ie.href,Ie.title,this.parseInline(Ie.tokens,de));break}case"image":{_e+=de.image(Ie.href,Ie.title,Ie.text);break}case"strong":{_e+=de.strong(this.parseInline(Ie.tokens,de));break}case"em":{_e+=de.em(this.parseInline(Ie.tokens,de));break}case"codespan":{_e+=de.codespan(Ie.text);break}case"br":{_e+=de.br();break}case"del":{_e+=de.del(this.parseInline(Ie.tokens,de));break}case"text":{_e+=de.text(Ie.text);break}default:{var ze='Token with "'+Ie.type+'" type was not found.';if(this.options.silent){console.error(ze);return}else throw new Error(ze)}}}return _e},xe}(),ve=G.merge,ke=G.checkSanitizeDeprecation,Oe=G.escape,De=A.getDefaults,Ue=A.changeDefaults,Ke=A.defaults;function Pe(xe,we,Te){if(typeof xe=="undefined"||xe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof xe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(xe)+", string expected");if(typeof we=="function"&&(Te=we,we=null),we=ve({},Pe.defaults,we||{}),ke(we),Te){var ue=we.highlight,de;try{de=be.lex(xe,we)}catch(Me){return Te(Me)}var _e=function(ze){var st;if(!ze)try{st=oe.parse(de,we)}catch(nt){ze=nt}return we.highlight=ue,ze?Te(ze):Te(null,st)};if(!ue||ue.length<3)return _e();if(delete we.highlight,!de.length)return _e();var ye=0;Pe.walkTokens(de,function(Me){Me.type==="code"&&(ye++,setTimeout(function(){ue(Me.text,Me.lang,function(ze,st){if(ze)return _e(ze);st!=null&&st!==Me.text&&(Me.text=st,Me.escaped=!0),ye--,ye===0&&_e()})},0))}),ye===0&&_e();return}try{var Ie=be.lex(xe,we);return we.walkTokens&&Pe.walkTokens(Ie,we.walkTokens),oe.parse(Ie,we)}catch(Me){if(Me.message+=`
Please report this to https://github.com/markedjs/marked.`,we.silent)return"<p>An error occurred:</p><pre>"+Oe(Me.message+"",!0)+"</pre>";throw Me}}Pe.options=Pe.setOptions=function(xe){return ve(Pe.defaults,xe),Ue(Pe.defaults),Pe},Pe.getDefaults=De,Pe.defaults=Ke,Pe.use=function(xe){var we=ve({},xe);if(xe.renderer&&function(){var ue=Pe.defaults.renderer||new C,de=function(Ie){var Me=ue[Ie];ue[Ie]=function(){for(var ze=arguments.length,st=new Array(ze),nt=0;nt<ze;nt++)st[nt]=arguments[nt];var Ve=xe.renderer[Ie].apply(ue,st);return Ve===!1&&(Ve=Me.apply(ue,st)),Ve}};for(var _e in xe.renderer)de(_e);we.renderer=ue}(),xe.tokenizer&&function(){var ue=Pe.defaults.tokenizer||new ee,de=function(Ie){var Me=ue[Ie];ue[Ie]=function(){for(var ze=arguments.length,st=new Array(ze),nt=0;nt<ze;nt++)st[nt]=arguments[nt];var Ve=xe.tokenizer[Ie].apply(ue,st);return Ve===!1&&(Ve=Me.apply(ue,st)),Ve}};for(var _e in xe.tokenizer)de(_e);we.tokenizer=ue}(),xe.walkTokens){var Te=Pe.defaults.walkTokens;we.walkTokens=function(ue){xe.walkTokens(ue),Te&&Te(ue)}}Pe.setOptions(we)},Pe.walkTokens=function(xe,we){for(var Te=L(xe),ue;!(ue=Te()).done;){var de=ue.value;we(de);switch(de.type){case"table":{for(var _e=L(de.tokens.header),ye;!(ye=_e()).done;){var Ie=ye.value;Pe.walkTokens(Ie,we)}for(var Me=L(de.tokens.cells),ze;!(ze=Me()).done;)for(var st=ze.value,nt=L(st),Ve;!(Ve=nt()).done;){var et=Ve.value;Pe.walkTokens(et,we)}break}case"list":{Pe.walkTokens(de.items,we);break}default:de.tokens&&Pe.walkTokens(de.tokens,we)}}},Pe.Parser=oe,Pe.parser=oe.parse,Pe.Renderer=C,Pe.TextRenderer=O,Pe.Lexer=be,Pe.lexer=be.lex,Pe.Tokenizer=ee,Pe.Slugger=j,Pe.parse=Pe;var Re=Pe;return Re})},E2g8:function(rt,tt,he){(function(Se,Z){/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/(function(U,b){rt.exports=b()})(this,function(){"use strict";function U(C){var O=typeof C;return C!==null&&(O==="object"||O==="function")}function b(C){return typeof C=="function"}var L=void 0;Array.isArray?L=Array.isArray:L=function(C){return Object.prototype.toString.call(C)==="[object Array]"};var E=L,A=0,w=void 0,v=void 0,u=function(O,j){g[A]=O,g[A+1]=j,A+=2,A===2&&(v?v(m):_())};function h(C){v=C}function a(C){u=C}var t=typeof window!="undefined"?window:void 0,i=t||{},l=i.MutationObserver||i.WebKitMutationObserver,c=typeof self=="undefined"&&typeof Se!="undefined"&&{}.toString.call(Se)==="[object process]",o=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function e(){return function(){return Se.nextTick(m)}}function s(){return typeof w!="undefined"?function(){w(m)}:f()}function r(){var C=0,O=new l(m),j=document.createTextNode("");return O.observe(j,{characterData:!0}),function(){j.data=C=++C%2}}function d(){var C=new MessageChannel;return C.port1.onmessage=m,function(){return C.port2.postMessage(0)}}function f(){var C=setTimeout;return function(){return C(m,1)}}var g=new Array(1e3);function m(){for(var C=0;C<A;C+=2){var O=g[C],j=g[C+1];O(j),g[C]=void 0,g[C+1]=void 0}A=0}function p(){try{var C=Function("return this")().require("vertx");return w=C.runOnLoop||C.runOnContext,s()}catch(O){return f()}}var _=void 0;c?_=e():l?_=r():o?_=d():t===void 0&&!0?_=p():_=f();function y(C,O){var j=this,M=new this.constructor(S);M[x]===void 0&&ie(M);var F=j._state;if(F){var oe=arguments[F-1];u(function(){return ae(F,M,oe,j._result)})}else ee(j,M,C,O);return M}function n(C){var O=this;if(C&&typeof C=="object"&&C.constructor===O)return C;var j=new O(S);return V(j,C),j}var x=Math.random().toString(36).substring(2);function S(){}var T=void 0,R=1,D=2;function I(){return new TypeError("You cannot resolve a promise with itself")}function B(){return new TypeError("A promises callback cannot return that same promise.")}function G(C,O,j,M){try{C.call(O,j,M)}catch(F){return F}}function k(C,O,j){u(function(M){var F=!1,oe=G(j,O,function(ve){if(F)return;F=!0,O!==ve?V(M,ve):z(M,ve)},function(ve){if(F)return;F=!0,q(M,ve)},"Settle: "+(M._label||" unknown promise"));!F&&oe&&(F=!0,q(M,oe))},C)}function $(C,O){O._state===R?z(C,O._result):O._state===D?q(C,O._result):ee(O,void 0,function(j){return V(C,j)},function(j){return q(C,j)})}function X(C,O,j){O.constructor===C.constructor&&j===y&&O.constructor.resolve===n?$(C,O):j===void 0?z(C,O):b(j)?k(C,O,j):z(C,O)}function V(C,O){if(C===O)q(C,I());else if(U(O)){var j=void 0;try{j=O.then}catch(M){q(C,M);return}X(C,O,j)}else z(C,O)}function N(C){C._onerror&&C._onerror(C._result),fe(C)}function z(C,O){if(C._state!==T)return;C._result=O,C._state=R,C._subscribers.length!==0&&u(fe,C)}function q(C,O){if(C._state!==T)return;C._state=D,C._result=O,u(N,C)}function ee(C,O,j,M){var F=C._subscribers,oe=F.length;C._onerror=null,F[oe]=O,F[oe+R]=j,F[oe+D]=M,oe===0&&C._state&&u(fe,C)}function fe(C){var O=C._subscribers,j=C._state;if(O.length===0)return;for(var M=void 0,F=void 0,oe=C._result,ve=0;ve<O.length;ve+=3)M=O[ve],F=O[ve+j],M?ae(j,M,F,oe):F(oe);C._subscribers.length=0}function ae(C,O,j,M){var F=b(j),oe=void 0,ve=void 0,ke=!0;if(F){try{oe=j(M)}catch(Oe){ke=!1,ve=Oe}if(O===oe){q(O,B());return}}else oe=M;O._state!==T||(F&&ke?V(O,oe):ke===!1?q(O,ve):C===R?z(O,oe):C===D&&q(O,oe))}function pe(C,O){try{O(function(M){V(C,M)},function(M){q(C,M)})}catch(j){q(C,j)}}var se=0;function ge(){return se++}function ie(C){C[x]=se++,C._state=void 0,C._result=void 0,C._subscribers=[]}function te(){return new Error("Array Methods must be provided an Array")}var Q=function(){function C(O,j){this._instanceConstructor=O,this.promise=new O(S),this.promise[x]||ie(this.promise),E(j)?(this.length=j.length,this._remaining=j.length,this._result=new Array(this.length),this.length===0?z(this.promise,this._result):(this.length=this.length||0,this._enumerate(j),this._remaining===0&&z(this.promise,this._result))):q(this.promise,te())}return C.prototype._enumerate=function(j){for(var M=0;this._state===T&&M<j.length;M++)this._eachEntry(j[M],M)},C.prototype._eachEntry=function(j,M){var F=this._instanceConstructor,oe=F.resolve;if(oe===n){var ve=void 0,ke=void 0,Oe=!1;try{ve=j.then}catch(Ue){Oe=!0,ke=Ue}if(ve===y&&j._state!==T)this._settledAt(j._state,M,j._result);else if(typeof ve!="function")this._remaining--,this._result[M]=j;else if(F===Le){var De=new F(S);Oe?q(De,ke):X(De,j,ve),this._willSettleAt(De,M)}else this._willSettleAt(new F(function(Ue){return Ue(j)}),M)}else this._willSettleAt(oe(j),M)},C.prototype._settledAt=function(j,M,F){var oe=this.promise;oe._state===T&&(this._remaining--,j===D?q(oe,F):this._result[M]=F),this._remaining===0&&z(oe,this._result)},C.prototype._willSettleAt=function(j,M){var F=this;ee(j,void 0,function(oe){return F._settledAt(R,M,oe)},function(oe){return F._settledAt(D,M,oe)})},C}();function me(C){return new Q(this,C).promise}function re(C){var O=this;return E(C)?new O(function(j,M){for(var F=C.length,oe=0;oe<F;oe++)O.resolve(C[oe]).then(j,M)}):new O(function(j,M){return M(new TypeError("You must pass an array to race."))})}function J(C){var O=this,j=new O(S);return q(j,C),j}function be(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Ee(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var Le=function(){function C(O){this[x]=ge(),this._result=this._state=void 0,this._subscribers=[],S!==O&&(typeof O!="function"&&be(),this instanceof C?pe(this,O):Ee())}return C.prototype.catch=function(j){return this.then(null,j)},C.prototype.finally=function(j){var M=this,F=M.constructor;return b(j)?M.then(function(oe){return F.resolve(j()).then(function(){return oe})},function(oe){return F.resolve(j()).then(function(){throw oe})}):M.then(j,j)},C}();Le.prototype.then=y,Le.all=me,Le.race=re,Le.resolve=n,Le.reject=J,Le._setScheduler=h,Le._setAsap=a,Le._asap=u;function H(){var C=void 0;if(typeof Z!="undefined")C=Z;else if(typeof self!="undefined")C=self;else try{C=Function("return this")()}catch(M){throw new Error("polyfill failed because global object is unavailable in this environment")}var O=C.Promise;if(O){var j=null;try{j=Object.prototype.toString.call(O.resolve())}catch(M){}if(j==="[object Promise]"&&!O.cast)return}C.Promise=Le}return Le.polyfill=H,Le.Promise=Le,Le})}).call(this,he("Q2Ig"),he("IyRk"))},E9nw:function(rt,tt){rt.exports=function(){var he=document.getSelection();if(!he.rangeCount)return function(){};for(var Se=document.activeElement,Z=[],U=0;U<he.rangeCount;U++)Z.push(he.getRangeAt(U));switch(Se.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":Se.blur();break;default:Se=null;break}return he.removeAllRanges(),function(){he.type==="Caret"&&he.removeAllRanges(),he.rangeCount||Z.forEach(function(b){he.addRange(b)}),Se&&Se.focus()}}},GUcZ:function(rt,tt,he){"use strict";var Se=he("fWQN"),Z=he("mtLc"),U=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(P,W){return P.__proto__=W,P},Object.assign=Object.assign||function(P){if(P==null)throw new TypeError("Cannot convert undefined or null to object");for(var W=Object(P),K=1;K<arguments.length;K++){var Y=arguments[K];if(Y!=null)for(var le in Y)Y.hasOwnProperty(le)&&(W[le]=Y[le])}return W},typeof self.Promise!="function"&&he("E2g8").polyfill()}}]),ce}();U.install();var b=U,L=he("+qE3"),E=he.n(L),A=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"e",value:function(P,W){(!P||ce.FORCE_GLOBAL_TAG)&&(P=ce.GLOBAL_TAG);var K="[".concat(P,"] > ").concat(W);if(ce.ENABLE_CALLBACK&&ce.emitter.emit("log","error",K),!ce.ENABLE_ERROR)return;console.error?console.error(K):console.warn?console.warn(K):console.log(K)}},{key:"i",value:function(P,W){(!P||ce.FORCE_GLOBAL_TAG)&&(P=ce.GLOBAL_TAG);var K="[".concat(P,"] > ").concat(W);if(ce.ENABLE_CALLBACK&&ce.emitter.emit("log","info",K),!ce.ENABLE_INFO)return;console.info?console.info(K):console.log(K)}},{key:"w",value:function(P,W){(!P||ce.FORCE_GLOBAL_TAG)&&(P=ce.GLOBAL_TAG);var K="[".concat(P,"] > ").concat(W);if(ce.ENABLE_CALLBACK&&ce.emitter.emit("log","warn",K),!ce.ENABLE_WARN)return;console.warn?console.warn(K):console.log(K)}},{key:"d",value:function(P,W){(!P||ce.FORCE_GLOBAL_TAG)&&(P=ce.GLOBAL_TAG);var K="[".concat(P,"] > ").concat(W);if(ce.ENABLE_CALLBACK&&ce.emitter.emit("log","debug",K),!ce.ENABLE_DEBUG)return;console.debug?console.debug(K):console.log(K)}},{key:"v",value:function(P,W){(!P||ce.FORCE_GLOBAL_TAG)&&(P=ce.GLOBAL_TAG);var K="[".concat(P,"] > ").concat(W);if(ce.ENABLE_CALLBACK&&ce.emitter.emit("log","verbose",K),!ce.ENABLE_VERBOSE)return;console.log(K)}}]),ce}();A.GLOBAL_TAG="flv.js",A.FORCE_GLOBAL_TAG=!1,A.ENABLE_ERROR=!0,A.ENABLE_INFO=!0,A.ENABLE_WARN=!0,A.ENABLE_DEBUG=!0,A.ENABLE_VERBOSE=!0,A.ENABLE_CALLBACK=!1,A.emitter=new E.a;var w=A,v=function(){function ce(){Object(Se.a)(this,ce),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return Object(Z.a)(ce,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(P){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=P,this._totalBytes+=P):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=P,this._totalBytes+=P):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=P,this._totalBytes+=P,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var P=(this._now()-this._lastCheckpoint)/1e3;return P==0&&(P=1),this._intervalBytes/P/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var P=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/P/1024}}]),ce}(),u=v,h=he("yKVA"),a=he("879j"),t=function(){function ce(ne){Object(Se.a)(this,ce),this._message=ne}return Object(Z.a)(ce,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),ce}(),i=function(ce){Object(h.a)(P,ce);var ne=Object(a.a)(P);function P(W){return Object(Se.a)(this,P),ne.call(this,W)}return Object(Z.a)(P,[{key:"name",get:function(){return"IllegalStateException"}}]),P}(t),l=function(ce){Object(h.a)(P,ce);var ne=Object(a.a)(P);function P(W){return Object(Se.a)(this,P),ne.call(this,W)}return Object(Z.a)(P,[{key:"name",get:function(){return"InvalidArgumentException"}}]),P}(t),c=function(ce){Object(h.a)(P,ce);var ne=Object(a.a)(P);function P(W){return Object(Se.a)(this,P),ne.call(this,W)}return Object(Z.a)(P,[{key:"name",get:function(){return"NotImplementedException"}}]),P}(t),o={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},e={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},s=function(){function ce(ne){Object(Se.a)(this,ce),this._type=ne||"undefined",this._status=o.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._status=o.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===o.kConnecting||this._status===o.kBuffering}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(P){this._onContentLengthKnown=P}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(P){this._onURLRedirect=P}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(P){this._onDataArrival=P}},{key:"onError",get:function(){return this._onError},set:function(P){this._onError=P}},{key:"onComplete",get:function(){return this._onComplete},set:function(P){this._onComplete=P}},{key:"open",value:function(P,W){throw new c("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new c("Unimplemented abstract function!")}}]),ce}(),r=he("oZsa");function d(ce,ne){for(;!Object.prototype.hasOwnProperty.call(ce,ne)&&!(ce=Object(r.a)(ce),ce===null););return ce}function f(ce,ne,P){return typeof Reflect!="undefined"&&Reflect.get?f=Reflect.get:f=function(K,Y,le){var Ae=d(K,Y);if(!Ae)return;var Ce=Object.getOwnPropertyDescriptor(Ae,Y);return Ce.get?Ce.get.call(le):Ce.value},f(ce,ne,P||ce)}var g={};function m(){var ce=self.navigator.userAgent.toLowerCase(),ne=/(edge)\/([\w.]+)/.exec(ce)||/(opr)[\/]([\w.]+)/.exec(ce)||/(chrome)[ \/]([\w.]+)/.exec(ce)||/(iemobile)[\/]([\w.]+)/.exec(ce)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ce)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ce)||/(webkit)[ \/]([\w.]+)/.exec(ce)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ce)||/(msie) ([\w.]+)/.exec(ce)||ce.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(ce)||ce.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(ce)||[],P=/(ipad)/.exec(ce)||/(ipod)/.exec(ce)||/(windows phone)/.exec(ce)||/(iphone)/.exec(ce)||/(kindle)/.exec(ce)||/(android)/.exec(ce)||/(windows)/.exec(ce)||/(mac)/.exec(ce)||/(linux)/.exec(ce)||/(cros)/.exec(ce)||[],W={browser:ne[5]||ne[3]||ne[1]||"",version:ne[2]||ne[4]||"0",majorVersion:ne[4]||ne[2]||"0",platform:P[0]||""},K={};if(W.browser){K[W.browser]=!0;var Y=W.majorVersion.split(".");K.version={major:parseInt(W.majorVersion,10),string:W.version},Y.length>1&&(K.version.minor=parseInt(Y[1],10)),Y.length>2&&(K.version.build=parseInt(Y[2],10))}if(W.platform&&(K[W.platform]=!0),(K.chrome||K.opr||K.safari)&&(K.webkit=!0),K.rv||K.iemobile){K.rv&&delete K.rv;var le="msie";W.browser=le,K[le]=!0}if(K.edge){delete K.edge;var Ae="msedge";W.browser=Ae,K[Ae]=!0}if(K.opr){var Ce="opera";W.browser=Ce,K[Ce]=!0}if(K.safari&&K.android){var Fe="android";W.browser=Fe,K[Fe]=!0}K.name=W.browser,K.platform=W.platform;for(var We in g)g.hasOwnProperty(We)&&delete g[We];Object.assign(g,K)}m();var p=g,_=function(ce){Object(h.a)(P,ce);var ne=Object(a.a)(P);function P(W,K){var Y;return Object(Se.a)(this,P),Y=ne.call(this,"fetch-stream-loader"),Y.TAG="FetchStreamLoader",Y._seekHandler=W,Y._config=K,Y._needStash=!0,Y._requestAbort=!1,Y._contentLength=null,Y._receivedLength=0,Y}return Object(Z.a)(P,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),f(Object(r.a)(P.prototype),"destroy",this).call(this)}},{key:"open",value:function(K,Y){var le=this;this._dataSource=K,this._range=Y;var Ae=K.url;this._config.reuseRedirectedURL&&K.redirectedURL!=null&&(Ae=K.redirectedURL);var Ce=this._seekHandler.getConfig(Ae,Y),Fe=new self.Headers;if(typeof Ce.headers=="object"){var We=Ce.headers;for(var je in We)We.hasOwnProperty(je)&&Fe.append(je,We[je])}var Qe={method:"GET",headers:Fe,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var qe in this._config.headers)Fe.append(qe,this._config.headers[qe]);K.cors===!1&&(Qe.mode="same-origin"),K.withCredentials&&(Qe.credentials="include"),K.referrerPolicy&&(Qe.referrerPolicy=K.referrerPolicy),this._status=o.kConnecting,self.fetch(Ce.url,Qe).then(function(Ne){if(le._requestAbort){le._requestAbort=!1,le._status=o.kIdle;return}if(Ne.ok&&Ne.status>=200&&Ne.status<=299){if(Ne.url!==Ce.url&&le._onURLRedirect){var $e=le._seekHandler.removeURLParameters(Ne.url);le._onURLRedirect($e)}var Ze=Ne.headers.get("Content-Length");return Ze!=null&&(le._contentLength=parseInt(Ze),le._contentLength!==0&&(le._onContentLengthKnown&&le._onContentLengthKnown(le._contentLength))),le._pump.call(le,Ne.body.getReader())}else if(le._status=o.kError,le._onError)le._onError(e.HTTP_STATUS_CODE_INVALID,{code:Ne.status,msg:Ne.statusText});else throw new t("FetchStreamLoader: Http code invalid, "+Ne.status+" "+Ne.statusText)}).catch(function(Ne){if(le._status=o.kError,le._onError)le._onError(e.EXCEPTION,{code:-1,msg:Ne.message});else throw Ne})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(K){var Y=this;return K.read().then(function(le){if(le.done)if(Y._contentLength!==null&&Y._receivedLength<Y._contentLength){Y._status=o.kError;var Ae=e.EARLY_EOF,Ce={code:-1,msg:"Fetch stream meet Early-EOF"};if(Y._onError)Y._onError(Ae,Ce);else throw new t(Ce.msg)}else Y._status=o.kComplete,Y._onComplete&&Y._onComplete(Y._range.from,Y._range.from+Y._receivedLength-1);else{if(Y._requestAbort===!0)return Y._requestAbort=!1,Y._status=o.kComplete,K.cancel();Y._status=o.kBuffering;var Fe=le.value.buffer,We=Y._range.from+Y._receivedLength;Y._receivedLength+=Fe.byteLength,Y._onDataArrival&&Y._onDataArrival(Fe,We,Y._receivedLength),Y._pump(K)}}).catch(function(le){if(le.code===11&&p.msedge)return;Y._status=o.kError;var Ae=0,Ce=null;if((le.code===19||le.message==="network error")&&(Y._contentLength===null||Y._contentLength!==null&&Y._receivedLength<Y._contentLength)?(Ae=e.EARLY_EOF,Ce={code:le.code,msg:"Fetch stream meet Early-EOF"}):(Ae=e.EXCEPTION,Ce={code:le.code,msg:le.message}),Y._onError)Y._onError(Ae,Ce);else throw new t(Ce.msg)})}}],[{key:"isSupported",value:function(){try{var K=p.msedge&&p.version.minor>=15048,Y=p.msedge?K:!0;return self.fetch&&self.ReadableStream&&Y}catch(le){return!1}}}]),P}(s),y=_,n=function(ce){Object(h.a)(P,ce);var ne=Object(a.a)(P);function P(W,K){var Y;return Object(Se.a)(this,P),Y=ne.call(this,"xhr-moz-chunked-loader"),Y.TAG="MozChunkedLoader",Y._seekHandler=W,Y._config=K,Y._needStash=!0,Y._xhr=null,Y._requestAbort=!1,Y._contentLength=null,Y._receivedLength=0,Y}return Object(Z.a)(P,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),f(Object(r.a)(P.prototype),"destroy",this).call(this)}},{key:"open",value:function(K,Y){this._dataSource=K,this._range=Y;var le=K.url;this._config.reuseRedirectedURL&&K.redirectedURL!=null&&(le=K.redirectedURL);var Ae=this._seekHandler.getConfig(le,Y);this._requestURL=Ae.url;var Ce=this._xhr=new XMLHttpRequest;if(Ce.open("GET",Ae.url,!0),Ce.responseType="moz-chunked-arraybuffer",Ce.onreadystatechange=this._onReadyStateChange.bind(this),Ce.onprogress=this._onProgress.bind(this),Ce.onloadend=this._onLoadEnd.bind(this),Ce.onerror=this._onXhrError.bind(this),K.withCredentials&&(Ce.withCredentials=!0),typeof Ae.headers=="object"){var Fe=Ae.headers;for(var We in Fe)Fe.hasOwnProperty(We)&&Ce.setRequestHeader(We,Fe[We])}if(typeof this._config.headers=="object"){var je=this._config.headers;for(var Qe in je)je.hasOwnProperty(Qe)&&Ce.setRequestHeader(Qe,je[Qe])}this._status=o.kConnecting,Ce.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=o.kComplete}},{key:"_onReadyStateChange",value:function(K){var Y=K.target;if(Y.readyState===2){if(Y.responseURL!=null&&Y.responseURL!==this._requestURL&&this._onURLRedirect){var le=this._seekHandler.removeURLParameters(Y.responseURL);this._onURLRedirect(le)}if(Y.status!==0&&(Y.status<200||Y.status>299))if(this._status=o.kError,this._onError)this._onError(e.HTTP_STATUS_CODE_INVALID,{code:Y.status,msg:Y.statusText});else throw new t("MozChunkedLoader: Http code invalid, "+Y.status+" "+Y.statusText);else this._status=o.kBuffering}}},{key:"_onProgress",value:function(K){if(this._status===o.kError)return;this._contentLength===null&&(K.total!==null&&K.total!==0&&(this._contentLength=K.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var Y=K.target.response,le=this._range.from+this._receivedLength;this._receivedLength+=Y.byteLength,this._onDataArrival&&this._onDataArrival(Y,le,this._receivedLength)}},{key:"_onLoadEnd",value:function(K){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===o.kError)return;this._status=o.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function(K){this._status=o.kError;var Y=0,le=null;if(this._contentLength&&K.loaded<this._contentLength?(Y=e.EARLY_EOF,le={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(Y=e.EXCEPTION,le={code:-1,msg:K.constructor.name+" "+K.type}),this._onError)this._onError(Y,le);else throw new t(le.msg)}}],[{key:"isSupported",value:function(){try{var K=new XMLHttpRequest;return K.open("GET","https://example.com",!0),K.responseType="moz-chunked-arraybuffer",K.responseType==="moz-chunked-arraybuffer"}catch(Y){return w.w("MozChunkedLoader",Y.message),!1}}}]),P}(s),x=n,S=function(ce){Object(h.a)(P,ce);var ne=Object(a.a)(P);function P(W,K){var Y;return Object(Se.a)(this,P),Y=ne.call(this,"xhr-msstream-loader"),Y.TAG="MSStreamLoader",Y._seekHandler=W,Y._config=K,Y._needStash=!0,Y._xhr=null,Y._reader=null,Y._totalRange=null,Y._currentRange=null,Y._currentRequestURL=null,Y._currentRedirectedURL=null,Y._contentLength=null,Y._receivedLength=0,Y._bufferLimit=16*1024*1024,Y._lastTimeBufferSize=0,Y._isReconnecting=!1,Y}return Object(Z.a)(P,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),f(Object(r.a)(P.prototype),"destroy",this).call(this)}},{key:"open",value:function(K,Y){this._internalOpen(K,Y,!1)}},{key:"_internalOpen",value:function(K,Y,le){this._dataSource=K,le?this._currentRange=Y:this._totalRange=Y;var Ae=K.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Ae=this._currentRedirectedURL:K.redirectedURL!=null&&(Ae=K.redirectedURL));var Ce=this._seekHandler.getConfig(Ae,Y);this._currentRequestURL=Ce.url;var Fe=this._reader=new self.MSStreamReader;Fe.onprogress=this._msrOnProgress.bind(this),Fe.onload=this._msrOnLoad.bind(this),Fe.onerror=this._msrOnError.bind(this);var We=this._xhr=new XMLHttpRequest;if(We.open("GET",Ce.url,!0),We.responseType="ms-stream",We.onreadystatechange=this._xhrOnReadyStateChange.bind(this),We.onerror=this._xhrOnError.bind(this),K.withCredentials&&(We.withCredentials=!0),typeof Ce.headers=="object"){var je=Ce.headers;for(var Qe in je)je.hasOwnProperty(Qe)&&We.setRequestHeader(Qe,je[Qe])}if(typeof this._config.headers=="object"){var qe=this._config.headers;for(var Ne in qe)qe.hasOwnProperty(Ne)&&We.setRequestHeader(Ne,qe[Ne])}this._isReconnecting?this._isReconnecting=!1:this._status=o.kConnecting,We.send()}},{key:"abort",value:function(){this._internalAbort(),this._status=o.kComplete}},{key:"_internalAbort",value:function(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}},{key:"_xhrOnReadyStateChange",value:function(K){var Y=K.target;if(Y.readyState===2)if(Y.status>=200&&Y.status<=299){if(this._status=o.kBuffering,Y.responseURL!=null){var le=this._seekHandler.removeURLParameters(Y.responseURL);Y.responseURL!==this._currentRequestURL&&le!==this._currentRedirectedURL&&(this._currentRedirectedURL=le,this._onURLRedirect&&this._onURLRedirect(le))}var Ae=Y.getResponseHeader("Content-Length");if(Ae!=null&&this._contentLength==null){var Ce=parseInt(Ae);Ce>0&&(this._contentLength=Ce,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=o.kError,this._onError)this._onError(e.HTTP_STATUS_CODE_INVALID,{code:Y.status,msg:Y.statusText});else throw new t("MSStreamLoader: Http code invalid, "+Y.status+" "+Y.statusText);else if(Y.readyState===3&&(Y.status>=200&&Y.status<=299)){this._status=o.kBuffering;var Fe=Y.response;this._reader.readAsArrayBuffer(Fe)}}},{key:"_xhrOnError",value:function(K){this._status=o.kError;var Y=e.EXCEPTION,le={code:-1,msg:K.constructor.name+" "+K.type};if(this._onError)this._onError(Y,le);else throw new t(le.msg)}},{key:"_msrOnProgress",value:function(K){var Y=K.target,le=Y.result;if(le==null){this._doReconnectIfNeeded();return}var Ae=le.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=le.byteLength;var Ce=this._totalRange.from+this._receivedLength;this._receivedLength+=Ae.byteLength,this._onDataArrival&&this._onDataArrival(Ae,Ce,this._receivedLength),le.byteLength>=this._bufferLimit&&(w.v(this.TAG,"MSStream buffer exceeded max size near ".concat(Ce+Ae.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();var K={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,K,!0)}}},{key:"_msrOnLoad",value:function(K){this._status=o.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}},{key:"_msrOnError",value:function(K){this._status=o.kError;var Y=0,le=null;if(this._contentLength&&this._receivedLength<this._contentLength?(Y=e.EARLY_EOF,le={code:-1,msg:"MSStream meet Early-Eof"}):(Y=e.EARLY_EOF,le={code:-1,msg:K.constructor.name+" "+K.type}),this._onError)this._onError(Y,le);else throw new t(le.msg)}}],[{key:"isSupported",value:function(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;var K=new XMLHttpRequest;return K.open("GET","https://example.com",!0),K.responseType="ms-stream",K.responseType==="ms-stream"}catch(Y){return w.w("MSStreamLoader",Y.message),!1}}}]),P}(s),T=S,R=function(ce){Object(h.a)(P,ce);var ne=Object(a.a)(P);function P(W,K){var Y;return Object(Se.a)(this,P),Y=ne.call(this,"xhr-range-loader"),Y.TAG="RangeLoader",Y._seekHandler=W,Y._config=K,Y._needStash=!1,Y._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],Y._currentChunkSizeKB=384,Y._currentSpeedNormalized=0,Y._zeroSpeedChunkCount=0,Y._xhr=null,Y._speedSampler=new u,Y._requestAbort=!1,Y._waitForTotalLength=!1,Y._totalLengthReceived=!1,Y._currentRequestURL=null,Y._currentRedirectedURL=null,Y._currentRequestRange=null,Y._totalLength=null,Y._contentLength=null,Y._receivedLength=0,Y._lastTimeLoaded=0,Y}return Object(Z.a)(P,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),f(Object(r.a)(P.prototype),"destroy",this).call(this)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}},{key:"open",value:function(K,Y){this._dataSource=K,this._range=Y,this._status=o.kConnecting;var le=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(le=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!le?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}},{key:"_openSubRange",value:function(){var K=this._currentChunkSizeKB*1024,Y=this._range.from+this._receivedLength,le=Y+K;this._contentLength!=null&&(le-this._range.from>=this._contentLength&&(le=this._range.from+this._contentLength-1)),this._currentRequestRange={from:Y,to:le},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(K,Y){this._lastTimeLoaded=0;var le=K.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?le=this._currentRedirectedURL:K.redirectedURL!=null&&(le=K.redirectedURL));var Ae=this._seekHandler.getConfig(le,Y);this._currentRequestURL=Ae.url;var Ce=this._xhr=new XMLHttpRequest;if(Ce.open("GET",Ae.url,!0),Ce.responseType="arraybuffer",Ce.onreadystatechange=this._onReadyStateChange.bind(this),Ce.onprogress=this._onProgress.bind(this),Ce.onload=this._onLoad.bind(this),Ce.onerror=this._onXhrError.bind(this),K.withCredentials&&(Ce.withCredentials=!0),typeof Ae.headers=="object"){var Fe=Ae.headers;for(var We in Fe)Fe.hasOwnProperty(We)&&Ce.setRequestHeader(We,Fe[We])}if(typeof this._config.headers=="object"){var je=this._config.headers;for(var Qe in je)je.hasOwnProperty(Qe)&&Ce.setRequestHeader(Qe,je[Qe])}Ce.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=o.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(K){var Y=K.target;if(Y.readyState===2){if(Y.responseURL!=null){var le=this._seekHandler.removeURLParameters(Y.responseURL);Y.responseURL!==this._currentRequestURL&&le!==this._currentRedirectedURL&&(this._currentRedirectedURL=le,this._onURLRedirect&&this._onURLRedirect(le))}if(Y.status>=200&&Y.status<=299){if(this._waitForTotalLength)return;this._status=o.kBuffering}else if(this._status=o.kError,this._onError)this._onError(e.HTTP_STATUS_CODE_INVALID,{code:Y.status,msg:Y.statusText});else throw new t("RangeLoader: Http code invalid, "+Y.status+" "+Y.statusText)}}},{key:"_onProgress",value:function(K){if(this._status===o.kError)return;if(this._contentLength===null){var Y=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,Y=!0;var le=K.total;this._internalAbort(),le!=null&le!==0&&(this._totalLength=le)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,Y){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Ae=K.loaded-this._lastTimeLoaded;this._lastTimeLoaded=K.loaded,this._speedSampler.addBytes(Ae)}},{key:"_normalizeSpeed",value:function(K){var Y=this._chunkSizeKBList,le=Y.length-1,Ae=0,Ce=0,Fe=le;if(K<Y[0])return Y[0];for(;Ce<=Fe;){if(Ae=Ce+Math.floor((Fe-Ce)/2),Ae===le||K>=Y[Ae]&&K<Y[Ae+1])return Y[Ae];Y[Ae]<K?Ce=Ae+1:Fe=Ae-1}}},{key:"_onLoad",value:function(K){if(this._status===o.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var Y=this._speedSampler.lastSecondKBps;if(Y===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(Y=this._speedSampler.currentKBps)),Y!==0){var le=this._normalizeSpeed(Y);this._currentSpeedNormalized!==le&&(this._currentSpeedNormalized=le,this._currentChunkSizeKB=le)}var Ae=K.target.response,Ce=this._range.from+this._receivedLength;this._receivedLength+=Ae.byteLength;var Fe=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():Fe=!0,this._onDataArrival&&this._onDataArrival(Ae,Ce,this._receivedLength),Fe&&(this._status=o.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},{key:"_onXhrError",value:function(K){this._status=o.kError;var Y=0,le=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(Y=e.EARLY_EOF,le={code:-1,msg:"RangeLoader meet Early-Eof"}):(Y=e.EXCEPTION,le={code:-1,msg:K.constructor.name+" "+K.type}),this._onError)this._onError(Y,le);else throw new t(le.msg)}}],[{key:"isSupported",value:function(){try{var K=new XMLHttpRequest;return K.open("GET","https://example.com",!0),K.responseType="arraybuffer",K.responseType==="arraybuffer"}catch(Y){return w.w("RangeLoader",Y.message),!1}}}]),P}(s),D=R,I=function(ce){Object(h.a)(P,ce);var ne=Object(a.a)(P);function P(){var W;return Object(Se.a)(this,P),W=ne.call(this,"websocket-loader"),W.TAG="WebSocketLoader",W._needStash=!0,W._ws=null,W._requestAbort=!1,W._receivedLength=0,W}return Object(Z.a)(P,[{key:"destroy",value:function(){this._ws&&this.abort(),f(Object(r.a)(P.prototype),"destroy",this).call(this)}},{key:"open",value:function(K){try{var Y=this._ws=new self.WebSocket(K.url);Y.binaryType="arraybuffer",Y.onopen=this._onWebSocketOpen.bind(this),Y.onclose=this._onWebSocketClose.bind(this),Y.onmessage=this._onWebSocketMessage.bind(this),Y.onerror=this._onWebSocketError.bind(this),this._status=o.kConnecting}catch(Ae){this._status=o.kError;var le={code:Ae.code,msg:Ae.message};if(this._onError)this._onError(e.EXCEPTION,le);else throw new t(le.msg)}}},{key:"abort",value:function(){var K=this._ws;K&&(K.readyState===0||K.readyState===1)&&(this._requestAbort=!0,K.close()),this._ws=null,this._status=o.kComplete}},{key:"_onWebSocketOpen",value:function(K){this._status=o.kBuffering}},{key:"_onWebSocketClose",value:function(K){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=o.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}},{key:"_onWebSocketMessage",value:function(K){var Y=this;if(K.data instanceof ArrayBuffer)this._dispatchArrayBuffer(K.data);else if(K.data instanceof Blob){var le=new FileReader;le.onload=function(){Y._dispatchArrayBuffer(le.result)},le.readAsArrayBuffer(K.data)}else{this._status=o.kError;var Ae={code:-1,msg:"Unsupported WebSocket message type: "+K.data.constructor.name};if(this._onError)this._onError(e.EXCEPTION,Ae);else throw new t(Ae.msg)}}},{key:"_dispatchArrayBuffer",value:function(K){var Y=K,le=this._receivedLength;this._receivedLength+=Y.byteLength,this._onDataArrival&&this._onDataArrival(Y,le,this._receivedLength)}},{key:"_onWebSocketError",value:function(K){this._status=o.kError;var Y={code:K.code,msg:K.message};if(this._onError)this._onError(e.EXCEPTION,Y);else throw new t(Y.msg)}}],[{key:"isSupported",value:function(){try{return typeof self.WebSocket!="undefined"}catch(K){return!1}}}]),P}(s),B=I,G=function(){function ce(ne){Object(Se.a)(this,ce),this._zeroStart=ne||!1}return Object(Z.a)(ce,[{key:"getConfig",value:function(P,W){var K={};if(W.from!==0||W.to!==-1){var Y;W.to!==-1?Y="bytes=".concat(W.from.toString(),"-").concat(W.to.toString()):Y="bytes=".concat(W.from.toString(),"-"),K.Range=Y}else this._zeroStart&&(K.Range="bytes=0-");return{url:P,headers:K}}},{key:"removeURLParameters",value:function(P){return P}}]),ce}(),k=G,$=function(){function ce(ne,P){Object(Se.a)(this,ce),this._startName=ne,this._endName=P}return Object(Z.a)(ce,[{key:"getConfig",value:function(P,W){var K=P;if(W.from!==0||W.to!==-1){var Y=!0;K.indexOf("?")===-1&&(K+="?",Y=!1),Y&&(K+="&"),K+="".concat(this._startName,"=").concat(W.from.toString()),W.to!==-1&&(K+="&".concat(this._endName,"=").concat(W.to.toString()))}return{url:K,headers:{}}}},{key:"removeURLParameters",value:function(P){var W=P.split("?")[0],K=void 0,Y=P.indexOf("?");Y!==-1&&(K=P.substring(Y+1));var le="";if(K!=null&&K.length>0)for(var Ae=K.split("&"),Ce=0;Ce<Ae.length;Ce++){var Fe=Ae[Ce].split("="),We=Ce>0;Fe[0]!==this._startName&&Fe[0]!==this._endName&&(We&&(le+="&"),le+=Ae[Ce])}return le.length===0?W:W+"?"+le}}]),ce}(),X=$,V=function(){function ce(ne,P,W){Object(Se.a)(this,ce),this.TAG="IOController",this._config=P,this._extraData=W,this._stashInitialSize=1024*384,P.stashInitialSize!=null&&P.stashInitialSize>0&&(this._stashInitialSize=P.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,P.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=ne,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(ne.url),this._refTotalLength=ne.filesize?ne.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new u,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"status",get:function(){return this._loader.status}},{key:"extraData",get:function(){return this._extraData},set:function(P){this._extraData=P}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(P){this._onDataArrival=P}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(P){this._onSeeked=P}},{key:"onError",get:function(){return this._onError},set:function(P){this._onError=P}},{key:"onComplete",get:function(){return this._onComplete},set:function(P){this._onComplete=P}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(P){this._onRedirect=P}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(P){this._onRecoveredEarlyEof=P}},{key:"currentURL",get:function(){return this._dataSource.url}},{key:"hasRedirect",get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}},{key:"currentRedirectedURL",get:function(){return this._redirectedURL||this._dataSource.redirectedURL}},{key:"currentSpeed",get:function(){return this._loaderClass===D?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var P=this._config;if(P.seekType==="range")this._seekHandler=new k(this._config.rangeLoadZeroStart);else if(P.seekType==="param"){var W=P.seekParamStart||"bstart",K=P.seekParamEnd||"bend";this._seekHandler=new X(W,K)}else if(P.seekType==="custom"){if(typeof P.customSeekHandler!="function")throw new l("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new P.customSeekHandler}else throw new l("Invalid seekType in config: ".concat(P.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=B;else if(y.isSupported())this._loaderClass=y;else if(x.isSupported())this._loaderClass=x;else if(D.isSupported())this._loaderClass=D;else throw new t("Your browser doesn't support xhr with arraybuffer responseType!")}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(P){this._currentRange={from:0,to:-1},P&&(this._currentRange.from=P),this._speedSampler.reset(),P||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var P=this._resumeFrom;this._resumeFrom=0,this._internalSeek(P,!0)}}},{key:"seek",value:function(P){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(P,!0)}},{key:"_internalSeek",value:function(P,W){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(W),this._loader.destroy(),this._loader=null;var K={from:P,to:-1};this._currentRange={from:K.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,K),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(P){if(!P||typeof P!="string"||P.length===0)throw new l("Url must be a non-empty string!");this._dataSource.url=P}},{key:"_expandBuffer",value:function(P){for(var W=this._stashSize;W+1024*1024*1<P;)W*=2;if(W+=1024*1024*1,W===this._bufferSize)return;var K=new ArrayBuffer(W);if(this._stashUsed>0){var Y=new Uint8Array(this._stashBuffer,0,this._stashUsed),le=new Uint8Array(K,0,W);le.set(Y,0)}this._stashBuffer=K,this._bufferSize=W}},{key:"_normalizeSpeed",value:function(P){var W=this._speedNormalizeList,K=W.length-1,Y=0,le=0,Ae=K;if(P<W[0])return W[0];for(;le<=Ae;){if(Y=le+Math.floor((Ae-le)/2),Y===K||P>=W[Y]&&P<W[Y+1])return W[Y];W[Y]<P?le=Y+1:Ae=Y-1}}},{key:"_adjustStashSize",value:function(P){var W=0;this._config.isLive||P<512?W=P:P>=512&&P<=1024?W=Math.floor(P*1.5):W=P*2,W>8192&&(W=8192);var K=W*1024+1024*1024*1;this._bufferSize<K&&this._expandBuffer(K),this._stashSize=W*1024}},{key:"_dispatchChunks",value:function(P,W){return this._currentRange.to=W+P.byteLength-1,this._onDataArrival(P,W)}},{key:"_onURLRedirect",value:function(P){this._redirectedURL=P,this._onRedirect&&this._onRedirect(P)}},{key:"_onContentLengthKnown",value:function(P){P&&this._fullRequestFlag&&(this._totalLength=P,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(P,W,K){if(!this._onDataArrival)throw new i("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(P.byteLength);var Y=this._speedSampler.lastSecondKBps;if(Y!==0){var le=this._normalizeSpeed(Y);this._speedNormalized!==le&&(this._speedNormalized=le,this._adjustStashSize(le))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=W),this._stashUsed+P.byteLength<=this._stashSize){var qe=new Uint8Array(this._stashBuffer,0,this._stashSize);qe.set(new Uint8Array(P),this._stashUsed),this._stashUsed+=P.byteLength}else{var Ne=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var $e=this._stashBuffer.slice(0,this._stashUsed),Ze=this._dispatchChunks($e,this._stashByteStart);if(Ze<$e.byteLength){if(Ze>0){var Xe=new Uint8Array($e,Ze);Ne.set(Xe,0),this._stashUsed=Xe.byteLength,this._stashByteStart+=Ze}}else this._stashUsed=0,this._stashByteStart+=Ze;this._stashUsed+P.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+P.byteLength),Ne=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ne.set(new Uint8Array(P),this._stashUsed),this._stashUsed+=P.byteLength}else{var Be=this._dispatchChunks(P,W);if(Be<P.byteLength){var it=P.byteLength-Be;it>this._bufferSize&&(this._expandBuffer(it),Ne=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ne.set(new Uint8Array(P,Be),0),this._stashUsed+=it,this._stashByteStart=W+Be}}}else if(this._stashUsed===0){var Ae=this._dispatchChunks(P,W);if(Ae<P.byteLength){var Ce=P.byteLength-Ae;Ce>this._bufferSize&&this._expandBuffer(Ce);var Fe=new Uint8Array(this._stashBuffer,0,this._bufferSize);Fe.set(new Uint8Array(P,Ae),0),this._stashUsed+=Ce,this._stashByteStart=W+Ae}}else{this._stashUsed+P.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+P.byteLength);var We=new Uint8Array(this._stashBuffer,0,this._bufferSize);We.set(new Uint8Array(P),this._stashUsed),this._stashUsed+=P.byteLength;var je=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(je<this._stashUsed&&je>0){var Qe=new Uint8Array(this._stashBuffer,je);We.set(Qe,0)}this._stashUsed-=je,this._stashByteStart+=je}}},{key:"_flushStashBuffer",value:function(P){if(this._stashUsed>0){var W=this._stashBuffer.slice(0,this._stashUsed),K=this._dispatchChunks(W,this._stashByteStart),Y=W.byteLength-K;if(K<W.byteLength)if(P)w.w(this.TAG,"".concat(Y," bytes unconsumed data remain when flush buffer, dropped"));else{if(K>0){var le=new Uint8Array(this._stashBuffer,0,this._bufferSize),Ae=new Uint8Array(W,K);le.set(Ae,0),this._stashUsed=Ae.byteLength,this._stashByteStart+=K}return 0}return this._stashUsed=0,this._stashByteStart=0,Y}return 0}},{key:"_onLoaderComplete",value:function(P,W){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(P,W){w.e(this.TAG,"Loader error, code = ".concat(W.code,", msg = ").concat(W.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,P=e.UNRECOVERABLE_EARLY_EOF);switch(P){case e.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var K=this._currentRange.to+1;K<this._totalLength&&(w.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(K,!1));return}P=e.UNRECOVERABLE_EARLY_EOF;break}case e.UNRECOVERABLE_EARLY_EOF:case e.CONNECTING_TIMEOUT:case e.HTTP_STATUS_CODE_INVALID:case e.EXCEPTION:break}if(this._onError)this._onError(P,W);else throw new t("IOException: "+W.msg)}}]),ce}(),N=V,z={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function q(){return Object.assign({},z)}var ee=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"supportMSEH264Playback",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"supportNetworkStreamIO",value:function(){var P=new N({},q()),W=P.loaderType;return P.destroy(),W=="fetch-stream-loader"||W=="xhr-moz-chunked-loader"}},{key:"getNetworkLoaderTypeName",value:function(){var P=new N({},q()),W=P.loaderType;return P.destroy(),W}},{key:"supportNativeMediaPlayback",value:function(P){ce.videoElement==null&&(ce.videoElement=window.document.createElement("video"));var W=ce.videoElement.canPlayType(P);return W==="probably"||W=="maybe"}},{key:"getFeatureList",value:function(){var P={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return P.mseFlvPlayback=ce.supportMSEH264Playback(),P.networkStreamIO=ce.supportNetworkStreamIO(),P.networkLoaderName=ce.getNetworkLoaderTypeName(),P.mseLiveFlvPlayback=P.mseFlvPlayback&&P.networkStreamIO,P.nativeMP4H264Playback=ce.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),P.nativeWebmVP8Playback=ce.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),P.nativeWebmVP9Playback=ce.supportNativeMediaPlayback('video/webm; codecs="vp9"'),P}}]),ce}(),fe=ee,ae={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"},pe=ae,se=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"forceGlobalTag",get:function(){return w.FORCE_GLOBAL_TAG},set:function(P){w.FORCE_GLOBAL_TAG=P,ce._notifyChange()}},{key:"globalTag",get:function(){return w.GLOBAL_TAG},set:function(P){w.GLOBAL_TAG=P,ce._notifyChange()}},{key:"enableAll",get:function(){return w.ENABLE_VERBOSE&&w.ENABLE_DEBUG&&w.ENABLE_INFO&&w.ENABLE_WARN&&w.ENABLE_ERROR},set:function(P){w.ENABLE_VERBOSE=P,w.ENABLE_DEBUG=P,w.ENABLE_INFO=P,w.ENABLE_WARN=P,w.ENABLE_ERROR=P,ce._notifyChange()}},{key:"enableDebug",get:function(){return w.ENABLE_DEBUG},set:function(P){w.ENABLE_DEBUG=P,ce._notifyChange()}},{key:"enableVerbose",get:function(){return w.ENABLE_VERBOSE},set:function(P){w.ENABLE_VERBOSE=P,ce._notifyChange()}},{key:"enableInfo",get:function(){return w.ENABLE_INFO},set:function(P){w.ENABLE_INFO=P,ce._notifyChange()}},{key:"enableWarn",get:function(){return w.ENABLE_WARN},set:function(P){w.ENABLE_WARN=P,ce._notifyChange()}},{key:"enableError",get:function(){return w.ENABLE_ERROR},set:function(P){w.ENABLE_ERROR=P,ce._notifyChange()}},{key:"getConfig",value:function(){return{globalTag:w.GLOBAL_TAG,forceGlobalTag:w.FORCE_GLOBAL_TAG,enableVerbose:w.ENABLE_VERBOSE,enableDebug:w.ENABLE_DEBUG,enableInfo:w.ENABLE_INFO,enableWarn:w.ENABLE_WARN,enableError:w.ENABLE_ERROR,enableCallback:w.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(P){w.GLOBAL_TAG=P.globalTag,w.FORCE_GLOBAL_TAG=P.forceGlobalTag,w.ENABLE_VERBOSE=P.enableVerbose,w.ENABLE_DEBUG=P.enableDebug,w.ENABLE_INFO=P.enableInfo,w.ENABLE_WARN=P.enableWarn,w.ENABLE_ERROR=P.enableError,w.ENABLE_CALLBACK=P.enableCallback}},{key:"_notifyChange",value:function(){var P=ce.emitter;if(P.listenerCount("change")>0){var W=ce.getConfig();P.emit("change",W)}}},{key:"registerListener",value:function(P){ce.emitter.addListener("change",P)}},{key:"removeListener",value:function(P){ce.emitter.removeListener("change",P)}},{key:"addLogListener",value:function(P){w.emitter.addListener("log",P),w.emitter.listenerCount("log")>0&&(w.ENABLE_CALLBACK=!0,ce._notifyChange())}},{key:"removeLogListener",value:function(P){w.emitter.removeListener("log",P),w.emitter.listenerCount("log")===0&&(w.ENABLE_CALLBACK=!1,ce._notifyChange())}}]),ce}();se.emitter=new E.a;var ge=se,ie=function(){function ce(){Object(Se.a)(this,ce),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return Object(Z.a)(ce,[{key:"isComplete",value:function(){var P=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,W=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&P&&W}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(P){if(this.keyframesIndex==null)return null;var W=this.keyframesIndex,K=this._search(W.times,P);return{index:K,milliseconds:W.times[K],fileposition:W.filepositions[K]}}},{key:"_search",value:function(P,W){var K=0,Y=P.length-1,le=0,Ae=0,Ce=Y;for(W<P[0]&&(K=0,Ae=Ce+1);Ae<=Ce;)if(le=Ae+Math.floor((Ce-Ae)/2),le===Y||W>=P[le]&&W<P[le+1]){K=le;break}else P[le]<W?Ae=le+1:Ce=le-1;return K}}]),ce}(),te=ie;function Q(ce,ne,P){var W=ce;if(ne+P<W.length){for(;P--;)if((W[++ne]&192)!==128)return!1;return!0}else return!1}function me(ce){for(var ne=[],P=ce,W=0,K=ce.length;W<K;){if(P[W]<128){ne.push(String.fromCharCode(P[W])),++W;continue}else if(!(P[W]<192)){if(P[W]<224){if(Q(P,W,1)){var Y=(P[W]&31)<<6|P[W+1]&63;if(Y>=128){ne.push(String.fromCharCode(Y&65535)),W+=2;continue}}}else if(P[W]<240){if(Q(P,W,2)){var le=(P[W]&15)<<12|(P[W+1]&63)<<6|P[W+2]&63;if(le>=2048&&(le&63488)!==55296){ne.push(String.fromCharCode(le&65535)),W+=3;continue}}}else if(P[W]<248&&Q(P,W,3)){var Ae=(P[W]&7)<<18|(P[W+1]&63)<<12|(P[W+2]&63)<<6|P[W+3]&63;if(Ae>65536&&Ae<1114112){Ae-=65536,ne.push(String.fromCharCode(Ae>>>10|55296)),ne.push(String.fromCharCode(Ae&1023|56320)),W+=4;continue}}}ne.push(String.fromCharCode(65533)),++W}return ne.join("")}var re=me,J=function(){var ce=new ArrayBuffer(2);return new DataView(ce).setInt16(0,256,!0),new Int16Array(ce)[0]===256}(),be=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"parseScriptData",value:function(P,W,K){var Y={};try{var le=ce.parseValue(P,W,K),Ae=ce.parseValue(P,W+le.size,K-le.size);Y[le.data]=Ae.data}catch(Ce){w.e("AMF",Ce.toString())}return Y}},{key:"parseObject",value:function(P,W,K){if(K<3)throw new i("Data not enough when parse ScriptDataObject");var Y=ce.parseString(P,W,K),le=ce.parseValue(P,W+Y.size,K-Y.size),Ae=le.objectEnd;return{data:{name:Y.data,value:le.data},size:Y.size+le.size,objectEnd:Ae}}},{key:"parseVariable",value:function(P,W,K){return ce.parseObject(P,W,K)}},{key:"parseString",value:function(P,W,K){if(K<2)throw new i("Data not enough when parse String");var Y=new DataView(P,W,K),le=Y.getUint16(0,!J),Ae;return le>0?Ae=re(new Uint8Array(P,W+2,le)):Ae="",{data:Ae,size:2+le}}},{key:"parseLongString",value:function(P,W,K){if(K<4)throw new i("Data not enough when parse LongString");var Y=new DataView(P,W,K),le=Y.getUint32(0,!J),Ae;return le>0?Ae=re(new Uint8Array(P,W+4,le)):Ae="",{data:Ae,size:4+le}}},{key:"parseDate",value:function(P,W,K){if(K<10)throw new i("Data size invalid when parse Date");var Y=new DataView(P,W,K),le=Y.getFloat64(0,!J),Ae=Y.getInt16(8,!J);return le+=Ae*60*1e3,{data:new Date(le),size:8+2}}},{key:"parseValue",value:function(P,W,K){if(K<1)throw new i("Data not enough when parse Value");var Y=new DataView(P,W,K),le=1,Ae=Y.getUint8(0),Ce,Fe=!1;try{switch(Ae){case 0:Ce=Y.getFloat64(1,!J),le+=8;break;case 1:{var We=Y.getUint8(1);Ce=!!We,le+=1;break}case 2:{var je=ce.parseString(P,W+1,K-1);Ce=je.data,le+=je.size;break}case 3:{Ce={};var Qe=0;for((Y.getUint32(K-4,!J)&16777215)===9&&(Qe=3);le<K-4;){var qe=ce.parseObject(P,W+le,K-le-Qe);if(qe.objectEnd)break;Ce[qe.data.name]=qe.data.value,le+=qe.size}if(le<=K-3){var Ne=Y.getUint32(le-1,!J)&16777215;Ne===9&&(le+=3)}break}case 8:{Ce={},le+=4;var $e=0;for((Y.getUint32(K-4,!J)&16777215)===9&&($e=3);le<K-8;){var Ze=ce.parseVariable(P,W+le,K-le-$e);if(Ze.objectEnd)break;Ce[Ze.data.name]=Ze.data.value,le+=Ze.size}if(le<=K-3){var Xe=Y.getUint32(le-1,!J)&16777215;Xe===9&&(le+=3)}break}case 9:Ce=void 0,le=1,Fe=!0;break;case 10:{Ce=[];var Be=Y.getUint32(1,!J);le+=4;for(var it=0;it<Be;it++){var ct=ce.parseValue(P,W+le,K-le);Ce.push(ct.data),le+=ct.size}break}case 11:{var at=ce.parseDate(P,W+1,K-1);Ce=at.data,le+=at.size;break}case 12:{var ut=ce.parseString(P,W+1,K-1);Ce=ut.data,le+=ut.size;break}default:le=K,w.w("AMF","Unsupported AMF value type "+Ae)}}catch(yt){w.e("AMF",yt.toString())}return{data:Ce,size:le,objectEnd:Fe}}}]),ce}(),Ee=be,Le=function(){function ce(ne){Object(Se.a)(this,ce),this.TAG="ExpGolomb",this._buffer=ne,this._buffer_index=0,this._total_bytes=ne.byteLength,this._total_bits=ne.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var P=this._total_bytes-this._buffer_index;if(P<=0)throw new i("ExpGolomb: _fillCurrentWord() but no bytes available");var W=Math.min(4,P),K=new Uint8Array(4);K.set(this._buffer.subarray(this._buffer_index,this._buffer_index+W)),this._current_word=new DataView(K.buffer).getUint32(0,!1),this._buffer_index+=W,this._current_word_bits_left=W*8}},{key:"readBits",value:function(P){if(P>32)throw new l("ExpGolomb: readBits() bits exceeded max 32bits!");if(P<=this._current_word_bits_left){var W=this._current_word>>>32-P;return this._current_word<<=P,this._current_word_bits_left-=P,W}var K=this._current_word_bits_left?this._current_word:0;K=K>>>32-this._current_word_bits_left;var Y=P-this._current_word_bits_left;this._fillCurrentWord();var le=Math.min(Y,this._current_word_bits_left),Ae=this._current_word>>>32-le;return this._current_word<<=le,this._current_word_bits_left-=le,K=K<<le|Ae,K}},{key:"readBool",value:function(){return this.readBits(1)===1}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var P;for(P=0;P<this._current_word_bits_left;P++)if((this._current_word&2147483648>>>P)!==0)return this._current_word<<=P,this._current_word_bits_left-=P,P;return this._fillCurrentWord(),P+this._skipLeadingZero()}},{key:"readUEG",value:function(){var P=this._skipLeadingZero();return this.readBits(P+1)-1}},{key:"readSEG",value:function(){var P=this.readUEG();return P&1?P+1>>>1:-1*(P>>>1)}}]),ce}(),H=Le,C=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"_ebsp2rbsp",value:function(P){for(var W=P,K=W.byteLength,Y=new Uint8Array(K),le=0,Ae=0;Ae<K;Ae++){if(Ae>=2&&(W[Ae]===3&&W[Ae-1]===0&&W[Ae-2]===0))continue;Y[le]=W[Ae],le++}return new Uint8Array(Y.buffer,0,le)}},{key:"parseSPS",value:function(P){var W=ce._ebsp2rbsp(P),K=new H(W);K.readByte();var Y=K.readByte();K.readByte();var le=K.readByte();K.readUEG();var Ae=ce.getProfileString(Y),Ce=ce.getLevelString(le),Fe=1,We=420,je=[0,420,422,444],Qe=8;if((Y===100||Y===110||Y===122||Y===244||Y===44||Y===83||Y===86||Y===118||Y===128||Y===138||Y===144)&&(Fe=K.readUEG(),Fe===3&&K.readBits(1),Fe<=3&&(We=je[Fe]),Qe=K.readUEG()+8,K.readUEG(),K.readBits(1),K.readBool()))for(var qe=Fe!==3?8:12,Ne=0;Ne<qe;Ne++)K.readBool()&&(Ne<6?ce._skipScalingList(K,16):ce._skipScalingList(K,64));K.readUEG();var $e=K.readUEG();if($e===0)K.readUEG();else if($e===1){K.readBits(1),K.readSEG(),K.readSEG();for(var Ze=K.readUEG(),Xe=0;Xe<Ze;Xe++)K.readSEG()}var Be=K.readUEG();K.readBits(1);var it=K.readUEG(),ct=K.readUEG(),at=K.readBits(1);at===0&&K.readBits(1),K.readBits(1);var ut=0,yt=0,Tt=0,mt=0,St=K.readBool();St&&(ut=K.readUEG(),yt=K.readUEG(),Tt=K.readUEG(),mt=K.readUEG());var Lt=1,_t=1,At=0,It=!0,kt=0,Ot=0,Ct=K.readBool();if(Ct){if(K.readBool()){var xt=K.readByte(),Kt=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Nt=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];xt>0&&xt<16?(Lt=Kt[xt-1],_t=Nt[xt-1]):xt===255&&(Lt=K.readByte()<<8|K.readByte(),_t=K.readByte()<<8|K.readByte())}if(K.readBool()&&K.readBool(),K.readBool()&&(K.readBits(4),K.readBool()&&K.readBits(24)),K.readBool()&&(K.readUEG(),K.readUEG()),K.readBool()){var wt=K.readBits(32),Rt=K.readBits(32);It=K.readBool(),kt=Rt,Ot=wt*2,At=kt/Ot}}var Mt=1;(Lt!==1||_t!==1)&&(Mt=Lt/_t);var Ft=0,Bt=0;if(Fe===0)Ft=1,Bt=2-at;else{var jt=Fe===3?1:2,Gt=Fe===1?2:1;Ft=jt,Bt=Gt*(2-at)}var Ut=(it+1)*16,Wt=(2-at)*((ct+1)*16);Ut-=(ut+yt)*Ft,Wt-=(Tt+mt)*Bt;var Ht=Math.ceil(Ut*Mt);return K.destroy(),K=null,{profile_string:Ae,level_string:Ce,bit_depth:Qe,ref_frames:Be,chroma_format:We,chroma_format_string:ce.getChromaFormatString(We),frame_rate:{fixed:It,fps:At,fps_den:Ot,fps_num:kt},sar_ratio:{width:Lt,height:_t},codec_size:{width:Ut,height:Wt},present_size:{width:Ht,height:Wt}}}},{key:"_skipScalingList",value:function(P,W){for(var K=8,Y=8,le=0,Ae=0;Ae<W;Ae++)Y!==0&&(le=P.readSEG(),Y=(K+le+256)%256),K=Y===0?K:Y}},{key:"getProfileString",value:function(P){switch(P){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelString",value:function(P){return(P/10).toFixed(1)}},{key:"getChromaFormatString",value:function(P){switch(P){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),ce}(),O=C,j={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"},M=j;function F(ce){return ce>>>8&255|(ce&255)<<8}function oe(ce){return(ce&4278190080)>>>24|(ce&16711680)>>>8|(ce&65280)<<8|(ce&255)<<24}function ve(ce,ne){return ce[ne]<<24|ce[ne+1]<<16|ce[ne+2]<<8|ce[ne+3]}var ke=function(){function ce(ne,P){Object(Se.a)(this,ce),this.TAG="FLVDemuxer",this._config=P,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=ne.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=ne.hasAudioTrack,this._hasVideo=ne.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new te,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var W=new ArrayBuffer(2);return new DataView(W).setInt16(0,256,!0),new Int16Array(W)[0]===256}()}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}},{key:"bindDataSource",value:function(P){return P.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(P){this._onTrackMetadata=P}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(P){this._onMediaInfo=P}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(P){this._onMetaDataArrived=P}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(P){this._onScriptDataArrived=P}},{key:"onError",get:function(){return this._onError},set:function(P){this._onError=P}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(P){this._onDataAvailable=P}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(P){this._timestampBase=P}},{key:"overridedDuration",get:function(){return this._duration},set:function(P){this._durationOverrided=!0,this._duration=P,this._mediaInfo.duration=P}},{key:"overridedHasAudio",set:function(P){this._hasAudioFlagOverrided=!0,this._hasAudio=P,this._mediaInfo.hasAudio=P}},{key:"overridedHasVideo",set:function(P){this._hasVideoFlagOverrided=!0,this._hasVideo=P,this._mediaInfo.hasVideo=P}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new te}},{key:"_isInitialMetadataDispatched",value:function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}},{key:"parseChunks",value:function(P,W){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new i("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var K=0,Y=this._littleEndian;if(W===0)if(P.byteLength>13){var le=ce.probe(P);K=le.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,W+K!==this._dataOffset&&w.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Ae=new DataView(P,K),Ce=Ae.getUint32(0,!Y);Ce!==0&&w.w(this.TAG,"PrevTagSize0 !== 0 !!!"),K+=4}for(;K<P.byteLength;){this._dispatch=!0;var Fe=new DataView(P,K);if(K+11+4>P.byteLength)break;var We=Fe.getUint8(0),je=Fe.getUint32(0,!Y)&16777215;if(K+11+je+4>P.byteLength)break;if(We!==8&&We!==9&&We!==18){w.w(this.TAG,"Unsupported tag type ".concat(We,", skipped")),K+=11+je+4;continue}var Qe=Fe.getUint8(4),qe=Fe.getUint8(5),Ne=Fe.getUint8(6),$e=Fe.getUint8(7),Ze=Ne|qe<<8|Qe<<16|$e<<24,Xe=Fe.getUint32(7,!Y)&16777215;Xe!==0&&w.w(this.TAG,"Meet tag which has StreamID != 0!");var Be=K+11;switch(We){case 8:this._parseAudioData(P,Be,je,Ze);break;case 9:this._parseVideoData(P,Be,je,Ze,W+K);break;case 18:this._parseScriptData(P,Be,je);break}var it=Fe.getUint32(11+je,!Y);it!==11+je&&w.w(this.TAG,"Invalid PrevTagSize ".concat(it)),K+=11+je+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),K}},{key:"_parseScriptData",value:function(P,W,K){var Y=Ee.parseScriptData(P,W,K);if(Y.hasOwnProperty("onMetaData")){if(Y.onMetaData==null||typeof Y.onMetaData!="object"){w.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&w.w(this.TAG,"Found another onMetaData tag!"),this._metadata=Y;var le=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},le)),typeof le.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=le.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof le.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=le.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof le.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=le.audiodatarate),typeof le.videodatarate=="number"&&(this._mediaInfo.videoDataRate=le.videodatarate),typeof le.width=="number"&&(this._mediaInfo.width=le.width),typeof le.height=="number"&&(this._mediaInfo.height=le.height),typeof le.duration=="number"){if(!this._durationOverrided){var Ae=Math.floor(le.duration*this._timescale);this._duration=Ae,this._mediaInfo.duration=Ae}}else this._mediaInfo.duration=0;if(typeof le.framerate=="number"){var Ce=Math.floor(le.framerate*1e3);if(Ce>0){var Fe=Ce/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Fe,this._referenceFrameRate.fps_num=Ce,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Fe}}if(typeof le.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var We=le.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(We),le.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=le,w.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(Y).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},Y)))}},{key:"_parseKeyframesIndex",value:function(P){for(var W=[],K=[],Y=1;Y<P.times.length;Y++){var le=this._timestampBase+Math.floor(P.times[Y]*1e3);W.push(le),K.push(P.filepositions[Y])}return{times:W,filepositions:K}}},{key:"_parseAudioData",value:function(P,W,K,Y){if(K<=1){w.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;var le=this._littleEndian,Ae=new DataView(P,W,K),Ce=Ae.getUint8(0),Fe=Ce>>>4;if(Fe!==2&&Fe!==10){this._onError(M.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+Fe);return}var We=0,je=(Ce&12)>>>2;if(je>=0&&je<=4)We=this._flvSoundRateTable[je];else{this._onError(M.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+je);return}var Qe=(Ce&2)>>>1,qe=Ce&1,Ne=this._audioMetadata,$e=this._audioTrack;if(Ne||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),Ne=this._audioMetadata={},Ne.type="audio",Ne.id=$e.id,Ne.timescale=this._timescale,Ne.duration=this._duration,Ne.audioSampleRate=We,Ne.channelCount=qe===0?1:2),Fe===10){var Ze=this._parseAACAudioData(P,W+1,K-1);if(Ze==null)return;if(Ze.packetType===0){Ne.config&&w.w(this.TAG,"Found another AudioSpecificConfig!");var Xe=Ze.data;Ne.audioSampleRate=Xe.samplingRate,Ne.channelCount=Xe.channelCount,Ne.codec=Xe.codec,Ne.originalCodec=Xe.originalCodec,Ne.config=Xe.config,Ne.refSampleDuration=1024/Ne.audioSampleRate*Ne.timescale,w.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",Ne);var Be=this._mediaInfo;Be.audioCodec=Ne.originalCodec,Be.audioSampleRate=Ne.audioSampleRate,Be.audioChannelCount=Ne.channelCount,Be.hasVideo?Be.videoCodec!=null&&(Be.mimeType='video/x-flv; codecs="'+Be.videoCodec+","+Be.audioCodec+'"'):Be.mimeType='video/x-flv; codecs="'+Be.audioCodec+'"',Be.isComplete()&&this._onMediaInfo(Be)}else if(Ze.packetType===1){var it=this._timestampBase+Y,ct={unit:Ze.data,length:Ze.data.byteLength,dts:it,pts:it};$e.samples.push(ct),$e.length+=Ze.data.length}else w.e(this.TAG,"Flv: Unsupported AAC data type ".concat(Ze.packetType))}else if(Fe===2){if(!Ne.codec){var at=this._parseMP3AudioData(P,W+1,K-1,!0);if(at==null)return;Ne.audioSampleRate=at.samplingRate,Ne.channelCount=at.channelCount,Ne.codec=at.codec,Ne.originalCodec=at.originalCodec,Ne.refSampleDuration=1152/Ne.audioSampleRate*Ne.timescale,w.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",Ne);var ut=this._mediaInfo;ut.audioCodec=Ne.codec,ut.audioSampleRate=Ne.audioSampleRate,ut.audioChannelCount=Ne.channelCount,ut.audioDataRate=at.bitRate,ut.hasVideo?ut.videoCodec!=null&&(ut.mimeType='video/x-flv; codecs="'+ut.videoCodec+","+ut.audioCodec+'"'):ut.mimeType='video/x-flv; codecs="'+ut.audioCodec+'"',ut.isComplete()&&this._onMediaInfo(ut)}var yt=this._parseMP3AudioData(P,W+1,K-1,!1);if(yt==null)return;var Tt=this._timestampBase+Y,mt={unit:yt,length:yt.byteLength,dts:Tt,pts:Tt};$e.samples.push(mt),$e.length+=yt.length}}},{key:"_parseAACAudioData",value:function(P,W,K){if(K<=1){w.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var Y={},le=new Uint8Array(P,W,K);return Y.packetType=le[0],le[0]===0?Y.data=this._parseAACAudioSpecificConfig(P,W+1,K-1):Y.data=le.subarray(1),Y}},{key:"_parseAACAudioSpecificConfig",value:function(P,W,K){var Y=new Uint8Array(P,W,K),le=null,Ae=0,Ce=0,Fe=null,We=0,je=null;if(Ae=Ce=Y[0]>>>3,We=(Y[0]&7)<<1|Y[1]>>>7,We<0||We>=this._mpegSamplingRates.length){this._onError(M.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var Qe=this._mpegSamplingRates[We],qe=(Y[1]&120)>>>3;if(qe<0||qe>=8){this._onError(M.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Ae===5&&(je=(Y[1]&7)<<1|Y[2]>>>7,Fe=(Y[2]&124)>>>2);var Ne=self.navigator.userAgent.toLowerCase();return Ne.indexOf("firefox")!==-1?We>=6?(Ae=5,le=new Array(4),je=We-3):(Ae=2,le=new Array(2),je=We):Ne.indexOf("android")!==-1?(Ae=2,le=new Array(2),je=We):(Ae=5,je=We,le=new Array(4),We>=6?je=We-3:qe===1&&(Ae=2,le=new Array(2),je=We)),le[0]=Ae<<3,le[0]|=(We&15)>>>1,le[1]=(We&15)<<7,le[1]|=(qe&15)<<3,Ae===5&&(le[1]|=(je&15)>>>1,le[2]=(je&1)<<7,le[2]|=2<<2,le[3]=0),{config:le,samplingRate:Qe,channelCount:qe,codec:"mp4a.40."+Ae,originalCodec:"mp4a.40."+Ce}}},{key:"_parseMP3AudioData",value:function(P,W,K,Y){if(K<4){w.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var le=this._littleEndian,Ae=new Uint8Array(P,W,K),Ce=null;if(Y){if(Ae[0]!==255)return;var Fe=Ae[1]>>>3&3,We=(Ae[1]&6)>>1,je=(Ae[2]&240)>>>4,Qe=(Ae[2]&12)>>>2,qe=Ae[3]>>>6&3,Ne=qe!==3?2:1,$e=0,Ze=0,Xe=34,Be="mp3";switch(Fe){case 0:$e=this._mpegAudioV25SampleRateTable[Qe];break;case 2:$e=this._mpegAudioV20SampleRateTable[Qe];break;case 3:$e=this._mpegAudioV10SampleRateTable[Qe];break}switch(We){case 1:Xe=34,je<this._mpegAudioL3BitRateTable.length&&(Ze=this._mpegAudioL3BitRateTable[je]);break;case 2:Xe=33,je<this._mpegAudioL2BitRateTable.length&&(Ze=this._mpegAudioL2BitRateTable[je]);break;case 3:Xe=32,je<this._mpegAudioL1BitRateTable.length&&(Ze=this._mpegAudioL1BitRateTable[je]);break}Ce={bitRate:Ze,samplingRate:$e,channelCount:Ne,codec:Be,originalCodec:Be}}else Ce=Ae;return Ce}},{key:"_parseVideoData",value:function(P,W,K,Y,le){if(K<=1){w.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;var Ae=new Uint8Array(P,W,K)[0],Ce=(Ae&240)>>>4,Fe=Ae&15;if(Fe!==7){this._onError(M.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(Fe));return}this._parseAVCVideoPacket(P,W+1,K-1,Y,le,Ce)}},{key:"_parseAVCVideoPacket",value:function(P,W,K,Y,le,Ae){if(K<4){w.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var Ce=this._littleEndian,Fe=new DataView(P,W,K),We=Fe.getUint8(0),je=Fe.getUint32(0,!Ce)&16777215,Qe=je<<8>>8;if(We===0)this._parseAVCDecoderConfigurationRecord(P,W+4,K-4);else if(We===1)this._parseAVCVideoData(P,W+4,K-4,Y,le,Ae,Qe);else if(!(We===2)){this._onError(M.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(We));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(P,W,K){if(K<7){w.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var Y=this._videoMetadata,le=this._videoTrack,Ae=this._littleEndian,Ce=new DataView(P,W,K);Y?typeof Y.avcc!="undefined"&&w.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),Y=this._videoMetadata={},Y.type="video",Y.id=le.id,Y.timescale=this._timescale,Y.duration=this._duration);var Fe=Ce.getUint8(0),We=Ce.getUint8(1),je=Ce.getUint8(2),Qe=Ce.getUint8(3);if(Fe!==1||We===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(Ce.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(M.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var qe=Ce.getUint8(5)&31;if(qe===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else qe>1&&w.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(qe));for(var Ne=6,$e=0;$e<qe;$e++){var Ze=Ce.getUint16(Ne,!Ae);if(Ne+=2,Ze===0)continue;var Xe=new Uint8Array(P,W+Ne,Ze);Ne+=Ze;var Be=O.parseSPS(Xe);if($e!==0)continue;Y.codecWidth=Be.codec_size.width,Y.codecHeight=Be.codec_size.height,Y.presentWidth=Be.present_size.width,Y.presentHeight=Be.present_size.height,Y.profile=Be.profile_string,Y.level=Be.level_string,Y.bitDepth=Be.bit_depth,Y.chromaFormat=Be.chroma_format,Y.sarRatio=Be.sar_ratio,Y.frameRate=Be.frame_rate,(Be.frame_rate.fixed===!1||Be.frame_rate.fps_num===0||Be.frame_rate.fps_den===0)&&(Y.frameRate=this._referenceFrameRate);var it=Y.frameRate.fps_den,ct=Y.frameRate.fps_num;Y.refSampleDuration=Y.timescale*(it/ct);for(var at=Xe.subarray(1,4),ut="avc1.",yt=0;yt<3;yt++){var Tt=at[yt].toString(16);Tt.length<2&&(Tt="0"+Tt),ut+=Tt}Y.codec=ut;var mt=this._mediaInfo;mt.width=Y.codecWidth,mt.height=Y.codecHeight,mt.fps=Y.frameRate.fps,mt.profile=Y.profile,mt.level=Y.level,mt.refFrames=Be.ref_frames,mt.chromaFormat=Be.chroma_format_string,mt.sarNum=Y.sarRatio.width,mt.sarDen=Y.sarRatio.height,mt.videoCodec=ut,mt.hasAudio?mt.audioCodec!=null&&(mt.mimeType='video/x-flv; codecs="'+mt.videoCodec+","+mt.audioCodec+'"'):mt.mimeType='video/x-flv; codecs="'+mt.videoCodec+'"',mt.isComplete()&&this._onMediaInfo(mt)}var St=Ce.getUint8(Ne);if(St===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else St>1&&w.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(St));Ne++;for(var Lt=0;Lt<St;Lt++){var _t=Ce.getUint16(Ne,!Ae);if(Ne+=2,_t===0)continue;Ne+=_t}Y.avcc=new Uint8Array(K),Y.avcc.set(new Uint8Array(P,W,K),0),w.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",Y)}},{key:"_parseAVCVideoData",value:function(P,W,K,Y,le,Ae,Ce){for(var Fe=this._littleEndian,We=new DataView(P,W,K),je=[],Qe=0,qe=0,Ne=this._naluLengthSize,$e=this._timestampBase+Y,Ze=Ae===1;qe<K;){if(qe+4>=K){w.w(this.TAG,"Malformed Nalu near timestamp ".concat($e,", offset = ").concat(qe,", dataSize = ").concat(K));break}var Xe=We.getUint32(qe,!Fe);if(Ne===3&&(Xe>>>=8),Xe>K-Ne){w.w(this.TAG,"Malformed Nalus near timestamp ".concat($e,", NaluSize > DataSize!"));return}var Be=We.getUint8(qe+Ne)&31;Be===5&&(Ze=!0);var it=new Uint8Array(P,W+qe,Ne+Xe),ct={type:Be,data:it};je.push(ct),Qe+=it.byteLength,qe+=Ne+Xe}if(je.length){var at=this._videoTrack,ut={units:je,length:Qe,isKeyframe:Ze,dts:$e,cts:Ce,pts:$e+Ce};Ze&&(ut.fileposition=le),at.samples.push(ut),at.length+=Qe}}}],[{key:"probe",value:function(P){var W=new Uint8Array(P),K={match:!1};if(W[0]!==70||W[1]!==76||W[2]!==86||W[3]!==1)return K;var Y=(W[4]&4)>>>2!==0,le=(W[4]&1)!==0,Ae=ve(W,5);return Ae<9?K:{match:!0,consumed:Ae,dataOffset:Ae,hasAudioTrack:Y,hasVideoTrack:le}}}]),ce}(),Oe=ke,De=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"init",value:function(){ce.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(var P in ce.types)ce.types.hasOwnProperty(P)&&(ce.types[P]=[P.charCodeAt(0),P.charCodeAt(1),P.charCodeAt(2),P.charCodeAt(3)]);var W=ce.constants={};W.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),W.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),W.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),W.STSC=W.STCO=W.STTS,W.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),W.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),W.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),W.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),W.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),W.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(P){for(var W=8,K=null,Y=Array.prototype.slice.call(arguments,1),le=Y.length,Ae=0;Ae<le;Ae++)W+=Y[Ae].byteLength;K=new Uint8Array(W),K[0]=W>>>24&255,K[1]=W>>>16&255,K[2]=W>>>8&255,K[3]=W&255,K.set(P,4);for(var Ce=8,Fe=0;Fe<le;Fe++)K.set(Y[Fe],Ce),Ce+=Y[Fe].byteLength;return K}},{key:"generateInitSegment",value:function(P){var W=ce.box(ce.types.ftyp,ce.constants.FTYP),K=ce.moov(P),Y=new Uint8Array(W.byteLength+K.byteLength);return Y.set(W,0),Y.set(K,W.byteLength),Y}},{key:"moov",value:function(P){var W=ce.mvhd(P.timescale,P.duration),K=ce.trak(P),Y=ce.mvex(P);return ce.box(ce.types.moov,W,K,Y)}},{key:"mvhd",value:function(P,W){return ce.box(ce.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,P>>>24&255,P>>>16&255,P>>>8&255,P&255,W>>>24&255,W>>>16&255,W>>>8&255,W&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(P){return ce.box(ce.types.trak,ce.tkhd(P),ce.mdia(P))}},{key:"tkhd",value:function(P){var W=P.id,K=P.duration,Y=P.presentWidth,le=P.presentHeight;return ce.box(ce.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255,0,0,0,0,K>>>24&255,K>>>16&255,K>>>8&255,K&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,Y>>>8&255,Y&255,0,0,le>>>8&255,le&255,0,0]))}},{key:"mdia",value:function(P){return ce.box(ce.types.mdia,ce.mdhd(P),ce.hdlr(P),ce.minf(P))}},{key:"mdhd",value:function(P){var W=P.timescale,K=P.duration;return ce.box(ce.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255,K>>>24&255,K>>>16&255,K>>>8&255,K&255,85,196,0,0]))}},{key:"hdlr",value:function(P){var W=null;return P.type==="audio"?W=ce.constants.HDLR_AUDIO:W=ce.constants.HDLR_VIDEO,ce.box(ce.types.hdlr,W)}},{key:"minf",value:function(P){var W=null;return P.type==="audio"?W=ce.box(ce.types.smhd,ce.constants.SMHD):W=ce.box(ce.types.vmhd,ce.constants.VMHD),ce.box(ce.types.minf,W,ce.dinf(),ce.stbl(P))}},{key:"dinf",value:function(){var P=ce.box(ce.types.dinf,ce.box(ce.types.dref,ce.constants.DREF));return P}},{key:"stbl",value:function(P){var W=ce.box(ce.types.stbl,ce.stsd(P),ce.box(ce.types.stts,ce.constants.STTS),ce.box(ce.types.stsc,ce.constants.STSC),ce.box(ce.types.stsz,ce.constants.STSZ),ce.box(ce.types.stco,ce.constants.STCO));return W}},{key:"stsd",value:function(P){return P.type==="audio"?P.codec==="mp3"?ce.box(ce.types.stsd,ce.constants.STSD_PREFIX,ce.mp3(P)):ce.box(ce.types.stsd,ce.constants.STSD_PREFIX,ce.mp4a(P)):ce.box(ce.types.stsd,ce.constants.STSD_PREFIX,ce.avc1(P))}},{key:"mp3",value:function(P){var W=P.channelCount,K=P.audioSampleRate,Y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W,0,16,0,0,0,0,K>>>8&255,K&255,0,0]);return ce.box(ce.types[".mp3"],Y)}},{key:"mp4a",value:function(P){var W=P.channelCount,K=P.audioSampleRate,Y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W,0,16,0,0,0,0,K>>>8&255,K&255,0,0]);return ce.box(ce.types.mp4a,Y,ce.esds(P))}},{key:"esds",value:function(P){var W=P.config||[],K=W.length,Y=new Uint8Array([0,0,0,0,3,23+K,0,1,0,4,15+K,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([K]).concat(W).concat([6,1,2]));return ce.box(ce.types.esds,Y)}},{key:"avc1",value:function(P){var W=P.avcc,K=P.codecWidth,Y=P.codecHeight,le=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,K>>>8&255,K&255,Y>>>8&255,Y&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return ce.box(ce.types.avc1,le,ce.box(ce.types.avcC,W))}},{key:"mvex",value:function(P){return ce.box(ce.types.mvex,ce.trex(P))}},{key:"trex",value:function(P){var W=P.id,K=new Uint8Array([0,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return ce.box(ce.types.trex,K)}},{key:"moof",value:function(P,W){return ce.box(ce.types.moof,ce.mfhd(P.sequenceNumber),ce.traf(P,W))}},{key:"mfhd",value:function(P){var W=new Uint8Array([0,0,0,0,P>>>24&255,P>>>16&255,P>>>8&255,P&255]);return ce.box(ce.types.mfhd,W)}},{key:"traf",value:function(P,W){var K=P.id,Y=ce.box(ce.types.tfhd,new Uint8Array([0,0,0,0,K>>>24&255,K>>>16&255,K>>>8&255,K&255])),le=ce.box(ce.types.tfdt,new Uint8Array([0,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255])),Ae=ce.sdtp(P),Ce=ce.trun(P,Ae.byteLength+16+16+8+16+8+8);return ce.box(ce.types.traf,Y,le,Ce,Ae)}},{key:"sdtp",value:function(P){for(var W=P.samples||[],K=W.length,Y=new Uint8Array(4+K),le=0;le<K;le++){var Ae=W[le].flags;Y[le+4]=Ae.isLeading<<6|Ae.dependsOn<<4|Ae.isDependedOn<<2|Ae.hasRedundancy}return ce.box(ce.types.sdtp,Y)}},{key:"trun",value:function(P,W){var K=P.samples||[],Y=K.length,le=12+16*Y,Ae=new Uint8Array(le);W+=8+le,Ae.set([0,0,15,1,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255,W>>>24&255,W>>>16&255,W>>>8&255,W&255],0);for(var Ce=0;Ce<Y;Ce++){var Fe=K[Ce].duration,We=K[Ce].size,je=K[Ce].flags,Qe=K[Ce].cts;Ae.set([Fe>>>24&255,Fe>>>16&255,Fe>>>8&255,Fe&255,We>>>24&255,We>>>16&255,We>>>8&255,We&255,je.isLeading<<2|je.dependsOn,je.isDependedOn<<6|je.hasRedundancy<<4|je.isNonSync,0,0,Qe>>>24&255,Qe>>>16&255,Qe>>>8&255,Qe&255],12+16*Ce)}return ce.box(ce.types.trun,Ae)}},{key:"mdat",value:function(P){return ce.box(ce.types.mdat,P)}}]),ce}();De.init();var Ue=De,Ke=function(){function ce(){Object(Se.a)(this,ce)}return Object(Z.a)(ce,null,[{key:"getSilentFrame",value:function(P,W){if(P==="mp4a.40.2"){if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(W===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(W===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(W===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(W===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}}]),ce}(),Pe=Ke,Re=function ce(ne,P,W,K,Y){Object(Se.a)(this,ce),this.dts=ne,this.pts=P,this.duration=W,this.originalDts=K,this.isSyncPoint=Y,this.fileposition=null},xe=function(){function ce(){Object(Se.a)(this,ce),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return Object(Z.a)(ce,[{key:"appendSyncPoint",value:function(P){P.isSyncPoint=!0,this.syncPoints.push(P)}}]),ce}(),we=function(){function ce(){Object(Se.a)(this,ce),this._list=[]}return Object(Z.a)(ce,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(P){var W=this._list;if(P.length===0)return;W.length>0&&P[0].originalDts<W[W.length-1].originalDts&&this.clear(),Array.prototype.push.apply(W,P)}},{key:"getLastSyncPointBeforeDts",value:function(P){if(this._list.length==0)return null;var W=this._list,K=0,Y=W.length-1,le=0,Ae=0,Ce=Y;for(P<W[0].dts&&(K=0,Ae=Ce+1);Ae<=Ce;)if(le=Ae+Math.floor((Ce-Ae)/2),le===Y||P>=W[le].dts&&P<W[le+1].dts){K=le;break}else W[le].dts<P?Ae=le+1:Ce=le-1;return this._list[K]}}]),ce}(),Te=function(){function ce(ne){Object(Se.a)(this,ce),this._type=ne,this._list=[],this._lastAppendLocation=-1}return Object(Z.a)(ce,[{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}},{key:"isEmpty",value:function(){return this._list.length===0}},{key:"clear",value:function(){this._list=[],this._lastAppendLocation=-1}},{key:"_searchNearestSegmentBefore",value:function(P){var W=this._list;if(W.length===0)return-2;var K=W.length-1,Y=0,le=0,Ae=K,Ce=0;if(P<W[0].originalBeginDts)return Ce=-1,Ce;for(;le<=Ae;)if(Y=le+Math.floor((Ae-le)/2),Y===K||P>W[Y].lastSample.originalDts&&P<W[Y+1].originalBeginDts){Ce=Y;break}else W[Y].originalBeginDts<P?le=Y+1:Ae=Y-1;return Ce}},{key:"_searchNearestSegmentAfter",value:function(P){return this._searchNearestSegmentBefore(P)+1}},{key:"append",value:function(P){var W=this._list,K=P,Y=this._lastAppendLocation,le=0;Y!==-1&&Y<W.length&&K.originalBeginDts>=W[Y].lastSample.originalDts&&(Y===W.length-1||Y<W.length-1&&K.originalBeginDts<W[Y+1].originalBeginDts)?le=Y+1:W.length>0&&(le=this._searchNearestSegmentBefore(K.originalBeginDts)+1),this._lastAppendLocation=le,this._list.splice(le,0,K)}},{key:"getLastSegmentBefore",value:function(P){var W=this._searchNearestSegmentBefore(P);return W>=0?this._list[W]:null}},{key:"getLastSampleBefore",value:function(P){var W=this.getLastSegmentBefore(P);return W!=null?W.lastSample:null}},{key:"getLastSyncPointBefore",value:function(P){for(var W=this._searchNearestSegmentBefore(P),K=this._list[W].syncPoints;K.length===0&&W>0;)W--,K=this._list[W].syncPoints;return K.length>0?K[K.length-1]:null}}]),ce}(),ue=function(){function ce(ne){Object(Se.a)(this,ce),this.TAG="MP4Remuxer",this._config=ne,this._isLive=ne.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=Infinity,this._videoDtsBase=Infinity,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Te("audio"),this._videoSegmentInfoList=new Te("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(p.chrome&&(p.version.major<50||p.version.major===50&&p.version.build<2661)),this._fillSilentAfterSeek=p.msedge||p.msie,this._mp3UseMpegAudio=!p.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(P){return P.onDataAvailable=this.remux.bind(this),P.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(P){this._onInitSegment=P}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(P){this._onMediaSegment=P}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(P){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(P,W){if(!this._onMediaSegment)throw new i("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(P,W),this._remuxVideo(W),this._remuxAudio(P)}},{key:"_onTrackMetadataReceived",value:function(P,W){var K=null,Y="mp4",le=W.codec;if(P==="audio")this._audioMeta=W,W.codec==="mp3"&&this._mp3UseMpegAudio?(Y="mpeg",le="",K=new Uint8Array):K=Ue.generateInitSegment(W);else if(P==="video")this._videoMeta=W,K=Ue.generateInitSegment(W);else return;if(!this._onInitSegment)throw new i("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(P,{type:P,data:K.buffer,codec:le,container:"".concat(P,"/").concat(Y),mediaDuration:W.duration})}},{key:"_calculateDtsBase",value:function(P,W){if(this._dtsBaseInited)return;P.samples&&P.samples.length&&(this._audioDtsBase=P.samples[0].dts),W.samples&&W.samples.length&&(this._videoDtsBase=W.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var P=this._videoStashedLastSample,W=this._audioStashedLastSample,K={type:"video",id:1,sequenceNumber:0,samples:[],length:0};P!=null&&(K.samples.push(P),K.length=P.length);var Y={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};W!=null&&(Y.samples.push(W),Y.length=W.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(K,!0),this._remuxAudio(Y,!0)}},{key:"_remuxAudio",value:function(P,W){if(this._audioMeta==null)return;var K=P,Y=K.samples,le=void 0,Ae=-1,Ce=-1,Fe=-1,We=this._audioMeta.refSampleDuration,je=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,Qe=this._dtsBaseInited&&this._audioNextDts===void 0,qe=!1;if(!Y||Y.length===0)return;if(Y.length===1&&!W)return;var Ne=0,$e=null,Ze=0;je?(Ne=0,Ze=K.length):(Ne=8,Ze=8+K.length);var Xe=null;if(Y.length>1&&(Xe=Y.pop(),Ze-=Xe.length),this._audioStashedLastSample!=null){var Be=this._audioStashedLastSample;this._audioStashedLastSample=null,Y.unshift(Be),Ze+=Be.length}Xe!=null&&(this._audioStashedLastSample=Xe);var it=Y[0].dts-this._dtsBase;if(this._audioNextDts)le=it-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())le=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(qe=!0));else{var ct=this._audioSegmentInfoList.getLastSampleBefore(it);if(ct!=null){var at=it-(ct.originalDts+ct.duration);at<=3&&(at=0);var ut=ct.dts+ct.duration+at;le=it-ut}else le=0}if(qe){var yt=it-le,Tt=this._videoSegmentInfoList.getLastSegmentBefore(it);if(Tt!=null&&Tt.beginDts<yt){var mt=Pe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(mt){var St=Tt.beginDts,Lt=yt-Tt.beginDts;w.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(St,", duration: ").concat(Lt)),Y.unshift({unit:mt,dts:St,pts:St}),Ze+=mt.byteLength}}else qe=!1}for(var _t=[],At=0;At<Y.length;At++){var It=Y[At],kt=It.unit,Ot=It.dts-this._dtsBase,Ct=Ot-le;Ae===-1&&(Ae=Ct);var xt=0;if(At!==Y.length-1){var Kt=Y[At+1].dts-this._dtsBase-le;xt=Kt-Ct}else if(Xe!=null){var Nt=Xe.dts-this._dtsBase-le;xt=Nt-Ct}else _t.length>=1?xt=_t[_t.length-1].duration:xt=Math.floor(We);var wt=!1,Rt=null;if(xt>We*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!p.safari){wt=!0;var Mt=Math.abs(xt-We),Ft=Math.ceil(Mt/We),Bt=Ct+We;w.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
`+"dts: ".concat(Ct+xt," ms, expected: ").concat(Ct+Math.round(We)," ms, ")+"delta: ".concat(Math.round(Mt)," ms, generate: ").concat(Ft," frames"));var jt=Pe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);jt==null&&(w.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),jt=kt),Rt=[];for(var Gt=0;Gt<Ft;Gt++){var Ut=Math.round(Bt);if(Rt.length>0){var Wt=Rt[Rt.length-1];Wt.duration=Ut-Wt.dts}var Ht={dts:Ut,pts:Ut,cts:0,unit:jt,size:jt.byteLength,duration:0,originalDts:Ot,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};Rt.push(Ht),Ze+=Ht.size,Bt+=We}var Xt=Rt[Rt.length-1];Xt.duration=Ct+xt-Xt.dts,xt=Math.round(We)}_t.push({dts:Ct,pts:Ct,cts:0,unit:It.unit,size:It.unit.byteLength,duration:xt,originalDts:Ot,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),wt&&_t.push.apply(_t,Rt)}je?$e=new Uint8Array(Ze):($e=new Uint8Array(Ze),$e[0]=Ze>>>24&255,$e[1]=Ze>>>16&255,$e[2]=Ze>>>8&255,$e[3]=Ze&255,$e.set(Ue.types.mdat,4));for(var Vt=0;Vt<_t.length;Vt++){var Yt=_t[Vt].unit;$e.set(Yt,Ne),Ne+=Yt.byteLength}var Pt=_t[_t.length-1];Ce=Pt.dts+Pt.duration,this._audioNextDts=Ce;var Dt=new xe;Dt.beginDts=Ae,Dt.endDts=Ce,Dt.beginPts=Ae,Dt.endPts=Ce,Dt.originalBeginDts=_t[0].originalDts,Dt.originalEndDts=Pt.originalDts+Pt.duration,Dt.firstSample=new Re(_t[0].dts,_t[0].pts,_t[0].duration,_t[0].originalDts,!1),Dt.lastSample=new Re(Pt.dts,Pt.pts,Pt.duration,Pt.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(Dt),K.samples=_t,K.sequenceNumber++;var zt=null;je?zt=new Uint8Array:zt=Ue.moof(K,Ae),K.samples=[],K.length=0;var qt={type:"audio",data:this._mergeBoxes(zt,$e).buffer,sampleCount:_t.length,info:Dt};je&&Qe&&(qt.timestampOffset=Ae),this._onMediaSegment("audio",qt)}},{key:"_remuxVideo",value:function(P,W){if(this._videoMeta==null)return;var K=P,Y=K.samples,le=void 0,Ae=-1,Ce=-1,Fe=-1,We=-1;if(!Y||Y.length===0)return;if(Y.length===1&&!W)return;var je=8,Qe=null,qe=8+P.length,Ne=null;if(Y.length>1&&(Ne=Y.pop(),qe-=Ne.length),this._videoStashedLastSample!=null){var $e=this._videoStashedLastSample;this._videoStashedLastSample=null,Y.unshift($e),qe+=$e.length}Ne!=null&&(this._videoStashedLastSample=Ne);var Ze=Y[0].dts-this._dtsBase;if(this._videoNextDts)le=Ze-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())le=0;else{var Xe=this._videoSegmentInfoList.getLastSampleBefore(Ze);if(Xe!=null){var Be=Ze-(Xe.originalDts+Xe.duration);Be<=3&&(Be=0);var it=Xe.dts+Xe.duration+Be;le=Ze-it}else le=0}for(var ct=new xe,at=[],ut=0;ut<Y.length;ut++){var yt=Y[ut],Tt=yt.dts-this._dtsBase,mt=yt.isKeyframe,St=Tt-le,Lt=yt.cts,_t=St+Lt;Ae===-1&&(Ae=St,Fe=_t);var At=0;if(ut!==Y.length-1){var It=Y[ut+1].dts-this._dtsBase-le;At=It-St}else if(Ne!=null){var kt=Ne.dts-this._dtsBase-le;At=kt-St}else at.length>=1?At=at[at.length-1].duration:At=Math.floor(this._videoMeta.refSampleDuration);if(mt){var Ot=new Re(St,_t,At,yt.dts,!0);Ot.fileposition=yt.fileposition,ct.appendSyncPoint(Ot)}at.push({dts:St,pts:_t,cts:Lt,units:yt.units,size:yt.length,isKeyframe:mt,duration:At,originalDts:Tt,flags:{isLeading:0,dependsOn:mt?2:1,isDependedOn:mt?1:0,hasRedundancy:0,isNonSync:mt?0:1}})}Qe=new Uint8Array(qe),Qe[0]=qe>>>24&255,Qe[1]=qe>>>16&255,Qe[2]=qe>>>8&255,Qe[3]=qe&255,Qe.set(Ue.types.mdat,4);for(var Ct=0;Ct<at.length;Ct++)for(var xt=at[Ct].units;xt.length;){var Kt=xt.shift(),Nt=Kt.data;Qe.set(Nt,je),je+=Nt.byteLength}var wt=at[at.length-1];if(Ce=wt.dts+wt.duration,We=wt.pts+wt.duration,this._videoNextDts=Ce,ct.beginDts=Ae,ct.endDts=Ce,ct.beginPts=Fe,ct.endPts=We,ct.originalBeginDts=at[0].originalDts,ct.originalEndDts=wt.originalDts+wt.duration,ct.firstSample=new Re(at[0].dts,at[0].pts,at[0].duration,at[0].originalDts,at[0].isKeyframe),ct.lastSample=new Re(wt.dts,wt.pts,wt.duration,wt.originalDts,wt.isKeyframe),this._isLive||this._videoSegmentInfoList.append(ct),K.samples=at,K.sequenceNumber++,this._forceFirstIDR){var Rt=at[0].flags;Rt.dependsOn=2,Rt.isNonSync=0}var Mt=Ue.moof(K,Ae);K.samples=[],K.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Mt,Qe).buffer,sampleCount:at.length,info:ct})}},{key:"_mergeBoxes",value:function(P,W){var K=new Uint8Array(P.byteLength+W.byteLength);return K.set(P,0),K.set(W,P.byteLength),K}}]),ce}(),de=ue,_e={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"},ye=_e,Ie=function(){function ce(ne,P){Object(Se.a)(this,ce),this.TAG="TransmuxingController",this._emitter=new E.a,this._config=P,ne.segments||(ne.segments=[{duration:ne.duration,filesize:ne.filesize,url:ne.url}]),typeof ne.cors!="boolean"&&(ne.cors=!0),typeof ne.withCredentials!="boolean"&&(ne.withCredentials=!1),this._mediaDataSource=ne,this._currentSegmentIndex=0;var W=0;this._mediaDataSource.segments.forEach(function(K){K.timestampBase=W,W+=K.duration,K.cors=ne.cors,K.withCredentials=ne.withCredentials,P.referrerPolicy&&(K.referrerPolicy=P.referrerPolicy)}),!isNaN(W)&&this._mediaDataSource.duration!==W&&(this._mediaDataSource.duration=W),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(P,W){this._emitter.addListener(P,W)}},{key:"off",value:function(P,W){this._emitter.removeListener(P,W)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(P,W){this._currentSegmentIndex=P;var K=this._mediaDataSource.segments[P],Y=this._ioctl=new N(K,this._config,P);Y.onError=this._onIOException.bind(this),Y.onSeeked=this._onIOSeeked.bind(this),Y.onComplete=this._onIOComplete.bind(this),Y.onRedirect=this._onIORedirect.bind(this),Y.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),W?this._demuxer.bindDataSource(this._ioctl):Y.onDataArrival=this._onInitChunkArrival.bind(this),Y.open(W)}},{key:"stop",value:function(){this._internalAbort(),this._disableStatisticsReporter()}},{key:"_internalAbort",value:function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}},{key:"pause",value:function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}},{key:"resume",value:function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}},{key:"seek",value:function(P){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;var W=this._searchSegmentIndexContains(P);if(W===this._currentSegmentIndex){var K=this._mediaInfo.segments[W];if(K==null)this._pendingSeekTime=P;else{var Y=K.getNearestKeyframe(P);this._remuxer.seek(Y.milliseconds),this._ioctl.seek(Y.fileposition),this._pendingResolveSeekPoint=Y.milliseconds}}else{var le=this._mediaInfo.segments[W];if(le==null)this._pendingSeekTime=P,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(W);else{var Ae=le.getNearestKeyframe(P);this._internalAbort(),this._remuxer.seek(P),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[W].timestampBase,this._loadSegment(W,Ae.fileposition),this._pendingResolveSeekPoint=Ae.milliseconds,this._reportSegmentMediaInfo(W)}}this._enableStatisticsReporter()}},{key:"_searchSegmentIndexContains",value:function(P){for(var W=this._mediaDataSource.segments,K=W.length-1,Y=0;Y<W.length;Y++)if(P<W[Y].timestampBase){K=Y-1;break}return K}},{key:"_onInitChunkArrival",value:function(P,W){var K=this,Y=null,le=0;if(W>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,le=this._demuxer.parseChunks(P,W);else if((Y=Oe.probe(P)).match){this._demuxer=new Oe(Y,this._config),this._remuxer||(this._remuxer=new de(this._config));var Ae=this._mediaDataSource;Ae.duration!=null&&!isNaN(Ae.duration)&&(this._demuxer.overridedDuration=Ae.duration),typeof Ae.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Ae.hasAudio),typeof Ae.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Ae.hasVideo),this._demuxer.timestampBase=Ae.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),le=this._demuxer.parseChunks(P,W)}else Y=null,w.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){K._internalAbort()}),this._emitter.emit(ye.DEMUX_ERROR,M.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),le=0;return le}},{key:"_onMediaInfo",value:function(P){var W=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},P),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,te.prototype));var K=Object.assign({},P);Object.setPrototypeOf(K,te.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=K,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var Y=W._pendingSeekTime;W._pendingSeekTime=null,W.seek(Y)})}},{key:"_onMetaDataArrived",value:function(P){this._emitter.emit(ye.METADATA_ARRIVED,P)}},{key:"_onScriptDataArrived",value:function(P){this._emitter.emit(ye.SCRIPTDATA_ARRIVED,P)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(P){var W=P,K=W+1;K<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(K)):(this._remuxer.flushStashedSamples(),this._emitter.emit(ye.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(P){var W=this._ioctl.extraData;this._mediaDataSource.segments[W].redirectedURL=P}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(ye.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(P,W){w.e(this.TAG,"IOException: type = ".concat(P,", code = ").concat(W.code,", msg = ").concat(W.msg)),this._emitter.emit(ye.IO_ERROR,P,W),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(P,W){w.e(this.TAG,"DemuxException: type = ".concat(P,", info = ").concat(W)),this._emitter.emit(ye.DEMUX_ERROR,P,W)}},{key:"_onRemuxerInitSegmentArrival",value:function(P,W){this._emitter.emit(ye.INIT_SEGMENT,P,W)}},{key:"_onRemuxerMediaSegmentArrival",value:function(P,W){if(this._pendingSeekTime!=null)return;if(this._emitter.emit(ye.MEDIA_SEGMENT,P,W),this._pendingResolveSeekPoint!=null&&P==="video"){var K=W.info.syncPoints,Y=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,p.safari&&K.length>0&&K[0].originalDts===Y&&(Y=K[0].pts),this._emitter.emit(ye.RECOMMEND_SEEKPOINT,Y)}}},{key:"_enableStatisticsReporter",value:function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(P){var W=this._mediaInfo.segments[P],K=Object.assign({},W);K.duration=this._mediaInfo.duration,K.segmentCount=this._mediaInfo.segmentCount,delete K.segments,delete K.keyframesIndex,this._emitter.emit(ye.MEDIA_INFO,K)}},{key:"_reportStatisticsInfo",value:function(){var P={};P.url=this._ioctl.currentURL,P.hasRedirect=this._ioctl.hasRedirect,P.hasRedirect&&(P.redirectedURL=this._ioctl.currentRedirectedURL),P.speed=this._ioctl.currentSpeed,P.loaderType=this._ioctl.loaderType,P.currentSegmentIndex=this._currentSegmentIndex,P.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(ye.STATISTICS_INFO,P)}}]),ce}(),Me=Ie,ze=function(ne){var P="TransmuxingWorker",W=null,K=Ze.bind(this);b.install(),ne.addEventListener("message",function(Xe){switch(Xe.data.cmd){case"init":W=new Me(Xe.data.param[0],Xe.data.param[1]),W.on(ye.IO_ERROR,qe.bind(this)),W.on(ye.DEMUX_ERROR,Ne.bind(this)),W.on(ye.INIT_SEGMENT,Y.bind(this)),W.on(ye.MEDIA_SEGMENT,le.bind(this)),W.on(ye.LOADING_COMPLETE,Ae.bind(this)),W.on(ye.RECOVERED_EARLY_EOF,Ce.bind(this)),W.on(ye.MEDIA_INFO,Fe.bind(this)),W.on(ye.METADATA_ARRIVED,We.bind(this)),W.on(ye.SCRIPTDATA_ARRIVED,je.bind(this)),W.on(ye.STATISTICS_INFO,Qe.bind(this)),W.on(ye.RECOMMEND_SEEKPOINT,$e.bind(this));break;case"destroy":W&&(W.destroy(),W=null),ne.postMessage({msg:"destroyed"});break;case"start":W.start();break;case"stop":W.stop();break;case"seek":W.seek(Xe.data.param);break;case"pause":W.pause();break;case"resume":W.resume();break;case"logging_config":{var Be=Xe.data.param;ge.applyConfig(Be),Be.enableCallback===!0?ge.addLogListener(K):ge.removeLogListener(K);break}}});function Y(Xe,Be){var it={msg:ye.INIT_SEGMENT,data:{type:Xe,data:Be}};ne.postMessage(it,[Be.data])}function le(Xe,Be){var it={msg:ye.MEDIA_SEGMENT,data:{type:Xe,data:Be}};ne.postMessage(it,[Be.data])}function Ae(){var Xe={msg:ye.LOADING_COMPLETE};ne.postMessage(Xe)}function Ce(){var Xe={msg:ye.RECOVERED_EARLY_EOF};ne.postMessage(Xe)}function Fe(Xe){var Be={msg:ye.MEDIA_INFO,data:Xe};ne.postMessage(Be)}function We(Xe){var Be={msg:ye.METADATA_ARRIVED,data:Xe};ne.postMessage(Be)}function je(Xe){var Be={msg:ye.SCRIPTDATA_ARRIVED,data:Xe};ne.postMessage(Be)}function Qe(Xe){var Be={msg:ye.STATISTICS_INFO,data:Xe};ne.postMessage(Be)}function qe(Xe,Be){ne.postMessage({msg:ye.IO_ERROR,data:{type:Xe,info:Be}})}function Ne(Xe,Be){ne.postMessage({msg:ye.DEMUX_ERROR,data:{type:Xe,info:Be}})}function $e(Xe){ne.postMessage({msg:ye.RECOMMEND_SEEKPOINT,data:Xe})}function Ze(Xe,Be){ne.postMessage({msg:"logcat_callback",data:{type:Xe,logcat:Be}})}},st=ze,nt=function(){function ce(ne,P){if(Object(Se.a)(this,ce),this.TAG="Transmuxer",this._emitter=new E.a,P.enableWorker&&typeof Worker!="undefined")try{var W=he("0r65");this._worker=W(st),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[ne,P]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},ge.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:ge.getConfig()})}catch(Y){w.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Me(ne,P)}else this._controller=new Me(ne,P);if(this._controller){var K=this._controller;K.on(ye.IO_ERROR,this._onIOError.bind(this)),K.on(ye.DEMUX_ERROR,this._onDemuxError.bind(this)),K.on(ye.INIT_SEGMENT,this._onInitSegment.bind(this)),K.on(ye.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),K.on(ye.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),K.on(ye.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),K.on(ye.MEDIA_INFO,this._onMediaInfo.bind(this)),K.on(ye.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),K.on(ye.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),K.on(ye.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),K.on(ye.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),ge.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(P,W){this._emitter.addListener(P,W)}},{key:"off",value:function(P,W){this._emitter.removeListener(P,W)}},{key:"hasWorker",value:function(){return this._worker!=null}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(P){this._worker?this._worker.postMessage({cmd:"seek",param:P}):this._controller.seek(P)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(P,W){var K=this;Promise.resolve().then(function(){K._emitter.emit(ye.INIT_SEGMENT,P,W)})}},{key:"_onMediaSegment",value:function(P,W){var K=this;Promise.resolve().then(function(){K._emitter.emit(ye.MEDIA_SEGMENT,P,W)})}},{key:"_onLoadingComplete",value:function(){var P=this;Promise.resolve().then(function(){P._emitter.emit(ye.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var P=this;Promise.resolve().then(function(){P._emitter.emit(ye.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(P){var W=this;Promise.resolve().then(function(){W._emitter.emit(ye.MEDIA_INFO,P)})}},{key:"_onMetaDataArrived",value:function(P){var W=this;Promise.resolve().then(function(){W._emitter.emit(ye.METADATA_ARRIVED,P)})}},{key:"_onScriptDataArrived",value:function(P){var W=this;Promise.resolve().then(function(){W._emitter.emit(ye.SCRIPTDATA_ARRIVED,P)})}},{key:"_onStatisticsInfo",value:function(P){var W=this;Promise.resolve().then(function(){W._emitter.emit(ye.STATISTICS_INFO,P)})}},{key:"_onIOError",value:function(P,W){var K=this;Promise.resolve().then(function(){K._emitter.emit(ye.IO_ERROR,P,W)})}},{key:"_onDemuxError",value:function(P,W){var K=this;Promise.resolve().then(function(){K._emitter.emit(ye.DEMUX_ERROR,P,W)})}},{key:"_onRecommendSeekpoint",value:function(P){var W=this;Promise.resolve().then(function(){W._emitter.emit(ye.RECOMMEND_SEEKPOINT,P)})}},{key:"_onLoggingConfigChanged",value:function(P){this._worker&&this._worker.postMessage({cmd:"logging_config",param:P})}},{key:"_onWorkerMessage",value:function(P){var W=P.data,K=W.data;if(W.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(W.msg){case ye.INIT_SEGMENT:case ye.MEDIA_SEGMENT:this._emitter.emit(W.msg,K.type,K.data);break;case ye.LOADING_COMPLETE:case ye.RECOVERED_EARLY_EOF:this._emitter.emit(W.msg);break;case ye.MEDIA_INFO:Object.setPrototypeOf(K,te.prototype),this._emitter.emit(W.msg,K);break;case ye.METADATA_ARRIVED:case ye.SCRIPTDATA_ARRIVED:case ye.STATISTICS_INFO:this._emitter.emit(W.msg,K);break;case ye.IO_ERROR:case ye.DEMUX_ERROR:this._emitter.emit(W.msg,K.type,K.info);break;case ye.RECOMMEND_SEEKPOINT:this._emitter.emit(W.msg,K);break;case"logcat_callback":w.emitter.emit("log",K.type,K.logcat);break;default:break}}}]),ce}(),Ve=nt,et={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},Ge=et,He=function(){function ce(ne){Object(Se.a)(this,ce),this.TAG="MSEController",this._config=ne,this._emitter=new E.a,this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new we}return Object(Z.a)(ce,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(P,W){this._emitter.addListener(P,W)}},{key:"off",value:function(P,W){this._emitter.removeListener(P,W)}},{key:"attachMediaElement",value:function(P){if(this._mediaSource)throw new i("MediaSource has been attached to an HTMLMediaElement!");var W=this._mediaSource=new window.MediaSource;W.addEventListener("sourceopen",this.e.onSourceOpen),W.addEventListener("sourceended",this.e.onSourceEnded),W.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=P,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),P.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var P=this._mediaSource;for(var W in this._sourceBuffers){var K=this._pendingSegments[W];K.splice(0,K.length),this._pendingSegments[W]=null,this._pendingRemoveRanges[W]=null,this._lastInitSegments[W]=null;var Y=this._sourceBuffers[W];if(Y){if(P.readyState!=="closed"){try{P.removeSourceBuffer(Y)}catch(le){w.e(this.TAG,le.message)}Y.removeEventListener("error",this.e.onSourceBufferError),Y.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[W]=null,this._sourceBuffers[W]=null}}if(P.readyState==="open")try{P.endOfStream()}catch(le){w.e(this.TAG,le.message)}P.removeEventListener("sourceopen",this.e.onSourceOpen),P.removeEventListener("sourceended",this.e.onSourceEnded),P.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(P,W){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(P),this._pendingSegments[P.type].push(P);return}var K=P,Y="".concat(K.container);K.codec&&K.codec.length>0&&(Y+=";codecs=".concat(K.codec));var le=!1;if(w.v(this.TAG,"Received Initialization Segment, mimeType: "+Y),this._lastInitSegments[K.type]=K,Y!==this._mimeTypes[K.type]){if(this._mimeTypes[K.type])w.v(this.TAG,"Notice: ".concat(K.type," mimeType changed, origin: ").concat(this._mimeTypes[K.type],", target: ").concat(Y));else{le=!0;try{var Ae=this._sourceBuffers[K.type]=this._mediaSource.addSourceBuffer(Y);Ae.addEventListener("error",this.e.onSourceBufferError),Ae.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(Ce){w.e(this.TAG,Ce.message),this._emitter.emit(Ge.ERROR,{code:Ce.code,msg:Ce.message});return}}this._mimeTypes[K.type]=Y}W||this._pendingSegments[K.type].push(K),le||this._sourceBuffers[K.type]&&!this._sourceBuffers[K.type].updating&&this._doAppendSegments(),p.safari&&K.container==="audio/mpeg"&&K.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=K.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(P){var W=P;this._pendingSegments[W.type].push(W),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var K=this._sourceBuffers[W.type];K&&!K.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(P){for(var W in this._sourceBuffers){if(!this._sourceBuffers[W])continue;var K=this._sourceBuffers[W];if(this._mediaSource.readyState==="open")try{K.abort()}catch(We){w.e(this.TAG,We.message)}this._idrList.clear();var Y=this._pendingSegments[W];if(Y.splice(0,Y.length),this._mediaSource.readyState==="closed")continue;for(var le=0;le<K.buffered.length;le++){var Ae=K.buffered.start(le),Ce=K.buffered.end(le);this._pendingRemoveRanges[W].push({start:Ae,end:Ce})}if(K.updating||this._doRemoveRanges(),p.safari){var Fe=this._lastInitSegments[W];Fe&&(this._pendingSegments[W].push(Fe),K.updating||this._doAppendSegments())}}}},{key:"endOfStream",value:function(){var P=this._mediaSource,W=this._sourceBuffers;if(!P||P.readyState!=="open"){P&&P.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}W.video&&W.video.updating||W.audio&&W.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,P.endOfStream())}},{key:"getNearestKeyframe",value:function(P){return this._idrList.getLastSyncPointBeforeDts(P)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var P=this._mediaElement.currentTime;for(var W in this._sourceBuffers){var K=this._sourceBuffers[W];if(K){var Y=K.buffered;if(Y.length>=1&&P-Y.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var P=this._mediaElement.currentTime;for(var W in this._sourceBuffers){var K=this._sourceBuffers[W];if(K){for(var Y=K.buffered,le=!1,Ae=0;Ae<Y.length;Ae++){var Ce=Y.start(Ae),Fe=Y.end(Ae);if(Ce<=P&&P<Fe+3){if(P-Ce>=this._config.autoCleanupMaxBackwardDuration){le=!0;var We=P-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[W].push({start:Ce,end:We})}}else Fe<P&&(le=!0,this._pendingRemoveRanges[W].push({start:Ce,end:Fe}))}le&&!K.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var P=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")return;if(P.video&&P.video.updating||P.audio&&P.audio.updating)return;var W=this._mediaSource.duration,K=this._pendingMediaDuration;K>0&&(isNaN(W)||K>W)&&(w.v(this.TAG,"Update MediaSource duration from ".concat(W," to ").concat(K)),this._mediaSource.duration=K),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var P in this._pendingRemoveRanges){if(!this._sourceBuffers[P]||this._sourceBuffers[P].updating)continue;for(var W=this._sourceBuffers[P],K=this._pendingRemoveRanges[P];K.length&&!W.updating;){var Y=K.shift();W.remove(Y.start,Y.end)}}}},{key:"_doAppendSegments",value:function(){var P=this._pendingSegments;for(var W in P){if(!this._sourceBuffers[W]||this._sourceBuffers[W].updating)continue;if(P[W].length>0){var K=P[W].shift();if(K.timestampOffset){var Y=this._sourceBuffers[W].timestampOffset,le=K.timestampOffset/1e3,Ae=Math.abs(Y-le);Ae>.1&&(w.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(Y," to ").concat(le)),this._sourceBuffers[W].timestampOffset=le),delete K.timestampOffset}if(!K.data||K.data.byteLength===0)continue;try{this._sourceBuffers[W].appendBuffer(K.data),this._isBufferFull=!1,W==="video"&&K.hasOwnProperty("info")&&this._idrList.appendArray(K.info.syncPoints)}catch(Ce){this._pendingSegments[W].unshift(K),Ce.code===22?(this._isBufferFull||this._emitter.emit(Ge.BUFFER_FULL),this._isBufferFull=!0):(w.e(this.TAG,Ce.message),this._emitter.emit(Ge.ERROR,{code:Ce.code,msg:Ce.message}))}}}}},{key:"_onSourceOpen",value:function(){if(w.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var P=this._pendingSourceBufferInit;P.length;){var W=P.shift();this.appendInitSegment(W,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(Ge.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){w.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){w.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var P=this._pendingSegments;return P.video.length>0||P.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var P=this._pendingRemoveRanges;return P.video.length>0||P.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(Ge.UPDATE_END)}},{key:"_onSourceBufferError",value:function(P){w.e(this.TAG,"SourceBuffer Error: ".concat(P))}}]),ce}(),Ye=He,Je={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},ot={NETWORK_EXCEPTION:e.EXCEPTION,NETWORK_STATUS_CODE_INVALID:e.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:e.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:e.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:M.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:M.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:M.CODEC_UNSUPPORTED},dt=function(){function ce(ne,P){if(Object(Se.a)(this,ce),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new E.a,this._config=q(),typeof P=="object"&&Object.assign(this._config,P),ne.type.toLowerCase()!=="flv")throw new l("FlvPlayer requires an flv MediaDataSource input!");ne.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=ne,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var W=p.chrome&&(p.version.major<50||p.version.major===50&&p.version.build<2661);this._alwaysSeekKeyframe=!!(W||p.msedge||p.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(P,W){var K=this;P===pe.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){K._emitter.emit(pe.MEDIA_INFO,K.mediaInfo)}):P===pe.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){K._emitter.emit(pe.STATISTICS_INFO,K.statisticsInfo)})),this._emitter.addListener(P,W)}},{key:"off",value:function(P,W){this._emitter.removeListener(P,W)}},{key:"attachMediaElement",value:function(P){var W=this;if(this._mediaElement=P,P.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),P.addEventListener("seeking",this.e.onvSeeking),P.addEventListener("canplay",this.e.onvCanPlay),P.addEventListener("stalled",this.e.onvStalled),P.addEventListener("progress",this.e.onvProgress),this._msectl=new Ye(this._config),this._msectl.on(Ge.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(Ge.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(Ge.SOURCE_OPEN,function(){W._mseSourceOpened=!0,W._hasPendingLoad&&(W._hasPendingLoad=!1,W.load())}),this._msectl.on(Ge.ERROR,function(K){W._emitter.emit(pe.ERROR,Je.MEDIA_ERROR,ot.MEDIA_MSE_ERROR,K)}),this._msectl.attachMediaElement(P),this._pendingSeekTime!=null)try{P.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(K){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var P=this;if(!this._mediaElement)throw new i("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new i("FlvPlayer.load() has been called, please call unload() first!");if(this._hasPendingLoad)return;if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new Ve(this._mediaDataSource,this._config),this._transmuxer.on(ye.INIT_SEGMENT,function(W,K){P._msectl.appendInitSegment(K)}),this._transmuxer.on(ye.MEDIA_SEGMENT,function(W,K){if(P._msectl.appendMediaSegment(K),P._config.lazyLoad&&!P._config.isLive){var Y=P._mediaElement.currentTime;K.info.endDts>=(Y+P._config.lazyLoadMaxDuration)*1e3&&(P._progressChecker==null&&(w.v(P.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),P._suspendTransmuxer()))}}),this._transmuxer.on(ye.LOADING_COMPLETE,function(){P._msectl.endOfStream(),P._emitter.emit(pe.LOADING_COMPLETE)}),this._transmuxer.on(ye.RECOVERED_EARLY_EOF,function(){P._emitter.emit(pe.RECOVERED_EARLY_EOF)}),this._transmuxer.on(ye.IO_ERROR,function(W,K){P._emitter.emit(pe.ERROR,Je.NETWORK_ERROR,W,K)}),this._transmuxer.on(ye.DEMUX_ERROR,function(W,K){P._emitter.emit(pe.ERROR,Je.MEDIA_ERROR,W,{code:-1,msg:K})}),this._transmuxer.on(ye.MEDIA_INFO,function(W){P._mediaInfo=W,P._emitter.emit(pe.MEDIA_INFO,Object.assign({},W))}),this._transmuxer.on(ye.METADATA_ARRIVED,function(W){P._emitter.emit(pe.METADATA_ARRIVED,W)}),this._transmuxer.on(ye.SCRIPTDATA_ARRIVED,function(W){P._emitter.emit(pe.SCRIPTDATA_ARRIVED,W)}),this._transmuxer.on(ye.STATISTICS_INFO,function(W){P._statisticsInfo=P._fillStatisticsInfo(W),P._emitter.emit(pe.STATISTICS_INFO,Object.assign({},P._statisticsInfo))}),this._transmuxer.on(ye.RECOMMEND_SEEKPOINT,function(W){P._mediaElement&&!P._config.accurateSeek&&(P._requestSetTime=!0,P._mediaElement.currentTime=W/1e3)}),this._transmuxer.open()}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(P){this._mediaElement.volume=P}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(P){this._mediaElement.muted=P}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(P){this._mediaElement?this._internalSeek(P):this._pendingSeekTime=P}},{key:"mediaInfo",get:function(){return Object.assign({},this._mediaInfo)}},{key:"statisticsInfo",get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}},{key:"_fillStatisticsInfo",value:function(P){if(P.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return P;var W=!0,K=0,Y=0;if(this._mediaElement.getVideoPlaybackQuality){var le=this._mediaElement.getVideoPlaybackQuality();K=le.totalVideoFrames,Y=le.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(K=this._mediaElement.webkitDecodedFrameCount,Y=this._mediaElement.webkitDroppedFrameCount):W=!1;return W&&(P.decodedFrames=K,P.droppedFrames=Y),P}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var P=this._mediaElement.buffered,W=this._mediaElement.currentTime,K=0,Y=0,le=0;le<P.length;le++){var Ae=P.start(le),Ce=P.end(le);if(Ae<=W&&W<Ce){K=Ae,Y=Ce;break}}Y>=W+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(w.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){w.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var P=this._mediaElement.currentTime,W=this._mediaElement.buffered,K=!1,Y=0;Y<W.length;Y++){var le=W.start(Y),Ae=W.end(Y);if(P>=le&&P<Ae){P>=Ae-this._config.lazyLoadRecoverDuration&&(K=!0);break}}K&&(window.clearInterval(this._progressChecker),this._progressChecker=null,K&&(w.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(P){for(var W=this._mediaElement.buffered,K=0;K<W.length;K++){var Y=W.start(K),le=W.end(K);if(P>=Y&&P<le)return!0}return!1}},{key:"_internalSeek",value:function(P){var W=this._isTimepointBuffered(P),K=!1,Y=0;if(P<1&&this._mediaElement.buffered.length>0){var le=this._mediaElement.buffered.start(0);(le<1&&P<le||p.safari)&&(K=!0,Y=p.safari?.1:le)}if(K)this._requestSetTime=!0,this._mediaElement.currentTime=Y;else if(W){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=P;else{var Ae=this._msectl.getNearestKeyframe(Math.floor(P*1e3));this._requestSetTime=!0,Ae!=null?this._mediaElement.currentTime=Ae.dts/1e3:this._mediaElement.currentTime=P}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(P),this._transmuxer.seek(Math.floor(P*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=P)}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var P=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(P)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(P),this._transmuxer.seek(Math.floor(P*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=P))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(P){var W=this._mediaElement;if(P||!this._receivedCanPlay||W.readyState<2){var K=W.buffered;K.length>0&&W.currentTime<K.start(0)&&(w.w(this.TAG,"Playback seems stuck at ".concat(W.currentTime,", seek to ").concat(K.start(0))),this._requestSetTime=!0,this._mediaElement.currentTime=K.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}},{key:"_onvLoadedMetadata",value:function(P){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(P){var W=this._mediaElement.currentTime,K=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(W<1&&K.length>0){var Y=K.start(0);if(Y<1&&W<Y||p.safari){this._requestSetTime=!0,this._mediaElement.currentTime=p.safari?.1:Y;return}}if(this._isTimepointBuffered(W)){if(this._alwaysSeekKeyframe){var le=this._msectl.getNearestKeyframe(Math.floor(W*1e3));le!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=le.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:W,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_onvCanPlay",value:function(P){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(P){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(P){this._checkAndResumeStuckPlayback()}}]),ce}(),ft=dt,lt=function(){function ce(ne,P){if(Object(Se.a)(this,ce),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new E.a,this._config=q(),typeof P=="object"&&Object.assign(this._config,P),ne.type.toLowerCase()==="flv")throw new l("NativePlayer does't support flv MediaDataSource input!");if(ne.hasOwnProperty("segments"))throw new l("NativePlayer(".concat(ne.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=ne,this._mediaElement=null}return Object(Z.a)(ce,[{key:"destroy",value:function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(P,W){var K=this;P===pe.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){K._emitter.emit(pe.MEDIA_INFO,K.mediaInfo)}):P===pe.STATISTICS_INFO&&(this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){K._emitter.emit(pe.STATISTICS_INFO,K.statisticsInfo)})),this._emitter.addListener(P,W)}},{key:"off",value:function(P,W){this._emitter.removeListener(P,W)}},{key:"attachMediaElement",value:function(P){if(this._mediaElement=P,P.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{P.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(W){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"load",value:function(){if(!this._mediaElement)throw new i("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(P){this._mediaElement.volume=P}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(P){this._mediaElement.muted=P}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(P){this._mediaElement?this._mediaElement.currentTime=P:this._pendingSeekTime=P}},{key:"mediaInfo",get:function(){var P=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",W={mimeType:P+this._mediaDataSource.type};return this._mediaElement&&(W.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(W.width=this._mediaElement.videoWidth,W.height=this._mediaElement.videoHeight)),W}},{key:"statisticsInfo",get:function(){var P={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return P;var W=!0,K=0,Y=0;if(this._mediaElement.getVideoPlaybackQuality){var le=this._mediaElement.getVideoPlaybackQuality();K=le.totalVideoFrames,Y=le.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(K=this._mediaElement.webkitDecodedFrameCount,Y=this._mediaElement.webkitDroppedFrameCount):W=!1;return W&&(P.decodedFrames=K,P.droppedFrames=Y),P}},{key:"_onvLoadedMetadata",value:function(P){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(pe.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(pe.STATISTICS_INFO,this.statisticsInfo)}}]),ce}(),vt=lt;b.install();function gt(ce,ne){var P=ce;if(P==null||typeof P!="object")throw new l("MediaDataSource must be an javascript object!");if(!P.hasOwnProperty("type"))throw new l("MediaDataSource must has type field to indicate video file type!");switch(P.type){case"flv":return new ft(P,ne);default:return new vt(P,ne)}}function bt(){return fe.supportMSEH264Playback()}function Et(){return fe.getFeatureList()}var ht={};ht.createPlayer=gt,ht.isSupported=bt,ht.getFeatureList=Et,ht.BaseLoader=s,ht.LoaderStatus=o,ht.LoaderErrors=e,ht.Events=pe,ht.ErrorTypes=Je,ht.ErrorDetails=ot,ht.FlvPlayer=ft,ht.NativePlayer=vt,ht.LoggingControl=ge,Object.defineProperty(ht,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var pt=tt.a=ht},GfqC:function(rt,tt,he){"use strict";var Se=he("cDcd"),Z=he.n(Se),U=he("TSYQ"),b=he.n(U);function L(G,k){var $="cannot "+G.method+" "+G.action+" "+k.status+"'",X=new Error($);return X.status=k.status,X.method=G.method,X.url=G.action,X}function E(G){var k=G.responseText||G.response;if(!k)return k;try{return JSON.parse(k)}catch($){return k}}function A(G){var k=new XMLHttpRequest;G.onProgress&&k.upload&&(k.upload.onprogress=function(N){N.total>0&&(N.percent=N.loaded/N.total*100),G.onProgress(N)});var $=new FormData;G.data&&Object.keys(G.data).forEach(function(V){var N=G.data[V];if(Array.isArray(N)){N.forEach(function(z){$.append(V+"[]",z)});return}$.append(V,G.data[V])}),G.file instanceof Blob?$.append(G.filename,G.file,G.file.name):$.append(G.filename,G.file),k.onerror=function(N){G.onError(N)},k.onload=function(){return k.status<200||k.status>=300?G.onError(L(G,k),E(k)):G.onSuccess(E(k),k)},k.open(G.method,G.action,!0),G.withCredentials&&"withCredentials"in k&&(k.withCredentials=!0);var X=G.headers||{};return X["X-Requested-With"]!==null&&k.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(X).forEach(function(V){X[V]!==null&&k.setRequestHeader(V,X[V])}),k.send($),{abort:function(){k.abort()}}}var w=+new Date,v=0;function u(){return"rc-upload-"+w+"-"+ ++v}function h(G,k){return G.indexOf(k,G.length-k.length)!==-1}var a=function(G,k){if(G&&k){var $=Array.isArray(k)?k:k.split(","),X=G.name||"",V=G.type||"",N=V.replace(/\/.*$/,"");return $.some(function(z){var q=z.trim();return q.charAt(0)==="."?h(X.toLowerCase(),q.toLowerCase()):/\/\*$/.test(q)?N===q.replace(/\/.*$/,""):V===q})}return!0};function t(G,k){var $=G.createReader(),X=[];function V(){$.readEntries(function(N){var z=Array.prototype.slice.apply(N);X=X.concat(z);var q=!z.length;q?k(X):V()})}V()}var i=function(k,$,X){var V=function N(z,q){q=q||"",z.isFile?z.file(function(ee){X(ee)&&(z.fullPath&&!ee.webkitRelativePath&&(Object.defineProperties(ee,{webkitRelativePath:{writable:!0}}),ee.webkitRelativePath=z.fullPath.replace(/^\//,""),Object.defineProperties(ee,{webkitRelativePath:{writable:!1}})),$([ee]))}):z.isDirectory&&t(z,function(ee){ee.forEach(function(fe){N(fe,""+q+z.name+"/")})})};k.forEach(function(N){V(N.webkitGetAsEntry())})},l=i,c=Object.assign||function(G){for(var k=1;k<arguments.length;k++){var $=arguments[k];for(var X in $)Object.prototype.hasOwnProperty.call($,X)&&(G[X]=$[X])}return G},o=function(){function G(k,$){var X=[],V=!0,N=!1,z=void 0;try{for(var q=k[Symbol.iterator](),ee;!(V=(ee=q.next()).done)&&!(X.push(ee.value),$&&X.length===$);V=!0);}catch(fe){N=!0,z=fe}finally{try{!V&&q.return&&q.return()}finally{if(N)throw z}}return X}return function(k,$){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return G(k,$);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),e=function(){function G(k,$){for(var X=0;X<$.length;X++){var V=$[X];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(k,V.key,V)}}return function(k,$,X){return $&&G(k.prototype,$),X&&G(k,X),k}}();function s(G,k,$){return k in G?Object.defineProperty(G,k,{value:$,enumerable:!0,configurable:!0,writable:!0}):G[k]=$,G}function r(G,k){var $={};for(var X in G){if(k.indexOf(X)>=0)continue;if(!Object.prototype.hasOwnProperty.call(G,X))continue;$[X]=G[X]}return $}function d(G,k){if(!(G instanceof k))throw new TypeError("Cannot call a class as a function")}function f(G,k){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:G}function g(G,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);G.prototype=Object.create(k&&k.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(G,k):G.__proto__=k)}var m=function(k){return Object.keys(k).reduce(function($,X){return(X.substr(0,5)==="data-"||X.substr(0,5)==="aria-"||X==="role")&&($[X]=k[X]),$},{})},p=function(G){g(k,G);function k(){var $,X,V,N;d(this,k);for(var z=arguments.length,q=Array(z),ee=0;ee<z;ee++)q[ee]=arguments[ee];return N=(X=(V=f(this,($=k.__proto__||Object.getPrototypeOf(k)).call.apply($,[this].concat(q))),V),V.state={uid:u()},V.reqs={},V.onChange=function(fe){var ae=fe.target.files;V.uploadFiles(ae),V.reset()},V.onClick=function(fe){var ae=V.fileInput;if(!ae)return;var pe=V.props,se=pe.children,ge=pe.onClick;se&&se.type==="button"&&(ae.parentNode.focus(),ae.parentNode.querySelector("button").blur()),ae.click(),ge&&ge(fe)},V.onKeyDown=function(fe){fe.key==="Enter"&&V.onClick()},V.onFileDrop=function(fe){var ae=V.props.multiple;if(fe.preventDefault(),fe.type==="dragover")return;if(V.props.directory)l(Array.prototype.slice.call(fe.dataTransfer.items),V.uploadFiles,function(se){return a(se,V.props.accept)});else{var pe=Array.prototype.slice.call(fe.dataTransfer.files).filter(function(se){return a(se,V.props.accept)});ae===!1&&(pe=pe.slice(0,1)),V.uploadFiles(pe)}},V.uploadFiles=function(fe){var ae=Array.prototype.slice.call(fe);ae.map(function(pe){return pe.uid=u(),pe}).forEach(function(pe){V.upload(pe,ae)})},V.saveFileInput=function(fe){V.fileInput=fe},X),f(V,N)}return e(k,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(X,V){var N=this,z=this.props;if(!z.beforeUpload)return setTimeout(function(){return N.post(X)},0);var q=z.beforeUpload(X,V);q&&q.then?q.then(function(ee){var fe=Object.prototype.toString.call(ee);return fe==="[object File]"||fe==="[object Blob]"?N.post(ee):N.post(X)}).catch(function(ee){console.log(ee)}):q!==!1&&setTimeout(function(){return N.post(X)},0);return}},{key:"post",value:function(X){var V=this;if(!this._isMounted)return;var N=this.props,z=N.onStart,q=N.onProgress,ee=N.transformFile,fe=ee===void 0?function(ae){return ae}:ee;new Promise(function(ae){var pe=N.action;return typeof pe=="function"&&(pe=pe(X)),ae(pe)}).then(function(ae){var pe=X.uid,se=N.customRequest||A,ge=Promise.resolve(fe(X)).then(function(ie){var te=N.data;return typeof te=="function"&&(te=te(ie)),Promise.all([ie,te])}).catch(function(ie){console.error(ie)});ge.then(function(ie){var te=o(ie,2),Q=te[0],me=te[1],re={action:ae,filename:N.name,data:me,file:Q,headers:N.headers,withCredentials:N.withCredentials,method:N.method||"post",onProgress:q?function(J){q(J,X)}:null,onSuccess:function(be,Ee){delete V.reqs[pe],N.onSuccess(be,X,Ee)},onError:function(be,Ee){delete V.reqs[pe],N.onError(be,Ee,X)}};z(X),V.reqs[pe]=se(re)})})}},{key:"reset",value:function(){this.setState({uid:u()})}},{key:"abort",value:function(X){var V=this.reqs;if(X){var N=X;X&&X.uid&&(N=X.uid),V[N]&&V[N].abort&&V[N].abort(),delete V[N]}else Object.keys(V).forEach(function(z){V[z]&&V[z].abort&&V[z].abort(),delete V[z]})}},{key:"render",value:function(){var X,V=this.props,N=V.component,z=V.prefixCls,q=V.className,ee=V.disabled,fe=V.id,ae=V.style,pe=V.multiple,se=V.accept,ge=V.children,ie=V.directory,te=V.openFileDialogOnClick,Q=V.onMouseEnter,me=V.onMouseLeave,re=r(V,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),J=b()((X={},s(X,z,!0),s(X,z+"-disabled",ee),s(X,q,q),X)),be=ee?{}:{onClick:te?this.onClick:function(){},onKeyDown:te?this.onKeyDown:function(){},onMouseEnter:Q,onMouseLeave:me,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return Z.a.createElement(N,c({},be,{className:J,role:"button",style:ae}),Z.a.createElement("input",c({},m(re),{id:fe,type:"file",ref:this.saveFileInput,onClick:function(Le){return Le.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:se,directory:ie?"directory":null,webkitdirectory:ie?"webkitdirectory":null,multiple:pe,onChange:this.onChange})),ge)}}]),k}(Se.Component),_=p,y=Object.assign||function(G){for(var k=1;k<arguments.length;k++){var $=arguments[k];for(var X in $)Object.prototype.hasOwnProperty.call($,X)&&(G[X]=$[X])}return G},n=function(){function G(k,$){for(var X=0;X<$.length;X++){var V=$[X];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(k,V.key,V)}}return function(k,$,X){return $&&G(k.prototype,$),X&&G(k,X),k}}();function x(G,k){if(!(G instanceof k))throw new TypeError("Cannot call a class as a function")}function S(G,k){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:G}function T(G,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);G.prototype=Object.create(k&&k.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(G,k):G.__proto__=k)}function R(){}var D=function(G){T(k,G);function k(){var $,X,V,N;x(this,k);for(var z=arguments.length,q=Array(z),ee=0;ee<z;ee++)q[ee]=arguments[ee];return N=(X=(V=S(this,($=k.__proto__||Object.getPrototypeOf(k)).call.apply($,[this].concat(q))),V),V.saveUploader=function(fe){V.uploader=fe},X),S(V,N)}return n(k,[{key:"abort",value:function(X){this.uploader.abort(X)}},{key:"render",value:function(){return Z.a.createElement(_,y({},this.props,{ref:this.saveUploader}))}}]),k}(Se.Component);D.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:R,onError:R,onSuccess:R,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var I=D,B=tt.a=I},Gytx:function(rt,tt){rt.exports=function(Se,Z,U,b){var L=U?U.call(b,Se,Z):void 0;if(L!==void 0)return!!L;if(Se===Z)return!0;if(typeof Se!="object"||!Se||typeof Z!="object"||!Z)return!1;var E=Object.keys(Se),A=Object.keys(Z);if(E.length!==A.length)return!1;for(var w=Object.prototype.hasOwnProperty.bind(Z),v=0;v<E.length;v++){var u=E[v];if(!w(u))return!1;var h=Se[u],a=Z[u];if(L=U?U.call(b,h,a,u):void 0,L===!1||L===void 0&&h!==a)return!1}return!0}},J66h:function(rt,tt,he){(function(Se){var Z,U;(function(b,L){rt.exports=L(b)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Se!="undefined"?Se:this,function(b){"use strict";b=b||{};var L=b.Base64,E="2.6.4",A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=function(R){for(var D={},I=0,B=R.length;I<B;I++)D[R.charAt(I)]=I;return D}(A),v=String.fromCharCode,u=function(R){if(R.length<2){var D=R.charCodeAt(0);return D<128?R:D<2048?v(192|D>>>6)+v(128|D&63):v(224|D>>>12&15)+v(128|D>>>6&63)+v(128|D&63)}else{var D=65536+(R.charCodeAt(0)-55296)*1024+(R.charCodeAt(1)-56320);return v(240|D>>>18&7)+v(128|D>>>12&63)+v(128|D>>>6&63)+v(128|D&63)}},h=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,a=function(R){return R.replace(h,u)},t=function(R){var D=[0,2,1][R.length%3],I=R.charCodeAt(0)<<16|(R.length>1?R.charCodeAt(1):0)<<8|(R.length>2?R.charCodeAt(2):0),B=[A.charAt(I>>>18),A.charAt(I>>>12&63),D>=2?"=":A.charAt(I>>>6&63),D>=1?"=":A.charAt(I&63)];return B.join("")},i=b.btoa&&typeof b.btoa=="function"?function(R){return b.btoa(R)}:function(R){if(R.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return R.replace(/[\s\S]{1,3}/g,t)},l=function(R){return i(a(String(R)))},c=function(R){return R.replace(/[+\/]/g,function(D){return D=="+"?"-":"_"}).replace(/=/g,"")},o=function(R,D){return D?c(l(R)):l(R)},e=function(R){return o(R,!0)},s;b.Uint8Array&&(s=function(R,D){for(var I="",B=0,G=R.length;B<G;B+=3){var k=R[B],$=R[B+1],X=R[B+2],V=k<<16|$<<8|X;I+=A.charAt(V>>>18)+A.charAt(V>>>12&63)+(typeof $!="undefined"?A.charAt(V>>>6&63):"=")+(typeof X!="undefined"?A.charAt(V&63):"=")}return D?c(I):I});var r=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,d=function(R){switch(R.length){case 4:var D=(7&R.charCodeAt(0))<<18|(63&R.charCodeAt(1))<<12|(63&R.charCodeAt(2))<<6|63&R.charCodeAt(3),I=D-65536;return v((I>>>10)+55296)+v((I&1023)+56320);case 3:return v((15&R.charCodeAt(0))<<12|(63&R.charCodeAt(1))<<6|63&R.charCodeAt(2));default:return v((31&R.charCodeAt(0))<<6|63&R.charCodeAt(1))}},f=function(R){return R.replace(r,d)},g=function(R){var D=R.length,I=D%4,B=(D>0?w[R.charAt(0)]<<18:0)|(D>1?w[R.charAt(1)]<<12:0)|(D>2?w[R.charAt(2)]<<6:0)|(D>3?w[R.charAt(3)]:0),G=[v(B>>>16),v(B>>>8&255),v(B&255)];return G.length-=[0,0,2,1][I],G.join("")},m=b.atob&&typeof b.atob=="function"?function(R){return b.atob(R)}:function(R){return R.replace(/\S{1,4}/g,g)},p=function(R){return m(String(R).replace(/[^A-Za-z0-9\+\/]/g,""))},_=function(R){return f(m(R))},y=function(R){return String(R).replace(/[-_]/g,function(D){return D=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},n=function(R){return _(y(R))},x;b.Uint8Array&&(x=function(R){return Uint8Array.from(p(y(R)),function(D){return D.charCodeAt(0)})});var S=function(){var R=b.Base64;return b.Base64=L,R};if(b.Base64={VERSION:E,atob:p,btoa:i,fromBase64:n,toBase64:o,utob:a,encode:o,encodeURI:e,btou:f,decode:n,noConflict:S,fromUint8Array:s,toUint8Array:x},typeof Object.defineProperty=="function"){var T=function(R){return{value:R,enumerable:!1,writable:!0,configurable:!0}};b.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",T(function(){return n(this)})),Object.defineProperty(String.prototype,"toBase64",T(function(R){return o(this,R)})),Object.defineProperty(String.prototype,"toBase64URI",T(function(){return o(this,!0)}))}}return b.Meteor&&(Base64=b.Base64),rt.exports?rt.exports.Base64=b.Base64:!(Z=[],U=function(){return b.Base64}.apply(tt,Z),U!==void 0&&(rt.exports=U)),{Base64:b.Base64}})}).call(this,he("IyRk"))},JqQi:function(rt,tt,he){rt.exports={bg:"bg___31owl",container:"container___2NGOo"}},LdHM:function(rt,tt,he){"use strict";he.d(tt,"b",function(){return r}),he.d(tt,"a",function(){return f});var Se=he("1OyB"),Z=he("vuIU"),U=he("Ji7U"),b=he("LK+K"),L=he("cDcd"),E=he("rePB"),A=he("Ff2n"),w=he("ODXe"),v=he("4IlW"),u=he("bX4T"),h=he("YrtM"),a=he("TSYQ"),t=he.n(a),i=he("+nKL"),l=he("8OUc"),c=function(X,V){var N=X.prefixCls,z=X.id,q=X.flattenOptions,ee=X.childrenAsData,fe=X.values,ae=X.searchValue,pe=X.multiple,se=X.defaultActiveFirstOption,ge=X.height,ie=X.itemHeight,te=X.notFoundContent,Q=X.open,me=X.menuItemSelectedIcon,re=X.virtual,J=X.onSelect,be=X.onToggleOpen,Ee=X.onActiveValue,Le=X.onScroll,H=X.onMouseEnter,C="".concat(N,"-item"),O=Object(h.a)(function(){return q},[Q,q],function(Re,xe){return xe[0]&&Re[1]!==xe[1]}),j=L.useRef(null),M=function(xe){xe.preventDefault()},F=function(xe){j.current&&j.current.scrollTo({index:xe})},oe=function(xe){for(var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Te=O.length,ue=0;ue<Te;ue+=1){var de=(xe+ue*we+Te)%Te,_e=O[de],ye=_e.group,Ie=_e.data;if(!ye&&!Ie.disabled)return de}return-1},ve=L.useState(function(){return oe(0)}),ke=Object(w.a)(ve,2),Oe=ke[0],De=ke[1],Ue=function(xe){De(xe);var we=O[xe];if(!we){Ee(null,-1);return}Ee(we.data.value,xe)};L.useEffect(function(){Ue(se!==!1?oe(0):-1)},[O.length,ae]),L.useEffect(function(){var Re=setTimeout(function(){if(!pe&&Q&&fe.size===1){var xe=Array.from(fe)[0],we=O.findIndex(function(Te){var ue=Te.data;return ue.value===xe});Ue(we),F(we)}});return function(){return clearTimeout(Re)}},[Q]);var Ke=function(xe){xe!==void 0&&J(xe,{selected:!fe.has(xe)}),pe||be(!1)};if(L.useImperativeHandle(V,function(){return{onKeyDown:function(xe){var we=xe.which;switch(we){case v.a.UP:case v.a.DOWN:{var Te=0;if(we===v.a.UP?Te=-1:we===v.a.DOWN&&(Te=1),Te!==0){var ue=oe(Oe+Te,Te);F(ue),Ue(ue)}break}case v.a.ENTER:{var de=O[Oe];de&&!de.data.disabled?Ke(de.data.value):Ke(void 0),Q&&xe.preventDefault();break}case v.a.ESC:be(!1)}},onKeyUp:function(){},scrollTo:function(xe){F(xe)}}}),O.length===0)return L.createElement("div",{role:"listbox",id:"".concat(z,"_list"),className:"".concat(C,"-empty"),onMouseDown:M},te);function Pe(Re){var xe=O[Re];if(!xe)return null;var we=xe.data||{},Te=we.value,ue=we.label,de=we.children,_e=Object(u.a)(we,!0),ye=ee?de:ue;return xe?L.createElement("div",Object.assign({"aria-label":typeof ye=="string"?ye:null},_e,{key:Re,role:"option",id:"".concat(z,"_list_").concat(Re),"aria-selected":fe.has(Te)}),Te):null}return L.createElement(L.Fragment,null,L.createElement("div",{role:"listbox",id:"".concat(z,"_list"),style:{height:0,width:0,overflow:"hidden"}},Pe(Oe-1),Pe(Oe),Pe(Oe+1)),L.createElement(i.a,{itemKey:"key",ref:j,data:O,height:ge,itemHeight:ie,fullHeight:!1,onMouseDown:M,onScroll:Le,virtual:re,onMouseEnter:H},function(Re,xe){var we,Te=Re.group,ue=Re.groupOption,de=Re.data,_e=de.label,ye=de.key;if(Te)return L.createElement("div",{className:t()(C,"".concat(C,"-group"))},_e!==void 0?_e:ye);var Ie=de.disabled,Me=de.value,ze=de.title,st=de.children,nt=de.style,Ve=de.className,et=Object(A.a)(de,["disabled","value","title","children","style","className"]),Ge=fe.has(Me),He="".concat(C,"-option"),Ye=t()(C,He,Ve,(we={},Object(E.a)(we,"".concat(He,"-grouped"),ue),Object(E.a)(we,"".concat(He,"-active"),Oe===xe&&!Ie),Object(E.a)(we,"".concat(He,"-disabled"),Ie),Object(E.a)(we,"".concat(He,"-selected"),Ge),we)),Je=ee?st:_e,ot=!me||typeof me=="function"||Ge;return L.createElement("div",Object.assign({},et,{"aria-selected":Ge,className:Ye,title:ze,onMouseMove:function(){if(Oe===xe||Ie)return;Ue(xe)},onClick:function(){Ie||Ke(Me)},style:nt}),L.createElement("div",{className:"".concat(He,"-content")},Je||Me),L.isValidElement(me)||Ge,ot&&L.createElement(l.a,{className:"".concat(C,"-option-state"),customizeIcon:me,customizeIconProps:{isSelected:Ge}},Ge?"\u2713":null))}))},o=L.forwardRef(c);o.displayName="OptionList";var e=o,s=function(){return null};s.isSelectOption=!0;var r=s,d=function(){return null};d.isSelectOptGroup=!0;var f=d,g=he("VTBJ"),m=he("Zm9Q");function p($){var X=$.key,V=$.props,N=V.children,z=V.value,q=Object(A.a)(V,["children","value"]);return Object(g.a)({key:X,value:z!==void 0?z:X,children:N},q)}function _($){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(m.a)($).map(function(V,N){if(!L.isValidElement(V)||!V.type)return null;var z=V.type.isSelectOptGroup,q=V.key,ee=V.props,fe=ee.children,ae=Object(A.a)(ee,["children"]);return X||!z?p(V):Object(g.a)(Object(g.a)({key:"__RC_SELECT_GRP__".concat(q===null?N:q,"__"),label:q},ae),{},{options:_(fe)})}).filter(function(V){return V})}var y=he("2Qr1"),n=he("qNPg"),x=he("U8pU"),S=he("Kwbf"),T=he("WKfj");function R($){var X=$.mode,V=$.options,N=$.children,z=$.backfill,q=$.allowClear,ee=$.placeholder,fe=$.getInputElement,ae=$.showSearch,pe=$.onSearch,se=$.defaultOpen,ge=$.autoFocus,ie=$.labelInValue,te=$.value,Q=$.inputValue,me=$.optionLabelProp,re=X==="multiple"||X==="tags",J=ae!==void 0?ae:re||X==="combobox",be=V||_(N);if(Object(S.a)(X!=="tags"||be.every(function(C){return!C.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),X==="tags"||X==="combobox"){var Ee=be.some(function(C){return C.options?C.options.some(function(O){return typeof("value"in O?O.value:O.key)=="number"}):typeof("value"in C?C.value:C.key)=="number"});Object(S.a)(!Ee,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(X!=="combobox"||!me,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(X==="combobox"||!z,"`backfill` only works with `combobox` mode."),Object(S.a)(X==="combobox"||!fe,"`getInputElement` only work with `combobox` mode."),Object(S.b)(X!=="combobox"||!fe||!q||!ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),pe&&!J&&X!=="combobox"&&X!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!se||ge,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),te!=null){var Le=Object(T.d)(te);Object(S.a)(!ie||Le.every(function(C){return Object(x.a)(C)==="object"&&("key"in C||"value"in C)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!re||Array.isArray(te),"`value` should be array when `mode` is `multiple` or `tags`")}if(N){var H=null;Object(m.a)(N).some(function(C){if(!L.isValidElement(C)||!C.type)return!1;var O=C.type;if(O.isSelectOption)return!1;if(O.isSelectOptGroup){var j=Object(m.a)(C.props.children).every(function(M){return!L.isValidElement(M)||!C.type||M.type.isSelectOption?!0:(H=M.type,!1)});return!j}return H=O,!0}),H&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(H.displayName||H.name||H,"`.")),Object(S.a)(Q===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var D=R,I=Object(n.a)({prefixCls:"rc-select",components:{optionList:e},convertChildrenToData:_,flattenOptions:y.d,getLabeledValue:y.e,filterOptions:y.b,isValueDisabled:y.g,findValueOption:y.c,warningProps:D,fillOptionsWithMissingValue:y.a}),B=function($){Object(U.a)(V,$);var X=Object(b.a)(V);function V(){var N;return Object(Se.a)(this,V),N=X.apply(this,arguments),N.selectRef=L.createRef(),N.focus=function(){N.selectRef.current.focus()},N.blur=function(){N.selectRef.current.blur()},N}return Object(Z.a)(V,[{key:"render",value:function(){return L.createElement(I,Object.assign({ref:this.selectRef},this.props))}}]),V}(L.Component);B.Option=r,B.OptGroup=f;var G=B,k=tt.c=G},MRWH:function(rt,tt,he){rt.exports={flex_box_center:"flex_box_center___30XbU",flex_space_between:"flex_space_between___3jfWA",flex_box_vertical_center:"flex_box_vertical_center___27kWs",flex_box_center_end:"flex_box_center_end___1RoAS",flex_box_column:"flex_box_column____3Jvr",list:"list___2NJ_T",box:"box___36KCF",title:"title___Kd2ce",gray:"gray___14ob6",brght:"brght___GgzyD",s1:"s1___IhDpz",s2:"s2___3hR0s",s3:"s3___23SCF",active:"active___2_5D5",line:"line___3Croa"}},NLgs:function(rt,tt,he){"use strict";he.d(tt,"e",function(){return r}),he.d(tt,"f",function(){return d}),he.d(tt,"d",function(){return g}),he.d(tt,"c",function(){return m}),he.d(tt,"a",function(){return p}),he.d(tt,"b",function(){return _});var Se=he("miYZ"),Z=he("tsqr"),U=he("9og8"),b=he("2qtc"),L=he("kLXV"),E=he("WmNS"),A=he.n(E),w=he("cDcd"),v=he.n(w),u=he("9kvl"),h=he("xKgJ"),a=he("1vsH"),t=he("RCxd"),i=he("mOS8"),l=he.n(i),c=he("1ZF9"),o=he.n(c),e=he("NoGO"),s=he.n(e),r=function(n){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(d(n)&&f(x))},d=function(n){return Object(h.p)()?!0:(n({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},f=function(){var n,x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,S=Object(u.c)()._store.getState(),T=S.user;return(n=T.userInfo)!==null&&n!==void 0&&n.profile_completed?!0:(L.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:x?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){u.d.push("/account/profile/edit")}}),!1)},g=function(){var n,x=Object(u.c)()._store.getState(),S=x.user;return(n=S.userInfo)!==null&&n!==void 0&&n.professional_certification?!0:(L.a.confirm({title:"\u63D0\u793A",centered:!0,content:v.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(a.U)("/account/certification")}}),!1)},m=function(){return Object(h.a)()?!0:(L.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:v.a.createElement("div",{className:"tc",style:{marginLeft:-38}},v.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),v.a.createElement("img",{src:s.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},p=function(n,x){return n?!0:(L.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:v.a.createElement("div",null,v.a.createElement("p",null,x||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),v.a.createElement("div",{style:{marginLeft:"110px"}},v.a.createElement("img",{src:o.a,width:200}),v.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(a.U)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},_=function(n){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",S=Object(u.c)()._store.getState(),T=S.shixunsDetail.detail;return(T==null?void 0:T.public)===2||(T==null?void 0:T.public)===1||(T==null?void 0:T.shixun_status)===3?(L.a.info({centered:!0,icon:v.a.createElement(t.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:v.a.createElement("div",{className:"tc",style:{marginLeft:-38}},v.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},v.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(T==null?void 0:T.public)===2?"\u5DF2\u516C\u5F00":(T==null?void 0:T.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",x,"\u3002"),v.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),v.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:l.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(T==null?void 0:T.shixun_status)===2?(L.a.confirm({centered:!0,icon:v.a.createElement(t.a,null),title:"\u63D0\u793A",content:v.a.createElement("div",null,v.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",x,"\u3002"),v.a.createElement("br",null),v.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){L.a.confirm({width:440,centered:!0,icon:v.a.createElement(t.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var D=Object(U.a)(A.a.mark(function B(){var G;return A.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.next=2,n({type:"shixunsDetail/cancelRelease",payload:{id:T==null?void 0:T.identifier}});case 2:G=$.sent,G.status!==401&&(Z.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),n({type:"shixunsDetail/getShixunsDetail",payload:{id:T==null?void 0:T.identifier}}),n({type:"practiceSetting/getCommonData",payload:{id:T==null?void 0:T.identifier}}));case 4:case"end":return $.stop()}},B)}));function I(){return D.apply(this,arguments)}return I}()})}}),!0):!1}},NoGO:function(rt,tt,he){rt.exports=he.p+"static/newqrcode.9bae6615.png"},OLES:function(rt,tt,he){"use strict";var Se=he("U8pU"),Z=he("VTBJ"),U=he("Ff2n"),b=he("cDcd"),L=he("uciX"),E=he("7ixt"),A=function(t){var i=t.overlay,l=t.prefixCls,c=t.id,o=t.overlayInnerStyle;return b.createElement("div",{className:"".concat(l,"-inner"),id:c,role:"tooltip",style:o},typeof i=="function"?i():i)},w=A,v=function(t,i){var l=t.overlayClassName,c=t.trigger,o=c===void 0?["hover"]:c,e=t.mouseEnterDelay,s=e===void 0?0:e,r=t.mouseLeaveDelay,d=r===void 0?.1:r,f=t.overlayStyle,g=t.prefixCls,m=g===void 0?"rc-tooltip":g,p=t.children,_=t.onVisibleChange,y=t.afterVisibleChange,n=t.transitionName,x=t.animation,S=t.placement,T=S===void 0?"right":S,R=t.align,D=R===void 0?{}:R,I=t.destroyTooltipOnHide,B=I===void 0?!1:I,G=t.defaultVisible,k=t.getTooltipContainer,$=t.overlayInnerStyle,X=Object(U.a)(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),V=Object(b.useRef)(null);Object(b.useImperativeHandle)(i,function(){return V.current});var N=Object(Z.a)({},X);"visible"in t&&(N.popupVisible=t.visible);var z=function(){var pe=t.arrowContent,se=pe===void 0?null:pe,ge=t.overlay,ie=t.id;return[b.createElement("div",{className:"".concat(m,"-arrow"),key:"arrow"},se),b.createElement(w,{key:"content",prefixCls:m,id:ie,overlay:ge,overlayInnerStyle:$})]},q=!1,ee=!1;if(typeof B=="boolean")q=B;else if(B&&Object(Se.a)(B)==="object"){var fe=B.keepParent;q=fe===!0,ee=fe===!1}return b.createElement(L.a,Object.assign({popupClassName:l,prefixCls:m,popup:z,action:o,builtinPlacements:E.a,popupPlacement:T,ref:V,popupAlign:D,getPopupContainer:k,onPopupVisibleChange:_,afterPopupVisibleChange:y,popupTransitionName:n,popupAnimation:x,defaultPopupVisible:G,destroyPopupOnHide:q,autoDestroy:ee,mouseLeaveDelay:d,popupStyle:f,mouseEnterDelay:s},N),p)},u=Object(b.forwardRef)(v),h=tt.a=u},P5Jw:function(rt,tt,he){"use strict";var Se=he("rHrb"),Z=Se.CopyToClipboard;Z.CopyToClipboard=Z,rt.exports=Z},SJMd:function(rt,tt){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var he,Se,Z,U=!1,b,L;window.PR_SHOULD_USE_CONTINUATION=!0;var E,A;(function(){var w=window,v=["break,continue,do,else,for,if,return,while"],u=[v,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],h=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],a=[h,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],t=[h,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],i=[h,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],l="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",c=[h,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",e=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],s=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],r=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],d=[a,i,t,c,o,e,s,r],f=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,g="str",m="kwd",p="com",_="typ",y="lit",n="pun",x="pln",S="tag",T="dec",R="src",D="atn",I="atv",B="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(J){for(var be=0,Ee=!1,Le=!1,H=0,C=J.length;H<C;++H){var O=J[H];if(O.ignoreCase)Le=!0;else if(/[a-z]/i.test(O.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ee=!0,Le=!1;break}}var j={b:8,t:9,n:10,v:11,f:12,r:13};function M(Oe){var De=Oe.charCodeAt(0);if(De!==92)return De;var Ue=Oe.charAt(1);return De=j[Ue],De||("0"<=Ue&&Ue<="7"?parseInt(Oe.substring(1),8):Ue==="u"||Ue==="x"?parseInt(Oe.substring(2),16):Oe.charCodeAt(1))}function F(Oe){if(Oe<32)return(Oe<16?"\\x0":"\\x")+Oe.toString(16);var De=String.fromCharCode(Oe);return De==="\\"||De==="-"||De==="]"||De==="^"?"\\"+De:De}function oe(Oe){var De=Oe.substring(1,Oe.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Ue=[],Ke=De[0]==="^",Pe=["["];Ke&&Pe.push("^");for(var Re=Ke?1:0,xe=De.length;Re<xe;++Re){var we=De[Re];if(/\\[bdsw]/i.test(we))Pe.push(we);else{var Te=M(we),ue;Re+2<xe&&De[Re+1]==="-"?(ue=M(De[Re+2]),Re+=2):ue=Te,Ue.push([Te,ue]),ue<65||Te>122||(ue<65||Te>90||Ue.push([Math.max(65,Te)|32,Math.min(ue,90)|32]),ue<97||Te>122||Ue.push([Math.max(97,Te)&~32,Math.min(ue,122)&~32]))}}Ue.sort(function(Ie,Me){return Ie[0]-Me[0]||Me[1]-Ie[1]});for(var de=[],_e=[],Re=0;Re<Ue.length;++Re){var ye=Ue[Re];ye[0]<=_e[1]+1?_e[1]=Math.max(_e[1],ye[1]):de.push(_e=ye)}for(var Re=0;Re<de.length;++Re){var ye=de[Re];Pe.push(F(ye[0])),ye[1]>ye[0]&&(ye[1]+1>ye[0]&&Pe.push("-"),Pe.push(F(ye[1])))}return Pe.push("]"),Pe.join("")}function ve(Oe){for(var De=Oe.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ue=De.length,Ke=[],Pe=0,Re=0;Pe<Ue;++Pe){var xe=De[Pe];if(xe==="(")++Re;else if(xe.charAt(0)==="\\"){var we=+xe.substring(1);we&&(we<=Re?Ke[we]=-1:De[Pe]=F(we))}}for(var Pe=1;Pe<Ke.length;++Pe)Ke[Pe]===-1&&(Ke[Pe]=++be);for(var Pe=0,Re=0;Pe<Ue;++Pe){var xe=De[Pe];if(xe==="(")++Re,Ke[Re]||(De[Pe]="(?:");else if(xe.charAt(0)==="\\"){var we=+xe.substring(1);we&&we<=Re&&(De[Pe]="\\"+Ke[we])}}for(var Pe=0;Pe<Ue;++Pe)De[Pe]==="^"&&De[Pe+1]!=="^"&&(De[Pe]="");if(Oe.ignoreCase&&Ee)for(var Pe=0;Pe<Ue;++Pe){var xe=De[Pe],Te=xe.charAt(0);xe.length>=2&&Te==="["?De[Pe]=oe(xe):Te!=="\\"&&(De[Pe]=xe.replace(/[a-zA-Z]/g,function(_e){var ye=_e.charCodeAt(0);return"["+String.fromCharCode(ye&~32,ye|32)+"]"}))}return De.join("")}for(var ke=[],H=0,C=J.length;H<C;++H){var O=J[H];if(O.global||O.multiline)throw new Error(""+O);ke.push("(?:"+ve(O)+")")}return new RegExp(ke.join("|"),Le?"gi":"g")}function $(J,be){var Ee=/(?:^|\s)nocode(?:\s|$)/,Le=[],H=0,C=[],O=0;function j(M){var F=M.nodeType;if(F==1){if(Ee.test(M.className))return;for(var oe=M.firstChild;oe;oe=oe.nextSibling)j(oe);var ve=M.nodeName.toLowerCase();(ve==="br"||ve==="li")&&(Le[O]=`
`,C[O<<1]=H++,C[O++<<1|1]=M)}else if(F==3||F==4){var ke=M.nodeValue;ke.length&&(be?ke=ke.replace(/\r\n?/g,`
`):ke=ke.replace(/[ \t\r\n]+/g," "),Le[O]=ke,C[O<<1]=H,H+=ke.length,C[O++<<1|1]=M)}}return j(J),{sourceCode:Le.join("").replace(/\n$/,""),spans:C}}function X(J,be,Ee,Le,H){if(!Ee)return;var C={sourceNode:J,pre:1,langExtension:null,numberLines:null,sourceCode:Ee,spans:null,basePos:be,decorations:null};Le(C),H.push.apply(H,C.decorations)}var V=/\S/;function N(J){for(var be=void 0,Ee=J.firstChild;Ee;Ee=Ee.nextSibling){var Le=Ee.nodeType;be=Le===1?be?J:Ee:Le===3&&V.test(Ee.nodeValue)?J:be}return be===J?void 0:be}function z(J,be){var Ee={},Le;(function(){for(var O=J.concat(be),j=[],M={},F=0,oe=O.length;F<oe;++F){var ve=O[F],ke=ve[3];if(ke)for(var Oe=ke.length;--Oe>=0;)Ee[ke.charAt(Oe)]=ve;var De=ve[1],Ue=""+De;M.hasOwnProperty(Ue)||(j.push(De),M[Ue]=null)}j.push(/[\0-\uffff]/),Le=k(j)})();var H=be.length,C=function(O){for(var j=O.sourceCode,M=O.basePos,F=O.sourceNode,oe=[M,x],ve=0,ke=j.match(Le)||[],Oe={},De=0,Ue=ke.length;De<Ue;++De){var Ke=ke[De],Pe=Oe[Ke],Re=void 0,xe;if(typeof Pe=="string")xe=!1;else{var we=Ee[Ke.charAt(0)];if(we)Re=Ke.match(we[1]),Pe=we[0];else{for(var Te=0;Te<H;++Te)if(we=be[Te],Re=Ke.match(we[1]),Re){Pe=we[0];break}Re||(Pe=x)}xe=Pe.length>=5&&Pe.substring(0,5)==="lang-",xe&&!(Re&&typeof Re[1]=="string")&&(xe=!1,Pe=R),xe||(Oe[Ke]=Pe)}var ue=ve;if(ve+=Ke.length,!xe)oe.push(M+ue,Pe);else{var de=Re[1],_e=Ke.indexOf(de),ye=_e+de.length;Re[2]&&(ye=Ke.length-Re[2].length,_e=ye-de.length);var Ie=Pe.substring(5);X(F,M+ue,Ke.substring(0,_e),C,oe),X(F,M+ue+_e,de,ge(Ie,de),oe),X(F,M+ue+ye,Ke.substring(ye),C,oe)}}O.decorations=oe};return C}function q(J){var be=[],Ee=[];J.tripleQuotedStrings?be.push([g,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):J.multiLineStrings?be.push([g,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):be.push([g,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),J.verbatimStrings&&Ee.push([g,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Le=J.hashComments;Le&&(J.cStyleComments?(Le>1?be.push([p,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):be.push([p,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ee.push([g,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):be.push([p,/^#[^\r\n]*/,null,"#"])),J.cStyleComments&&(Ee.push([p,/^\/\/[^\r\n]*/,null]),Ee.push([p,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var H=J.regexLiterals;if(H){var C=H>1?"":`
\r`,O=C?".":"[\\S\\s]",j="/(?=[^/*"+C+"])(?:[^/\\x5B\\x5C"+C+"]|\\x5C"+O+"|\\x5B(?:[^\\x5C\\x5D"+C+"]|\\x5C"+O+")*(?:\\x5D|$))+/";Ee.push(["lang-regex",RegExp("^"+G+"("+j+")")])}var M=J.types;M&&Ee.push([_,M]);var F=(""+J.keywords).replace(/^ | $/g,"");F.length&&Ee.push([m,new RegExp("^(?:"+F.replace(/[\s,]+/g,"|")+")\\b"),null]),be.push([x,/^\s+/,null,` \r
\xA0`]);var oe="^.[^\\s\\w.$@'\"`/\\\\]*";return J.regexLiterals&&(oe+="(?!s*/)"),Ee.push([y,/^@[a-z_$][a-z_$@0-9]*/i,null],[_,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[x,/^[a-z_$][a-z_$@0-9]*/i,null],[y,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[x,/^\\[\s\S]?/,null],[n,new RegExp(oe),null]),z(be,Ee)}var ee=q({keywords:d,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function fe(J,be,Ee){for(var Le=/(?:^|\s)nocode(?:\s|$)/,H=/\r\n?|\n/,C=J.ownerDocument,O=C.createElement("li");J.firstChild;)O.appendChild(J.firstChild);var j=[O];function M(De){var Ue=De.nodeType;if(Ue==1&&!Le.test(De.className))if(De.nodeName==="br")F(De),De.parentNode&&De.parentNode.removeChild(De);else for(var Ke=De.firstChild;Ke;Ke=Ke.nextSibling)M(Ke);else if((Ue==3||Ue==4)&&Ee){var Pe=De.nodeValue,Re=Pe.match(H);if(Re){var xe=Pe.substring(0,Re.index);De.nodeValue=xe;var we=Pe.substring(Re.index+Re[0].length);if(we){var Te=De.parentNode;Te.insertBefore(C.createTextNode(we),De.nextSibling)}F(De),xe||De.parentNode.removeChild(De)}}}function F(De){for(;!De.nextSibling;)if(De=De.parentNode,!De)return;function Ue(Re,xe){var we=xe?Re.cloneNode(!1):Re,Te=Re.parentNode;if(Te){var ue=Ue(Te,1),de=Re.nextSibling;ue.appendChild(we);for(var _e=de;_e;_e=de)de=_e.nextSibling,ue.appendChild(_e)}return we}for(var Ke=Ue(De.nextSibling,0),Pe;(Pe=Ke.parentNode)&&Pe.nodeType===1;)Ke=Pe;j.push(Ke)}for(var oe=0;oe<j.length;++oe)M(j[oe]);be===(be|0)&&j[0].setAttribute("value",be);var ve=C.createElement("ol");ve.className="linenums";for(var ke=Math.max(0,be-1|0)||0,oe=0,Oe=j.length;oe<Oe;++oe)O=j[oe],O.className="L"+(oe+ke)%10,O.firstChild||O.appendChild(C.createTextNode("\xA0")),ve.appendChild(O);J.appendChild(ve)}function ae(J){var be=/\bMSIE\s(\d+)/.exec(navigator.userAgent);be=be&&+be[1]<=8;var Ee=/\n/g,Le=J.sourceCode,H=Le.length,C=0,O=J.spans,j=O.length,M=0,F=J.decorations,oe=F.length,ve=0;F[oe]=H;var ke,Oe;for(Oe=ke=0;Oe<oe;)F[Oe]!==F[Oe+2]?(F[ke++]=F[Oe++],F[ke++]=F[Oe++]):Oe+=2;for(oe=ke,Oe=ke=0;Oe<oe;){for(var De=F[Oe],Ue=F[Oe+1],Ke=Oe+2;Ke+2<=oe&&F[Ke+1]===Ue;)Ke+=2;F[ke++]=De,F[ke++]=Ue,Oe=Ke}oe=F.length=ke;var Pe=J.sourceNode,Re="";Pe&&(Re=Pe.style.display,Pe.style.display="none");try{for(var xe=null;M<j;){var we=O[M],Te=O[M+2]||H,ue=F[ve+2]||H,Ke=Math.min(Te,ue),de=O[M+1],_e;if(de.nodeType!==1&&(_e=Le.substring(C,Ke))){be&&(_e=_e.replace(Ee,"\r")),de.nodeValue=_e;var ye=de.ownerDocument,Ie=ye.createElement("span");Ie.className=F[ve+1];var Me=de.parentNode;Me.replaceChild(Ie,de),Ie.appendChild(de),C<Te&&(O[M+1]=de=ye.createTextNode(Le.substring(Ke,Te)),Me.insertBefore(de,Ie.nextSibling))}C=Ke,C>=Te&&(M+=2),C>=ue&&(ve+=2)}}finally{Pe&&(Pe.style.display=Re)}}var pe={};function se(J,be){for(var Ee=be.length;--Ee>=0;){var Le=be[Ee];pe.hasOwnProperty(Le)?w.console&&console.warn("cannot override language handler %s",Le):pe[Le]=J}}function ge(J,be){return J&&pe.hasOwnProperty(J)||(J=/^\s*</.test(be)?"default-markup":"default-code"),pe[J]}se(ee,["default-code"]),se(z([],[[x,/^[^<?]+/],[T,/^<!\w[^>]*(?:>|$)/],[p,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[n,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),se(z([[x,/^[\s]+/,null,` \r
`],[I,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[S,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[D,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[n,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),se(z([],[[I,/^[\s\S]+/]]),["uq.val"]),se(q({keywords:a,hashComments:!0,cStyleComments:!0,types:f}),["c","cc","cpp","cxx","cyc","m"]),se(q({keywords:"null,true,false"}),["json"]),se(q({keywords:i,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:f}),["cs"]),se(q({keywords:t,cStyleComments:!0}),["java"]),se(q({keywords:r,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),se(q({keywords:e,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),se(q({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),se(q({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),se(q({keywords:c,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),se(q({keywords:l,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),se(z([],[[g,/^[\s\S]+/]]),["regex"]);function ie(J){var be=J.langExtension;try{var Ee=$(J.sourceNode,J.pre),Le=Ee.sourceCode;J.sourceCode=Le,J.spans=Ee.spans,J.basePos=0,ge(be,Le)(J),ae(J)}catch(H){w.console&&console.log(H&&H.stack||H)}}function te(J,be,Ee){var Le=Ee||!1,H=be||null,C=document.createElement("div");C.innerHTML="<pre>"+J+"</pre>",C=C.firstChild,Le&&fe(C,Le,!0);var O={langExtension:H,numberLines:Le,sourceNode:C,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ie(O),C.innerHTML}function Q(J,be){var Ee=be||document.body,Le=Ee.ownerDocument||document;function H(we){return Ee.getElementsByTagName(we)}for(var C=[H("pre"),H("code"),H("xmp")],O=[],j=0;j<C.length;++j)for(var M=0,F=C[j].length;M<F;++M)O.push(C[j][M]);C=null;var oe=Date;oe.now||(oe={now:function(){return+new Date}});var ve=0,ke=/\blang(?:uage)?-([\w.]+)(?!\S)/,Oe=/\bprettyprint\b/,De=/\bprettyprinted\b/,Ue=/pre|xmp/i,Ke=/^code$/i,Pe=/^(?:pre|code|xmp)$/i,Re={};function xe(){for(var we=w.PR_SHOULD_USE_CONTINUATION?oe.now()+250:Infinity;ve<O.length&&oe.now()<we;ve++){for(var Te=O[ve],ue=Re,de=Te;de=de.previousSibling;){var _e=de.nodeType,ye=(_e===7||_e===8)&&de.nodeValue;if(ye?!/^\??prettify\b/.test(ye):_e!==3||/\S/.test(de.nodeValue))break;if(ye){ue={},ye.replace(/\b(\w+)=([\w:.%+-]+)/g,function(dt,ft,lt){ue[ft]=lt});break}}var Ie=Te.className;if((ue!==Re||Oe.test(Ie))&&!De.test(Ie)){for(var Me=!1,ze=Te.parentNode;ze;ze=ze.parentNode){var st=ze.tagName;if(Pe.test(st)&&ze.className&&Oe.test(ze.className)){Me=!0;break}}if(!Me){Te.className+=" prettyprinted";var nt=ue.lang;if(!nt){nt=Ie.match(ke);var Ve;!nt&&(Ve=N(Te))&&Ke.test(Ve.tagName)&&(nt=Ve.className.match(ke)),nt&&(nt=nt[1])}var et;if(Ue.test(Te.tagName))et=1;else{var Ge=Te.currentStyle,He=Le.defaultView,Ye=Ge?Ge.whiteSpace:He&&He.getComputedStyle?He.getComputedStyle(Te,null).getPropertyValue("white-space"):0;et=Ye&&Ye.substring(0,3)==="pre"}var Je=ue.linenums;(Je=Je==="true"||+Je)||(Je=Ie.match(/\blinenums\b(?::(\d+))?/),Je=Je?Je[1]&&Je[1].length?+Je[1]:!0:!1),Je&&fe(Te,Je,et);var ot={langExtension:nt,sourceNode:Te,numberLines:Je,pre:et,sourceCode:null,basePos:null,spans:null,decorations:null};ie(ot)}}}ve<O.length?w.setTimeout(xe,250):typeof J=="function"&&J()}xe()}var me=w.PR={createSimpleLexer:z,registerLangHandler:se,sourceDecorator:q,PR_ATTRIB_NAME:D,PR_ATTRIB_VALUE:I,PR_COMMENT:p,PR_DECLARATION:T,PR_KEYWORD:m,PR_LITERAL:y,PR_NOCODE:B,PR_PLAIN:x,PR_PUNCTUATION:n,PR_SOURCE:R,PR_STRING:g,PR_TAG:S,PR_TYPE:_,prettyPrintOne:U?w.prettyPrintOne=te:E=te,prettyPrint:A=U?w.prettyPrint=Q:A=Q},re=w.define;typeof re=="function"&&re.amd&&re("google-code-prettify",[],function(){return me})})()},Y1PL:function(rt,tt,he){"use strict";he.r(tt),he.d(tt,"ResizableTextArea",function(){return N});var Se=he("wx14"),Z=he("1OyB"),U=he("vuIU"),b=he("Ji7U"),L=he("LK+K"),E=he("cDcd"),A=he("VTBJ"),w=he("rePB"),v=he("Zm9Q"),u=he("Kwbf"),h=he("c+Xe"),a=he("m+aA"),t=he("bdgK"),i=new Map;function l(ee){ee.forEach(function(fe){var ae,pe=fe.target;(ae=i.get(pe))===null||ae===void 0||ae.forEach(function(se){return se(pe)})})}var c=new t.default(l),o=null,e=null;function s(ee,fe){i.has(ee)||(i.set(ee,new Set),c.observe(ee)),i.get(ee).add(fe)}function r(ee,fe){i.has(ee)&&(i.get(ee).delete(fe),i.get(ee).size||(c.unobserve(ee),i.delete(ee)))}var d=function(ee){Object(b.a)(ae,ee);var fe=Object(L.a)(ae);function ae(){return Object(Z.a)(this,ae),fe.apply(this,arguments)}return Object(U.a)(ae,[{key:"render",value:function(){return this.props.children}}]),ae}(E.Component),f=E.createContext(null);function g(ee){var fe=ee.children,ae=ee.onBatchResize,pe=E.useRef(0),se=E.useRef([]),ge=E.useContext(f),ie=E.useCallback(function(te,Q,me){pe.current+=1;var re=pe.current;se.current.push({size:te,element:Q,data:me}),Promise.resolve().then(function(){re===pe.current&&(ae==null||ae(se.current),se.current=[])}),ge==null||ge(te,Q,me)},[ae,ge]);return E.createElement(f.Provider,{value:ie},fe)}function m(ee){var fe=ee.children,ae=ee.disabled,pe=E.useRef(null),se=E.useRef(null),ge=E.useContext(f),ie=E.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),te=E.isValidElement(fe)&&Object(h.c)(fe),Q=te?fe.ref:null,me=E.useMemo(function(){return Object(h.a)(Q,pe)},[Q,pe]),re=E.useRef(ee);re.current=ee;var J=E.useCallback(function(be){var Ee=re.current,Le=Ee.onResize,H=Ee.data,C=be.getBoundingClientRect(),O=C.width,j=C.height,M=be.offsetWidth,F=be.offsetHeight,oe=Math.floor(O),ve=Math.floor(j);if(ie.current.width!==oe||ie.current.height!==ve||ie.current.offsetWidth!==M||ie.current.offsetHeight!==F){var ke={width:oe,height:ve,offsetWidth:M,offsetHeight:F};ie.current=ke;var Oe=M===Math.round(O)?O:M,De=F===Math.round(j)?j:F,Ue=Object(A.a)(Object(A.a)({},ke),{},{offsetWidth:Oe,offsetHeight:De});ge==null||ge(Ue,be,H),Le&&Promise.resolve().then(function(){Le(Ue,be)})}},[]);return E.useEffect(function(){var be=Object(a.a)(pe.current)||Object(a.a)(se.current);return be&&!ae&&s(be,J),function(){return r(be,J)}},[pe.current,ae]),E.createElement(d,{ref:se},te?E.cloneElement(fe,{ref:me}):fe)}var p="rc-observer-key";function _(ee){var fe=ee.children,ae=Object(v.a)(fe);return ae.map(function(pe,se){var ge=(pe==null?void 0:pe.key)||"".concat(p,"-").concat(se);return E.createElement(m,Object(Se.a)({},ee,{key:ge}),pe)})}_.Collection=g;var y=_,n=he("bT9E"),x=he("TSYQ"),S=he.n(x),T=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,R=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],D={},I;function B(ee){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ae=ee.getAttribute("id")||ee.getAttribute("data-reactid")||ee.getAttribute("name");if(fe&&D[ae])return D[ae];var pe=window.getComputedStyle(ee),se=pe.getPropertyValue("box-sizing")||pe.getPropertyValue("-moz-box-sizing")||pe.getPropertyValue("-webkit-box-sizing"),ge=parseFloat(pe.getPropertyValue("padding-bottom"))+parseFloat(pe.getPropertyValue("padding-top")),ie=parseFloat(pe.getPropertyValue("border-bottom-width"))+parseFloat(pe.getPropertyValue("border-top-width")),te=R.map(function(me){return"".concat(me,":").concat(pe.getPropertyValue(me))}).join(";"),Q={sizingStyle:te,paddingSize:ge,borderSize:ie,boxSizing:se};return fe&&ae&&(D[ae]=Q),Q}function G(ee){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,pe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;I||(I=document.createElement("textarea"),I.setAttribute("tab-index","-1"),I.setAttribute("aria-hidden","true"),document.body.appendChild(I)),ee.getAttribute("wrap")?I.setAttribute("wrap",ee.getAttribute("wrap")):I.removeAttribute("wrap");var se=B(ee,fe),ge=se.paddingSize,ie=se.borderSize,te=se.boxSizing,Q=se.sizingStyle;I.setAttribute("style","".concat(Q,";").concat(T)),I.value=ee.value||ee.placeholder||"";var me=Number.MIN_SAFE_INTEGER,re=Number.MAX_SAFE_INTEGER,J=I.scrollHeight,be;if(te==="border-box"?J+=ie:te==="content-box"&&(J-=ge),ae!==null||pe!==null){I.value=" ";var Ee=I.scrollHeight-ge;ae!==null&&(me=Ee*ae,te==="border-box"&&(me=me+ge+ie),J=Math.max(me,J)),pe!==null&&(re=Ee*pe,te==="border-box"&&(re=re+ge+ie),be=J>re?"":"hidden",J=Math.min(re,J))}return{height:J,minHeight:me,maxHeight:re,overflowY:be,resize:"none"}}var k=he("Gytx"),$=he.n(k),X;(function(ee){ee[ee.NONE=0]="NONE",ee[ee.RESIZING=1]="RESIZING",ee[ee.RESIZED=2]="RESIZED"})(X||(X={}));var V=function(ee){Object(b.a)(ae,ee);var fe=Object(L.a)(ae);function ae(pe){var se;return Object(Z.a)(this,ae),se=fe.call(this,pe),se.nextFrameActionId=void 0,se.resizeFrameId=void 0,se.textArea=void 0,se.saveTextArea=function(ge){se.textArea=ge},se.handleResize=function(ge){var ie=se.state.resizeStatus,te=se.props,Q=te.autoSize,me=te.onResize;if(ie!==X.NONE)return;typeof me=="function"&&me(ge),Q&&se.resizeOnNextFrame()},se.resizeOnNextFrame=function(){cancelAnimationFrame(se.nextFrameActionId),se.nextFrameActionId=requestAnimationFrame(se.resizeTextarea)},se.resizeTextarea=function(){var ge=se.props.autoSize;if(!ge||!se.textArea)return;var ie=ge.minRows,te=ge.maxRows,Q=G(se.textArea,!1,ie,te);se.setState({textareaStyles:Q,resizeStatus:X.RESIZING},function(){cancelAnimationFrame(se.resizeFrameId),se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:X.RESIZED},function(){se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:X.NONE}),se.fixFirefoxAutoScroll()})})})})},se.renderTextArea=function(){var ge=se.props,ie=ge.prefixCls,te=ie===void 0?"rc-textarea":ie,Q=ge.autoSize,me=ge.onResize,re=ge.className,J=ge.disabled,be=se.state,Ee=be.textareaStyles,Le=be.resizeStatus,H=Object(n.a)(se.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),C=S()(te,re,Object(w.a)({},"".concat(te,"-disabled"),J));"value"in H&&(H.value=H.value||"");var O=Object(A.a)(Object(A.a)(Object(A.a)({},se.props.style),Ee),Le===X.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return E.createElement(y,{onResize:se.handleResize,disabled:!(Q||me)},E.createElement("textarea",Object(Se.a)({},H,{className:C,style:O,ref:se.saveTextArea})))},se.state={textareaStyles:{},resizeStatus:X.NONE},se}return Object(U.a)(ae,[{key:"componentDidUpdate",value:function(se){(se.value!==this.props.value||!$()(se.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var se=this.textArea.selectionStart,ge=this.textArea.selectionEnd;this.textArea.setSelectionRange(se,ge)}}catch(ie){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ae}(E.Component),N=V,z=function(ee){Object(b.a)(ae,ee);var fe=Object(L.a)(ae);function ae(pe){var se;Object(Z.a)(this,ae),se=fe.call(this,pe),se.resizableTextArea=void 0,se.focus=function(){se.resizableTextArea.textArea.focus()},se.saveTextArea=function(ie){se.resizableTextArea=ie},se.handleChange=function(ie){var te=se.props.onChange;se.setValue(ie.target.value,function(){se.resizableTextArea.resizeTextarea()}),te&&te(ie)},se.handleKeyDown=function(ie){var te=se.props,Q=te.onPressEnter,me=te.onKeyDown;ie.keyCode===13&&Q&&Q(ie),me&&me(ie)};var ge=typeof pe.value=="undefined"||pe.value===null?pe.defaultValue:pe.value;return se.state={value:ge},se}return Object(U.a)(ae,[{key:"setValue",value:function(se,ge){"value"in this.props||this.setState({value:se},ge)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return E.createElement(N,Object(Se.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(se){return"value"in se?{value:se.value}:null}}]),ae}(E.Component),q=tt.default=z},ZpRC:function(rt,tt,he){"use strict";function Se(h){return typeof h=="object"&&h!=null&&h.nodeType===1}function Z(h,a){return(!a||h!=="hidden")&&h!=="visible"&&h!=="clip"}function U(h,a){if(h.clientHeight<h.scrollHeight||h.clientWidth<h.scrollWidth){var t=getComputedStyle(h,null);return Z(t.overflowY,a)||Z(t.overflowX,a)||function(i){var l=function(c){if(!c.ownerDocument||!c.ownerDocument.defaultView)return null;try{return c.ownerDocument.defaultView.frameElement}catch(o){return null}}(i);return!!l&&(l.clientHeight<i.scrollHeight||l.clientWidth<i.scrollWidth)}(h)}return!1}function b(h,a,t,i,l,c,o,e){return c<h&&o>a||c>h&&o<a?0:c<=h&&e<=t||o>=a&&e>=t?c-h-i:o>a&&e<t||c<h&&e>t?o-a+l:0}var L=function(h,a){var t=window,i=a.scrollMode,l=a.block,c=a.inline,o=a.boundary,e=a.skipOverflowHiddenElements,s=typeof o=="function"?o:function(Ee){return Ee!==o};if(!Se(h))throw new TypeError("Invalid target");for(var r=document.scrollingElement||document.documentElement,d=[],f=h;Se(f)&&s(f);){if((f=f.parentElement)===r){d.push(f);break}f!=null&&f===document.body&&U(f)&&!U(document.documentElement)||f!=null&&U(f,e)&&d.push(f)}for(var g=t.visualViewport?t.visualViewport.width:innerWidth,m=t.visualViewport?t.visualViewport.height:innerHeight,p=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,y=h.getBoundingClientRect(),n=y.height,x=y.width,S=y.top,T=y.right,R=y.bottom,D=y.left,I=l==="start"||l==="nearest"?S:l==="end"?R:S+n/2,B=c==="center"?D+x/2:c==="end"?T:D,G=[],k=0;k<d.length;k++){var $=d[k],X=$.getBoundingClientRect(),V=X.height,N=X.width,z=X.top,q=X.right,ee=X.bottom,fe=X.left;if(i==="if-needed"&&S>=0&&D>=0&&R<=m&&T<=g&&S>=z&&R<=ee&&D>=fe&&T<=q)return G;var ae=getComputedStyle($),pe=parseInt(ae.borderLeftWidth,10),se=parseInt(ae.borderTopWidth,10),ge=parseInt(ae.borderRightWidth,10),ie=parseInt(ae.borderBottomWidth,10),te=0,Q=0,me="offsetWidth"in $?$.offsetWidth-$.clientWidth-pe-ge:0,re="offsetHeight"in $?$.offsetHeight-$.clientHeight-se-ie:0;if(r===$)te=l==="start"?I:l==="end"?I-m:l==="nearest"?b(_,_+m,m,se,ie,_+I,_+I+n,n):I-m/2,Q=c==="start"?B:c==="center"?B-g/2:c==="end"?B-g:b(p,p+g,g,pe,ge,p+B,p+B+x,x),te=Math.max(0,te+_),Q=Math.max(0,Q+p);else{te=l==="start"?I-z-se:l==="end"?I-ee+ie+re:l==="nearest"?b(z,ee,V,se,ie+re,I,I+n,n):I-(z+V/2)+re/2,Q=c==="start"?B-fe-pe:c==="center"?B-(fe+N/2)+me/2:c==="end"?B-q+ge+me:b(fe,q,N,pe,ge+me,B,B+x,x);var J=$.scrollLeft,be=$.scrollTop;I+=be-(te=Math.max(0,Math.min(be+te,$.scrollHeight-V+re))),B+=J-(Q=Math.max(0,Math.min(J+Q,$.scrollWidth-N+me)))}G.push({el:$,top:te,left:Q})}return G};function E(h){return h===Object(h)&&Object.keys(h).length!==0}function A(h,a){a===void 0&&(a="auto");var t="scrollBehavior"in document.body.style;h.forEach(function(i){var l=i.el,c=i.top,o=i.left;l.scroll&&t?l.scroll({top:c,left:o,behavior:a}):(l.scrollTop=c,l.scrollLeft=o)})}function w(h){return h===!1?{block:"end",inline:"nearest"}:E(h)?h:{block:"start",inline:"nearest"}}function v(h,a){var t=!h.ownerDocument.documentElement.contains(h);if(E(a)&&typeof a.behavior=="function")return a.behavior(t?[]:L(h,a));if(t)return;var i=w(a);return A(L(h,i),i.behavior)}var u=tt.a=v},Zss7:function(rt,tt,he){var Se;(function(Z){var U=/^\s+/,b=/\s+$/,L=0,E=Z.round,A=Z.min,w=Z.max,v=Z.random;function u(ie,te){if(ie=ie||"",te=te||{},ie instanceof u)return ie;if(!(this instanceof u))return new u(ie,te);var Q=h(ie);this._originalInput=ie,this._r=Q.r,this._g=Q.g,this._b=Q.b,this._a=Q.a,this._roundA=E(100*this._a)/100,this._format=te.format||Q.format,this._gradientType=te.gradientType,this._r<1&&(this._r=E(this._r)),this._g<1&&(this._g=E(this._g)),this._b<1&&(this._b=E(this._b)),this._ok=Q.ok,this._tc_id=L++}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var ie=this.toRgb();return(ie.r*299+ie.g*587+ie.b*114)/1e3},getLuminance:function(){var ie=this.toRgb(),te,Q,me,re,J,be;return te=ie.r/255,Q=ie.g/255,me=ie.b/255,te<=.03928?re=te/12.92:re=Z.pow((te+.055)/1.055,2.4),Q<=.03928?J=Q/12.92:J=Z.pow((Q+.055)/1.055,2.4),me<=.03928?be=me/12.92:be=Z.pow((me+.055)/1.055,2.4),.2126*re+.7152*J+.0722*be},setAlpha:function(ie){return this._a=G(ie),this._roundA=E(100*this._a)/100,this},toHsv:function(){var ie=l(this._r,this._g,this._b);return{h:ie.h*360,s:ie.s,v:ie.v,a:this._a}},toHsvString:function(){var ie=l(this._r,this._g,this._b),te=E(ie.h*360),Q=E(ie.s*100),me=E(ie.v*100);return this._a==1?"hsv("+te+", "+Q+"%, "+me+"%)":"hsva("+te+", "+Q+"%, "+me+"%, "+this._roundA+")"},toHsl:function(){var ie=t(this._r,this._g,this._b);return{h:ie.h*360,s:ie.s,l:ie.l,a:this._a}},toHslString:function(){var ie=t(this._r,this._g,this._b),te=E(ie.h*360),Q=E(ie.s*100),me=E(ie.l*100);return this._a==1?"hsl("+te+", "+Q+"%, "+me+"%)":"hsla("+te+", "+Q+"%, "+me+"%, "+this._roundA+")"},toHex:function(ie){return o(this._r,this._g,this._b,ie)},toHexString:function(ie){return"#"+this.toHex(ie)},toHex8:function(ie){return e(this._r,this._g,this._b,this._a,ie)},toHex8String:function(ie){return"#"+this.toHex8(ie)},toRgb:function(){return{r:E(this._r),g:E(this._g),b:E(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+E(this._r)+", "+E(this._g)+", "+E(this._b)+")":"rgba("+E(this._r)+", "+E(this._g)+", "+E(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:E(k(this._r,255)*100)+"%",g:E(k(this._g,255)*100)+"%",b:E(k(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+E(k(this._r,255)*100)+"%, "+E(k(this._g,255)*100)+"%, "+E(k(this._b,255)*100)+"%)":"rgba("+E(k(this._r,255)*100)+"%, "+E(k(this._g,255)*100)+"%, "+E(k(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:I[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(ie){var te="#"+s(this._r,this._g,this._b,this._a),Q=te,me=this._gradientType?"GradientType = 1, ":"";if(ie){var re=u(ie);Q="#"+s(re._r,re._g,re._b,re._a)}return"progid:DXImageTransform.Microsoft.gradient("+me+"startColorstr="+te+",endColorstr="+Q+")"},toString:function(ie){var te=!!ie;ie=ie||this._format;var Q=!1,me=this._a<1&&this._a>=0,re=!te&&me&&(ie==="hex"||ie==="hex6"||ie==="hex3"||ie==="hex4"||ie==="hex8"||ie==="name");return re?ie==="name"&&this._a===0?this.toName():this.toRgbString():(ie==="rgb"&&(Q=this.toRgbString()),ie==="prgb"&&(Q=this.toPercentageRgbString()),(ie==="hex"||ie==="hex6")&&(Q=this.toHexString()),ie==="hex3"&&(Q=this.toHexString(!0)),ie==="hex4"&&(Q=this.toHex8String(!0)),ie==="hex8"&&(Q=this.toHex8String()),ie==="name"&&(Q=this.toName()),ie==="hsl"&&(Q=this.toHslString()),ie==="hsv"&&(Q=this.toHsvString()),Q||this.toHexString())},clone:function(){return u(this.toString())},_applyModification:function(ie,te){var Q=ie.apply(null,[this].concat([].slice.call(te)));return this._r=Q._r,this._g=Q._g,this._b=Q._b,this.setAlpha(Q._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(p,arguments)},desaturate:function(){return this._applyModification(r,arguments)},saturate:function(){return this._applyModification(d,arguments)},greyscale:function(){return this._applyModification(f,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(ie,te){return ie.apply(null,[this].concat([].slice.call(te)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(R,arguments)},splitcomplement:function(){return this._applyCombination(S,arguments)},triad:function(){return this._applyCombination(n,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},u.fromRatio=function(ie,te){if(typeof ie=="object"){var Q={};for(var me in ie)ie.hasOwnProperty(me)&&(me==="a"?Q[me]=ie[me]:Q[me]=q(ie[me]));ie=Q}return u(ie,te)};function h(ie){var te={r:0,g:0,b:0},Q=1,me=null,re=null,J=null,be=!1,Ee=!1;return typeof ie=="string"&&(ie=se(ie)),typeof ie=="object"&&(pe(ie.r)&&pe(ie.g)&&pe(ie.b)?(te=a(ie.r,ie.g,ie.b),be=!0,Ee=String(ie.r).substr(-1)==="%"?"prgb":"rgb"):pe(ie.h)&&pe(ie.s)&&pe(ie.v)?(me=q(ie.s),re=q(ie.v),te=c(ie.h,me,re),be=!0,Ee="hsv"):pe(ie.h)&&pe(ie.s)&&pe(ie.l)&&(me=q(ie.s),J=q(ie.l),te=i(ie.h,me,J),be=!0,Ee="hsl"),ie.hasOwnProperty("a")&&(Q=ie.a)),Q=G(Q),{ok:be,format:ie.format||Ee,r:A(255,w(te.r,0)),g:A(255,w(te.g,0)),b:A(255,w(te.b,0)),a:Q}}function a(ie,te,Q){return{r:k(ie,255)*255,g:k(te,255)*255,b:k(Q,255)*255}}function t(ie,te,Q){ie=k(ie,255),te=k(te,255),Q=k(Q,255);var me=w(ie,te,Q),re=A(ie,te,Q),J,be,Ee=(me+re)/2;if(me==re)J=be=0;else{var Le=me-re;be=Ee>.5?Le/(2-me-re):Le/(me+re);switch(me){case ie:J=(te-Q)/Le+(te<Q?6:0);break;case te:J=(Q-ie)/Le+2;break;case Q:J=(ie-te)/Le+4;break}J/=6}return{h:J,s:be,l:Ee}}function i(ie,te,Q){var me,re,J;ie=k(ie,360),te=k(te,100),Q=k(Q,100);function be(H,C,O){return O<0&&(O+=1),O>1&&(O-=1),O<1/6?H+(C-H)*6*O:O<1/2?C:O<2/3?H+(C-H)*(2/3-O)*6:H}if(te===0)me=re=J=Q;else{var Ee=Q<.5?Q*(1+te):Q+te-Q*te,Le=2*Q-Ee;me=be(Le,Ee,ie+1/3),re=be(Le,Ee,ie),J=be(Le,Ee,ie-1/3)}return{r:me*255,g:re*255,b:J*255}}function l(ie,te,Q){ie=k(ie,255),te=k(te,255),Q=k(Q,255);var me=w(ie,te,Q),re=A(ie,te,Q),J,be,Ee=me,Le=me-re;if(be=me===0?0:Le/me,me==re)J=0;else{switch(me){case ie:J=(te-Q)/Le+(te<Q?6:0);break;case te:J=(Q-ie)/Le+2;break;case Q:J=(ie-te)/Le+4;break}J/=6}return{h:J,s:be,v:Ee}}function c(ie,te,Q){ie=k(ie,360)*6,te=k(te,100),Q=k(Q,100);var me=Z.floor(ie),re=ie-me,J=Q*(1-te),be=Q*(1-re*te),Ee=Q*(1-(1-re)*te),Le=me%6,H=[Q,be,J,J,Ee,Q][Le],C=[Ee,Q,Q,be,J,J][Le],O=[J,J,Ee,Q,Q,be][Le];return{r:H*255,g:C*255,b:O*255}}function o(ie,te,Q,me){var re=[z(E(ie).toString(16)),z(E(te).toString(16)),z(E(Q).toString(16))];return me&&re[0].charAt(0)==re[0].charAt(1)&&re[1].charAt(0)==re[1].charAt(1)&&re[2].charAt(0)==re[2].charAt(1)?re[0].charAt(0)+re[1].charAt(0)+re[2].charAt(0):re.join("")}function e(ie,te,Q,me,re){var J=[z(E(ie).toString(16)),z(E(te).toString(16)),z(E(Q).toString(16)),z(ee(me))];return re&&J[0].charAt(0)==J[0].charAt(1)&&J[1].charAt(0)==J[1].charAt(1)&&J[2].charAt(0)==J[2].charAt(1)&&J[3].charAt(0)==J[3].charAt(1)?J[0].charAt(0)+J[1].charAt(0)+J[2].charAt(0)+J[3].charAt(0):J.join("")}function s(ie,te,Q,me){var re=[z(ee(me)),z(E(ie).toString(16)),z(E(te).toString(16)),z(E(Q).toString(16))];return re.join("")}u.equals=function(ie,te){return!ie||!te?!1:u(ie).toRgbString()==u(te).toRgbString()},u.random=function(){return u.fromRatio({r:v(),g:v(),b:v()})};function r(ie,te){te=te===0?0:te||10;var Q=u(ie).toHsl();return Q.s-=te/100,Q.s=$(Q.s),u(Q)}function d(ie,te){te=te===0?0:te||10;var Q=u(ie).toHsl();return Q.s+=te/100,Q.s=$(Q.s),u(Q)}function f(ie){return u(ie).desaturate(100)}function g(ie,te){te=te===0?0:te||10;var Q=u(ie).toHsl();return Q.l+=te/100,Q.l=$(Q.l),u(Q)}function m(ie,te){te=te===0?0:te||10;var Q=u(ie).toRgb();return Q.r=w(0,A(255,Q.r-E(255*-(te/100)))),Q.g=w(0,A(255,Q.g-E(255*-(te/100)))),Q.b=w(0,A(255,Q.b-E(255*-(te/100)))),u(Q)}function p(ie,te){te=te===0?0:te||10;var Q=u(ie).toHsl();return Q.l-=te/100,Q.l=$(Q.l),u(Q)}function _(ie,te){var Q=u(ie).toHsl(),me=(Q.h+te)%360;return Q.h=me<0?360+me:me,u(Q)}function y(ie){var te=u(ie).toHsl();return te.h=(te.h+180)%360,u(te)}function n(ie){var te=u(ie).toHsl(),Q=te.h;return[u(ie),u({h:(Q+120)%360,s:te.s,l:te.l}),u({h:(Q+240)%360,s:te.s,l:te.l})]}function x(ie){var te=u(ie).toHsl(),Q=te.h;return[u(ie),u({h:(Q+90)%360,s:te.s,l:te.l}),u({h:(Q+180)%360,s:te.s,l:te.l}),u({h:(Q+270)%360,s:te.s,l:te.l})]}function S(ie){var te=u(ie).toHsl(),Q=te.h;return[u(ie),u({h:(Q+72)%360,s:te.s,l:te.l}),u({h:(Q+216)%360,s:te.s,l:te.l})]}function T(ie,te,Q){te=te||6,Q=Q||30;var me=u(ie).toHsl(),re=360/Q,J=[u(ie)];for(me.h=(me.h-(re*te>>1)+720)%360;--te;)me.h=(me.h+re)%360,J.push(u(me));return J}function R(ie,te){te=te||6;for(var Q=u(ie).toHsv(),me=Q.h,re=Q.s,J=Q.v,be=[],Ee=1/te;te--;)be.push(u({h:me,s:re,v:J})),J=(J+Ee)%1;return be}u.mix=function(ie,te,Q){Q=Q===0?0:Q||50;var me=u(ie).toRgb(),re=u(te).toRgb(),J=Q/100,be={r:(re.r-me.r)*J+me.r,g:(re.g-me.g)*J+me.g,b:(re.b-me.b)*J+me.b,a:(re.a-me.a)*J+me.a};return u(be)},u.readability=function(ie,te){var Q=u(ie),me=u(te);return(Z.max(Q.getLuminance(),me.getLuminance())+.05)/(Z.min(Q.getLuminance(),me.getLuminance())+.05)},u.isReadable=function(ie,te,Q){var me=u.readability(ie,te),re,J;J=!1,re=ge(Q);switch(re.level+re.size){case"AAsmall":case"AAAlarge":J=me>=4.5;break;case"AAlarge":J=me>=3;break;case"AAAsmall":J=me>=7;break}return J},u.mostReadable=function(ie,te,Q){var me=null,re=0,J,be,Ee,Le;Q=Q||{},be=Q.includeFallbackColors,Ee=Q.level,Le=Q.size;for(var H=0;H<te.length;H++)J=u.readability(ie,te[H]),J>re&&(re=J,me=u(te[H]));return u.isReadable(ie,me,{level:Ee,size:Le})||!be?me:(Q.includeFallbackColors=!1,u.mostReadable(ie,["#fff","#000"],Q))};var D=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},I=u.hexNames=B(D);function B(ie){var te={};for(var Q in ie)ie.hasOwnProperty(Q)&&(te[ie[Q]]=Q);return te}function G(ie){return ie=parseFloat(ie),(isNaN(ie)||ie<0||ie>1)&&(ie=1),ie}function k(ie,te){V(ie)&&(ie="100%");var Q=N(ie);return ie=A(te,w(0,parseFloat(ie))),Q&&(ie=parseInt(ie*te,10)/100),Z.abs(ie-te)<1e-6?1:ie%te/parseFloat(te)}function $(ie){return A(1,w(0,ie))}function X(ie){return parseInt(ie,16)}function V(ie){return typeof ie=="string"&&ie.indexOf(".")!=-1&&parseFloat(ie)===1}function N(ie){return typeof ie=="string"&&ie.indexOf("%")!=-1}function z(ie){return ie.length==1?"0"+ie:""+ie}function q(ie){return ie<=1&&(ie=ie*100+"%"),ie}function ee(ie){return Z.round(parseFloat(ie)*255).toString(16)}function fe(ie){return X(ie)/255}var ae=function(){var ie="[-\\+]?\\d+%?",te="[-\\+]?\\d*\\.\\d+%?",Q="(?:"+te+")|(?:"+ie+")",me="[\\s|\\(]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")\\s*\\)?",re="[\\s|\\(]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")[,|\\s]+("+Q+")\\s*\\)?";return{CSS_UNIT:new RegExp(Q),rgb:new RegExp("rgb"+me),rgba:new RegExp("rgba"+re),hsl:new RegExp("hsl"+me),hsla:new RegExp("hsla"+re),hsv:new RegExp("hsv"+me),hsva:new RegExp("hsva"+re),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function pe(ie){return!!ae.CSS_UNIT.exec(ie)}function se(ie){ie=ie.replace(U,"").replace(b,"").toLowerCase();var te=!1;if(D[ie])ie=D[ie],te=!0;else if(ie=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var Q;return(Q=ae.rgb.exec(ie))?{r:Q[1],g:Q[2],b:Q[3]}:(Q=ae.rgba.exec(ie))?{r:Q[1],g:Q[2],b:Q[3],a:Q[4]}:(Q=ae.hsl.exec(ie))?{h:Q[1],s:Q[2],l:Q[3]}:(Q=ae.hsla.exec(ie))?{h:Q[1],s:Q[2],l:Q[3],a:Q[4]}:(Q=ae.hsv.exec(ie))?{h:Q[1],s:Q[2],v:Q[3]}:(Q=ae.hsva.exec(ie))?{h:Q[1],s:Q[2],v:Q[3],a:Q[4]}:(Q=ae.hex8.exec(ie))?{r:X(Q[1]),g:X(Q[2]),b:X(Q[3]),a:fe(Q[4]),format:te?"name":"hex8"}:(Q=ae.hex6.exec(ie))?{r:X(Q[1]),g:X(Q[2]),b:X(Q[3]),format:te?"name":"hex"}:(Q=ae.hex4.exec(ie))?{r:X(Q[1]+""+Q[1]),g:X(Q[2]+""+Q[2]),b:X(Q[3]+""+Q[3]),a:fe(Q[4]+""+Q[4]),format:te?"name":"hex8"}:(Q=ae.hex3.exec(ie))?{r:X(Q[1]+""+Q[1]),g:X(Q[2]+""+Q[2]),b:X(Q[3]+""+Q[3]),format:te?"name":"hex"}:!1}function ge(ie){var te,Q;return ie=ie||{level:"AA",size:"small"},te=(ie.level||"AA").toUpperCase(),Q=(ie.size||"small").toLowerCase(),te!=="AA"&&te!=="AAA"&&(te="AA"),Q!=="small"&&Q!=="large"&&(Q="small"),{level:te,size:Q}}rt.exports?rt.exports=u:!(Se=function(){return u}.call(tt,he,tt,rt),Se!==void 0&&(rt.exports=Se))})(Math)},b57q:function(rt,tt,he){rt.exports={officeContainer:"officeContainer___z7fd9"}},bT9E:function(rt,tt,he){"use strict";he.d(tt,"a",function(){return Z});var Se=he("VTBJ");function Z(U,b){var L=Object(Se.a)({},U);return Array.isArray(b)&&b.forEach(function(E){delete L[E]}),L}},eoI0:function(rt,tt,he){rt.exports={selectSchool:"selectSchool___2Vrh7",delete:"delete___qM8Jm"}},"h/US":function(rt,tt,he){"use strict";var Se=he("DZo9"),Z=he("8z0m"),U=he("miYZ"),b=he("tsqr"),L=he("+L6B"),E=he("2/Rp"),A=he("tJVT"),w=he("cDcd"),v=he.n(w),u=he("z7Xi"),h=he("jN4g"),a=he("m3rI"),t=he("w8Aa"),i=he.n(t),l=function(o){var e=o.value,s=o.onChange,r=o.getFileProgress,d=Object(w.useState)(!1),f=Object(A.a)(d,2),g=f[0],m=f[1],p=v.a.createElement(E.a,{loading:g,icon:v.a.createElement(u.a,null)},"\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6"),_=function(){return v.a.createElement("div",{className:i.a.img},v.a.createElement("img",{src:a.a.API_SERVER+"/api/attachments/"+e,alt:"avatar",style:{width:288}}),v.a.createElement("div",null,v.a.createElement(h.a,{onClick:function(){return s("")},style:{fontSize:"16px",color:"red"}})))},y=function(x){if(r&&r(x),x.file.status==="uploading"){m(!0);return}if(x.file.status==="done"){var S,T,R,D;if(m(!1),x.file.status==="done"&&((S=x.file)===null||S===void 0||((T=S.response)===null||T===void 0)?void 0:T.status)===-1){var I,B;b.b.error((I=x.file)===null||I===void 0||((B=I.response)===null||B===void 0)?void 0:B.message);return}s(x==null||((R=x.file)===null||R===void 0||((D=R.response)===null||D===void 0))?void 0:D.id)}};return v.a.createElement(v.a.Fragment,null,e?_():v.a.createElement("div",null,v.a.createElement(Z.a,{withCredentials:!0,name:"file",showUploadList:!1,action:"".concat(a.a.API_SERVER,"/api/attachments.json"),onChange:y,accept:"image/*"},p),v.a.createElement("div",{className:"mt20 c-light-black"},"\u8BF4\u660E\uFF1A\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u7528288*158\u50CF\u7D20\uFF1B"),v.a.createElement("div",{className:"c-light-black"},"\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002")))};tt.a=l},h78n:function(rt,tt,he){"use strict";he.d(tt,"a",function(){return R});var Se=he("cDcd"),Z=he.n(Se),U=he("TSYQ"),b=he.n(U),L={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},E=function(B){var G=B.map(function(){return Object(Se.useRef)()}),k=Object(Se.useRef)();return Object(Se.useEffect)(function(){var $=Date.now(),X=!1;Object.keys(G).forEach(function(V){var N=G[V].current;if(!N)return;X=!0;var z=N.style;z.transitionDuration=".3s, .3s, .3s, .06s",k.current&&$-k.current<100&&(z.transitionDuration="0s, 0s")}),X&&(k.current=Date.now())}),[G]};function A(){return A=Object.assign||function(I){for(var B=1;B<arguments.length;B++){var G=arguments[B];for(var k in G)Object.prototype.hasOwnProperty.call(G,k)&&(I[k]=G[k])}return I},A.apply(this,arguments)}function w(I,B){return t(I)||a(I,B)||u(I,B)||v()}function v(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u(I,B){if(!I)return;if(typeof I=="string")return h(I,B);var G=Object.prototype.toString.call(I).slice(8,-1);if(G==="Object"&&I.constructor&&(G=I.constructor.name),G==="Map"||G==="Set")return Array.from(I);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return h(I,B)}function h(I,B){(B==null||B>I.length)&&(B=I.length);for(var G=0,k=new Array(B);G<B;G++)k[G]=I[G];return k}function a(I,B){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(I)))return;var G=[],k=!0,$=!1,X=void 0;try{for(var V=I[Symbol.iterator](),N;!(k=(N=V.next()).done)&&!(G.push(N.value),B&&G.length===B);k=!0);}catch(z){$=!0,X=z}finally{try{!k&&V.return!=null&&V.return()}finally{if($)throw X}}return G}function t(I){if(Array.isArray(I))return I}function i(I,B){if(I==null)return{};var G=l(I,B),k,$;if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(I);for($=0;$<X.length;$++){if(k=X[$],B.indexOf(k)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(I,k))continue;G[k]=I[k]}}return G}function l(I,B){if(I==null)return{};var G={},k=Object.keys(I),$,X;for(X=0;X<k.length;X++){if($=k[X],B.indexOf($)>=0)continue;G[$]=I[$]}return G}var c=function(B){var G=B.className,k=B.percent,$=B.prefixCls,X=B.strokeColor,V=B.strokeLinecap,N=B.strokeWidth,z=B.style,q=B.trailColor,ee=B.trailWidth,fe=B.transition,ae=i(B,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ae.gapPosition;var pe=Array.isArray(k)?k:[k],se=Array.isArray(X)?X:[X],ge=E(pe),ie=w(ge,1),te=ie[0],Q=N/2,me=100-N/2,re="M ".concat(V==="round"?Q:0,",").concat(Q,`
L `).concat(V==="round"?me:100,",").concat(Q),J="0 0 100 ".concat(N),be=0;return Z.a.createElement("svg",A({className:b()("".concat($,"-line"),G),viewBox:J,preserveAspectRatio:"none",style:z},ae),Z.a.createElement("path",{className:"".concat($,"-line-trail"),d:re,strokeLinecap:V,stroke:q,strokeWidth:ee||N,fillOpacity:"0"}),pe.map(function(Ee,Le){var H={strokeDasharray:"".concat(Ee,"px, 100px"),strokeDashoffset:"-".concat(be,"px"),transition:fe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},C=se[Le]||se[se.length-1];return be+=Ee,Z.a.createElement("path",{key:Le,className:"".concat($,"-line-path"),d:re,strokeLinecap:V,stroke:C,strokeWidth:N,fillOpacity:"0",ref:te[Le],style:H})}))};c.defaultProps=L;var o=c;function e(){return e=Object.assign||function(I){for(var B=1;B<arguments.length;B++){var G=arguments[B];for(var k in G)Object.prototype.hasOwnProperty.call(G,k)&&(I[k]=G[k])}return I},e.apply(this,arguments)}function s(I,B){return m(I)||g(I,B)||d(I,B)||r()}function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(I,B){if(!I)return;if(typeof I=="string")return f(I,B);var G=Object.prototype.toString.call(I).slice(8,-1);if(G==="Object"&&I.constructor&&(G=I.constructor.name),G==="Map"||G==="Set")return Array.from(I);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return f(I,B)}function f(I,B){(B==null||B>I.length)&&(B=I.length);for(var G=0,k=new Array(B);G<B;G++)k[G]=I[G];return k}function g(I,B){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(I)))return;var G=[],k=!0,$=!1,X=void 0;try{for(var V=I[Symbol.iterator](),N;!(k=(N=V.next()).done)&&!(G.push(N.value),B&&G.length===B);k=!0);}catch(z){$=!0,X=z}finally{try{!k&&V.return!=null&&V.return()}finally{if($)throw X}}return G}function m(I){if(Array.isArray(I))return I}function p(I,B){if(I==null)return{};var G=_(I,B),k,$;if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(I);for($=0;$<X.length;$++){if(k=X[$],B.indexOf(k)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(I,k))continue;G[k]=I[k]}}return G}function _(I,B){if(I==null)return{};var G={},k=Object.keys(I),$,X;for(X=0;X<k.length;X++){if($=k[X],B.indexOf($)>=0)continue;G[$]=I[$]}return G}var y=0;function n(I){return+I.replace("%","")}function x(I){return Array.isArray(I)?I:[I]}function S(I,B,G,k){var $=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,X=arguments.length>5?arguments[5]:void 0,V=50-k/2,N=0,z=-V,q=0,ee=-2*V;switch(X){case"left":N=-V,z=0,q=2*V,ee=0;break;case"right":N=V,z=0,q=-2*V,ee=0;break;case"bottom":z=V,ee=2*V;break;default:}var fe="M 50,50 m ".concat(N,",").concat(z,`
a `).concat(V,",").concat(V," 0 1 1 ").concat(q,",").concat(-ee,`
a `).concat(V,",").concat(V," 0 1 1 ").concat(-q,",").concat(ee),ae=Math.PI*2*V,pe={stroke:G,strokeDasharray:"".concat(B/100*(ae-$),"px ").concat(ae,"px"),strokeDashoffset:"-".concat($/2+I/100*(ae-$),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:fe,pathStyle:pe}}var T=function(B){var G=B.prefixCls,k=B.strokeWidth,$=B.trailWidth,X=B.gapDegree,V=B.gapPosition,N=B.trailColor,z=B.strokeLinecap,q=B.style,ee=B.className,fe=B.strokeColor,ae=B.percent,pe=p(B,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),se=Object(Se.useMemo)(function(){return y+=1,y},[]),ge=S(0,100,N,k,X,V),ie=ge.pathString,te=ge.pathStyle,Q=x(ae),me=x(fe),re=me.find(function(H){return Object.prototype.toString.call(H)==="[object Object]"}),J=E(Q),be=s(J,1),Ee=be[0],Le=function(){var C=0;return Q.map(function(O,j){var M=me[j]||me[me.length-1],F=Object.prototype.toString.call(M)==="[object Object]"?"url(#".concat(G,"-gradient-").concat(se,")"):"",oe=S(C,O,M,k,X,V);return C+=O,Z.a.createElement("path",{key:j,className:"".concat(G,"-circle-path"),d:oe.pathString,stroke:F,strokeLinecap:z,strokeWidth:k,opacity:O===0?0:1,fillOpacity:"0",style:oe.pathStyle,ref:Ee[j]})})};return Z.a.createElement("svg",e({className:b()("".concat(G,"-circle"),ee),viewBox:"0 0 100 100",style:q},pe),re&&Z.a.createElement("defs",null,Z.a.createElement("linearGradient",{id:"".concat(G,"-gradient-").concat(se),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(re).sort(function(H,C){return n(H)-n(C)}).map(function(H,C){return Z.a.createElement("stop",{key:C,offset:H,stopColor:re[H]})}))),Z.a.createElement("path",{className:"".concat(G,"-circle-trail"),d:ie,stroke:N,strokeLinecap:z,strokeWidth:$||k,fillOpacity:"0",style:te}),Le().reverse())};T.defaultProps=L;var R=T,D={Line:o,Circle:R}},hgre:function(rt,tt,he){"use strict";var Se=he("miYZ"),Z=he("tsqr"),U=he("9og8"),b=he("WmNS"),L=he.n(b),E=he("cDcd"),A=he.n(E),w=he("GUcZ"),v=he("ulZh"),u=he.n(v),h=he("xKgJ"),a=he("P5Jw"),t=he.n(a),i=he("bntm"),l=he("4xil"),c=he.n(l);function o(d){if(isNaN(d))return{minutes:"00",seconds:"00"};var f=new Date(d*1e3).toISOString().substr(11,8);return{hour:f.substr(0,2),minutes:f.substr(3,2),seconds:f.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function e(d,f){return d-f}function s(d){d.sort(e);for(var f=0,g=0;g<d.length-1;g++){var m=Math.abs(d[g+1]-d[g]);m<21&&(f+=m)}return f}var r=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;tt.a=Object(E.forwardRef)(function(d,f){var g,m=d.src,p=d.toLog,_=d.videoId,y=d.logWatchHistory,n=d.courseId,x=n===void 0?null:n,S=d.startTime,T=d.handlePause,R=T===void 0?function(){}:T,D=d.handlePlay,I=D===void 0?function(){}:D,B=d.handlePlayEnded,G=B===void 0?function(){}:B,k=d.videoSpeed,$=k===void 0?1:k,X=m==null||((g=m.split("."))===null||g===void 0)?void 0:g.pop(),V=X==="flv",N=Object(E.useRef)(),z=Object(E.useRef)(),q=Object(E.useRef)(),ee=Object(E.useRef)(),fe=Object(E.useRef)(),ae=Object(E.useRef)(),pe=Object(E.useRef)(),se=Object(E.useRef)(),ge=Object(E.useRef)(),ie=Object(E.useRef)(),te=Object(E.useRef)(),Q=Object(E.useRef)(),me=Object(E.useRef)(),re=Object(E.useRef)(),J=navigator.userAgent.toLowerCase().match(r),be=J?J[0]:"pc",Ee=Object(E.useRef)(!1),Le=Object(h.x)(),H=0,C=0,O=0,j=null,M=!1,F=20,oe=1,ve=!1,ke=!1,Oe=[];Object(E.useImperativeHandle)(f,function(){return{getLastUpdatedTime:function(){return N.current.currentTime},getDuration:function(){return N.current.duration}}});var De=Object(E.useCallback)(function(xe){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te={point:N.current.currentTime};j?(Te.log_id=j,Te.watch_duration=s(Oe),Te.total_duration=C):(x?(Te.video_id=parseInt(_,10),Te.course_id=x):Te.video_id=_,Te.duration=H,Te.device=be),we&&(Te.ed="1");function ue(){return de.apply(this,arguments)}function de(){return de=Object(U.a)(L.a.mark(function _e(){var ye;return L.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return ve=!0,Me.next=3,y(Te);case 3:ye=Me.sent,j=ye,ve=!1,xe&&xe();case 7:case"end":return Me.stop()}},_e)})),de.apply(this,arguments)}ue()},[_,x]);Object(E.useEffect)(function(){Z.b.destroy();var xe=null;return w.a.isSupported&&V&&m&&(m==null?void 0:m.indexOf(".m3u8"))<0?(xe=w.a.createPlayer({type:"flv",volume:.8,cors:!0,url:m,muted:!1}),N.current&&(xe.attachMediaElement(N.current),xe.load())):N.current.setAttribute("src",m),Ke(),function(){xe&&(xe.unload(),xe.pause(),xe.destroy(),xe=null)}},[N,V,m]);function Ue(){N.current.paused?(ee.current.style.display="none",fe.current.style.display="block"):(ee.current.style.display="block",fe.current.style.display="none")}function Ke(){te.current.style.display="none",me.current.style.display="none",Q.current.style.display="none",N.current.muted||N.current.volume===0?te.current.style.display="block":N.current.volume>0&&N.current.volume<=.5?me.current.style.display="block":Q.current.style.display="block"}Object(E.useEffect)(function(){var xe=document.getElementById("play"),we=document.querySelectorAll(".playback-icons use");function Te(){I(),S&&!Ee.current&&(N.current.currentTime=S),Ee.current=!0,Oe.push(N.current.currentTime),M||(M=!0,p&&De())}function ue(){return de.apply(this,arguments)}function de(){return de=Object(U.a)(L.a.mark(function Ye(){return L.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:Ue(),Oe.push(N.current.currentTime),p&&De(function(){j=null,O=0,M=!1,ve=!1,ke=!1,Oe=[],C=0,oe=1},!0);case 3:case"end":return ot.stop()}},Ye)})),de.apply(this,arguments)}function _e(){ae.current.value=Math.round(N.current.currentTime),pe.current.value=Math.round(N.current.currentTime)}function ye(){var Ye=o(Math.round(N.current.currentTime));ge.current.innerText="".concat(Ye.hour>0?Ye.hour+":":"").concat(Ye.minutes,":").concat(Ye.seconds),ge.current.setAttribute("datetime","".concat(Ye.hour>0?" "+Ye.hour+" ":"").concat(Ye.minutes,"m ").concat(Ye.seconds,"s"))}function Ie(){var Ye=Math.round(N.current.duration);ae.current.setAttribute("max",Ye),pe.current.setAttribute("max",Ye);var Je=o(Ye);se.current.innerText="".concat(Je.hour>0?Je.hour+":":"").concat(Je.minutes,":").concat(Je.seconds),se.current.setAttribute("datetime","".concat(Je.hour>0?" "+Je.hour+" ":"").concat(Je.minutes,"m ").concat(Je.seconds,"s"))}function Me(){var Ye=Math.round(N.current.duration);ae.current.setAttribute("max",Ye),pe.current.setAttribute("max",Ye);var Je=o(Ye);se.current.innerText="".concat(Je.hour>0?Je.hour+":":"").concat(Je.minutes,":").concat(Je.seconds),se.current.setAttribute("datetime","".concat(Je.hour>0?" "+Je.hour+" ":"").concat(Je.minutes,"m ").concat(Je.seconds,"s")),_e(),ye();var ot=z.current.getBoundingClientRect(),dt=ot.width,ft=ot.height,lt=ot.x,vt=ot.y;if(lt<0||vt<0||!dt)return;if(!ke){var gt=N.current.currentTime,bt=gt-O;Math.abs(bt)<10?(C+=Math.abs(bt),O=gt,ve||C-oe*F>=0&&(oe++,Oe.push(O),p&&De())):(O=gt,p&&De())}}function ze(){ke=!0}function st(){N.current.playing&&Oe.push(N.current.currentTime,O),O=N.current.currentTime,ke=!1}function nt(){H=N.current.duration,H<=20&&(F=H/3),N.current.addEventListener("play",Te)}function Ve(Ye){Ye.preventDefault(),Object(i.a)()?(N.current.style.width="100%",N.current.style.height="100%"):N.current.style.cssText=""}function et(){R()}function Ge(Ye){var Je=Ye.target.dataset.seek?Ye.target.dataset.seek:Ye.target.value;N.current.currentTime=Je,pe.current.value=Je,ae.current.value=Je}function He(Ye){var Je=Math.round(Ye.offsetX/Ye.target.clientWidth*parseInt(Ye.target.getAttribute("max"),10));ae.current.setAttribute("data-seek",Je);var ot=o(Je);ie.current.textContent="".concat(ot.hour>0?ot.hour+":":"").concat(ot.minutes,":").concat(ot.seconds);var dt=N.current.getBoundingClientRect();ie.current.style.left="".concat(Ye.pageX-dt.left,"px")}return q.current.addEventListener(Object(i.c)(),Ve),N.current.addEventListener("canplay",nt),N.current.addEventListener("ended",ue),N.current.addEventListener("seeking",ze),N.current.addEventListener("seeked",st),N.current.addEventListener("loadedmetadata",Ie),ae.current.addEventListener("mousemove",He),ae.current.addEventListener("input",Ge),N.current.addEventListener("timeupdate",Me),N.current.addEventListener("pause",et),N.current.addEventListener("volumechange",Ke),function(){N.current.removeEventListener("canplay",nt),N.current.removeEventListener("play",Te),N.current.removeEventListener("ended",ue),N.current.removeEventListener("seeking",ze),N.current.removeEventListener("seeked",st),ae.current.removeEventListener("mousemove",He),ae.current.removeEventListener("input",Ge),N.current.removeEventListener("timeupdate",Me),N.current.removeEventListener("pause",et),N.current.removeEventListener("loadedmetadata",Ie),N.current.removeEventListener("volumechange",Ke),N.current.playing&&(Oe.push(O,N.current.currentTime),p&&De())}},[N,m]),Object(E.useEffect)(function(){if(N.current.onended=function(){G(N)},N.current.oncontextmenu=function(){return!1},(m==null?void 0:m.indexOf(".m3u8"))>-1){if(N.current.canPlayType("application/vnd.apple.mpegurl"))N.current.src=m;else if(u.a.isSupported()){var xe=new u.a;xe.loadSource(m),xe.attachMedia(N.current)}}},[m]),Object(E.useEffect)(function(){N.current.playbackRate=$},[$]);var Pe=function(){N.current.paused||N.current.ended?N.current.play():N.current.pause(),Ue()};function Re(){N.current.muted=!N.current.muted,N.current.muted?(re.current.setAttribute("data-volume",volume.value),re.current.value=0):re.current.value=re.current.dataset.volume}return A.a.createElement("div",{style:{position:"relative"},ref:q},A.a.createElement("div",{ref:z,className:"".concat(c.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(c.a.animate__loop)},Le?Le.login:" "),A.a.createElement("div",{className:c.a.container},A.a.createElement("div",{className:c.a["video-container"],id:"video-container"},A.a.createElement("div",{className:c.a["playback-animation"],id:"playback-animation"},A.a.createElement("svg",{className:c.a["playback-icons"]},A.a.createElement("use",{className:"hidden",href:"#play-icon"}),A.a.createElement("use",{href:"#pause"}))),A.a.createElement("video",{className:c.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:N,autoPlay:!1}),A.a.createElement("div",{className:"".concat(c.a["video-controls"]," "),id:"video-controls"},A.a.createElement("div",{className:c.a["bottom-controls"]},A.a.createElement("div",{className:c.a["left-controls"]},A.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:Pe},A.a.createElement("svg",{className:c.a["playback-icons"]},A.a.createElement("use",{ref:fe,href:"#play-icon"}),A.a.createElement("use",{ref:ee,style:{display:"none"},href:"#pause"}))),A.a.createElement("div",{className:c.a.time},A.a.createElement("time",{id:"time-elapsed",ref:ge},"00:00"),A.a.createElement("span",null," / "),A.a.createElement("time",{id:"duration",ref:se},"00:00"))),A.a.createElement("div",{className:c.a["right-controls"]},A.a.createElement(a.CopyToClipboard,{text:m,onCopy:function(){return Z.b.success("\u590D\u5236\u6210\u529F")}},A.a.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},A.a.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),A.a.createElement("div",{className:c.a["volume-controls"]},A.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:c.a["volume-button"],id:"volume-button",onClick:Re},A.a.createElement("i",{ref:te,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),A.a.createElement("i",{ref:me,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),A.a.createElement("i",{ref:Q,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),A.a.createElement("input",{className:c.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:re,style:{display:"none"},onClick:Ke})),A.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:c.a["fullscreen-button"],onClick:function(){Object(i.a)()?Object(i.b)():Object(i.d)(q.current)}},A.a.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),A.a.createElement("div",{className:c.a["video-progress"]},A.a.createElement("progress",{ref:pe,value:"0",min:"0"}),A.a.createElement("input",{className:c.a.seek,ref:ae,value:"0",min:"0",type:"range",step:"1"}),A.a.createElement("div",{className:c.a["seek-tooltip"],ref:ie,id:"seek-tooltip"},"00:00"))))),A.a.createElement("svg",{style:{display:"none"}},A.a.createElement("defs",null,A.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),A.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),A.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),A.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),A.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),A.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),A.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),A.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},kwm0:function(rt,tt,he){rt.exports={modal:"modal___1jX7c",uploadWrap:"uploadWrap___3-sVK",upload:"upload___2LemY",uploadLink:"uploadLink___j9Fsx",fileProgress:"fileProgress___11p3K",fileCancel:"fileCancel___3Mx9l",videoName:"videoName___2a-ZN",contentItem:"contentItem___1gUuj","tagsList-content":"tagsList-content___3Yj4d"}},lppi:function(rt,tt,he){rt.exports={pdfContainer:"pdfContainer___ECPbw",loading:"loading___2tzD5"}},mOS8:function(rt,tt,he){rt.exports=he.p+"static/403Qrcode.6c17b6f4.png"},nUhQ:function(rt,tt,he){rt.exports={flex_box_center:"flex_box_center___1OQ1z",flex_space_between:"flex_space_between___22uwF",flex_box_vertical_center:"flex_box_vertical_center___1xWAr",flex_box_center_end:"flex_box_center_end___1QTe3",flex_box_column:"flex_box_column___lWxZG",banner:"banner___1Hzq6",wrap:"wrap___1D5RS",title:"title___1LzGm",contentWrap:"contentWrap___19oxo",button:"button___3chJs",rating:"rating___3ODxx"}},p5ED:function(rt,tt,he){"use strict";var Se=he("+L6B"),Z=he("2/Rp"),U=he("5Dmo"),b=he("3S7+"),L=he("k1fw"),E=he("tJVT"),A=he("cDcd"),w=he.n(A),v=he("vHTk"),u=he.n(v),h=he("yEEn"),a=he("ZW9T"),t=he("1vsH");tt.a=function(i){var l=i.name,c=i.data,o=i.theme,e=i.type,s=i.filename,r=i.monacoEditor,d=i.className,f=i.style,g=i.close,m=i.onClose,p=i.hasMask,_=Object(A.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),y=Object(E.a)(_,2),n=y[0],x=y[1],S=Object(A.useState)(""),T=Object(E.a)(S,2),R=T[0],D=T[1],I,B=1024*1024,G=10*B,k=Object(A.useRef)();e==="office"&&(I=Object(t.V)(c).filesize,I>G&&(e="other")),s&&(r.filename=s),Object(A.useEffect)(function(){var V,N,z=(V=document.cookie)===null||V===void 0||((N=V.replace(/\s/g,""))===null||N===void 0)?void 0:N.split(";");z==null||z.map(function(q){var ee=q.split("=");ee[0]==="_educoder_session"&&D(ee[1])})},[]);var $=function(){if(c.startsWith("http")||c.startsWith("/")){X();return}Object(t.z)(s||"educoder",c,s)},X=function(){Object(t.x)(s||l,c)};return console.log("data:",c,"fileanme:",s," name:",l),w.a.createElement("div",{style:Object(L.a)({},f||{}),className:"".concat(p&&u.a.bgBlack," ").concat(e?u.a.wrp:"hide")},g&&w.a.createElement("div",{className:u.a.close,ref:k},w.a.createElement(b.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return k.current}},w.a.createElement("span",{onClick:X},w.a.createElement("i",{className:"icon-quxiaozhiding"}))),w.a.createElement(b.a,{title:"\u5173\u95ED",getPopupContainer:function(){return k.current}},w.a.createElement("span",{className:"",onClick:m},w.a.createElement("i",{className:"icon-guanbi1"})))),w.a.createElement("div",{className:"".concat(u.a[d]," ").concat(d," ").concat(u.a.monaco," ").concat(e==="txt"?"show":"hide")},e==="txt"&&w.a.createElement(a.b,r)),e==="audio"&&w.a.createElement("audio",{src:"".concat(c!=null&&c.startsWith("/")||(c==null?void 0:c.indexOf("https://"))>-1?c:"data:audio/mp3;base64,").concat(c),autoPlay:!0}),e==="video"&&w.a.createElement(w.a.Fragment,null,c!=null&&c.startsWith("/")?w.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):w.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),e==="html"&&w.a.createElement("iframe",{src:c+"&disposition=inline"}),e==="pdf"&&w.a.createElement("embed",{className:u.a.embed,src:c}),e==="image"&&w.a.createElement(w.a.Fragment,null,w.a.createElement("img",{src:"".concat(c!=null&&c.startsWith("/")||(c==null?void 0:c.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(c)})),e==="other"&&w.a.createElement("div",null,w.a.createElement(Z.a,{type:"primary",size:"large",onClick:$},w.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(e==="download"||e==="office")&&w.a.createElement(Z.a,{type:"primary",size:"large",onClick:$},w.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},ppsT:function(rt,tt,he){(function(Se){var Z,Z;!function(U){if(!0)window.OSS=U(),rt.exports=U();else var b}(function(){var U;return function(){function b(L,E,A){function w(h,a){if(!E[h]){if(!L[h]){var t=typeof Z=="function"&&Z;if(!a&&t)return Z(h,!0);if(v)return v(h,!0);var i=new Error("Cannot find module '"+h+"'");throw i.code="MODULE_NOT_FOUND",i}var l=E[h]={exports:{}};L[h][0].call(l.exports,function(c){return w(L[h][1][c]||c)},l,l.exports,b,L,E,A)}return E[h].exports}for(var v=typeof Z=="function"&&Z,u=0;u<A.length;u++)w(A[u]);return w}return b}()({1:[function(b,L,E){"use strict";var A=b("./browser/client");A.Buffer=b("buffer").Buffer,A.co=b("co"),A.urllib=b("../shims/xhr"),A.version=b("./browser/version").version,L.exports=A},{"../shims/xhr":244,"./browser/client":2,"./browser/version":5,buffer:38,co:41}],2:[function(b,L,E){(function(A,w){"use strict";function v(V){return V&&V.__esModule?V:{default:V}}function u(V,N){return V[N]||V[N.toLowerCase()]}function h(V,N){var z=n.parse(V);if(!z.protocol){var q=N?"https://":"http://";z=n.parse(q+V)}if(z.protocol!=="http:"&&z.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return z}function a(V,N,z){var q=z?"https://":"http://",ee=N?"-internal.aliyuncs.com":".aliyuncs.com";return V.substr(0,"vpc100-oss-cn-".length)==="vpc100-oss-cn-"&&(ee=".aliyuncs.com"),n.parse(q+V+ee)}function t(){return document&&document.location&&document.location.protocol==="https:"}function i(V,N){if(!(this instanceof i))return new i(V,N);V&&V.inited?this.options=V:this.options=i.initOptions(V),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=R,this.agent=this.options.agent||$),this.ctx=N,this.userAgent=this._getUserAgent(),this.options.amendTimeSkewed=0}var l=b("babel-runtime/regenerator"),c=v(l),o=b("babel-runtime/core-js/object/keys"),e=v(o),s=b("debug")("ali-oss"),r=b("./../../shims/crypto/crypto.js"),d=b("path"),f=b("copy-to"),g=b("mime"),m=b("xml2js"),p=b("humanize-ms"),_=b("agentkeepalive"),y=b("merge-descriptors"),n=b("url"),x=b("is-type-of"),S=b("platform"),T=b("utility"),R=b("urllib"),D=b("./version"),I=b("dateformat"),B=b("bowser"),G=b("../common/signUtils"),k=b("../common/utils"),$=new _;L.exports=i,i.initOptions=function(V){if(!V||!V.accessKeyId||!V.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");var N=t(),z={region:"oss-cn-hangzhou",internal:!1,secure:N,bucket:null,endpoint:null,cname:!1};if((0,e.default)(V).forEach(function(q){V[q]!==void 0&&(z[q]=V[q])}),z.accessKeyId=z.accessKeyId.trim(),z.accessKeySecret=z.accessKeySecret.trim(),z.timeout&&(z.timeout=p(z.timeout)),z.endpoint)z.endpoint=h(z.endpoint,z.secure);else{if(!z.region)throw new Error("require options.endpoint or options.region");z.endpoint=a(z.region,z.internal,z.secure)}return z.inited=!0,z};var X=i.prototype;y(X,b("./object")),y(X,b("./managed_upload")),y(X,b("../common/multipart")),y(X,b("../common/thunkpool.js")),i.Wrapper=b("./wrapper"),X.signature=function(V){return s("authorization stringToSign: %s",V),G.computeSignature(this.options.accessKeySecret,V)},X.authorization=function(V,N,z,q){var ee=G.buildCanonicalString(V.toUpperCase(),N,{headers:q,parameters:z});return G.authorization(this.options.accessKeyId,this.options.accessKeySecret,ee)},X.createRequest=function(V){var N={"x-oss-date":I(+new Date+this.options.amendTimeSkewed,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.options.stsToken&&(N["x-oss-security-token"]=this.options.stsToken),f(V.headers).to(N),u(N,"Content-Type")||(V.mime===g.default_type&&(V.mime=""),V.mime&&V.mime.indexOf("/")>0?N["Content-Type"]=V.mime:N["Content-Type"]=g.getType(V.mime||d.extname(V.object||""))||"application/octet-stream"),V.content&&(N["Content-Md5"]=r.createHash("md5").update(new w(V.content,"utf8")).digest("base64"),N["Content-Length"]||(N["Content-Length"]=V.content.length));var z=this._getResource(V);N.authorization=this.authorization(V.method,z,V.subres,N);var q=this._getReqUrl(V);s("request %s %s, with headers %j, !!stream: %s",V.method,q,N,!!V.stream);var ee=V.timeout||this.options.timeout;return{url:q,params:{agent:this.agent,method:V.method,content:V.content,stream:V.stream,headers:N,timeout:ee,writeStream:V.writeStream,customResponse:V.customResponse,ctx:V.ctx||this.ctx}}},X.request=c.default.mark(function V(N){var z,q,ee,fe;return c.default.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return z=this.createRequest(N),q=void 0,ee=void 0,ae.prev=3,ae.next=6,this.urllib.request(z.url,z.params);case 6:q=ae.sent,s("response %s %s, got %s, headers: %j",N.method,z.url,q.status,q.headers),ae.next=13;break;case 10:ae.prev=10,ae.t0=ae.catch(3),ee=ae.t0;case 13:if(fe=void 0,!q||!N.successStatuses||N.successStatuses.indexOf(q.status)!==-1){ae.next=26;break}return ae.next=17,this.requestError(q);case 17:if(fe=ae.sent,fe.code!=="RequestTimeTooSkewed"){ae.next=23;break}return this.options.amendTimeSkewed=+new Date(fe.serverTime)-new Date,ae.next=22,this.request(N);case 22:return ae.abrupt("return",ae.sent);case 23:fe.params=N,ae.next=30;break;case 26:if(!ee){ae.next=30;break}return ae.next=29,this.requestError(ee);case 29:fe=ae.sent;case 30:if(!fe){ae.next=32;break}throw fe;case 32:if(!N.xmlResponse){ae.next=36;break}return ae.next=35,this.parseXML(q.data);case 35:q.data=ae.sent;case 36:return ae.abrupt("return",q);case 37:case"end":return ae.stop()}},V,this,[[3,10]])}),X._getResource=function(V){var N="/";return V.bucket&&(N+=V.bucket+"/"),V.object&&(N+=V.object),N},X._isIP=function(V){return k._isIP(V)},X._escape=function(V){return T.encodeURIComponent(V).replace(/%2F/g,"/")},X._getReqUrl=function(V){var N={};f(this.options.endpoint).to(N);var z=this._isIP(N.hostname),q=this.options.cname;!V.bucket||q||z||(N.host=V.bucket+"."+N.host);var ee="/";V.bucket&&z&&(ee+=V.bucket+"/"),V.object&&(ee+=this._escape(V.object).replace(/\+/g,"%2B")),N.pathname=ee;var fe={};if(V.query&&y(fe,V.query),V.subres){var ae={};x.string(V.subres)?ae[V.subres]="":x.array(V.subres)?V.subres.forEach(function(pe){ae[pe]=""}):ae=V.subres,y(fe,ae)}return N.query=fe,n.format(N)},X._getUserAgent=function(){var V=A&&A.browser?"js":"nodejs",N="aliyun-sdk-"+V+"/"+D.version,z=S.description;return!z&&A&&(z="Node.js "+A.version.slice(1)+" on "+A.platform+" "+A.arch),this._checkUserAgent(N+" "+z)},X._checkUserAgent=function(V){return V.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")},X.checkBrowserAndVersion=function(V,N){return B.name===V&&B.version.split(".")[0]===N},X.parseXML=function(V){return function(N){w.isBuffer(V)&&(V=V.toString()),m.parseString(V,{explicitRoot:!1,explicitArray:!1},N)}},X.requestError=c.default.mark(function V(N){var z,q,ee,fe;return c.default.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:if(z=null,N.data&&N.data.length){ae.next=5;break}N.status===-1||N.status===-2?(z=new Error(N.message),z.name=N.name,z.status=N.status,z.code=N.name):(N.status===404?(z=new Error("Object not exists"),z.name="NoSuchKeyError",z.status=404,z.code="NoSuchKey"):N.status===412?(z=new Error("Pre condition failed"),z.name="PreconditionFailedError",z.status=412,z.code="PreconditionFailed"):(z=new Error("Unknow error, status: "+N.status),z.name="UnknowError",z.status=N.status),z.requestId=N.headers["x-oss-request-id"],z.host=""),ae.next=30;break;case 5:return q=String(N.data),s("request response error data: %s",q),ee=void 0,ae.prev=8,ae.next=11,this.parseXML(q)||{};case 11:ee=ae.sent,ae.next=21;break;case 14:return ae.prev=14,ae.t0=ae.catch(8),s(q),ae.t0.message+=`
raw xml: `+q,ae.t0.status=N.status,ae.t0.requestId=N.headers["x-oss-request-id"],ae.abrupt("return",ae.t0);case 21:fe=ee.Message||"unknow request error, status: "+N.status,ee.Condition&&(fe+=" (condition: "+ee.Condition+")"),z=new Error(fe),z.name=ee.Code?ee.Code+"Error":"UnknowError",z.status=N.status,z.code=ee.Code,z.requestId=ee.RequestId,z.hostId=ee.HostId,z.serverTime=ee.ServerTime;case 30:return s("generate error %j",z),ae.abrupt("return",z);case 32:case"end":return ae.stop()}},V,this,[[8,14]])})}).call(this,b("_process"),b("buffer").Buffer)},{"../common/multipart":8,"../common/signUtils":9,"../common/thunkpool.js":10,"../common/utils":11,"./../../shims/crypto/crypto.js":237,"./managed_upload":3,"./object":4,"./version":5,"./wrapper":6,_process:173,agentkeepalive:12,"babel-runtime/core-js/object/keys":23,"babel-runtime/regenerator":33,bowser:35,buffer:38,"copy-to":43,dateformat:154,debug:155,"humanize-ms":160,"is-type-of":165,"merge-descriptors":168,mime:242,path:170,platform:171,url:203,urllib:244,utility:243,xml2js:213}],3:[function(b,L,E){(function(A){"use strict";function w(f){return f&&f.__esModule?f:{default:f}}function v(f,g){if(!(this instanceof v))return new v(f,g);d.call(this,g),this.file=f,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}var u=b("babel-runtime/core-js/array/from"),h=w(u),a=b("babel-runtime/regenerator"),t=w(a),i=b("is-type-of"),l=b("util"),c=b("path"),o=b("mime"),e=b("copy-to"),s=E;s.multipartUpload=t.default.mark(function f(g,m,p){var _,y,n,x,S,T,R,D,I;return t.default.wrap(function(B){for(;;)switch(B.prev=B.next){case 0:if(this.resetCancelFlag(),p=p||{},!p.checkpoint||!p.checkpoint.uploadId){B.next=6;break}return B.next=5,this._resumeMultipart(p.checkpoint,p);case 5:return B.abrupt("return",B.sent);case 6:return _=102400,p.mime||(i.file(m)?p.mime=o.getType(c.extname(m.name)):i.blob(m)?p.mime=m.type:p.mime=o.getType(c.extname(m))),p.headers=p.headers||{},this._convertMetaToHeaders(p.meta,p.headers),B.next=12,this._getFileSize(m);case 12:if(!((y=B.sent)<_)){B.next=25;break}return n=this._createStream(m,0,y),p.contentLength=y,B.next=18,this.putStream(g,n,p);case 18:if(x=B.sent,!p||!p.progress){B.next=22;break}return B.next=22,p.progress(1);case 22:return S={res:x.res,bucket:this.options.bucket,name:g,etag:x.res.headers.etag},(p.headers&&p.headers["x-oss-callback"]||p.callback)&&(S.data=x.data),B.abrupt("return",S);case 25:if(!(p.partSize&&p.partSize<_)){B.next=27;break}throw new Error("partSize must not be smaller than "+_);case 27:return B.next=29,this.initMultipartUpload(g,p);case 29:if(T=B.sent,R=T.uploadId,D=this._getPartSize(y,p.partSize),I={file:m,name:g,fileSize:y,partSize:D,uploadId:R,doneParts:[]},!p||!p.progress){B.next=36;break}return B.next=36,p.progress(0,I,T.res);case 36:return B.next=38,this._resumeMultipart(I,p);case 38:return B.abrupt("return",B.sent);case 39:case"end":return B.stop()}},f,this)}),s._resumeMultipart=t.default.mark(function f(g,m){var p,_,y,n,x,S,T,R,D,I,B,G,k,$,X,V,N,z,q,ee,fe;return t.default.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:if(!this.isCancel()){ae.next=2;break}throw this._makeCancelEvent();case 2:if(p=g.file,_=g.fileSize,y=g.partSize,n=g.uploadId,x=g.doneParts,S=g.name,T=[],x.length>0&&e(x).to(T),R=this._divideParts(_,y),D=R.length,I=!1,B=t.default.mark(function pe(se,ge){var ie,te,Q;return t.default.wrap(function(me){for(;;)switch(me.prev=me.next){case 0:if(se.isCancel()){me.next=21;break}return me.prev=1,ie=R[ge-1],te={stream:se._createStream(p,ie.start,ie.end),size:ie.end-ie.start},me.next=6,se._uploadPart(S,n,ge,te);case 6:if(Q=me.sent,se.isCancel()||I){me.next=13;break}if(g.doneParts.push({number:ge,etag:Q.res.headers.etag}),T.push({number:ge,etag:Q.res.headers.etag}),!m||!m.progress){me.next=13;break}return me.next=13,m.progress(x.length/D,g,Q.res);case 13:me.next=21;break;case 15:if(me.prev=15,me.t0=me.catch(1),se.isCancel()){me.next=21;break}throw se.cancel(),me.t0.partNum=ge,me.t0;case 21:case"end":return me.stop()}},pe,this,[[1,15]])}),G=(0,h.default)(new Array(D),function(pe,se){return se+1}),k=T.map(function(pe){return pe.number}),$=G.filter(function(pe){return k.indexOf(pe)<0}),X=5,V=m.parallel||X,!this.checkBrowserAndVersion("Internet Explorer","10")&&V!==1){ae.next=26;break}N=0;case 16:if(!(N<$.length)){ae.next=24;break}if(!this.isCancel()){ae.next=19;break}throw this._makeCancelEvent();case 19:return ae.next=21,B(this,$[N]);case 21:N++,ae.next=16;break;case 24:ae.next=40;break;case 26:for(z=[],q=0;q<$.length;q++)z.push(B(this,$[q]));return ae.next=30,this._thunkPool(z,V);case 30:if(ee=ae.sent,I=!0,!(ee&&ee.length>0)){ae.next=37;break}throw this.resetCancelFlag(),fe=ee[0],fe.message="Failed to upload some parts with error: "+fe.toString()+" part_num: "+fe.partNum,fe;case 37:if(!this.isCancel()){ae.next=40;break}throw z=null,this._makeCancelEvent();case 40:return ae.next=42,this.completeMultipartUpload(S,n,T,m);case 42:return ae.abrupt("return",ae.sent);case 43:case"end":return ae.stop()}},f,this)}),i.file=function(f){return typeof File!="undefined"&&f instanceof File},i.blob=function(f){return typeof Blob!="undefined"&&f instanceof Blob},s._getFileSize=t.default.mark(function f(g){var m;return t.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(!i.buffer(g)){p.next=4;break}return p.abrupt("return",g.length);case 4:if(!i.blob(g)&&!i.file(g)){p.next=6;break}return p.abrupt("return",g.size);case 6:if(!i.string(g)){p.next=11;break}return p.next=9,this._statFile(g);case 9:return m=p.sent,p.abrupt("return",m.size);case 11:throw new Error("_getFileSize requires Buffer/File/String.");case 12:case"end":return p.stop()}},f,this)});var r=b("stream"),d=r.Readable;l.inherits(v,d),v.prototype.readFileAndPush=function(f){if(this.fileBuffer)for(var g=!0;g&&this.fileBuffer&&this.start<this.fileBuffer.length;){var m=this.start,p=m+f;p=p>this.fileBuffer.length?this.fileBuffer.length:p,this.start=p,g=this.push(this.fileBuffer.slice(m,p))}},v.prototype._read=function(f){if(this.file&&this.start>=this.file.size||this.fileBuffer&&this.start>=this.fileBuffer.length||this.finish||this.start===0&&!this.file)return this.finish||(this.fileBuffer=null,this.finish=!0),void this.push(null);f=f||16384;var g=this;this.reader.onload=function(m){g.fileBuffer=new A(new Uint8Array(m.target.result)),g.file=null,g.readFileAndPush(f)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(f)},s._createStream=function(f,g,m){if(i.blob(f)||i.file(f))return new v(f.slice(g,m));throw new Error("_createStream requires File/String.")},s._getPartSize=function(f,g){return g?Math.max(Math.ceil(f/1e4),g):1048576},s._divideParts=function(f,g){for(var m=Math.ceil(f/g),p=[],_=0;_<m;_++){var y=g*_,n=Math.min(y+g,f);p.push({start:y,end:n})}return p},s._makeCancelEvent=function(){return{status:0,name:"cancel"}}}).call(this,b("buffer").Buffer)},{"babel-runtime/core-js/array/from":16,"babel-runtime/regenerator":33,buffer:38,"copy-to":43,"is-type-of":165,mime:242,path:170,stream:195,util:207}],4:[function(b,L,E){"use strict";function A(g){return g&&g.__esModule?g:{default:g}}var w=b("babel-runtime/core-js/object/keys"),v=A(w),u=b("babel-runtime/regenerator"),h=A(u),a=b("debug")("ali-oss:object"),t=b("utility"),i=b("fs"),l=b("is-type-of"),c=b("url"),o=b("copy-to"),e=b("path"),s=b("mime"),r=b("../common/callback"),d=b("../common/signUtils"),f=E;f.append=h.default.mark(function g(m,p,_){var y;return h.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return _=_||{},_.position===void 0&&(_.position="0"),_.subres={append:"",position:_.position},_.method="POST",n.next=6,this.put(m,p,_);case 6:return y=n.sent,y.nextAppendPosition=y.res.headers["x-oss-next-append-position"],n.abrupt("return",y);case 9:case"end":return n.stop()}},g,this)}),f.put=h.default.mark(function g(m,p,_){var y,n,x,S,T,R;return h.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(y=void 0,_=_||{},!l.buffer(p)){D.next=6;break}y=p,D.next=18;break;case 6:if(!l.blob(p)&&!l.file(p)){D.next=17;break}return _.mime||(l.file(p)?_.mime=s.getType(e.extname(p.name)):_.mime=p.type),n=this._createStream(p,0,p.size),D.next=11,this._getFileSize(p);case 11:return _.contentLength=D.sent,D.next=14,this.putStream(m,n,_);case 14:return D.abrupt("return",D.sent);case 17:throw new TypeError("Must provide Buffer/Blob for put.");case 18:return _.headers=_.headers||{},this._convertMetaToHeaders(_.meta,_.headers),x=_.method||"PUT",S=this._objectRequestParams(x,m,_),r.encodeCallback(S,_),S.mime=_.mime,S.content=y,S.successStatuses=[200],D.next=28,this.request(S);case 28:return T=D.sent,R={name:m,url:this._objectUrl(m),res:T.res},S.headers&&S.headers["x-oss-callback"]&&(R.data=JSON.parse(T.data.toString())),D.abrupt("return",R);case 32:case"end":return D.stop()}},g,this)}),f.putStream=h.default.mark(function g(m,p,_){var y,n,x,S;return h.default.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return _=_||{},_.headers=_.headers||{},_.contentLength?_.headers["Content-Length"]=_.contentLength:_.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(_.meta,_.headers),y=_.method||"PUT",n=this._objectRequestParams(y,m,_),r.encodeCallback(n,_),n.mime=_.mime,n.stream=p,n.successStatuses=[200],T.next=12,this.request(n);case 12:return x=T.sent,S={name:m,url:this._objectUrl(m),res:x.res},n.headers&&n.headers["x-oss-callback"]&&(S.data=JSON.parse(x.data.toString())),T.abrupt("return",S);case 16:case"end":return T.stop()}},g,this)}),f.head=h.default.mark(function g(m,p){var _,y,n;return h.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return _=this._objectRequestParams("HEAD",m,p),_.successStatuses=[200,304],x.next=4,this.request(_);case 4:return y=x.sent,n={meta:null,res:y.res,status:y.status},y.status===200&&(0,v.default)(y.headers).forEach(function(S){S.indexOf("x-oss-meta-")===0&&(n.meta||(n.meta={}),n.meta[S.substring(11)]=y.headers[S])}),x.abrupt("return",n);case 8:case"end":return x.stop()}},g,this)}),f.get=h.default.mark(function g(m,p,_){var y,n,x,S;return h.default.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return y=null,n=!1,l.writableStream(p)?y=p:l.string(p)?(y=i.createWriteStream(p),n=!0):_=p,_=_||{},_.process&&(_.subres=_.subres||{},_.subres["x-oss-process"]=_.process),x=void 0,T.prev=6,S=this._objectRequestParams("GET",m,_),S.writeStream=y,S.successStatuses=[200,206,304],T.next=12,this.request(S);case 12:x=T.sent,n&&y.destroy(),T.next=24;break;case 16:if(T.prev=16,T.t0=T.catch(6),!n){T.next=23;break}return y.destroy(),a("get error: %s, delete the exists file %s",T.t0,p),T.next=23,this._deleteFileSafe(p);case 23:throw T.t0;case 24:return T.abrupt("return",{res:x.res,content:x.data});case 25:case"end":return T.stop()}},g,this,[[6,16]])}),f.getStream=h.default.mark(function g(m,p){var _,y;return h.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return p=p||{},_=this._objectRequestParams("GET",m,p),_.customResponse=!0,_.successStatuses=[200,206,304],n.next=6,this.request(_);case 6:return y=n.sent,n.abrupt("return",{stream:y.res,res:{status:y.status,headers:y.headers}});case 8:case"end":return n.stop()}},g,this)}),f.delete=h.default.mark(function g(m,p){var _,y;return h.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return _=this._objectRequestParams("DELETE",m,p),_.successStatuses=[204],n.next=4,this.request(_);case 4:return y=n.sent,n.abrupt("return",{res:y.res});case 6:case"end":return n.stop()}},g,this)}),f.deleteMulti=h.default.mark(function g(m,p){var _,y,n,x,S,T;return h.default.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:for(p=p||{},_=`<?xml version="1.0" encoding="UTF-8"?>
<Delete>
`,p.quiet?_+=` <Quiet>true</Quiet>
`:_+=` <Quiet>false</Quiet>
`,y=0;y<m.length;y++)_+=" <Object><Key>"+t.escape(this._objectName(m[y]))+`</Key></Object>
`;return _+="</Delete>",a("delete multi objects: %s",_),p.subres="delete",n=this._objectRequestParams("POST","",p),n.mime="xml",n.content=_,n.xmlResponse=!0,n.successStatuses=[200],R.next=14,this.request(n);case 14:return x=R.sent,S=x.data,T=S&&S.Deleted||null,T&&(Array.isArray(T)||(T=[T]),T=T.map(function(D){return D.Key})),R.abrupt("return",{res:x.res,deleted:T});case 19:case"end":return R.stop()}},g,this)}),f.copy=h.default.mark(function g(m,p,_){var y,n,x;return h.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return _=_||{},_.headers=_.headers||{},(0,v.default)(_.headers).forEach(function(T){_.headers["x-oss-copy-source-"+T.toLowerCase()]=_.headers[T]}),_.meta&&(_.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(_.meta,_.headers),p=p[0]!=="/"?"/"+this.options.bucket+"/"+encodeURIComponent(p):"/"+encodeURIComponent(p.slice(1)),_.headers["x-oss-copy-source"]=p,y=this._objectRequestParams("PUT",m,_),y.xmlResponse=!0,y.successStatuses=[200,304],S.next=12,this.request(y);case 12:return n=S.sent,x=n.data,x&&(x={etag:x.ETag,lastModified:x.LastModified}),S.abrupt("return",{data:x,res:n.res});case 16:case"end":return S.stop()}},g,this)}),f.putMeta=h.default.mark(function g(m,p,_){return h.default.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,this.copy(m,m,{meta:p||{},timeout:_&&_.timeout,ctx:_&&_.ctx});case 2:return y.abrupt("return",y.sent);case 3:case"end":return y.stop()}},g,this)}),f.list=h.default.mark(function g(m,p){var _,y,n,x,S;return h.default.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return _=this._objectRequestParams("GET","",p),_.query=m,_.xmlResponse=!0,_.successStatuses=[200],T.next=6,this.request(_);case 6:return y=T.sent,n=y.data.Contents,x=this,n&&(Array.isArray(n)||(n=[n]),n=n.map(function(R){return{name:R.Key,url:x._objectUrl(R.Key),lastModified:R.LastModified,etag:R.ETag,type:R.Type,size:Number(R.Size),storageClass:R.StorageClass,owner:{id:R.Owner.ID,displayName:R.Owner.DisplayName}}})),S=y.data.CommonPrefixes||null,S&&(Array.isArray(S)||(S=[S]),S=S.map(function(R){return R.Prefix})),T.abrupt("return",{res:y.res,objects:n,prefixes:S,nextMarker:y.data.NextMarker||null,isTruncated:y.data.IsTruncated==="true"});case 13:case"end":return T.stop()}},g,this)}),f.putACL=h.default.mark(function g(m,p,_){var y,n;return h.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return _=_||{},_.subres="acl",_.headers=_.headers||{},_.headers["x-oss-object-acl"]=p,m=this._objectName(m),y=this._objectRequestParams("PUT",m,_),y.successStatuses=[200],x.next=9,this.request(y);case 9:return n=x.sent,x.abrupt("return",{res:n.res});case 11:case"end":return x.stop()}},g,this)}),f.getACL=h.default.mark(function g(m,p){var _,y;return h.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return p=p||{},p.subres="acl",m=this._objectName(m),_=this._objectRequestParams("GET",m,p),_.successStatuses=[200],_.xmlResponse=!0,n.next=8,this.request(_);case 8:return y=n.sent,n.abrupt("return",{acl:y.data.AccessControlList.Grant,owner:{id:y.data.Owner.ID,displayName:y.data.Owner.DisplayName},res:y.res});case 10:case"end":return n.stop()}},g,this)}),f.restore=h.default.mark(function g(m,p){var _,y;return h.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return p=p||{},p.subres="restore",_=this._objectRequestParams("POST",m,p),_.successStatuses=[202],n.next=6,this.request(_);case 6:return y=n.sent,n.abrupt("return",{res:y.res});case 8:case"end":return n.stop()}},g,this)}),f.signatureUrl=function(g,m){m=m||{},g=this._objectName(g),m.method=m.method||"GET";var p=t.timestamp()+(m.expires||1800),_={bucket:this.options.bucket,object:g},y=this._getResource(_);this.options.stsToken&&(m["security-token"]=this.options.stsToken);var n=d._signatureForURL(this.options.accessKeySecret,m,y,p),x=c.parse(this._getReqUrl(_));return x.query={OSSAccessKeyId:this.options.accessKeyId,Expires:p,Signature:n.Signature},o(n.subResource).to(x.query),x.format()},f.getObjectUrl=function(g,m){return m?m[m.length-1]!=="/"&&(m+="/"):m=this.options.endpoint.format(),m+this._escape(this._objectName(g))},f._objectUrl=function(g){return this._getReqUrl({bucket:this.options.bucket,object:g})},f.generateObjectUrl=function(g,m){if(m)m[m.length-1]!=="/"&&(m+="/");else{m=this.options.endpoint.format();var p=c.parse(m),_=this.options.bucket;p.hostname=_+"."+p.hostname,p.host=_+"."+p.host,m=p.format()}return m+this._escape(this._objectName(g))},f._objectRequestParams=function(g,m,p){if(!this.options.bucket)throw new Error("Please create a bucket first");p=p||{},m=this._objectName(m);var _={object:m,bucket:this.options.bucket,method:g,subres:p&&p.subres,timeout:p&&p.timeout,ctx:p&&p.ctx};return p.headers&&(_.headers={},o(p.headers).to(_.headers)),_},f._objectName=function(g){return g.replace(/^\/+/,"")},f._statFile=function(g){return function(m){i.stat(g,m)}},f._convertMetaToHeaders=function(g,m){g&&(0,v.default)(g).forEach(function(p){m["x-oss-meta-"+p]=g[p]})},f._deleteFileSafe=function(g){return function(m){i.exists(g,function(p){p?i.unlink(g,function(_){_&&a("unlink %j error: %s",g,_),m()}):m()})}}},{"../common/callback":7,"../common/signUtils":9,"babel-runtime/core-js/object/keys":23,"babel-runtime/regenerator":33,"copy-to":43,debug:155,fs:36,"is-type-of":165,mime:242,path:170,url:203,utility:243}],5:[function(b,L,E){"use strict";E.version="5.3.1"},{}],6:[function(b,L,E){"use strict";function A(e){return e&&e.__esModule?e:{default:e}}function w(e){return e&&typeof e.next=="function"&&typeof e.throw=="function"}function v(e){if(!e)return!1;var s=e.constructor;return!!s&&(s.name==="GeneratorFunction"||s.displayName==="GeneratorFunction"||w(s.prototype)||w(e.prototype))}function u(e,s){var r=new e(s),d=(0,l.default)(r),f=(0,l.default)((0,t.default)(r));d.concat(f).forEach(function(g){v(r[g])?this[g]=c.wrap(r[g]).bind(r):this[g]=r[g]},this)}function h(e){if(!(this instanceof h))return new h(e);u.call(this,o,e)}var a=b("babel-runtime/core-js/object/get-prototype-of"),t=A(a),i=b("babel-runtime/core-js/object/keys"),l=A(i),c=b("co"),o=b("./client");L.exports=h,h.STS=function e(s){if(!(this instanceof e))return new e(s);u.call(this,o.STS,s)}},{"./client":2,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/core-js/object/keys":23,co:41}],7:[function(b,L,E){(function(A){"use strict";function w(t){return t&&t.__esModule?t:{default:t}}var v=b("babel-runtime/core-js/object/keys"),u=w(v),h=b("babel-runtime/core-js/json/stringify"),a=w(h);E.encodeCallback=function(t,i){if(t.headers=t.headers||{},!Object.prototype.hasOwnProperty.call(t.headers,"x-oss-callback")&&i.callback){var l={callbackUrl:encodeURI(i.callback.url),callbackBody:i.callback.body};i.callback.host&&(l.callbackHost=i.callback.host),i.callback.contentType&&(l.callbackBodyType=i.callback.contentType);var c=new A((0,a.default)(l)).toString("base64");if(t.headers["x-oss-callback"]=c,i.callback.customValue){var o={};(0,u.default)(i.callback.customValue).forEach(function(e){o["x:"+e]=i.callback.customValue[e]}),t.headers["x-oss-callback-var"]=new A((0,a.default)(o)).toString("base64")}}}}).call(this,b("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38}],8:[function(b,L,E){"use strict";var A=b("babel-runtime/regenerator"),w=function(a){return a&&a.__esModule?a:{default:a}}(A),v=b("copy-to"),u=b("./callback"),h=E;h.listUploads=w.default.mark(function a(t,i){var l,c,o,e;return w.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return i=i||{},l={},v(i).to(l),l.subres="uploads",c=this._objectRequestParams("GET","",l),c.query=t,c.xmlResponse=!0,c.successStatuses=[200],s.next=10,this.request(c);case 10:return o=s.sent,e=o.data.Upload||[],Array.isArray(e)||(e=[e]),e=e.map(function(r){return{name:r.Key,uploadId:r.UploadId,initiated:r.Initiated}}),s.abrupt("return",{res:o.res,uploads:e,bucket:o.data.Bucket,nextKeyMarker:o.data.NextKeyMarker,nextUploadIdMarker:o.data.NextUploadIdMarker,isTruncated:o.data.IsTruncated==="true"});case 15:case"end":return s.stop()}},a,this)}),h.listParts=w.default.mark(function a(t,i,l,c){var o,e,s;return w.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return c=c||{},o={},v(c).to(o),o.subres={uploadId:i},e=this._objectRequestParams("GET",t,o),e.query=l,e.xmlResponse=!0,e.successStatuses=[200],r.next=10,this.request(e);case 10:return s=r.sent,r.abrupt("return",{res:s.res,uploadId:s.data.UploadId,bucket:s.data.Bucket,name:s.data.Key,partNumberMarker:s.data.PartNumberMarker,nextPartNumberMarker:s.data.NextPartNumberMarker,maxParts:s.data.MaxParts,isTruncated:s.data.IsTruncated,parts:s.data.Part||[]});case 12:case"end":return r.stop()}},a,this)}),h.abortMultipartUpload=w.default.mark(function a(t,i,l){var c,o,e;return w.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return this.cancel(),l=l||{},c={},v(l).to(c),c.subres={uploadId:i},o=this._objectRequestParams("DELETE",t,c),o.successStatuses=[204],s.next=9,this.request(o);case 9:return e=s.sent,s.abrupt("return",{res:e.res});case 11:case"end":return s.stop()}},a,this)}),h.initMultipartUpload=w.default.mark(function a(t,i){var l,c,o;return w.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=i||{},l={},v(i).to(l),l.headers=l.headers||{},this._convertMetaToHeaders(i.meta,l.headers),l.subres="uploads",c=this._objectRequestParams("POST",t,l),c.mime=i.mime,c.xmlResponse=!0,c.successStatuses=[200],e.next=12,this.request(c);case 12:return o=e.sent,e.abrupt("return",{res:o.res,bucket:o.data.Bucket,name:o.data.Key,uploadId:o.data.UploadId});case 14:case"end":return e.stop()}},a,this)}),h.uploadPart=w.default.mark(function a(t,i,l,c,o,e,s){var r;return w.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return r={stream:this._createStream(c,o,e),size:e-o},d.next=3,this._uploadPart(t,i,l,r,s);case 3:return d.abrupt("return",d.sent);case 4:case"end":return d.stop()}},a,this)}),h.completeMultipartUpload=w.default.mark(function a(t,i,l,c){var o,e,s,r,d,f,g,m;return w.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:for(o=l.concat().sort(function(_,y){return _.number-y.number}).filter(function(_,y,n){return!y||_.number!==n[y-1].number}),e=`<?xml version="1.0" encoding="UTF-8"?>
<CompleteMultipartUpload>
`,s=0;s<o.length;s++)r=o[s],e+=`<Part>
`,e+="<PartNumber>"+r.number+`</PartNumber>
`,e+="<ETag>"+r.etag+`</ETag>
`,e+=`</Part>
`;return e+="</CompleteMultipartUpload>",c=c||{},d={},v(c).to(d),d.subres={uploadId:i},f=this._objectRequestParams("POST",t,d),u.encodeCallback(f,d),f.mime="xml",f.content=e,f.headers&&f.headers["x-oss-callback"]||(f.xmlResponse=!0),f.successStatuses=[200],p.next=16,this.request(f);case 16:return g=p.sent,m={res:g.res,bucket:f.bucket,name:t,etag:g.res.headers.etag},f.headers&&f.headers["x-oss-callback"]&&(m.data=JSON.parse(g.data.toString())),p.abrupt("return",m);case 20:case"end":return p.stop()}},a,this)}),h._uploadPart=w.default.mark(function a(t,i,l,c,o){var e,s,r;return w.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return o=o||{},e={},v(o).to(e),e.headers={"Content-Length":c.size},e.subres={partNumber:l,uploadId:i},s=this._objectRequestParams("PUT",t,e),s.mime=e.mime,s.stream=c.stream,s.successStatuses=[200],d.next=11,this.request(s);case 11:return r=d.sent,c.stream=null,s.stream=null,d.abrupt("return",{name:t,etag:r.res.headers.etag,res:r.res});case 15:case"end":return d.stop()}},a,this)})},{"./callback":7,"babel-runtime/regenerator":33,"copy-to":43}],9:[function(b,L,E){(function(A){"use strict";function w(l){return l&&l.__esModule?l:{default:l}}var v=b("babel-runtime/core-js/json/stringify"),u=w(v),h=b("babel-runtime/core-js/object/keys"),a=w(h),t=b("./../../shims/crypto/crypto.js"),i=b("is-type-of");E.buildCanonicalizedResource=function(l,c){var o=""+l,e="?";if(i.string(c)&&c.trim()!=="")o+=e+c;else if(i.array(c))c.sort(),o+=e+c.join("&");else if(c){var s=function(d,f){return d[0]>f[0]?1:d[0]<f[0]?-1:0},r=function(d){o+=e+d,c[d]&&(o+="="+c[d]),e="&"};(0,a.default)(c).sort(s).forEach(r)}return o},E.buildCanonicalString=function(l,c,o,e){o=o||{};var s=o.headers||{},r=[],d={},f=[l.toUpperCase(),s["Content-Md5"]||"",s["Content-Type"]||s["Content-Type".toLowerCase()],e||s["x-oss-date"]];return(0,a.default)(s).forEach(function(g){var m=g.toLowerCase();m.indexOf("x-oss-")===0&&(d[m]=String(s[g]).trim())}),(0,a.default)(d).sort().forEach(function(g){r.push(g+":"+d[g])}),f=f.concat(r),f.push(this.buildCanonicalizedResource(c,o.parameters)),f.join(`
`)},E.computeSignature=function(l,c){return t.createHmac("sha1",l).update(new A(c,"utf8")).digest("base64")},E.authorization=function(l,c,o){return"OSS "+l+":"+this.computeSignature(c,o)},E._signatureForURL=function(l,c,o,e){var s={},r={};if(c.process&&(r["x-oss-process"]=c.process),c.response&&(0,a.default)(c.response).forEach(function(m){var p="response-"+m.toLowerCase();r[p]=c.response[m]}),(0,a.default)(c).forEach(function(m){var p=m.toLowerCase(),_=c[m];p.indexOf("x-oss-")===0?s[p]=_:p.indexOf("content-md5")===0||p.indexOf("content-type")===0?s[m]=_:p!=="expires"&&p!=="response"&&p!=="process"&&p!=="method"&&(r[p]=_)}),Object.prototype.hasOwnProperty.call(c,"security-token")&&(r["security-token"]=c["security-token"]),Object.prototype.hasOwnProperty.call(c,"callback")){var d={callbackUrl:encodeURI(c.callback.url),callbackBody:c.callback.body};if(c.callback.host&&(d.callbackHost=c.callback.host),c.callback.contentType&&(d.callbackBodyType=c.callback.contentType),r.callback=new A((0,u.default)(d)).toString("base64"),c.callback.customValue){var f={};(0,a.default)(c.callback.customValue).forEach(function(m){f["x:"+m]=c.callback.customValue[m]}),r["callback-var"]=new A((0,u.default)(f)).toString("base64")}}var g=this.buildCanonicalString(c.method,o,{headers:s,parameters:r},e.toString());return{Signature:this.computeSignature(l,g),subResource:r}}}).call(this,b("buffer").Buffer)},{"./../../shims/crypto/crypto.js":237,"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38,"is-type-of":165}],10:[function(b,L,E){"use strict";var A=b("babel-runtime/regenerator"),w=function(t){return t&&t.__esModule?t:{default:t}}(A),v=b("co"),u=b("co-priority-queue"),h=b("any-promise"),a=E;a._thunkPool=function(t,i){function l(r,d){++e===r.length&&d(s)}function c(r,d){function f(){var n;return w.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:n=void 0;case 1:if(o.isCancel()){x.next=9;break}return x.next=4,p.next();case 4:return n=x.sent,x.next=7,n();case 7:x.next=1;break;case 9:_+=1,_===r&&(p.fns=[],p.buffer=[],d(s));case 11:case"end":return x.stop()}},m,this)}function g(n){console.error(n.stack)}for(var m=w.default.mark(f),p=new u,_=0,y=0;y<r;y++)v(f).catch(g);return function(n,x){return function(S){p.push(w.default.mark(function T(){return w.default.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.prev=0,R.t0=S,R.next=4,n;case 4:R.t1=R.sent,(0,R.t0)(null,R.t1),R.next=11;break;case 8:R.prev=8,R.t2=R.catch(0),S(R.t2);case 11:case"end":return R.stop()}},T,this,[[0,8]])}),x)}}}var o=this,e=0,s=[];return new h(function(r){function d(_){return w.default.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,m(t[_]);case 2:l(t,r);case 3:case"end":return y.stop()}},g,this)}function f(_){s.push(_),l(t,r)}for(var g=w.default.mark(d),m=new c(i,r),p=0;p<t.length;p++)v(d(p)).catch(f)})},a.cancel=function(){this.options.cancelFlag=!0},a.isCancel=function(){return this.options.cancelFlag},a.resetCancelFlag=function(){this.options.cancelFlag=!1}},{"any-promise":13,"babel-runtime/regenerator":33,co:41,"co-priority-queue":40}],11:[function(b,L,E){"use strict";E._isIP=function(A){var w=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,v=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;return w.test(A)||v.test(A)}},{}],12:[function(b,L,E){function A(){}L.exports=A,L.exports.HttpsAgent=A},{}],13:[function(b,L,E){L.exports=b("./register")().Promise},{"./register":15}],14:[function(b,L,E){"use strict";var A=null;L.exports=function(w,v){return function(u,h){u=u||null,h=h||{};var a=h.global!==!1;if(A===null&&a&&(A=w["@@any-promise/REGISTRATION"]||null),A!==null&&u!==null&&A.implementation!==u)throw new Error('any-promise already defined as "'+A.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return A===null&&(A=u!==null&&h.Promise!==void 0?{Promise:h.Promise,implementation:u}:v(u),a&&(w["@@any-promise/REGISTRATION"]=A)),A}}},{}],15:[function(b,L,E){"use strict";function A(){if(window.Promise===void 0)throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}}L.exports=b("./loader")(window,A)},{"./loader":14}],16:[function(b,L,E){L.exports={default:b("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":44}],17:[function(b,L,E){L.exports={default:b("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":45}],18:[function(b,L,E){L.exports={default:b("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":46}],19:[function(b,L,E){L.exports={default:b("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":47}],20:[function(b,L,E){L.exports={default:b("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":48}],21:[function(b,L,E){L.exports={default:b("core-js/library/fn/object/get-own-property-names"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-names":49}],22:[function(b,L,E){L.exports={default:b("core-js/library/fn/object/get-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/get-prototype-of":50}],23:[function(b,L,E){L.exports={default:b("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":51}],24:[function(b,L,E){L.exports={default:b("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":52}],25:[function(b,L,E){L.exports={default:b("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":53}],26:[function(b,L,E){L.exports={default:b("core-js/library/fn/string/from-code-point"),__esModule:!0}},{"core-js/library/fn/string/from-code-point":54}],27:[function(b,L,E){L.exports={default:b("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":56}],28:[function(b,L,E){L.exports={default:b("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":55}],29:[function(b,L,E){L.exports={default:b("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":57}],30:[function(b,L,E){"use strict";E.__esModule=!0,E.default=function(A,w){if(!(A instanceof w))throw new TypeError("Cannot call a class as a function")}},{}],31:[function(b,L,E){"use strict";E.__esModule=!0;var A=b("../core-js/object/define-property"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);E.default=function(){function v(u,h){for(var a=0;a<h.length;a++){var t=h[a];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),(0,w.default)(u,t.key,t)}}return function(u,h,a){return h&&v(u.prototype,h),a&&v(u,a),u}}()},{"../core-js/object/define-property":20}],32:[function(b,L,E){"use strict";function A(t){return t&&t.__esModule?t:{default:t}}E.__esModule=!0;var w=b("../core-js/symbol/iterator"),v=A(w),u=b("../core-js/symbol"),h=A(u),a=typeof h.default=="function"&&typeof v.default=="symbol"?function(t){return typeof t}:function(t){return t&&typeof h.default=="function"&&t.constructor===h.default&&t!==h.default.prototype?"symbol":typeof t};E.default=typeof h.default=="function"&&a(v.default)==="symbol"?function(t){return t===void 0?"undefined":a(t)}:function(t){return t&&typeof h.default=="function"&&t.constructor===h.default&&t!==h.default.prototype?"symbol":t===void 0?"undefined":a(t)}},{"../core-js/symbol":27,"../core-js/symbol/iterator":29}],33:[function(b,L,E){L.exports=b("regenerator-runtime")},{"regenerator-runtime":191}],34:[function(b,L,E){"use strict";function A(r){var d=r.length;if(d%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=r.indexOf("=");return f===-1&&(f=d),[f,f===d?0:4-f%4]}function w(r){var d=A(r),f=d[0],g=d[1];return 3*(f+g)/4-g}function v(r,d,f){return 3*(d+f)/4-f}function u(r){for(var d,f=A(r),g=f[0],m=f[1],p=new c(v(r,g,m)),_=0,y=m>0?g-4:g,n=0;n<y;n+=4)d=l[r.charCodeAt(n)]<<18|l[r.charCodeAt(n+1)]<<12|l[r.charCodeAt(n+2)]<<6|l[r.charCodeAt(n+3)],p[_++]=d>>16&255,p[_++]=d>>8&255,p[_++]=255&d;return m===2&&(d=l[r.charCodeAt(n)]<<2|l[r.charCodeAt(n+1)]>>4,p[_++]=255&d),m===1&&(d=l[r.charCodeAt(n)]<<10|l[r.charCodeAt(n+1)]<<4|l[r.charCodeAt(n+2)]>>2,p[_++]=d>>8&255,p[_++]=255&d),p}function h(r){return i[r>>18&63]+i[r>>12&63]+i[r>>6&63]+i[63&r]}function a(r,d,f){for(var g,m=[],p=d;p<f;p+=3)g=(r[p]<<16&16711680)+(r[p+1]<<8&65280)+(255&r[p+2]),m.push(h(g));return m.join("")}function t(r){for(var d,f=r.length,g=f%3,m=[],p=0,_=f-g;p<_;p+=16383)m.push(a(r,p,p+16383>_?_:p+16383));return g===1?(d=r[f-1],m.push(i[d>>2]+i[d<<4&63]+"==")):g===2&&(d=(r[f-2]<<8)+r[f-1],m.push(i[d>>10]+i[d>>4&63]+i[d<<2&63]+"=")),m.join("")}E.byteLength=w,E.toByteArray=u,E.fromByteArray=t;for(var i=[],l=[],c=typeof Uint8Array!="undefined"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,s=o.length;e<s;++e)i[e]=o[e],l[o.charCodeAt(e)]=e;l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},{}],35:[function(b,L,E){!function(A,w,v){L!==void 0&&L.exports?L.exports=v():typeof U=="function"&&U.amd?U("bowser",v):A.bowser=v()}(this,0,function(){function A(l){function c(V){var N=l.match(V);return N&&N.length>1&&N[1]||""}function o(V){var N=l.match(V);return N&&N.length>1&&N[2]||""}var e,s=c(/(ipod|iphone|ipad)/i).toLowerCase(),r=/like android/i.test(l),d=!r&&/android/i.test(l),f=/nexus\s*[0-6]\s*/i.test(l),g=!f&&/nexus\s*[0-9]+/i.test(l),m=/CrOS/.test(l),p=/silk/i.test(l),_=/sailfish/i.test(l),y=/tizen/i.test(l),n=/(web|hpw)os/i.test(l),x=/windows phone/i.test(l),S=(/SamsungBrowser/i.test(l),!x&&/windows/i.test(l)),T=!s&&!p&&/macintosh/i.test(l),R=!d&&!_&&!y&&!n&&/linux/i.test(l),D=o(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),I=c(/version\/(\d+(\.\d+)?)/i),B=/tablet/i.test(l)&&!/tablet pc/i.test(l),G=!B&&/[^-]mobi/i.test(l),k=/xbox/i.test(l);/opera/i.test(l)?e={name:"Opera",opera:t,version:I||c(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(l)?e={name:"Opera",opera:t,version:c(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||I}:/SamsungBrowser/i.test(l)?e={name:"Samsung Internet for Android",samsungBrowser:t,version:I||c(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(l)?e={name:"Opera Coast",coast:t,version:I||c(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(l)?e={name:"Yandex Browser",yandexbrowser:t,version:I||c(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(l)?e={name:"UC Browser",ucbrowser:t,version:c(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(l)?e={name:"Maxthon",maxthon:t,version:c(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(l)?e={name:"Epiphany",epiphany:t,version:c(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(l)?e={name:"Puffin",puffin:t,version:c(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(l)?e={name:"Sleipnir",sleipnir:t,version:c(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(l)?e={name:"K-Meleon",kMeleon:t,version:c(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:x?(e={name:"Windows Phone",osname:"Windows Phone",windowsphone:t},D?(e.msedge=t,e.version=D):(e.msie=t,e.version=c(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(l)?e={name:"Internet Explorer",msie:t,version:c(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:m?e={name:"Chrome",osname:"Chrome OS",chromeos:t,chromeBook:t,chrome:t,version:c(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(l)?e={name:"Microsoft Edge",msedge:t,version:D}:/vivaldi/i.test(l)?e={name:"Vivaldi",vivaldi:t,version:c(/vivaldi\/(\d+(\.\d+)?)/i)||I}:_?e={name:"Sailfish",osname:"Sailfish OS",sailfish:t,version:c(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(l)?e={name:"SeaMonkey",seamonkey:t,version:c(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(l)?(e={name:"Firefox",firefox:t,version:c(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(l)&&(e.firefoxos=t,e.osname="Firefox OS")):p?e={name:"Amazon Silk",silk:t,version:c(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(l)?e={name:"PhantomJS",phantom:t,version:c(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(l)?e={name:"SlimerJS",slimer:t,version:c(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(l)||/rim\stablet/i.test(l)?e={name:"BlackBerry",osname:"BlackBerry OS",blackberry:t,version:I||c(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:n?(e={name:"WebOS",osname:"WebOS",webos:t,version:I||c(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(l)&&(e.touchpad=t)):/bada/i.test(l)?e={name:"Bada",osname:"Bada",bada:t,version:c(/dolfin\/(\d+(\.\d+)?)/i)}:y?e={name:"Tizen",osname:"Tizen",tizen:t,version:c(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||I}:/qupzilla/i.test(l)?e={name:"QupZilla",qupzilla:t,version:c(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||I}:/chromium/i.test(l)?e={name:"Chromium",chromium:t,version:c(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||I}:/chrome|crios|crmo/i.test(l)?e={name:"Chrome",chrome:t,version:c(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:d?e={name:"Android",version:I}:/safari|applewebkit/i.test(l)?(e={name:"Safari",safari:t},I&&(e.version=I)):s?(e={name:s=="iphone"?"iPhone":s=="ipad"?"iPad":"iPod"},I&&(e.version=I)):e=/googlebot/i.test(l)?{name:"Googlebot",googlebot:t,version:c(/googlebot\/(\d+(\.\d+))/i)||I}:{name:c(/^(.*)\/(.*) /),version:o(/^(.*)\/(.*) /)},!e.msedge&&/(apple)?webkit/i.test(l)?(/(apple)?webkit\/537\.36/i.test(l)?(e.name=e.name||"Blink",e.blink=t):(e.name=e.name||"Webkit",e.webkit=t),!e.version&&I&&(e.version=I)):!e.opera&&/gecko\//i.test(l)&&(e.name=e.name||"Gecko",e.gecko=t,e.version=e.version||c(/gecko\/(\d+(\.\d+)?)/i)),e.windowsphone||!d&&!e.silk?!e.windowsphone&&s?(e[s]=t,e.ios=t,e.osname="iOS"):T?(e.mac=t,e.osname="macOS"):k?(e.xbox=t,e.osname="Xbox"):S?(e.windows=t,e.osname="Windows"):R&&(e.linux=t,e.osname="Linux"):(e.android=t,e.osname="Android");var $="";e.windows?$=function(V){switch(V){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(c(/Windows ((NT|XP)( \d\d?.\d)?)/i)):e.windowsphone?$=c(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):e.mac?($=c(/Mac OS X (\d+([_\.\s]\d+)*)/i),$=$.replace(/[_\s]/g,".")):s?($=c(/os (\d+([_\s]\d+)*) like mac os x/i),$=$.replace(/[_\s]/g,".")):d?$=c(/android[ \/-](\d+(\.\d+)*)/i):e.webos?$=c(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):e.blackberry?$=c(/rim\stablet\sos\s(\d+(\.\d+)*)/i):e.bada?$=c(/bada\/(\d+(\.\d+)*)/i):e.tizen&&($=c(/tizen[\/\s](\d+(\.\d+)*)/i)),$&&(e.osversion=$);var X=!e.windows&&$.split(".")[0];return B||g||s=="ipad"||d&&(X==3||X>=4&&!G)||e.silk?e.tablet=t:(G||s=="iphone"||s=="ipod"||d||f||e.blackberry||e.webos||e.bada)&&(e.mobile=t),e.msedge||e.msie&&e.version>=10||e.yandexbrowser&&e.version>=15||e.vivaldi&&e.version>=1||e.chrome&&e.version>=20||e.samsungBrowser&&e.version>=4||e.firefox&&e.version>=20||e.safari&&e.version>=6||e.opera&&e.version>=10||e.ios&&e.osversion&&e.osversion.split(".")[0]>=6||e.blackberry&&e.version>=10.1||e.chromium&&e.version>=20?e.a=t:e.msie&&e.version<10||e.chrome&&e.version<20||e.firefox&&e.version<20||e.safari&&e.version<6||e.opera&&e.version<10||e.ios&&e.osversion&&e.osversion.split(".")[0]<6||e.chromium&&e.version<20?e.c=t:e.x=t,e}function w(l){return l.split(".").length}function v(l,c){var o,e=[];if(Array.prototype.map)return Array.prototype.map.call(l,c);for(o=0;o<l.length;o++)e.push(c(l[o]));return e}function u(l){for(var c=Math.max(w(l[0]),w(l[1])),o=v(l,function(e){var s=c-w(e);return e+=new Array(s+1).join(".0"),v(e.split("."),function(r){return new Array(20-r.length).join("0")+r}).reverse()});--c>=0;){if(o[0][c]>o[1][c])return 1;if(o[0][c]!==o[1][c])return-1;if(c===0)return 0}}function h(l,c,o){var e=i;typeof c=="string"&&(o=c,c=void 0),c===void 0&&(c=!1),o&&(e=A(o));var s=""+e.version;for(var r in l)if(l.hasOwnProperty(r)&&e[r]){if(typeof l[r]!="string")throw new Error("Browser version in the minVersion map should be a string: "+r+": "+String(l));return u([s,l[r]])<0}return c}function a(l,c,o){return!h(l,c,o)}var t=!0,i=A(typeof navigator!="undefined"&&navigator.userAgent||"");return i.test=function(l){for(var c=0;c<l.length;++c){var o=l[c];if(typeof o=="string"&&o in i)return!0}return!1},i.isUnsupportedBrowser=h,i.compareVersions=u,i.check=a,i._detect=A,i.detect=A,i})},{}],36:[function(b,L,E){},{}],37:[function(b,L,E){function A(i){if(i&&!a(i))throw new Error("Unknown encoding: "+i)}function w(i){return i.toString(this.encoding)}function v(i){this.charReceived=i.length%2,this.charLength=this.charReceived?2:0}function u(i){this.charReceived=i.length%3,this.charLength=this.charReceived?3:0}var h=b("buffer").Buffer,a=h.isEncoding||function(i){switch(i&&i.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}},t=E.StringDecoder=function(i){switch(this.encoding=(i||"utf8").toLowerCase().replace(/[-_]/,""),A(i),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=v;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=w)}this.charBuffer=new h(6),this.charReceived=0,this.charLength=0};t.prototype.write=function(i){for(var l="";this.charLength;){var c=i.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:i.length;if(i.copy(this.charBuffer,this.charReceived,0,c),this.charReceived+=c,this.charReceived<this.charLength)return"";i=i.slice(c,i.length),l=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var e=l.charCodeAt(l.length-1);if(!(e>=55296&&e<=56319)){if(this.charReceived=this.charLength=0,i.length===0)return l;break}this.charLength+=this.surrogateSize,l=""}this.detectIncompleteChar(i);var o=i.length;this.charLength&&(i.copy(this.charBuffer,0,i.length-this.charReceived,o),o-=this.charReceived),l+=i.toString(this.encoding,0,o);var o=l.length-1,e=l.charCodeAt(o);if(e>=55296&&e<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),i.copy(this.charBuffer,0,0,s),l.substring(0,o)}return l},t.prototype.detectIncompleteChar=function(i){for(var l=i.length>=3?3:i.length;l>0;l--){var c=i[i.length-l];if(l==1&&c>>5==6){this.charLength=2;break}if(l<=2&&c>>4==14){this.charLength=3;break}if(l<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=l},t.prototype.end=function(i){var l="";if(i&&i.length&&(l=this.write(i)),this.charReceived){var c=this.charReceived,o=this.charBuffer,e=this.encoding;l+=o.slice(0,c).toString(e)}return l}},{buffer:38}],38:[function(b,L,E){(function(A){"use strict";function w(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function v(C,O){if(w()<O)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(C=new Uint8Array(O),C.__proto__=u.prototype):(C===null&&(C=new u(O)),C.length=O),C}function u(C,O,j){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(C,O,j);if(typeof C=="number"){if(typeof O=="string")throw new Error("If encoding is specified then the first argument must be a string");return i(this,C)}return h(this,C,O,j)}function h(C,O,j,M){if(typeof O=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&O instanceof ArrayBuffer?o(C,O,j,M):typeof O=="string"?l(C,O,j):e(C,O)}function a(C){if(typeof C!="number")throw new TypeError('"size" argument must be a number');if(C<0)throw new RangeError('"size" argument must not be negative')}function t(C,O,j,M){return a(O),O<=0?v(C,O):j!==void 0?typeof M=="string"?v(C,O).fill(j,M):v(C,O).fill(j):v(C,O)}function i(C,O){if(a(O),C=v(C,O<0?0:0|s(O)),!u.TYPED_ARRAY_SUPPORT)for(var j=0;j<O;++j)C[j]=0;return C}function l(C,O,j){if(typeof j=="string"&&j!==""||(j="utf8"),!u.isEncoding(j))throw new TypeError('"encoding" must be a valid string encoding');var M=0|d(O,j);C=v(C,M);var F=C.write(O,j);return F!==M&&(C=C.slice(0,F)),C}function c(C,O){var j=O.length<0?0:0|s(O.length);C=v(C,j);for(var M=0;M<j;M+=1)C[M]=255&O[M];return C}function o(C,O,j,M){if(O.byteLength,j<0||O.byteLength<j)throw new RangeError("'offset' is out of bounds");if(O.byteLength<j+(M||0))throw new RangeError("'length' is out of bounds");return O=j===void 0&&M===void 0?new Uint8Array(O):M===void 0?new Uint8Array(O,j):new Uint8Array(O,j,M),u.TYPED_ARRAY_SUPPORT?(C=O,C.__proto__=u.prototype):C=c(C,O),C}function e(C,O){if(u.isBuffer(O)){var j=0|s(O.length);return C=v(C,j),C.length===0||O.copy(C,0,0,j),C}if(O){if(typeof ArrayBuffer!="undefined"&&O.buffer instanceof ArrayBuffer||"length"in O)return typeof O.length!="number"||re(O.length)?v(C,0):c(C,O);if(O.type==="Buffer"&&Ee(O.data))return c(C,O.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function s(C){if(C>=w())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w().toString(16)+" bytes");return 0|C}function r(C){return+C!=C&&(C=0),u.alloc(+C)}function d(C,O){if(u.isBuffer(C))return C.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(C)||C instanceof ArrayBuffer))return C.byteLength;typeof C!="string"&&(C=""+C);var j=C.length;if(j===0)return 0;for(var M=!1;;)switch(O){case"ascii":case"latin1":case"binary":return j;case"utf8":case"utf-8":case void 0:return ge(C).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*j;case"hex":return j>>>1;case"base64":return Q(C).length;default:if(M)return ge(C).length;O=(""+O).toLowerCase(),M=!0}}function f(C,O,j){var M=!1;if((O===void 0||O<0)&&(O=0),O>this.length)return"";if((j===void 0||j>this.length)&&(j=this.length),j<=0)return"";if(j>>>=0,O>>>=0,j<=O)return"";for(C||(C="utf8");;)switch(C){case"hex":return k(this,O,j);case"utf8":case"utf-8":return D(this,O,j);case"ascii":return B(this,O,j);case"latin1":case"binary":return G(this,O,j);case"base64":return R(this,O,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,O,j);default:if(M)throw new TypeError("Unknown encoding: "+C);C=(C+"").toLowerCase(),M=!0}}function g(C,O,j){var M=C[O];C[O]=C[j],C[j]=M}function m(C,O,j,M,F){if(C.length===0)return-1;if(typeof j=="string"?(M=j,j=0):j>2147483647?j=2147483647:j<-2147483648&&(j=-2147483648),j=+j,isNaN(j)&&(j=F?0:C.length-1),j<0&&(j=C.length+j),j>=C.length){if(F)return-1;j=C.length-1}else if(j<0){if(!F)return-1;j=0}if(typeof O=="string"&&(O=u.from(O,M)),u.isBuffer(O))return O.length===0?-1:p(C,O,j,M,F);if(typeof O=="number")return O&=255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?F?Uint8Array.prototype.indexOf.call(C,O,j):Uint8Array.prototype.lastIndexOf.call(C,O,j):p(C,[O],j,M,F);throw new TypeError("val must be string, number or Buffer")}function p(C,O,j,M,F){function oe(Re,xe){return ve===1?Re[xe]:Re.readUInt16BE(xe*ve)}var ve=1,ke=C.length,Oe=O.length;if(M!==void 0&&((M=String(M).toLowerCase())==="ucs2"||M==="ucs-2"||M==="utf16le"||M==="utf-16le")){if(C.length<2||O.length<2)return-1;ve=2,ke/=2,Oe/=2,j/=2}var De;if(F){var Ue=-1;for(De=j;De<ke;De++)if(oe(C,De)===oe(O,Ue===-1?0:De-Ue)){if(Ue===-1&&(Ue=De),De-Ue+1===Oe)return Ue*ve}else Ue!==-1&&(De-=De-Ue),Ue=-1}else for(j+Oe>ke&&(j=ke-Oe),De=j;De>=0;De--){for(var Ke=!0,Pe=0;Pe<Oe;Pe++)if(oe(C,De+Pe)!==oe(O,Pe)){Ke=!1;break}if(Ke)return De}return-1}function _(C,O,j,M){j=Number(j)||0;var F=C.length-j;M?(M=Number(M))>F&&(M=F):M=F;var oe=O.length;if(oe%2!=0)throw new TypeError("Invalid hex string");M>oe/2&&(M=oe/2);for(var ve=0;ve<M;++ve){var ke=parseInt(O.substr(2*ve,2),16);if(isNaN(ke))return ve;C[j+ve]=ke}return ve}function y(C,O,j,M){return me(ge(O,C.length-j),C,j,M)}function n(C,O,j,M){return me(ie(O),C,j,M)}function x(C,O,j,M){return n(C,O,j,M)}function S(C,O,j,M){return me(Q(O),C,j,M)}function T(C,O,j,M){return me(te(O,C.length-j),C,j,M)}function R(C,O,j){return O===0&&j===C.length?J.fromByteArray(C):J.fromByteArray(C.slice(O,j))}function D(C,O,j){j=Math.min(C.length,j);for(var M=[],F=O;F<j;){var oe=C[F],ve=null,ke=oe>239?4:oe>223?3:oe>191?2:1;if(F+ke<=j){var Oe,De,Ue,Ke;switch(ke){case 1:oe<128&&(ve=oe);break;case 2:Oe=C[F+1],(192&Oe)==128&&(Ke=(31&oe)<<6|63&Oe)>127&&(ve=Ke);break;case 3:Oe=C[F+1],De=C[F+2],(192&Oe)==128&&(192&De)==128&&(Ke=(15&oe)<<12|(63&Oe)<<6|63&De)>2047&&(Ke<55296||Ke>57343)&&(ve=Ke);break;case 4:Oe=C[F+1],De=C[F+2],Ue=C[F+3],(192&Oe)==128&&(192&De)==128&&(192&Ue)==128&&(Ke=(15&oe)<<18|(63&Oe)<<12|(63&De)<<6|63&Ue)>65535&&Ke<1114112&&(ve=Ke)}}ve===null?(ve=65533,ke=1):ve>65535&&(ve-=65536,M.push(ve>>>10&1023|55296),ve=56320|1023&ve),M.push(ve),F+=ke}return I(M)}function I(C){var O=C.length;if(O<=Le)return String.fromCharCode.apply(String,C);for(var j="",M=0;M<O;)j+=String.fromCharCode.apply(String,C.slice(M,M+=Le));return j}function B(C,O,j){var M="";j=Math.min(C.length,j);for(var F=O;F<j;++F)M+=String.fromCharCode(127&C[F]);return M}function G(C,O,j){var M="";j=Math.min(C.length,j);for(var F=O;F<j;++F)M+=String.fromCharCode(C[F]);return M}function k(C,O,j){var M=C.length;(!O||O<0)&&(O=0),(!j||j<0||j>M)&&(j=M);for(var F="",oe=O;oe<j;++oe)F+=se(C[oe]);return F}function $(C,O,j){for(var M=C.slice(O,j),F="",oe=0;oe<M.length;oe+=2)F+=String.fromCharCode(M[oe]+256*M[oe+1]);return F}function X(C,O,j){if(C%1!=0||C<0)throw new RangeError("offset is not uint");if(C+O>j)throw new RangeError("Trying to access beyond buffer length")}function V(C,O,j,M,F,oe){if(!u.isBuffer(C))throw new TypeError('"buffer" argument must be a Buffer instance');if(O>F||O<oe)throw new RangeError('"value" argument is out of bounds');if(j+M>C.length)throw new RangeError("Index out of range")}function N(C,O,j,M){O<0&&(O=65535+O+1);for(var F=0,oe=Math.min(C.length-j,2);F<oe;++F)C[j+F]=(O&255<<8*(M?F:1-F))>>>8*(M?F:1-F)}function z(C,O,j,M){O<0&&(O=4294967295+O+1);for(var F=0,oe=Math.min(C.length-j,4);F<oe;++F)C[j+F]=O>>>8*(M?F:3-F)&255}function q(C,O,j,M,F,oe){if(j+M>C.length)throw new RangeError("Index out of range");if(j<0)throw new RangeError("Index out of range")}function ee(C,O,j,M,F){return F||q(C,O,j,4,34028234663852886e22,-34028234663852886e22),be.write(C,O,j,M,23,4),j+4}function fe(C,O,j,M,F){return F||q(C,O,j,8,17976931348623157e292,-17976931348623157e292),be.write(C,O,j,M,52,8),j+8}function ae(C){if(C=pe(C).replace(H,""),C.length<2)return"";for(;C.length%4!=0;)C+="=";return C}function pe(C){return C.trim?C.trim():C.replace(/^\s+|\s+$/g,"")}function se(C){return C<16?"0"+C.toString(16):C.toString(16)}function ge(C,O){O=O||1/0;for(var j,M=C.length,F=null,oe=[],ve=0;ve<M;++ve){if((j=C.charCodeAt(ve))>55295&&j<57344){if(!F){if(j>56319){(O-=3)>-1&&oe.push(239,191,189);continue}if(ve+1===M){(O-=3)>-1&&oe.push(239,191,189);continue}F=j;continue}if(j<56320){(O-=3)>-1&&oe.push(239,191,189),F=j;continue}j=65536+(F-55296<<10|j-56320)}else F&&(O-=3)>-1&&oe.push(239,191,189);if(F=null,j<128){if((O-=1)<0)break;oe.push(j)}else if(j<2048){if((O-=2)<0)break;oe.push(j>>6|192,63&j|128)}else if(j<65536){if((O-=3)<0)break;oe.push(j>>12|224,j>>6&63|128,63&j|128)}else{if(!(j<1114112))throw new Error("Invalid code point");if((O-=4)<0)break;oe.push(j>>18|240,j>>12&63|128,j>>6&63|128,63&j|128)}}return oe}function ie(C){for(var O=[],j=0;j<C.length;++j)O.push(255&C.charCodeAt(j));return O}function te(C,O){for(var j,M,F,oe=[],ve=0;ve<C.length&&!((O-=2)<0);++ve)j=C.charCodeAt(ve),M=j>>8,F=j%256,oe.push(F),oe.push(M);return oe}function Q(C){return J.toByteArray(ae(C))}function me(C,O,j,M){for(var F=0;F<M&&!(F+j>=O.length||F>=C.length);++F)O[F+j]=C[F];return F}function re(C){return C!==C}var J=b("base64-js"),be=b("ieee754"),Ee=b("isarray");E.Buffer=u,E.SlowBuffer=r,E.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=A.TYPED_ARRAY_SUPPORT!==void 0?A.TYPED_ARRAY_SUPPORT:function(){try{var C=new Uint8Array(1);return C.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},C.foo()===42&&typeof C.subarray=="function"&&C.subarray(1,1).byteLength===0}catch(O){return!1}}(),E.kMaxLength=w(),u.poolSize=8192,u._augment=function(C){return C.__proto__=u.prototype,C},u.from=function(C,O,j){return h(null,C,O,j)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(C,O,j){return t(null,C,O,j)},u.allocUnsafe=function(C){return i(null,C)},u.allocUnsafeSlow=function(C){return i(null,C)},u.isBuffer=function(C){return!(C==null||!C._isBuffer)},u.compare=function(C,O){if(!u.isBuffer(C)||!u.isBuffer(O))throw new TypeError("Arguments must be Buffers");if(C===O)return 0;for(var j=C.length,M=O.length,F=0,oe=Math.min(j,M);F<oe;++F)if(C[F]!==O[F]){j=C[F],M=O[F];break}return j<M?-1:M<j?1:0},u.isEncoding=function(C){switch(String(C).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}},u.concat=function(C,O){if(!Ee(C))throw new TypeError('"list" argument must be an Array of Buffers');if(C.length===0)return u.alloc(0);var j;if(O===void 0)for(O=0,j=0;j<C.length;++j)O+=C[j].length;var M=u.allocUnsafe(O),F=0;for(j=0;j<C.length;++j){var oe=C[j];if(!u.isBuffer(oe))throw new TypeError('"list" argument must be an Array of Buffers');oe.copy(M,F),F+=oe.length}return M},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var C=this.length;if(C%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var O=0;O<C;O+=2)g(this,O,O+1);return this},u.prototype.swap32=function(){var C=this.length;if(C%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var O=0;O<C;O+=4)g(this,O,O+3),g(this,O+1,O+2);return this},u.prototype.swap64=function(){var C=this.length;if(C%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var O=0;O<C;O+=8)g(this,O,O+7),g(this,O+1,O+6),g(this,O+2,O+5),g(this,O+3,O+4);return this},u.prototype.toString=function(){var C=0|this.length;return C===0?"":arguments.length===0?D(this,0,C):f.apply(this,arguments)},u.prototype.equals=function(C){if(!u.isBuffer(C))throw new TypeError("Argument must be a Buffer");return this===C||u.compare(this,C)===0},u.prototype.inspect=function(){var C="",O=E.INSPECT_MAX_BYTES;return this.length>0&&(C=this.toString("hex",0,O).match(/.{2}/g).join(" "),this.length>O&&(C+=" ... ")),"<Buffer "+C+">"},u.prototype.compare=function(C,O,j,M,F){if(!u.isBuffer(C))throw new TypeError("Argument must be a Buffer");if(O===void 0&&(O=0),j===void 0&&(j=C?C.length:0),M===void 0&&(M=0),F===void 0&&(F=this.length),O<0||j>C.length||M<0||F>this.length)throw new RangeError("out of range index");if(M>=F&&O>=j)return 0;if(M>=F)return-1;if(O>=j)return 1;if(O>>>=0,j>>>=0,M>>>=0,F>>>=0,this===C)return 0;for(var oe=F-M,ve=j-O,ke=Math.min(oe,ve),Oe=this.slice(M,F),De=C.slice(O,j),Ue=0;Ue<ke;++Ue)if(Oe[Ue]!==De[Ue]){oe=Oe[Ue],ve=De[Ue];break}return oe<ve?-1:ve<oe?1:0},u.prototype.includes=function(C,O,j){return this.indexOf(C,O,j)!==-1},u.prototype.indexOf=function(C,O,j){return m(this,C,O,j,!0)},u.prototype.lastIndexOf=function(C,O,j){return m(this,C,O,j,!1)},u.prototype.write=function(C,O,j,M){if(O===void 0)M="utf8",j=this.length,O=0;else if(j===void 0&&typeof O=="string")M=O,j=this.length,O=0;else{if(!isFinite(O))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");O|=0,isFinite(j)?(j|=0,M===void 0&&(M="utf8")):(M=j,j=void 0)}var F=this.length-O;if((j===void 0||j>F)&&(j=F),C.length>0&&(j<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");for(var oe=!1;;)switch(M){case"hex":return _(this,C,O,j);case"utf8":case"utf-8":return y(this,C,O,j);case"ascii":return n(this,C,O,j);case"latin1":case"binary":return x(this,C,O,j);case"base64":return S(this,C,O,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,C,O,j);default:if(oe)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),oe=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Le=4096;u.prototype.slice=function(C,O){var j=this.length;C=~~C,O=O===void 0?j:~~O,C<0?(C+=j)<0&&(C=0):C>j&&(C=j),O<0?(O+=j)<0&&(O=0):O>j&&(O=j),O<C&&(O=C);var M;if(u.TYPED_ARRAY_SUPPORT)M=this.subarray(C,O),M.__proto__=u.prototype;else{var F=O-C;M=new u(F,void 0);for(var oe=0;oe<F;++oe)M[oe]=this[oe+C]}return M},u.prototype.readUIntLE=function(C,O,j){C|=0,O|=0,j||X(C,O,this.length);for(var M=this[C],F=1,oe=0;++oe<O&&(F*=256);)M+=this[C+oe]*F;return M},u.prototype.readUIntBE=function(C,O,j){C|=0,O|=0,j||X(C,O,this.length);for(var M=this[C+--O],F=1;O>0&&(F*=256);)M+=this[C+--O]*F;return M},u.prototype.readUInt8=function(C,O){return O||X(C,1,this.length),this[C]},u.prototype.readUInt16LE=function(C,O){return O||X(C,2,this.length),this[C]|this[C+1]<<8},u.prototype.readUInt16BE=function(C,O){return O||X(C,2,this.length),this[C]<<8|this[C+1]},u.prototype.readUInt32LE=function(C,O){return O||X(C,4,this.length),(this[C]|this[C+1]<<8|this[C+2]<<16)+16777216*this[C+3]},u.prototype.readUInt32BE=function(C,O){return O||X(C,4,this.length),16777216*this[C]+(this[C+1]<<16|this[C+2]<<8|this[C+3])},u.prototype.readIntLE=function(C,O,j){C|=0,O|=0,j||X(C,O,this.length);for(var M=this[C],F=1,oe=0;++oe<O&&(F*=256);)M+=this[C+oe]*F;return F*=128,M>=F&&(M-=Math.pow(2,8*O)),M},u.prototype.readIntBE=function(C,O,j){C|=0,O|=0,j||X(C,O,this.length);for(var M=O,F=1,oe=this[C+--M];M>0&&(F*=256);)oe+=this[C+--M]*F;return F*=128,oe>=F&&(oe-=Math.pow(2,8*O)),oe},u.prototype.readInt8=function(C,O){return O||X(C,1,this.length),128&this[C]?-1*(255-this[C]+1):this[C]},u.prototype.readInt16LE=function(C,O){O||X(C,2,this.length);var j=this[C]|this[C+1]<<8;return 32768&j?4294901760|j:j},u.prototype.readInt16BE=function(C,O){O||X(C,2,this.length);var j=this[C+1]|this[C]<<8;return 32768&j?4294901760|j:j},u.prototype.readInt32LE=function(C,O){return O||X(C,4,this.length),this[C]|this[C+1]<<8|this[C+2]<<16|this[C+3]<<24},u.prototype.readInt32BE=function(C,O){return O||X(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},u.prototype.readFloatLE=function(C,O){return O||X(C,4,this.length),be.read(this,C,!0,23,4)},u.prototype.readFloatBE=function(C,O){return O||X(C,4,this.length),be.read(this,C,!1,23,4)},u.prototype.readDoubleLE=function(C,O){return O||X(C,8,this.length),be.read(this,C,!0,52,8)},u.prototype.readDoubleBE=function(C,O){return O||X(C,8,this.length),be.read(this,C,!1,52,8)},u.prototype.writeUIntLE=function(C,O,j,M){(C=+C,O|=0,j|=0,!M)&&V(this,C,O,j,Math.pow(2,8*j)-1,0);var F=1,oe=0;for(this[O]=255&C;++oe<j&&(F*=256);)this[O+oe]=C/F&255;return O+j},u.prototype.writeUIntBE=function(C,O,j,M){(C=+C,O|=0,j|=0,!M)&&V(this,C,O,j,Math.pow(2,8*j)-1,0);var F=j-1,oe=1;for(this[O+F]=255&C;--F>=0&&(oe*=256);)this[O+F]=C/oe&255;return O+j},u.prototype.writeUInt8=function(C,O,j){return C=+C,O|=0,j||V(this,C,O,1,255,0),u.TYPED_ARRAY_SUPPORT||(C=Math.floor(C)),this[O]=255&C,O+1},u.prototype.writeUInt16LE=function(C,O,j){return C=+C,O|=0,j||V(this,C,O,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[O]=255&C,this[O+1]=C>>>8):N(this,C,O,!0),O+2},u.prototype.writeUInt16BE=function(C,O,j){return C=+C,O|=0,j||V(this,C,O,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[O]=C>>>8,this[O+1]=255&C):N(this,C,O,!1),O+2},u.prototype.writeUInt32LE=function(C,O,j){return C=+C,O|=0,j||V(this,C,O,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[O+3]=C>>>24,this[O+2]=C>>>16,this[O+1]=C>>>8,this[O]=255&C):z(this,C,O,!0),O+4},u.prototype.writeUInt32BE=function(C,O,j){return C=+C,O|=0,j||V(this,C,O,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[O]=C>>>24,this[O+1]=C>>>16,this[O+2]=C>>>8,this[O+3]=255&C):z(this,C,O,!1),O+4},u.prototype.writeIntLE=function(C,O,j,M){if(C=+C,O|=0,!M){var F=Math.pow(2,8*j-1);V(this,C,O,j,F-1,-F)}var oe=0,ve=1,ke=0;for(this[O]=255&C;++oe<j&&(ve*=256);)C<0&&ke===0&&this[O+oe-1]!==0&&(ke=1),this[O+oe]=(C/ve>>0)-ke&255;return O+j},u.prototype.writeIntBE=function(C,O,j,M){if(C=+C,O|=0,!M){var F=Math.pow(2,8*j-1);V(this,C,O,j,F-1,-F)}var oe=j-1,ve=1,ke=0;for(this[O+oe]=255&C;--oe>=0&&(ve*=256);)C<0&&ke===0&&this[O+oe+1]!==0&&(ke=1),this[O+oe]=(C/ve>>0)-ke&255;return O+j},u.prototype.writeInt8=function(C,O,j){return C=+C,O|=0,j||V(this,C,O,1,127,-128),u.TYPED_ARRAY_SUPPORT||(C=Math.floor(C)),C<0&&(C=255+C+1),this[O]=255&C,O+1},u.prototype.writeInt16LE=function(C,O,j){return C=+C,O|=0,j||V(this,C,O,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[O]=255&C,this[O+1]=C>>>8):N(this,C,O,!0),O+2},u.prototype.writeInt16BE=function(C,O,j){return C=+C,O|=0,j||V(this,C,O,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[O]=C>>>8,this[O+1]=255&C):N(this,C,O,!1),O+2},u.prototype.writeInt32LE=function(C,O,j){return C=+C,O|=0,j||V(this,C,O,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[O]=255&C,this[O+1]=C>>>8,this[O+2]=C>>>16,this[O+3]=C>>>24):z(this,C,O,!0),O+4},u.prototype.writeInt32BE=function(C,O,j){return C=+C,O|=0,j||V(this,C,O,4,2147483647,-2147483648),C<0&&(C=4294967295+C+1),u.TYPED_ARRAY_SUPPORT?(this[O]=C>>>24,this[O+1]=C>>>16,this[O+2]=C>>>8,this[O+3]=255&C):z(this,C,O,!1),O+4},u.prototype.writeFloatLE=function(C,O,j){return ee(this,C,O,!0,j)},u.prototype.writeFloatBE=function(C,O,j){return ee(this,C,O,!1,j)},u.prototype.writeDoubleLE=function(C,O,j){return fe(this,C,O,!0,j)},u.prototype.writeDoubleBE=function(C,O,j){return fe(this,C,O,!1,j)},u.prototype.copy=function(C,O,j,M){if(j||(j=0),M||M===0||(M=this.length),O>=C.length&&(O=C.length),O||(O=0),M>0&&M<j&&(M=j),M===j)return 0;if(C.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(j<0||j>=this.length)throw new RangeError("sourceStart out of bounds");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),C.length-O<M-j&&(M=C.length-O+j);var F,oe=M-j;if(this===C&&j<O&&O<M)for(F=oe-1;F>=0;--F)C[F+O]=this[F+j];else if(oe<1e3||!u.TYPED_ARRAY_SUPPORT)for(F=0;F<oe;++F)C[F+O]=this[F+j];else Uint8Array.prototype.set.call(C,this.subarray(j,j+oe),O);return oe},u.prototype.fill=function(C,O,j,M){if(typeof C=="string"){if(typeof O=="string"?(M=O,O=0,j=this.length):typeof j=="string"&&(M=j,j=this.length),C.length===1){var F=C.charCodeAt(0);F<256&&(C=F)}if(M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!u.isEncoding(M))throw new TypeError("Unknown encoding: "+M)}else typeof C=="number"&&(C&=255);if(O<0||this.length<O||this.length<j)throw new RangeError("Out of range index");if(j<=O)return this;O>>>=0,j=j===void 0?this.length:j>>>0,C||(C=0);var oe;if(typeof C=="number")for(oe=O;oe<j;++oe)this[oe]=C;else{var ve=u.isBuffer(C)?C:ge(new u(C,M).toString()),ke=ve.length;for(oe=0;oe<j-O;++oe)this[oe+O]=ve[oe%ke]}return this};var H=/[^+\/0-9A-Za-z-_]/g}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"base64-js":34,ieee754:161,isarray:166}],39:[function(b,L,E){L.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],40:[function(b,L,E){"use strict";var A=function(){this.buffer=[],this.fns=[]};A.prototype.push=function(v,u){if(this.fns.length)return this.fns.shift()(null,v);var h={data:v,priority:u},a=w(this.buffer,h,function(t){return t.priority});this.buffer.splice(a,0,h)},A.prototype.next=function(){var v=this;return function(u){if(v.buffer.length)return u(null,v.buffer.pop().data);v.fns.push(u)}};var w=function(v,u,h){u=h(u);for(var a=0,t=v?v.length:a;a<t;){var i=a+t>>>1;h(v[i])<u?a=i+1:t=i}return a};L.exports=A},{}],41:[function(b,L,E){function A(o){var e=this,s=c.call(arguments,1);return new Promise(function(r,d){function f(p){var _;try{_=o.next(p)}catch(y){return d(y)}m(_)}function g(p){var _;try{_=o.throw(p)}catch(y){return d(y)}m(_)}function m(p){if(p.done)return r(p.value);var _=w.call(e,p.value);return _&&a(_)?_.then(f,g):g(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "'+String(p.value)+'"'))}if(typeof o=="function"&&(o=o.apply(e,s)),!o||typeof o.next!="function")return r(o);f()})}function w(o){return o&&(a(o)?o:i(o)||t(o)?A.call(this,o):typeof o=="function"?v.call(this,o):Array.isArray(o)?u.call(this,o):l(o)?h.call(this,o):o)}function v(o){var e=this;return new Promise(function(s,r){o.call(e,function(d,f){if(d)return r(d);arguments.length>2&&(f=c.call(arguments,1)),s(f)})})}function u(o){return Promise.all(o.map(w,this))}function h(o){for(var e=new o.constructor,s=Object.keys(o),r=[],d=0;d<s.length;d++){var f=s[d],g=w.call(this,o[f]);g&&a(g)?function(m,p){e[p]=void 0,r.push(m.then(function(_){e[p]=_}))}(g,f):e[f]=o[f]}return Promise.all(r).then(function(){return e})}function a(o){return typeof o.then=="function"}function t(o){return typeof o.next=="function"&&typeof o.throw=="function"}function i(o){var e=o.constructor;return!!e&&(e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction"||t(e.prototype))}function l(o){return Object==o.constructor}var c=Array.prototype.slice;L.exports=A.default=A.co=A,A.wrap=function(o){function e(){return A.call(this,o.apply(this,arguments))}return e.__generatorFunction__=o,e}},{}],42:[function(b,L,E){L.exports={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:512,O_EXCL:2048,O_NOCTTY:131072,O_TRUNC:1024,O_APPEND:8,O_DIRECTORY:1048576,O_NOFOLLOW:256,O_SYNC:128,O_SYMLINK:2097152,O_NONBLOCK:4,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,E2BIG:7,EACCES:13,EADDRINUSE:48,EADDRNOTAVAIL:49,EAFNOSUPPORT:47,EAGAIN:35,EALREADY:37,EBADF:9,EBADMSG:94,EBUSY:16,ECANCELED:89,ECHILD:10,ECONNABORTED:53,ECONNREFUSED:61,ECONNRESET:54,EDEADLK:11,EDESTADDRREQ:39,EDOM:33,EDQUOT:69,EEXIST:17,EFAULT:14,EFBIG:27,EHOSTUNREACH:65,EIDRM:90,EILSEQ:92,EINPROGRESS:36,EINTR:4,EINVAL:22,EIO:5,EISCONN:56,EISDIR:21,ELOOP:62,EMFILE:24,EMLINK:31,EMSGSIZE:40,EMULTIHOP:95,ENAMETOOLONG:63,ENETDOWN:50,ENETRESET:52,ENETUNREACH:51,ENFILE:23,ENOBUFS:55,ENODATA:96,ENODEV:19,ENOENT:2,ENOEXEC:8,ENOLCK:77,ENOLINK:97,ENOMEM:12,ENOMSG:91,ENOPROTOOPT:42,ENOSPC:28,ENOSR:98,ENOSTR:99,ENOSYS:78,ENOTCONN:57,ENOTDIR:20,ENOTEMPTY:66,ENOTSOCK:38,ENOTSUP:45,ENOTTY:25,ENXIO:6,EOPNOTSUPP:102,EOVERFLOW:84,EPERM:1,EPIPE:32,EPROTO:100,EPROTONOSUPPORT:43,EPROTOTYPE:41,ERANGE:34,EROFS:30,ESPIPE:29,ESRCH:3,ESTALE:70,ETIME:101,ETIMEDOUT:60,ETXTBSY:26,EWOULDBLOCK:35,EXDEV:18,SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGBUS:10,SIGFPE:8,SIGKILL:9,SIGUSR1:30,SIGSEGV:11,SIGUSR2:31,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGCHLD:20,SIGCONT:19,SIGSTOP:17,SIGTSTP:18,SIGTTIN:21,SIGTTOU:22,SIGURG:16,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28,SIGIO:23,SIGSYS:12,SSL_OP_ALL:2147486719,SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION:262144,SSL_OP_CIPHER_SERVER_PREFERENCE:4194304,SSL_OP_CISCO_ANYCONNECT:32768,SSL_OP_COOKIE_EXCHANGE:8192,SSL_OP_CRYPTOPRO_TLSEXT_BUG:2147483648,SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS:2048,SSL_OP_EPHEMERAL_RSA:0,SSL_OP_LEGACY_SERVER_CONNECT:4,SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER:32,SSL_OP_MICROSOFT_SESS_ID_BUG:1,SSL_OP_MSIE_SSLV2_RSA_PADDING:0,SSL_OP_NETSCAPE_CA_DN_BUG:536870912,SSL_OP_NETSCAPE_CHALLENGE_BUG:2,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG:1073741824,SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG:8,SSL_OP_NO_COMPRESSION:131072,SSL_OP_NO_QUERY_MTU:4096,SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION:65536,SSL_OP_NO_SSLv2:16777216,SSL_OP_NO_SSLv3:33554432,SSL_OP_NO_TICKET:16384,SSL_OP_NO_TLSv1:67108864,SSL_OP_NO_TLSv1_1:268435456,SSL_OP_NO_TLSv1_2:134217728,SSL_OP_PKCS1_CHECK_1:0,SSL_OP_PKCS1_CHECK_2:0,SSL_OP_SINGLE_DH_USE:1048576,SSL_OP_SINGLE_ECDH_USE:524288,SSL_OP_SSLEAY_080_CLIENT_DH_BUG:128,SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG:0,SSL_OP_TLS_BLOCK_PADDING_BUG:512,SSL_OP_TLS_D5_BUG:256,SSL_OP_TLS_ROLLBACK_BUG:8388608,ENGINE_METHOD_DSA:2,ENGINE_METHOD_DH:4,ENGINE_METHOD_RAND:8,ENGINE_METHOD_ECDH:16,ENGINE_METHOD_ECDSA:32,ENGINE_METHOD_CIPHERS:64,ENGINE_METHOD_DIGESTS:128,ENGINE_METHOD_STORE:256,ENGINE_METHOD_PKEY_METHS:512,ENGINE_METHOD_PKEY_ASN1_METHS:1024,ENGINE_METHOD_ALL:65535,ENGINE_METHOD_NONE:0,DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_UDP_REUSEADDR:4}},{}],43:[function(b,L,E){"use strict";function A(u,h){if(!(this instanceof A))return new A(u,h);this.src=u,this._withAccess=h}function w(u,h){return u[h]===void 0&&u.__lookupGetter__(h)===void 0&&u.__lookupSetter__(h)===void 0}var v=Array.prototype.slice;L.exports=A,A.prototype.withAccess=function(u){return this._withAccess=u!==!1,this},A.prototype.pick=function(u){return Array.isArray(u)||(u=v.call(arguments)),u.length&&(this.keys=u),this},A.prototype.to=function(u){if(u=u||{},!this.src)return u;var h=this.keys||Object.keys(this.src);if(!this._withAccess){for(var a=0;a<h.length;a++)t=h[a],u[t]===void 0&&(u[t]=this.src[t]);return u}for(var a=0;a<h.length;a++){var t=h[a];if(w(u,t)){var i=this.src.__lookupGetter__(t),l=this.src.__lookupSetter__(t);i&&u.__defineGetter__(t,i),l&&u.__defineSetter__(t,l),i||l||(u[t]=this.src[t])}}return u},A.prototype.toCover=function(u){for(var h=this.keys||Object.keys(this.src),a=0;a<h.length;a++){var t=h[a];delete u[t];var i=this.src.__lookupGetter__(t),l=this.src.__lookupSetter__(t);i&&u.__defineGetter__(t,i),l&&u.__defineSetter__(t,l),i||l||(u[t]=this.src[t])}},A.prototype.override=A.prototype.toCover,A.prototype.and=function(u){var h={};return this.to(h),this.src=u,this.to(h),this.src=h,this}},{}],44:[function(b,L,E){b("../../modules/es6.string.iterator"),b("../../modules/es6.array.from"),L.exports=b("../../modules/_core").Array.from},{"../../modules/_core":65,"../../modules/es6.array.from":133,"../../modules/es6.string.iterator":145}],45:[function(b,L,E){var A=b("../../modules/_core"),w=A.JSON||(A.JSON={stringify:JSON.stringify});L.exports=function(v){return w.stringify.apply(w,arguments)}},{"../../modules/_core":65}],46:[function(b,L,E){b("../../modules/es6.object.assign"),L.exports=b("../../modules/_core").Object.assign},{"../../modules/_core":65,"../../modules/es6.object.assign":136}],47:[function(b,L,E){b("../../modules/es6.object.create");var A=b("../../modules/_core").Object;L.exports=function(w,v){return A.create(w,v)}},{"../../modules/_core":65,"../../modules/es6.object.create":137}],48:[function(b,L,E){b("../../modules/es6.object.define-property");var A=b("../../modules/_core").Object;L.exports=function(w,v,u){return A.defineProperty(w,v,u)}},{"../../modules/_core":65,"../../modules/es6.object.define-property":138}],49:[function(b,L,E){b("../../modules/es6.object.get-own-property-names");var A=b("../../modules/_core").Object;L.exports=function(w){return A.getOwnPropertyNames(w)}},{"../../modules/_core":65,"../../modules/es6.object.get-own-property-names":139}],50:[function(b,L,E){b("../../modules/es6.object.get-prototype-of"),L.exports=b("../../modules/_core").Object.getPrototypeOf},{"../../modules/_core":65,"../../modules/es6.object.get-prototype-of":140}],51:[function(b,L,E){b("../../modules/es6.object.keys"),L.exports=b("../../modules/_core").Object.keys},{"../../modules/_core":65,"../../modules/es6.object.keys":141}],52:[function(b,L,E){b("../modules/es6.object.to-string"),b("../modules/es6.string.iterator"),b("../modules/web.dom.iterable"),b("../modules/es6.promise"),b("../modules/es7.promise.finally"),b("../modules/es7.promise.try"),L.exports=b("../modules/_core").Promise},{"../modules/_core":65,"../modules/es6.object.to-string":142,"../modules/es6.promise":143,"../modules/es6.string.iterator":145,"../modules/es7.promise.finally":147,"../modules/es7.promise.try":148,"../modules/web.dom.iterable":151}],53:[function(b,L,E){b("../modules/web.immediate"),L.exports=b("../modules/_core").setImmediate},{"../modules/_core":65,"../modules/web.immediate":152}],54:[function(b,L,E){b("../../modules/es6.string.from-code-point"),L.exports=b("../../modules/_core").String.fromCodePoint},{"../../modules/_core":65,"../../modules/es6.string.from-code-point":144}],55:[function(b,L,E){b("../../modules/es6.function.has-instance"),L.exports=b("../../modules/_wks-ext").f("hasInstance")},{"../../modules/_wks-ext":130,"../../modules/es6.function.has-instance":135}],56:[function(b,L,E){b("../../modules/es6.symbol"),b("../../modules/es6.object.to-string"),b("../../modules/es7.symbol.async-iterator"),b("../../modules/es7.symbol.observable"),L.exports=b("../../modules/_core").Symbol},{"../../modules/_core":65,"../../modules/es6.object.to-string":142,"../../modules/es6.symbol":146,"../../modules/es7.symbol.async-iterator":149,"../../modules/es7.symbol.observable":150}],57:[function(b,L,E){b("../../modules/es6.string.iterator"),b("../../modules/web.dom.iterable"),L.exports=b("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":130,"../../modules/es6.string.iterator":145,"../../modules/web.dom.iterable":151}],58:[function(b,L,E){L.exports=function(A){if(typeof A!="function")throw TypeError(A+" is not a function!");return A}},{}],59:[function(b,L,E){L.exports=function(){}},{}],60:[function(b,L,E){L.exports=function(A,w,v,u){if(!(A instanceof w)||u!==void 0&&u in A)throw TypeError(v+": incorrect invocation!");return A}},{}],61:[function(b,L,E){var A=b("./_is-object");L.exports=function(w){if(!A(w))throw TypeError(w+" is not an object!");return w}},{"./_is-object":85}],62:[function(b,L,E){var A=b("./_to-iobject"),w=b("./_to-length"),v=b("./_to-absolute-index");L.exports=function(u){return function(h,a,t){var i,l=A(h),c=w(l.length),o=v(t,c);if(u&&a!=a){for(;c>o;)if((i=l[o++])!=i)return!0}else for(;c>o;o++)if((u||o in l)&&l[o]===a)return u||o||0;return!u&&-1}}},{"./_to-absolute-index":121,"./_to-iobject":123,"./_to-length":124}],63:[function(b,L,E){var A=b("./_cof"),w=b("./_wks")("toStringTag"),v=A(function(){return arguments}())=="Arguments",u=function(h,a){try{return h[a]}catch(t){}};L.exports=function(h){var a,t,i;return h===void 0?"Undefined":h===null?"Null":typeof(t=u(a=Object(h),w))=="string"?t:v?A(a):(i=A(a))=="Object"&&typeof a.callee=="function"?"Arguments":i}},{"./_cof":64,"./_wks":131}],64:[function(b,L,E){var A={}.toString;L.exports=function(w){return A.call(w).slice(8,-1)}},{}],65:[function(b,L,E){var A=L.exports={version:"2.5.7"};typeof __e=="number"&&(__e=A)},{}],66:[function(b,L,E){"use strict";var A=b("./_object-dp"),w=b("./_property-desc");L.exports=function(v,u,h){u in v?A.f(v,u,w(0,h)):v[u]=h}},{"./_object-dp":98,"./_property-desc":111}],67:[function(b,L,E){var A=b("./_a-function");L.exports=function(w,v,u){if(A(w),v===void 0)return w;switch(u){case 1:return function(h){return w.call(v,h)};case 2:return function(h,a){return w.call(v,h,a)};case 3:return function(h,a,t){return w.call(v,h,a,t)}}return function(){return w.apply(v,arguments)}}},{"./_a-function":58}],68:[function(b,L,E){L.exports=function(A){if(A==null)throw TypeError("Can't call method on "+A);return A}},{}],69:[function(b,L,E){L.exports=!b("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":74}],70:[function(b,L,E){var A=b("./_is-object"),w=b("./_global").document,v=A(w)&&A(w.createElement);L.exports=function(u){return v?w.createElement(u):{}}},{"./_global":76,"./_is-object":85}],71:[function(b,L,E){L.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],72:[function(b,L,E){var A=b("./_object-keys"),w=b("./_object-gops"),v=b("./_object-pie");L.exports=function(u){var h=A(u),a=w.f;if(a)for(var t,i=a(u),l=v.f,c=0;i.length>c;)l.call(u,t=i[c++])&&h.push(t);return h}},{"./_object-gops":103,"./_object-keys":106,"./_object-pie":107}],73:[function(b,L,E){var A=b("./_global"),w=b("./_core"),v=b("./_ctx"),u=b("./_hide"),h=b("./_has"),a=function(t,i,l){var c,o,e,s=t&a.F,r=t&a.G,d=t&a.S,f=t&a.P,g=t&a.B,m=t&a.W,p=r?w:w[i]||(w[i]={}),_=p.prototype,y=r?A:d?A[i]:(A[i]||{}).prototype;r&&(l=i);for(c in l)(o=!s&&y&&y[c]!==void 0)&&h(p,c)||(e=o?y[c]:l[c],p[c]=r&&typeof y[c]!="function"?l[c]:g&&o?v(e,A):m&&y[c]==e?function(n){var x=function(S,T,R){if(this instanceof n){switch(arguments.length){case 0:return new n;case 1:return new n(S);case 2:return new n(S,T)}return new n(S,T,R)}return n.apply(this,arguments)};return x.prototype=n.prototype,x}(e):f&&typeof e=="function"?v(Function.call,e):e,f&&((p.virtual||(p.virtual={}))[c]=e,t&a.R&&_&&!_[c]&&u(_,c,e)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,L.exports=a},{"./_core":65,"./_ctx":67,"./_global":76,"./_has":77,"./_hide":78}],74:[function(b,L,E){L.exports=function(A){try{return!!A()}catch(w){return!0}}},{}],75:[function(b,L,E){var A=b("./_ctx"),w=b("./_iter-call"),v=b("./_is-array-iter"),u=b("./_an-object"),h=b("./_to-length"),a=b("./core.get-iterator-method"),t={},i={},E=L.exports=function(l,c,o,e,s){var r,d,f,g,m=s?function(){return l}:a(l),p=A(o,e,c?2:1),_=0;if(typeof m!="function")throw TypeError(l+" is not iterable!");if(v(m)){for(r=h(l.length);r>_;_++)if((g=c?p(u(d=l[_])[0],d[1]):p(l[_]))===t||g===i)return g}else for(f=m.call(l);!(d=f.next()).done;)if((g=w(f,p,d.value,c))===t||g===i)return g};E.BREAK=t,E.RETURN=i},{"./_an-object":61,"./_ctx":67,"./_is-array-iter":83,"./_iter-call":86,"./_to-length":124,"./core.get-iterator-method":132}],76:[function(b,L,E){var A=L.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=A)},{}],77:[function(b,L,E){var A={}.hasOwnProperty;L.exports=function(w,v){return A.call(w,v)}},{}],78:[function(b,L,E){var A=b("./_object-dp"),w=b("./_property-desc");L.exports=b("./_descriptors")?function(v,u,h){return A.f(v,u,w(1,h))}:function(v,u,h){return v[u]=h,v}},{"./_descriptors":69,"./_object-dp":98,"./_property-desc":111}],79:[function(b,L,E){var A=b("./_global").document;L.exports=A&&A.documentElement},{"./_global":76}],80:[function(b,L,E){L.exports=!b("./_descriptors")&&!b("./_fails")(function(){return Object.defineProperty(b("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":69,"./_dom-create":70,"./_fails":74}],81:[function(b,L,E){L.exports=function(A,w,v){var u=v===void 0;switch(w.length){case 0:return u?A():A.call(v);case 1:return u?A(w[0]):A.call(v,w[0]);case 2:return u?A(w[0],w[1]):A.call(v,w[0],w[1]);case 3:return u?A(w[0],w[1],w[2]):A.call(v,w[0],w[1],w[2]);case 4:return u?A(w[0],w[1],w[2],w[3]):A.call(v,w[0],w[1],w[2],w[3])}return A.apply(v,w)}},{}],82:[function(b,L,E){var A=b("./_cof");L.exports=Object("z").propertyIsEnumerable(0)?Object:function(w){return A(w)=="String"?w.split(""):Object(w)}},{"./_cof":64}],83:[function(b,L,E){var A=b("./_iterators"),w=b("./_wks")("iterator"),v=Array.prototype;L.exports=function(u){return u!==void 0&&(A.Array===u||v[w]===u)}},{"./_iterators":91,"./_wks":131}],84:[function(b,L,E){var A=b("./_cof");L.exports=Array.isArray||function(w){return A(w)=="Array"}},{"./_cof":64}],85:[function(b,L,E){L.exports=function(A){return typeof A=="object"?A!==null:typeof A=="function"}},{}],86:[function(b,L,E){var A=b("./_an-object");L.exports=function(w,v,u,h){try{return h?v(A(u)[0],u[1]):v(u)}catch(t){var a=w.return;throw a!==void 0&&A(a.call(w)),t}}},{"./_an-object":61}],87:[function(b,L,E){"use strict";var A=b("./_object-create"),w=b("./_property-desc"),v=b("./_set-to-string-tag"),u={};b("./_hide")(u,b("./_wks")("iterator"),function(){return this}),L.exports=function(h,a,t){h.prototype=A(u,{next:w(1,t)}),v(h,a+" Iterator")}},{"./_hide":78,"./_object-create":97,"./_property-desc":111,"./_set-to-string-tag":115,"./_wks":131}],88:[function(b,L,E){"use strict";var A=b("./_library"),w=b("./_export"),v=b("./_redefine"),u=b("./_hide"),h=b("./_iterators"),a=b("./_iter-create"),t=b("./_set-to-string-tag"),i=b("./_object-gpo"),l=b("./_wks")("iterator"),c=!([].keys&&"next"in[].keys()),o=function(){return this};L.exports=function(e,s,r,d,f,g,m){a(r,s,d);var p,_,y,n=function(k){if(!c&&k in R)return R[k];switch(k){case"keys":case"values":return function(){return new r(this,k)}}return function(){return new r(this,k)}},x=s+" Iterator",S=f=="values",T=!1,R=e.prototype,D=R[l]||R["@@iterator"]||f&&R[f],I=D||n(f),B=f?S?n("entries"):I:void 0,G=s=="Array"&&R.entries||D;if(G&&(y=i(G.call(new e)))!==Object.prototype&&y.next&&(t(y,x,!0),A||typeof y[l]=="function"||u(y,l,o)),S&&D&&D.name!=="values"&&(T=!0,I=function(){return D.call(this)}),A&&!m||!c&&!T&&R[l]||u(R,l,I),h[s]=I,h[x]=o,f)if(p={values:S?I:n("values"),keys:g?I:n("keys"),entries:B},m)for(_ in p)_ in R||v(R,_,p[_]);else w(w.P+w.F*(c||T),s,p);return p}},{"./_export":73,"./_hide":78,"./_iter-create":87,"./_iterators":91,"./_library":92,"./_object-gpo":104,"./_redefine":113,"./_set-to-string-tag":115,"./_wks":131}],89:[function(b,L,E){var A=b("./_wks")("iterator"),w=!1;try{var v=[7][A]();v.return=function(){w=!0},Array.from(v,function(){throw 2})}catch(u){}L.exports=function(u,h){if(!h&&!w)return!1;var a=!1;try{var t=[7],i=t[A]();i.next=function(){return{done:a=!0}},t[A]=function(){return i},u(t)}catch(l){}return a}},{"./_wks":131}],90:[function(b,L,E){L.exports=function(A,w){return{value:w,done:!!A}}},{}],91:[function(b,L,E){L.exports={}},{}],92:[function(b,L,E){L.exports=!0},{}],93:[function(b,L,E){var A=b("./_uid")("meta"),w=b("./_is-object"),v=b("./_has"),u=b("./_object-dp").f,h=0,a=Object.isExtensible||function(){return!0},t=!b("./_fails")(function(){return a(Object.preventExtensions({}))}),i=function(s){u(s,A,{value:{i:"O"+ ++h,w:{}}})},l=function(s,r){if(!w(s))return typeof s=="symbol"?s:(typeof s=="string"?"S":"P")+s;if(!v(s,A)){if(!a(s))return"F";if(!r)return"E";i(s)}return s[A].i},c=function(s,r){if(!v(s,A)){if(!a(s))return!0;if(!r)return!1;i(s)}return s[A].w},o=function(s){return t&&e.NEED&&a(s)&&!v(s,A)&&i(s),s},e=L.exports={KEY:A,NEED:!1,fastKey:l,getWeak:c,onFreeze:o}},{"./_fails":74,"./_has":77,"./_is-object":85,"./_object-dp":98,"./_uid":127}],94:[function(b,L,E){var A=b("./_global"),w=b("./_task").set,v=A.MutationObserver||A.WebKitMutationObserver,u=A.process,h=A.Promise,a=b("./_cof")(u)=="process";L.exports=function(){var t,i,l,c=function(){var r,d;for(a&&(r=u.domain)&&r.exit();t;){d=t.fn,t=t.next;try{d()}catch(f){throw t?l():i=void 0,f}}i=void 0,r&&r.enter()};if(a)l=function(){u.nextTick(c)};else if(!v||A.navigator&&A.navigator.standalone)if(h&&h.resolve){var o=h.resolve(void 0);l=function(){o.then(c)}}else l=function(){w.call(A,c)};else{var e=!0,s=document.createTextNode("");new v(c).observe(s,{characterData:!0}),l=function(){s.data=e=!e}}return function(r){var d={fn:r,next:void 0};i&&(i.next=d),t||(t=d,l()),i=d}}},{"./_cof":64,"./_global":76,"./_task":120}],95:[function(b,L,E){"use strict";function A(v){var u,h;this.promise=new v(function(a,t){if(u!==void 0||h!==void 0)throw TypeError("Bad Promise constructor");u=a,h=t}),this.resolve=w(u),this.reject=w(h)}var w=b("./_a-function");L.exports.f=function(v){return new A(v)}},{"./_a-function":58}],96:[function(b,L,E){"use strict";var A=b("./_object-keys"),w=b("./_object-gops"),v=b("./_object-pie"),u=b("./_to-object"),h=b("./_iobject"),a=Object.assign;L.exports=!a||b("./_fails")(function(){var t={},i={},l=Symbol(),c="abcdefghijklmnopqrst";return t[l]=7,c.split("").forEach(function(o){i[o]=o}),a({},t)[l]!=7||Object.keys(a({},i)).join("")!=c})?function(t,i){for(var l=u(t),c=arguments.length,o=1,e=w.f,s=v.f;c>o;)for(var r,d=h(arguments[o++]),f=e?A(d).concat(e(d)):A(d),g=f.length,m=0;g>m;)s.call(d,r=f[m++])&&(l[r]=d[r]);return l}:a},{"./_fails":74,"./_iobject":82,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_to-object":125}],97:[function(b,L,E){var A=b("./_an-object"),w=b("./_object-dps"),v=b("./_enum-bug-keys"),u=b("./_shared-key")("IE_PROTO"),h=function(){},a=function(){var t,i=b("./_dom-create")("iframe"),l=v.length;for(i.style.display="none",b("./_html").appendChild(i),i.src="javascript:",t=i.contentWindow.document,t.open(),t.write("<script>document.F=Object</script>"),t.close(),a=t.F;l--;)delete a.prototype[v[l]];return a()};L.exports=Object.create||function(t,i){var l;return t!==null?(h.prototype=A(t),l=new h,h.prototype=null,l[u]=t):l=a(),i===void 0?l:w(l,i)}},{"./_an-object":61,"./_dom-create":70,"./_enum-bug-keys":71,"./_html":79,"./_object-dps":99,"./_shared-key":116}],98:[function(b,L,E){var A=b("./_an-object"),w=b("./_ie8-dom-define"),v=b("./_to-primitive"),u=Object.defineProperty;E.f=b("./_descriptors")?Object.defineProperty:function(h,a,t){if(A(h),a=v(a,!0),A(t),w)try{return u(h,a,t)}catch(i){}if("get"in t||"set"in t)throw TypeError("Accessors not supported!");return"value"in t&&(h[a]=t.value),h}},{"./_an-object":61,"./_descriptors":69,"./_ie8-dom-define":80,"./_to-primitive":126}],99:[function(b,L,E){var A=b("./_object-dp"),w=b("./_an-object"),v=b("./_object-keys");L.exports=b("./_descriptors")?Object.defineProperties:function(u,h){w(u);for(var a,t=v(h),i=t.length,l=0;i>l;)A.f(u,a=t[l++],h[a]);return u}},{"./_an-object":61,"./_descriptors":69,"./_object-dp":98,"./_object-keys":106}],100:[function(b,L,E){var A=b("./_object-pie"),w=b("./_property-desc"),v=b("./_to-iobject"),u=b("./_to-primitive"),h=b("./_has"),a=b("./_ie8-dom-define"),t=Object.getOwnPropertyDescriptor;E.f=b("./_descriptors")?t:function(i,l){if(i=v(i),l=u(l,!0),a)try{return t(i,l)}catch(c){}if(h(i,l))return w(!A.f.call(i,l),i[l])}},{"./_descriptors":69,"./_has":77,"./_ie8-dom-define":80,"./_object-pie":107,"./_property-desc":111,"./_to-iobject":123,"./_to-primitive":126}],101:[function(b,L,E){var A=b("./_to-iobject"),w=b("./_object-gopn").f,v={}.toString,u=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],h=function(a){try{return w(a)}catch(t){return u.slice()}};L.exports.f=function(a){return u&&v.call(a)=="[object Window]"?h(a):w(A(a))}},{"./_object-gopn":102,"./_to-iobject":123}],102:[function(b,L,E){var A=b("./_object-keys-internal"),w=b("./_enum-bug-keys").concat("length","prototype");E.f=Object.getOwnPropertyNames||function(v){return A(v,w)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],103:[function(b,L,E){E.f=Object.getOwnPropertySymbols},{}],104:[function(b,L,E){var A=b("./_has"),w=b("./_to-object"),v=b("./_shared-key")("IE_PROTO"),u=Object.prototype;L.exports=Object.getPrototypeOf||function(h){return h=w(h),A(h,v)?h[v]:typeof h.constructor=="function"&&h instanceof h.constructor?h.constructor.prototype:h instanceof Object?u:null}},{"./_has":77,"./_shared-key":116,"./_to-object":125}],105:[function(b,L,E){var A=b("./_has"),w=b("./_to-iobject"),v=b("./_array-includes")(!1),u=b("./_shared-key")("IE_PROTO");L.exports=function(h,a){var t,i=w(h),l=0,c=[];for(t in i)t!=u&&A(i,t)&&c.push(t);for(;a.length>l;)A(i,t=a[l++])&&(~v(c,t)||c.push(t));return c}},{"./_array-includes":62,"./_has":77,"./_shared-key":116,"./_to-iobject":123}],106:[function(b,L,E){var A=b("./_object-keys-internal"),w=b("./_enum-bug-keys");L.exports=Object.keys||function(v){return A(v,w)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],107:[function(b,L,E){E.f={}.propertyIsEnumerable},{}],108:[function(b,L,E){var A=b("./_export"),w=b("./_core"),v=b("./_fails");L.exports=function(u,h){var a=(w.Object||{})[u]||Object[u],t={};t[u]=h(a),A(A.S+A.F*v(function(){a(1)}),"Object",t)}},{"./_core":65,"./_export":73,"./_fails":74}],109:[function(b,L,E){L.exports=function(A){try{return{e:!1,v:A()}}catch(w){return{e:!0,v:w}}}},{}],110:[function(b,L,E){var A=b("./_an-object"),w=b("./_is-object"),v=b("./_new-promise-capability");L.exports=function(u,h){if(A(u),w(h)&&h.constructor===u)return h;var a=v.f(u);return(0,a.resolve)(h),a.promise}},{"./_an-object":61,"./_is-object":85,"./_new-promise-capability":95}],111:[function(b,L,E){L.exports=function(A,w){return{enumerable:!(1&A),configurable:!(2&A),writable:!(4&A),value:w}}},{}],112:[function(b,L,E){var A=b("./_hide");L.exports=function(w,v,u){for(var h in v)u&&w[h]?w[h]=v[h]:A(w,h,v[h]);return w}},{"./_hide":78}],113:[function(b,L,E){L.exports=b("./_hide")},{"./_hide":78}],114:[function(b,L,E){"use strict";var A=b("./_global"),w=b("./_core"),v=b("./_object-dp"),u=b("./_descriptors"),h=b("./_wks")("species");L.exports=function(a){var t=typeof w[a]=="function"?w[a]:A[a];u&&t&&!t[h]&&v.f(t,h,{configurable:!0,get:function(){return this}})}},{"./_core":65,"./_descriptors":69,"./_global":76,"./_object-dp":98,"./_wks":131}],115:[function(b,L,E){var A=b("./_object-dp").f,w=b("./_has"),v=b("./_wks")("toStringTag");L.exports=function(u,h,a){u&&!w(u=a?u:u.prototype,v)&&A(u,v,{configurable:!0,value:h})}},{"./_has":77,"./_object-dp":98,"./_wks":131}],116:[function(b,L,E){var A=b("./_shared")("keys"),w=b("./_uid");L.exports=function(v){return A[v]||(A[v]=w(v))}},{"./_shared":117,"./_uid":127}],117:[function(b,L,E){var A=b("./_core"),w=b("./_global"),v=w["__core-js_shared__"]||(w["__core-js_shared__"]={});(L.exports=function(u,h){return v[u]||(v[u]=h!==void 0?h:{})})("versions",[]).push({version:A.version,mode:b("./_library")?"pure":"global",copyright:"\u6F0F 2018 Denis Pushkarev (zloirock.ru)"})},{"./_core":65,"./_global":76,"./_library":92}],118:[function(b,L,E){var A=b("./_an-object"),w=b("./_a-function"),v=b("./_wks")("species");L.exports=function(u,h){var a,t=A(u).constructor;return t===void 0||(a=A(t)[v])==null?h:w(a)}},{"./_a-function":58,"./_an-object":61,"./_wks":131}],119:[function(b,L,E){var A=b("./_to-integer"),w=b("./_defined");L.exports=function(v){return function(u,h){var a,t,i=String(w(u)),l=A(h),c=i.length;return l<0||l>=c?v?"":void 0:(a=i.charCodeAt(l),a<55296||a>56319||l+1===c||(t=i.charCodeAt(l+1))<56320||t>57343?v?i.charAt(l):a:v?i.slice(l,l+2):t-56320+(a-55296<<10)+65536)}}},{"./_defined":68,"./_to-integer":122}],120:[function(b,L,E){var A,w,v,u=b("./_ctx"),h=b("./_invoke"),a=b("./_html"),t=b("./_dom-create"),i=b("./_global"),l=i.process,c=i.setImmediate,o=i.clearImmediate,e=i.MessageChannel,s=i.Dispatch,r=0,d={},f=function(){var m=+this;if(d.hasOwnProperty(m)){var p=d[m];delete d[m],p()}},g=function(m){f.call(m.data)};c&&o||(c=function(m){for(var p=[],_=1;arguments.length>_;)p.push(arguments[_++]);return d[++r]=function(){h(typeof m=="function"?m:Function(m),p)},A(r),r},o=function(m){delete d[m]},b("./_cof")(l)=="process"?A=function(m){l.nextTick(u(f,m,1))}:s&&s.now?A=function(m){s.now(u(f,m,1))}:e?(w=new e,v=w.port2,w.port1.onmessage=g,A=u(v.postMessage,v,1)):i.addEventListener&&typeof postMessage=="function"&&!i.importScripts?(A=function(m){i.postMessage(m+"","*")},i.addEventListener("message",g,!1)):A="onreadystatechange"in t("script")?function(m){a.appendChild(t("script")).onreadystatechange=function(){a.removeChild(this),f.call(m)}}:function(m){setTimeout(u(f,m,1),0)}),L.exports={set:c,clear:o}},{"./_cof":64,"./_ctx":67,"./_dom-create":70,"./_global":76,"./_html":79,"./_invoke":81}],121:[function(b,L,E){var A=b("./_to-integer"),w=Math.max,v=Math.min;L.exports=function(u,h){return u=A(u),u<0?w(u+h,0):v(u,h)}},{"./_to-integer":122}],122:[function(b,L,E){var A=Math.ceil,w=Math.floor;L.exports=function(v){return isNaN(v=+v)?0:(v>0?w:A)(v)}},{}],123:[function(b,L,E){var A=b("./_iobject"),w=b("./_defined");L.exports=function(v){return A(w(v))}},{"./_defined":68,"./_iobject":82}],124:[function(b,L,E){var A=b("./_to-integer"),w=Math.min;L.exports=function(v){return v>0?w(A(v),9007199254740991):0}},{"./_to-integer":122}],125:[function(b,L,E){var A=b("./_defined");L.exports=function(w){return Object(A(w))}},{"./_defined":68}],126:[function(b,L,E){var A=b("./_is-object");L.exports=function(w,v){if(!A(w))return w;var u,h;if(v&&typeof(u=w.toString)=="function"&&!A(h=u.call(w)))return h;if(typeof(u=w.valueOf)=="function"&&!A(h=u.call(w)))return h;if(!v&&typeof(u=w.toString)=="function"&&!A(h=u.call(w)))return h;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":85}],127:[function(b,L,E){var A=0,w=Math.random();L.exports=function(v){return"Symbol(".concat(v===void 0?"":v,")_",(++A+w).toString(36))}},{}],128:[function(b,L,E){var A=b("./_global"),w=A.navigator;L.exports=w&&w.userAgent||""},{"./_global":76}],129:[function(b,L,E){var A=b("./_global"),w=b("./_core"),v=b("./_library"),u=b("./_wks-ext"),h=b("./_object-dp").f;L.exports=function(a){var t=w.Symbol||(w.Symbol=v?{}:A.Symbol||{});a.charAt(0)=="_"||a in t||h(t,a,{value:u.f(a)})}},{"./_core":65,"./_global":76,"./_library":92,"./_object-dp":98,"./_wks-ext":130}],130:[function(b,L,E){E.f=b("./_wks")},{"./_wks":131}],131:[function(b,L,E){var A=b("./_shared")("wks"),w=b("./_uid"),v=b("./_global").Symbol,u=typeof v=="function";(L.exports=function(h){return A[h]||(A[h]=u&&v[h]||(u?v:w)("Symbol."+h))}).store=A},{"./_global":76,"./_shared":117,"./_uid":127}],132:[function(b,L,E){var A=b("./_classof"),w=b("./_wks")("iterator"),v=b("./_iterators");L.exports=b("./_core").getIteratorMethod=function(u){if(u!=null)return u[w]||u["@@iterator"]||v[A(u)]}},{"./_classof":63,"./_core":65,"./_iterators":91,"./_wks":131}],133:[function(b,L,E){"use strict";var A=b("./_ctx"),w=b("./_export"),v=b("./_to-object"),u=b("./_iter-call"),h=b("./_is-array-iter"),a=b("./_to-length"),t=b("./_create-property"),i=b("./core.get-iterator-method");w(w.S+w.F*!b("./_iter-detect")(function(l){Array.from(l)}),"Array",{from:function(l){var c,o,e,s,r=v(l),d=typeof this=="function"?this:Array,f=arguments.length,g=f>1?arguments[1]:void 0,m=g!==void 0,p=0,_=i(r);if(m&&(g=A(g,f>2?arguments[2]:void 0,2)),_==null||d==Array&&h(_))for(c=a(r.length),o=new d(c);c>p;p++)t(o,p,m?g(r[p],p):r[p]);else for(s=_.call(r),o=new d;!(e=s.next()).done;p++)t(o,p,m?u(s,g,[e.value,p],!0):e.value);return o.length=p,o}})},{"./_create-property":66,"./_ctx":67,"./_export":73,"./_is-array-iter":83,"./_iter-call":86,"./_iter-detect":89,"./_to-length":124,"./_to-object":125,"./core.get-iterator-method":132}],134:[function(b,L,E){"use strict";var A=b("./_add-to-unscopables"),w=b("./_iter-step"),v=b("./_iterators"),u=b("./_to-iobject");L.exports=b("./_iter-define")(Array,"Array",function(h,a){this._t=u(h),this._i=0,this._k=a},function(){var h=this._t,a=this._k,t=this._i++;return!h||t>=h.length?(this._t=void 0,w(1)):a=="keys"?w(0,t):a=="values"?w(0,h[t]):w(0,[t,h[t]])},"values"),v.Arguments=v.Array,A("keys"),A("values"),A("entries")},{"./_add-to-unscopables":59,"./_iter-define":88,"./_iter-step":90,"./_iterators":91,"./_to-iobject":123}],135:[function(b,L,E){"use strict";var A=b("./_is-object"),w=b("./_object-gpo"),v=b("./_wks")("hasInstance"),u=Function.prototype;v in u||b("./_object-dp").f(u,v,{value:function(h){if(typeof this!="function"||!A(h))return!1;if(!A(this.prototype))return h instanceof this;for(;h=w(h);)if(this.prototype===h)return!0;return!1}})},{"./_is-object":85,"./_object-dp":98,"./_object-gpo":104,"./_wks":131}],136:[function(b,L,E){var A=b("./_export");A(A.S+A.F,"Object",{assign:b("./_object-assign")})},{"./_export":73,"./_object-assign":96}],137:[function(b,L,E){var A=b("./_export");A(A.S,"Object",{create:b("./_object-create")})},{"./_export":73,"./_object-create":97}],138:[function(b,L,E){var A=b("./_export");A(A.S+A.F*!b("./_descriptors"),"Object",{defineProperty:b("./_object-dp").f})},{"./_descriptors":69,"./_export":73,"./_object-dp":98}],139:[function(b,L,E){b("./_object-sap")("getOwnPropertyNames",function(){return b("./_object-gopn-ext").f})},{"./_object-gopn-ext":101,"./_object-sap":108}],140:[function(b,L,E){var A=b("./_to-object"),w=b("./_object-gpo");b("./_object-sap")("getPrototypeOf",function(){return function(v){return w(A(v))}})},{"./_object-gpo":104,"./_object-sap":108,"./_to-object":125}],141:[function(b,L,E){var A=b("./_to-object"),w=b("./_object-keys");b("./_object-sap")("keys",function(){return function(v){return w(A(v))}})},{"./_object-keys":106,"./_object-sap":108,"./_to-object":125}],142:[function(b,L,E){arguments[4][36][0].apply(E,arguments)},{dup:36}],143:[function(b,L,E){"use strict";var A,w,v,u,h=b("./_library"),a=b("./_global"),t=b("./_ctx"),i=b("./_classof"),l=b("./_export"),c=b("./_is-object"),o=b("./_a-function"),e=b("./_an-instance"),s=b("./_for-of"),r=b("./_species-constructor"),d=b("./_task").set,f=b("./_microtask")(),g=b("./_new-promise-capability"),m=b("./_perform"),p=b("./_user-agent"),_=b("./_promise-resolve"),y=a.TypeError,n=a.process,x=n&&n.versions,S=x&&x.v8||"",T=a.Promise,R=i(n)=="process",D=function(){},I=w=g.f,B=!!function(){try{var q=T.resolve(1),ee=(q.constructor={})[b("./_wks")("species")]=function(fe){fe(D,D)};return(R||typeof PromiseRejectionEvent=="function")&&q.then(D)instanceof ee&&S.indexOf("6.6")!==0&&p.indexOf("Chrome/66")===-1}catch(fe){}}(),G=function(q){var ee;return!(!c(q)||typeof(ee=q.then)!="function")&&ee},k=function(q,ee){if(!q._n){q._n=!0;var fe=q._c;f(function(){for(var ae=q._v,pe=q._s==1,se=0;fe.length>se;)!function(ge){var ie,te,Q,me=pe?ge.ok:ge.fail,re=ge.resolve,J=ge.reject,be=ge.domain;try{me?(pe||(q._h==2&&V(q),q._h=1),me===!0?ie=ae:(be&&be.enter(),ie=me(ae),be&&(be.exit(),Q=!0)),ie===ge.promise?J(y("Promise-chain cycle")):(te=G(ie))?te.call(ie,re,J):re(ie)):J(ae)}catch(Ee){be&&!Q&&be.exit(),J(Ee)}}(fe[se++]);q._c=[],q._n=!1,ee&&!q._h&&$(q)})}},$=function(q){d.call(a,function(){var ee,fe,ae,pe=q._v,se=X(q);if(se&&(ee=m(function(){R?n.emit("unhandledRejection",pe,q):(fe=a.onunhandledrejection)?fe({promise:q,reason:pe}):(ae=a.console)&&ae.error&&ae.error("Unhandled promise rejection",pe)}),q._h=R||X(q)?2:1),q._a=void 0,se&&ee.e)throw ee.v})},X=function(q){return q._h!==1&&(q._a||q._c).length===0},V=function(q){d.call(a,function(){var ee;R?n.emit("rejectionHandled",q):(ee=a.onrejectionhandled)&&ee({promise:q,reason:q._v})})},N=function(q){var ee=this;ee._d||(ee._d=!0,ee=ee._w||ee,ee._v=q,ee._s=2,ee._a||(ee._a=ee._c.slice()),k(ee,!0))},z=function(q){var ee,fe=this;if(!fe._d){fe._d=!0,fe=fe._w||fe;try{if(fe===q)throw y("Promise can't be resolved itself");(ee=G(q))?f(function(){var ae={_w:fe,_d:!1};try{ee.call(q,t(z,ae,1),t(N,ae,1))}catch(pe){N.call(ae,pe)}}):(fe._v=q,fe._s=1,k(fe,!1))}catch(ae){N.call({_w:fe,_d:!1},ae)}}};B||(T=function(q){e(this,T,"Promise","_h"),o(q),A.call(this);try{q(t(z,this,1),t(N,this,1))}catch(ee){N.call(this,ee)}},A=function(q){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},A.prototype=b("./_redefine-all")(T.prototype,{then:function(q,ee){var fe=I(r(this,T));return fe.ok=typeof q!="function"||q,fe.fail=typeof ee=="function"&&ee,fe.domain=R?n.domain:void 0,this._c.push(fe),this._a&&this._a.push(fe),this._s&&k(this,!1),fe.promise},catch:function(q){return this.then(void 0,q)}}),v=function(){var q=new A;this.promise=q,this.resolve=t(z,q,1),this.reject=t(N,q,1)},g.f=I=function(q){return q===T||q===u?new v(q):w(q)}),l(l.G+l.W+l.F*!B,{Promise:T}),b("./_set-to-string-tag")(T,"Promise"),b("./_set-species")("Promise"),u=b("./_core").Promise,l(l.S+l.F*!B,"Promise",{reject:function(q){var ee=I(this);return(0,ee.reject)(q),ee.promise}}),l(l.S+l.F*(h||!B),"Promise",{resolve:function(q){return _(h&&this===u?T:this,q)}}),l(l.S+l.F*!(B&&b("./_iter-detect")(function(q){T.all(q).catch(D)})),"Promise",{all:function(q){var ee=this,fe=I(ee),ae=fe.resolve,pe=fe.reject,se=m(function(){var ge=[],ie=0,te=1;s(q,!1,function(Q){var me=ie++,re=!1;ge.push(void 0),te++,ee.resolve(Q).then(function(J){re||(re=!0,ge[me]=J,--te||ae(ge))},pe)}),--te||ae(ge)});return se.e&&pe(se.v),fe.promise},race:function(q){var ee=this,fe=I(ee),ae=fe.reject,pe=m(function(){s(q,!1,function(se){ee.resolve(se).then(fe.resolve,ae)})});return pe.e&&ae(pe.v),fe.promise}})},{"./_a-function":58,"./_an-instance":60,"./_classof":63,"./_core":65,"./_ctx":67,"./_export":73,"./_for-of":75,"./_global":76,"./_is-object":85,"./_iter-detect":89,"./_library":92,"./_microtask":94,"./_new-promise-capability":95,"./_perform":109,"./_promise-resolve":110,"./_redefine-all":112,"./_set-species":114,"./_set-to-string-tag":115,"./_species-constructor":118,"./_task":120,"./_user-agent":128,"./_wks":131}],144:[function(b,L,E){var A=b("./_export"),w=b("./_to-absolute-index"),v=String.fromCharCode,u=String.fromCodePoint;A(A.S+A.F*(!!u&&u.length!=1),"String",{fromCodePoint:function(h){for(var a,t=[],i=arguments.length,l=0;i>l;){if(a=+arguments[l++],w(a,1114111)!==a)throw RangeError(a+" is not a valid code point");t.push(a<65536?v(a):v(55296+((a-=65536)>>10),a%1024+56320))}return t.join("")}})},{"./_export":73,"./_to-absolute-index":121}],145:[function(b,L,E){"use strict";var A=b("./_string-at")(!0);b("./_iter-define")(String,"String",function(w){this._t=String(w),this._i=0},function(){var w,v=this._t,u=this._i;return u>=v.length?{value:void 0,done:!0}:(w=A(v,u),this._i+=w.length,{value:w,done:!1})})},{"./_iter-define":88,"./_string-at":119}],146:[function(b,L,E){"use strict";var A=b("./_global"),w=b("./_has"),v=b("./_descriptors"),u=b("./_export"),h=b("./_redefine"),a=b("./_meta").KEY,t=b("./_fails"),i=b("./_shared"),l=b("./_set-to-string-tag"),c=b("./_uid"),o=b("./_wks"),e=b("./_wks-ext"),s=b("./_wks-define"),r=b("./_enum-keys"),d=b("./_is-array"),f=b("./_an-object"),g=b("./_is-object"),m=b("./_to-iobject"),p=b("./_to-primitive"),_=b("./_property-desc"),y=b("./_object-create"),n=b("./_object-gopn-ext"),x=b("./_object-gopd"),S=b("./_object-dp"),T=b("./_object-keys"),R=x.f,D=S.f,I=n.f,B=A.Symbol,G=A.JSON,k=G&&G.stringify,$=o("_hidden"),X=o("toPrimitive"),V={}.propertyIsEnumerable,N=i("symbol-registry"),z=i("symbols"),q=i("op-symbols"),ee=Object.prototype,fe=typeof B=="function",ae=A.QObject,pe=!ae||!ae.prototype||!ae.prototype.findChild,se=v&&t(function(){return y(D({},"a",{get:function(){return D(this,"a",{value:7}).a}})).a!=7})?function(j,M,F){var oe=R(ee,M);oe&&delete ee[M],D(j,M,F),oe&&j!==ee&&D(ee,M,oe)}:D,ge=function(j){var M=z[j]=y(B.prototype);return M._k=j,M},ie=fe&&typeof B.iterator=="symbol"?function(j){return typeof j=="symbol"}:function(j){return j instanceof B},te=function(j,M,F){return j===ee&&te(q,M,F),f(j),M=p(M,!0),f(F),w(z,M)?(F.enumerable?(w(j,$)&&j[$][M]&&(j[$][M]=!1),F=y(F,{enumerable:_(0,!1)})):(w(j,$)||D(j,$,_(1,{})),j[$][M]=!0),se(j,M,F)):D(j,M,F)},Q=function(j,M){f(j);for(var F,oe=r(M=m(M)),ve=0,ke=oe.length;ke>ve;)te(j,F=oe[ve++],M[F]);return j},me=function(j,M){return M===void 0?y(j):Q(y(j),M)},re=function(j){var M=V.call(this,j=p(j,!0));return!(this===ee&&w(z,j)&&!w(q,j))&&(!(M||!w(this,j)||!w(z,j)||w(this,$)&&this[$][j])||M)},J=function(j,M){if(j=m(j),M=p(M,!0),j!==ee||!w(z,M)||w(q,M)){var F=R(j,M);return!F||!w(z,M)||w(j,$)&&j[$][M]||(F.enumerable=!0),F}},be=function(j){for(var M,F=I(m(j)),oe=[],ve=0;F.length>ve;)w(z,M=F[ve++])||M==$||M==a||oe.push(M);return oe},Ee=function(j){for(var M,F=j===ee,oe=I(F?q:m(j)),ve=[],ke=0;oe.length>ke;)!w(z,M=oe[ke++])||F&&!w(ee,M)||ve.push(z[M]);return ve};fe||(B=function(){if(this instanceof B)throw TypeError("Symbol is not a constructor!");var j=c(arguments.length>0?arguments[0]:void 0),M=function(F){this===ee&&M.call(q,F),w(this,$)&&w(this[$],j)&&(this[$][j]=!1),se(this,j,_(1,F))};return v&&pe&&se(ee,j,{configurable:!0,set:M}),ge(j)},h(B.prototype,"toString",function(){return this._k}),x.f=J,S.f=te,b("./_object-gopn").f=n.f=be,b("./_object-pie").f=re,b("./_object-gops").f=Ee,v&&!b("./_library")&&h(ee,"propertyIsEnumerable",re,!0),e.f=function(j){return ge(o(j))}),u(u.G+u.W+u.F*!fe,{Symbol:B});for(var Le="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),H=0;Le.length>H;)o(Le[H++]);for(var C=T(o.store),O=0;C.length>O;)s(C[O++]);u(u.S+u.F*!fe,"Symbol",{for:function(j){return w(N,j+="")?N[j]:N[j]=B(j)},keyFor:function(j){if(!ie(j))throw TypeError(j+" is not a symbol!");for(var M in N)if(N[M]===j)return M},useSetter:function(){pe=!0},useSimple:function(){pe=!1}}),u(u.S+u.F*!fe,"Object",{create:me,defineProperty:te,defineProperties:Q,getOwnPropertyDescriptor:J,getOwnPropertyNames:be,getOwnPropertySymbols:Ee}),G&&u(u.S+u.F*(!fe||t(function(){var j=B();return k([j])!="[null]"||k({a:j})!="{}"||k(Object(j))!="{}"})),"JSON",{stringify:function(j){for(var M,F,oe=[j],ve=1;arguments.length>ve;)oe.push(arguments[ve++]);if(F=M=oe[1],(g(M)||j!==void 0)&&!ie(j))return d(M)||(M=function(ke,Oe){if(typeof F=="function"&&(Oe=F.call(this,ke,Oe)),!ie(Oe))return Oe}),oe[1]=M,k.apply(G,oe)}}),B.prototype[X]||b("./_hide")(B.prototype,X,B.prototype.valueOf),l(B,"Symbol"),l(Math,"Math",!0),l(A.JSON,"JSON",!0)},{"./_an-object":61,"./_descriptors":69,"./_enum-keys":72,"./_export":73,"./_fails":74,"./_global":76,"./_has":77,"./_hide":78,"./_is-array":84,"./_is-object":85,"./_library":92,"./_meta":93,"./_object-create":97,"./_object-dp":98,"./_object-gopd":100,"./_object-gopn":102,"./_object-gopn-ext":101,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_property-desc":111,"./_redefine":113,"./_set-to-string-tag":115,"./_shared":117,"./_to-iobject":123,"./_to-primitive":126,"./_uid":127,"./_wks":131,"./_wks-define":129,"./_wks-ext":130}],147:[function(b,L,E){"use strict";var A=b("./_export"),w=b("./_core"),v=b("./_global"),u=b("./_species-constructor"),h=b("./_promise-resolve");A(A.P+A.R,"Promise",{finally:function(a){var t=u(this,w.Promise||v.Promise),i=typeof a=="function";return this.then(i?function(l){return h(t,a()).then(function(){return l})}:a,i?function(l){return h(t,a()).then(function(){throw l})}:a)}})},{"./_core":65,"./_export":73,"./_global":76,"./_promise-resolve":110,"./_species-constructor":118}],148:[function(b,L,E){"use strict";var A=b("./_export"),w=b("./_new-promise-capability"),v=b("./_perform");A(A.S,"Promise",{try:function(u){var h=w.f(this),a=v(u);return(a.e?h.reject:h.resolve)(a.v),h.promise}})},{"./_export":73,"./_new-promise-capability":95,"./_perform":109}],149:[function(b,L,E){b("./_wks-define")("asyncIterator")},{"./_wks-define":129}],150:[function(b,L,E){b("./_wks-define")("observable")},{"./_wks-define":129}],151:[function(b,L,E){b("./es6.array.iterator");for(var A=b("./_global"),w=b("./_hide"),v=b("./_iterators"),u=b("./_wks")("toStringTag"),h="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),a=0;a<h.length;a++){var t=h[a],i=A[t],l=i&&i.prototype;l&&!l[u]&&w(l,u,t),v[t]=v.Array}},{"./_global":76,"./_hide":78,"./_iterators":91,"./_wks":131,"./es6.array.iterator":134}],152:[function(b,L,E){var A=b("./_export"),w=b("./_task");A(A.G+A.B,{setImmediate:w.set,clearImmediate:w.clear})},{"./_export":73,"./_task":120}],153:[function(b,L,E){(function(A){"use strict";function w(p){return Array.isArray?Array.isArray(p):f(p)==="[object Array]"}function v(p){return typeof p=="boolean"}function u(p){return p===null}function h(p){return p==null}function a(p){return typeof p=="number"}function t(p){return typeof p=="string"}function i(p){return(p===void 0?"undefined":(0,m.default)(p))==="symbol"}function l(p){return p===void 0}function c(p){return f(p)==="[object RegExp]"}function o(p){return(p===void 0?"undefined":(0,m.default)(p))==="object"&&p!==null}function e(p){return f(p)==="[object Date]"}function s(p){return f(p)==="[object Error]"||p instanceof Error}function r(p){return typeof p=="function"}function d(p){return p===null||typeof p=="boolean"||typeof p=="number"||typeof p=="string"||(p===void 0?"undefined":(0,m.default)(p))==="symbol"||p===void 0}function f(p){return Object.prototype.toString.call(p)}var g=b("babel-runtime/helpers/typeof"),m=function(p){return p&&p.__esModule?p:{default:p}}(g);E.isArray=w,E.isBoolean=v,E.isNull=u,E.isNullOrUndefined=h,E.isNumber=a,E.isString=t,E.isSymbol=i,E.isUndefined=l,E.isRegExp=c,E.isObject=o,E.isDate=e,E.isError=s,E.isFunction=r,E.isPrimitive=d,E.isBuffer=A.isBuffer}).call(this,{isBuffer:b("../../is-buffer/index.js")})},{"../../is-buffer/index.js":163,"babel-runtime/helpers/typeof":32}],154:[function(b,L,E){"use strict";var A=b("babel-runtime/helpers/typeof"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);!function(v){function u(l,c){for(l=String(l),c=c||2;l.length<c;)l="0"+l;return l}function h(l){var c=new Date(l.getFullYear(),l.getMonth(),l.getDate());c.setDate(c.getDate()-(c.getDay()+6)%7+3);var o=new Date(c.getFullYear(),0,4);o.setDate(o.getDate()-(o.getDay()+6)%7+3);var e=c.getTimezoneOffset()-o.getTimezoneOffset();c.setHours(c.getHours()-e);var s=(c-o)/6048e5;return 1+Math.floor(s)}function a(l){var c=l.getDay();return c===0&&(c=7),c}function t(l){return l===null?"null":l===void 0?"undefined":(l===void 0?"undefined":(0,w.default)(l))!=="object"?l===void 0?"undefined":(0,w.default)(l):Array.isArray(l)?"array":{}.toString.call(l).slice(8,-1).toLowerCase()}var i=function(){var l=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,c=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,o=/[^-+\dA-Z]/g;return function(e,s,r,d){if(arguments.length!==1||t(e)!=="string"||/\d/.test(e)||(s=e,e=void 0),e=e||new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");s=String(i.masks[s]||s||i.masks.default);var f=s.slice(0,4);f!=="UTC:"&&f!=="GMT:"||(s=s.slice(4),r=!0,f==="GMT:"&&(d=!0));var g=r?"getUTC":"get",m=e[g+"Date"](),p=e[g+"Day"](),_=e[g+"Month"](),y=e[g+"FullYear"](),n=e[g+"Hours"](),x=e[g+"Minutes"](),S=e[g+"Seconds"](),T=e[g+"Milliseconds"](),R=r?0:e.getTimezoneOffset(),D=h(e),I=a(e),B={d:m,dd:u(m),ddd:i.i18n.dayNames[p],dddd:i.i18n.dayNames[p+7],m:_+1,mm:u(_+1),mmm:i.i18n.monthNames[_],mmmm:i.i18n.monthNames[_+12],yy:String(y).slice(2),yyyy:y,h:n%12||12,hh:u(n%12||12),H:n,HH:u(n),M:x,MM:u(x),s:S,ss:u(S),l:u(T,3),L:u(Math.round(T/10)),t:n<12?"a":"p",tt:n<12?"am":"pm",T:n<12?"A":"P",TT:n<12?"AM":"PM",Z:d?"GMT":r?"UTC":(String(e).match(c)||[""]).pop().replace(o,""),o:(R>0?"-":"+")+u(100*Math.floor(Math.abs(R)/60)+Math.abs(R)%60,4),S:["th","st","nd","rd"][m%10>3?0:(m%100-m%10!=10)*m%10],W:D,N:I};return s.replace(l,function(G){return G in B?B[G]:G.slice(1,G.length-1)})}}();i.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},i.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},typeof U=="function"&&U.amd?U(function(){return i}):(E===void 0?"undefined":(0,w.default)(E))==="object"?L.exports=i:v.dateFormat=i}(void 0)},{"babel-runtime/helpers/typeof":32}],155:[function(b,L,E){(function(A){function w(){return!(typeof window=="undefined"||!window.process||window.process.type!=="renderer")||typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function v(t){var i=this.useColors;if(t[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+t[0]+(i?"%c ":" ")+"+"+E.humanize(this.diff),i){var l="color: "+this.color;t.splice(1,0,l,"color: inherit");var c=0,o=0;t[0].replace(/%[a-zA-Z%]/g,function(e){e!=="%%"&&(c++,e==="%c"&&(o=c))}),t.splice(o,0,l)}}function u(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function h(t){try{t==null?E.storage.removeItem("debug"):E.storage.debug=t}catch(i){}}function a(){var t;try{t=E.storage.debug}catch(i){}return!t&&A!==void 0&&"env"in A&&(t=A.env.DEBUG),t}E=L.exports=b("./debug"),E.log=u,E.formatArgs=v,E.save=h,E.load=a,E.useColors=w,E.storage=typeof chrome!="undefined"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),E.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],E.formatters.j=function(t){try{return JSON.stringify(t)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}},E.enable(a())}).call(this,b("_process"))},{"./debug":156,_process:173}],156:[function(b,L,E){function A(i){var l,c=0;for(l in i)c=(c<<5)-c+i.charCodeAt(l),c|=0;return E.colors[Math.abs(c)%E.colors.length]}function w(i){function l(){if(l.enabled){var c=l,o=+new Date,e=o-(t||o);c.diff=e,c.prev=t,c.curr=o,t=o;for(var s=new Array(arguments.length),r=0;r<s.length;r++)s[r]=arguments[r];s[0]=E.coerce(s[0]),typeof s[0]!="string"&&s.unshift("%O");var d=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(f,g){if(f==="%%")return f;d++;var m=E.formatters[g];if(typeof m=="function"){var p=s[d];f=m.call(c,p),s.splice(d,1),d--}return f}),E.formatArgs.call(c,s),(l.log||E.log||console.log.bind(console)).apply(c,s)}}return l.namespace=i,l.enabled=E.enabled(i),l.useColors=E.useColors(),l.color=A(i),typeof E.init=="function"&&E.init(l),l}function v(i){E.save(i),E.names=[],E.skips=[];for(var l=(typeof i=="string"?i:"").split(/[\s,]+/),c=l.length,o=0;o<c;o++)l[o]&&(i=l[o].replace(/\*/g,".*?"),i[0]==="-"?E.skips.push(new RegExp("^"+i.substr(1)+"$")):E.names.push(new RegExp("^"+i+"$")))}function u(){E.enable("")}function h(i){var l,c;for(l=0,c=E.skips.length;l<c;l++)if(E.skips[l].test(i))return!1;for(l=0,c=E.names.length;l<c;l++)if(E.names[l].test(i))return!0;return!1}function a(i){return i instanceof Error?i.stack||i.message:i}E=L.exports=w.debug=w.default=w,E.coerce=a,E.disable=u,E.enable=v,E.enabled=h,E.humanize=b("ms"),E.names=[],E.skips=[],E.formatters={};var t},{ms:169}],157:[function(b,L,E){"use strict";function A(v){var u=""+v,h=w.exec(u);if(!h)return u;var a,t="",i=0,l=0;for(i=h.index;i<u.length;i++){switch(u.charCodeAt(i)){case 34:a="&quot;";break;case 38:a="&amp;";break;case 39:a="&#39;";break;case 60:a="&lt;";break;case 62:a="&gt;";break;default:continue}l!==i&&(t+=u.substring(l,i)),l=i+1,t+=a}return l!==i?t+u.substring(l,i):t}var w=/["'&<>]/;L.exports=A},{}],158:[function(b,L,E){function A(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function w(a){return typeof a=="function"}function v(a){return typeof a=="number"}function u(a){return typeof a=="object"&&a!==null}function h(a){return a===void 0}L.exports=A,A.EventEmitter=A,A.prototype._events=void 0,A.prototype._maxListeners=void 0,A.defaultMaxListeners=10,A.prototype.setMaxListeners=function(a){if(!v(a)||a<0||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},A.prototype.emit=function(a){var t,i,l,c,o,e;if(this._events||(this._events={}),a==="error"&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(i=this._events[a],h(i))return!1;if(w(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:c=Array.prototype.slice.call(arguments,1),i.apply(this,c)}else if(u(i))for(c=Array.prototype.slice.call(arguments,1),e=i.slice(),l=e.length,o=0;o<l;o++)e[o].apply(this,c);return!0},A.prototype.addListener=function(a,t){var i;if(!w(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,w(t.listener)?t.listener:t),this._events[a]?u(this._events[a])?this._events[a].push(t):this._events[a]=[this._events[a],t]:this._events[a]=t,u(this._events[a])&&!this._events[a].warned&&(i=h(this._maxListeners)?A.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[a].length>i&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),typeof console.trace=="function"&&console.trace()),this},A.prototype.on=A.prototype.addListener,A.prototype.once=function(a,t){function i(){this.removeListener(a,i),l||(l=!0,t.apply(this,arguments))}if(!w(t))throw TypeError("listener must be a function");var l=!1;return i.listener=t,this.on(a,i),this},A.prototype.removeListener=function(a,t){var i,l,c,o;if(!w(t))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(i=this._events[a],c=i.length,l=-1,i===t||w(i.listener)&&i.listener===t)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,t);else if(u(i)){for(o=c;o-- >0;)if(i[o]===t||i[o].listener&&i[o].listener===t){l=o;break}if(l<0)return this;i.length===1?(i.length=0,delete this._events[a]):i.splice(l,1),this._events.removeListener&&this.emit("removeListener",a,t)}return this},A.prototype.removeAllListeners=function(a){var t,i;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[a]&&delete this._events[a],this;if(arguments.length===0){for(t in this._events)t!=="removeListener"&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(i=this._events[a],w(i))this.removeListener(a,i);else if(i)for(;i.length;)this.removeListener(a,i[i.length-1]);return delete this._events[a],this},A.prototype.listeners=function(a){return this._events&&this._events[a]?w(this._events[a])?[this._events[a]]:this._events[a].slice():[]},A.prototype.listenerCount=function(a){if(this._events){var t=this._events[a];if(w(t))return 1;if(t)return t.length}return 0},A.listenerCount=function(a,t){return a.listenerCount(t)}},{}],159:[function(b,L,E){var A=b("http"),w=L.exports;for(var v in A)A.hasOwnProperty(v)&&(w[v]=A[v]);w.request=function(u,h){return u||(u={}),u.scheme="https",u.protocol="https:",A.request.call(this,u,h)}},{http:196}],160:[function(b,L,E){"use strict";var A=b("util"),w=b("ms");L.exports=function(v){if(typeof v=="number")return v;var u=w(v);if(u===void 0){var h=new Error(A.format("humanize-ms(%j) result undefined",v));console.warn(h.stack)}return u}},{ms:169,util:207}],161:[function(b,L,E){E.read=function(A,w,v,u,h){var a,t,i=8*h-u-1,l=(1<<i)-1,c=l>>1,o=-7,e=v?h-1:0,s=v?-1:1,r=A[w+e];for(e+=s,a=r&(1<<-o)-1,r>>=-o,o+=i;o>0;a=256*a+A[w+e],e+=s,o-=8);for(t=a&(1<<-o)-1,a>>=-o,o+=u;o>0;t=256*t+A[w+e],e+=s,o-=8);if(a===0)a=1-c;else{if(a===l)return t?NaN:1/0*(r?-1:1);t+=Math.pow(2,u),a-=c}return(r?-1:1)*t*Math.pow(2,a-u)},E.write=function(A,w,v,u,h,a){var t,i,l,c=8*a-h-1,o=(1<<c)-1,e=o>>1,s=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,r=u?0:a-1,d=u?1:-1,f=w<0||w===0&&1/w<0?1:0;for(w=Math.abs(w),isNaN(w)||w===1/0?(i=isNaN(w)?1:0,t=o):(t=Math.floor(Math.log(w)/Math.LN2),w*(l=Math.pow(2,-t))<1&&(t--,l*=2),w+=t+e>=1?s/l:s*Math.pow(2,1-e),w*l>=2&&(t++,l/=2),t+e>=o?(i=0,t=o):t+e>=1?(i=(w*l-1)*Math.pow(2,h),t+=e):(i=w*Math.pow(2,e-1)*Math.pow(2,h),t=0));h>=8;A[v+r]=255&i,r+=d,i/=256,h-=8);for(t=t<<h|i,c+=h;c>0;A[v+r]=255&t,r+=d,t/=256,c-=8);A[v+r-d]|=128*f}},{}],162:[function(b,L,E){typeof Object.create=="function"?L.exports=function(A,w){A.super_=w,A.prototype=Object.create(w.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}})}:L.exports=function(A,w){A.super_=w;var v=function(){};v.prototype=w.prototype,A.prototype=new v,A.prototype.constructor=A}},{}],163:[function(b,L,E){function A(v){return!!v.constructor&&typeof v.constructor.isBuffer=="function"&&v.constructor.isBuffer(v)}function w(v){return typeof v.readFloatLE=="function"&&typeof v.slice=="function"&&A(v.slice(0,0))}L.exports=function(v){return v!=null&&(A(v)||w(v)||!!v._isBuffer)}},{}],164:[function(b,L,E){!function(A){function w(h){return u.call(h).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}function v(h){return typeof h=="function"&&(/^class(\s|\{\}$)/.test(u.call(h))||/^.*classCallCheck\(/.test(w(h)))}var u=Function.prototype.toString;E!==void 0?(L!==void 0&&L.exports&&(E=L.exports=v),E.isClass=v):typeof U=="function"&&U.amd?U([],function(){return v}):A.isClass=v}(this)},{}],165:[function(b,L,E){"use strict";function A(a){var t=a.slice(2);return t=t[0].toLowerCase()+t.slice(1)}var w=b("core-util-is"),v=b("isstream"),u=b("is-class");Object.keys(w).map(function(a){E[A(a)]=w[a]}),E.stream=v,E.readableStream=v.isReadable,E.writableStream=v.isWritable,E.duplexStream=v.isDuplex,E.class=u,E.finite=function(a){return Number.isFinite(a)},E.NaN=function(a){return Number.isNaN(a)},E.generator=function(a){return a&&typeof a.next=="function"&&typeof a.throw=="function"},E.generatorFunction=function(a){return a&&a.constructor&&a.constructor.name==="GeneratorFunction"},E.asyncFunction=function(a){return a&&a.constructor&&a.constructor.name==="AsyncFunction"},E.promise=function(a){return a&&typeof a.then=="function"};var h=Math.pow(2,31);E.int=function(a){return w.isNumber(a)&&a%1==0},E.int32=function(a){return E.int(a)&&a<h&&a>=-h},E.long=function(a){return E.int(a)&&(a>=h||a<-h)},E.Long=function(a){return E.object(a)&&E.number(a.high)&&E.number(a.low)},E.double=function(a){return w.isNumber(a)&&!isNaN(a)&&a%1!=0},E.date=function(a){return a instanceof Date},E.regExp=function(a){return a instanceof RegExp},E.regexp=E.regExp,E.error=function(a){return a instanceof Error},E.array=function(a){return Array.isArray(a)}},{"core-util-is":153,"is-class":164,isstream:167}],166:[function(b,L,E){var A={}.toString;L.exports=Array.isArray||function(w){return A.call(w)=="[object Array]"}},{}],167:[function(b,L,E){function A(a){return a instanceof h.Stream}function w(a){return A(a)&&typeof a._read=="function"&&typeof a._readableState=="object"}function v(a){return A(a)&&typeof a._write=="function"&&typeof a._writableState=="object"}function u(a){return w(a)&&v(a)}var h=b("stream");L.exports=A,L.exports.isReadable=w,L.exports.isWritable=v,L.exports.isDuplex=u},{stream:195}],168:[function(b,L,E){"use strict";function A(v,u,h){if(!v)throw new TypeError("argument dest is required");if(!u)throw new TypeError("argument src is required");return h===void 0&&(h=!0),Object.getOwnPropertyNames(u).forEach(function(a){if(h||!w.call(v,a)){var t=Object.getOwnPropertyDescriptor(u,a);Object.defineProperty(v,a,t)}}),v}L.exports=A;var w=Object.prototype.hasOwnProperty},{}],169:[function(b,L,E){function A(c){if(c=String(c),!(c.length>100)){var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(c);if(o){var e=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return e*l;case"days":case"day":case"d":return e*i;case"hours":case"hour":case"hrs":case"hr":case"h":return e*t;case"minutes":case"minute":case"mins":case"min":case"m":return e*a;case"seconds":case"second":case"secs":case"sec":case"s":return e*h;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}function w(c){return c>=i?Math.round(c/i)+"d":c>=t?Math.round(c/t)+"h":c>=a?Math.round(c/a)+"m":c>=h?Math.round(c/h)+"s":c+"ms"}function v(c){return u(c,i,"day")||u(c,t,"hour")||u(c,a,"minute")||u(c,h,"second")||c+" ms"}function u(c,o,e){if(!(c<o))return c<1.5*o?Math.floor(c/o)+" "+e:Math.ceil(c/o)+" "+e+"s"}var h=1e3,a=60*h,t=60*a,i=24*t,l=365.25*i;L.exports=function(c,o){o=o||{};var e=typeof c;if(e==="string"&&c.length>0)return A(c);if(e==="number"&&isNaN(c)===!1)return o.long?v(c):w(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))}},{}],170:[function(b,L,E){(function(A){function w(a,t){for(var i=0,l=a.length-1;l>=0;l--){var c=a[l];c==="."?a.splice(l,1):c===".."?(a.splice(l,1),i++):i&&(a.splice(l,1),i--)}if(t)for(;i--;i)a.unshift("..");return a}function v(a){typeof a!="string"&&(a+="");var t,i=0,l=-1,c=!0;for(t=a.length-1;t>=0;--t)if(a.charCodeAt(t)===47){if(!c){i=t+1;break}}else l===-1&&(c=!1,l=t+1);return l===-1?"":a.slice(i,l)}function u(a,t){if(a.filter)return a.filter(t);for(var i=[],l=0;l<a.length;l++)t(a[l],l,a)&&i.push(a[l]);return i}E.resolve=function(){for(var a="",t=!1,i=arguments.length-1;i>=-1&&!t;i--){var l=i>=0?arguments[i]:A.cwd();if(typeof l!="string")throw new TypeError("Arguments to path.resolve must be strings");l&&(a=l+"/"+a,t=l.charAt(0)==="/")}return a=w(u(a.split("/"),function(c){return!!c}),!t).join("/"),(t?"/":"")+a||"."},E.normalize=function(a){var t=E.isAbsolute(a),i=h(a,-1)==="/";return a=w(u(a.split("/"),function(l){return!!l}),!t).join("/"),a||t||(a="."),a&&i&&(a+="/"),(t?"/":"")+a},E.isAbsolute=function(a){return a.charAt(0)==="/"},E.join=function(){var a=Array.prototype.slice.call(arguments,0);return E.normalize(u(a,function(t,i){if(typeof t!="string")throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},E.relative=function(a,t){function i(d){for(var f=0;f<d.length&&d[f]==="";f++);for(var g=d.length-1;g>=0&&d[g]==="";g--);return f>g?[]:d.slice(f,g-f+1)}a=E.resolve(a).substr(1),t=E.resolve(t).substr(1);for(var l=i(a.split("/")),c=i(t.split("/")),o=Math.min(l.length,c.length),e=o,s=0;s<o;s++)if(l[s]!==c[s]){e=s;break}for(var r=[],s=e;s<l.length;s++)r.push("..");return r=r.concat(c.slice(e)),r.join("/")},E.sep="/",E.delimiter=":",E.dirname=function(a){if(typeof a!="string"&&(a+=""),a.length===0)return".";for(var t=a.charCodeAt(0),i=t===47,l=-1,c=!0,o=a.length-1;o>=1;--o)if((t=a.charCodeAt(o))===47){if(!c){l=o;break}}else c=!1;return l===-1?i?"/":".":i&&l===1?"/":a.slice(0,l)},E.basename=function(a,t){var i=v(a);return t&&i.substr(-1*t.length)===t&&(i=i.substr(0,i.length-t.length)),i},E.extname=function(a){typeof a!="string"&&(a+="");for(var t=-1,i=0,l=-1,c=!0,o=0,e=a.length-1;e>=0;--e){var s=a.charCodeAt(e);if(s!==47)l===-1&&(c=!1,l=e+1),s===46?t===-1?t=e:o!==1&&(o=1):t!==-1&&(o=-1);else if(!c){i=e+1;break}}return t===-1||l===-1||o===0||o===1&&t===l-1&&t===i+1?"":a.slice(t,l)};var h="ab".substr(-1)==="b"?function(a,t,i){return a.substr(t,i)}:function(a,t,i){return t<0&&(t=a.length+t),a.substr(t,i)}}).call(this,b("_process"))},{_process:173}],171:[function(b,L,E){(function(A){(function(){"use strict";function w(S){return S=String(S),S.charAt(0).toUpperCase()+S.slice(1)}function v(S,T,R){var D={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return T&&R&&/^Win/i.test(S)&&!/^Windows Phone /i.test(S)&&(D=D[/[\d.]+$/.exec(S)])&&(S="Windows "+D),S=String(S),T&&R&&(S=S.replace(RegExp(T,"i"),R)),S=h(S.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}function u(S,T){var R=-1,D=S?S.length:0;if(typeof D=="number"&&D>-1&&D<=m)for(;++R<D;)T(S[R],R,S);else a(S,T)}function h(S){return S=o(S),/^(?:webOS|i(?:OS|P))/.test(S)?S:w(S)}function a(S,T){for(var R in S)y.call(S,R)&&T(S[R],R,S)}function t(S){return S==null?w(S):n.call(S).slice(8,-1)}function i(S,T){var R=S!=null?typeof S[T]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(R)||R=="object"&&!S[T])}function l(S){return String(S).replace(/([ -])(?!$)/g,"$1?")}function c(S,T){var R=null;return u(S,function(D,I){R=T(R,D,I,S)}),R}function o(S){return String(S).replace(/^ +| +$/g,"")}function e(S){function T(j){return c(j,function(M,F){var oe=F.pattern||l(F);return!M&&(M=RegExp("\\b"+oe+" *\\d+[.\\w_]*","i").exec(S)||RegExp("\\b"+oe+" *\\w+-[\\w]*","i").exec(S)||RegExp("\\b"+oe+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(S))&&((M=String(F.label&&!RegExp(oe,"i").test(F.label)?F.label:M).split("/"))[1]&&!/[\d.]+/.test(M[0])&&(M[0]+=" "+M[1]),F=F.label||F,M=h(M[0].replace(RegExp(oe,"i"),F).replace(RegExp("; *(?:"+F+"[_-])?","i")," ").replace(RegExp("("+F+")[-_.]?(\\w)","i"),"$1 $2"))),M})}function R(){return this.description||""}var D=r,I=S&&typeof S=="object"&&t(S)!="String";I&&(D=S,S=null);var B=D.navigator||{},G=B.userAgent||"";S||(S=G);var k,$,X=I?!!B.likeChrome:/\bChrome\b/.test(S)&&!/internal|\n/i.test(n.toString()),V=I?"Object":"ScriptBridgingProxyObject",N=I?"Object":"Environment",z=I&&D.java?"JavaPackage":t(D.java),q=I?"Object":"RuntimeObject",ee=/\bJava/.test(z)&&D.java,fe=ee&&t(D.environment)==N,ae=ee?"a":"\u4F2A",pe=ee?"b":"\u5C3E",se=D.document||{},ge=D.operamini||D.opera,ie=p.test(ie=I&&ge?ge["[[Class]]"]:t(ge))?ie:ge=null,te=S,Q=[],me=null,re=S==G,J=re&&ge&&typeof ge.version=="function"&&ge.version(),be=function(j){return c(j,function(M,F){return M||RegExp("\\b"+(F.pattern||l(F))+"\\b","i").exec(S)&&(F.label||F)})}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),Ee=function(j){return c(j,function(M,F){return M||RegExp("\\b"+(F.pattern||l(F))+"\\b","i").exec(S)&&(F.label||F)})}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"Edge"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Waterfox","WebPositive","Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chrome",{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),Le=T([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),H=function(j){return c(j,function(M,F,oe){return M||(F[Le]||F[/^[a-z]+(?: +[a-z]+\b)*/i.exec(Le)]||RegExp("\\b"+l(oe)+"(?:\\b|\\w*\\d)","i").exec(S))&&oe})}({Apple:{iPad:1,iPhone:1,iPod:1},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1}}),C=function(j){return c(j,function(M,F){var oe=F.pattern||l(F);return!M&&(M=RegExp("\\b"+oe+"(?:/[\\d.]+|[ \\w.]*)","i").exec(S))&&(M=v(M,oe,F.label||F)),M})}(["Windows Phone","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian","Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);if(be&&(be=[be]),H&&!Le&&(Le=T([H])),(k=/\bGoogle TV\b/.exec(Le))&&(Le=k[0]),/\bSimulator\b/i.test(S)&&(Le=(Le?Le+" ":"")+"Simulator"),Ee=="Opera Mini"&&/\bOPiOS\b/.test(S)&&Q.push("running in Turbo/Uncompressed mode"),Ee=="IE"&&/\blike iPhone OS\b/.test(S)?(k=e(S.replace(/like iPhone OS/,"")),H=k.manufacturer,Le=k.product):/^iP/.test(Le)?(Ee||(Ee="Safari"),C="iOS"+((k=/ OS ([\d_]+)/i.exec(S))?" "+k[1].replace(/_/g,"."):"")):Ee!="Konqueror"||/buntu/i.test(C)?H&&H!="Google"&&(/Chrome/.test(Ee)&&!/\bMobile Safari\b/i.test(S)||/\bVita\b/.test(Le))||/\bAndroid\b/.test(C)&&/^Chrome/.test(Ee)&&/\bVersion\//i.test(S)?(Ee="Android Browser",C=/\bAndroid\b/.test(C)?C:"Android"):Ee=="Silk"?(/\bMobi/i.test(S)||(C="Android",Q.unshift("desktop mode")),/Accelerated *= *true/i.test(S)&&Q.unshift("accelerated")):Ee=="PaleMoon"&&(k=/\bFirefox\/([\d.]+)\b/.exec(S))?Q.push("identifying as Firefox "+k[1]):Ee=="Firefox"&&(k=/\b(Mobile|Tablet|TV)\b/i.exec(S))?(C||(C="Firefox OS"),Le||(Le=k[1])):!Ee||(k=!/\bMinefield\b/i.test(S)&&/\b(?:Firefox|Safari)\b/.exec(Ee))?(Ee&&!Le&&/[\/,]|^[^(]+?\)/.test(S.slice(S.indexOf(k+"/")+8))&&(Ee=null),(k=Le||H||C)&&(Le||H||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(C))&&(Ee=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(C)?C:k)+" Browser")):Ee=="Electron"&&(k=(/\bChrome\/([\d.]+)\b/.exec(S)||0)[1])&&Q.push("Chromium "+k):C="Kubuntu",J||(J=function(j){return c(j,function(M,F){return M||(RegExp(F+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(S)||0)[1]||null})}(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",l(Ee),"(?:Firefox|Minefield|NetFront)"])),(k=be=="iCab"&&parseFloat(J)>3&&"WebKit"||/\bOpera\b/.test(Ee)&&(/\bOPR\b/.test(S)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(S)&&!/^(?:Trident|EdgeHTML)$/.test(be)&&"WebKit"||!be&&/\bMSIE\b/i.test(S)&&(C=="Mac OS"?"Tasman":"Trident")||be=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(Ee)&&"NetFront")&&(be=[k]),Ee=="IE"&&(k=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(S)||0)[1])?(Ee+=" Mobile",C="Windows Phone "+(/\+$/.test(k)?k:k+".x"),Q.unshift("desktop mode")):/\bWPDesktop\b/i.test(S)?(Ee="IE Mobile",C="Windows Phone 8.x",Q.unshift("desktop mode"),J||(J=(/\brv:([\d.]+)/.exec(S)||0)[1])):Ee!="IE"&&be=="Trident"&&(k=/\brv:([\d.]+)/.exec(S))&&(Ee&&Q.push("identifying as "+Ee+(J?" "+J:"")),Ee="IE",J=k[1]),re){if(i(D,"global"))if(ee&&(k=ee.lang.System,te=k.getProperty("os.arch"),C=C||k.getProperty("os.name")+" "+k.getProperty("os.version")),fe){try{J=D.require("ringo/engine").version.join("."),Ee="RingoJS"}catch(j){(k=D.system)&&k.global.system==D.system&&(Ee="Narwhal",C||(C=k[0].os||null))}Ee||(Ee="Rhino")}else typeof D.process=="object"&&!D.process.browser&&(k=D.process)&&(typeof k.versions=="object"&&(typeof k.versions.electron=="string"?(Q.push("Node "+k.versions.node),Ee="Electron",J=k.versions.electron):typeof k.versions.nw=="string"&&(Q.push("Chromium "+J,"Node "+k.versions.node),Ee="NW.js",J=k.versions.nw)),Ee||(Ee="Node.js",te=k.arch,C=k.platform,J=/[\d.]+/.exec(k.version),J=J?J[0]:null));else t(k=D.runtime)==V?(Ee="Adobe AIR",C=k.flash.system.Capabilities.os):t(k=D.phantom)==q?(Ee="PhantomJS",J=(k=k.version||null)&&k.major+"."+k.minor+"."+k.patch):typeof se.documentMode=="number"&&(k=/\bTrident\/(\d+)/i.exec(S))?(J=[J,se.documentMode],(k=+k[1]+4)!=J[1]&&(Q.push("IE "+J[1]+" mode"),be&&(be[1]=""),J[1]=k),J=Ee=="IE"?String(J[1].toFixed(1)):J[0]):typeof se.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(Ee)&&(Q.push("masking as "+Ee+" "+J),Ee="IE",J="11.0",be=["Trident"],C="Windows");C=C&&h(C)}if(J&&(k=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(J)||/(?:alpha|beta)(?: ?\d)?/i.exec(S+";"+(re&&B.appMinorVersion))||/\bMinefield\b/i.test(S)&&"a")&&(me=/b/i.test(k)?"beta":"alpha",J=J.replace(RegExp(k+"\\+?$"),"")+(me=="beta"?pe:ae)+(/\d+\+?/.exec(k)||"")),Ee=="Fennec"||Ee=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(C))Ee="Firefox Mobile";else if(Ee=="Maxthon"&&J)J=J.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(Le))Le=="Xbox 360"&&(C=null),Le=="Xbox 360"&&/\bIEMobile\b/.test(S)&&Q.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(Ee)&&(!Ee||Le||/Browser|Mobi/.test(Ee))||C!="Windows CE"&&!/Mobi/i.test(S))if(Ee=="IE"&&re)try{D.external===null&&Q.unshift("platform preview")}catch(j){Q.unshift("embedded")}else(/\bBlackBerry\b/.test(Le)||/\bBB10\b/.test(S))&&(k=(RegExp(Le.replace(/ +/g," *")+"/([.\\d]+)","i").exec(S)||0)[1]||J)?(k=[k,/BB10/.test(S)],C=(k[1]?(Le=null,H="BlackBerry"):"Device Software")+" "+k[0],J=null):this!=a&&Le!="Wii"&&(re&&ge||/Opera/.test(Ee)&&/\b(?:MSIE|Firefox)\b/i.test(S)||Ee=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(C)||Ee=="IE"&&(C&&!/^Win/.test(C)&&J>5.5||/\bWindows XP\b/.test(C)&&J>8||J==8&&!/\bTrident\b/.test(S)))&&!p.test(k=e.call(a,S.replace(p,"")+";"))&&k.name&&(k="ing as "+k.name+((k=k.version)?" "+k:""),p.test(Ee)?(/\bIE\b/.test(k)&&C=="Mac OS"&&(C=null),k="identify"+k):(k="mask"+k,Ee=ie?h(ie.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(k)&&(C=null),re||(J=null)),be=["Presto"],Q.push(k));else Ee+=" Mobile";(k=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(S)||0)[1])&&(k=[parseFloat(k.replace(/\.(\d)$/,".0$1")),k],Ee=="Safari"&&k[1].slice(-1)=="+"?(Ee="WebKit Nightly",me="alpha",J=k[1].slice(0,-1)):J!=k[1]&&J!=(k[2]=(/\bSafari\/([\d.]+\+?)/i.exec(S)||0)[1])||(J=null),k[1]=(/\bChrome\/([\d.]+)/i.exec(S)||0)[1],k[0]==537.36&&k[2]==537.36&&parseFloat(k[1])>=28&&be=="WebKit"&&(be=["Blink"]),re&&(X||k[1])?(be&&(be[1]="like Chrome"),k=k[1]||(k=k[0],k<530?1:k<532?2:k<532.05?3:k<533?4:k<534.03?5:k<534.07?6:k<534.1?7:k<534.13?8:k<534.16?9:k<534.24?10:k<534.3?11:k<535.01?12:k<535.02?"13+":k<535.07?15:k<535.11?16:k<535.19?17:k<536.05?18:k<536.1?19:k<537.01?20:k<537.11?"21+":k<537.13?23:k<537.18?24:k<537.24?25:k<537.36?26:be!="Blink"?"27":"28")):(be&&(be[1]="like Safari"),k=k[0],k=k<400?1:k<500?2:k<526?3:k<533?4:k<534?"4+":k<535?5:k<537?6:k<538?7:k<601?8:"8"),be&&(be[1]+=" "+(k+=typeof k=="number"?".x":/[.+]/.test(k)?"":"+")),Ee=="Safari"&&(!J||parseInt(J)>45)&&(J=k)),Ee=="Opera"&&(k=/\bzbov|zvav$/.exec(C))?(Ee+=" ",Q.unshift("desktop mode"),k=="zvav"?(Ee+="Mini",J=null):Ee+="Mobile",C=C.replace(RegExp(" *"+k+"$"),"")):Ee=="Safari"&&/\bChrome\b/.exec(be&&be[1])&&(Q.unshift("desktop mode"),Ee="Chrome Mobile",J=null,/\bOS X\b/.test(C)?(H="Apple",C="iOS 4.3+"):C=null),J&&J.indexOf(k=/[\d.]+$/.exec(C))==0&&S.indexOf("/"+k+"-")>-1&&(C=o(C.replace(k,""))),be&&!/\b(?:Avant|Nook)\b/.test(Ee)&&(/Browser|Lunascape|Maxthon/.test(Ee)||Ee!="Safari"&&/^iOS/.test(C)&&/\bSafari\b/.test(be[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(Ee)&&be[1])&&(k=be[be.length-1])&&Q.push(k),Q.length&&(Q=["("+Q.join("; ")+")"]),H&&Le&&Le.indexOf(H)<0&&Q.push("on "+H),Le&&Q.push((/^on /.test(Q[Q.length-1])?"":"on ")+Le),C&&(k=/ ([\d.+]+)$/.exec(C),$=k&&C.charAt(C.length-k[0].length-1)=="/",C={architecture:32,family:k&&!$?C.replace(k[0],""):C,version:k?k[1]:null,toString:function(){var j=this.version;return this.family+(j&&!$?" "+j:"")+(this.architecture==64?" 64-bit":"")}}),(k=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(te))&&!/\bi686\b/i.test(te)?(C&&(C.architecture=64,C.family=C.family.replace(RegExp(" *"+k),"")),Ee&&(/\bWOW64\b/i.test(S)||re&&/\w(?:86|32)$/.test(B.cpuClass||B.platform)&&!/\bWin64; x64\b/i.test(S))&&Q.unshift("32-bit")):C&&/^OS X/.test(C.family)&&Ee=="Chrome"&&parseFloat(J)>=39&&(C.architecture=64),S||(S=null);var O={};return O.description=S,O.layout=be&&be[0],O.manufacturer=H,O.name=Ee,O.prerelease=me,O.product=Le,O.ua=S,O.version=Ee&&J,O.os=C||{architecture:null,family:null,version:null,toString:function(){return"null"}},O.parse=e,O.toString=R,O.version&&Q.unshift(J),O.name&&Q.unshift(Ee),C&&Ee&&(C!=String(C).split(" ")[0]||C!=Ee.split(" ")[0]&&!Le)&&Q.push(Le?"("+C+")":"on "+C),Q.length&&(O.description=Q.join(" ")),O}var s={function:!0,object:!0},r=s[typeof window]&&window||this,d=s[typeof E]&&E,f=s[typeof L]&&L&&!L.nodeType&&L,g=d&&f&&typeof A=="object"&&A;!g||g.global!==g&&g.window!==g&&g.self!==g||(r=g);var m=Math.pow(2,53)-1,p=/\bOpera/,_=Object.prototype,y=_.hasOwnProperty,n=_.toString,x=e();typeof U=="function"&&typeof U.amd=="object"&&U.amd?(r.platform=x,U(function(){return x})):d&&f?a(x,function(S,T){d[T]=S}):r.platform=x}).call(this)}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],172:[function(b,L,E){(function(A){"use strict";function w(v,u,h,a){if(typeof v!="function")throw new TypeError('"callback" argument must be a function');var t,i,l=arguments.length;switch(l){case 0:case 1:return A.nextTick(v);case 2:return A.nextTick(function(){v.call(null,u)});case 3:return A.nextTick(function(){v.call(null,u,h)});case 4:return A.nextTick(function(){v.call(null,u,h,a)});default:for(t=new Array(l-1),i=0;i<t.length;)t[i++]=arguments[i];return A.nextTick(function(){v.apply(null,t)})}}!A.version||A.version.indexOf("v0.")===0||A.version.indexOf("v1.")===0&&A.version.indexOf("v1.8.")!==0?L.exports={nextTick:w}:L.exports=A}).call(this,b("_process"))},{_process:173}],173:[function(b,L,E){function A(){throw new Error("setTimeout has not been defined")}function w(){throw new Error("clearTimeout has not been defined")}function v(f){if(l===setTimeout)return setTimeout(f,0);if((l===A||!l)&&setTimeout)return l=setTimeout,setTimeout(f,0);try{return l(f,0)}catch(g){try{return l.call(null,f,0)}catch(m){return l.call(this,f,0)}}}function u(f){if(c===clearTimeout)return clearTimeout(f);if((c===w||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(f);try{return c(f)}catch(g){try{return c.call(null,f)}catch(m){return c.call(this,f)}}}function h(){r&&e&&(r=!1,e.length?s=e.concat(s):d=-1,s.length&&a())}function a(){if(!r){var f=v(h);r=!0;for(var g=s.length;g;){for(e=s,s=[];++d<g;)e&&e[d].run();d=-1,g=s.length}e=null,r=!1,u(f)}}function t(f,g){this.fun=f,this.array=g}function i(){}var l,c,o=L.exports={};!function(){try{l=typeof setTimeout=="function"?setTimeout:A}catch(f){l=A}try{c=typeof clearTimeout=="function"?clearTimeout:w}catch(f){c=w}}();var e,s=[],r=!1,d=-1;o.nextTick=function(f){var g=new Array(arguments.length-1);if(arguments.length>1)for(var m=1;m<arguments.length;m++)g[m-1]=arguments[m];s.push(new t(f,g)),s.length!==1||r||v(a)},t.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=i,o.addListener=i,o.once=i,o.off=i,o.removeListener=i,o.removeAllListeners=i,o.emit=i,o.prependListener=i,o.prependOnceListener=i,o.listeners=function(f){return[]},o.binding=function(f){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(f){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],174:[function(b,L,E){(function(A){!function(w){function v(z){throw new RangeError($[z])}function u(z,q){for(var ee=z.length,fe=[];ee--;)fe[ee]=q(z[ee]);return fe}function h(z,q){var ee=z.split("@"),fe="";return ee.length>1&&(fe=ee[0]+"@",z=ee[1]),z=z.replace(k,"."),fe+u(z.split("."),q).join(".")}function a(z){for(var q,ee,fe=[],ae=0,pe=z.length;ae<pe;)q=z.charCodeAt(ae++),q>=55296&&q<=56319&&ae<pe?(ee=z.charCodeAt(ae++),(64512&ee)==56320?fe.push(((1023&q)<<10)+(1023&ee)+65536):(fe.push(q),ae--)):fe.push(q);return fe}function t(z){return u(z,function(q){var ee="";return q>65535&&(q-=65536,ee+=N(q>>>10&1023|55296),q=56320|1023&q),ee+=N(q)}).join("")}function i(z){return z-48<10?z-22:z-65<26?z-65:z-97<26?z-97:y}function l(z,q){return z+22+75*(z<26)-((q!=0)<<5)}function c(z,q,ee){var fe=0;for(z=ee?V(z/T):z>>1,z+=V(z/q);z>X*x>>1;fe+=y)z=V(z/X);return V(fe+(X+1)*z/(z+S))}function o(z){var q,ee,fe,ae,pe,se,ge,ie,te,Q,me=[],re=z.length,J=0,be=D,Ee=R;for(ee=z.lastIndexOf(I),ee<0&&(ee=0),fe=0;fe<ee;++fe)z.charCodeAt(fe)>=128&&v("not-basic"),me.push(z.charCodeAt(fe));for(ae=ee>0?ee+1:0;ae<re;){for(pe=J,se=1,ge=y;ae>=re&&v("invalid-input"),ie=i(z.charCodeAt(ae++)),(ie>=y||ie>V((_-J)/se))&&v("overflow"),J+=ie*se,te=ge<=Ee?n:ge>=Ee+x?x:ge-Ee,!(ie<te);ge+=y)Q=y-te,se>V(_/Q)&&v("overflow"),se*=Q;q=me.length+1,Ee=c(J-pe,q,pe==0),V(J/q)>_-be&&v("overflow"),be+=V(J/q),J%=q,me.splice(J++,0,be)}return t(me)}function e(z){var q,ee,fe,ae,pe,se,ge,ie,te,Q,me,re,J,be,Ee,Le=[];for(z=a(z),re=z.length,q=D,ee=0,pe=R,se=0;se<re;++se)(me=z[se])<128&&Le.push(N(me));for(fe=ae=Le.length,ae&&Le.push(I);fe<re;){for(ge=_,se=0;se<re;++se)(me=z[se])>=q&&me<ge&&(ge=me);for(J=fe+1,ge-q>V((_-ee)/J)&&v("overflow"),ee+=(ge-q)*J,q=ge,se=0;se<re;++se)if(me=z[se],me<q&&++ee>_&&v("overflow"),me==q){for(ie=ee,te=y;Q=te<=pe?n:te>=pe+x?x:te-pe,!(ie<Q);te+=y)Ee=ie-Q,be=y-Q,Le.push(N(l(Q+Ee%be,0))),ie=V(Ee/be);Le.push(N(l(ie,0))),pe=c(ee,J,fe==ae),ee=0,++fe}++ee,++q}return Le.join("")}function s(z){return h(z,function(q){return B.test(q)?o(q.slice(4).toLowerCase()):q})}function r(z){return h(z,function(q){return G.test(q)?"xn--"+e(q):q})}var d=typeof E=="object"&&E&&!E.nodeType&&E,f=typeof L=="object"&&L&&!L.nodeType&&L,g=typeof A=="object"&&A;g.global!==g&&g.window!==g&&g.self!==g||(w=g);var m,p,_=2147483647,y=36,n=1,x=26,S=38,T=700,R=72,D=128,I="-",B=/^xn--/,G=/[^\x20-\x7E]/,k=/[\x2E\u3002\uFF0E\uFF61]/g,$={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},X=y-n,V=Math.floor,N=String.fromCharCode;if(m={version:"1.4.1",ucs2:{decode:a,encode:t},decode:o,encode:e,toASCII:r,toUnicode:s},typeof U=="function"&&typeof U.amd=="object"&&U.amd)U("punycode",function(){return m});else if(d&&f)if(L.exports==d)f.exports=m;else for(p in m)m.hasOwnProperty(p)&&(d[p]=m[p]);else w.punycode=m}(this)}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],175:[function(b,L,E){"use strict";function A(v,u){return Object.prototype.hasOwnProperty.call(v,u)}L.exports=function(v,u,h,a){u=u||"&",h=h||"=";var t={};if(typeof v!="string"||v.length===0)return t;var i=/\+/g;v=v.split(u);var l=1e3;a&&typeof a.maxKeys=="number"&&(l=a.maxKeys);var c=v.length;l>0&&c>l&&(c=l);for(var o=0;o<c;++o){var e,s,r,d,f=v[o].replace(i,"%20"),g=f.indexOf(h);g>=0?(e=f.substr(0,g),s=f.substr(g+1)):(e=f,s=""),r=decodeURIComponent(e),d=decodeURIComponent(s),A(t,r)?w(t[r])?t[r].push(d):t[r]=[t[r],d]:t[r]=d}return t};var w=Array.isArray||function(v){return Object.prototype.toString.call(v)==="[object Array]"}},{}],176:[function(b,L,E){"use strict";function A(h,a){if(h.map)return h.map(a);for(var t=[],i=0;i<h.length;i++)t.push(a(h[i],i));return t}var w=function(h){switch(typeof h){case"string":return h;case"boolean":return h?"true":"false";case"number":return isFinite(h)?h:"";default:return""}};L.exports=function(h,a,t,i){return a=a||"&",t=t||"=",h===null&&(h=void 0),typeof h=="object"?A(u(h),function(l){var c=encodeURIComponent(w(l))+t;return v(h[l])?A(h[l],function(o){return c+encodeURIComponent(w(o))}).join(a):c+encodeURIComponent(w(h[l]))}).join(a):i?encodeURIComponent(w(i))+t+encodeURIComponent(w(h)):""};var v=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"},u=Object.keys||function(h){var a=[];for(var t in h)Object.prototype.hasOwnProperty.call(h,t)&&a.push(t);return a}},{}],177:[function(b,L,E){"use strict";E.decode=E.parse=b("./decode"),E.encode=E.stringify=b("./encode")},{"./decode":175,"./encode":176}],178:[function(b,L,E){L.exports=b("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":179}],179:[function(b,L,E){"use strict";function A(r){if(!(this instanceof A))return new A(r);l.call(this,r),c.call(this,r),r&&r.readable===!1&&(this.readable=!1),r&&r.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,r&&r.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",w)}function w(){this.allowHalfOpen||this._writableState.ended||a.nextTick(v,this)}function v(r){r.end()}var u=b("babel-runtime/core-js/object/keys"),h=function(r){return r&&r.__esModule?r:{default:r}}(u),a=b("process-nextick-args"),t=h.default||function(r){var d=[];for(var f in r)d.push(f);return d};L.exports=A;var i=b("core-util-is");i.inherits=b("inherits");var l=b("./_stream_readable"),c=b("./_stream_writable");i.inherits(A,l);for(var o=t(c.prototype),e=0;e<o.length;e++){var s=o[e];A.prototype[s]||(A.prototype[s]=c.prototype[s])}Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(A.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(r){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=r,this._writableState.destroyed=r)}}),A.prototype._destroy=function(r,d){this.push(null),this.end(),a.nextTick(d,r)}},{"./_stream_readable":181,"./_stream_writable":183,"babel-runtime/core-js/object/keys":23,"core-util-is":153,inherits:162,"process-nextick-args":172}],180:[function(b,L,E){"use strict";function A(u){if(!(this instanceof A))return new A(u);w.call(this,u)}L.exports=A;var w=b("./_stream_transform"),v=b("core-util-is");v.inherits=b("inherits"),v.inherits(A,w),A.prototype._transform=function(u,h,a){a(null,u)}},{"./_stream_transform":182,"core-util-is":153,inherits:162}],181:[function(b,L,E){(function(A,w){"use strict";function v(re){return ee.from(re)}function u(re){return ee.isBuffer(re)||re instanceof fe}function h(re,J,be){if(typeof re.prependListener=="function")return re.prependListener(J,be);re._events&&re._events[J]?N(re._events[J])?re._events[J].unshift(be):re._events[J]=[be,re._events[J]]:re.on(J,be)}function a(re,J){V=V||b("./_stream_duplex"),re=re||{};var be=J instanceof V;this.objectMode=!!re.objectMode,be&&(this.objectMode=this.objectMode||!!re.readableObjectMode);var Ee=re.highWaterMark,Le=re.readableHighWaterMark,H=this.objectMode?16:16384;this.highWaterMark=Ee||Ee===0?Ee:be&&(Le||Le===0)?Le:H,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new ie,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.destroyed=!1,this.defaultEncoding=re.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,re.encoding&&(ge||(ge=b("string_decoder/").StringDecoder),this.decoder=new ge(re.encoding),this.encoding=re.encoding)}function t(re){if(V=V||b("./_stream_duplex"),!(this instanceof t))return new t(re);this._readableState=new a(re,this),this.readable=!0,re&&(typeof re.read=="function"&&(this._read=re.read),typeof re.destroy=="function"&&(this._destroy=re.destroy)),q.call(this)}function i(re,J,be,Ee,Le){var H=re._readableState;if(J===null)H.reading=!1,r(re,H);else{var C;Le||(C=c(H,J)),C?re.emit("error",C):H.objectMode||J&&J.length>0?(typeof J=="string"||H.objectMode||(0,$.default)(J)===ee.prototype||(J=v(J)),Ee?H.endEmitted?re.emit("error",new Error("stream.unshift() after end event")):l(re,H,J,!0):H.ended?re.emit("error",new Error("stream.push() after EOF")):(H.reading=!1,H.decoder&&!be?(J=H.decoder.write(J),H.objectMode||J.length!==0?l(re,H,J,!1):g(re,H)):l(re,H,J,!1))):Ee||(H.reading=!1)}return o(H)}function l(re,J,be,Ee){J.flowing&&J.length===0&&!J.sync?(re.emit("data",be),re.read(0)):(J.length+=J.objectMode?1:be.length,Ee?J.buffer.unshift(be):J.buffer.push(be),J.needReadable&&d(re)),g(re,J)}function c(re,J){var be;return u(J)||typeof J=="string"||J===void 0||re.objectMode||(be=new TypeError("Invalid non-string/buffer chunk")),be}function o(re){return!re.ended&&(re.needReadable||re.length<re.highWaterMark||re.length===0)}function e(re){return re>=me?re=me:(re--,re|=re>>>1,re|=re>>>2,re|=re>>>4,re|=re>>>8,re|=re>>>16,re++),re}function s(re,J){return re<=0||J.length===0&&J.ended?0:J.objectMode?1:re!==re?J.flowing&&J.length?J.buffer.head.data.length:J.length:(re>J.highWaterMark&&(J.highWaterMark=e(re)),re<=J.length?re:J.ended?J.length:(J.needReadable=!0,0))}function r(re,J){if(!J.ended){if(J.decoder){var be=J.decoder.end();be&&be.length&&(J.buffer.push(be),J.length+=J.objectMode?1:be.length)}J.ended=!0,d(re)}}function d(re){var J=re._readableState;J.needReadable=!1,J.emittedReadable||(se("emitReadable",J.flowing),J.emittedReadable=!0,J.sync?X.nextTick(f,re):f(re))}function f(re){se("emit readable"),re.emit("readable"),x(re)}function g(re,J){J.readingMore||(J.readingMore=!0,X.nextTick(m,re,J))}function m(re,J){for(var be=J.length;!J.reading&&!J.flowing&&!J.ended&&J.length<J.highWaterMark&&(se("maybeReadMore read 0"),re.read(0),be!==J.length);)be=J.length;J.readingMore=!1}function p(re){return function(){var J=re._readableState;se("pipeOnDrain",J.awaitDrain),J.awaitDrain&&J.awaitDrain--,J.awaitDrain===0&&z(re,"data")&&(J.flowing=!0,x(re))}}function _(re){se("readable nexttick read 0"),re.read(0)}function y(re,J){J.resumeScheduled||(J.resumeScheduled=!0,X.nextTick(n,re,J))}function n(re,J){J.reading||(se("resume read 0"),re.read(0)),J.resumeScheduled=!1,J.awaitDrain=0,re.emit("resume"),x(re),J.flowing&&!J.reading&&re.read(0)}function x(re){var J=re._readableState;for(se("flow",J.flowing);J.flowing&&re.read()!==null;);}function S(re,J){if(J.length===0)return null;var be;return J.objectMode?be=J.buffer.shift():!re||re>=J.length?(be=J.decoder?J.buffer.join(""):J.buffer.length===1?J.buffer.head.data:J.buffer.concat(J.length),J.buffer.clear()):be=T(re,J.buffer,J.decoder),be}function T(re,J,be){var Ee;return re<J.head.data.length?(Ee=J.head.data.slice(0,re),J.head.data=J.head.data.slice(re)):Ee=re===J.head.data.length?J.shift():be?R(re,J):D(re,J),Ee}function R(re,J){var be=J.head,Ee=1,Le=be.data;for(re-=Le.length;be=be.next;){var H=be.data,C=re>H.length?H.length:re;if(C===H.length?Le+=H:Le+=H.slice(0,re),(re-=C)===0){C===H.length?(++Ee,be.next?J.head=be.next:J.head=J.tail=null):(J.head=be,be.data=H.slice(C));break}++Ee}return J.length-=Ee,Le}function D(re,J){var be=ee.allocUnsafe(re),Ee=J.head,Le=1;for(Ee.data.copy(be),re-=Ee.data.length;Ee=Ee.next;){var H=Ee.data,C=re>H.length?H.length:re;if(H.copy(be,be.length-re,0,C),(re-=C)===0){C===H.length?(++Le,Ee.next?J.head=Ee.next:J.head=J.tail=null):(J.head=Ee,Ee.data=H.slice(C));break}++Le}return J.length-=Le,be}function I(re){var J=re._readableState;if(J.length>0)throw new Error('"endReadable()" called on non-empty stream');J.endEmitted||(J.ended=!0,X.nextTick(B,J,re))}function B(re,J){re.endEmitted||re.length!==0||(re.endEmitted=!0,J.readable=!1,J.emit("end"))}function G(re,J){for(var be=0,Ee=re.length;be<Ee;be++)if(re[be]===J)return be;return-1}var k=b("babel-runtime/core-js/object/get-prototype-of"),$=function(re){return re&&re.__esModule?re:{default:re}}(k),X=b("process-nextick-args");L.exports=t;var V,N=b("isarray");t.ReadableState=a;var z=(b("events").EventEmitter,function(re,J){return re.listeners(J).length}),q=b("./internal/streams/stream"),ee=b("safe-buffer").Buffer,fe=w.Uint8Array||function(){},ae=b("core-util-is");ae.inherits=b("inherits");var pe=b("util"),se=void 0;se=pe&&pe.debuglog?pe.debuglog("stream"):function(){};var ge,ie=b("./internal/streams/BufferList"),te=b("./internal/streams/destroy");ae.inherits(t,q);var Q=["error","close","destroy","pause","resume"];Object.defineProperty(t.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(re){this._readableState&&(this._readableState.destroyed=re)}}),t.prototype.destroy=te.destroy,t.prototype._undestroy=te.undestroy,t.prototype._destroy=function(re,J){this.push(null),J(re)},t.prototype.push=function(re,J){var be,Ee=this._readableState;return Ee.objectMode?be=!0:typeof re=="string"&&(J=J||Ee.defaultEncoding,J!==Ee.encoding&&(re=ee.from(re,J),J=""),be=!0),i(this,re,J,!1,be)},t.prototype.unshift=function(re){return i(this,re,null,!0,!1)},t.prototype.isPaused=function(){return this._readableState.flowing===!1},t.prototype.setEncoding=function(re){return ge||(ge=b("string_decoder/").StringDecoder),this._readableState.decoder=new ge(re),this._readableState.encoding=re,this};var me=8388608;t.prototype.read=function(re){se("read",re),re=parseInt(re,10);var J=this._readableState,be=re;if(re!==0&&(J.emittedReadable=!1),re===0&&J.needReadable&&(J.length>=J.highWaterMark||J.ended))return se("read: emitReadable",J.length,J.ended),J.length===0&&J.ended?I(this):d(this),null;if((re=s(re,J))===0&&J.ended)return J.length===0&&I(this),null;var Ee=J.needReadable;se("need readable",Ee),(J.length===0||J.length-re<J.highWaterMark)&&(Ee=!0,se("length less than watermark",Ee)),J.ended||J.reading?(Ee=!1,se("reading or ended",Ee)):Ee&&(se("do read"),J.reading=!0,J.sync=!0,J.length===0&&(J.needReadable=!0),this._read(J.highWaterMark),J.sync=!1,J.reading||(re=s(be,J)));var Le;return Le=re>0?S(re,J):null,Le===null?(J.needReadable=!0,re=0):J.length-=re,J.length===0&&(J.ended||(J.needReadable=!0),be!==re&&J.ended&&I(this)),Le!==null&&this.emit("data",Le),Le},t.prototype._read=function(re){this.emit("error",new Error("_read() is not implemented"))},t.prototype.pipe=function(re,J){function be(Ke,Pe){se("onunpipe"),Ke===F&&Pe&&Pe.hasUnpiped===!1&&(Pe.hasUnpiped=!0,Le())}function Ee(){se("onend"),re.end()}function Le(){se("cleanup"),re.removeListener("close",O),re.removeListener("finish",j),re.removeListener("drain",Oe),re.removeListener("error",C),re.removeListener("unpipe",be),F.removeListener("end",Ee),F.removeListener("end",M),F.removeListener("data",H),De=!0,!oe.awaitDrain||re._writableState&&!re._writableState.needDrain||Oe()}function H(Ke){se("ondata"),Ue=!1,re.write(Ke)!==!1||Ue||((oe.pipesCount===1&&oe.pipes===re||oe.pipesCount>1&&G(oe.pipes,re)!==-1)&&!De&&(se("false write response, pause",F._readableState.awaitDrain),F._readableState.awaitDrain++,Ue=!0),F.pause())}function C(Ke){se("onerror",Ke),M(),re.removeListener("error",C),z(re,"error")===0&&re.emit("error",Ke)}function O(){re.removeListener("finish",j),M()}function j(){se("onfinish"),re.removeListener("close",O),M()}function M(){se("unpipe"),F.unpipe(re)}var F=this,oe=this._readableState;switch(oe.pipesCount){case 0:oe.pipes=re;break;case 1:oe.pipes=[oe.pipes,re];break;default:oe.pipes.push(re)}oe.pipesCount+=1,se("pipe count=%d opts=%j",oe.pipesCount,J);var ve=(!J||J.end!==!1)&&re!==A.stdout&&re!==A.stderr,ke=ve?Ee:M;oe.endEmitted?X.nextTick(ke):F.once("end",ke),re.on("unpipe",be);var Oe=p(F);re.on("drain",Oe);var De=!1,Ue=!1;return F.on("data",H),h(re,"error",C),re.once("close",O),re.once("finish",j),re.emit("pipe",F),oe.flowing||(se("pipe resume"),F.resume()),re},t.prototype.unpipe=function(re){var J=this._readableState,be={hasUnpiped:!1};if(J.pipesCount===0)return this;if(J.pipesCount===1)return re&&re!==J.pipes?this:(re||(re=J.pipes),J.pipes=null,J.pipesCount=0,J.flowing=!1,re&&re.emit("unpipe",this,be),this);if(!re){var Ee=J.pipes,Le=J.pipesCount;J.pipes=null,J.pipesCount=0,J.flowing=!1;for(var H=0;H<Le;H++)Ee[H].emit("unpipe",this,be);return this}var C=G(J.pipes,re);return C===-1?this:(J.pipes.splice(C,1),J.pipesCount-=1,J.pipesCount===1&&(J.pipes=J.pipes[0]),re.emit("unpipe",this,be),this)},t.prototype.on=function(re,J){var be=q.prototype.on.call(this,re,J);if(re==="data")this._readableState.flowing!==!1&&this.resume();else if(re==="readable"){var Ee=this._readableState;Ee.endEmitted||Ee.readableListening||(Ee.readableListening=Ee.needReadable=!0,Ee.emittedReadable=!1,Ee.reading?Ee.length&&d(this):X.nextTick(_,this))}return be},t.prototype.addListener=t.prototype.on,t.prototype.resume=function(){var re=this._readableState;return re.flowing||(se("resume"),re.flowing=!0,y(this,re)),this},t.prototype.pause=function(){return se("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(se("pause"),this._readableState.flowing=!1,this.emit("pause")),this},t.prototype.wrap=function(re){var J=this,be=this._readableState,Ee=!1;re.on("end",function(){if(se("wrapped end"),be.decoder&&!be.ended){var C=be.decoder.end();C&&C.length&&J.push(C)}J.push(null)}),re.on("data",function(C){(se("wrapped data"),be.decoder&&(C=be.decoder.write(C)),(!be.objectMode||C!=null)&&(be.objectMode||C&&C.length))&&(J.push(C)||(Ee=!0,re.pause()))});for(var Le in re)this[Le]===void 0&&typeof re[Le]=="function"&&(this[Le]=function(C){return function(){return re[C].apply(re,arguments)}}(Le));for(var H=0;H<Q.length;H++)re.on(Q[H],this.emit.bind(this,Q[H]));return this._read=function(C){se("wrapped _read",C),Ee&&(Ee=!1,re.resume())},this},Object.defineProperty(t.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),t._fromList=S}).call(this,b("_process"),typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":179,"./internal/streams/BufferList":184,"./internal/streams/destroy":185,"./internal/streams/stream":186,_process:173,"babel-runtime/core-js/object/get-prototype-of":22,"core-util-is":153,events:158,inherits:162,isarray:166,"process-nextick-args":172,"safe-buffer":193,"string_decoder/":200,util:36}],182:[function(b,L,E){"use strict";function A(t,i){var l=this._transformState;l.transforming=!1;var c=l.writecb;if(!c)return this.emit("error",new Error("write callback called multiple times"));l.writechunk=null,l.writecb=null,i!=null&&this.push(i),c(t);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function w(t){if(!(this instanceof w))return new w(t);h.call(this,t),this._transformState={afterTransform:A.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",v)}function v(){var t=this;typeof this._flush=="function"?this._flush(function(i,l){u(t,i,l)}):u(this,null,null)}function u(t,i,l){if(i)return t.emit("error",i);if(l!=null&&t.push(l),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}L.exports=w;var h=b("./_stream_duplex"),a=b("core-util-is");a.inherits=b("inherits"),a.inherits(w,h),w.prototype.push=function(t,i){return this._transformState.needTransform=!1,h.prototype.push.call(this,t,i)},w.prototype._transform=function(t,i,l){throw new Error("_transform() is not implemented")},w.prototype._write=function(t,i,l){var c=this._transformState;if(c.writecb=l,c.writechunk=t,c.writeencoding=i,!c.transforming){var o=this._readableState;(c.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},w.prototype._read=function(t){var i=this._transformState;i.writechunk!==null&&i.writecb&&!i.transforming?(i.transforming=!0,this._transform(i.writechunk,i.writeencoding,i.afterTransform)):i.needTransform=!0},w.prototype._destroy=function(t,i){var l=this;h.prototype._destroy.call(this,t,function(c){i(c),l.emit("close")})}},{"./_stream_duplex":179,"core-util-is":153,inherits:162}],183:[function(b,L,E){(function(A,w){"use strict";function v(te){return te&&te.__esModule?te:{default:te}}function u(te){var Q=this;this.next=null,this.entry=null,this.finish=function(){R(Q,te)}}function h(te){return pe.from(te)}function a(te){return pe.isBuffer(te)||te instanceof se}function t(){}function i(te,Q){z=z||b("./_stream_duplex"),te=te||{};var me=Q instanceof z;this.objectMode=!!te.objectMode,me&&(this.objectMode=this.objectMode||!!te.writableObjectMode);var re=te.highWaterMark,J=te.writableHighWaterMark,be=this.objectMode?16:16384;this.highWaterMark=re||re===0?re:me&&(J||J===0)?J:be,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Ee=te.decodeStrings===!1;this.decodeStrings=!Ee,this.defaultEncoding=te.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Le){g(Q,Le)},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 u(this)}function l(te){if(z=z||b("./_stream_duplex"),!(ie.call(l,this)||this instanceof z))return new l(te);this._writableState=new i(te,this),this.writable=!0,te&&(typeof te.write=="function"&&(this._write=te.write),typeof te.writev=="function"&&(this._writev=te.writev),typeof te.destroy=="function"&&(this._destroy=te.destroy),typeof te.final=="function"&&(this._final=te.final)),ae.call(this)}function c(te,Q){var me=new Error("write after end");te.emit("error",me),N.nextTick(Q,me)}function o(te,Q,me,re){var J=!0,be=!1;return me===null?be=new TypeError("May not write null values to stream"):typeof me=="string"||me===void 0||Q.objectMode||(be=new TypeError("Invalid non-string/buffer chunk")),be&&(te.emit("error",be),N.nextTick(re,be),J=!1),J}function e(te,Q,me){return te.objectMode||te.decodeStrings===!1||typeof Q!="string"||(Q=pe.from(Q,me)),Q}function s(te,Q,me,re,J,be){if(!me){var Ee=e(Q,re,J);re!==Ee&&(me=!0,J="buffer",re=Ee)}var Le=Q.objectMode?1:re.length;Q.length+=Le;var H=Q.length<Q.highWaterMark;if(H||(Q.needDrain=!0),Q.writing||Q.corked){var C=Q.lastBufferedRequest;Q.lastBufferedRequest={chunk:re,encoding:J,isBuf:me,callback:be,next:null},C?C.next=Q.lastBufferedRequest:Q.bufferedRequest=Q.lastBufferedRequest,Q.bufferedRequestCount+=1}else r(te,Q,!1,Le,re,J,be);return H}function r(te,Q,me,re,J,be,Ee){Q.writelen=re,Q.writecb=Ee,Q.writing=!0,Q.sync=!0,me?te._writev(J,Q.onwrite):te._write(J,be,Q.onwrite),Q.sync=!1}function d(te,Q,me,re,J){--Q.pendingcb,me?(N.nextTick(J,re),N.nextTick(S,te,Q),te._writableState.errorEmitted=!0,te.emit("error",re)):(J(re),te._writableState.errorEmitted=!0,te.emit("error",re),S(te,Q))}function f(te){te.writing=!1,te.writecb=null,te.length-=te.writelen,te.writelen=0}function g(te,Q){var me=te._writableState,re=me.sync,J=me.writecb;if(f(me),Q)d(te,me,re,Q,J);else{var be=y(me);be||me.corked||me.bufferProcessing||!me.bufferedRequest||_(te,me),re?q(m,te,me,be,J):m(te,me,be,J)}}function m(te,Q,me,re){me||p(te,Q),Q.pendingcb--,re(),S(te,Q)}function p(te,Q){Q.length===0&&Q.needDrain&&(Q.needDrain=!1,te.emit("drain"))}function _(te,Q){Q.bufferProcessing=!0;var me=Q.bufferedRequest;if(te._writev&&me&&me.next){var re=Q.bufferedRequestCount,J=new Array(re),be=Q.corkedRequestsFree;be.entry=me;for(var Ee=0,Le=!0;me;)J[Ee]=me,me.isBuf||(Le=!1),me=me.next,Ee+=1;J.allBuffers=Le,r(te,Q,!0,Q.length,J,"",be.finish),Q.pendingcb++,Q.lastBufferedRequest=null,be.next?(Q.corkedRequestsFree=be.next,be.next=null):Q.corkedRequestsFree=new u(Q),Q.bufferedRequestCount=0}else{for(;me;){var H=me.chunk,C=me.encoding,O=me.callback;if(r(te,Q,!1,Q.objectMode?1:H.length,H,C,O),me=me.next,Q.bufferedRequestCount--,Q.writing)break}me===null&&(Q.lastBufferedRequest=null)}Q.bufferedRequest=me,Q.bufferProcessing=!1}function y(te){return te.ending&&te.length===0&&te.bufferedRequest===null&&!te.finished&&!te.writing}function n(te,Q){te._final(function(me){Q.pendingcb--,me&&te.emit("error",me),Q.prefinished=!0,te.emit("prefinish"),S(te,Q)})}function x(te,Q){Q.prefinished||Q.finalCalled||(typeof te._final=="function"?(Q.pendingcb++,Q.finalCalled=!0,N.nextTick(n,te,Q)):(Q.prefinished=!0,te.emit("prefinish")))}function S(te,Q){var me=y(Q);return me&&(x(te,Q),Q.pendingcb===0&&(Q.finished=!0,te.emit("finish"))),me}function T(te,Q,me){Q.ending=!0,S(te,Q),me&&(Q.finished?N.nextTick(me):te.once("finish",me)),Q.ended=!0,te.writable=!1}function R(te,Q,me){var re=te.entry;for(te.entry=null;re;){var J=re.callback;Q.pendingcb--,J(me),re=re.next}Q.corkedRequestsFree?Q.corkedRequestsFree.next=te:Q.corkedRequestsFree=te}var D=b("babel-runtime/core-js/object/define-property"),I=v(D),B=b("babel-runtime/core-js/symbol/has-instance"),G=v(B),k=b("babel-runtime/core-js/symbol"),$=v(k),X=b("babel-runtime/core-js/set-immediate"),V=v(X),N=b("process-nextick-args");L.exports=l;var z,q=!A.browser&&["v0.10","v0.9."].indexOf(A.version.slice(0,5))>-1?V.default:N.nextTick;l.WritableState=i;var ee=b("core-util-is");ee.inherits=b("inherits");var fe={deprecate:b("util-deprecate")},ae=b("./internal/streams/stream"),pe=b("safe-buffer").Buffer,se=w.Uint8Array||function(){},ge=b("./internal/streams/destroy");ee.inherits(l,ae),i.prototype.getBuffer=function(){for(var te=this.bufferedRequest,Q=[];te;)Q.push(te),te=te.next;return Q},function(){try{Object.defineProperty(i.prototype,"buffer",{get:fe.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(te){}}();var ie;typeof $.default=="function"&&G.default&&typeof Function.prototype[G.default]=="function"?(ie=Function.prototype[G.default],(0,I.default)(l,G.default,{value:function(te){return!!ie.call(this,te)||this===l&&te&&te._writableState instanceof i}})):ie=function(te){return te instanceof this},l.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},l.prototype.write=function(te,Q,me){var re=this._writableState,J=!1,be=!re.objectMode&&a(te);return be&&!pe.isBuffer(te)&&(te=h(te)),typeof Q=="function"&&(me=Q,Q=null),be?Q="buffer":Q||(Q=re.defaultEncoding),typeof me!="function"&&(me=t),re.ended?c(this,me):(be||o(this,re,te,me))&&(re.pendingcb++,J=s(this,re,be,te,Q,me)),J},l.prototype.cork=function(){this._writableState.corked++},l.prototype.uncork=function(){var te=this._writableState;te.corked&&(te.corked--,te.writing||te.corked||te.finished||te.bufferProcessing||!te.bufferedRequest||_(this,te))},l.prototype.setDefaultEncoding=function(te){if(typeof te=="string"&&(te=te.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((te+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+te);return this._writableState.defaultEncoding=te,this},Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),l.prototype._write=function(te,Q,me){me(new Error("_write() is not implemented"))},l.prototype._writev=null,l.prototype.end=function(te,Q,me){var re=this._writableState;typeof te=="function"?(me=te,te=null,Q=null):typeof Q=="function"&&(me=Q,Q=null),te!=null&&this.write(te,Q),re.corked&&(re.corked=1,this.uncork()),re.ending||re.finished||T(this,re,me)},Object.defineProperty(l.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(te){this._writableState&&(this._writableState.destroyed=te)}}),l.prototype.destroy=ge.destroy,l.prototype._undestroy=ge.undestroy,l.prototype._destroy=function(te,Q){this.end(),Q(te)}}).call(this,b("_process"),typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":179,"./internal/streams/destroy":185,"./internal/streams/stream":186,_process:173,"babel-runtime/core-js/object/define-property":20,"babel-runtime/core-js/set-immediate":25,"babel-runtime/core-js/symbol":27,"babel-runtime/core-js/symbol/has-instance":28,"core-util-is":153,inherits:162,"process-nextick-args":172,"safe-buffer":193,"util-deprecate":205}],184:[function(b,L,E){"use strict";function A(h,a){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")}function w(h,a,t){h.copy(a,t)}var v=b("safe-buffer").Buffer,u=b("util");L.exports=function(){function h(){A(this,h),this.head=null,this.tail=null,this.length=0}return h.prototype.push=function(a){var t={data:a,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},h.prototype.unshift=function(a){var t={data:a,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length},h.prototype.shift=function(){if(this.length!==0){var a=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,a}},h.prototype.clear=function(){this.head=this.tail=null,this.length=0},h.prototype.join=function(a){if(this.length===0)return"";for(var t=this.head,i=""+t.data;t=t.next;)i+=a+t.data;return i},h.prototype.concat=function(a){if(this.length===0)return v.alloc(0);if(this.length===1)return this.head.data;for(var t=v.allocUnsafe(a>>>0),i=this.head,l=0;i;)w(i.data,t,l),l+=i.data.length,i=i.next;return t},h}(),u&&u.inspect&&u.inspect.custom&&(L.exports.prototype[u.inspect.custom]=function(){var h=u.inspect({length:this.length});return this.constructor.name+" "+h})},{"safe-buffer":193,util:36}],185:[function(b,L,E){"use strict";function A(h,a){var t=this,i=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return i||l?(a?a(h):!h||this._writableState&&this._writableState.errorEmitted||u.nextTick(v,this,h),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(h||null,function(c){!a&&c?(u.nextTick(v,t,c),t._writableState&&(t._writableState.errorEmitted=!0)):a&&a(c)}),this)}function w(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function v(h,a){h.emit("error",a)}var u=b("process-nextick-args");L.exports={destroy:A,undestroy:w}},{"process-nextick-args":172}],186:[function(b,L,E){"use strict";L.exports=b("events").EventEmitter},{events:158}],187:[function(b,L,E){L.exports=b("./readable").PassThrough},{"./readable":188}],188:[function(b,L,E){E=L.exports=b("./lib/_stream_readable.js"),E.Stream=E,E.Readable=E,E.Writable=b("./lib/_stream_writable.js"),E.Duplex=b("./lib/_stream_duplex.js"),E.Transform=b("./lib/_stream_transform.js"),E.PassThrough=b("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":179,"./lib/_stream_passthrough.js":180,"./lib/_stream_readable.js":181,"./lib/_stream_transform.js":182,"./lib/_stream_writable.js":183}],189:[function(b,L,E){L.exports=b("./readable").Transform},{"./readable":188}],190:[function(b,L,E){L.exports=b("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":183}],191:[function(b,L,E){var A=function(){return this}()||Function("return this")(),w=A.regeneratorRuntime&&Object.getOwnPropertyNames(A).indexOf("regeneratorRuntime")>=0,v=w&&A.regeneratorRuntime;if(A.regeneratorRuntime=void 0,L.exports=b("./runtime"),w)A.regeneratorRuntime=v;else try{delete A.regeneratorRuntime}catch(u){A.regeneratorRuntime=void 0}},{"./runtime":192}],192:[function(b,L,E){!function(A){"use strict";function w(V,N,z,q){var ee=N&&N.prototype instanceof u?N:u,fe=Object.create(ee.prototype),ae=new s(q||[]);return fe._invoke=l(V,z,ae),fe}function v(V,N,z){try{return{type:"normal",arg:V.call(N,z)}}catch(q){return{type:"throw",arg:q}}}function u(){}function h(){}function a(){}function t(V){["next","throw","return"].forEach(function(N){V[N]=function(z){return this._invoke(N,z)}})}function i(V){function N(ee,fe,ae,pe){var se=v(V[ee],V,fe);if(se.type!=="throw"){var ge=se.arg,ie=ge.value;return ie&&typeof ie=="object"&&m.call(ie,"__await")?Promise.resolve(ie.__await).then(function(te){N("next",te,ae,pe)},function(te){N("throw",te,ae,pe)}):Promise.resolve(ie).then(function(te){ge.value=te,ae(ge)},pe)}pe(se.arg)}function z(ee,fe){function ae(){return new Promise(function(pe,se){N(ee,fe,pe,se)})}return q=q?q.then(ae,ae):ae()}var q;this._invoke=z}function l(V,N,z){var q=T;return function(ee,fe){if(q===D)throw new Error("Generator is already running");if(q===I){if(ee==="throw")throw fe;return d()}for(z.method=ee,z.arg=fe;;){var ae=z.delegate;if(ae){var pe=c(ae,z);if(pe){if(pe===B)continue;return pe}}if(z.method==="next")z.sent=z._sent=z.arg;else if(z.method==="throw"){if(q===T)throw q=I,z.arg;z.dispatchException(z.arg)}else z.method==="return"&&z.abrupt("return",z.arg);q=D;var se=v(V,N,z);if(se.type==="normal"){if(q=z.done?I:R,se.arg===B)continue;return{value:se.arg,done:z.done}}se.type==="throw"&&(q=I,z.method="throw",z.arg=se.arg)}}}function c(V,N){var z=V.iterator[N.method];if(z===f){if(N.delegate=null,N.method==="throw"){if(V.iterator.return&&(N.method="return",N.arg=f,c(V,N),N.method==="throw"))return B;N.method="throw",N.arg=new TypeError("The iterator does not provide a 'throw' method")}return B}var q=v(z,V.iterator,N.arg);if(q.type==="throw")return N.method="throw",N.arg=q.arg,N.delegate=null,B;var ee=q.arg;return ee?ee.done?(N[V.resultName]=ee.value,N.next=V.nextLoc,N.method!=="return"&&(N.method="next",N.arg=f),N.delegate=null,B):ee:(N.method="throw",N.arg=new TypeError("iterator result is not an object"),N.delegate=null,B)}function o(V){var N={tryLoc:V[0]};1 in V&&(N.catchLoc=V[1]),2 in V&&(N.finallyLoc=V[2],N.afterLoc=V[3]),this.tryEntries.push(N)}function e(V){var N=V.completion||{};N.type="normal",delete N.arg,V.completion=N}function s(V){this.tryEntries=[{tryLoc:"root"}],V.forEach(o,this),this.reset(!0)}function r(V){if(V){var N=V[_];if(N)return N.call(V);if(typeof V.next=="function")return V;if(!isNaN(V.length)){var z=-1,q=function ee(){for(;++z<V.length;)if(m.call(V,z))return ee.value=V[z],ee.done=!1,ee;return ee.value=f,ee.done=!0,ee};return q.next=q}}return{next:d}}function d(){return{value:f,done:!0}}var f,g=Object.prototype,m=g.hasOwnProperty,p=typeof Symbol=="function"?Symbol:{},_=p.iterator||"@@iterator",y=p.asyncIterator||"@@asyncIterator",n=p.toStringTag||"@@toStringTag",x=typeof L=="object",S=A.regeneratorRuntime;if(S)return void(x&&(L.exports=S));S=A.regeneratorRuntime=x?L.exports:{},S.wrap=w;var T="suspendedStart",R="suspendedYield",D="executing",I="completed",B={},G={};G[_]=function(){return this};var k=Object.getPrototypeOf,$=k&&k(k(r([])));$&&$!==g&&m.call($,_)&&(G=$);var X=a.prototype=u.prototype=Object.create(G);h.prototype=X.constructor=a,a.constructor=h,a[n]=h.displayName="GeneratorFunction",S.isGeneratorFunction=function(V){var N=typeof V=="function"&&V.constructor;return!!N&&(N===h||(N.displayName||N.name)==="GeneratorFunction")},S.mark=function(V){return Object.setPrototypeOf?Object.setPrototypeOf(V,a):(V.__proto__=a,n in V||(V[n]="GeneratorFunction")),V.prototype=Object.create(X),V},S.awrap=function(V){return{__await:V}},t(i.prototype),i.prototype[y]=function(){return this},S.AsyncIterator=i,S.async=function(V,N,z,q){var ee=new i(w(V,N,z,q));return S.isGeneratorFunction(N)?ee:ee.next().then(function(fe){return fe.done?fe.value:ee.next()})},t(X),X[n]="Generator",X[_]=function(){return this},X.toString=function(){return"[object Generator]"},S.keys=function(V){var N=[];for(var z in V)N.push(z);return N.reverse(),function q(){for(;N.length;){var ee=N.pop();if(ee in V)return q.value=ee,q.done=!1,q}return q.done=!0,q}},S.values=r,s.prototype={constructor:s,reset:function(V){if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,this.tryEntries.forEach(e),!V)for(var N in this)N.charAt(0)==="t"&&m.call(this,N)&&!isNaN(+N.slice(1))&&(this[N]=f)},stop:function(){this.done=!0;var V=this.tryEntries[0],N=V.completion;if(N.type==="throw")throw N.arg;return this.rval},dispatchException:function(V){function N(se,ge){return fe.type="throw",fe.arg=V,z.next=se,ge&&(z.method="next",z.arg=f),!!ge}if(this.done)throw V;for(var z=this,q=this.tryEntries.length-1;q>=0;--q){var ee=this.tryEntries[q],fe=ee.completion;if(ee.tryLoc==="root")return N("end");if(ee.tryLoc<=this.prev){var ae=m.call(ee,"catchLoc"),pe=m.call(ee,"finallyLoc");if(ae&&pe){if(this.prev<ee.catchLoc)return N(ee.catchLoc,!0);if(this.prev<ee.finallyLoc)return N(ee.finallyLoc)}else if(ae){if(this.prev<ee.catchLoc)return N(ee.catchLoc,!0)}else{if(!pe)throw new Error("try statement without catch or finally");if(this.prev<ee.finallyLoc)return N(ee.finallyLoc)}}}},abrupt:function(V,N){for(var z=this.tryEntries.length-1;z>=0;--z){var q=this.tryEntries[z];if(q.tryLoc<=this.prev&&m.call(q,"finallyLoc")&&this.prev<q.finallyLoc){var ee=q;break}}ee&&(V==="break"||V==="continue")&&ee.tryLoc<=N&&N<=ee.finallyLoc&&(ee=null);var fe=ee?ee.completion:{};return fe.type=V,fe.arg=N,ee?(this.method="next",this.next=ee.finallyLoc,B):this.complete(fe)},complete:function(V,N){if(V.type==="throw")throw V.arg;return V.type==="break"||V.type==="continue"?this.next=V.arg:V.type==="return"?(this.rval=this.arg=V.arg,this.method="return",this.next="end"):V.type==="normal"&&N&&(this.next=N),B},finish:function(V){for(var N=this.tryEntries.length-1;N>=0;--N){var z=this.tryEntries[N];if(z.finallyLoc===V)return this.complete(z.completion,z.afterLoc),e(z),B}},catch:function(V){for(var N=this.tryEntries.length-1;N>=0;--N){var z=this.tryEntries[N];if(z.tryLoc===V){var q=z.completion;if(q.type==="throw"){var ee=q.arg;e(z)}return ee}}throw new Error("illegal catch attempt")},delegateYield:function(V,N,z){return this.delegate={iterator:r(V),resultName:N,nextLoc:z},this.method==="next"&&(this.arg=f),B}}}(function(){return this}()||Function("return this")())},{}],193:[function(b,L,E){function A(h,a){for(var t in h)a[t]=h[t]}function w(h,a,t){return u(h,a,t)}var v=b("buffer"),u=v.Buffer;u.from&&u.alloc&&u.allocUnsafe&&u.allocUnsafeSlow?L.exports=v:(A(v,E),E.Buffer=w),A(u,w),w.from=function(h,a,t){if(typeof h=="number")throw new TypeError("Argument must not be a number");return u(h,a,t)},w.alloc=function(h,a,t){if(typeof h!="number")throw new TypeError("Argument must be a number");var i=u(h);return a!==void 0?typeof t=="string"?i.fill(a,t):i.fill(a):i.fill(0),i},w.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return u(h)},w.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return v.SlowBuffer(h)}},{buffer:38}],194:[function(b,L,E){(function(A){"use strict";function w(d){return d&&d.__esModule?d:{default:d}}var v=b("babel-runtime/core-js/string/from-code-point"),u=w(v),h=b("babel-runtime/core-js/json/stringify"),a=w(h),t=b("babel-runtime/helpers/typeof"),i=w(t),l=b("babel-runtime/core-js/object/define-property"),c=w(l),o=b("babel-runtime/core-js/object/keys"),e=w(o),s=b("babel-runtime/core-js/object/create"),r=w(s);!function(d){function f(M,F){if(!(this instanceof f))return new f(M,F);var oe=this;m(oe),oe.q=oe.c="",oe.bufferCheckPosition=d.MAX_BUFFER_LENGTH,oe.opt=F||{},oe.opt.lowercase=oe.opt.lowercase||oe.opt.lowercasetags,oe.looseCase=oe.opt.lowercase?"toLowerCase":"toUpperCase",oe.tags=[],oe.closed=oe.closedRoot=oe.sawRoot=!1,oe.tag=oe.error=null,oe.strict=!!M,oe.noscript=!(!M&&!oe.opt.noscript),oe.state=O.BEGIN,oe.strictEntities=oe.opt.strictEntities,oe.ENTITIES=oe.strictEntities?(0,r.default)(d.XML_ENTITIES):(0,r.default)(d.ENTITIES),oe.attribList=[],oe.opt.xmlns&&(oe.ns=(0,r.default)(be)),oe.trackPosition=oe.opt.position!==!1,oe.trackPosition&&(oe.position=oe.line=oe.column=0),D(oe,"onready")}function g(M){for(var F=Math.max(d.MAX_BUFFER_LENGTH,10),oe=0,ve=0,ke=ge.length;ve<ke;ve++){var Oe=M[ge[ve]].length;if(Oe>F)switch(ge[ve]){case"textNode":B(M);break;case"cdata":I(M,"oncdata",M.cdata),M.cdata="";break;case"script":I(M,"onscript",M.script),M.script="";break;default:k(M,"Max buffer length exceeded: "+ge[ve])}oe=Math.max(oe,Oe)}var De=d.MAX_BUFFER_LENGTH-oe;M.bufferCheckPosition=De+M.position}function m(M){for(var F=0,oe=ge.length;F<oe;F++)M[ge[F]]=""}function p(M){B(M),M.cdata!==""&&(I(M,"oncdata",M.cdata),M.cdata=""),M.script!==""&&(I(M,"onscript",M.script),M.script="")}function _(M,F){return new y(M,F)}function y(M,F){if(!(this instanceof y))return new y(M,F);ie.apply(this),this._parser=new f(M,F),this.writable=!0,this.readable=!0;var oe=this;this._parser.onend=function(){oe.emit("end")},this._parser.onerror=function(ve){oe.emit("error",ve),oe._parser.error=null},this._decoder=null,te.forEach(function(ve){(0,c.default)(oe,"on"+ve,{get:function(){return oe._parser["on"+ve]},set:function(ke){if(!ke)return oe.removeAllListeners(ve),oe._parser["on"+ve]=ke,ke;oe.on(ve,ke)},enumerable:!0,configurable:!1})})}function n(M){return M===" "||M===`
`||M==="\r"||M===" "}function x(M){return M==='"'||M==="'"}function S(M){return M===">"||n(M)}function T(M,F){return M.test(F)}function R(M,F){return!T(M,F)}function D(M,F,oe){M[F]&&M[F](oe)}function I(M,F,oe){M.textNode&&B(M),D(M,F,oe)}function B(M){M.textNode=G(M.opt,M.textNode),M.textNode&&D(M,"ontext",M.textNode),M.textNode=""}function G(M,F){return M.trim&&(F=F.trim()),M.normalize&&(F=F.replace(/\s+/g," ")),F}function k(M,F){return B(M),M.trackPosition&&(F+=`
Line: `+M.line+`
Column: `+M.column+`
Char: `+M.c),F=new Error(F),M.error=F,D(M,"onerror",F),M}function $(M){return M.sawRoot&&!M.closedRoot&&X(M,"Unclosed root tag"),M.state!==O.BEGIN&&M.state!==O.BEGIN_WHITESPACE&&M.state!==O.TEXT&&k(M,"Unexpected end"),B(M),M.c="",M.closed=!0,D(M,"onend"),f.call(M,M.strict,M.opt),M}function X(M,F){if((M===void 0?"undefined":(0,i.default)(M))!=="object"||!(M instanceof f))throw new Error("bad call to strictFail");M.strict&&k(M,F)}function V(M){M.strict||(M.tagName=M.tagName[M.looseCase]());var F=M.tags[M.tags.length-1]||M,oe=M.tag={name:M.tagName,attributes:{}};M.opt.xmlns&&(oe.ns=F.ns),M.attribList.length=0,I(M,"onopentagstart",oe)}function N(M,F){var oe=M.indexOf(":"),ve=oe<0?["",M]:M.split(":"),ke=ve[0],Oe=ve[1];return F&&M==="xmlns"&&(ke="xmlns",Oe=""),{prefix:ke,local:Oe}}function z(M){if(M.strict||(M.attribName=M.attribName[M.looseCase]()),M.attribList.indexOf(M.attribName)!==-1||M.tag.attributes.hasOwnProperty(M.attribName))return void(M.attribName=M.attribValue="");if(M.opt.xmlns){var F=N(M.attribName,!0),oe=F.prefix,ve=F.local;if(oe==="xmlns")if(ve==="xml"&&M.attribValue!==re)X(M,"xml: prefix must be bound to "+re+`
Actual: `+M.attribValue);else if(ve==="xmlns"&&M.attribValue!==J)X(M,"xmlns: prefix must be bound to "+J+`
Actual: `+M.attribValue);else{var ke=M.tag,Oe=M.tags[M.tags.length-1]||M;ke.ns===Oe.ns&&(ke.ns=(0,r.default)(Oe.ns)),ke.ns[ve]=M.attribValue}M.attribList.push([M.attribName,M.attribValue])}else M.tag.attributes[M.attribName]=M.attribValue,I(M,"onattribute",{name:M.attribName,value:M.attribValue});M.attribName=M.attribValue=""}function q(M,F){if(M.opt.xmlns){var oe=M.tag,ve=N(M.tagName);oe.prefix=ve.prefix,oe.local=ve.local,oe.uri=oe.ns[ve.prefix]||"",oe.prefix&&!oe.uri&&(X(M,"Unbound namespace prefix: "+(0,a.default)(M.tagName)),oe.uri=ve.prefix);var ke=M.tags[M.tags.length-1]||M;oe.ns&&ke.ns!==oe.ns&&(0,e.default)(oe.ns).forEach(function(de){I(M,"onopennamespace",{prefix:de,uri:oe.ns[de]})});for(var Oe=0,De=M.attribList.length;Oe<De;Oe++){var Ue=M.attribList[Oe],Ke=Ue[0],Pe=Ue[1],Re=N(Ke,!0),xe=Re.prefix,we=Re.local,Te=xe===""?"":oe.ns[xe]||"",ue={name:Ke,value:Pe,prefix:xe,local:we,uri:Te};xe&&xe!=="xmlns"&&!Te&&(X(M,"Unbound namespace prefix: "+(0,a.default)(xe)),ue.uri=xe),M.tag.attributes[Ke]=ue,I(M,"onattribute",ue)}M.attribList.length=0}M.tag.isSelfClosing=!!F,M.sawRoot=!0,M.tags.push(M.tag),I(M,"onopentag",M.tag),F||(M.noscript||M.tagName.toLowerCase()!=="script"?M.state=O.TEXT:M.state=O.SCRIPT,M.tag=null,M.tagName=""),M.attribName=M.attribValue="",M.attribList.length=0}function ee(M){if(!M.tagName)return X(M,"Weird empty close tag."),M.textNode+="</>",void(M.state=O.TEXT);if(M.script){if(M.tagName!=="script")return M.script+="</"+M.tagName+">",M.tagName="",void(M.state=O.SCRIPT);I(M,"onscript",M.script),M.script=""}var F=M.tags.length,oe=M.tagName;M.strict||(oe=oe[M.looseCase]());for(var ve=oe;F--&&!(M.tags[F].name===ve);)X(M,"Unexpected close tag");if(F<0)return X(M,"Unmatched closing tag: "+M.tagName),M.textNode+="</"+M.tagName+">",void(M.state=O.TEXT);M.tagName=oe;for(var ke=M.tags.length;ke-- >F;){var Oe=M.tag=M.tags.pop();M.tagName=M.tag.name,I(M,"onclosetag",M.tagName);var De={};for(var Ue in Oe.ns)De[Ue]=Oe.ns[Ue];var Ke=M.tags[M.tags.length-1]||M;M.opt.xmlns&&Oe.ns!==Ke.ns&&(0,e.default)(Oe.ns).forEach(function(Pe){var Re=Oe.ns[Pe];I(M,"onclosenamespace",{prefix:Pe,uri:Re})})}F===0&&(M.closedRoot=!0),M.tagName=M.attribValue=M.attribName="",M.attribList.length=0,M.state=O.TEXT}function fe(M){var F,oe=M.entity,ve=oe.toLowerCase(),ke="";return M.ENTITIES[oe]?M.ENTITIES[oe]:M.ENTITIES[ve]?M.ENTITIES[ve]:(oe=ve,oe.charAt(0)==="#"&&(oe.charAt(1)==="x"?(oe=oe.slice(2),F=parseInt(oe,16),ke=F.toString(16)):(oe=oe.slice(1),F=parseInt(oe,10),ke=F.toString(10))),oe=oe.replace(/^0+/,""),isNaN(F)||ke.toLowerCase()!==oe?(X(M,"Invalid character entity"),"&"+M.entity+";"):(0,u.default)(F))}function ae(M,F){F==="<"?(M.state=O.OPEN_WAKA,M.startTagPosition=M.position):n(F)||(X(M,"Non-whitespace before first tag."),M.textNode=F,M.state=O.TEXT)}function pe(M,F){var oe="";return F<M.length&&(oe=M.charAt(F)),oe}function se(M){var F=this;if(this.error)throw this.error;if(F.closed)return k(F,"Cannot write after close. Assign an onready handler.");if(M===null)return $(F);(M===void 0?"undefined":(0,i.default)(M))==="object"&&(M=M.toString());for(var oe=0,ve="";!(ve=pe(M,oe++),F.c=ve,!ve);)switch(F.trackPosition&&(F.position++,ve===`
`?(F.line++,F.column=0):F.column++),F.state){case O.BEGIN:if(F.state=O.BEGIN_WHITESPACE,ve==="\uFEFF")continue;ae(F,ve);continue;case O.BEGIN_WHITESPACE:ae(F,ve);continue;case O.TEXT:if(F.sawRoot&&!F.closedRoot){for(var ke=oe-1;ve&&ve!=="<"&&ve!=="&";)(ve=pe(M,oe++))&&F.trackPosition&&(F.position++,ve===`
`?(F.line++,F.column=0):F.column++);F.textNode+=M.substring(ke,oe-1)}ve!=="<"||F.sawRoot&&F.closedRoot&&!F.strict?(n(ve)||F.sawRoot&&!F.closedRoot||X(F,"Text data outside of root node."),ve==="&"?F.state=O.TEXT_ENTITY:F.textNode+=ve):(F.state=O.OPEN_WAKA,F.startTagPosition=F.position);continue;case O.SCRIPT:ve==="<"?F.state=O.SCRIPT_ENDING:F.script+=ve;continue;case O.SCRIPT_ENDING:ve==="/"?F.state=O.CLOSE_TAG:(F.script+="<"+ve,F.state=O.SCRIPT);continue;case O.OPEN_WAKA:if(ve==="!")F.state=O.SGML_DECL,F.sgmlDecl="";else if(!n(ve))if(T(Ee,ve))F.state=O.OPEN_TAG,F.tagName=ve;else if(ve==="/")F.state=O.CLOSE_TAG,F.tagName="";else if(ve==="?")F.state=O.PROC_INST,F.procInstName=F.procInstBody="";else{if(X(F,"Unencoded <"),F.startTagPosition+1<F.position){var Oe=F.position-F.startTagPosition;ve=new Array(Oe).join(" ")+ve}F.textNode+="<"+ve,F.state=O.TEXT}continue;case O.SGML_DECL:(F.sgmlDecl+ve).toUpperCase()===Q?(I(F,"onopencdata"),F.state=O.CDATA,F.sgmlDecl="",F.cdata=""):F.sgmlDecl+ve==="--"?(F.state=O.COMMENT,F.comment="",F.sgmlDecl=""):(F.sgmlDecl+ve).toUpperCase()===me?(F.state=O.DOCTYPE,(F.doctype||F.sawRoot)&&X(F,"Inappropriately located doctype declaration"),F.doctype="",F.sgmlDecl=""):ve===">"?(I(F,"onsgmldeclaration",F.sgmlDecl),F.sgmlDecl="",F.state=O.TEXT):(x(ve)&&(F.state=O.SGML_DECL_QUOTED),F.sgmlDecl+=ve);continue;case O.SGML_DECL_QUOTED:ve===F.q&&(F.state=O.SGML_DECL,F.q=""),F.sgmlDecl+=ve;continue;case O.DOCTYPE:ve===">"?(F.state=O.TEXT,I(F,"ondoctype",F.doctype),F.doctype=!0):(F.doctype+=ve,ve==="["?F.state=O.DOCTYPE_DTD:x(ve)&&(F.state=O.DOCTYPE_QUOTED,F.q=ve));continue;case O.DOCTYPE_QUOTED:F.doctype+=ve,ve===F.q&&(F.q="",F.state=O.DOCTYPE);continue;case O.DOCTYPE_DTD:F.doctype+=ve,ve==="]"?F.state=O.DOCTYPE:x(ve)&&(F.state=O.DOCTYPE_DTD_QUOTED,F.q=ve);continue;case O.DOCTYPE_DTD_QUOTED:F.doctype+=ve,ve===F.q&&(F.state=O.DOCTYPE_DTD,F.q="");continue;case O.COMMENT:ve==="-"?F.state=O.COMMENT_ENDING:F.comment+=ve;continue;case O.COMMENT_ENDING:ve==="-"?(F.state=O.COMMENT_ENDED,F.comment=G(F.opt,F.comment),F.comment&&I(F,"oncomment",F.comment),F.comment=""):(F.comment+="-"+ve,F.state=O.COMMENT);continue;case O.COMMENT_ENDED:ve!==">"?(X(F,"Malformed comment"),F.comment+="--"+ve,F.state=O.COMMENT):F.state=O.TEXT;continue;case O.CDATA:ve==="]"?F.state=O.CDATA_ENDING:F.cdata+=ve;continue;case O.CDATA_ENDING:ve==="]"?F.state=O.CDATA_ENDING_2:(F.cdata+="]"+ve,F.state=O.CDATA);continue;case O.CDATA_ENDING_2:ve===">"?(F.cdata&&I(F,"oncdata",F.cdata),I(F,"onclosecdata"),F.cdata="",F.state=O.TEXT):ve==="]"?F.cdata+="]":(F.cdata+="]]"+ve,F.state=O.CDATA);continue;case O.PROC_INST:ve==="?"?F.state=O.PROC_INST_ENDING:n(ve)?F.state=O.PROC_INST_BODY:F.procInstName+=ve;continue;case O.PROC_INST_BODY:if(!F.procInstBody&&n(ve))continue;ve==="?"?F.state=O.PROC_INST_ENDING:F.procInstBody+=ve;continue;case O.PROC_INST_ENDING:ve===">"?(I(F,"onprocessinginstruction",{name:F.procInstName,body:F.procInstBody}),F.procInstName=F.procInstBody="",F.state=O.TEXT):(F.procInstBody+="?"+ve,F.state=O.PROC_INST_BODY);continue;case O.OPEN_TAG:T(Le,ve)?F.tagName+=ve:(V(F),ve===">"?q(F):ve==="/"?F.state=O.OPEN_TAG_SLASH:(n(ve)||X(F,"Invalid character in tag name"),F.state=O.ATTRIB));continue;case O.OPEN_TAG_SLASH:ve===">"?(q(F,!0),ee(F)):(X(F,"Forward-slash in opening tag not followed by >"),F.state=O.ATTRIB);continue;case O.ATTRIB:if(n(ve))continue;ve===">"?q(F):ve==="/"?F.state=O.OPEN_TAG_SLASH:T(Ee,ve)?(F.attribName=ve,F.attribValue="",F.state=O.ATTRIB_NAME):X(F,"Invalid attribute name");continue;case O.ATTRIB_NAME:ve==="="?F.state=O.ATTRIB_VALUE:ve===">"?(X(F,"Attribute without value"),F.attribValue=F.attribName,z(F),q(F)):n(ve)?F.state=O.ATTRIB_NAME_SAW_WHITE:T(Le,ve)?F.attribName+=ve:X(F,"Invalid attribute name");continue;case O.ATTRIB_NAME_SAW_WHITE:if(ve==="=")F.state=O.ATTRIB_VALUE;else{if(n(ve))continue;X(F,"Attribute without value"),F.tag.attributes[F.attribName]="",F.attribValue="",I(F,"onattribute",{name:F.attribName,value:""}),F.attribName="",ve===">"?q(F):T(Ee,ve)?(F.attribName=ve,F.state=O.ATTRIB_NAME):(X(F,"Invalid attribute name"),F.state=O.ATTRIB)}continue;case O.ATTRIB_VALUE:if(n(ve))continue;x(ve)?(F.q=ve,F.state=O.ATTRIB_VALUE_QUOTED):(X(F,"Unquoted attribute value"),F.state=O.ATTRIB_VALUE_UNQUOTED,F.attribValue=ve);continue;case O.ATTRIB_VALUE_QUOTED:if(ve!==F.q){ve==="&"?F.state=O.ATTRIB_VALUE_ENTITY_Q:F.attribValue+=ve;continue}z(F),F.q="",F.state=O.ATTRIB_VALUE_CLOSED;continue;case O.ATTRIB_VALUE_CLOSED:n(ve)?F.state=O.ATTRIB:ve===">"?q(F):ve==="/"?F.state=O.OPEN_TAG_SLASH:T(Ee,ve)?(X(F,"No whitespace between attributes"),F.attribName=ve,F.attribValue="",F.state=O.ATTRIB_NAME):X(F,"Invalid attribute name");continue;case O.ATTRIB_VALUE_UNQUOTED:if(!S(ve)){ve==="&"?F.state=O.ATTRIB_VALUE_ENTITY_U:F.attribValue+=ve;continue}z(F),ve===">"?q(F):F.state=O.ATTRIB;continue;case O.CLOSE_TAG:if(F.tagName)ve===">"?ee(F):T(Le,ve)?F.tagName+=ve:F.script?(F.script+="</"+F.tagName,F.tagName="",F.state=O.SCRIPT):(n(ve)||X(F,"Invalid tagname in closing tag"),F.state=O.CLOSE_TAG_SAW_WHITE);else{if(n(ve))continue;R(Ee,ve)?F.script?(F.script+="</"+ve,F.state=O.SCRIPT):X(F,"Invalid tagname in closing tag."):F.tagName=ve}continue;case O.CLOSE_TAG_SAW_WHITE:if(n(ve))continue;ve===">"?ee(F):X(F,"Invalid characters in closing tag");continue;case O.TEXT_ENTITY:case O.ATTRIB_VALUE_ENTITY_Q:case O.ATTRIB_VALUE_ENTITY_U:var De,Ue;switch(F.state){case O.TEXT_ENTITY:De=O.TEXT,Ue="textNode";break;case O.ATTRIB_VALUE_ENTITY_Q:De=O.ATTRIB_VALUE_QUOTED,Ue="attribValue";break;case O.ATTRIB_VALUE_ENTITY_U:De=O.ATTRIB_VALUE_UNQUOTED,Ue="attribValue"}ve===";"?(F[Ue]+=fe(F),F.entity="",F.state=De):T(F.entity.length?C:H,ve)?F.entity+=ve:(X(F,"Invalid character in entity name"),F[Ue]+="&"+F.entity+ve,F.entity="",F.state=De);continue;default:throw new Error(F,"Unknown state: "+F.state)}return F.position>=F.bufferCheckPosition&&g(F),F}d.parser=function(M,F){return new f(M,F)},d.SAXParser=f,d.SAXStream=y,d.createStream=_,d.MAX_BUFFER_LENGTH=65536;var ge=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];d.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],r.default||(Object.create=function(M){function F(){}return F.prototype=M,new F}),e.default||(Object.keys=function(M){var F=[];for(var oe in M)M.hasOwnProperty(oe)&&F.push(oe);return F}),f.prototype={end:function(){$(this)},write:se,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){p(this)}};var ie;try{ie=b("stream").Stream}catch(M){ie=function(){}}var te=d.EVENTS.filter(function(M){return M!=="error"&&M!=="end"});y.prototype=(0,r.default)(ie.prototype,{constructor:{value:y}}),y.prototype.write=function(M){if(typeof A=="function"&&typeof A.isBuffer=="function"&&A.isBuffer(M)){if(!this._decoder){var F=b("string_decoder").StringDecoder;this._decoder=new F("utf8")}M=this._decoder.write(M)}return this._parser.write(M.toString()),this.emit("data",M),!0},y.prototype.end=function(M){return M&&M.length&&this.write(M),this._parser.end(),!0},y.prototype.on=function(M,F){var oe=this;return oe._parser["on"+M]||te.indexOf(M)===-1||(oe._parser["on"+M]=function(){var ve=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ve.splice(0,0,M),oe.emit.apply(oe,ve)}),ie.prototype.on.call(oe,M,F)};var Q="[CDATA[",me="DOCTYPE",re="http://www.w3.org/XML/1998/namespace",J="http://www.w3.org/2000/xmlns/",be={xml:re,xmlns:J},Ee=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Le=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,H=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,C=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,O=0;d.STATE={BEGIN:O++,BEGIN_WHITESPACE:O++,TEXT:O++,TEXT_ENTITY:O++,OPEN_WAKA:O++,SGML_DECL:O++,SGML_DECL_QUOTED:O++,DOCTYPE:O++,DOCTYPE_QUOTED:O++,DOCTYPE_DTD:O++,DOCTYPE_DTD_QUOTED:O++,COMMENT_STARTING:O++,COMMENT:O++,COMMENT_ENDING:O++,COMMENT_ENDED:O++,CDATA:O++,CDATA_ENDING:O++,CDATA_ENDING_2:O++,PROC_INST:O++,PROC_INST_BODY:O++,PROC_INST_ENDING:O++,OPEN_TAG:O++,OPEN_TAG_SLASH:O++,ATTRIB:O++,ATTRIB_NAME:O++,ATTRIB_NAME_SAW_WHITE:O++,ATTRIB_VALUE:O++,ATTRIB_VALUE_QUOTED:O++,ATTRIB_VALUE_CLOSED:O++,ATTRIB_VALUE_UNQUOTED:O++,ATTRIB_VALUE_ENTITY_Q:O++,ATTRIB_VALUE_ENTITY_U:O++,CLOSE_TAG:O++,CLOSE_TAG_SAW_WHITE:O++,SCRIPT:O++,SCRIPT_ENDING:O++},d.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},d.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},(0,e.default)(d.ENTITIES).forEach(function(M){var F=d.ENTITIES[M],oe=typeof F=="number"?String.fromCharCode(F):F;d.ENTITIES[M]=oe});for(var j in d.STATE)d.STATE[d.STATE[j]]=j;O=d.STATE,u.default||function(){var M=String.fromCharCode,F=Math.floor,oe=function(){var ve,ke,Oe=[],De=-1,Ue=arguments.length;if(!Ue)return"";for(var Ke="";++De<Ue;){var Pe=Number(arguments[De]);if(!isFinite(Pe)||Pe<0||Pe>1114111||F(Pe)!==Pe)throw RangeError("Invalid code point: "+Pe);Pe<=65535?Oe.push(Pe):(Pe-=65536,ve=55296+(Pe>>10),ke=Pe%1024+56320,Oe.push(ve,ke)),(De+1===Ue||Oe.length>16384)&&(Ke+=M.apply(null,Oe),Oe.length=0)}return Ke};c.default?Object.defineProperty(String,"fromCodePoint",{value:oe,configurable:!0,writable:!0}):String.fromCodePoint=oe}()}(E===void 0?(void 0).sax={}:E)}).call(this,b("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/create":19,"babel-runtime/core-js/object/define-property":20,"babel-runtime/core-js/object/keys":23,"babel-runtime/core-js/string/from-code-point":26,"babel-runtime/helpers/typeof":32,buffer:38,stream:195,string_decoder:37}],195:[function(b,L,E){function A(){w.call(this)}L.exports=A;var w=b("events").EventEmitter;b("inherits")(A,w),A.Readable=b("readable-stream/readable.js"),A.Writable=b("readable-stream/writable.js"),A.Duplex=b("readable-stream/duplex.js"),A.Transform=b("readable-stream/transform.js"),A.PassThrough=b("readable-stream/passthrough.js"),A.Stream=A,A.prototype.pipe=function(v,u){function h(s){v.writable&&v.write(s)===!1&&o.pause&&o.pause()}function a(){o.readable&&o.resume&&o.resume()}function t(){e||(e=!0,v.end())}function i(){e||(e=!0,typeof v.destroy=="function"&&v.destroy())}function l(s){if(c(),w.listenerCount(this,"error")===0)throw s}function c(){o.removeListener("data",h),v.removeListener("drain",a),o.removeListener("end",t),o.removeListener("close",i),o.removeListener("error",l),v.removeListener("error",l),o.removeListener("end",c),o.removeListener("close",c),v.removeListener("close",c)}var o=this;o.on("data",h),v.on("drain",a),v._isStdio||u&&u.end===!1||(o.on("end",t),o.on("close",i));var e=!1;return o.on("error",l),v.on("error",l),o.on("end",c),o.on("close",c),v.on("close",c),v.emit("pipe",o),v}},{events:158,inherits:162,"readable-stream/duplex.js":178,"readable-stream/passthrough.js":187,"readable-stream/readable.js":188,"readable-stream/transform.js":189,"readable-stream/writable.js":190}],196:[function(b,L,E){(function(A){var w=b("./lib/request"),v=b("./lib/response"),u=b("xtend"),h=b("builtin-status-codes"),a=b("url"),t=E;t.request=function(i,l){i=typeof i=="string"?a.parse(i):u(i);var c=A.location.protocol.search(/^https?:$/)===-1?"http:":"",o=i.protocol||c,e=i.hostname||i.host,s=i.port,r=i.path||"/";e&&e.indexOf(":")!==-1&&(e="["+e+"]"),i.url=(e?o+"//"+e:"")+(s?":"+s:"")+r,i.method=(i.method||"GET").toUpperCase(),i.headers=i.headers||{};var d=new w(i);return l&&d.on("response",l),d},t.get=function(i,l){var c=t.request(i,l);return c.end(),c},t.ClientRequest=w,t.IncomingMessage=v.IncomingMessage,t.Agent=function(){},t.Agent.defaultMaxSockets=4,t.globalAgent=new t.Agent,t.STATUS_CODES=h,t.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":198,"./lib/response":199,"builtin-status-codes":39,url:203,xtend:236}],197:[function(b,L,E){(function(A){"use strict";function w(){if(h!==void 0)return h;if(A.XMLHttpRequest){h=new A.XMLHttpRequest;try{h.open("GET",A.XDomainRequest?"/":"https://example.com")}catch(i){h=null}}else h=null;return h}function v(i){var l=w();if(!l)return!1;try{return l.responseType=i,l.responseType===i}catch(c){}return!1}function u(i){return typeof i=="function"}E.fetch=u(A.fetch)&&u(A.ReadableStream),E.writableStream=u(A.WritableStream),E.abortController=u(A.AbortController),E.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),E.blobConstructor=!0}catch(i){}var h,a=A.ArrayBuffer!==void 0,t=a&&u(A.ArrayBuffer.prototype.slice);E.arraybuffer=E.fetch||a&&v("arraybuffer"),E.msstream=!E.fetch&&t&&v("ms-stream"),E.mozchunkedarraybuffer=!E.fetch&&a&&v("moz-chunked-arraybuffer"),E.overrideMimeType=E.fetch||!!w()&&u(w().overrideMimeType),E.vbArray=u(A.VBArray),h=null}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],198:[function(b,L,E){(function(A,w,v){"use strict";function u(g,m){return i.fetch&&m?"fetch":i.mozchunkedarraybuffer?"moz-chunked-arraybuffer":i.msstream?"ms-stream":i.arraybuffer&&g?"arraybuffer":i.vbArray&&g?"text:vbarray":"text"}function h(g){try{var m=g.status;return m!==null&&m!==0}catch(p){return!1}}var a=b("babel-runtime/core-js/object/keys"),t=function(g){return g&&g.__esModule?g:{default:g}}(a),i=b("./capability"),l=b("inherits"),c=b("./response"),o=b("readable-stream"),e=b("to-arraybuffer"),s=c.IncomingMessage,r=c.readyStates,d=L.exports=function(g){var m=this;o.Writable.call(m),m._opts=g,m._body=[],m._headers={},g.auth&&m.setHeader("Authorization","Basic "+new v(g.auth).toString("base64")),(0,t.default)(g.headers).forEach(function(y){m.setHeader(y,g.headers[y])});var p,_=!0;if(g.mode==="disable-fetch"||"requestTimeout"in g&&!i.abortController)_=!1,p=!0;else if(g.mode==="prefer-streaming")p=!1;else if(g.mode==="allow-wrong-content-type")p=!i.overrideMimeType;else{if(g.mode&&g.mode!=="default"&&g.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");p=!0}m._mode=u(p,_),m._fetchTimer=null,m.on("finish",function(){m._onFinish()})};l(d,o.Writable),d.prototype.setHeader=function(g,m){var p=this,_=g.toLowerCase();f.indexOf(_)===-1&&(p._headers[_]={name:g,value:m})},d.prototype.getHeader=function(g){var m=this._headers[g.toLowerCase()];return m?m.value:null},d.prototype.removeHeader=function(g){delete this._headers[g.toLowerCase()]},d.prototype._onFinish=function(){var g=this;if(!g._destroyed){var m=g._opts,p=g._headers,_=null;m.method!=="GET"&&m.method!=="HEAD"&&(_=i.arraybuffer?e(v.concat(g._body)):i.blobConstructor?new w.Blob(g._body.map(function(T){return e(T)}),{type:(p["content-type"]||{}).value||""}):v.concat(g._body).toString());var y=[];if((0,t.default)(p).forEach(function(T){var R=p[T].name,D=p[T].value;Array.isArray(D)?D.forEach(function(I){y.push([R,I])}):y.push([R,D])}),g._mode==="fetch"){var n=null;if(i.abortController){var x=new AbortController;n=x.signal,g._fetchAbortController=x,"requestTimeout"in m&&m.requestTimeout!==0&&(g._fetchTimer=w.setTimeout(function(){g.emit("requestTimeout"),g._fetchAbortController&&g._fetchAbortController.abort()},m.requestTimeout))}w.fetch(g._opts.url,{method:g._opts.method,headers:y,body:_||void 0,mode:"cors",credentials:m.withCredentials?"include":"same-origin",signal:n}).then(function(T){g._fetchResponse=T,g._connect()},function(T){w.clearTimeout(g._fetchTimer),g._destroyed||g.emit("error",T)})}else{var S=g._xhr=new w.XMLHttpRequest;try{S.open(g._opts.method,g._opts.url,!0)}catch(T){return void A.nextTick(function(){g.emit("error",T)})}"responseType"in S&&(S.responseType=g._mode.split(":")[0]),"withCredentials"in S&&(S.withCredentials=!!m.withCredentials),g._mode==="text"&&"overrideMimeType"in S&&S.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in m&&(S.timeout=m.requestTimeout,S.ontimeout=function(){g.emit("requestTimeout")}),y.forEach(function(T){S.setRequestHeader(T[0],T[1])}),g._response=null,S.onreadystatechange=function(){switch(S.readyState){case r.LOADING:case r.DONE:g._onXHRProgress()}},g._mode==="moz-chunked-arraybuffer"&&(S.onprogress=function(){g._onXHRProgress()}),S.onerror=function(){g._destroyed||g.emit("error",new Error("XHR error"))};try{S.send(_)}catch(T){return void A.nextTick(function(){g.emit("error",T)})}}}},d.prototype._onXHRProgress=function(){var g=this;h(g._xhr)&&!g._destroyed&&(g._response||g._connect(),g._response._onXHRProgress())},d.prototype._connect=function(){var g=this;g._destroyed||(g._response=new s(g._xhr,g._fetchResponse,g._mode,g._fetchTimer),g._response.on("error",function(m){g.emit("error",m)}),g.emit("response",g._response))},d.prototype._write=function(g,m,p){this._body.push(g),p()},d.prototype.abort=d.prototype.destroy=function(){var g=this;g._destroyed=!0,w.clearTimeout(g._fetchTimer),g._response&&(g._response._destroyed=!0),g._xhr?g._xhr.abort():g._fetchAbortController&&g._fetchAbortController.abort()},d.prototype.end=function(g,m,p){var _=this;typeof g=="function"&&(p=g,g=void 0),o.Writable.prototype.end.call(_,g,m,p)},d.prototype.flushHeaders=function(){},d.prototype.setTimeout=function(){},d.prototype.setNoDelay=function(){},d.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(this,b("_process"),typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{},b("buffer").Buffer)},{"./capability":197,"./response":199,_process:173,"babel-runtime/core-js/object/keys":23,buffer:38,inherits:162,"readable-stream":188,"to-arraybuffer":202}],199:[function(b,L,E){(function(A,w,v){"use strict";var u=b("babel-runtime/core-js/promise"),h=function(o){return o&&o.__esModule?o:{default:o}}(u),a=b("./capability"),t=b("inherits"),i=b("readable-stream"),l=E.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=E.IncomingMessage=function(o,e,s,r){var d=this;if(i.Readable.call(d),d._mode=s,d.headers={},d.rawHeaders=[],d.trailers={},d.rawTrailers=[],d.on("end",function(){A.nextTick(function(){d.emit("close")})}),s==="fetch"){if(d._fetchResponse=e,d.url=e.url,d.statusCode=e.status,d.statusMessage=e.statusText,e.headers.forEach(function(_,y){d.headers[y.toLowerCase()]=_,d.rawHeaders.push(y,_)}),a.writableStream){var f=new WritableStream({write:function(_){return new h.default(function(y,n){d._destroyed?n():d.push(new v(_))?y():d._resumeFetch=y})},close:function(){w.clearTimeout(r),d._destroyed||d.push(null)},abort:function(_){d._destroyed||d.emit("error",_)}});try{return void e.body.pipeTo(f).catch(function(_){w.clearTimeout(r),d._destroyed||d.emit("error",_)})}catch(_){}}var g=e.body.getReader();!function _(){g.read().then(function(y){if(!d._destroyed){if(y.done)return w.clearTimeout(r),void d.push(null);d.push(new v(y.value)),_()}}).catch(function(y){w.clearTimeout(r),d._destroyed||d.emit("error",y)})}()}else if(d._xhr=o,d._pos=0,d.url=o.responseURL,d.statusCode=o.status,d.statusMessage=o.statusText,o.getAllResponseHeaders().split(/\r?\n/).forEach(function(_){var y=_.match(/^([^:]+):\s*(.*)/);if(y){var n=y[1].toLowerCase();n==="set-cookie"?(d.headers[n]===void 0&&(d.headers[n]=[]),d.headers[n].push(y[2])):d.headers[n]!==void 0?d.headers[n]+=", "+y[2]:d.headers[n]=y[2],d.rawHeaders.push(y[1],y[2])}}),d._charset="x-user-defined",!a.overrideMimeType){var m=d.rawHeaders["mime-type"];if(m){var p=m.match(/;\s*charset=([^;])(;|$)/);p&&(d._charset=p[1].toLowerCase())}d._charset||(d._charset="utf-8")}};t(c,i.Readable),c.prototype._read=function(){var o=this,e=o._resumeFetch;e&&(o._resumeFetch=null,e())},c.prototype._onXHRProgress=function(){var o=this,e=o._xhr,s=null;switch(o._mode){case"text:vbarray":if(e.readyState!==l.DONE)break;try{s=new w.VBArray(e.responseBody).toArray()}catch(m){}if(s!==null){o.push(new v(s));break}case"text":try{s=e.responseText}catch(m){o._mode="text:vbarray";break}if(s.length>o._pos){var r=s.substr(o._pos);if(o._charset==="x-user-defined"){for(var d=new v(r.length),f=0;f<r.length;f++)d[f]=255&r.charCodeAt(f);o.push(d)}else o.push(r,o._charset);o._pos=s.length}break;case"arraybuffer":if(e.readyState!==l.DONE||!e.response)break;s=e.response,o.push(new v(new Uint8Array(s)));break;case"moz-chunked-arraybuffer":if(s=e.response,e.readyState!==l.LOADING||!s)break;o.push(new v(new Uint8Array(s)));break;case"ms-stream":if(s=e.response,e.readyState!==l.LOADING)break;var g=new w.MSStreamReader;g.onprogress=function(){g.result.byteLength>o._pos&&(o.push(new v(new Uint8Array(g.result.slice(o._pos)))),o._pos=g.result.byteLength)},g.onload=function(){o.push(null)},g.readAsArrayBuffer(s)}o._xhr.readyState===l.DONE&&o._mode!=="ms-stream"&&o.push(null)}}).call(this,b("_process"),typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{},b("buffer").Buffer)},{"./capability":197,_process:173,"babel-runtime/core-js/promise":24,buffer:38,inherits:162,"readable-stream":188}],200:[function(b,L,E){"use strict";function A(m){if(!m)return"utf8";for(var p;;)switch(m){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 m;default:if(p)return;m=(""+m).toLowerCase(),p=!0}}function w(m){var p=A(m);if(typeof p!="string"&&(f.isEncoding===g||!g(m)))throw new Error("Unknown encoding: "+m);return p||m}function v(m){this.encoding=w(m);var p;switch(this.encoding){case"utf16le":this.text=c,this.end=o,p=4;break;case"utf8":this.fillLast=t,p=4;break;case"base64":this.text=e,this.end=s,p=3;break;default:return this.write=r,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=f.allocUnsafe(p)}function u(m){return m<=127?0:m>>5==6?2:m>>4==14?3:m>>3==30?4:m>>6==2?-1:-2}function h(m,p,_){var y=p.length-1;if(y<_)return 0;var n=u(p[y]);return n>=0?(n>0&&(m.lastNeed=n-1),n):--y<_||n===-2?0:(n=u(p[y]))>=0?(n>0&&(m.lastNeed=n-2),n):--y<_||n===-2?0:(n=u(p[y]),n>=0?(n>0&&(n===2?n=0:m.lastNeed=n-3),n):0)}function a(m,p,_){if((192&p[0])!=128)return m.lastNeed=0,"\u951F\uFFFD";if(m.lastNeed>1&&p.length>1){if((192&p[1])!=128)return m.lastNeed=1,"\u951F\uFFFD";if(m.lastNeed>2&&p.length>2&&(192&p[2])!=128)return m.lastNeed=2,"\u951F\uFFFD"}}function t(m){var p=this.lastTotal-this.lastNeed,_=a(this,m,p);return _!==void 0?_:this.lastNeed<=m.length?(m.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(m.copy(this.lastChar,p,0,m.length),void(this.lastNeed-=m.length))}function i(m,p){var _=h(this,m,p);if(!this.lastNeed)return m.toString("utf8",p);this.lastTotal=_;var y=m.length-(_-this.lastNeed);return m.copy(this.lastChar,0,y),m.toString("utf8",p,y)}function l(m){var p=m&&m.length?this.write(m):"";return this.lastNeed?p+"\u951F\uFFFD":p}function c(m,p){if((m.length-p)%2==0){var _=m.toString("utf16le",p);if(_){var y=_.charCodeAt(_.length-1);if(y>=55296&&y<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=m[m.length-2],this.lastChar[1]=m[m.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=m[m.length-1],m.toString("utf16le",p,m.length-1)}function o(m){var p=m&&m.length?this.write(m):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return p+this.lastChar.toString("utf16le",0,_)}return p}function e(m,p){var _=(m.length-p)%3;return _===0?m.toString("base64",p):(this.lastNeed=3-_,this.lastTotal=3,_===1?this.lastChar[0]=m[m.length-1]:(this.lastChar[0]=m[m.length-2],this.lastChar[1]=m[m.length-1]),m.toString("base64",p,m.length-_))}function s(m){var p=m&&m.length?this.write(m):"";return this.lastNeed?p+this.lastChar.toString("base64",0,3-this.lastNeed):p}function r(m){return m.toString(this.encoding)}function d(m){return m&&m.length?this.write(m):""}var f=b("safe-buffer").Buffer,g=f.isEncoding||function(m){switch((m=""+m)&&m.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}};E.StringDecoder=v,v.prototype.write=function(m){if(m.length===0)return"";var p,_;if(this.lastNeed){if((p=this.fillLast(m))===void 0)return"";_=this.lastNeed,this.lastNeed=0}else _=0;return _<m.length?p?p+this.text(m,_):this.text(m,_):p||""},v.prototype.end=l,v.prototype.text=i,v.prototype.fillLast=function(m){if(this.lastNeed<=m.length)return m.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);m.copy(this.lastChar,this.lastTotal-this.lastNeed,0,m.length),this.lastNeed-=m.length}},{"safe-buffer":193}],201:[function(b,L,E){(function(A,w){function v(l,c){this._id=l,this._clearFn=c}var u=b("process/browser.js").nextTick,h=Function.prototype.apply,a=Array.prototype.slice,t={},i=0;E.setTimeout=function(){return new v(h.call(setTimeout,window,arguments),clearTimeout)},E.setInterval=function(){return new v(h.call(setInterval,window,arguments),clearInterval)},E.clearTimeout=E.clearInterval=function(l){l.close()},v.prototype.unref=v.prototype.ref=function(){},v.prototype.close=function(){this._clearFn.call(window,this._id)},E.enroll=function(l,c){clearTimeout(l._idleTimeoutId),l._idleTimeout=c},E.unenroll=function(l){clearTimeout(l._idleTimeoutId),l._idleTimeout=-1},E._unrefActive=E.active=function(l){clearTimeout(l._idleTimeoutId);var c=l._idleTimeout;c>=0&&(l._idleTimeoutId=setTimeout(function(){l._onTimeout&&l._onTimeout()},c))},E.setImmediate=typeof A=="function"?A:function(l){var c=i++,o=!(arguments.length<2)&&a.call(arguments,1);return t[c]=!0,u(function(){t[c]&&(o?l.apply(null,o):l.call(null),E.clearImmediate(c))}),c},E.clearImmediate=typeof w=="function"?w:function(l){delete t[l]}}).call(this,b("timers").setImmediate,b("timers").clearImmediate)},{"process/browser.js":173,timers:201}],202:[function(b,L,E){var A=b("buffer").Buffer;L.exports=function(w){if(w instanceof Uint8Array){if(w.byteOffset===0&&w.byteLength===w.buffer.byteLength)return w.buffer;if(typeof w.buffer.slice=="function")return w.buffer.slice(w.byteOffset,w.byteOffset+w.byteLength)}if(A.isBuffer(w)){for(var v=new Uint8Array(w.length),u=w.length,h=0;h<u;h++)v[h]=w[h];return v.buffer}throw new Error("Argument must be a Buffer")}},{buffer:38}],203:[function(b,L,E){"use strict";function A(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function w(n,x,S){if(n&&t.isObject(n)&&n instanceof A)return n;var T=new A;return T.parse(n,x,S),T}function v(n){return t.isString(n)&&(n=w(n)),n instanceof A?n.format():A.prototype.format.call(n)}function u(n,x){return w(n,!1,!0).resolve(x)}function h(n,x){return n?w(n,!1,!0).resolveObject(x):x}var a=b("punycode"),t=b("./util");E.parse=w,E.resolve=u,E.resolveObject=h,E.format=v,E.Url=A;var i=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,o=["<",">",'"',"`"," ","\r",`
`," "],e=["{","}","|","\\","^","`"].concat(o),s=["'"].concat(e),r=["%","/","?",";","#"].concat(s),d=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},p={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=b("querystring");A.prototype.parse=function(n,x,S){if(!t.isString(n))throw new TypeError("Parameter 'url' must be a string, not "+typeof n);var T=n.indexOf("?"),R=T!==-1&&T<n.indexOf("#")?"?":"#",D=n.split(R),I=/\\/g;D[0]=D[0].replace(I,"/"),n=D.join(R);var B=n;if(B=B.trim(),!S&&n.split("#").length===1){var G=c.exec(B);if(G)return this.path=B,this.href=B,this.pathname=G[1],G[2]?(this.search=G[2],this.query=x?y.parse(this.search.substr(1)):this.search.substr(1)):x&&(this.search="",this.query={}),this}var k=i.exec(B);if(k){k=k[0];var $=k.toLowerCase();this.protocol=$,B=B.substr(k.length)}if(S||k||B.match(/^\/\/[^@\/]+@[^@\/]+/)){var X=B.substr(0,2)==="//";!X||k&&p[k]||(B=B.substr(2),this.slashes=!0)}if(!p[k]&&(X||k&&!_[k])){for(var V=-1,N=0;N<d.length;N++){var z=B.indexOf(d[N]);z!==-1&&(V===-1||z<V)&&(V=z)}var q,ee;ee=V===-1?B.lastIndexOf("@"):B.lastIndexOf("@",V),ee!==-1&&(q=B.slice(0,ee),B=B.slice(ee+1),this.auth=decodeURIComponent(q)),V=-1;for(var N=0;N<r.length;N++){var z=B.indexOf(r[N]);z!==-1&&(V===-1||z<V)&&(V=z)}V===-1&&(V=B.length),this.host=B.slice(0,V),B=B.slice(V),this.parseHost(),this.hostname=this.hostname||"";var fe=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!fe)for(var ae=this.hostname.split(/\./),N=0,pe=ae.length;N<pe;N++){var se=ae[N];if(se&&!se.match(f)){for(var ge="",ie=0,te=se.length;ie<te;ie++)se.charCodeAt(ie)>127?ge+="x":ge+=se[ie];if(!ge.match(f)){var Q=ae.slice(0,N),me=ae.slice(N+1),re=se.match(g);re&&(Q.push(re[1]),me.unshift(re[2])),me.length&&(B="/"+me.join(".")+B),this.hostname=Q.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),fe||(this.hostname=a.toASCII(this.hostname));var J=this.port?":"+this.port:"",be=this.hostname||"";this.host=be+J,this.href+=this.host,fe&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),B[0]!=="/"&&(B="/"+B))}if(!m[$])for(var N=0,pe=s.length;N<pe;N++){var Ee=s[N];if(B.indexOf(Ee)!==-1){var Le=encodeURIComponent(Ee);Le===Ee&&(Le=escape(Ee)),B=B.split(Ee).join(Le)}}var H=B.indexOf("#");H!==-1&&(this.hash=B.substr(H),B=B.slice(0,H));var C=B.indexOf("?");if(C!==-1?(this.search=B.substr(C),this.query=B.substr(C+1),x&&(this.query=y.parse(this.query)),B=B.slice(0,C)):x&&(this.search="",this.query={}),B&&(this.pathname=B),_[$]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var J=this.pathname||"",O=this.search||"";this.path=J+O}return this.href=this.format(),this},A.prototype.format=function(){var n=this.auth||"";n&&(n=encodeURIComponent(n),n=n.replace(/%3A/i,":"),n+="@");var x=this.protocol||"",S=this.pathname||"",T=this.hash||"",R=!1,D="";this.host?R=n+this.host:this.hostname&&(R=n+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(R+=":"+this.port)),this.query&&t.isObject(this.query)&&Object.keys(this.query).length&&(D=y.stringify(this.query));var I=this.search||D&&"?"+D||"";return x&&x.substr(-1)!==":"&&(x+=":"),this.slashes||(!x||_[x])&&R!==!1?(R="//"+(R||""),S&&S.charAt(0)!=="/"&&(S="/"+S)):R||(R=""),T&&T.charAt(0)!=="#"&&(T="#"+T),I&&I.charAt(0)!=="?"&&(I="?"+I),S=S.replace(/[?#]/g,function(B){return encodeURIComponent(B)}),I=I.replace("#","%23"),x+R+S+I+T},A.prototype.resolve=function(n){return this.resolveObject(w(n,!1,!0)).format()},A.prototype.resolveObject=function(n){if(t.isString(n)){var x=new A;x.parse(n,!1,!0),n=x}for(var S=new A,T=Object.keys(this),R=0;R<T.length;R++){var D=T[R];S[D]=this[D]}if(S.hash=n.hash,n.href==="")return S.href=S.format(),S;if(n.slashes&&!n.protocol){for(var I=Object.keys(n),B=0;B<I.length;B++){var G=I[B];G!=="protocol"&&(S[G]=n[G])}return _[S.protocol]&&S.hostname&&!S.pathname&&(S.path=S.pathname="/"),S.href=S.format(),S}if(n.protocol&&n.protocol!==S.protocol){if(!_[n.protocol]){for(var k=Object.keys(n),$=0;$<k.length;$++){var X=k[$];S[X]=n[X]}return S.href=S.format(),S}if(S.protocol=n.protocol,n.host||p[n.protocol])S.pathname=n.pathname;else{for(var pe=(n.pathname||"").split("/");pe.length&&!(n.host=pe.shift()););n.host||(n.host=""),n.hostname||(n.hostname=""),pe[0]!==""&&pe.unshift(""),pe.length<2&&pe.unshift(""),S.pathname=pe.join("/")}if(S.search=n.search,S.query=n.query,S.host=n.host||"",S.auth=n.auth,S.hostname=n.hostname||n.host,S.port=n.port,S.pathname||S.search){var V=S.pathname||"",N=S.search||"";S.path=V+N}return S.slashes=S.slashes||n.slashes,S.href=S.format(),S}var z=S.pathname&&S.pathname.charAt(0)==="/",q=n.host||n.pathname&&n.pathname.charAt(0)==="/",ee=q||z||S.host&&n.pathname,fe=ee,ae=S.pathname&&S.pathname.split("/")||[],pe=n.pathname&&n.pathname.split("/")||[],se=S.protocol&&!_[S.protocol];if(se&&(S.hostname="",S.port=null,S.host&&(ae[0]===""?ae[0]=S.host:ae.unshift(S.host)),S.host="",n.protocol&&(n.hostname=null,n.port=null,n.host&&(pe[0]===""?pe[0]=n.host:pe.unshift(n.host)),n.host=null),ee=ee&&(pe[0]===""||ae[0]==="")),q)S.host=n.host||n.host===""?n.host:S.host,S.hostname=n.hostname||n.hostname===""?n.hostname:S.hostname,S.search=n.search,S.query=n.query,ae=pe;else if(pe.length)ae||(ae=[]),ae.pop(),ae=ae.concat(pe),S.search=n.search,S.query=n.query;else if(!t.isNullOrUndefined(n.search)){if(se){S.hostname=S.host=ae.shift();var ge=!!(S.host&&S.host.indexOf("@")>0)&&S.host.split("@");ge&&(S.auth=ge.shift(),S.host=S.hostname=ge.shift())}return S.search=n.search,S.query=n.query,t.isNull(S.pathname)&&t.isNull(S.search)||(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.href=S.format(),S}if(!ae.length)return S.pathname=null,S.search?S.path="/"+S.search:S.path=null,S.href=S.format(),S;for(var ie=ae.slice(-1)[0],te=(S.host||n.host||ae.length>1)&&(ie==="."||ie==="..")||ie==="",Q=0,me=ae.length;me>=0;me--)ie=ae[me],ie==="."?ae.splice(me,1):ie===".."?(ae.splice(me,1),Q++):Q&&(ae.splice(me,1),Q--);if(!ee&&!fe)for(;Q--;Q)ae.unshift("..");!ee||ae[0]===""||ae[0]&&ae[0].charAt(0)==="/"||ae.unshift(""),te&&ae.join("/").substr(-1)!=="/"&&ae.push("");var re=ae[0]===""||ae[0]&&ae[0].charAt(0)==="/";if(se){S.hostname=S.host=re?"":ae.length?ae.shift():"";var ge=!!(S.host&&S.host.indexOf("@")>0)&&S.host.split("@");ge&&(S.auth=ge.shift(),S.host=S.hostname=ge.shift())}return ee=ee||S.host&&ae.length,ee&&!re&&ae.unshift(""),ae.length?S.pathname=ae.join("/"):(S.pathname=null,S.path=null),t.isNull(S.pathname)&&t.isNull(S.search)||(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.auth=n.auth||S.auth,S.slashes=S.slashes||n.slashes,S.href=S.format(),S},A.prototype.parseHost=function(){var n=this.host,x=l.exec(n);x&&(x=x[0],x!==":"&&(this.port=x.substr(1)),n=n.substr(0,n.length-x.length)),n&&(this.hostname=n)}},{"./util":204,punycode:174,querystring:177}],204:[function(b,L,E){"use strict";L.exports={isString:function(A){return typeof A=="string"},isObject:function(A){return typeof A=="object"&&A!==null},isNull:function(A){return A===null},isNullOrUndefined:function(A){return A==null}}},{}],205:[function(b,L,E){(function(A){function w(u,h){function a(){if(!t){if(v("throwDeprecation"))throw new Error(h);v("traceDeprecation")?console.trace(h):console.warn(h),t=!0}return u.apply(this,arguments)}if(v("noDeprecation"))return u;var t=!1;return a}function v(u){try{if(!A.localStorage)return!1}catch(a){return!1}var h=A.localStorage[u];return h!=null&&String(h).toLowerCase()==="true"}L.exports=w}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],206:[function(b,L,E){L.exports=function(A){return A&&typeof A=="object"&&typeof A.copy=="function"&&typeof A.fill=="function"&&typeof A.readUInt8=="function"}},{}],207:[function(b,L,E){(function(A,w){function v(N,z){var q={seen:[],stylize:h};return arguments.length>=3&&(q.depth=arguments[2]),arguments.length>=4&&(q.colors=arguments[3]),r(z)?q.showHidden=z:z&&E._extend(q,z),_(q.showHidden)&&(q.showHidden=!1),_(q.depth)&&(q.depth=2),_(q.colors)&&(q.colors=!1),_(q.customInspect)&&(q.customInspect=!0),q.colors&&(q.stylize=u),t(q,N,q.depth)}function u(N,z){var q=v.styles[z];return q?"["+v.colors[q][0]+"m"+N+"["+v.colors[q][1]+"m":N}function h(N,z){return N}function a(N){var z={};return N.forEach(function(q,ee){z[q]=!0}),z}function t(N,z,q){if(N.customInspect&&z&&T(z.inspect)&&z.inspect!==E.inspect&&(!z.constructor||z.constructor.prototype!==z)){var ee=z.inspect(q,N);return m(ee)||(ee=t(N,ee,q)),ee}var fe=i(N,z);if(fe)return fe;var ae=Object.keys(z),pe=a(ae);if(N.showHidden&&(ae=Object.getOwnPropertyNames(z)),S(z)&&(ae.indexOf("message")>=0||ae.indexOf("description")>=0))return l(z);if(ae.length===0){if(T(z)){var se=z.name?": "+z.name:"";return N.stylize("[Function"+se+"]","special")}if(y(z))return N.stylize(RegExp.prototype.toString.call(z),"regexp");if(x(z))return N.stylize(Date.prototype.toString.call(z),"date");if(S(z))return l(z)}var ge="",ie=!1,te=["{","}"];if((s(z)&&(ie=!0,te=["[","]"]),T(z))&&(ge=" [Function"+(z.name?": "+z.name:"")+"]"),y(z)&&(ge=" "+RegExp.prototype.toString.call(z)),x(z)&&(ge=" "+Date.prototype.toUTCString.call(z)),S(z)&&(ge=" "+l(z)),ae.length===0&&(!ie||z.length==0))return te[0]+ge+te[1];if(q<0)return y(z)?N.stylize(RegExp.prototype.toString.call(z),"regexp"):N.stylize("[Object]","special");N.seen.push(z);var Q;return Q=ie?c(N,z,q,pe,ae):ae.map(function(me){return o(N,z,q,pe,me,ie)}),N.seen.pop(),e(Q,ge,te)}function i(N,z){if(_(z))return N.stylize("undefined","undefined");if(m(z)){var q="'"+JSON.stringify(z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return N.stylize(q,"string")}return g(z)?N.stylize(""+z,"number"):r(z)?N.stylize(""+z,"boolean"):d(z)?N.stylize("null","null"):void 0}function l(N){return"["+Error.prototype.toString.call(N)+"]"}function c(N,z,q,ee,fe){for(var ae=[],pe=0,se=z.length;pe<se;++pe)G(z,String(pe))?ae.push(o(N,z,q,ee,String(pe),!0)):ae.push("");return fe.forEach(function(ge){ge.match(/^\d+$/)||ae.push(o(N,z,q,ee,ge,!0))}),ae}function o(N,z,q,ee,fe,ae){var pe,se,ge;if(ge=Object.getOwnPropertyDescriptor(z,fe)||{value:z[fe]},ge.get?se=ge.set?N.stylize("[Getter/Setter]","special"):N.stylize("[Getter]","special"):ge.set&&(se=N.stylize("[Setter]","special")),G(ee,fe)||(pe="["+fe+"]"),se||(N.seen.indexOf(ge.value)<0?(se=d(q)?t(N,ge.value,null):t(N,ge.value,q-1),se.indexOf(`
`)>-1&&(se=ae?se.split(`
`).map(function(ie){return" "+ie}).join(`
`).substr(2):`
`+se.split(`
`).map(function(ie){return" "+ie}).join(`
`))):se=N.stylize("[Circular]","special")),_(pe)){if(ae&&fe.match(/^\d+$/))return se;pe=JSON.stringify(""+fe),pe.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(pe=pe.substr(1,pe.length-2),pe=N.stylize(pe,"name")):(pe=pe.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),pe=N.stylize(pe,"string"))}return pe+": "+se}function e(N,z,q){var ee=0;return N.reduce(function(fe,ae){return ee++,ae.indexOf(`
`)>=0&&ee++,fe+ae.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?q[0]+(z===""?"":z+`
`)+" "+N.join(`,
`)+" "+q[1]:q[0]+z+" "+N.join(", ")+" "+q[1]}function s(N){return Array.isArray(N)}function r(N){return typeof N=="boolean"}function d(N){return N===null}function f(N){return N==null}function g(N){return typeof N=="number"}function m(N){return typeof N=="string"}function p(N){return typeof N=="symbol"}function _(N){return N===void 0}function y(N){return n(N)&&D(N)==="[object RegExp]"}function n(N){return typeof N=="object"&&N!==null}function x(N){return n(N)&&D(N)==="[object Date]"}function S(N){return n(N)&&(D(N)==="[object Error]"||N instanceof Error)}function T(N){return typeof N=="function"}function R(N){return N===null||typeof N=="boolean"||typeof N=="number"||typeof N=="string"||typeof N=="symbol"||N===void 0}function D(N){return Object.prototype.toString.call(N)}function I(N){return N<10?"0"+N.toString(10):N.toString(10)}function B(){var N=new Date,z=[I(N.getHours()),I(N.getMinutes()),I(N.getSeconds())].join(":");return[N.getDate(),V[N.getMonth()],z].join(" ")}function G(N,z){return Object.prototype.hasOwnProperty.call(N,z)}var k=/%[sdj%]/g;E.format=function(N){if(!m(N)){for(var z=[],q=0;q<arguments.length;q++)z.push(v(arguments[q]));return z.join(" ")}for(var q=1,ee=arguments,fe=ee.length,ae=String(N).replace(k,function(ge){if(ge==="%%")return"%";if(q>=fe)return ge;switch(ge){case"%s":return String(ee[q++]);case"%d":return Number(ee[q++]);case"%j":try{return JSON.stringify(ee[q++])}catch(ie){return"[Circular]"}default:return ge}}),pe=ee[q];q<fe;pe=ee[++q])d(pe)||!n(pe)?ae+=" "+pe:ae+=" "+v(pe);return ae},E.deprecate=function(N,z){function q(){if(!ee){if(A.throwDeprecation)throw new Error(z);A.traceDeprecation?console.trace(z):console.error(z),ee=!0}return N.apply(this,arguments)}if(_(w.process))return function(){return E.deprecate(N,z).apply(this,arguments)};if(A.noDeprecation===!0)return N;var ee=!1;return q};var $,X={};E.debuglog=function(N){if(_($)&&($=A.env.NODE_DEBUG||""),N=N.toUpperCase(),!X[N])if(new RegExp("\\b"+N+"\\b","i").test($)){var z=A.pid;X[N]=function(){var q=E.format.apply(E,arguments);console.error("%s %d: %s",N,z,q)}}else X[N]=function(){};return X[N]},E.inspect=v,v.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]},v.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},E.isArray=s,E.isBoolean=r,E.isNull=d,E.isNullOrUndefined=f,E.isNumber=g,E.isString=m,E.isSymbol=p,E.isUndefined=_,E.isRegExp=y,E.isObject=n,E.isDate=x,E.isError=S,E.isFunction=T,E.isPrimitive=R,E.isBuffer=b("./support/isBuffer");var V=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];E.log=function(){console.log("%s - %s",B(),E.format.apply(E,arguments))},E.inherits=b("inherits"),E._extend=function(N,z){if(!z||!n(z))return N;for(var q=Object.keys(z),ee=q.length;ee--;)N[q[ee]]=z[q[ee]];return N}}).call(this,b("_process"),typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":206,_process:173,inherits:162}],208:[function(b,L,E){"use strict";(function(){E.stripBOM=function(A){return A[0]==="\uFEFF"?A.substring(1):A}}).call(void 0)},{}],209:[function(b,L,E){"use strict";function A(a){return a&&a.__esModule?a:{default:a}}var w=b("babel-runtime/helpers/typeof"),v=A(w),u=b("babel-runtime/core-js/object/keys"),h=A(u);(function(){var a,t,i,l,c,o={}.hasOwnProperty;a=b("xmlbuilder"),t=b("./defaults").defaults,l=function(e){return typeof e=="string"&&(e.indexOf("&")>=0||e.indexOf(">")>=0||e.indexOf("<")>=0)},c=function(e){return"<![CDATA["+i(e)+"]]>"},i=function(e){return e.replace("]]>","]]]]><![CDATA[>")},E.Builder=function(){function e(s){var r,d,f;this.options={},d=t[.2];for(r in d)o.call(d,r)&&(f=d[r],this.options[r]=f);for(r in s)o.call(s,r)&&(f=s[r],this.options[r]=f)}return e.prototype.buildObject=function(s){var r,d,f,g,m;return r=this.options.attrkey,d=this.options.charkey,(0,h.default)(s).length===1&&this.options.rootName===t[.2].rootName?(m=(0,h.default)(s)[0],s=s[m]):m=this.options.rootName,f=function(p){return function(_,y){var n,x,S,T,R,D;if((y===void 0?"undefined":(0,v.default)(y))!=="object")p.options.cdata&&l(y)?_.raw(c(y)):_.txt(y);else if(Array.isArray(y)){for(T in y)if(o.call(y,T)){x=y[T];for(R in x)S=x[R],_=f(_.ele(R),S).up()}}else for(R in y)if(o.call(y,R))if(x=y[R],R===r){if((x===void 0?"undefined":(0,v.default)(x))==="object")for(n in x)D=x[n],_=_.att(n,D)}else if(R===d)_=p.options.cdata&&l(x)?_.raw(c(x)):_.txt(x);else if(Array.isArray(x))for(T in x)o.call(x,T)&&(S=x[T],_=typeof S=="string"?p.options.cdata&&l(S)?_.ele(R).raw(c(S)).up():_.ele(R,S).up():f(_.ele(R),S).up());else(x===void 0?"undefined":(0,v.default)(x))==="object"?_=f(_.ele(R),x).up():typeof x=="string"&&p.options.cdata&&l(x)?_=_.ele(R).raw(c(x)).up():(x==null&&(x=""),_=_.ele(R,x.toString()).up());return _}}(this),g=a.create(m,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),f(g,s).end(this.options.renderOpts)},e}()}).call(void 0)},{"./defaults":210,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,xmlbuilder:235}],210:[function(b,L,E){"use strict";(function(){E.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(void 0)},{}],211:[function(b,L,E){"use strict";function A(i){return i&&i.__esModule?i:{default:i}}var w=b("babel-runtime/core-js/object/get-own-property-names"),v=A(w),u=b("babel-runtime/core-js/object/keys"),h=A(u),a=b("babel-runtime/helpers/typeof"),t=A(a);(function(){var i,l,c,o,e,s,r,d,f=function(p,_){return function(){return p.apply(_,arguments)}},g=function(p,_){function y(){this.constructor=p}for(var n in _)m.call(_,n)&&(p[n]=_[n]);return y.prototype=_.prototype,p.prototype=new y,p.__super__=_.prototype,p},m={}.hasOwnProperty;r=b("sax"),c=b("events"),i=b("./bom"),s=b("./processors"),d=b("timers").setImmediate,l=b("./defaults").defaults,o=function(p){return(p===void 0?"undefined":(0,t.default)(p))==="object"&&p!=null&&(0,h.default)(p).length===0},e=function(p,_,y){var n,x,S;for(n=0,x=p.length;n<x;n++)S=p[n],_=S(_,y);return _},E.Parser=function(p){function _(y){this.parseString=f(this.parseString,this),this.reset=f(this.reset,this),this.assignOrPush=f(this.assignOrPush,this),this.processAsync=f(this.processAsync,this);var n,x,S;if(!(this instanceof E.Parser))return new E.Parser(y);this.options={},x=l[.2];for(n in x)m.call(x,n)&&(S=x[n],this.options[n]=S);for(n in y)m.call(y,n)&&(S=y[n],this.options[n]=S);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(s.normalize)),this.reset()}return g(_,p),_.prototype.processAsync=function(){var y,n;try{return this.remaining.length<=this.options.chunkSize?(y=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(y),this.saxParser.close()):(y=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(y),d(this.processAsync))}catch(x){if(n=x,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(n)}},_.prototype.assignOrPush=function(y,n,x){return n in y?(y[n]instanceof Array||(y[n]=[y[n]]),y[n].push(x)):this.options.explicitArray?y[n]=[x]:y[n]=x},_.prototype.reset=function(){var y,n,x,S;return this.removeAllListeners(),this.saxParser=r.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(T){return function(R){if(T.saxParser.resume(),!T.saxParser.errThrown)return T.saxParser.errThrown=!0,T.emit("error",R)}}(this),this.saxParser.onend=function(T){return function(){if(!T.saxParser.ended)return T.saxParser.ended=!0,T.emit("end",T.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,S=[],y=this.options.attrkey,n=this.options.charkey,this.saxParser.onopentag=function(T){return function(R){var D,I,B,G,k;if(B={},B[n]="",!T.options.ignoreAttrs){k=R.attributes;for(D in k)m.call(k,D)&&(y in B||T.options.mergeAttrs||(B[y]={}),I=T.options.attrValueProcessors?e(T.options.attrValueProcessors,R.attributes[D],D):R.attributes[D],G=T.options.attrNameProcessors?e(T.options.attrNameProcessors,D):D,T.options.mergeAttrs?T.assignOrPush(B,G,I):B[y][G]=I)}return B["#name"]=T.options.tagNameProcessors?e(T.options.tagNameProcessors,R.name):R.name,T.options.xmlns&&(B[T.options.xmlnskey]={uri:R.uri,local:R.local}),S.push(B)}}(this),this.saxParser.onclosetag=function(T){return function(){var R,D,I,B,G,k,$,X,V,N;if(k=S.pop(),G=k["#name"],T.options.explicitChildren&&T.options.preserveChildrenOrder||delete k["#name"],k.cdata===!0&&(R=k.cdata,delete k.cdata),V=S[S.length-1],k[n].match(/^\s*$/)&&!R?(D=k[n],delete k[n]):(T.options.trim&&(k[n]=k[n].trim()),T.options.normalize&&(k[n]=k[n].replace(/\s{2,}/g," ").trim()),k[n]=T.options.valueProcessors?e(T.options.valueProcessors,k[n],G):k[n],(0,h.default)(k).length===1&&n in k&&!T.EXPLICIT_CHARKEY&&(k=k[n])),o(k)&&(k=T.options.emptyTag!==""?T.options.emptyTag:D),T.options.validator!=null&&(N="/"+function(){var z,q,ee;for(ee=[],z=0,q=S.length;z<q;z++)B=S[z],ee.push(B["#name"]);return ee}().concat(G).join("/"),function(){var z;try{k=T.options.validator(N,V&&V[G],k)}catch(q){return z=q,T.emit("error",z)}}()),T.options.explicitChildren&&!T.options.mergeAttrs&&(k===void 0?"undefined":(0,t.default)(k))==="object")if(T.options.preserveChildrenOrder){if(V){V[T.options.childkey]=V[T.options.childkey]||[],$={};for(I in k)m.call(k,I)&&($[I]=k[I]);V[T.options.childkey].push($),delete k["#name"],(0,h.default)(k).length===1&&n in k&&!T.EXPLICIT_CHARKEY&&(k=k[n])}}else B={},T.options.attrkey in k&&(B[T.options.attrkey]=k[T.options.attrkey],delete k[T.options.attrkey]),!T.options.charsAsChildren&&T.options.charkey in k&&(B[T.options.charkey]=k[T.options.charkey],delete k[T.options.charkey]),(0,v.default)(k).length>0&&(B[T.options.childkey]=k),k=B;return S.length>0?T.assignOrPush(V,G,k):(T.options.explicitRoot&&(X=k,k={},k[G]=X),T.resultObject=k,T.saxParser.ended=!0,T.emit("end",T.resultObject))}}(this),x=function(T){return function(R){var D,I;if(I=S[S.length-1])return I[n]+=R,T.options.explicitChildren&&T.options.preserveChildrenOrder&&T.options.charsAsChildren&&(T.options.includeWhiteChars||R.replace(/\\n/g,"").trim()!=="")&&(I[T.options.childkey]=I[T.options.childkey]||[],D={"#name":"__text__"},D[n]=R,T.options.normalize&&(D[n]=D[n].replace(/\s{2,}/g," ").trim()),I[T.options.childkey].push(D)),I}}(this),this.saxParser.ontext=x,this.saxParser.oncdata=function(T){return function(R){var D;if(D=x(R))return D.cdata=!0}}()},_.prototype.parseString=function(y,n){var x;n!=null&&typeof n=="function"&&(this.on("end",function(S){return this.reset(),n(null,S)}),this.on("error",function(S){return this.reset(),n(S)}));try{return y=y.toString(),y.trim()===""?(this.emit("end",null),!0):(y=i.stripBOM(y),this.options.async?(this.remaining=y,d(this.processAsync),this.saxParser):this.saxParser.write(y).close())}catch(S){if(x=S,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",x),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw x}},_}(c.EventEmitter),E.parseString=function(p,_,y){var n,x,S;return y!=null?(typeof y=="function"&&(n=y),(_===void 0?"undefined":(0,t.default)(_))==="object"&&(x=_)):(typeof _=="function"&&(n=_),x={}),S=new E.Parser(x),S.parseString(p,n)}}).call(void 0)},{"./bom":208,"./defaults":210,"./processors":212,"babel-runtime/core-js/object/get-own-property-names":21,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,events:158,sax:194,timers:201}],212:[function(b,L,E){"use strict";(function(){var A;A=new RegExp(/(?!xmlns)^.*:/),E.normalize=function(w){return w.toLowerCase()},E.firstCharLowerCase=function(w){return w.charAt(0).toLowerCase()+w.slice(1)},E.stripPrefix=function(w){return w.replace(A,"")},E.parseNumbers=function(w){return isNaN(w)||(w=w%1==0?parseInt(w,10):parseFloat(w)),w},E.parseBooleans=function(w){return/^(?:true|false)$/i.test(w)&&(w=w.toLowerCase()==="true"),w}}).call(void 0)},{}],213:[function(b,L,E){"use strict";(function(){var A,w,v,u,h=function(t,i){function l(){this.constructor=t}for(var c in i)a.call(i,c)&&(t[c]=i[c]);return l.prototype=i.prototype,t.prototype=new l,t.__super__=i.prototype,t},a={}.hasOwnProperty;w=b("./defaults"),A=b("./builder"),v=b("./parser"),u=b("./processors"),E.defaults=w.defaults,E.processors=u,E.ValidationError=function(t){function i(l){this.message=l}return h(i,t),i}(Error),E.Builder=A.Builder,E.Parser=v.Parser,E.parseString=v.parseString}).call(void 0)},{"./builder":209,"./defaults":210,"./parser":211,"./processors":212}],214:[function(b,L,E){"use strict";function A(i){return i&&i.__esModule?i:{default:i}}var w=b("babel-runtime/core-js/object/get-prototype-of"),v=A(w),u=b("babel-runtime/helpers/typeof"),h=A(u),a=b("babel-runtime/core-js/object/assign"),t=A(a);(function(){var i,l,c,o,e,s,r=[].slice,d={}.hasOwnProperty;i=function(){var f,g,m,p,_,y;if(y=arguments[0],_=2<=arguments.length?r.call(arguments,1):[],o(t.default))t.default.apply(null,arguments);else for(f=0,m=_.length;f<m;f++)if((p=_[f])!=null)for(g in p)d.call(p,g)&&(y[g]=p[g]);return y},o=function(f){return!!f&&Object.prototype.toString.call(f)==="[object Function]"},e=function(f){var g;return!!f&&((g=f===void 0?"undefined":(0,h.default)(f))==="function"||g==="object")},l=function(f){return o(Array.isArray)?Array.isArray(f):Object.prototype.toString.call(f)==="[object Array]"},c=function(f){var g;if(l(f))return!f.length;for(g in f)if(d.call(f,g))return!1;return!0},s=function(f){var g,m;return e(f)&&(m=(0,v.default)(f))&&(g=m.constructor)&&typeof g=="function"&&g instanceof g&&Function.prototype.toString.call(g)===Function.prototype.toString.call(Object)},L.exports.assign=i,L.exports.isFunction=o,L.exports.isObject=e,L.exports.isArray=l,L.exports.isEmpty=c,L.exports.isPlainObject=s}).call(void 0)},{"babel-runtime/core-js/object/assign":18,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/helpers/typeof":32}],215:[function(b,L,E){"use strict";var A=b("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){L.exports=function(){function v(u,h,a){if(this.options=u.options,this.stringify=u.stringify,h==null)throw new Error("Missing attribute name of element "+u.name);if(a==null)throw new Error("Missing attribute value for attribute "+h+" of element "+u.name);this.name=this.stringify.attName(h),this.value=this.stringify.attValue(a)}return v.prototype.clone=function(){return(0,w.default)(this)},v.prototype.toString=function(u){return this.options.writer.set(u).attribute(this)},v}()}).call(void 0)},{"babel-runtime/core-js/object/create":19}],216:[function(b,L,E){"use strict";var A=b("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){var v,u=function(a,t){function i(){this.constructor=a}for(var l in t)h.call(t,l)&&(a[l]=t[l]);return i.prototype=t.prototype,a.prototype=new i,a.__super__=t.prototype,a},h={}.hasOwnProperty;v=b("./XMLNode"),L.exports=function(a){function t(i,l){if(t.__super__.constructor.call(this,i),l==null)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(l)}return u(t,a),t.prototype.clone=function(){return(0,w.default)(this)},t.prototype.toString=function(i){return this.options.writer.set(i).cdata(this)},t}(v)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],217:[function(b,L,E){"use strict";var A=b("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){var v,u=function(a,t){function i(){this.constructor=a}for(var l in t)h.call(t,l)&&(a[l]=t[l]);return i.prototype=t.prototype,a.prototype=new i,a.__super__=t.prototype,a},h={}.hasOwnProperty;v=b("./XMLNode"),L.exports=function(a){function t(i,l){if(t.__super__.constructor.call(this,i),l==null)throw new Error("Missing comment text");this.text=this.stringify.comment(l)}return u(t,a),t.prototype.clone=function(){return(0,w.default)(this)},t.prototype.toString=function(i){return this.options.writer.set(i).comment(this)},t}(v)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],218:[function(b,L,E){"use strict";(function(){var A,w=function(u,h){function a(){this.constructor=u}for(var t in h)v.call(h,t)&&(u[t]=h[t]);return a.prototype=h.prototype,u.prototype=new a,u.__super__=h.prototype,u},v={}.hasOwnProperty;A=b("./XMLNode"),L.exports=function(u){function h(a,t,i,l,c,o){if(h.__super__.constructor.call(this,a),t==null)throw new Error("Missing DTD element name");if(i==null)throw new Error("Missing DTD attribute name");if(!l)throw new Error("Missing DTD attribute type");if(!c)throw new Error("Missing DTD attribute default");if(c.indexOf("#")!==0&&(c="#"+c),!c.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(o&&!c.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(t),this.attributeName=this.stringify.attName(i),this.attributeType=this.stringify.dtdAttType(l),this.defaultValue=this.stringify.dtdAttDefault(o),this.defaultValueType=c}return w(h,u),h.prototype.toString=function(a){return this.options.writer.set(a).dtdAttList(this)},h}(A)}).call(void 0)},{"./XMLNode":227}],219:[function(b,L,E){"use strict";(function(){var A,w=function(u,h){function a(){this.constructor=u}for(var t in h)v.call(h,t)&&(u[t]=h[t]);return a.prototype=h.prototype,u.prototype=new a,u.__super__=h.prototype,u},v={}.hasOwnProperty;A=b("./XMLNode"),L.exports=function(u){function h(a,t,i){if(h.__super__.constructor.call(this,a),t==null)throw new Error("Missing DTD element name");i||(i="(#PCDATA)"),Array.isArray(i)&&(i="("+i.join(",")+")"),this.name=this.stringify.eleName(t),this.value=this.stringify.dtdElementValue(i)}return w(h,u),h.prototype.toString=function(a){return this.options.writer.set(a).dtdElement(this)},h}(A)}).call(void 0)},{"./XMLNode":227}],220:[function(b,L,E){"use strict";(function(){var A,w,v=function(h,a){function t(){this.constructor=h}for(var i in a)u.call(a,i)&&(h[i]=a[i]);return t.prototype=a.prototype,h.prototype=new t,h.__super__=a.prototype,h},u={}.hasOwnProperty;w=b("./Utility").isObject,A=b("./XMLNode"),L.exports=function(h){function a(t,i,l,c){if(a.__super__.constructor.call(this,t),l==null)throw new Error("Missing entity name");if(c==null)throw new Error("Missing entity value");if(this.pe=!!i,this.name=this.stringify.eleName(l),w(c)){if(!c.pubID&&!c.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(c.pubID&&!c.sysID)throw new Error("System identifier is required for a public external entity");if(c.pubID!=null&&(this.pubID=this.stringify.dtdPubID(c.pubID)),c.sysID!=null&&(this.sysID=this.stringify.dtdSysID(c.sysID)),c.nData!=null&&(this.nData=this.stringify.dtdNData(c.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}else this.value=this.stringify.dtdEntityValue(c)}return v(a,h),a.prototype.toString=function(t){return this.options.writer.set(t).dtdEntity(this)},a}(A)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],221:[function(b,L,E){"use strict";(function(){var A,w=function(u,h){function a(){this.constructor=u}for(var t in h)v.call(h,t)&&(u[t]=h[t]);return a.prototype=h.prototype,u.prototype=new a,u.__super__=h.prototype,u},v={}.hasOwnProperty;A=b("./XMLNode"),L.exports=function(u){function h(a,t,i){if(h.__super__.constructor.call(this,a),t==null)throw new Error("Missing notation name");if(!i.pubID&&!i.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(t),i.pubID!=null&&(this.pubID=this.stringify.dtdPubID(i.pubID)),i.sysID!=null&&(this.sysID=this.stringify.dtdSysID(i.sysID))}return w(h,u),h.prototype.toString=function(a){return this.options.writer.set(a).dtdNotation(this)},h}(A)}).call(void 0)},{"./XMLNode":227}],222:[function(b,L,E){"use strict";(function(){var A,w,v=function(h,a){function t(){this.constructor=h}for(var i in a)u.call(a,i)&&(h[i]=a[i]);return t.prototype=a.prototype,h.prototype=new t,h.__super__=a.prototype,h},u={}.hasOwnProperty;w=b("./Utility").isObject,A=b("./XMLNode"),L.exports=function(h){function a(t,i,l,c){var o;a.__super__.constructor.call(this,t),w(i)&&(o=i,i=o.version,l=o.encoding,c=o.standalone),i||(i="1.0"),this.version=this.stringify.xmlVersion(i),l!=null&&(this.encoding=this.stringify.xmlEncoding(l)),c!=null&&(this.standalone=this.stringify.xmlStandalone(c))}return v(a,h),a.prototype.toString=function(t){return this.options.writer.set(t).declaration(this)},a}(A)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],223:[function(b,L,E){"use strict";(function(){var A,w,v,u,h,a,t=function(l,c){function o(){this.constructor=l}for(var e in c)i.call(c,e)&&(l[e]=c[e]);return o.prototype=c.prototype,l.prototype=new o,l.__super__=c.prototype,l},i={}.hasOwnProperty;a=b("./Utility").isObject,h=b("./XMLNode"),A=b("./XMLDTDAttList"),v=b("./XMLDTDEntity"),w=b("./XMLDTDElement"),u=b("./XMLDTDNotation"),L.exports=function(l){function c(o,e,s){var r,d;c.__super__.constructor.call(this,o),this.documentObject=o,a(e)&&(r=e,e=r.pubID,s=r.sysID),s==null&&(d=[e,s],s=d[0],e=d[1]),e!=null&&(this.pubID=this.stringify.dtdPubID(e)),s!=null&&(this.sysID=this.stringify.dtdSysID(s))}return t(c,l),c.prototype.element=function(o,e){var s;return s=new w(this,o,e),this.children.push(s),this},c.prototype.attList=function(o,e,s,r,d){var f;return f=new A(this,o,e,s,r,d),this.children.push(f),this},c.prototype.entity=function(o,e){var s;return s=new v(this,!1,o,e),this.children.push(s),this},c.prototype.pEntity=function(o,e){var s;return s=new v(this,!0,o,e),this.children.push(s),this},c.prototype.notation=function(o,e){var s;return s=new u(this,o,e),this.children.push(s),this},c.prototype.toString=function(o){return this.options.writer.set(o).docType(this)},c.prototype.ele=function(o,e){return this.element(o,e)},c.prototype.att=function(o,e,s,r,d){return this.attList(o,e,s,r,d)},c.prototype.ent=function(o,e){return this.entity(o,e)},c.prototype.pent=function(o,e){return this.pEntity(o,e)},c.prototype.not=function(o,e){return this.notation(o,e)},c.prototype.up=function(){return this.root()||this.documentObject},c}(h)}).call(void 0)},{"./Utility":214,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLNode":227}],224:[function(b,L,E){"use strict";(function(){var A,w,v,u,h=function(t,i){function l(){this.constructor=t}for(var c in i)a.call(i,c)&&(t[c]=i[c]);return l.prototype=i.prototype,t.prototype=new l,t.__super__=i.prototype,t},a={}.hasOwnProperty;u=b("./Utility").isPlainObject,A=b("./XMLNode"),v=b("./XMLStringifier"),w=b("./XMLStringWriter"),L.exports=function(t){function i(l){i.__super__.constructor.call(this,null),l||(l={}),l.writer||(l.writer=new w),this.options=l,this.stringify=new v(l),this.isDocument=!0}return h(i,t),i.prototype.end=function(l){var c;return l?u(l)&&(c=l,l=this.options.writer.set(c)):l=this.options.writer,l.document(this)},i.prototype.toString=function(l){return this.options.writer.set(l).document(this)},i}(A)}).call(void 0)},{"./Utility":214,"./XMLNode":227,"./XMLStringWriter":231,"./XMLStringifier":232}],225:[function(b,L,E){"use strict";(function(){var A,w,v,u,h,a,t,i,l,c,o,e,s,r,d,f,g,m,p,_={}.hasOwnProperty;p=b("./Utility"),g=p.isObject,f=p.isFunction,m=p.isPlainObject,c=b("./XMLElement"),w=b("./XMLCData"),v=b("./XMLComment"),e=b("./XMLRaw"),d=b("./XMLText"),o=b("./XMLProcessingInstruction"),i=b("./XMLDeclaration"),l=b("./XMLDocType"),u=b("./XMLDTDAttList"),a=b("./XMLDTDEntity"),h=b("./XMLDTDElement"),t=b("./XMLDTDNotation"),A=b("./XMLAttribute"),r=b("./XMLStringifier"),s=b("./XMLStringWriter"),L.exports=function(){function y(n,x,S){var T;n||(n={}),n.writer?m(n.writer)&&(T=n.writer,n.writer=new s(T)):n.writer=new s(n),this.options=n,this.writer=n.writer,this.stringify=new r(n),this.onDataCallback=x||function(){},this.onEndCallback=S||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return y.prototype.node=function(n,x,S){var T;if(n==null)throw new Error("Missing node name");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node");return this.openCurrent(),n=n.valueOf(),x==null&&(x={}),x=x.valueOf(),g(x)||(T=[x,S],S=T[0],x=T[1]),this.currentNode=new c(this,n,x),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,S!=null&&this.text(S),this},y.prototype.element=function(n,x,S){return this.currentNode&&this.currentNode instanceof l?this.dtdElement.apply(this,arguments):this.node(n,x,S)},y.prototype.attribute=function(n,x){var S,T;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode");if(n!=null&&(n=n.valueOf()),g(n))for(S in n)_.call(n,S)&&(T=n[S],this.attribute(S,T));else f(x)&&(x=x.apply()),this.options.skipNullAttributes&&x==null||(this.currentNode.attributes[n]=new A(this,n,x));return this},y.prototype.text=function(n){var x;return this.openCurrent(),x=new d(this,n),this.onData(this.writer.text(x,this.currentLevel+1)),this},y.prototype.cdata=function(n){var x;return this.openCurrent(),x=new w(this,n),this.onData(this.writer.cdata(x,this.currentLevel+1)),this},y.prototype.comment=function(n){var x;return this.openCurrent(),x=new v(this,n),this.onData(this.writer.comment(x,this.currentLevel+1)),this},y.prototype.raw=function(n){var x;return this.openCurrent(),x=new e(this,n),this.onData(this.writer.raw(x,this.currentLevel+1)),this},y.prototype.instruction=function(n,x){var S,T,R,D,I;if(this.openCurrent(),n!=null&&(n=n.valueOf()),x!=null&&(x=x.valueOf()),Array.isArray(n))for(S=0,D=n.length;S<D;S++)T=n[S],this.instruction(T);else if(g(n))for(T in n)_.call(n,T)&&(R=n[T],this.instruction(T,R));else f(x)&&(x=x.apply()),I=new o(this,n,x),this.onData(this.writer.processingInstruction(I,this.currentLevel+1));return this},y.prototype.declaration=function(n,x,S){var T;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node");return T=new i(this,n,x,S),this.onData(this.writer.declaration(T,this.currentLevel+1)),this},y.prototype.doctype=function(n,x,S){if(this.openCurrent(),n==null)throw new Error("Missing root node name");if(this.root)throw new Error("dtd() must come before the root node");return this.currentNode=new l(this,x,S),this.currentNode.rootNodeName=n,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},y.prototype.dtdElement=function(n,x){var S;return this.openCurrent(),S=new h(this,n,x),this.onData(this.writer.dtdElement(S,this.currentLevel+1)),this},y.prototype.attList=function(n,x,S,T,R){var D;return this.openCurrent(),D=new u(this,n,x,S,T,R),this.onData(this.writer.dtdAttList(D,this.currentLevel+1)),this},y.prototype.entity=function(n,x){var S;return this.openCurrent(),S=new a(this,!1,n,x),this.onData(this.writer.dtdEntity(S,this.currentLevel+1)),this},y.prototype.pEntity=function(n,x){var S;return this.openCurrent(),S=new a(this,!0,n,x),this.onData(this.writer.dtdEntity(S,this.currentLevel+1)),this},y.prototype.notation=function(n,x){var S;return this.openCurrent(),S=new t(this,n,x),this.onData(this.writer.dtdNotation(S,this.currentLevel+1)),this},y.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},y.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},y.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},y.prototype.openNode=function(n){if(!n.isOpen)return!this.root&&this.currentLevel===0&&n instanceof c&&(this.root=n),this.onData(this.writer.openNode(n,this.currentLevel)),n.isOpen=!0},y.prototype.closeNode=function(n){if(!n.isClosed)return this.onData(this.writer.closeNode(n,this.currentLevel)),n.isClosed=!0},y.prototype.onData=function(n){return this.documentStarted=!0,this.onDataCallback(n)},y.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},y.prototype.ele=function(){return this.element.apply(this,arguments)},y.prototype.nod=function(n,x,S){return this.node(n,x,S)},y.prototype.txt=function(n){return this.text(n)},y.prototype.dat=function(n){return this.cdata(n)},y.prototype.com=function(n){return this.comment(n)},y.prototype.ins=function(n,x){return this.instruction(n,x)},y.prototype.dec=function(n,x,S){return this.declaration(n,x,S)},y.prototype.dtd=function(n,x,S){return this.doctype(n,x,S)},y.prototype.e=function(n,x,S){return this.element(n,x,S)},y.prototype.n=function(n,x,S){return this.node(n,x,S)},y.prototype.t=function(n){return this.text(n)},y.prototype.d=function(n){return this.cdata(n)},y.prototype.c=function(n){return this.comment(n)},y.prototype.r=function(n){return this.raw(n)},y.prototype.i=function(n,x){return this.instruction(n,x)},y.prototype.att=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},y.prototype.a=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},y.prototype.ent=function(n,x){return this.entity(n,x)},y.prototype.pent=function(n,x){return this.pEntity(n,x)},y.prototype.not=function(n,x){return this.notation(n,x)},y}()}).call(void 0)},{"./Utility":214,"./XMLAttribute":215,"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLStringWriter":231,"./XMLStringifier":232,"./XMLText":233}],226:[function(b,L,E){"use strict";var A=b("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){var v,u,h,a,t,i=function(c,o){function e(){this.constructor=c}for(var s in o)l.call(o,s)&&(c[s]=o[s]);return e.prototype=o.prototype,c.prototype=new e,c.__super__=o.prototype,c},l={}.hasOwnProperty;t=b("./Utility"),a=t.isObject,h=t.isFunction,u=b("./XMLNode"),v=b("./XMLAttribute"),L.exports=function(c){function o(e,s,r){if(o.__super__.constructor.call(this,e),s==null)throw new Error("Missing element name");this.name=this.stringify.eleName(s),this.attributes={},r!=null&&this.attribute(r),e.isDocument&&(this.isRoot=!0,this.documentObject=e,e.rootObject=this)}return i(o,c),o.prototype.clone=function(){var e,s,r,d;r=(0,w.default)(this),r.isRoot&&(r.documentObject=null),r.attributes={},d=this.attributes;for(s in d)l.call(d,s)&&(e=d[s],r.attributes[s]=e.clone());return r.children=[],this.children.forEach(function(f){var g;return g=f.clone(),g.parent=r,r.children.push(g)}),r},o.prototype.attribute=function(e,s){var r,d;if(e!=null&&(e=e.valueOf()),a(e))for(r in e)l.call(e,r)&&(d=e[r],this.attribute(r,d));else h(s)&&(s=s.apply()),this.options.skipNullAttributes&&s==null||(this.attributes[e]=new v(this,e,s));return this},o.prototype.removeAttribute=function(e){var s,r,d;if(e==null)throw new Error("Missing attribute name");if(e=e.valueOf(),Array.isArray(e))for(r=0,d=e.length;r<d;r++)s=e[r],delete this.attributes[s];else delete this.attributes[e];return this},o.prototype.toString=function(e){return this.options.writer.set(e).element(this)},o.prototype.att=function(e,s){return this.attribute(e,s)},o.prototype.a=function(e,s){return this.attribute(e,s)},o}(u)}).call(void 0)},{"./Utility":214,"./XMLAttribute":215,"./XMLNode":227,"babel-runtime/core-js/object/create":19}],227:[function(b,L,E){"use strict";(function(){var A,w,v,u,h,a,t,i,l,c,o,e,s={}.hasOwnProperty;e=b("./Utility"),o=e.isObject,c=e.isFunction,l=e.isEmpty,h=null,A=null,w=null,v=null,u=null,t=null,i=null,a=null,L.exports=function(){function r(d){this.parent=d,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],h||(h=b("./XMLElement"),A=b("./XMLCData"),w=b("./XMLComment"),v=b("./XMLDeclaration"),u=b("./XMLDocType"),t=b("./XMLRaw"),i=b("./XMLText"),a=b("./XMLProcessingInstruction"))}return r.prototype.element=function(d,f,g){var m,p,_,y,n,x,S,T,R,D;if(x=null,f==null&&(f={}),f=f.valueOf(),o(f)||(R=[f,g],g=R[0],f=R[1]),d!=null&&(d=d.valueOf()),Array.isArray(d))for(_=0,S=d.length;_<S;_++)p=d[_],x=this.element(p);else if(c(d))x=this.element(d.apply());else if(o(d)){for(n in d)if(s.call(d,n))if(D=d[n],c(D)&&(D=D.apply()),o(D)&&l(D)&&(D=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&n.indexOf(this.stringify.convertAttKey)===0)x=this.attribute(n.substr(this.stringify.convertAttKey.length),D);else if(!this.options.separateArrayItems&&Array.isArray(D))for(y=0,T=D.length;y<T;y++)p=D[y],m={},m[n]=p,x=this.element(m);else o(D)?(x=this.element(n),x.element(D)):x=this.element(n,D)}else x=!this.options.ignoreDecorators&&this.stringify.convertTextKey&&d.indexOf(this.stringify.convertTextKey)===0?this.text(g):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&d.indexOf(this.stringify.convertCDataKey)===0?this.cdata(g):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&d.indexOf(this.stringify.convertCommentKey)===0?this.comment(g):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&d.indexOf(this.stringify.convertRawKey)===0?this.raw(g):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&d.indexOf(this.stringify.convertPIKey)===0?this.instruction(d.substr(this.stringify.convertPIKey.length),g):this.node(d,f,g);if(x==null)throw new Error("Could not create any elements with: "+d);return x},r.prototype.insertBefore=function(d,f,g){var m,p,_;if(this.isRoot)throw new Error("Cannot insert elements at root level");return p=this.parent.children.indexOf(this),_=this.parent.children.splice(p),m=this.parent.element(d,f,g),Array.prototype.push.apply(this.parent.children,_),m},r.prototype.insertAfter=function(d,f,g){var m,p,_;if(this.isRoot)throw new Error("Cannot insert elements at root level");return p=this.parent.children.indexOf(this),_=this.parent.children.splice(p+1),m=this.parent.element(d,f,g),Array.prototype.push.apply(this.parent.children,_),m},r.prototype.remove=function(){var d;if(this.isRoot)throw new Error("Cannot remove the root element");return d=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[d,d-d+1].concat([])),this.parent},r.prototype.node=function(d,f,g){var m,p;return d!=null&&(d=d.valueOf()),f||(f={}),f=f.valueOf(),o(f)||(p=[f,g],g=p[0],f=p[1]),m=new h(this,d,f),g!=null&&m.text(g),this.children.push(m),m},r.prototype.text=function(d){var f;return f=new i(this,d),this.children.push(f),this},r.prototype.cdata=function(d){var f;return f=new A(this,d),this.children.push(f),this},r.prototype.comment=function(d){var f;return f=new w(this,d),this.children.push(f),this},r.prototype.commentBefore=function(d){var f,g;return f=this.parent.children.indexOf(this),g=this.parent.children.splice(f),this.parent.comment(d),Array.prototype.push.apply(this.parent.children,g),this},r.prototype.commentAfter=function(d){var f,g;return f=this.parent.children.indexOf(this),g=this.parent.children.splice(f+1),this.parent.comment(d),Array.prototype.push.apply(this.parent.children,g),this},r.prototype.raw=function(d){var f;return f=new t(this,d),this.children.push(f),this},r.prototype.instruction=function(d,f){var g,m,p,_,y;if(d!=null&&(d=d.valueOf()),f!=null&&(f=f.valueOf()),Array.isArray(d))for(_=0,y=d.length;_<y;_++)g=d[_],this.instruction(g);else if(o(d))for(g in d)s.call(d,g)&&(m=d[g],this.instruction(g,m));else c(f)&&(f=f.apply()),p=new a(this,d,f),this.children.push(p);return this},r.prototype.instructionBefore=function(d,f){var g,m;return g=this.parent.children.indexOf(this),m=this.parent.children.splice(g),this.parent.instruction(d,f),Array.prototype.push.apply(this.parent.children,m),this},r.prototype.instructionAfter=function(d,f){var g,m;return g=this.parent.children.indexOf(this),m=this.parent.children.splice(g+1),this.parent.instruction(d,f),Array.prototype.push.apply(this.parent.children,m),this},r.prototype.declaration=function(d,f,g){var m,p;return m=this.document(),p=new v(m,d,f,g),m.children[0]instanceof v?m.children[0]=p:m.children.unshift(p),m.root()||m},r.prototype.doctype=function(d,f){var g,m,p,_,y,n,x,S,T,R;for(m=this.document(),p=new u(m,d,f),T=m.children,_=y=0,x=T.length;y<x;_=++y)if((g=T[_])instanceof u)return m.children[_]=p,p;for(R=m.children,_=n=0,S=R.length;n<S;_=++n)if(g=R[_],g.isRoot)return m.children.splice(_,0,p),p;return m.children.push(p),p},r.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},r.prototype.root=function(){var d;for(d=this;d;){if(d.isDocument)return d.rootObject;if(d.isRoot)return d;d=d.parent}},r.prototype.document=function(){var d;for(d=this;d;){if(d.isDocument)return d;d=d.parent}},r.prototype.end=function(d){return this.document().end(d)},r.prototype.prev=function(){var d;if((d=this.parent.children.indexOf(this))<1)throw new Error("Already at the first node");return this.parent.children[d-1]},r.prototype.next=function(){var d;if((d=this.parent.children.indexOf(this))===-1||d===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[d+1]},r.prototype.importDocument=function(d){var f;return f=d.root().clone(),f.parent=this,f.isRoot=!1,this.children.push(f),this},r.prototype.ele=function(d,f,g){return this.element(d,f,g)},r.prototype.nod=function(d,f,g){return this.node(d,f,g)},r.prototype.txt=function(d){return this.text(d)},r.prototype.dat=function(d){return this.cdata(d)},r.prototype.com=function(d){return this.comment(d)},r.prototype.ins=function(d,f){return this.instruction(d,f)},r.prototype.doc=function(){return this.document()},r.prototype.dec=function(d,f,g){return this.declaration(d,f,g)},r.prototype.dtd=function(d,f){return this.doctype(d,f)},r.prototype.e=function(d,f,g){return this.element(d,f,g)},r.prototype.n=function(d,f,g){return this.node(d,f,g)},r.prototype.t=function(d){return this.text(d)},r.prototype.d=function(d){return this.cdata(d)},r.prototype.c=function(d){return this.comment(d)},r.prototype.r=function(d){return this.raw(d)},r.prototype.i=function(d,f){return this.instruction(d,f)},r.prototype.u=function(){return this.up()},r.prototype.importXMLBuilder=function(d){return this.importDocument(d)},r}()}).call(void 0)},{"./Utility":214,"./XMLCData":216,"./XMLComment":217,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233}],228:[function(b,L,E){"use strict";var A=b("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){var v,u=function(a,t){function i(){this.constructor=a}for(var l in t)h.call(t,l)&&(a[l]=t[l]);return i.prototype=t.prototype,a.prototype=new i,a.__super__=t.prototype,a},h={}.hasOwnProperty;v=b("./XMLNode"),L.exports=function(a){function t(i,l,c){if(t.__super__.constructor.call(this,i),l==null)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(l),c&&(this.value=this.stringify.insValue(c))}return u(t,a),t.prototype.clone=function(){return(0,w.default)(this)},t.prototype.toString=function(i){return this.options.writer.set(i).processingInstruction(this)},t}(v)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],229:[function(b,L,E){"use strict";var A=b("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){var v,u=function(a,t){function i(){this.constructor=a}for(var l in t)h.call(t,l)&&(a[l]=t[l]);return i.prototype=t.prototype,a.prototype=new i,a.__super__=t.prototype,a},h={}.hasOwnProperty;v=b("./XMLNode"),L.exports=function(a){function t(i,l){if(t.__super__.constructor.call(this,i),l==null)throw new Error("Missing raw text");this.value=this.stringify.raw(l)}return u(t,a),t.prototype.clone=function(){return(0,w.default)(this)},t.prototype.toString=function(i){return this.options.writer.set(i).raw(this)},t}(v)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],230:[function(b,L,E){"use strict";(function(){var A,w,v,u,h,a,t,i,l,c,o,e,s,r=function(f,g){function m(){this.constructor=f}for(var p in g)d.call(g,p)&&(f[p]=g[p]);return m.prototype=g.prototype,f.prototype=new m,f.__super__=g.prototype,f},d={}.hasOwnProperty;t=b("./XMLDeclaration"),i=b("./XMLDocType"),A=b("./XMLCData"),w=b("./XMLComment"),l=b("./XMLElement"),o=b("./XMLRaw"),e=b("./XMLText"),c=b("./XMLProcessingInstruction"),v=b("./XMLDTDAttList"),u=b("./XMLDTDElement"),h=b("./XMLDTDEntity"),a=b("./XMLDTDNotation"),s=b("./XMLWriterBase"),L.exports=function(f){function g(m,p){g.__super__.constructor.call(this,p),this.stream=m}return r(g,f),g.prototype.document=function(m){var p,_,y,n,x,S,T,R;for(S=m.children,_=0,n=S.length;_<n;_++)p=S[_],p.isLastRootNode=!1;for(m.children[m.children.length-1].isLastRootNode=!0,T=m.children,R=[],y=0,x=T.length;y<x;y++)switch(p=T[y],!1){case!(p instanceof t):R.push(this.declaration(p));break;case!(p instanceof i):R.push(this.docType(p));break;case!(p instanceof w):R.push(this.comment(p));break;case!(p instanceof c):R.push(this.processingInstruction(p));break;default:R.push(this.element(p))}return R},g.prototype.attribute=function(m){return this.stream.write(" "+m.name+'="'+m.value+'"')},g.prototype.cdata=function(m,p){return this.stream.write(this.space(p)+"<![CDATA["+m.text+"]]>"+this.endline(m))},g.prototype.comment=function(m,p){return this.stream.write(this.space(p)+"<!-- "+m.text+" -->"+this.endline(m))},g.prototype.declaration=function(m,p){return this.stream.write(this.space(p)),this.stream.write('<?xml version="'+m.version+'"'),m.encoding!=null&&this.stream.write(' encoding="'+m.encoding+'"'),m.standalone!=null&&this.stream.write(' standalone="'+m.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(m))},g.prototype.docType=function(m,p){var _,y,n,x;if(p||(p=0),this.stream.write(this.space(p)),this.stream.write("<!DOCTYPE "+m.root().name),m.pubID&&m.sysID?this.stream.write(' PUBLIC "'+m.pubID+'" "'+m.sysID+'"'):m.sysID&&this.stream.write(' SYSTEM "'+m.sysID+'"'),m.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(m)),x=m.children,y=0,n=x.length;y<n;y++)switch(_=x[y],!1){case!(_ instanceof v):this.dtdAttList(_,p+1);break;case!(_ instanceof u):this.dtdElement(_,p+1);break;case!(_ instanceof h):this.dtdEntity(_,p+1);break;case!(_ instanceof a):this.dtdNotation(_,p+1);break;case!(_ instanceof A):this.cdata(_,p+1);break;case!(_ instanceof w):this.comment(_,p+1);break;case!(_ instanceof c):this.processingInstruction(_,p+1);break;default:throw new Error("Unknown DTD node type: "+_.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(m))},g.prototype.element=function(m,p){var _,y,n,x,S,T,R,D;p||(p=0),D=this.space(p),this.stream.write(D+"<"+m.name),T=m.attributes;for(S in T)d.call(T,S)&&(_=T[S],this.attribute(_));if(m.children.length===0||m.children.every(function(I){return I.value===""}))this.allowEmpty?this.stream.write("></"+m.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&m.children.length===1&&m.children[0].value!=null)this.stream.write(">"),this.stream.write(m.children[0].value),this.stream.write("</"+m.name+">");else{for(this.stream.write(">"+this.newline),R=m.children,n=0,x=R.length;n<x;n++)switch(y=R[n],!1){case!(y instanceof A):this.cdata(y,p+1);break;case!(y instanceof w):this.comment(y,p+1);break;case!(y instanceof l):this.element(y,p+1);break;case!(y instanceof o):this.raw(y,p+1);break;case!(y instanceof e):this.text(y,p+1);break;case!(y instanceof c):this.processingInstruction(y,p+1);break;default:throw new Error("Unknown XML node type: "+y.constructor.name)}this.stream.write(D+"</"+m.name+">")}return this.stream.write(this.endline(m))},g.prototype.processingInstruction=function(m,p){return this.stream.write(this.space(p)+"<?"+m.target),m.value&&this.stream.write(" "+m.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(m))},g.prototype.raw=function(m,p){return this.stream.write(this.space(p)+m.value+this.endline(m))},g.prototype.text=function(m,p){return this.stream.write(this.space(p)+m.value+this.endline(m))},g.prototype.dtdAttList=function(m,p){return this.stream.write(this.space(p)+"<!ATTLIST "+m.elementName+" "+m.attributeName+" "+m.attributeType),m.defaultValueType!=="#DEFAULT"&&this.stream.write(" "+m.defaultValueType),m.defaultValue&&this.stream.write(' "'+m.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(m))},g.prototype.dtdElement=function(m,p){return this.stream.write(this.space(p)+"<!ELEMENT "+m.name+" "+m.value),this.stream.write(this.spacebeforeslash+">"+this.endline(m))},g.prototype.dtdEntity=function(m,p){return this.stream.write(this.space(p)+"<!ENTITY"),m.pe&&this.stream.write(" %"),this.stream.write(" "+m.name),m.value?this.stream.write(' "'+m.value+'"'):(m.pubID&&m.sysID?this.stream.write(' PUBLIC "'+m.pubID+'" "'+m.sysID+'"'):m.sysID&&this.stream.write(' SYSTEM "'+m.sysID+'"'),m.nData&&this.stream.write(" NDATA "+m.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(m))},g.prototype.dtdNotation=function(m,p){return this.stream.write(this.space(p)+"<!NOTATION "+m.name),m.pubID&&m.sysID?this.stream.write(' PUBLIC "'+m.pubID+'" "'+m.sysID+'"'):m.pubID?this.stream.write(' PUBLIC "'+m.pubID+'"'):m.sysID&&this.stream.write(' SYSTEM "'+m.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(m))},g.prototype.endline=function(m){return m.isLastRootNode?"":this.newline},g}(s)}).call(void 0)},{"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233,"./XMLWriterBase":234}],231:[function(b,L,E){"use strict";(function(){var A,w,v,u,h,a,t,i,l,c,o,e,s,r=function(f,g){function m(){this.constructor=f}for(var p in g)d.call(g,p)&&(f[p]=g[p]);return m.prototype=g.prototype,f.prototype=new m,f.__super__=g.prototype,f},d={}.hasOwnProperty;t=b("./XMLDeclaration"),i=b("./XMLDocType"),A=b("./XMLCData"),w=b("./XMLComment"),l=b("./XMLElement"),o=b("./XMLRaw"),e=b("./XMLText"),c=b("./XMLProcessingInstruction"),v=b("./XMLDTDAttList"),u=b("./XMLDTDElement"),h=b("./XMLDTDEntity"),a=b("./XMLDTDNotation"),s=b("./XMLWriterBase"),L.exports=function(f){function g(m){g.__super__.constructor.call(this,m)}return r(g,f),g.prototype.document=function(m){var p,_,y,n,x;for(this.textispresent=!1,n="",x=m.children,_=0,y=x.length;_<y;_++)p=x[_],n+=function(){switch(!1){case!(p instanceof t):return this.declaration(p);case!(p instanceof i):return this.docType(p);case!(p instanceof w):return this.comment(p);case!(p instanceof c):return this.processingInstruction(p);default:return this.element(p,0)}}.call(this);return this.pretty&&n.slice(-this.newline.length)===this.newline&&(n=n.slice(0,-this.newline.length)),n},g.prototype.attribute=function(m){return" "+m.name+'="'+m.value+'"'},g.prototype.cdata=function(m,p){return this.space(p)+"<![CDATA["+m.text+"]]>"+this.newline},g.prototype.comment=function(m,p){return this.space(p)+"<!-- "+m.text+" -->"+this.newline},g.prototype.declaration=function(m,p){var _;return _=this.space(p),_+='<?xml version="'+m.version+'"',m.encoding!=null&&(_+=' encoding="'+m.encoding+'"'),m.standalone!=null&&(_+=' standalone="'+m.standalone+'"'),_+=this.spacebeforeslash+"?>",_+=this.newline},g.prototype.docType=function(m,p){var _,y,n,x,S;if(p||(p=0),x=this.space(p),x+="<!DOCTYPE "+m.root().name,m.pubID&&m.sysID?x+=' PUBLIC "'+m.pubID+'" "'+m.sysID+'"':m.sysID&&(x+=' SYSTEM "'+m.sysID+'"'),m.children.length>0){for(x+=" [",x+=this.newline,S=m.children,y=0,n=S.length;y<n;y++)_=S[y],x+=function(){switch(!1){case!(_ instanceof v):return this.dtdAttList(_,p+1);case!(_ instanceof u):return this.dtdElement(_,p+1);case!(_ instanceof h):return this.dtdEntity(_,p+1);case!(_ instanceof a):return this.dtdNotation(_,p+1);case!(_ instanceof A):return this.cdata(_,p+1);case!(_ instanceof w):return this.comment(_,p+1);case!(_ instanceof c):return this.processingInstruction(_,p+1);default:throw new Error("Unknown DTD node type: "+_.constructor.name)}}.call(this);x+="]"}return x+=this.spacebeforeslash+">",x+=this.newline},g.prototype.element=function(m,p){var _,y,n,x,S,T,R,D,I,B,G,k,$;p||(p=0),$=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),k=this.space(p),D="",D+=k+"<"+m.name,I=m.attributes;for(R in I)d.call(I,R)&&(_=I[R],D+=this.attribute(_));if(m.children.length===0||m.children.every(function(X){return X.value===""}))this.allowEmpty?D+="></"+m.name+">"+this.newline:D+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&m.children.length===1&&m.children[0].value!=null)D+=">",D+=m.children[0].value,D+="</"+m.name+">"+this.newline;else{if(this.dontprettytextnodes){for(B=m.children,n=0,S=B.length;n<S;n++)if(y=B[n],y.value!=null){this.textispresent++,$=!0;break}}for(this.textispresent&&(this.newline="",this.pretty=!1,k=this.space(p)),D+=">"+this.newline,G=m.children,x=0,T=G.length;x<T;x++)y=G[x],D+=function(){switch(!1){case!(y instanceof A):return this.cdata(y,p+1);case!(y instanceof w):return this.comment(y,p+1);case!(y instanceof l):return this.element(y,p+1);case!(y instanceof o):return this.raw(y,p+1);case!(y instanceof e):return this.text(y,p+1);case!(y instanceof c):return this.processingInstruction(y,p+1);default:throw new Error("Unknown XML node type: "+y.constructor.name)}}.call(this);$&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),D+=k+"</"+m.name+">"+this.newline}return D},g.prototype.processingInstruction=function(m,p){var _;return _=this.space(p)+"<?"+m.target,m.value&&(_+=" "+m.value),_+=this.spacebeforeslash+"?>"+this.newline},g.prototype.raw=function(m,p){return this.space(p)+m.value+this.newline},g.prototype.text=function(m,p){return this.space(p)+m.value+this.newline},g.prototype.dtdAttList=function(m,p){var _;return _=this.space(p)+"<!ATTLIST "+m.elementName+" "+m.attributeName+" "+m.attributeType,m.defaultValueType!=="#DEFAULT"&&(_+=" "+m.defaultValueType),m.defaultValue&&(_+=' "'+m.defaultValue+'"'),_+=this.spacebeforeslash+">"+this.newline},g.prototype.dtdElement=function(m,p){return this.space(p)+"<!ELEMENT "+m.name+" "+m.value+this.spacebeforeslash+">"+this.newline},g.prototype.dtdEntity=function(m,p){var _;return _=this.space(p)+"<!ENTITY",m.pe&&(_+=" %"),_+=" "+m.name,m.value?_+=' "'+m.value+'"':(m.pubID&&m.sysID?_+=' PUBLIC "'+m.pubID+'" "'+m.sysID+'"':m.sysID&&(_+=' SYSTEM "'+m.sysID+'"'),m.nData&&(_+=" NDATA "+m.nData)),_+=this.spacebeforeslash+">"+this.newline},g.prototype.dtdNotation=function(m,p){var _;return _=this.space(p)+"<!NOTATION "+m.name,m.pubID&&m.sysID?_+=' PUBLIC "'+m.pubID+'" "'+m.sysID+'"':m.pubID?_+=' PUBLIC "'+m.pubID+'"':m.sysID&&(_+=' SYSTEM "'+m.sysID+'"'),_+=this.spacebeforeslash+">"+this.newline},g.prototype.openNode=function(m,p){var _,y,n,x;if(p||(p=0),m instanceof l){n=this.space(p)+"<"+m.name,x=m.attributes;for(y in x)d.call(x,y)&&(_=x[y],n+=this.attribute(_));return n+=(m.children?">":"/>")+this.newline}return n=this.space(p)+"<!DOCTYPE "+m.rootNodeName,m.pubID&&m.sysID?n+=' PUBLIC "'+m.pubID+'" "'+m.sysID+'"':m.sysID&&(n+=' SYSTEM "'+m.sysID+'"'),n+=(m.children?" [":">")+this.newline},g.prototype.closeNode=function(m,p){switch(p||(p=0),!1){case!(m instanceof l):return this.space(p)+"</"+m.name+">"+this.newline;case!(m instanceof i):return this.space(p)+"]>"+this.newline}},g}(s)}).call(void 0)},{"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233,"./XMLWriterBase":234}],232:[function(b,L,E){"use strict";(function(){var A=function(v,u){return function(){return v.apply(u,arguments)}},w={}.hasOwnProperty;L.exports=function(){function v(u){this.assertLegalChar=A(this.assertLegalChar,this);var h,a,t;u||(u={}),this.noDoubleEncoding=u.noDoubleEncoding,a=u.stringify||{};for(h in a)w.call(a,h)&&(t=a[h],this[h]=t)}return v.prototype.eleName=function(u){return u=""+u||"",this.assertLegalChar(u)},v.prototype.eleText=function(u){return u=""+u||"",this.assertLegalChar(this.elEscape(u))},v.prototype.cdata=function(u){return u=""+u||"",u=u.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(u)},v.prototype.comment=function(u){if(u=""+u||"",u.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+u);return this.assertLegalChar(u)},v.prototype.raw=function(u){return""+u||""},v.prototype.attName=function(u){return u=""+u||""},v.prototype.attValue=function(u){return u=""+u||"",this.attEscape(u)},v.prototype.insTarget=function(u){return""+u||""},v.prototype.insValue=function(u){if(u=""+u||"",u.match(/\?>/))throw new Error("Invalid processing instruction value: "+u);return u},v.prototype.xmlVersion=function(u){if(u=""+u||"",!u.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+u);return u},v.prototype.xmlEncoding=function(u){if(u=""+u||"",!u.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+u);return u},v.prototype.xmlStandalone=function(u){return u?"yes":"no"},v.prototype.dtdPubID=function(u){return""+u||""},v.prototype.dtdSysID=function(u){return""+u||""},v.prototype.dtdElementValue=function(u){return""+u||""},v.prototype.dtdAttType=function(u){return""+u||""},v.prototype.dtdAttDefault=function(u){return u!=null?""+u||"":u},v.prototype.dtdEntityValue=function(u){return""+u||""},v.prototype.dtdNData=function(u){return""+u||""},v.prototype.convertAttKey="@",v.prototype.convertPIKey="?",v.prototype.convertTextKey="#text",v.prototype.convertCDataKey="#cdata",v.prototype.convertCommentKey="#comment",v.prototype.convertRawKey="#raw",v.prototype.assertLegalChar=function(u){var h;if(h=u.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+u+" at index "+h.index);return u},v.prototype.elEscape=function(u){var h;return h=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,u.replace(h,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")},v.prototype.attEscape=function(u){var h;return h=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,u.replace(h,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")},v}()}).call(void 0)},{}],233:[function(b,L,E){"use strict";var A=b("babel-runtime/core-js/object/create"),w=function(v){return v&&v.__esModule?v:{default:v}}(A);(function(){var v,u=function(a,t){function i(){this.constructor=a}for(var l in t)h.call(t,l)&&(a[l]=t[l]);return i.prototype=t.prototype,a.prototype=new i,a.__super__=t.prototype,a},h={}.hasOwnProperty;v=b("./XMLNode"),L.exports=function(a){function t(i,l){if(t.__super__.constructor.call(this,i),l==null)throw new Error("Missing element text");this.value=this.stringify.eleText(l)}return u(t,a),t.prototype.clone=function(){return(0,w.default)(this)},t.prototype.toString=function(i){return this.options.writer.set(i).text(this)},t}(v)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],234:[function(b,L,E){"use strict";(function(){var A={}.hasOwnProperty;L.exports=function(){function w(v){var u,h,a,t,i,l,c,o,e;v||(v={}),this.pretty=v.pretty||!1,this.allowEmpty=(h=v.allowEmpty)!=null&&h,this.pretty?(this.indent=(a=v.indent)!=null?a:" ",this.newline=(t=v.newline)!=null?t:`
`,this.offset=(i=v.offset)!=null?i:0,this.dontprettytextnodes=(l=v.dontprettytextnodes)!=null?l:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=(c=v.spacebeforeslash)!=null?c:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,o=v.writer||{};for(u in o)A.call(o,u)&&(e=o[u],this[u]=e)}return w.prototype.set=function(v){var u,h,a;v||(v={}),"pretty"in v&&(this.pretty=v.pretty),"allowEmpty"in v&&(this.allowEmpty=v.allowEmpty),this.pretty?(this.indent="indent"in v?v.indent:" ",this.newline="newline"in v?v.newline:`
`,this.offset="offset"in v?v.offset:0,this.dontprettytextnodes="dontprettytextnodes"in v?v.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in v?v.spacebeforeslash:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,h=v.writer||{};for(u in h)A.call(h,u)&&(a=h[u],this[u]=a);return this},w.prototype.space=function(v){var u;return this.pretty?(u=(v||0)+this.offset+1,u>0?new Array(u).join(this.indent):""):""},w}()}).call(void 0)},{}],235:[function(b,L,E){"use strict";(function(){var A,w,v,u,h,a,t;t=b("./Utility"),h=t.assign,a=t.isFunction,A=b("./XMLDocument"),w=b("./XMLDocumentCB"),u=b("./XMLStringWriter"),v=b("./XMLStreamWriter"),L.exports.create=function(i,l,c,o){var e,s;if(i==null)throw new Error("Root element needs a name");return o=h({},l,c,o),e=new A(o),s=e.element(i),o.headless||(e.declaration(o),o.pubID==null&&o.sysID==null||e.doctype(o)),s},L.exports.begin=function(i,l,c){var o;return a(i)&&(o=[i,l],l=o[0],c=o[1],i={}),l?new w(i,l,c):new A(i)},L.exports.stringWriter=function(i){return new u(i)},L.exports.streamWriter=function(i,l){return new v(i,l)}}).call(void 0)},{"./Utility":214,"./XMLDocument":224,"./XMLDocumentCB":225,"./XMLStreamWriter":230,"./XMLStringWriter":231}],236:[function(b,L,E){function A(){for(var v={},u=0;u<arguments.length;u++){var h=arguments[u];for(var a in h)w.call(h,a)&&(v[a]=h[a])}return v}L.exports=A;var w=Object.prototype.hasOwnProperty},{}],237:[function(b,L,E){"use strict";function A(o,e,s){u.isBuffer(e)||(e=new u(e)),u.isBuffer(s)||(s=new u(s)),e.length>l?e=o(e):e.length<l&&(e=u.concat([e,c],l));for(var r=new u(l),d=new u(l),f=0;f<l;f++)r[f]=54^e[f],d[f]=92^e[f];var g=o(u.concat([r,s]));return o(u.concat([d,g]))}function w(o,e){o=o||"sha1";var s=i[o],r=[],d=0;return s||v("algorithm:",o,"is not yet supported"),{update:function(f){return u.isBuffer(f)||(f=new u(f)),r.push(f),d+=f.length,this},digest:function(f){var g=u.concat(r),m=e?A(s,e,g):s(g);return r=null,f?m.toString(f):m}}}function v(){var o=[].slice.call(arguments).join(" ");throw new Error([o,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
`))}var u=b("buffer").Buffer,h=b("./sha"),a=b("./sha256"),t=b("./md5"),i={sha1:h,sha256:a,md5:t},l=64,c=new u(l);c.fill(0),E.createHash=function(o){return w(o)},E.createHmac=function(o,e){return w(o,e)},function(o,e){for(var s in o)e(o[s],s)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(o){E[o]=function(){v("sorry,",o,"is not implemented yet")}})},{"./md5":239,"./sha":240,"./sha256":241,buffer:38}],238:[function(b,L,E){"use strict";function A(i,l){if(i.length%h!=0){var c=i.length+(h-i.length%h);i=u.concat([i,a],c)}for(var o=[],e=l?i.readInt32BE:i.readInt32LE,s=0;s<i.length;s+=h)o.push(e.call(i,s));return o}function w(i,l,c){for(var o=new u(l),e=c?o.writeInt32BE:o.writeInt32LE,s=0;s<i.length;s++)e.call(o,i[s],4*s,!0);return o}function v(i,l,c,o){return u.isBuffer(i)||(i=new u(i)),w(l(A(i,o),i.length*t),c,o)}var u=b("buffer").Buffer,h=4,a=new u(h);a.fill(0);var t=8;L.exports={hash:v}},{buffer:38}],239:[function(b,L,E){"use strict";function A(c,o){c[o>>5]|=128<<o%32,c[14+(o+64>>>9<<4)]=o;for(var e=1732584193,s=-271733879,r=-1732584194,d=271733878,f=0;f<c.length;f+=16){var g=e,m=s,p=r,_=d;e=v(e,s,r,d,c[f+0],7,-680876936),d=v(d,e,s,r,c[f+1],12,-389564586),r=v(r,d,e,s,c[f+2],17,606105819),s=v(s,r,d,e,c[f+3],22,-1044525330),e=v(e,s,r,d,c[f+4],7,-176418897),d=v(d,e,s,r,c[f+5],12,1200080426),r=v(r,d,e,s,c[f+6],17,-1473231341),s=v(s,r,d,e,c[f+7],22,-45705983),e=v(e,s,r,d,c[f+8],7,1770035416),d=v(d,e,s,r,c[f+9],12,-1958414417),r=v(r,d,e,s,c[f+10],17,-42063),s=v(s,r,d,e,c[f+11],22,-1990404162),e=v(e,s,r,d,c[f+12],7,1804603682),d=v(d,e,s,r,c[f+13],12,-40341101),r=v(r,d,e,s,c[f+14],17,-1502002290),s=v(s,r,d,e,c[f+15],22,1236535329),e=u(e,s,r,d,c[f+1],5,-165796510),d=u(d,e,s,r,c[f+6],9,-1069501632),r=u(r,d,e,s,c[f+11],14,643717713),s=u(s,r,d,e,c[f+0],20,-373897302),e=u(e,s,r,d,c[f+5],5,-701558691),d=u(d,e,s,r,c[f+10],9,38016083),r=u(r,d,e,s,c[f+15],14,-660478335),s=u(s,r,d,e,c[f+4],20,-405537848),e=u(e,s,r,d,c[f+9],5,568446438),d=u(d,e,s,r,c[f+14],9,-1019803690),r=u(r,d,e,s,c[f+3],14,-187363961),s=u(s,r,d,e,c[f+8],20,1163531501),e=u(e,s,r,d,c[f+13],5,-1444681467),d=u(d,e,s,r,c[f+2],9,-51403784),r=u(r,d,e,s,c[f+7],14,1735328473),s=u(s,r,d,e,c[f+12],20,-1926607734),e=h(e,s,r,d,c[f+5],4,-378558),d=h(d,e,s,r,c[f+8],11,-2022574463),r=h(r,d,e,s,c[f+11],16,1839030562),s=h(s,r,d,e,c[f+14],23,-35309556),e=h(e,s,r,d,c[f+1],4,-1530992060),d=h(d,e,s,r,c[f+4],11,1272893353),r=h(r,d,e,s,c[f+7],16,-155497632),s=h(s,r,d,e,c[f+10],23,-1094730640),e=h(e,s,r,d,c[f+13],4,681279174),d=h(d,e,s,r,c[f+0],11,-358537222),r=h(r,d,e,s,c[f+3],16,-722521979),s=h(s,r,d,e,c[f+6],23,76029189),e=h(e,s,r,d,c[f+9],4,-640364487),d=h(d,e,s,r,c[f+12],11,-421815835),r=h(r,d,e,s,c[f+15],16,530742520),s=h(s,r,d,e,c[f+2],23,-995338651),e=a(e,s,r,d,c[f+0],6,-198630844),d=a(d,e,s,r,c[f+7],10,1126891415),r=a(r,d,e,s,c[f+14],15,-1416354905),s=a(s,r,d,e,c[f+5],21,-57434055),e=a(e,s,r,d,c[f+12],6,1700485571),d=a(d,e,s,r,c[f+3],10,-1894986606),r=a(r,d,e,s,c[f+10],15,-1051523),s=a(s,r,d,e,c[f+1],21,-2054922799),e=a(e,s,r,d,c[f+8],6,1873313359),d=a(d,e,s,r,c[f+15],10,-30611744),r=a(r,d,e,s,c[f+6],15,-1560198380),s=a(s,r,d,e,c[f+13],21,1309151649),e=a(e,s,r,d,c[f+4],6,-145523070),d=a(d,e,s,r,c[f+11],10,-1120210379),r=a(r,d,e,s,c[f+2],15,718787259),s=a(s,r,d,e,c[f+9],21,-343485551),e=t(e,g),s=t(s,m),r=t(r,p),d=t(d,_)}return Array(e,s,r,d)}function w(c,o,e,s,r,d){return t(i(t(t(o,c),t(s,d)),r),e)}function v(c,o,e,s,r,d,f){return w(o&e|~o&s,c,o,r,d,f)}function u(c,o,e,s,r,d,f){return w(o&s|e&~s,c,o,r,d,f)}function h(c,o,e,s,r,d,f){return w(o^e^s,c,o,r,d,f)}function a(c,o,e,s,r,d,f){return w(e^(o|~s),c,o,r,d,f)}function t(c,o){var e=(65535&c)+(65535&o);return(c>>16)+(o>>16)+(e>>16)<<16|65535&e}function i(c,o){return c<<o|c>>>32-o}var l=b("./helpers");L.exports=function(c){return l.hash(c,A,16)}},{"./helpers":238}],240:[function(b,L,E){"use strict";function A(t,i){t[i>>5]|=128<<24-i%32,t[15+(i+64>>9<<4)]=i;for(var l=Array(80),c=1732584193,o=-271733879,e=-1732584194,s=271733878,r=-1009589776,d=0;d<t.length;d+=16){for(var f=c,g=o,m=e,p=s,_=r,y=0;y<80;y++){l[y]=y<16?t[d+y]:h(l[y-3]^l[y-8]^l[y-14]^l[y-16],1);var n=u(u(h(c,5),w(y,o,e,s)),u(u(r,l[y]),v(y)));r=s,s=e,e=h(o,30),o=c,c=n}c=u(c,f),o=u(o,g),e=u(e,m),s=u(s,p),r=u(r,_)}return Array(c,o,e,s,r)}function w(t,i,l,c){return t<20?i&l|~i&c:t<40?i^l^c:t<60?i&l|i&c|l&c:i^l^c}function v(t){return t<20?1518500249:t<40?1859775393:t<60?-1894007588:-899497514}function u(t,i){var l=(65535&t)+(65535&i);return(t>>16)+(i>>16)+(l>>16)<<16|65535&l}function h(t,i){return t<<i|t>>>32-i}var a=b("./helpers");L.exports=function(t){return a.hash(t,A,20,!0)}},{"./helpers":238}],241:[function(b,L,E){"use strict";var A=b("./helpers"),w=function(e,s){var r=(65535&e)+(65535&s);return(e>>16)+(s>>16)+(r>>16)<<16|65535&r},v=function(e,s){return e>>>s|e<<32-s},u=function(e,s){return e>>>s},h=function(e,s,r){return e&s^~e&r},a=function(e,s,r){return e&s^e&r^s&r},t=function(e){return v(e,2)^v(e,13)^v(e,22)},i=function(e){return v(e,6)^v(e,11)^v(e,25)},l=function(e){return v(e,7)^v(e,18)^u(e,3)},c=function(e){return v(e,17)^v(e,19)^u(e,10)},o=function(e,s){var r,d,f,g,m,p,_,y,n,x,S,T,R=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),D=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),I=new Array(64);e[s>>5]|=128<<24-s%32,e[15+(s+64>>9<<4)]=s;for(var n=0;n<e.length;n+=16){r=D[0],d=D[1],f=D[2],g=D[3],m=D[4],p=D[5],_=D[6],y=D[7];for(var x=0;x<64;x++)I[x]=x<16?e[x+n]:w(w(w(c(I[x-2]),I[x-7]),l(I[x-15])),I[x-16]),S=w(w(w(w(y,i(m)),h(m,p,_)),R[x]),I[x]),T=w(t(r),a(r,d,f)),y=_,_=p,p=m,m=w(g,S),g=f,f=d,d=r,r=w(S,T);D[0]=w(r,D[0]),D[1]=w(d,D[1]),D[2]=w(f,D[2]),D[3]=w(g,D[3]),D[4]=w(m,D[4]),D[5]=w(p,D[5]),D[6]=w(_,D[6]),D[7]=w(y,D[7])}return D};L.exports=function(e){return A.hash(e,o,32,!0)}},{"./helpers":238}],242:[function(b,L,E){(function(A){"use strict";function w(o){return o&&o.__esModule?o:{default:o}}var v=b("babel-runtime/core-js/object/create"),u=w(v),h=b("babel-runtime/helpers/classCallCheck"),a=w(h),t=b("babel-runtime/helpers/createClass"),i=w(t),l=b("babel-runtime/helpers/typeof"),c=w(l);!function(o){if((E===void 0?"undefined":(0,c.default)(E))==="object"&&L!==void 0)L.exports=o();else if(typeof U=="function"&&U.amd)U([],o);else{var e;e=typeof window!="undefined"?window:A!==void 0?A:typeof self!="undefined"?self:this,e.mime=o()}}(function(){return function o(e,s,r){function d(m,p){if(!s[m]){if(!e[m]){var _=typeof b=="function"&&b;if(!p&&_)return _(m,!0);if(f)return f(m,!0);var y=new Error("Cannot find module '"+m+"'");throw y.code="MODULE_NOT_FOUND",y}var n=s[m]={exports:{}};e[m][0].call(n.exports,function(x){var S=e[m][1][x];return d(S||x)},n,n.exports,o,e,s,r)}return s[m].exports}for(var f=typeof b=="function"&&b,g=0;g<r.length;g++)d(r[g]);return d}({1:[function(o,e,s){var r=function(){function d(){(0,a.default)(this,d),this._types=(0,u.default)(null),this._extensions=(0,u.default)(null);for(var f=0;f<arguments.length;f++)this.define(arguments[f])}return(0,i.default)(d,[{key:"define",value:function(f,g){for(var m in f){for(var p=f[m],_=0;_<p.length;_++){var y=p[_];if(!g&&y in this._types)throw new Error('Attempt to change mapping for "'+y+'" extension from "'+this._types[y]+'" to "'+m+'". Pass `force=true` to allow this, otherwise remove "'+y+'" from the list of extensions for "'+m+'".');this._types[y]=m}!g&&this._extensions[m]||(this._extensions[m]=p[0])}}},{key:"getType",value:function(f){f=String(f);var g=f.replace(/^.*[\/\\]/,"").toLowerCase(),m=g.replace(/^.*\./,"").toLowerCase(),p=g.length<f.length;return(m.length<g.length-1||!p)&&this._types[m]||null}},{key:"getExtension",value:function(f){return(f=/^\s*([^;\s]*)/.test(f)&&RegExp.$1)&&this._extensions[f.toLowerCase()]||null}}]),d}();e.exports=r},{}],2:[function(o,e,s){var r=o("./Mime");e.exports=new r(o("./types/standard"),o("./types/other"))},{"./Mime":1,"./types/other":3,"./types/standard":4}],3:[function(o,e,s){e.exports={"application/prs.cww":["cww"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":[],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},{}],4:[function(o,e,s){e.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/xm":["xm"],"font/otf":["otf"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/webp":["webp"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},{}]},{},[2])(2)})}).call(this,typeof Se!="undefined"?Se:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"babel-runtime/core-js/object/create":19,"babel-runtime/helpers/classCallCheck":30,"babel-runtime/helpers/createClass":31,"babel-runtime/helpers/typeof":32}],243:[function(b,L,E){"use strict";E.encodeURIComponent=function(A){try{return encodeURIComponent(A)}catch(w){return A}},E.escape=b("escape-html"),E.timestamp=function(A){if(A){var w=A;return typeof w=="string"&&(w=Number(w)),String(A).length===10&&(w*=1e3),new Date(w)}return Math.round(Date.now()/1e3)}},{"escape-html":157}],244:[function(b,L,E){(function(A,w){"use strict";function v(y){return y&&y.__esModule?y:{default:y}}function u(y,n){return y===void 0?n:y}function h(y,n){return function(x,S,T){if(x)return n(x);y({data:S,status:T.statusCode,headers:T.headers,res:T})}}var a,t=b("babel-runtime/core-js/json/stringify"),i=v(t),l=b("babel-runtime/helpers/typeof"),c=v(l),o=b("util"),e=b("url"),s=b("http"),r=b("https"),d=b("debug")("urllib"),f=b("humanize-ms"),g=0,m=Math.pow(2,31)-10,p=/^https?:\/\//i;E.TIMEOUTS=[f("300s"),f("300s")];var _=["json","text"];E.request=function(y,n,x){return arguments.length===2&&typeof n=="function"&&(x=n,n=null),typeof x=="function"?E.requestWithCallback(y,n,x):(a||(a=b("any-promise")),new a(function(S,T){E.requestWithCallback(y,n,h(S,T))}))},E.requestWithCallback=function(y,n,x){function S(){Le&&(clearTimeout(Le),Le=null)}function T(){H&&(clearTimeout(H),H=null)}function R(Re,xe,we){if(T(),!x)return console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),X,A.pid,se.method,y),void(Re&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
stack: %s`,Date(),X,A.pid,Re.name,Re.message,Re.stack));var Te=x;x=null;var ue={};if(we&&(F=we.statusCode,ue=we.headers),F===401&&ue["www-authenticate"]&&(!n.headers||!n.headers.Authorization)&&n.digestAuth){var de=ue["www-authenticate"];if(de.indexOf("Digest ")>=0)return d("Request#%d %s: got digest auth header WWW-Authenticate: %s",X,y,de),n.headers=n.headers||{},n.headers.Authorization=digestAuthHeader(se.method,se.path,de,n.digestAuth),d("Request#%d %s: auth with digest header: %s",X,y,n.headers.Authorization),we.headers["set-cookie"]&&(n.headers.Cookie=we.headers["set-cookie"].join(";")),E.requestWithCallback(y,n,Te)}var _e=Date.now()-z;Oe&&(Oe.contentDownload=_e),d("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",_e,M,F,se.method,se.host,se.path,j,Oe);var ye={status:F,statusCode:F,headers:ue,size:M,aborted:oe,rt:_e,keepAliveSocket:j,data:xe,requestUrls:n.requestUrls,timing:Oe,remoteAddress:ve,remotePort:ke};if(Re){var Ie="";ae&&typeof ae.getCurrentStatus=="function"&&(Ie=", agent status: "+(0,i.default)(ae.getCurrentStatus())),Re.message+=", "+se.method+" "+y+" "+F+" (connected: "+O+", keepalive socket: "+j+Ie+`)
headers: `+(0,i.default)(ue),Re.data=xe,Re.path=se.path,Re.status=F,Re.headers=ue,Re.res=ye}Te(Re,xe,n.streaming?we:ye),n.emitter&&(V.url=y,V.socket=Pe&&Pe.connection,V.options=se,V.size=be,n.emitter.emit("response",{requestId:X,error:Re,ctx:n.ctx,req:V,res:ye}))}function D(Re){var xe=null;if(n.followRedirect&&statuses.redirect[Re.statusCode]){n._followRedirectCount=(n._followRedirectCount||0)+1;var we=Re.headers.location;if(we){if(!(n._followRedirectCount>n.maxRedirects)){var Te=n.formatRedirectUrl?n.formatRedirectUrl(y,we):e.resolve(y,we);d("Request#%d %s: `redirected` from %s to %s",X,se.path,y,Te),T(),n.headers&&n.headers.Host&&p.test(we)&&(n.headers.Host=null);var ue=x;return x=null,E.requestWithCallback(Te,n,ue),{redirect:!0,error:null}}xe=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+y),xe.name="MaxRedirectError"}else xe=new Error("Got statusCode "+Re.statusCode+" but cannot resolve next location from headers"),xe.name="FollowRedirectError"}return{redirect:!1,error:xe}}function I(Re,xe,we){return we(null,xe,Re.headers["content-encoding"])}function B(Re){if(Oe&&(Oe.waiting=Date.now()-z),d("Request#%d %s `req response` event emit: status %d, headers: %j",X,y,Re.statusCode,Re.headers),n.streaming){var xe=D(Re);return xe.redirect?void Re.resume():xe.error?(Re.resume(),R(xe.error,null,Re)):R(null,null,Re)}if(Re.on("close",function(){d("Request#%d %s: `res close` event emit, total size %d",X,y,M)}),Re.on("error",function(){d("Request#%d %s: `res error` event emit, total size %d",X,y,M)}),Re.on("aborted",function(){oe=!0,d("Request#%d %s: `res aborted` event emit, total size %d",X,y,M)}),De){var xe=D(Re);return xe.redirect?void Re.resume():xe.error?(Re.resume(),De.end(),R(xe.error,null,Re)):(n.consumeWriteStream===!1?Re.on("end",R.bind(null,null,null,Re)):isNode010||isNode012?first([[De,"close"],[Re,"aborted"]],function(ue,de,_e){d("Request#%d %s: writeStream or res %s event emitted",X,y,_e),R(C||null,null,Re)}):De.on("close",function(){d("Request#%d %s: writeStream close event emitted",X,y),R(C||null,null,Re)}),Re.pipe(De))}var we=[];Re.on("data",function(Te){d("Request#%d %s: `res data` event emit, size %d",X,y,Te.length),M+=Te.length,we.push(Te)}),Re.on("end",function(){var Te=w.concat(we,M);if(d("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",X,y,M,Re._dumped),C)return R(C,Te,Re);var ue=D(Re);if(ue.error)return R(ue.error,Te,Re);ue.redirect||I(Re,Te,function(de,_e,ye){if(de)return R(de,Te,Re);if(!ye&&_.indexOf(n.dataType)>=0){try{_e=decodeBodyByCharset(_e,Re)}catch(Me){return d("decodeBodyByCharset error: %s",Me),R(null,_e,Re)}if(n.dataType==="json")if(M===0)_e=null;else{var Ie=parseJSON(_e,pe);Ie.error?de=Ie.error:_e=Ie.data}}oe&&d("Request#%d %s: Remote socket was terminated before `response.end()` was called",X,y),R(de,_e,Re)})})}function G(){d("Response timer ticking, timeout: %d",Ke),H=setTimeout(function(){H=null;var Re="Response timeout for "+Ke+"ms";C=new Error(Re),C.name="ResponseTimeoutError",C.requestId=X,d("ResponseTimeout: Request#%d %s %s: %s, connected: %s",X,y,C.name,Re,O),k()},Ke)}function k(){d("Request#%d %s abort, connected: %s",X,y,O),Pe.socket||(C.noSocket=!0,R(C)),Pe.abort()}if(!y||typeof y!="string"&&(y===void 0?"undefined":(0,c.default)(y))!=="object"){var $=o.format("expect request url to be a string or a http request options, but got %j",y);throw new Error($)}arguments.length===2&&typeof n=="function"&&(x=n,n=null),n=n||{},g>=m&&(g=0);var X=++g;n.requestUrls=n.requestUrls||[];var V={requestId:X,url:y,args:n,ctx:n.ctx};n.emitter&&n.emitter.emit("request",V),n.timeout=n.timeout||E.TIMEOUTS,n.maxRedirects=n.maxRedirects||10,n.streaming=n.streaming||n.customResponse;var N,z=Date.now();typeof y=="string"?(p.test(y)||(y="http://"+y),N=e.parse(y)):N=y;var q=(n.type||n.method||N.method||"GET").toUpperCase(),ee=N.port||80,fe=s,ae=u(n.agent,E.agent),pe=n.fixJSONCtlChars;N.protocol==="https:"&&(fe=r,ae=u(n.httpsAgent,E.httpsAgent),N.port||(ee=443));var se={host:N.hostname||N.host||"localhost",path:N.path||"/",method:q,port:ee,agent:ae,headers:n.headers||{},lookup:n.lookup};Array.isArray(n.timeout)?se.requestTimeout=n.timeout[n.timeout.length-1]:n.timeout!==void 0&&(se.requestTimeout=n.timeout);for(var ge=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],ie=0;ie<ge.length;ie++){var te=ge[ie];n.hasOwnProperty(te)&&(se[te]=n[te])}se.rejectUnauthorized!==!1||se.hasOwnProperty("secureOptions")||(se.secureOptions=b("constants").SSL_OP_NO_TLSv1_2);var Q=n.auth||N.auth;Q&&(se.auth=Q);var me=n.content||n.data,re=q==="GET"||q==="HEAD"||n.dataAsQueryString;if(!n.content&&me&&typeof me!="string"&&!w.isBuffer(me))if(re)me=n.nestedQuerystring?qs.stringify(me):querystring.stringify(me);else{var J=se.headers["Content-Type"]||se.headers["content-type"];J||(J=n.contentType==="json"?"application/json":"application/x-www-form-urlencoded",se.headers["Content-Type"]=J),me=parseContentType(J).type==="application/json"?(0,i.default)(me):n.nestedQuerystring?qs.stringify(me):querystring.stringify(me)}re&&me&&(se.path+=(N.query?"&":"?")+me,me=null);var be=0;if(me){var Ee=me.length;w.isBuffer(me)||(Ee=w.byteLength(me)),be=se.headers["Content-Length"]=Ee}n.dataType==="json"&&(se.headers.Accept="application/json"),typeof n.beforeRequest=="function"&&n.beforeRequest(se);var Le=null,H=null,C=null,O=!1,j=!1,M=0,F=-1,oe=!1,ve="",ke="",Oe=null;n.timing&&(Oe={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0}),se.headers["User-Agent"]||se.headers["user-agent"]||(se.headers["User-Agent"]=navigator.userAgent),n.gzip&&(se.headers["Accept-Encoding"]||se.headers["accept-encoding"]||(se.headers["Accept-Encoding"]="gzip"));var De=n.writeStream;d("Request#%d %s %s with headers %j, options.path: %s",X,q,y,se.headers,se.path),n.requestUrls.push(y);var Ue,Ke;Array.isArray(n.timeout)?(Ue=f(n.timeout[0]),Ke=f(n.timeout[1])):Ue=Ke=f(n.timeout),d("ConnectTimeout: %d, ResponseTimeout: %d",Ue,Ke);var Pe;try{Pe=fe.request(se,B)}catch(Re){return R(Re)}return typeof window=="undefined"?function(){d("Connect timer ticking, timeout: %d",Ue),Le=setTimeout(function(){Le=null,F===-1&&(F=-2);var Re="Connect timeout for "+Ue+"ms",xe="ConnectionTimeoutError";Pe.socket||(xe="SocketAssignTimeoutError",Re+=", working sockets is full"),C=new Error(Re),C.name=xe,C.requestId=X,d("ConnectTimeout: Request#%d %s %s: %s, connected: %s",X,y,C.name,Re,O),k()},Ue)}():Pe.on("requestTimeout",function(){F===-1&&(F=-2);var Re="Connect timeout for "+Ue+"ms";C=new Error(Re),C.name="ConnectionTimeoutError",C.requestId=X,k()}),Oe&&Pe.on("finish",function(){Oe.requestSent=Date.now()-z}),Pe.once("socket",function(Re){Oe&&(Oe.queuing=Date.now()-z),isNode010&&Re.socket&&(Re=Re.socket);var xe=Re.readyState;if(xe==="opening")return Re.once("lookup",function(we,Te,ue){d("Request#%d %s lookup: %s, %s, %s",X,y,we,Te,ue),Oe&&(Oe.dnslookup=Date.now()-z),Te&&(ve=Te)}),void Re.once("connect",function(){Oe&&(Oe.connected=Date.now()-z),S(),G(),d("Request#%d %s new socket connected",X,y),O=!0,ve||(ve=Re.remoteAddress),ke=Re.remotePort});d("Request#%d %s reuse socket connected, readyState: %s",X,y,xe),O=!0,j=!0,ve||(ve=Re.remoteAddress),ke=Re.remotePort,S(),G()}),Pe.on("error",function(Re){Re.name!=="Error"&&Re.name!=="TypeError"||(Re.name=O?"ResponseError":"RequestError"),Re.message+=' (req "error")',d("Request#%d %s `req error` event emit, %s: %s",X,y,Re.name,Re.message),R(C||Re)}),De&&De.once("error",function(Re){Re.message+=' (writeStream "error")',C=Re,d("Request#%d %s `writeStream error` event emit, %s: %s",X,y,Re.name,Re.message),k()}),n.stream?(n.stream.pipe(Pe),n.stream.once("error",function(Re){Re.message+=' (stream "error")',C=Re,d("Request#%d %s `readStream error` event emit, %s: %s",X,y,Re.name,Re.message),k()})):Pe.end(me),Pe.requestId=X,Pe}}).call(this,b("_process"),b("buffer").Buffer)},{_process:173,"any-promise":13,"babel-runtime/core-js/json/stringify":17,"babel-runtime/helpers/typeof":32,buffer:38,constants:42,debug:155,http:196,https:159,"humanize-ms":160,url:203,util:207}]},{},[1])(1)}),!function(U){function b(E){if(L[E])return L[E].exports;var A=L[E]={i:E,l:!1,exports:{}};return U[E].call(A.exports,A,A.exports,b),A.l=!0,A.exports}var L={};b.m=U,b.c=L,b.d=function(E,A,w){b.o(E,A)||Object.defineProperty(E,A,{configurable:!1,enumerable:!0,get:w})},b.n=function(E){var A=E&&E.__esModule?function(){return E.default}:function(){return E};return b.d(A,"a",A),A},b.o=function(E,A){return Object.prototype.hasOwnProperty.call(E,A)},b.p="",b(b.s=12)}([function(U,b,L){!function(E,A){U.exports=b=A()}(0,function(){var E=E||function(A,w){var v=Object.create||function(){function r(){}return function(d){var f;return r.prototype=d,f=new r,r.prototype=null,f}}(),u={},h=u.lib={},a=h.Base=function(){return{extend:function(r){var d=v(this);return r&&d.mixIn(r),d.hasOwnProperty("init")&&this.init!==d.init||(d.init=function(){d.$super.init.apply(this,arguments)}),d.init.prototype=d,d.$super=this,d},create:function(){var r=this.extend();return r.init.apply(r,arguments),r},init:function(){},mixIn:function(r){for(var d in r)r.hasOwnProperty(d)&&(this[d]=r[d]);r.hasOwnProperty("toString")&&(this.toString=r.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),t=h.WordArray=a.extend({init:function(r,d){r=this.words=r||[],this.sigBytes=d!=null?d:4*r.length},toString:function(r){return(r||l).stringify(this)},concat:function(r){var d=this.words,f=r.words,g=this.sigBytes,m=r.sigBytes;if(this.clamp(),g%4)for(var p=0;p<m;p++){var _=f[p>>>2]>>>24-p%4*8&255;d[g+p>>>2]|=_<<24-(g+p)%4*8}else for(var p=0;p<m;p+=4)d[g+p>>>2]=f[p>>>2];return this.sigBytes+=m,this},clamp:function(){var r=this.words,d=this.sigBytes;r[d>>>2]&=4294967295<<32-d%4*8,r.length=A.ceil(d/4)},clone:function(){var r=a.clone.call(this);return r.words=this.words.slice(0),r},random:function(r){for(var d,f=[],g=0;g<r;g+=4){var m=function(p){var p=p,_=987654321,y=4294967295;return function(){_=36969*(65535&_)+(_>>16)&y,p=18e3*(65535&p)+(p>>16)&y;var n=(_<<16)+p&y;return n/=4294967296,(n+=.5)*(A.random()>.5?1:-1)}}(4294967296*(d||A.random()));d=987654071*m(),f.push(4294967296*m()|0)}return new t.init(f,r)}}),i=u.enc={},l=i.Hex={stringify:function(r){for(var d=r.words,f=r.sigBytes,g=[],m=0;m<f;m++){var p=d[m>>>2]>>>24-m%4*8&255;g.push((p>>>4).toString(16)),g.push((15&p).toString(16))}return g.join("")},parse:function(r){for(var d=r.length,f=[],g=0;g<d;g+=2)f[g>>>3]|=parseInt(r.substr(g,2),16)<<24-g%8*4;return new t.init(f,d/2)}},c=i.Latin1={stringify:function(r){for(var d=r.words,f=r.sigBytes,g=[],m=0;m<f;m++){var p=d[m>>>2]>>>24-m%4*8&255;g.push(String.fromCharCode(p))}return g.join("")},parse:function(r){for(var d=r.length,f=[],g=0;g<d;g++)f[g>>>2]|=(255&r.charCodeAt(g))<<24-g%4*8;return new t.init(f,d)}},o=i.Utf8={stringify:function(r){try{return decodeURIComponent(escape(c.stringify(r)))}catch(d){throw new Error("Malformed UTF-8 data")}},parse:function(r){return c.parse(unescape(encodeURIComponent(r)))}},e=h.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new t.init,this._nDataBytes=0},_append:function(r){typeof r=="string"&&(r=o.parse(r)),this._data.concat(r),this._nDataBytes+=r.sigBytes},_process:function(r){var d=this._data,f=d.words,g=d.sigBytes,m=this.blockSize,p=4*m,_=g/p;_=r?A.ceil(_):A.max((0|_)-this._minBufferSize,0);var y=_*m,n=A.min(4*y,g);if(y){for(var x=0;x<y;x+=m)this._doProcessBlock(f,x);var S=f.splice(0,y);d.sigBytes-=n}return new t.init(S,n)},clone:function(){var r=a.clone.call(this);return r._data=this._data.clone(),r},_minBufferSize:0}),s=(h.Hasher=e.extend({cfg:a.extend(),init:function(r){this.cfg=this.cfg.extend(r),this.reset()},reset:function(){e.reset.call(this),this._doReset()},update:function(r){return this._append(r),this._process(),this},finalize:function(r){return r&&this._append(r),this._doFinalize()},blockSize:16,_createHelper:function(r){return function(d,f){return new r.init(f).finalize(d)}},_createHmacHelper:function(r){return function(d,f){return new s.HMAC.init(r,f).finalize(d)}}}),u.algo={});return u}(Math);return E})},function(U,b,L){"use strict";function E(v,u){if(!(v instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function v(u,h){for(var a=0;a<h.length;a++){var t=h[a];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,h,a){return h&&v(u.prototype,h),a&&v(u,a),u}}(),w=function(){function v(){E(this,v)}return A(v,null,[{key:"detectIEVersion",value:function(){for(var u=4,h=document.createElement("div"),a=h.getElementsByTagName("i");h.innerHTML="<!--[if gt IE "+u+"]><i></i><![endif]-->",a[0];)u++;return u>4&&u}},{key:"extend",value:function(u,h){for(var a in h)Object.prototype.hasOwnProperty.call(h,a)&&h[a]&&(u[a]=h[a])}},{key:"isArray",value:function(u){return Object.prototype.toString.call(arg)==="[object Array]"}},{key:"getFileType",value:function(u){return u=u.toLowerCase(),/.mp4|.flv|.m3u8|.avi|.rm|.rmvb|.mpeg|.mpg|.mov|.wmv|.3gp|.asf|.dat|.dv|.f4v|.gif|.m2t|.m4v|.mj2|.mjpeg|.mpe|.mts|.ogg|.qt|.swf|.ts|.vob|.wmv|.webm/.test(u)?"video":/.mp3|.wav|.ape|.cda|.au|.midi|.mac|.aac|.ac3|.acm|.amr|.caf|.flac|.m4a|.ra|.wma/.test(u)?"audio":/.bmp|.jpg|.jpeg|.png/.test(u)?"img":"other"}},{key:"isImage",value:function(u){return u=u.toLowerCase(),!!/.jpg|.jpeg|.png/.test(u)}},{key:"ISODateString",value:function(u){function h(a){return a<10?"0"+a:a}return u.getUTCFullYear()+"-"+h(u.getUTCMonth()+1)+"-"+h(u.getUTCDate())+"T"+h(u.getUTCHours())+":"+h(u.getUTCMinutes())+":"+h(u.getUTCSeconds())+"Z"}},{key:"isIntNum",value:function(u){return!!/^\d+$/.test(u)}}]),v}();b.default=w},function(U,b,L){!function(E,A){U.exports=b=A(L(0))}(0,function(E){return function(A){function w(s,r,d,f,g,m,p){var _=s+(r&d|~r&f)+g+p;return(_<<m|_>>>32-m)+r}function v(s,r,d,f,g,m,p){var _=s+(r&f|d&~f)+g+p;return(_<<m|_>>>32-m)+r}function u(s,r,d,f,g,m,p){var _=s+(r^d^f)+g+p;return(_<<m|_>>>32-m)+r}function h(s,r,d,f,g,m,p){var _=s+(d^(r|~f))+g+p;return(_<<m|_>>>32-m)+r}var a=E,t=a.lib,i=t.WordArray,l=t.Hasher,c=a.algo,o=[];!function(){for(var s=0;s<64;s++)o[s]=4294967296*A.abs(A.sin(s+1))|0}();var e=c.MD5=l.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(s,r){for(var d=0;d<16;d++){var f=r+d,g=s[f];s[f]=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8)}var m=this._hash.words,p=s[r+0],_=s[r+1],y=s[r+2],n=s[r+3],x=s[r+4],S=s[r+5],T=s[r+6],R=s[r+7],D=s[r+8],I=s[r+9],B=s[r+10],G=s[r+11],k=s[r+12],$=s[r+13],X=s[r+14],V=s[r+15],N=m[0],z=m[1],q=m[2],ee=m[3];N=w(N,z,q,ee,p,7,o[0]),ee=w(ee,N,z,q,_,12,o[1]),q=w(q,ee,N,z,y,17,o[2]),z=w(z,q,ee,N,n,22,o[3]),N=w(N,z,q,ee,x,7,o[4]),ee=w(ee,N,z,q,S,12,o[5]),q=w(q,ee,N,z,T,17,o[6]),z=w(z,q,ee,N,R,22,o[7]),N=w(N,z,q,ee,D,7,o[8]),ee=w(ee,N,z,q,I,12,o[9]),q=w(q,ee,N,z,B,17,o[10]),z=w(z,q,ee,N,G,22,o[11]),N=w(N,z,q,ee,k,7,o[12]),ee=w(ee,N,z,q,$,12,o[13]),q=w(q,ee,N,z,X,17,o[14]),z=w(z,q,ee,N,V,22,o[15]),N=v(N,z,q,ee,_,5,o[16]),ee=v(ee,N,z,q,T,9,o[17]),q=v(q,ee,N,z,G,14,o[18]),z=v(z,q,ee,N,p,20,o[19]),N=v(N,z,q,ee,S,5,o[20]),ee=v(ee,N,z,q,B,9,o[21]),q=v(q,ee,N,z,V,14,o[22]),z=v(z,q,ee,N,x,20,o[23]),N=v(N,z,q,ee,I,5,o[24]),ee=v(ee,N,z,q,X,9,o[25]),q=v(q,ee,N,z,n,14,o[26]),z=v(z,q,ee,N,D,20,o[27]),N=v(N,z,q,ee,$,5,o[28]),ee=v(ee,N,z,q,y,9,o[29]),q=v(q,ee,N,z,R,14,o[30]),z=v(z,q,ee,N,k,20,o[31]),N=u(N,z,q,ee,S,4,o[32]),ee=u(ee,N,z,q,D,11,o[33]),q=u(q,ee,N,z,G,16,o[34]),z=u(z,q,ee,N,X,23,o[35]),N=u(N,z,q,ee,_,4,o[36]),ee=u(ee,N,z,q,x,11,o[37]),q=u(q,ee,N,z,R,16,o[38]),z=u(z,q,ee,N,B,23,o[39]),N=u(N,z,q,ee,$,4,o[40]),ee=u(ee,N,z,q,p,11,o[41]),q=u(q,ee,N,z,n,16,o[42]),z=u(z,q,ee,N,T,23,o[43]),N=u(N,z,q,ee,I,4,o[44]),ee=u(ee,N,z,q,k,11,o[45]),q=u(q,ee,N,z,V,16,o[46]),z=u(z,q,ee,N,y,23,o[47]),N=h(N,z,q,ee,p,6,o[48]),ee=h(ee,N,z,q,R,10,o[49]),q=h(q,ee,N,z,X,15,o[50]),z=h(z,q,ee,N,S,21,o[51]),N=h(N,z,q,ee,k,6,o[52]),ee=h(ee,N,z,q,n,10,o[53]),q=h(q,ee,N,z,B,15,o[54]),z=h(z,q,ee,N,_,21,o[55]),N=h(N,z,q,ee,D,6,o[56]),ee=h(ee,N,z,q,V,10,o[57]),q=h(q,ee,N,z,T,15,o[58]),z=h(z,q,ee,N,$,21,o[59]),N=h(N,z,q,ee,x,6,o[60]),ee=h(ee,N,z,q,G,10,o[61]),q=h(q,ee,N,z,y,15,o[62]),z=h(z,q,ee,N,I,21,o[63]),m[0]=m[0]+N|0,m[1]=m[1]+z|0,m[2]=m[2]+q|0,m[3]=m[3]+ee|0},_doFinalize:function(){var s=this._data,r=s.words,d=8*this._nDataBytes,f=8*s.sigBytes;r[f>>>5]|=128<<24-f%32;var g=A.floor(d/4294967296),m=d;r[15+(f+64>>>9<<4)]=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8),r[14+(f+64>>>9<<4)]=16711935&(m<<8|m>>>24)|4278255360&(m<<24|m>>>8),s.sigBytes=4*(r.length+1),this._process();for(var p=this._hash,_=p.words,y=0;y<4;y++){var n=_[y];_[y]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}return p},clone:function(){var s=l.clone.call(this);return s._hash=this._hash.clone(),s}});a.MD5=l._createHelper(e),a.HmacMD5=l._createHmacHelper(e)}(Math),E.MD5})},function(U,b,L){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.UPLOADSTATE={INIT:"init",UPLOADING:"uploading",COMPLETE:"complete",INTERRUPT:"interrupt"},b.UPLOADSTEP={INIT:"init",PART:"part",COMPLETE:"complete"},b.UPLOADDEFAULT={PARALLEL:5,PARTSIZE:1048576}},function(U,b,L){"use strict";function E(e){return e&&e.__esModule?e:{default:e}}function A(e,s){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var w=function(){function e(s,r){for(var d=0;d<r.length;d++){var f=r[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(s,f.key,f)}}return function(s,r,d){return r&&e(s.prototype,r),d&&e(s,d),s}}(),v=L(5),u=E(v),h=L(25),a=E(h),t=L(6),i=E(t),l=L(7),c=E(l),o=function(){function e(s){A(this,e);var r=c.default.os.name,d=c.default.os.version||"",f=c.default.browser.name,g=c.default.browser.version||"",m=window.location.href,p="";m&&(p=c.default.getHost(m));var _="pc";c.default.os.ipad?_="pad":(c.default.os.iphone||c.default.os.android)&&(_="phone"),this._ri=u.default.create(),this.initParam={APIVersion:"0.6.0",lv:"1",av:i.default.version,pd:"upload",sm:"upload",md:"uploader",uuid:e.getUuid(),os:r,ov:d,et:f,ev:g,uat:navigator.userAgent,app_n:p,tt:_,dm:"h5",ut:""}}return w(e,[{key:"log",value:function(s,r){r&&r.ri?(this._ri=r.ri,delete r.ri):this._ri=u.default.create(),r&&r.ut&&(this.initParam.ut=r.ut,delete r.ut),this.initParam.t=new Date().getTime(),this.initParam.ll=s=="20006"?"error":"info",this.initParam.ri=this._ri,this.initParam.e=s;var d=[];if(r)for(var f in r)d.push(f+"="+r[f]);var g=d.join("&");this.initParam.args=encodeURIComponent(g==""?"0":g);var m=[];for(var f in this.initParam)m.push(f+"="+this.initParam[f]);var p=m.join("&");AliyunUpload&&AliyunUpload.__logTestCallback__?AliyunUpload.__logTestCallback__(p):new Image(0,0).src="https://videocloud.cn-hangzhou.log.aliyuncs.com/logstores/upload/track?"+p}}],[{key:"getUuid",value:function(){var s=a.default.get("p_h5_upload_u");return s||(s=u.default.create(),a.default.set("p_h5_upload_u",s,730)),s}},{key:"getClientId",value:function(){return a.default.get("p_h5_upload_clientId")}},{key:"setClientId",value:function(s){return s||(s=u.default.create()),a.default.set("p_h5_upload_clientId",s,730),s}}]),e}();b.default=o},function(U,b,L){"use strict";function E(v,u){if(!(v instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function v(u,h){for(var a=0;a<h.length;a++){var t=h[a];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,h,a){return h&&v(u.prototype,h),a&&v(u,a),u}}(),w=function(){function v(){E(this,v)}return A(v,null,[{key:"create",value:function(u,h){var a,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=[];if(h=h||t.length,u)for(a=0;a<u;a++)i[a]=t[0|Math.random()*h];else{var l;for(i[8]=i[13]=i[18]=i[23]="-",i[14]="4",a=0;a<36;a++)i[a]||(l=0|16*Math.random(),i[a]=t[a==19?3&l|8:l])}return i.join("")}}]),v}();b.default=w},function(U,b,L){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var E={version:"1.5.0"};b.default=E},function(U,b,L){"use strict";function E(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function t(i,l){for(var c=0;c<l.length;c++){var o=l[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(i,o.key,o)}}return function(i,l,c){return l&&t(i.prototype,l),c&&t(i,c),i}}(),w=function(t){var i=navigator.userAgent,l="other";if(t.ios)return"iOS";if(t.android)return"android";if(i.indexOf("Baiduspider")>-1)return"Baiduspider";if(i.indexOf("PlayStation")>-1)return"PS4";var c=navigator.platform=="Win32"||navigator.platform=="Windows"||i.indexOf("Windows")>-1,o=navigator.platform=="Mac68K"||navigator.platform=="MacPPC"||navigator.platform=="Macintosh"||navigator.platform=="MacIntel";return o&&(l="macOS"),navigator.platform=="X11"&&!c&&!o&&(l="Unix"),String(navigator.platform).indexOf("Linux")>-1&&(l="Linux"),c?"windows":l},v=function(){var t=navigator.userAgent,i="";return(t.indexOf("Windows NT 5.0")>-1||t.indexOf("Windows 2000")>-1)&&(i="2000"),(t.indexOf("Windows NT 5.1")>-1||t.indexOf("Windows XP")>-1)&&(i="XP"),(t.indexOf("Windows NT 5.2")>-1||t.indexOf("Windows 2003")>-1)&&(i="2003"),(t.indexOf("Windows NT 6.0")>-1||t.indexOf("Windows Vista")>-1)&&(i="Vista"),(t.indexOf("Windows NT 6.1")>-1||t.indexOf("Windows 7")>-1)&&(i="7"),(t.indexOf("Windows NT 6.2")>-1||t.indexOf("Windows 8")>-1)&&(i="8"),(t.indexOf("Windows NT 6.3")>-1||t.indexOf("Windows 8.1")>-1)&&(i="8.1"),(t.indexOf("Windows NT 10")>-1||t.indexOf("Windows 10")>-1)&&(i="10"),i},u=function(t){var i=navigator.userAgent.toLowerCase();return t.chrome?"Chrome":t.firefox?"Firefox":t.safari?"Safari":t.webview?"webview":t.ie?/edge/.test(i)?"Edge":"IE":/baiduspider/.test(i)?"Baiduspider":/ucweb/.test(i)||/UCBrowser/.test(i)?"UC":/opera/.test(i)?"Opera":/ucweb/.test(i)?"UC":/360se/.test(i)?"360\u6D4F\u89C8\u5668":/bidubrowser/.test(i)?"\u767E\u5EA6\u6D4F\u89C8\u5668":/metasr/.test(i)?"\u641C\u72D7\u6D4F\u89C8\u5668":/lbbrowser/.test(i)?"\u730E\u8C79\u6D4F\u89C8\u5668":/micromessenger/.test(i)?"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668":/qqbrowser/.test(i)?"QQ\u6D4F\u89C8\u5668":/playstation/.test(i)?"PS4\u6D4F\u89C8\u5668":void 0},h=function(){var t={},i={},l=navigator.userAgent,c=navigator.platform,o=l.match(/Web[kK]it[\/]{0,1}([\d.]+)/),e=l.match(/(Android);?[\s\/]+([\d.]+)?/),s=!!l.match(/\(Macintosh\; Intel /),r=l.match(/(iPad).*OS\s([\d_]+)/),d=l.match(/(iPod)(.*OS\s([\d_]+))?/),f=!r&&l.match(/(iPhone\sOS)\s([\d_]+)/),g=l.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),m=/Win\d{2}|Windows/.test(c),p=l.match(/Windows Phone ([\d.]+)/),_=g&&l.match(/TouchPad/),y=l.match(/Kindle\/([\d.]+)/),n=l.match(/Silk\/([\d._]+)/),x=l.match(/(BlackBerry).*Version\/([\d.]+)/),S=l.match(/(BB10).*Version\/([\d.]+)/),T=l.match(/(RIM\sTablet\sOS)\s([\d.]+)/),R=l.match(/PlayBook/),D=l.match(/Chrome\/([\d.]+)/)||l.match(/CriOS\/([\d.]+)/),I=l.match(/Firefox\/([\d.]+)/),B=l.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/),G=l.match(/MSIE\s([\d.]+)/)||l.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),k=!D&&l.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),$=k||l.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if((i.webkit=!!o)&&(i.version=o[1]),e&&(t.android=!0,t.version=e[2]),f&&!d&&(t.ios=t.iphone=!0,t.version=f[2].replace(/_/g,".")),r&&(t.ios=t.ipad=!0,t.version=r[2].replace(/_/g,".")),d&&(t.ios=t.ipod=!0,t.version=d[3]?d[3].replace(/_/g,"."):null),p&&(t.wp=!0,t.version=p[1]),g&&(t.webos=!0,t.version=g[2]),_&&(t.touchpad=!0),x&&(t.blackberry=!0,t.version=x[2]),S&&(t.bb10=!0,t.version=S[2]),T&&(t.rimtabletos=!0,t.version=T[2]),R&&(i.playbook=!0),y&&(t.kindle=!0,t.version=y[1]),n&&(i.silk=!0,i.version=n[1]),!n&&t.android&&l.match(/Kindle Fire/)&&(i.silk=!0),D&&(i.chrome=!0,i.version=D[1]),I&&(i.firefox=!0,i.version=I[1]),B&&(t.firefoxos=!0,t.version=B[1]),G&&(i.ie=!0,i.version=G[1]),$&&(s||t.ios||m||e)&&(i.safari=!0,t.ios||(i.version=$[1])),k&&(i.webview=!0),s){var X=l.match(/[\d]*_[\d]*_[\d]*/);X&&X.length>0&&X[0]&&(t.version=X[0].replace(/_/g,"."))}return t.tablet=!!(r||R||e&&!l.match(/Mobile/)||I&&l.match(/Tablet/)||G&&!l.match(/Phone/)&&l.match(/Touch/)),t.phone=!(t.tablet||t.ipod||!(e||f||g||x||S||D&&l.match(/Android/)||D&&l.match(/CriOS\/([\d.]+)/)||I&&l.match(/Mobile/)||G&&l.match(/Touch/))),t.pc=!t.tablet&&!t.phone,s?t.name="macOS":m?(t.name="windows",t.version=v()):t.name=w(t),i.name=u(i),{os:t,browser:i}}(),a=function(){function t(){E(this,t)}return A(t,null,[{key:"getHost",value:function(i){var l="";if(i===void 0||i==null||i=="")return"";var c=i.indexOf("//"),o=i;c>-1&&(o=i.substring(c+2));var l=o,e=o.split("/");return e&&e.length>0&&(l=e[0]),e=l.split(":"),e&&e.length>0&&(l=e[0]),l}},{key:"os",get:function(){return h.os}},{key:"browser",get:function(){var i=h.browser;return i.name||(i.name=u()),i}}]),t}();b.default=a},function(U,b,L){"use strict";function E(v,u){if(!(v instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function v(u,h){for(var a=0;a<h.length;a++){var t=h[a];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,h,a){return h&&v(u.prototype,h),a&&v(u,a),u}}(),w=function(){function v(){E(this,v)}return A(v,null,[{key:"get",value:function(u,h,a,t,i){var l;a=a||function(){},typeof XMLHttpRequest=="undefined"&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(c){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(c){}throw new Error("This browser does not support XMLHttpRequest.")}),l=new XMLHttpRequest,l.onreadystatechange=function(){l.readyState===4&&(l.status===200?h(l.responseText):a(l.responseText))};try{t===void 0&&(t=!0),l.open("GET",u,t),i&&(l.withCredentials=!0)}catch(c){return void a(c)}try{l.send()}catch(c){a(c)}}}]),v}();b.default=w},function(U,b,L){"use strict";function E(h,a){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function h(a,t){for(var i=0;i<t.length;i++){var l=t[i];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(a,l.key,l)}}return function(a,t,i){return t&&h(a.prototype,t),i&&h(a,i),a}}(),w=L(27),v=L(30),u=(L(10),function(){function h(){E(this,h)}return A(h,null,[{key:"randomUUID",value:function(){for(var a=[],t="0123456789abcdef",i=0;i<36;i++)a[i]=t.substr(Math.floor(16*Math.random()),1);return a[14]="4",a[19]=t.substr(3&a[19]|8,1),a[8]=a[13]=a[18]=a[23]="-",a.join("")}},{key:"aliyunEncodeURI",value:function(a){var t=encodeURIComponent(a);return t=t.replace(/\+/g,"%20").replace(/\*/g,"%2A").replace(/%7E/g,"~").replace(/!/g,"%21").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}},{key:"makeUTF8sort",value:function(a,t,i){if(!a)throw new Error("PrismPlayer Error: vid should not be null!");var l=[];for(var c in a)l.push(c);for(var o=l.sort(),e="",s=o.length,c=0;c<s;c++){var r=h.aliyunEncodeURI(o[c]),d=h.aliyunEncodeURI(a[o[c]]);e==""?e=r+t+d:e+=i+r+t+d}return e}},{key:"makeChangeSiga",value:function(a,t){if(!a)throw new Error("PrismPlayer Error: vid should not be null!");return v.stringify(w("GET&"+h.aliyunEncodeURI("/")+"&"+h.aliyunEncodeURI(h.makeUTF8sort(a,"=","&")),t+"&"))}}]),h}());b.default=u},function(U,b,L){!function(E,A){U.exports=b=A(L(0))}(0,function(E){return E.enc.Utf8})},function(U,b,L){!function(E,A){U.exports=b=A(L(0))}(0,function(E){return E.enc.Hex})},function(U,b,L){U.exports=L(13)},function(U,b,L){"use strict";var E,A,w=(typeof Symbol=="function"&&Symbol.iterator,L(14)),v=function(h){return h&&h.__esModule?h:{default:h}}(w),u={Vod:v.default};E=[],(A=function(){return u}.apply(b,E))!==void 0&&(U.exports=A),window.AliyunUpload=u,rt.exports=AliyunUpload},function(U,b,L){"use strict";function E(S){return S&&S.__esModule?S:{default:S}}function A(S,T){if(!(S instanceof T))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var w=function(){function S(T,R){for(var D=0;D<R.length;D++){var I=R[D];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(T,I.key,I)}}return function(T,R,D){return R&&S(T.prototype,R),D&&S(T,D),T}}(),v=L(15),u=L(3),h=L(16),a=E(h),t=L(18),i=E(t),l=L(24),c=E(l),o=L(4),e=E(o),s=L(1),r=E(s),d=L(5),f=E(d),g=L(26),m=E(g),p=L(31),_=E(p),y=L(32),n=E(y),x=(L(2),function(){function S(T){A(this,S),this.options=T,this.options.partSize=this.options.partSize||u.UPLOADDEFAULT.PARTSIZE,this.options.parallel=this.options.parallel||u.UPLOADDEFAULT.PARALLEL,this.options.region=this.options.region||"cn-shanghai",this.options.cname=this.options.cname||!1,this.options.localCheckpoint=this.options.localCheckpoint||!1,this.options.enableUploadProgress===void 0&&(this.options.enableUploadProgress=!0),this._ossCreditor=new Object,this._state=v.VODSTATE.INIT,this._uploadList=[],this._curIndex=-1,this._ossUpload=null,this._log=new e.default,this._retryCount=0,this._retryTotal=this.options.retryCount||3,this._retryDuration=this.options.retryDuration||2,this._state=v.VODSTATE.INIT,this._uploadWay="vod",this._onbeforeunload=!1,this._invalidUserId=!1,this._initEvent()}return w(S,[{key:"init",value:function(T,R,D,I){return this._retryCount=0,!(D&&!I||!D&&I)&&!(T&&!R||!T&&R)&&(this._ossCreditor.accessKeyId=T,this._ossCreditor.accessKeySecret=R,this._ossCreditor.securityToken=D,this._ossCreditor.expireTime=I,!0)}},{key:"addFile",value:function(T,R,D,I,B,G){if(!T)return!1;if(T.size==0)try{this.options.onUploadFailed({file:T},"EmptyFile","\u6587\u4EF6\u5927\u5C0F\u4E3A0\uFF0C\u4E0D\u80FD\u4E0A\u4F20")}catch(V){console.log(V)}for(var k=(this.options,0);k<this._uploadList.length;k++)if(this._uploadList[k].file==T)return!1;var $=new Object;if($.file=T,$._endpoint=R,$._bucket=D,$._object=I,$.state=v.UPLOADSTATE.INIT,$.isImage=r.default.isImage(T.name),!$.isImage&&this.options.enableUploadProgress){var X=this;n.default.getMd5(T,function(V){$.fileHash=V;var N=X._getCheckoutpoint($);X.options.localCheckpoint||N||X._getCheckoutpointFromCloud($,function(z){if(z.UploadPoint){var q=JSON.parse(z.UploadPoint);q.loaded!=1&&($.checkpoint=q.checkpoint,$.loaded=q.loaded,$.videoId=z.VideoId,X._saveCheckoutpoint($,q.checkpoint))}},function(z){try{if((z=JSON.parse(z))&&z.Code=="InvalidParameter"&&z.Message.indexOf("UserId")>0){X._invalidUserId=!0;var q=z.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(q)}}catch(ee){console.log(ee)}})})}B&&($.videoInfo=B?JSON.parse(B).Vod:{},$.userData=i.default.encode(B)),$.ri=f.default.create(),this._uploadList.push($),this._reportLog("20001",$,{ql:this._uploadList.length});try{this.options.addFileSuccess&&this.options.addFileSuccess($)}catch(V){console.log(V)}return!0}},{key:"deleteFile",value:function(T){return!!this.cancelFile(T)&&(this._uploadList.splice(T,1),!0)}},{key:"cleanList",value:function(){this.stopUpload(),this._uploadList.length=0,this._curIndex=-1}},{key:"cancelFile",value:function(T){if(this.options,T<0||T>=this._uploadList.length)return!1;var R=this._uploadList[T];if(T==this._curIndex&&R.state==v.UPLOADSTATE.UPLOADING){R.state=v.UPLOADSTATE.CANCELED;var D=this._getCheckoutpoint(R);D&&D.checkpoint&&(D=D.checkpoint),D&&this._ossUpload.abort(R),this._removeCheckoutpoint(R),this.nextUpload()}else R.state!=v.UPLOADSTATE.SUCCESS&&(R.state=v.UPLOADSTATE.CANCELED);return this._reportLog("20008",R),!0}},{key:"resumeFile",value:function(T){if(this.options,T<0||T>=this._uploadList.length)return!1;var R=this._uploadList[T];return R.state==v.UPLOADSTATE.CANCELED&&(R.state=v.UPLOADSTATE.INIT,!0)}},{key:"listFiles",value:function(){return this._uploadList}},{key:"getCheckpoint",value:function(T){return this._getCheckoutpoint({file:T})}},{key:"startUpload",value:function(T){if(this._retryCount=0,this.options,this._state==v.VODSTATE.START||this._state==v.VODSTATE.EXPIRE)return void console.log("already started or expired");if(this._initState(),this._curIndex=this._findUploadIndex(),this._curIndex==-1)return void(this._state=v.VODSTATE.END);var R=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(R),this._state=v.VODSTATE.START}},{key:"nextUpload",value:function(){var T=this.options;if(this._state==v.VODSTATE.START)if(this._curIndex=this._findUploadIndex(),this._curIndex!=-1){var R=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(R)}else{this._state=v.VODSTATE.END;try{T.onUploadEnd&&T.onUploadEnd(R)}catch(D){console.log(D)}}}},{key:"clear",value:function(T){for(var R=this.options,D=0,I=0;I<this._uploadList.length;I++)R.uploadList[I].state==v.UPLOADSTATE.SUCCESS&&D++,this._uploadList[I].state==T&&(R.uploadList.splice(I,1),I--);R.onClear&&R.onClear(R.uploadList.length,D)}},{key:"stopUpload",value:function(){if((this._state==v.VODSTATE.START||this._state==v.VODSTATE.FAILURE||this._curIndex==-1)&&this._curIndex!=-1){var T=this._uploadList[this._curIndex];this._state=v.VODSTATE.STOP,T.state=v.UPLOADSTATE.STOPED,this._changeState(T,v.UPLOADSTATE.STOPED),this._ossUpload.cancel()}}},{key:"resumeUploadWithAuth",value:function(T){var R=this;if(!T)return!1;var D=JSON.parse(i.default.decode(T));return!!(D.AccessKeyId&&D.AccessKeySecret&&D.SecurityToken&&D.Expiration)&&R.resumeUploadWithToken(D.AccessKeyId,D.AccessKeySecret,D.SecurityToken,D.Expiration)}},{key:"resumeUploadWithToken",value:function(T,R,D,I){if(this.options,!(T&&R&&D&&I))return!1;if(this._state!=v.VODSTATE.EXPIRE)return!1;if(this._curIndex==-1)return!1;var B="";return this._uploadList.length>this._curIndex&&(B=this._uploadList[this._curIndex]),B&&(this.init(T,R,D,I),this._state=v.VODSTATE.START,this._ossUpload=null,this._uploadCore(B,B.retry),B.retry=!1),!0}},{key:"resumeUploadWithSTSToken",value:function(T,R,D){if(this._curIndex==-1)return!1;if(this._state!=v.VODSTATE.EXPIRE)return!1;if(this._uploadList.length>this._curIndex){var I=this._uploadList[this._curIndex];I.object?this._refreshSTSTokenUpload(I,T,R,D):this.setSTSToken(I,T,R,D)}}},{key:"setSTSTokenDirectlyUpload",value:function(T,R,D,I,B){if(!(R&&D&&I&&B))return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken and expiration should not be empty."),!1;this._ut="oss";var G=T;this.init(R,D,I,B),G.endpoint=G._endpoint,G.bucket=G._bucket,G.object=G._object,this._ossUpload=null,this._uploadCore(G,T.retry),T.retry=!1}},{key:"setSTSToken",value:function(T,R,D,I){if(!R||!D||!I)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;this._ut="vod",this._uploadWay="sts";var B=T.videoInfo,G={accessKeyId:R,securityToken:I,accessKeySecret:D,fileName:T.file.name,title:B.Title,requestId:T.ri,region:this.options.region};B.ImageType&&(G.imageType=B.ImageType),B.ImageExt&&(G.imageExt=B.ImageExt),B.FileSize&&(G.fileSize=B.FileSize),B.Description&&(G.description=B.Description),B.CateId&&(G.cateId=B.CateId),B.Tags&&(G.tags=B.Tags),B.TemplateGroupId&&(G.templateGroupId=B.TemplateGroupId),B.StorageLocation&&(G.storageLocation=B.StorageLocation),B.CoverURL&&(G.coverUrl=B.CoverURL),B.TransCodeMode&&(G.transCodeMode=B.TransCodeMode),B.UserData&&(G.userData=B.UserData);var k=this,$="getUploadAuth";T.videoId?(G.videoId=T.videoId,$="refreshUploadAuth"):T.isImage&&($="getImageUploadAuth"),m.default[$](G,function(X){T.videoId=X.VideoId?X.VideoId:T.videoId,k.setUploadAuthAndAddress(T,X.UploadAuth,X.UploadAddress),k._state=v.VODSTATE.START},function(X){k._error(T,{name:X.Code,code:X.Code,message:X.Message,requestId:X.RequestId})})}},{key:"setUploadAuthAndAddress",value:function(T,R,D,I){if(!T||!R||!D)return!1;var B=JSON.parse(i.default.decode(R));if(!(B.AccessKeyId&&B.AccessKeySecret&&B.SecurityToken&&B.Expiration))return console.error("uploadauth is invalid"),!1;var G={},k=T;if(D){if(G=JSON.parse(i.default.decode(D)),!G.Endpoint||!G.Bucket||!G.FileName)return console.error("uploadAddress is invalid"),!1}else G.Endpoint=k.endpoint,G.Bucket=k.bucket,G.FileName=k.object;this._ut="vod",this._uploadWay="vod",this.options.region=B.Region||this.options.region,this.init(B.AccessKeyId,B.AccessKeySecret,B.SecurityToken,B.Expiration),k.endpoint=k._endpoint?k._endpoint:G.Endpoint,k.bucket=k._bucket?k._bucket:G.Bucket,k.object=k._object?k._object:G.FileName,k.region=this.options.region,I&&(k.videoId=I),this._ossUpload=null,this._uploadCore(k,T.retry),T.retry=!1}},{key:"_refreshSTSTokenUpload",value:function(T,R,D,I){if(!R||!D||!I)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;var B={accessKeyId:R,securityToken:I,accessKeySecret:D,videoId:T.object,requestId:T.ri,region:this.options.region},G=this,k="refreshUploadAuth";T.isImage&&(k="getImageUploadAuth"),m.default[k](B,function($){G.setUploadAuthAndAddress(T,$.UploadAuth,UploadAddress),G._state=v.VODSTATE.START},function($){G._error(T,{name:$.Code,code:$.Code,message:$.Message,requestId:$.RequestId})})}},{key:"_upload",value:function(T){var R=arguments.length>1&&arguments[1]!==void 0&&arguments[1],D=this.options;if(T.retry=R,D.onUploadstarted&&!R)try{var I=this._getCheckoutpoint(T);I&&I.state!=v.UPLOADSTATE.UPLOADING&&(T.checkpoint=I,T.videoId=I.videoId),D.onUploadstarted(T)}catch(B){console.log(B)}}},{key:"_uploadCore",value:function(T){if(arguments.length>1&&arguments[1]!==void 0&&arguments[1],!this._ossCreditor.accessKeyId||!this._ossCreditor.accessKeySecret||!this._ossCreditor.securityToken)throw new Error("AccessKeyId\u3001AccessKeySecret\u3001securityToken should not be null");if(T.state=v.UPLOADSTATE.UPLOADING,!this._ossUpload){T.endpoint=T.endpoint||"http://oss-cn-hangzhou.aliyuncs.com";var R=this;this._ossUpload=new a.default({bucket:T.bucket,endpoint:T.endpoint,AccessKeyId:this._ossCreditor.accessKeyId,AccessKeySecret:this._ossCreditor.accessKeySecret,SecurityToken:this._ossCreditor.securityToken,timeout:this.options.timeout,cname:this.options.cname},{onerror:function(X,V){R._error.call(R,X,V)},oncomplete:function(X,V){R._complete.call(R,X,V)},onprogress:function(X,V,N){R._progress.call(R,X,V,N)}})}var D=r.default.getFileType(T.file.name),I=this._getCheckoutpoint(T),B="",G="";I&&I.checkpoint&&(G=I.state,B=I.videoId,I=I.checkpoint),I&&B==T.videoId&&G!=v.UPLOADSTATE.UPLOADING&&(I.file=T.file,T.checkpoint=I,I.uploadId);var k=this._adjustPartSize(T);this._reportLog("20002",T,{ft:D,fs:T.file.size,bu:T.bucket,ok:T.object,vid:T.videoId||"",fn:T.file.name,fw:null,fh:null,ps:k});var $={headers:{"x-oss-notification":T.userData?T.userData:""},partSize:k,parallel:this.options.parallel};this._ossUpload.upload(T,$)}},{key:"_findUploadIndex",value:function(){for(var T=-1,R=0;R<this._uploadList.length;R++)if(this._uploadList[R].state==v.UPLOADSTATE.INIT){T=R;break}return T}},{key:"_error",value:function(T,R){if(R.name=="cancel")try{this.options.onUploadCanceled(T,R)}catch(I){console.log(I)}else{if(R.message.indexOf("InvalidAccessKeyIdError")>0||R.name=="SignatureDoesNotMatchError"||R.code=="SecurityTokenExpired"||R.code=="InvalidSecurityToken.Expired"||R.code=="InvalidAccessKeyId"&&this._ossCreditor.securityToken){if(this.options.onUploadTokenExpired){this._state=v.VODSTATE.EXPIRE,T.state=v.UPLOADSTATE.FAIlURE;try{this.options.onUploadTokenExpired(T,R)}catch(I){console.log(I)}}return}if((R.name=="RequestTimeoutError"||R.name=="ConnectionTimeout"||R.name=="ConnectionTimeoutError")&&this._retryTotal>this._retryCount){var D=this;return setTimeout(function(){D._uploadCore(T,!0)},1e3*D._retryDuration),void this._retryCount++}R.name=="NoSuchUploadError"&&this._removeCheckoutpoint(T),this._handleError(T,R)}}},{key:"_handleError",value:function(T,R){var D=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],I=v.UPLOADSTATE.FAIlURE;if(T.state!=v.UPLOADSTATE.CANCELED&&(T.state=v.UPLOADSTATE.FAIlURE,this._state=v.VODSTATE.FAILURE,this.options.onUploadFailed&&R&&R.code&&R.message))try{this.options.onUploadFailed(T,R.code,R.message)}catch(G){console.log(G)}if(D&&this._changeState(T,I),this._reportLog("20006",T,{code:R.name,message:R.message,requestId:R.requestId,fs:T.file.size,bu:T.bucket,ok:T.object,fn:T.file.name}),this._reportLog("20004",T,{requestId:R.requestId,fs:T.file.size,bu:T.bucket,ok:T.object,fn:T.file.name}),T.ri=f.default.create(),this._findUploadIndex()!=-1){var B=this;this._state=v.VODSTATE.START,setTimeout(function(){B.nextUpload()},100)}}},{key:"_complete",value:function(T,R){if(T.state=v.UPLOADSTATE.SUCCESS,this.options.onUploadSucceed)try{this.options.onUploadSucceed(T)}catch(B){console.log(B)}var D=0;R&&R.res&&R.res.headers&&(D=R.res.headers["x-oss-request-id"]),this._removeCheckoutpoint(T);var I=this;setTimeout(function(){I.nextUpload()},100),this._retryCount=0,this._reportLog("20003",T,{requestId:D})}},{key:"_progress",value:function(T,R,D){if(this.options.onUploadProgress)try{T.loaded=R.loaded,this.options.onUploadProgress(T,R.total,R.loaded)}catch(V){console.log(V)}var I=R.checkpoint,B=0;I&&(T.checkpoint=I,this._saveCheckoutpoint(T,I,v.UPLOADSTATE.UPLOADING),B=I.uploadId),this._retryCount=0;var G=this._getPortNumber(I),k=0;if(D&&D.headers&&(k=D.headers["x-oss-request-id"]),R.loaded!=0&&this._reportLog("20007",T,{pn:G,requestId:k}),R.loaded!=1&&this._reportLog("20005",T,{UploadId:B,pn:G+1,pr:T.retry?1:0,fs:T.file.size,bu:T.bucket,ok:T.object,fn:T.file.name}),!this._invalidUserId&&!T.isImage&&this._ut=="vod"&&this.options.enableUploadProgress){var $={file:T.file,checkpoint:R,userId:this.options.userId,videoId:T.videoId,region:this.options.region,fileHash:T.fileHash};try{var X=this;_.default.upload($,function(){},function(V){if((V=JSON.parse(V))&&V.Code=="InvalidParameter"&&V.Message.indexOf("UserId")>0){X._invalidUserId=!0;var N=V.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(N)}})}catch(V){console.log(V)}}}},{key:"_getPortNumber",value:function(T){if(T){var R=T.doneParts;if(R&&R.length>0)return R[R.length-1].number}return 0}},{key:"_removeCheckoutpoint",value:function(T){var R=this._getCheckoutpointKey(T);c.default.remove(R)}},{key:"_getCheckoutpoint",value:function(T){var R=this._getCheckoutpointKey(T),D=c.default.get(R);if(D)try{return JSON.parse(D)}catch(I){}return""}},{key:"_saveCheckoutpoint",value:function(T,R,D){if(R){var I=this._getCheckoutpointKey(T),B=T.file,G={fileName:B.name,lastModified:B.lastModified,size:B.size,object:T.object,videoId:T.videoId,bucket:T.bucket,endpoint:T.endpoint,checkpoint:R,loaded:T.loaded,state:D};c.default.set(I,JSON.stringify(G))}}},{key:"_changeState",value:function(T,R){var D=this._getCheckoutpoint(T);D&&((this._onbeforeunload=!0)&&(R=v.UPLOADSTATE.STOPED),this._saveCheckoutpoint(T,D.checkpoint,R))}},{key:"_getCheckoutpointKey",value:function(T){return"upload_"+T.file.lastModified+"_"+T.file.name+"_"+T.file.size}},{key:"_getCheckoutpointFromCloud",value:function(T,R,D){var I={userId:this.options.userId,uploadInfoList:[{FileName:T.file.name,FileSize:T.file.size,FileCreateTime:T.file.lastModified,FileHash:T.fileHash}],region:this.options.region};_.default.get(I,function(B){R(B)},D)}},{key:"_reportLog",value:function(T,R,D){D||(D={}),D.ri=R.ri,this._ut&&(D.ut=this._ut),this._log.log(T,D)}},{key:"_initEvent",value:function(){var T=this;window&&(window.onbeforeunload=function(R){if(T._onbeforeunload=!0,T._curIndex!=-1&&T._uploadList.length>T._curIndex){var D=T._uploadList[T._curIndex];T._changeState(D,v.UPLOADSTATE.STOPED)}})}},{key:"_initState",value:function(){for(var T=0;T<this._uploadList.length;T++){var R=this._uploadList[T];R.state!=v.UPLOADSTATE.FAIlURE&&R.state!=v.UPLOADSTATE.STOPED||(R.state=v.UPLOADSTATE.INIT)}this._state=v.VODSTATE.INIT}},{key:"_adjustPartSize",value:function(T){return T.file.size/this.options.partSize>1e4?T.file.size/9999:this.options.partSize}}]),S}());b.default=x},function(U,b,L){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.UPLOADSTATE={INIT:"Ready",UPLOADING:"Uploading",SUCCESS:"Success",FAIlURE:"Failure",CANCELED:"Canceled",STOPED:"Stoped"},b.VODSTATE={INIT:"Init",START:"Start",STOP:"Stop",FAILURE:"Failure",EXPIRE:"Expire",END:"End"}},function(U,b,L){"use strict";function E(t){return t&&t.__esModule?t:{default:t}}function A(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var w=function(){function t(i,l){for(var c=0;c<l.length;c++){var o=l[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(i,o.key,o)}}return function(i,l,c){return l&&t(i.prototype,l),c&&t(i,c),i}}(),v=L(3),u=L(17),h=(E(u),L(1)),a=(E(h),function(){function t(i,l){if(A(this,t),i){this._config=i,this.create(this._config),this._uploadInfo=null,this._callback={};var c=function(){};this._callback.onerror=l.onerror||c,this._callback.oncomplete=l.oncomplete||c,this._callback.onprogress=l.onprogress||c}}return w(t,[{key:"create",value:function(i){if(i.endpoint=i.endpoint||this._config.endpoint,i.bucket=i.bucket||this._config.bucket,!(i.AccessKeyId&&i.AccessKeySecret&&i.endpoint&&i.SecurityToken))throw new Error("AccessKeyId\u3001AccessKeySecret\u3001endpoint should not be null");var l={accessKeyId:i.AccessKeyId,accessKeySecret:i.AccessKeySecret,stsToken:i.SecurityToken,endpoint:i.endpoint||this._config.endpoint,bucket:i.bucket||this._config.bucket,secure:!0,cname:i.cname};i.timeout&&(l.timeout=i.timeout),this.oss=new OSS.Wrapper(l)}},{key:"abort",value:function(i){if(i.checkpoint){var l=i.checkpoint.uploadId;this.oss.abortMultipartUpload(i.object,l)}}},{key:"getVersion",value:function(){}},{key:"cancel",value:function(){this.oss.cancel&&this.oss.cancel()}},{key:"upload",value:function(i,l){this._uploadInfo=i;var c=this,o=function(s,r,d){return function(f){c._progress(s,r,d),f()}},e={parallel:l.parallel||this._config.parallel||v.UPLOADDEFAULT.PARALLEL,partSize:l.partSize||this._config.partSize||v.UPLOADDEFAULT.PARTSIZE,progress:o};l.headers&&(e.headers=l.headers),i.checkpoint&&(e.checkpoint=i.checkpoint),i.bucket||(this.oss.options.bucket=i.bucket),i.endpoint||(this.oss.options.endpoint=i.endpoint),this.oss.multipartUpload(i.object,i.file,e).then(function(s,r){c._complete(s)}).catch(function(s){c.oss.cancel&&(c.oss&&c.oss.isCancel()?console.log("oss is cancel as error"):c.oss.cancel()),c._error(s)})}},{key:"header",value:function(i,l,c){this.oss.get(i.object).then(function(o){l(o)}).catch(function(o){c(o)})}},{key:"_progress",value:function(i,l,c){this._callback.onprogress(this._uploadInfo,{loaded:i,total:this._uploadInfo.file.size,checkpoint:l},c)}},{key:"_error",value:function(i){this._callback.onerror(this._uploadInfo,i)}},{key:"_complete",value:function(i){this._callback.oncomplete(this._uploadInfo,i)}}]),t}());b.default=a},function(U,b,L){"use strict";function E(v,u){if(!(v instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function v(u,h){for(var a=0;a<h.length;a++){var t=h[a];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,h,a){return h&&v(u.prototype,h),a&&v(u,a),u}}(),w=function(){function v(){E(this,v)}return A(v,null,[{key:"format",value:function(u){if(arguments.length<2)return null;for(var h=arguments[1],a=1;a<arguments.length;a++){var t=new RegExp("\\{"+(a-1)+"\\}","gm");h=h.replace(t,arguments[a+1])}return{code:u,message:h}}},{key:"CODE",get:function(){return{SUCCESS:"Successful",EmptyValue:"InvalidParameter.EmptyValue",STSInvalid:"InvalidParameter.TokenInvalid",ReadFileError:"ReadFileError",FILEDUPLICATION:"FileDuplication",UploadALEADRYSTARTED:"UploadAlearyStarted"}}},{key:"MESSAGE",get:function(){return{SUCCESS:"Successful",EmptyValue:"\u53C2\u6570 {0} \u4E0D\u80FD\u4E3A\u7A7A\u3002",STSInvalid:"STS\u53C2\u6570\u975E\u6CD5\uFF0C accessKeyId\u3001accessKeySecret\u3001secretToken\u3001expireTime\u90FD\u4E0D\u80FD\u4E3A\u7A7A\u3002",ReadFileError:"\u8BFB\u53D6\u6587\u4EF6{0}{1}\u5931\u8D25.",FILEDUPLICATION:"\u6587\u4EF6\u91CD\u590D\u6DFB\u52A0 {0}",UploadALEADRYSTARTED:"\u91CD\u590D\u5F00\u59CB."}}}]),v}();b.default=w},function(U,b,L){"use strict";(function(E){function A(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var w=function(){function u(h,a){for(var t=0;t<a.length;t++){var i=a[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(h,i.key,i)}}return function(h,a,t){return a&&u(h.prototype,a),t&&u(h,t),h}}(),v=function(){function u(){A(this,u)}return w(u,null,[{key:"encode",value:function(h){return new E(h).toString("base64")}},{key:"decode",value:function(h){return new E(h,"base64").toString()}}]),u}();b.default=v}).call(b,L(19).Buffer)},function(U,b,L){"use strict";(function(E){function A(){return v.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function w(H,C){if(A()<C)throw new RangeError("Invalid typed array length");return v.TYPED_ARRAY_SUPPORT?(H=new Uint8Array(C),H.__proto__=v.prototype):(H===null&&(H=new v(C)),H.length=C),H}function v(H,C,O){if(!(v.TYPED_ARRAY_SUPPORT||this instanceof v))return new v(H,C,O);if(typeof H=="number"){if(typeof C=="string")throw new Error("If encoding is specified then the first argument must be a string");return t(this,H)}return u(this,H,C,O)}function u(H,C,O,j){if(typeof C=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&C instanceof ArrayBuffer?c(H,C,O,j):typeof C=="string"?i(H,C,O):o(H,C)}function h(H){if(typeof H!="number")throw new TypeError('"size" argument must be a number');if(H<0)throw new RangeError('"size" argument must not be negative')}function a(H,C,O,j){return h(C),C<=0?w(H,C):O!==void 0?typeof j=="string"?w(H,C).fill(O,j):w(H,C).fill(O):w(H,C)}function t(H,C){if(h(C),H=w(H,C<0?0:0|e(C)),!v.TYPED_ARRAY_SUPPORT)for(var O=0;O<C;++O)H[O]=0;return H}function i(H,C,O){if(typeof O=="string"&&O!==""||(O="utf8"),!v.isEncoding(O))throw new TypeError('"encoding" must be a valid string encoding');var j=0|r(C,O);H=w(H,j);var M=H.write(C,O);return M!==j&&(H=H.slice(0,M)),H}function l(H,C){var O=C.length<0?0:0|e(C.length);H=w(H,O);for(var j=0;j<O;j+=1)H[j]=255&C[j];return H}function c(H,C,O,j){if(C.byteLength,O<0||C.byteLength<O)throw new RangeError("'offset' is out of bounds");if(C.byteLength<O+(j||0))throw new RangeError("'length' is out of bounds");return C=O===void 0&&j===void 0?new Uint8Array(C):j===void 0?new Uint8Array(C,O):new Uint8Array(C,O,j),v.TYPED_ARRAY_SUPPORT?(H=C,H.__proto__=v.prototype):H=l(H,C),H}function o(H,C){if(v.isBuffer(C)){var O=0|e(C.length);return H=w(H,O),H.length===0||C.copy(H,0,0,O),H}if(C){if(typeof ArrayBuffer!="undefined"&&C.buffer instanceof ArrayBuffer||"length"in C)return typeof C.length!="number"||me(C.length)?w(H,0):l(H,C);if(C.type==="Buffer"&&be(C.data))return l(H,C.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function e(H){if(H>=A())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A().toString(16)+" bytes");return 0|H}function s(H){return+H!=H&&(H=0),v.alloc(+H)}function r(H,C){if(v.isBuffer(H))return H.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(H)||H instanceof ArrayBuffer))return H.byteLength;typeof H!="string"&&(H=""+H);var O=H.length;if(O===0)return 0;for(var j=!1;;)switch(C){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":case void 0:return se(H).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*O;case"hex":return O>>>1;case"base64":return te(H).length;default:if(j)return se(H).length;C=(""+C).toLowerCase(),j=!0}}function d(H,C,O){var j=!1;if((C===void 0||C<0)&&(C=0),C>this.length)return"";if((O===void 0||O>this.length)&&(O=this.length),O<=0)return"";if(O>>>=0,C>>>=0,O<=C)return"";for(H||(H="utf8");;)switch(H){case"hex":return G(this,C,O);case"utf8":case"utf-8":return R(this,C,O);case"ascii":return I(this,C,O);case"latin1":case"binary":return B(this,C,O);case"base64":return T(this,C,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,C,O);default:if(j)throw new TypeError("Unknown encoding: "+H);H=(H+"").toLowerCase(),j=!0}}function f(H,C,O){var j=H[C];H[C]=H[O],H[O]=j}function g(H,C,O,j,M){if(H.length===0)return-1;if(typeof O=="string"?(j=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,isNaN(O)&&(O=M?0:H.length-1),O<0&&(O=H.length+O),O>=H.length){if(M)return-1;O=H.length-1}else if(O<0){if(!M)return-1;O=0}if(typeof C=="string"&&(C=v.from(C,j)),v.isBuffer(C))return C.length===0?-1:m(H,C,O,j,M);if(typeof C=="number")return C&=255,v.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?M?Uint8Array.prototype.indexOf.call(H,C,O):Uint8Array.prototype.lastIndexOf.call(H,C,O):m(H,[C],O,j,M);throw new TypeError("val must be string, number or Buffer")}function m(H,C,O,j,M){function F(Pe,Re){return oe===1?Pe[Re]:Pe.readUInt16BE(Re*oe)}var oe=1,ve=H.length,ke=C.length;if(j!==void 0&&((j=String(j).toLowerCase())==="ucs2"||j==="ucs-2"||j==="utf16le"||j==="utf-16le")){if(H.length<2||C.length<2)return-1;oe=2,ve/=2,ke/=2,O/=2}var Oe;if(M){var De=-1;for(Oe=O;Oe<ve;Oe++)if(F(H,Oe)===F(C,De===-1?0:Oe-De)){if(De===-1&&(De=Oe),Oe-De+1===ke)return De*oe}else De!==-1&&(Oe-=Oe-De),De=-1}else for(O+ke>ve&&(O=ve-ke),Oe=O;Oe>=0;Oe--){for(var Ue=!0,Ke=0;Ke<ke;Ke++)if(F(H,Oe+Ke)!==F(C,Ke)){Ue=!1;break}if(Ue)return Oe}return-1}function p(H,C,O,j){O=Number(O)||0;var M=H.length-O;j?(j=Number(j))>M&&(j=M):j=M;var F=C.length;if(F%2!=0)throw new TypeError("Invalid hex string");j>F/2&&(j=F/2);for(var oe=0;oe<j;++oe){var ve=parseInt(C.substr(2*oe,2),16);if(isNaN(ve))return oe;H[O+oe]=ve}return oe}function _(H,C,O,j){return Q(se(C,H.length-O),H,O,j)}function y(H,C,O,j){return Q(ge(C),H,O,j)}function n(H,C,O,j){return y(H,C,O,j)}function x(H,C,O,j){return Q(te(C),H,O,j)}function S(H,C,O,j){return Q(ie(C,H.length-O),H,O,j)}function T(H,C,O){return C===0&&O===H.length?re.fromByteArray(H):re.fromByteArray(H.slice(C,O))}function R(H,C,O){O=Math.min(H.length,O);for(var j=[],M=C;M<O;){var F=H[M],oe=null,ve=F>239?4:F>223?3:F>191?2:1;if(M+ve<=O){var ke,Oe,De,Ue;switch(ve){case 1:F<128&&(oe=F);break;case 2:ke=H[M+1],(192&ke)==128&&(Ue=(31&F)<<6|63&ke)>127&&(oe=Ue);break;case 3:ke=H[M+1],Oe=H[M+2],(192&ke)==128&&(192&Oe)==128&&(Ue=(15&F)<<12|(63&ke)<<6|63&Oe)>2047&&(Ue<55296||Ue>57343)&&(oe=Ue);break;case 4:ke=H[M+1],Oe=H[M+2],De=H[M+3],(192&ke)==128&&(192&Oe)==128&&(192&De)==128&&(Ue=(15&F)<<18|(63&ke)<<12|(63&Oe)<<6|63&De)>65535&&Ue<1114112&&(oe=Ue)}}oe===null?(oe=65533,ve=1):oe>65535&&(oe-=65536,j.push(oe>>>10&1023|55296),oe=56320|1023&oe),j.push(oe),M+=ve}return D(j)}function D(H){var C=H.length;if(C<=Ee)return String.fromCharCode.apply(String,H);for(var O="",j=0;j<C;)O+=String.fromCharCode.apply(String,H.slice(j,j+=Ee));return O}function I(H,C,O){var j="";O=Math.min(H.length,O);for(var M=C;M<O;++M)j+=String.fromCharCode(127&H[M]);return j}function B(H,C,O){var j="";O=Math.min(H.length,O);for(var M=C;M<O;++M)j+=String.fromCharCode(H[M]);return j}function G(H,C,O){var j=H.length;(!C||C<0)&&(C=0),(!O||O<0||O>j)&&(O=j);for(var M="",F=C;F<O;++F)M+=pe(H[F]);return M}function k(H,C,O){for(var j=H.slice(C,O),M="",F=0;F<j.length;F+=2)M+=String.fromCharCode(j[F]+256*j[F+1]);return M}function $(H,C,O){if(H%1!=0||H<0)throw new RangeError("offset is not uint");if(H+C>O)throw new RangeError("Trying to access beyond buffer length")}function X(H,C,O,j,M,F){if(!v.isBuffer(H))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>M||C<F)throw new RangeError('"value" argument is out of bounds');if(O+j>H.length)throw new RangeError("Index out of range")}function V(H,C,O,j){C<0&&(C=65535+C+1);for(var M=0,F=Math.min(H.length-O,2);M<F;++M)H[O+M]=(C&255<<8*(j?M:1-M))>>>8*(j?M:1-M)}function N(H,C,O,j){C<0&&(C=4294967295+C+1);for(var M=0,F=Math.min(H.length-O,4);M<F;++M)H[O+M]=C>>>8*(j?M:3-M)&255}function z(H,C,O,j,M,F){if(O+j>H.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function q(H,C,O,j,M){return M||z(H,C,O,4,34028234663852886e22,-34028234663852886e22),J.write(H,C,O,j,23,4),O+4}function ee(H,C,O,j,M){return M||z(H,C,O,8,17976931348623157e292,-17976931348623157e292),J.write(H,C,O,j,52,8),O+8}function fe(H){if(H=ae(H).replace(Le,""),H.length<2)return"";for(;H.length%4!=0;)H+="=";return H}function ae(H){return H.trim?H.trim():H.replace(/^\s+|\s+$/g,"")}function pe(H){return H<16?"0"+H.toString(16):H.toString(16)}function se(H,C){C=C||1/0;for(var O,j=H.length,M=null,F=[],oe=0;oe<j;++oe){if((O=H.charCodeAt(oe))>55295&&O<57344){if(!M){if(O>56319){(C-=3)>-1&&F.push(239,191,189);continue}if(oe+1===j){(C-=3)>-1&&F.push(239,191,189);continue}M=O;continue}if(O<56320){(C-=3)>-1&&F.push(239,191,189),M=O;continue}O=65536+(M-55296<<10|O-56320)}else M&&(C-=3)>-1&&F.push(239,191,189);if(M=null,O<128){if((C-=1)<0)break;F.push(O)}else if(O<2048){if((C-=2)<0)break;F.push(O>>6|192,63&O|128)}else if(O<65536){if((C-=3)<0)break;F.push(O>>12|224,O>>6&63|128,63&O|128)}else{if(!(O<1114112))throw new Error("Invalid code point");if((C-=4)<0)break;F.push(O>>18|240,O>>12&63|128,O>>6&63|128,63&O|128)}}return F}function ge(H){for(var C=[],O=0;O<H.length;++O)C.push(255&H.charCodeAt(O));return C}function ie(H,C){for(var O,j,M,F=[],oe=0;oe<H.length&&!((C-=2)<0);++oe)O=H.charCodeAt(oe),j=O>>8,M=O%256,F.push(M),F.push(j);return F}function te(H){return re.toByteArray(fe(H))}function Q(H,C,O,j){for(var M=0;M<j&&!(M+O>=C.length||M>=H.length);++M)C[M+O]=H[M];return M}function me(H){return H!==H}/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/var re=L(21),J=L(22),be=L(23);b.Buffer=v,b.SlowBuffer=s,b.INSPECT_MAX_BYTES=50,v.TYPED_ARRAY_SUPPORT=E.TYPED_ARRAY_SUPPORT!==void 0?E.TYPED_ARRAY_SUPPORT:function(){try{var H=new Uint8Array(1);return H.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},H.foo()===42&&typeof H.subarray=="function"&&H.subarray(1,1).byteLength===0}catch(C){return!1}}(),b.kMaxLength=A(),v.poolSize=8192,v._augment=function(H){return H.__proto__=v.prototype,H},v.from=function(H,C,O){return u(null,H,C,O)},v.TYPED_ARRAY_SUPPORT&&(v.prototype.__proto__=Uint8Array.prototype,v.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&v[Symbol.species]===v&&Object.defineProperty(v,Symbol.species,{value:null,configurable:!0})),v.alloc=function(H,C,O){return a(null,H,C,O)},v.allocUnsafe=function(H){return t(null,H)},v.allocUnsafeSlow=function(H){return t(null,H)},v.isBuffer=function(H){return!(H==null||!H._isBuffer)},v.compare=function(H,C){if(!v.isBuffer(H)||!v.isBuffer(C))throw new TypeError("Arguments must be Buffers");if(H===C)return 0;for(var O=H.length,j=C.length,M=0,F=Math.min(O,j);M<F;++M)if(H[M]!==C[M]){O=H[M],j=C[M];break}return O<j?-1:j<O?1:0},v.isEncoding=function(H){switch(String(H).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}},v.concat=function(H,C){if(!be(H))throw new TypeError('"list" argument must be an Array of Buffers');if(H.length===0)return v.alloc(0);var O;if(C===void 0)for(C=0,O=0;O<H.length;++O)C+=H[O].length;var j=v.allocUnsafe(C),M=0;for(O=0;O<H.length;++O){var F=H[O];if(!v.isBuffer(F))throw new TypeError('"list" argument must be an Array of Buffers');F.copy(j,M),M+=F.length}return j},v.byteLength=r,v.prototype._isBuffer=!0,v.prototype.swap16=function(){var H=this.length;if(H%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var C=0;C<H;C+=2)f(this,C,C+1);return this},v.prototype.swap32=function(){var H=this.length;if(H%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var C=0;C<H;C+=4)f(this,C,C+3),f(this,C+1,C+2);return this},v.prototype.swap64=function(){var H=this.length;if(H%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var C=0;C<H;C+=8)f(this,C,C+7),f(this,C+1,C+6),f(this,C+2,C+5),f(this,C+3,C+4);return this},v.prototype.toString=function(){var H=0|this.length;return H===0?"":arguments.length===0?R(this,0,H):d.apply(this,arguments)},v.prototype.equals=function(H){if(!v.isBuffer(H))throw new TypeError("Argument must be a Buffer");return this===H||v.compare(this,H)===0},v.prototype.inspect=function(){var H="",C=b.INSPECT_MAX_BYTES;return this.length>0&&(H=this.toString("hex",0,C).match(/.{2}/g).join(" "),this.length>C&&(H+=" ... ")),"<Buffer "+H+">"},v.prototype.compare=function(H,C,O,j,M){if(!v.isBuffer(H))throw new TypeError("Argument must be a Buffer");if(C===void 0&&(C=0),O===void 0&&(O=H?H.length:0),j===void 0&&(j=0),M===void 0&&(M=this.length),C<0||O>H.length||j<0||M>this.length)throw new RangeError("out of range index");if(j>=M&&C>=O)return 0;if(j>=M)return-1;if(C>=O)return 1;if(C>>>=0,O>>>=0,j>>>=0,M>>>=0,this===H)return 0;for(var F=M-j,oe=O-C,ve=Math.min(F,oe),ke=this.slice(j,M),Oe=H.slice(C,O),De=0;De<ve;++De)if(ke[De]!==Oe[De]){F=ke[De],oe=Oe[De];break}return F<oe?-1:oe<F?1:0},v.prototype.includes=function(H,C,O){return this.indexOf(H,C,O)!==-1},v.prototype.indexOf=function(H,C,O){return g(this,H,C,O,!0)},v.prototype.lastIndexOf=function(H,C,O){return g(this,H,C,O,!1)},v.prototype.write=function(H,C,O,j){if(C===void 0)j="utf8",O=this.length,C=0;else if(O===void 0&&typeof C=="string")j=C,O=this.length,C=0;else{if(!isFinite(C))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");C|=0,isFinite(O)?(O|=0,j===void 0&&(j="utf8")):(j=O,O=void 0)}var M=this.length-C;if((O===void 0||O>M)&&(O=M),H.length>0&&(O<0||C<0)||C>this.length)throw new RangeError("Attempt to write outside buffer bounds");j||(j="utf8");for(var F=!1;;)switch(j){case"hex":return p(this,H,C,O);case"utf8":case"utf-8":return _(this,H,C,O);case"ascii":return y(this,H,C,O);case"latin1":case"binary":return n(this,H,C,O);case"base64":return x(this,H,C,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,H,C,O);default:if(F)throw new TypeError("Unknown encoding: "+j);j=(""+j).toLowerCase(),F=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Ee=4096;v.prototype.slice=function(H,C){var O=this.length;H=~~H,C=C===void 0?O:~~C,H<0?(H+=O)<0&&(H=0):H>O&&(H=O),C<0?(C+=O)<0&&(C=0):C>O&&(C=O),C<H&&(C=H);var j;if(v.TYPED_ARRAY_SUPPORT)j=this.subarray(H,C),j.__proto__=v.prototype;else{var M=C-H;j=new v(M,void 0);for(var F=0;F<M;++F)j[F]=this[F+H]}return j},v.prototype.readUIntLE=function(H,C,O){H|=0,C|=0,O||$(H,C,this.length);for(var j=this[H],M=1,F=0;++F<C&&(M*=256);)j+=this[H+F]*M;return j},v.prototype.readUIntBE=function(H,C,O){H|=0,C|=0,O||$(H,C,this.length);for(var j=this[H+--C],M=1;C>0&&(M*=256);)j+=this[H+--C]*M;return j},v.prototype.readUInt8=function(H,C){return C||$(H,1,this.length),this[H]},v.prototype.readUInt16LE=function(H,C){return C||$(H,2,this.length),this[H]|this[H+1]<<8},v.prototype.readUInt16BE=function(H,C){return C||$(H,2,this.length),this[H]<<8|this[H+1]},v.prototype.readUInt32LE=function(H,C){return C||$(H,4,this.length),(this[H]|this[H+1]<<8|this[H+2]<<16)+16777216*this[H+3]},v.prototype.readUInt32BE=function(H,C){return C||$(H,4,this.length),16777216*this[H]+(this[H+1]<<16|this[H+2]<<8|this[H+3])},v.prototype.readIntLE=function(H,C,O){H|=0,C|=0,O||$(H,C,this.length);for(var j=this[H],M=1,F=0;++F<C&&(M*=256);)j+=this[H+F]*M;return M*=128,j>=M&&(j-=Math.pow(2,8*C)),j},v.prototype.readIntBE=function(H,C,O){H|=0,C|=0,O||$(H,C,this.length);for(var j=C,M=1,F=this[H+--j];j>0&&(M*=256);)F+=this[H+--j]*M;return M*=128,F>=M&&(F-=Math.pow(2,8*C)),F},v.prototype.readInt8=function(H,C){return C||$(H,1,this.length),128&this[H]?-1*(255-this[H]+1):this[H]},v.prototype.readInt16LE=function(H,C){C||$(H,2,this.length);var O=this[H]|this[H+1]<<8;return 32768&O?4294901760|O:O},v.prototype.readInt16BE=function(H,C){C||$(H,2,this.length);var O=this[H+1]|this[H]<<8;return 32768&O?4294901760|O:O},v.prototype.readInt32LE=function(H,C){return C||$(H,4,this.length),this[H]|this[H+1]<<8|this[H+2]<<16|this[H+3]<<24},v.prototype.readInt32BE=function(H,C){return C||$(H,4,this.length),this[H]<<24|this[H+1]<<16|this[H+2]<<8|this[H+3]},v.prototype.readFloatLE=function(H,C){return C||$(H,4,this.length),J.read(this,H,!0,23,4)},v.prototype.readFloatBE=function(H,C){return C||$(H,4,this.length),J.read(this,H,!1,23,4)},v.prototype.readDoubleLE=function(H,C){return C||$(H,8,this.length),J.read(this,H,!0,52,8)},v.prototype.readDoubleBE=function(H,C){return C||$(H,8,this.length),J.read(this,H,!1,52,8)},v.prototype.writeUIntLE=function(H,C,O,j){(H=+H,C|=0,O|=0,!j)&&X(this,H,C,O,Math.pow(2,8*O)-1,0);var M=1,F=0;for(this[C]=255&H;++F<O&&(M*=256);)this[C+F]=H/M&255;return C+O},v.prototype.writeUIntBE=function(H,C,O,j){(H=+H,C|=0,O|=0,!j)&&X(this,H,C,O,Math.pow(2,8*O)-1,0);var M=O-1,F=1;for(this[C+M]=255&H;--M>=0&&(F*=256);)this[C+M]=H/F&255;return C+O},v.prototype.writeUInt8=function(H,C,O){return H=+H,C|=0,O||X(this,H,C,1,255,0),v.TYPED_ARRAY_SUPPORT||(H=Math.floor(H)),this[C]=255&H,C+1},v.prototype.writeUInt16LE=function(H,C,O){return H=+H,C|=0,O||X(this,H,C,2,65535,0),v.TYPED_ARRAY_SUPPORT?(this[C]=255&H,this[C+1]=H>>>8):V(this,H,C,!0),C+2},v.prototype.writeUInt16BE=function(H,C,O){return H=+H,C|=0,O||X(this,H,C,2,65535,0),v.TYPED_ARRAY_SUPPORT?(this[C]=H>>>8,this[C+1]=255&H):V(this,H,C,!1),C+2},v.prototype.writeUInt32LE=function(H,C,O){return H=+H,C|=0,O||X(this,H,C,4,4294967295,0),v.TYPED_ARRAY_SUPPORT?(this[C+3]=H>>>24,this[C+2]=H>>>16,this[C+1]=H>>>8,this[C]=255&H):N(this,H,C,!0),C+4},v.prototype.writeUInt32BE=function(H,C,O){return H=+H,C|=0,O||X(this,H,C,4,4294967295,0),v.TYPED_ARRAY_SUPPORT?(this[C]=H>>>24,this[C+1]=H>>>16,this[C+2]=H>>>8,this[C+3]=255&H):N(this,H,C,!1),C+4},v.prototype.writeIntLE=function(H,C,O,j){if(H=+H,C|=0,!j){var M=Math.pow(2,8*O-1);X(this,H,C,O,M-1,-M)}var F=0,oe=1,ve=0;for(this[C]=255&H;++F<O&&(oe*=256);)H<0&&ve===0&&this[C+F-1]!==0&&(ve=1),this[C+F]=(H/oe>>0)-ve&255;return C+O},v.prototype.writeIntBE=function(H,C,O,j){if(H=+H,C|=0,!j){var M=Math.pow(2,8*O-1);X(this,H,C,O,M-1,-M)}var F=O-1,oe=1,ve=0;for(this[C+F]=255&H;--F>=0&&(oe*=256);)H<0&&ve===0&&this[C+F+1]!==0&&(ve=1),this[C+F]=(H/oe>>0)-ve&255;return C+O},v.prototype.writeInt8=function(H,C,O){return H=+H,C|=0,O||X(this,H,C,1,127,-128),v.TYPED_ARRAY_SUPPORT||(H=Math.floor(H)),H<0&&(H=255+H+1),this[C]=255&H,C+1},v.prototype.writeInt16LE=function(H,C,O){return H=+H,C|=0,O||X(this,H,C,2,32767,-32768),v.TYPED_ARRAY_SUPPORT?(this[C]=255&H,this[C+1]=H>>>8):V(this,H,C,!0),C+2},v.prototype.writeInt16BE=function(H,C,O){return H=+H,C|=0,O||X(this,H,C,2,32767,-32768),v.TYPED_ARRAY_SUPPORT?(this[C]=H>>>8,this[C+1]=255&H):V(this,H,C,!1),C+2},v.prototype.writeInt32LE=function(H,C,O){return H=+H,C|=0,O||X(this,H,C,4,2147483647,-2147483648),v.TYPED_ARRAY_SUPPORT?(this[C]=255&H,this[C+1]=H>>>8,this[C+2]=H>>>16,this[C+3]=H>>>24):N(this,H,C,!0),C+4},v.prototype.writeInt32BE=function(H,C,O){return H=+H,C|=0,O||X(this,H,C,4,2147483647,-2147483648),H<0&&(H=4294967295+H+1),v.TYPED_ARRAY_SUPPORT?(this[C]=H>>>24,this[C+1]=H>>>16,this[C+2]=H>>>8,this[C+3]=255&H):N(this,H,C,!1),C+4},v.prototype.writeFloatLE=function(H,C,O){return q(this,H,C,!0,O)},v.prototype.writeFloatBE=function(H,C,O){return q(this,H,C,!1,O)},v.prototype.writeDoubleLE=function(H,C,O){return ee(this,H,C,!0,O)},v.prototype.writeDoubleBE=function(H,C,O){return ee(this,H,C,!1,O)},v.prototype.copy=function(H,C,O,j){if(O||(O=0),j||j===0||(j=this.length),C>=H.length&&(C=H.length),C||(C=0),j>0&&j<O&&(j=O),j===O)return 0;if(H.length===0||this.length===0)return 0;if(C<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("sourceStart out of bounds");if(j<0)throw new RangeError("sourceEnd out of bounds");j>this.length&&(j=this.length),H.length-C<j-O&&(j=H.length-C+O);var M,F=j-O;if(this===H&&O<C&&C<j)for(M=F-1;M>=0;--M)H[M+C]=this[M+O];else if(F<1e3||!v.TYPED_ARRAY_SUPPORT)for(M=0;M<F;++M)H[M+C]=this[M+O];else Uint8Array.prototype.set.call(H,this.subarray(O,O+F),C);return F},v.prototype.fill=function(H,C,O,j){if(typeof H=="string"){if(typeof C=="string"?(j=C,C=0,O=this.length):typeof O=="string"&&(j=O,O=this.length),H.length===1){var M=H.charCodeAt(0);M<256&&(H=M)}if(j!==void 0&&typeof j!="string")throw new TypeError("encoding must be a string");if(typeof j=="string"&&!v.isEncoding(j))throw new TypeError("Unknown encoding: "+j)}else typeof H=="number"&&(H&=255);if(C<0||this.length<C||this.length<O)throw new RangeError("Out of range index");if(O<=C)return this;C>>>=0,O=O===void 0?this.length:O>>>0,H||(H=0);var F;if(typeof H=="number")for(F=C;F<O;++F)this[F]=H;else{var oe=v.isBuffer(H)?H:se(new v(H,j).toString()),ve=oe.length;for(F=0;F<O-C;++F)this[F+C]=oe[F%ve]}return this};var Le=/[^+\/0-9A-Za-z-_]/g}).call(b,L(20))},function(U,b){var L;L=function(){return this}();try{L=L||Function("return this")()||(0,eval)("this")}catch(E){typeof window=="object"&&(L=window)}U.exports=L},function(U,b,L){"use strict";function E(e){var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return e[s-2]==="="?2:e[s-1]==="="?1:0}function A(e){return 3*e.length/4-E(e)}function w(e){var s,r,d,f,g,m=e.length;f=E(e),g=new i(3*m/4-f),r=f>0?m-4:m;var p=0;for(s=0;s<r;s+=4)d=t[e.charCodeAt(s)]<<18|t[e.charCodeAt(s+1)]<<12|t[e.charCodeAt(s+2)]<<6|t[e.charCodeAt(s+3)],g[p++]=d>>16&255,g[p++]=d>>8&255,g[p++]=255&d;return f===2?(d=t[e.charCodeAt(s)]<<2|t[e.charCodeAt(s+1)]>>4,g[p++]=255&d):f===1&&(d=t[e.charCodeAt(s)]<<10|t[e.charCodeAt(s+1)]<<4|t[e.charCodeAt(s+2)]>>2,g[p++]=d>>8&255,g[p++]=255&d),g}function v(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}function u(e,s,r){for(var d,f=[],g=s;g<r;g+=3)d=(e[g]<<16)+(e[g+1]<<8)+e[g+2],f.push(v(d));return f.join("")}function h(e){for(var s,r=e.length,d=r%3,f="",g=[],m=0,p=r-d;m<p;m+=16383)g.push(u(e,m,m+16383>p?p:m+16383));return d===1?(s=e[r-1],f+=a[s>>2],f+=a[s<<4&63],f+="=="):d===2&&(s=(e[r-2]<<8)+e[r-1],f+=a[s>>10],f+=a[s>>4&63],f+=a[s<<2&63],f+="="),g.push(f),g.join("")}b.byteLength=A,b.toByteArray=w,b.fromByteArray=h;for(var a=[],t=[],i=typeof Uint8Array!="undefined"?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,o=l.length;c<o;++c)a[c]=l[c],t[l.charCodeAt(c)]=c;t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63},function(U,b){b.read=function(L,E,A,w,v){var u,h,a=8*v-w-1,t=(1<<a)-1,i=t>>1,l=-7,c=A?v-1:0,o=A?-1:1,e=L[E+c];for(c+=o,u=e&(1<<-l)-1,e>>=-l,l+=a;l>0;u=256*u+L[E+c],c+=o,l-=8);for(h=u&(1<<-l)-1,u>>=-l,l+=w;l>0;h=256*h+L[E+c],c+=o,l-=8);if(u===0)u=1-i;else{if(u===t)return h?NaN:1/0*(e?-1:1);h+=Math.pow(2,w),u-=i}return(e?-1:1)*h*Math.pow(2,u-w)},b.write=function(L,E,A,w,v,u){var h,a,t,i=8*u-v-1,l=(1<<i)-1,c=l>>1,o=v===23?Math.pow(2,-24)-Math.pow(2,-77):0,e=w?0:u-1,s=w?1:-1,r=E<0||E===0&&1/E<0?1:0;for(E=Math.abs(E),isNaN(E)||E===1/0?(a=isNaN(E)?1:0,h=l):(h=Math.floor(Math.log(E)/Math.LN2),E*(t=Math.pow(2,-h))<1&&(h--,t*=2),E+=h+c>=1?o/t:o*Math.pow(2,1-c),E*t>=2&&(h++,t/=2),h+c>=l?(a=0,h=l):h+c>=1?(a=(E*t-1)*Math.pow(2,v),h+=c):(a=E*Math.pow(2,c-1)*Math.pow(2,v),h=0));v>=8;L[A+e]=255&a,e+=s,a/=256,v-=8);for(h=h<<v|a,i+=v;i>0;L[A+e]=255&h,e+=s,h/=256,i-=8);L[A+e-s]|=128*r}},function(U,b){var L={}.toString;U.exports=Array.isArray||function(E){return L.call(E)=="[object Array]"}},function(U,b,L){"use strict";function E(v,u){if(!(v instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function v(u,h){for(var a=0;a<h.length;a++){var t=h[a];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,h,a){return h&&v(u.prototype,h),a&&v(u,a),u}}(),w=function(){function v(){E(this,v)}return A(v,null,[{key:"set",value:function(u,h){try{window.localStorage&&localStorage.setItem(u,h)}catch(a){window[u+"_localStorage"]=h}}},{key:"get",value:function(u){try{if(window.localStorage)return localStorage.getItem(u)}catch(h){return window[u+"_localStorage"]}return""}},{key:"remove",value:function(u){try{window.localStorage&&localStorage.removeItem(u)}catch(h){delete window[u+"_localStorage"]}}}]),v}();b.default=w},function(U,b,L){"use strict";function E(v,u){if(!(v instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function v(u,h){for(var a=0;a<h.length;a++){var t=h[a];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,h,a){return h&&v(u.prototype,h),a&&v(u,a),u}}(),w=function(){function v(){E(this,v)}return A(v,null,[{key:"get",value:function(u){for(var h=u+"",a=document.cookie.split(";"),t=0;t<a.length;t++){var i=a[t].trim();if(i.indexOf(h)==0)return unescape(i.substring(h.length+1,i.length))}return""}},{key:"set",value:function(u,h,a){var t=new Date;t.setTime(t.getTime()+24*a*60*60*1e3);var i="expires="+t.toGMTString();document.cookie=u+"="+escape(h)+"; "+i}}]),v}();b.default=w},function(U,b,L){"use strict";function E(i){return i&&i.__esModule?i:{default:i}}function A(i,l){if(!(i instanceof l))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var w=function(){function i(l,c){for(var o=0;o<c.length;o++){var e=c[o];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(l,e.key,e)}}return function(l,c,o){return c&&i(l.prototype,c),o&&i(l,o),l}}(),v=L(8),u=E(v),h=L(9),a=E(h),t=function(){function i(){A(this,i)}return w(i,null,[{key:"refreshUploadAuth",value:function(l,c,o){var e=(a.default.randomUUID(),a.default.randomUUID()),s={AccessKeyId:l.accessKeyId,SecurityToken:l.securityToken,Action:"RefreshUploadVideo",VideoId:l.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:e,RequestId:l.requestId},r=a.default.makeUTF8sort(s,"=","&")+"&Signature="+a.default.aliyunEncodeURI(a.default.makeChangeSiga(s,l.accessKeySecret)),d="https://vod."+l.region+".aliyuncs.com/?"+r;u.default.get(d,function(f){var f=JSON.parse(f);c&&c(f)},function(f){if(o){var g=JSON.parse(f);o(g)}})}},{key:"getUploadAuth",value:function(l,c,o){var e=(a.default.randomUUID(),a.default.randomUUID()),s={AccessKeyId:l.accessKeyId,SecurityToken:l.securityToken,Action:"CreateUploadVideo",Title:l.title,FileName:l.fileName,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:e,RequestId:l.requestId};l.fileSize&&(s.FileSize=l.fileSize),l.description&&(s.Description=l.description),l.cateId&&(s.CateId=l.cateId),l.tags&&(s.Tags=l.tags),l.templateGroupId&&(s.TemplateGroupId=l.templateGroupId),l.storageLocation&&(s.StorageLocation=l.storageLocation),l.coverUrl&&(s.CoverURL=l.coverUrl),l.transCodeMode&&(s.TransCodeMode=l.transCodeMode),l.userData&&(s.UserData=JSON.stringify(l.userData));var r=a.default.makeUTF8sort(s,"=","&")+"&Signature="+a.default.aliyunEncodeURI(a.default.makeChangeSiga(s,l.accessKeySecret)),d="https://vod."+l.region+".aliyuncs.com/?"+r;u.default.get(d,function(f){try{f=JSON.parse(f)}catch(g){if(o)return void o({Code:"GetUploadAuthFailed",Message:"\u83B7\u53D6uploadauth\u5931\u8D25"})}c&&c(f)},function(f){if(o){var g={Code:"GetUploadAuthFailed",Message:"\u83B7\u53D6uploadauth\u5931\u8D25"};try{g=JSON.parse(f)}catch(m){}o(g)}})}},{key:"getImageUploadAuth",value:function(l,c,o){var e=(a.default.randomUUID(),a.default.randomUUID()),s={AccessKeyId:l.accessKeyId,SecurityToken:l.securityToken,Action:"CreateUploadImage",ImageType:l.imageType?l.imageType:"default",Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:e,RequestId:l.requestId};l.title&&(s.Title=l.title),l.imageExt&&(s.ImageExt=l.imageExt),l.tags&&(s.Tags=l.tags),l.storageLocation&&(s.StorageLocation=l.storageLocation);var r=a.default.makeUTF8sort(s,"=","&")+"&Signature="+a.default.aliyunEncodeURI(a.default.makeChangeSiga(s,l.accessKeySecret)),d="https://vod."+l.region+".aliyuncs.com/?"+r;u.default.get(d,function(f){f=JSON.parse(f),c&&c(f)},function(f){if(o){var g=JSON.parse(f);o(g)}})}}]),i}();b.default=t},function(U,b,L){!function(E,A,w){U.exports=b=A(L(0),L(28),L(29))}(0,function(E){return E.HmacSHA1})},function(U,b,L){!function(E,A){U.exports=b=A(L(0))}(0,function(E){return function(){var A=E,w=A.lib,v=w.WordArray,u=w.Hasher,h=A.algo,a=[],t=h.SHA1=u.extend({_doReset:function(){this._hash=new v.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(i,l){for(var c=this._hash.words,o=c[0],e=c[1],s=c[2],r=c[3],d=c[4],f=0;f<80;f++){if(f<16)a[f]=0|i[l+f];else{var g=a[f-3]^a[f-8]^a[f-14]^a[f-16];a[f]=g<<1|g>>>31}var m=(o<<5|o>>>27)+d+a[f];m+=f<20?1518500249+(e&s|~e&r):f<40?1859775393+(e^s^r):f<60?(e&s|e&r|s&r)-1894007588:(e^s^r)-899497514,d=r,r=s,s=e<<30|e>>>2,e=o,o=m}c[0]=c[0]+o|0,c[1]=c[1]+e|0,c[2]=c[2]+s|0,c[3]=c[3]+r|0,c[4]=c[4]+d|0},_doFinalize:function(){var i=this._data,l=i.words,c=8*this._nDataBytes,o=8*i.sigBytes;return l[o>>>5]|=128<<24-o%32,l[14+(o+64>>>9<<4)]=Math.floor(c/4294967296),l[15+(o+64>>>9<<4)]=c,i.sigBytes=4*l.length,this._process(),this._hash},clone:function(){var i=u.clone.call(this);return i._hash=this._hash.clone(),i}});A.SHA1=u._createHelper(t),A.HmacSHA1=u._createHmacHelper(t)}(),E.SHA1})},function(U,b,L){!function(E,A){U.exports=b=A(L(0))}(0,function(E){!function(){var A=E,w=A.lib,v=w.Base,u=A.enc,h=u.Utf8,a=A.algo;a.HMAC=v.extend({init:function(t,i){t=this._hasher=new t.init,typeof i=="string"&&(i=h.parse(i));var l=t.blockSize,c=4*l;i.sigBytes>c&&(i=t.finalize(i)),i.clamp();for(var o=this._oKey=i.clone(),e=this._iKey=i.clone(),s=o.words,r=e.words,d=0;d<l;d++)s[d]^=1549556828,r[d]^=909522486;o.sigBytes=e.sigBytes=c,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var i=this._hasher,l=i.finalize(t);return i.reset(),i.finalize(this._oKey.clone().concat(l))}})}()})},function(U,b,L){!function(E,A){U.exports=b=A(L(0))}(0,function(E){return function(){function A(a,t,i){for(var l=[],c=0,o=0;o<t;o++)if(o%4){var e=i[a.charCodeAt(o-1)]<<o%4*2,s=i[a.charCodeAt(o)]>>>6-o%4*2;l[c>>>2]|=(e|s)<<24-c%4*8,c++}return u.create(l,c)}var w=E,v=w.lib,u=v.WordArray,h=w.enc;h.Base64={stringify:function(a){var t=a.words,i=a.sigBytes,l=this._map;a.clamp();for(var c=[],o=0;o<i;o+=3)for(var e=t[o>>>2]>>>24-o%4*8&255,s=t[o+1>>>2]>>>24-(o+1)%4*8&255,r=t[o+2>>>2]>>>24-(o+2)%4*8&255,d=e<<16|s<<8|r,f=0;f<4&&o+.75*f<i;f++)c.push(l.charAt(d>>>6*(3-f)&63));var g=l.charAt(64);if(g)for(;c.length%4;)c.push(g);return c.join("")},parse:function(a){var t=a.length,i=this._map,l=this._reverseMap;if(!l){l=this._reverseMap=[];for(var c=0;c<i.length;c++)l[i.charCodeAt(c)]=c}var o=i.charAt(64);if(o){var e=a.indexOf(o);e!==-1&&(t=e)}return A(a,t,l)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),E.enc.Base64})},function(U,b,L){"use strict";function E(p){return p&&p.__esModule?p:{default:p}}function A(p,_){if(!(p instanceof _))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var w=function(){function p(_,y){for(var n=0;n<y.length;n++){var x=y[n];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(_,x.key,x)}}return function(_,y,n){return y&&p(_.prototype,y),n&&p(_,n),_}}(),v=L(8),u=E(v),h=L(7),a=E(h),t=L(4),i=E(t),l=L(6),c=E(l),o=L(1),e=E(o),s=L(9),r=E(s),d=L(2),f=L(11),g=L(10),m=function(){function p(){A(this,p)}return w(p,null,[{key:"getAuthInfo",value:function(_,y,n){var x=_+"|f#Ylm&^1TppeRhLg|"+n;return y&&(x=_+"|"+y+"|f#Ylm&^1TppeRhLg|"+n),d(g.parse(x)).toString(f)}},{key:"upload",value:function(_,y,n){var x=e.default.ISODateString(new Date),S=Math.floor(new Date().valueOf()/1e3),T=i.default.getClientId();T=i.default.setClientId(T);var R=p.getAuthInfo(_.userId,T,S),D=r.default.randomUUID(),I={Source:"WebSDK",BusinessType:"UploadVideo",Action:"ReportUploadProgress",TerminalType:"H5",DeviceModel:a.default.browser.name+(a.default.browser.version||""),AppVersion:c.default.version,AuthTimestamp:S,Timestamp:x,AuthInfo:R,FileName:_.file.name,FileSize:_.file.size,FileCreateTime:_.file.lastModified,FileHash:_.fileHash,UploadId:_.checkpoint.checkpoint.uploadId,PartSize:_.checkpoint.checkpoint.partSize,DonePartsCount:_.checkpoint.checkpoint.doneParts.length,UploadPoint:JSON.stringify(_.checkpoint),UploadRatio:_.checkpoint.loaded,UserId:_.userId,VideoId:_.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:D};T&&(I.ClientId=T);var B=r.default.makeUTF8sort(I,"=","&")+"&Signature="+r.default.aliyunEncodeURI(r.default.makeChangeSiga(I,_.accessKeySecret)),G="https://vod."+_.region+".aliyuncs.com/?"+B;u.default.get(G,function(k){y&&y()},function(k){k&&(n(k),console.log(k))})}},{key:"get",value:function(_,y,n){var x=e.default.ISODateString(new Date),S=Math.floor(new Date().valueOf()/1e3),T=i.default.getClientId(),R=p.getAuthInfo(_.userId,T,S),D=r.default.randomUUID(),I={Source:"WebSDK",BusinessType:"UploadVideo",Action:"GetUploadProgress",TerminalType:"H5",DeviceModel:a.default.browser.name+(a.default.browser.version||""),AppVersion:c.default.version,AuthTimestamp:S,Timestamp:x,AuthInfo:R,UserId:_.userId,UploadInfoList:JSON.stringify(_.uploadInfoList),Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:D};T&&(I.ClientId=T);var B=r.default.makeUTF8sort(I,"=","&")+"&Signature="+r.default.aliyunEncodeURI(r.default.makeChangeSiga(I,_.accessKeySecret)),G="https://vod."+_.region+".aliyuncs.com/?"+B;u.default.get(G,function(k){var $={},X=T;k=k?JSON.parse(k):{},k.UploadProgress&&k.UploadProgress.UploadProgressList&&k.UploadProgress.UploadProgressList.length>0&&($=k.UploadProgress.UploadProgressList[0],X=$.ClientId),i.default.setClientId(X),y&&y($)},function(k){k&&(n(k),console.log(k))})}}]),p}();b.default=m},function(U,b,L){"use strict";function E(h,a){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var A=function(){function h(a,t){for(var i=0;i<t.length;i++){var l=t[i];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(a,l.key,l)}}return function(a,t,i){return t&&h(a.prototype,t),i&&h(a,i),a}}(),w=L(2),v=L(33),u=(L(11),function(){function h(){E(this,h)}return A(h,null,[{key:"getMd5",value:function(a,t,i){var l=new FileReader;l.onload=function(e){try{if(e&&e.target){var s=w(v.parse(e.target.result)),r=s.toString();t(r)}}catch(d){console.log(d)}},l.onerror=function(e){console.log(e),errorCallback(e)};var c=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,o=c.call(a,0,1024);l.readAsBinaryString(o)}}]),h}());b.default=u},function(U,b,L){!function(E,A){U.exports=b=A(L(0))}(0,function(E){return E.enc.Latin1})}])}).call(this,he("IyRk"))},rHrb:function(rt,tt,he){"use strict";Object.defineProperty(tt,"__esModule",{value:!0}),tt.CopyToClipboard=void 0;var Se=U(he("cDcd")),Z=U(he("+QRC"));function U(s){return s&&s.__esModule?s:{default:s}}function b(s){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?b=function(d){return typeof d}:b=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},b(s)}function L(s,r){var d=Object.keys(s);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(s);r&&(f=f.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),d.push.apply(d,f)}return d}function E(s){for(var r=1;r<arguments.length;r++){var d=arguments[r]!=null?arguments[r]:{};r%2?L(d,!0).forEach(function(f){o(s,f,d[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(d)):L(d).forEach(function(f){Object.defineProperty(s,f,Object.getOwnPropertyDescriptor(d,f))})}return s}function A(s,r){if(s==null)return{};var d=w(s,r),f,g;if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(s);for(g=0;g<m.length;g++){if(f=m[g],r.indexOf(f)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(s,f))continue;d[f]=s[f]}}return d}function w(s,r){if(s==null)return{};var d={},f=Object.keys(s),g,m;for(m=0;m<f.length;m++){if(g=f[m],r.indexOf(g)>=0)continue;d[g]=s[g]}return d}function v(s,r){if(!(s instanceof r))throw new TypeError("Cannot call a class as a function")}function u(s,r){for(var d=0;d<r.length;d++){var f=r[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(s,f.key,f)}}function h(s,r,d){return r&&u(s.prototype,r),d&&u(s,d),s}function a(s,r){return r&&(b(r)==="object"||typeof r=="function")?r:i(s)}function t(s){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(d){return d.__proto__||Object.getPrototypeOf(d)},t(s)}function i(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function l(s,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(r&&r.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),r&&c(s,r)}function c(s,r){return c=Object.setPrototypeOf||function(f,g){return f.__proto__=g,f},c(s,r)}function o(s,r,d){return r in s?Object.defineProperty(s,r,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[r]=d,s}var e=function(s){l(r,s);function r(){var d,f;v(this,r);for(var g=arguments.length,m=new Array(g),p=0;p<g;p++)m[p]=arguments[p];return f=a(this,(d=t(r)).call.apply(d,[this].concat(m))),o(i(f),"onClick",function(_){var y=f.props,n=y.text,x=y.onCopy,S=y.children,T=y.options,R=Se.default.Children.only(S),D=(0,Z.default)(n,T);x&&x(n,D),R&&R.props&&typeof R.props.onClick=="function"&&R.props.onClick(_)}),f}return h(r,[{key:"render",value:function(){var f=this.props,g=f.text,m=f.onCopy,p=f.options,_=f.children,y=A(f,["text","onCopy","options","children"]),n=Se.default.Children.only(_);return Se.default.cloneElement(n,E({},y,{onClick:this.onClick}))}}]),r}(Se.default.PureComponent);tt.CopyToClipboard=e,o(e,"defaultProps",{onCopy:void 0,options:void 0})},rUJ1:function(rt,tt){const he=/[&<>"']/,Se=/[&<>"']/g,Z=/[<>"']|&(?!#?\w+;)/,U=/[<>"']|&(?!#?\w+;)/g,b={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},L=p=>b[p];function E(p,_){if(_){if(he.test(p))return p.replace(Se,L)}else if(Z.test(p))return p.replace(U,L);return p}const A=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function w(p){return p.replace(A,(_,y)=>(y=y.toLowerCase(),y==="colon"?":":y.charAt(0)==="#"?y.charAt(1)==="x"?String.fromCharCode(parseInt(y.substring(2),16)):String.fromCharCode(+y.substring(1)):""))}const v=/(^|[^\[])\^/g;function u(p,_){p=p.source||p,_=_||"";const y={replace:(n,x)=>(x=x.source||x,x=x.replace(v,"$1"),p=p.replace(n,x),y),getRegex:()=>new RegExp(p,_)};return y}const h=/[^\w:]/g,a=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function t(p,_,y){if(p){let n;try{n=decodeURIComponent(w(y)).replace(h,"").toLowerCase()}catch(x){return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}_&&!a.test(y)&&(y=e(_,y));try{y=encodeURI(y).replace(/%25/g,"%")}catch(n){return null}return y}const i={},l=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function e(p,_){i[" "+p]||(l.test(p)?i[" "+p]=p+"/":i[" "+p]=f(p,"/",!0)),p=i[" "+p];const y=p.indexOf(":")===-1;return _.substring(0,2)==="//"?y?_:p.replace(c,"$1")+_:_.charAt(0)==="/"?y?_:p.replace(o,"$1")+_:p+_}const s={exec:function(){}};function r(p){let _=1,y,n;for(;_<arguments.length;_++){y=arguments[_];for(n in y)Object.prototype.hasOwnProperty.call(y,n)&&(p[n]=y[n])}return p}function d(p,_){const y=p.replace(/\|/g,(S,T,R)=>{let D=!1,I=T;for(;--I>=0&&R[I]==="\\";)D=!D;return D?"|":" |"}),n=y.split(/ \|/);let x=0;if(n.length>_)n.splice(_);else for(;n.length<_;)n.push("");for(;x<n.length;x++)n[x]=n[x].trim().replace(/\\\|/g,"|");return n}function f(p,_,y){const n=p.length;if(n===0)return"";let x=0;for(;x<n;){const S=p.charAt(n-x-1);if(S===_&&!y)x++;else if(S!==_&&y)x++;else break}return p.substr(0,n-x)}function g(p,_){if(p.indexOf(_[1])===-1)return-1;const y=p.length;let n=0,x=0;for(;x<y;x++)if(p[x]==="\\")x++;else if(p[x]===_[0])n++;else if(p[x]===_[1]&&(n--,n<0))return x;return-1}function m(p){p&&p.sanitize&&!p.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}rt.exports={escape:E,unescape:w,edit:u,cleanUrl:t,resolveUrl:e,noopTest:s,merge:r,splitCells:d,rtrim:f,findClosingBracket:g,checkSanitizeDeprecation:m}},sBCT:function(rt,tt,he){"use strict";var Se=he("+BJd"),Z=he("mr32"),U=he("MXD1"),b=he("CFYs"),L=he("9og8"),E=he("2qtc"),A=he("kLXV"),w=he("miYZ"),v=he("tsqr"),u=he("y8nQ"),h=he("Vl3Y"),a=he("tJVT"),t=he("k1fw"),i=he("oBTY"),l=he("5NDa"),c=he("5rEg"),o=he("WmNS"),e=he.n(o),s=he("cDcd"),r=he.n(s),d=he("Ty5D"),f=he("55Ip"),g=he("9kvl"),m=he("kwm0"),p=he.n(m),_=he("Aky1"),y=he("h/US"),n=he("xKgJ"),x=c.a.TextArea,S=1024,T=function(I,B){var G,k=B.payload||{},$=k.uploadInfo,X=$===void 0?{}:$;switch(B.type){case"addVideo":return{videoList:[].concat(Object(i.a)(I.videoList),[{name:X.file.name,size:X.file.size,type:X.file.type,fileHash:X.fileHash,state:X.state,videoId:X.videoId,loaded:X.loaded||0,title:""}])};case"removeVideo":return{videoList:I.videoList.filter(function(V){return V.name!==B.payload.name})};case"removeAll":return{videoList:[]};case"updateProgress":return{videoList:I.videoList.map(function(V){return V.name===B.payload.uploadInfo.file.name?Object(t.a)(Object(t.a)({},V),{loaded:B.payload.progressPercent,videoId:X.videoId,fileHash:X.fileHash}):V})};case"updateTitle":return{videoList:(G=I.videoList)===null||G===void 0?void 0:G.map(function(V){return V.name===B.payload.item.name?Object(t.a)(Object(t.a)({},V),{title:B.payload.title}):V})};default:return{videoList:[]}}},R=function(I){var B,G=I.user,k=I.globalSetting,$=I.loading,X=I.dispatch,V=I.visible,N=I.editData,z=I.onCancel,q=z===void 0?function(){}:z,ee=I.onOk,fe=ee===void 0?function(){}:ee,ae=I.queryParams,pe=ae===void 0?{}:ae,se=Object(d.i)(),ge=h.a.useForm(),ie=Object(a.a)(ge,1),te=ie[0],Q=Object(s.useReducer)(T,{videoList:[]}),me=Object(a.a)(Q,2),re=me[0],J=me[1],be=Object(s.useState)(!1),Ee=Object(a.a)(be,2),Le=Ee[0],H=Ee[1],C=Object(s.useRef)(),O=Object(s.useState)(),j=Object(a.a)(O,2),M=j[0],F=j[1],oe=Object(s.useState)(!1),ve=Object(a.a)(oe,2),ke=ve[0],Oe=ve[1],De=Object(s.useState)(!1),Ue=Object(a.a)(De,2),Ke=Ue[0],Pe=Ue[1],Re=Object(n.v)()?3:1;Object(s.useEffect)(function(){var Ge,He;if(!V)return;if(!N)return;Oe(N.is_link),F(N.link),!N.is_link&&J({type:"addVideo",payload:{uploadInfo:{file:{name:N.file_name||N.name},videoId:N.video_id,loaded:100}}}),nt((N==null||((Ge=N.tags)===null||Ge===void 0)?void 0:Ge.map(function(Ye){return Ye==null?void 0:Ye.name}))||[]),te.setFieldsValue({name:N.name,description:N.description,attachment_id:N==null||((He=N.video)===null||He===void 0)?void 0:He.attachment_id})},[N,V]);var xe=function(){var He=document.getElementById("fileUpload");He.value=""},we=function(He){var Ye;Oe(!1);var Je=He.target.files[0];if(!Je){xe();return}var ot=Je.name.toLowerCase();if(ot&&ot.indexOf(".avi")==-1&&ot.indexOf(".flv")==-1&&ot.indexOf(".f4v")==-1&&ot.indexOf(".m4v")==-1&&ot.indexOf(".mov")==-1&&ot.indexOf(".mp4")==-1&&ot.indexOf(".rmvb")==-1&&ot.indexOf(".swf")==-1&&ot.indexOf(".webm")==-1&&ot.indexOf(".wmv")==-1){v.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),xe();return}if(Je.size>S*Re*1024*1024){v.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(Re,"G")),xe();return}if((Ye=re.videoList)!==null&&Ye!==void 0&&Ye.find(function(dt){return dt.name===Je.name})){v.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),xe();return}ue(Je)},Te=function(He,Ye){A.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:r.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",Ye?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){xe(),J({type:"removeVideo",payload:{name:He}})}})},ue=function(He){var Ye,Je='{"Vod":{}}';if(H(!0),C.current){C.current.addFile(He,null,null,null,Je);return}Object(_.a)((Ye=G.userInfo)===null||Ye===void 0?void 0:Ye.login,"",{create:!C,addFileSuccess:function(dt){J({type:"addVideo",payload:{uploadInfo:dt}})},onUploadProgress:function(dt,ft,lt){var vt=Math.ceil(lt*100);J({type:"updateProgress",payload:{uploadInfo:dt,progressPercent:vt}}),xe()},onUploadFailed:function(dt){v.b.info("\u89C6\u9891\u4E91\u670D\u52A1\u51FA\u73B0\u5F02\u5E38\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u3002")},onUploadEnd:function(dt){H(!1)},onUploadSucceed:function(dt){H(!1)},onUploadError:function(dt){H(!1)},gotUploader:function(dt){dt.addFile(He,null,null,null,Je),C.current=dt}})},de=function(){var Ge=Object(L.a)(e.a.mark(function He(){var Ye,Je,ot,dt;return e.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:return lt.next=2,te.validateFields();case 2:if(!(!ke&&!((Ye=re.videoList)!==null&&Ye!==void 0&&Ye.length)||ke&&!M)){lt.next=5;break}return v.b.info("\u8BF7\u5148\u4E0A\u4F20\u89C6\u9891\u6216\u8005\u6DFB\u52A0\u5916\u94FE"),lt.abrupt("return");case 5:return Pe(!0),ot=ke?{link:M}:{video_id:(Je=re.videoList)===null||Je===void 0?void 0:Je[0].videoId},lt.next=9,fe(Object(t.a)(Object(t.a)(Object(t.a)({},ot),pe),{name:te.getFieldValue("name"),attachment_id:te.getFieldValue("attachment_id"),description:te.getFieldValue("description"),tags:st}));case 9:dt=lt.sent,Pe(!1),dt.id&&_e();case 12:case"end":return lt.stop()}},He)}));return function(){return Ge.apply(this,arguments)}}(),_e=function(){te.resetFields(),J({type:"removeAll"}),F(null),nt([]),Oe(null)},ye=function(){q(),_e()},Ie=function(){var He,Ye,Je,ot,dt,ft,lt,vt,gt,bt,Et,ht;return r.a.createElement(r.a.Fragment,null,!ke&&!!((He=re.videoList)!==null&&He!==void 0&&He.length)&&r.a.createElement("div",{className:p.a.fileProgress},((Ye=re.videoList)===null||Ye===void 0||((Je=Ye[0])===null||Je===void 0)?void 0:Je.loaded)==100?r.a.createElement("div",{className:"".concat(p.a.videoName," font14")},(ot=re.videoList)===null||ot===void 0||((dt=ot[0])===null||dt===void 0)?void 0:dt.name):r.a.createElement(b.a,{style:{width:"80%"},percent:(ft=re.videoList)===null||ft===void 0||((lt=ft[0])===null||lt===void 0)?void 0:lt.loaded,status:((vt=re.videoList)===null||vt===void 0||((gt=vt[0])===null||gt===void 0)?void 0:gt.loaded)==100?"normal":"active"}),r.a.createElement("div",{className:p.a.fileCancel,onClick:function(){var ce,ne,P,W;return Te((ce=re.videoList)===null||ce===void 0||((ne=ce[0])===null||ne===void 0)?void 0:ne.name,((P=re.videoList)===null||P===void 0||((W=P[0])===null||W===void 0)?void 0:W.loaded)==100)}},((bt=re.videoList)===null||bt===void 0||((Et=bt[0])===null||Et===void 0)?void 0:Et.loaded)===100?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20")),!((ht=re.videoList)!==null&&ht!==void 0&&ht.length)&&r.a.createElement("div",{className:p.a.uploadWrap},r.a.createElement("label",{htmlFor:"fileUpload",className:p.a.upload},r.a.createElement("i",{className:"iconfont icon-shangchuanshipin1 mr5"}),"\u4E0A\u4F20\u89C6\u9891"),r.a.createElement("label",{className:"".concat(p.a.upload," ").concat(p.a.uploadLink),onClick:function(){return Oe(!0)}},r.a.createElement("i",{className:"iconfont icon-lianjie1 mr5"}),"\u6DFB\u52A0\u5916\u94FE")),ke&&r.a.createElement(c.a,{className:"mt5",placeholder:"\u8BF7\u8F93\u5165\u89C6\u9891\u94FE\u63A5",value:M,onChange:function(ce){return F(ce.target.value)}}))},Me=Object(s.useState)([]),ze=Object(a.a)(Me,2),st=ze[0],nt=ze[1],Ve=function(He){if(He.key=="Enter"){var Ye=te.getFieldValue("tag");if(te.setFieldsValue({tag:""}),!Ye){v.b.info("\u6807\u7B7E\u4E0D\u80FD\u4E3A\u7A7A");return}if(st.filter(function(Je){return Je===Ye}).length>0){v.b.info("\u5DF2\u6709\u76F8\u540C\u540D\u79F0\u6807\u7B7E");return}st.push(Ye),nt(Object(i.a)(st))}},et=function(He,Ye){He.preventDefault(),nt(Object(i.a)(st.filter(function(Je){return Je!=Ye})))};return r.a.createElement(A.a,{centered:!0,maskClosable:!1,title:N?"\u7F16\u8F91\u89C6\u9891\u9879\u76EE":"\u65B0\u5EFA\u89C6\u9891\u9879\u76EE",width:740,className:p.a.modal,visible:V,confirmLoading:Ke,onOk:de,onCancel:ye},r.a.createElement(h.a,{form:te},r.a.createElement("input",{type:"file",id:"fileUpload",style:{display:"none"},onChange:we,accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"}),r.a.createElement(h.a.Item,{label:"\u9879\u76EE\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9879\u76EE\u540D\u79F0"}]},r.a.createElement(c.a,{maxLength:40,placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC740\u5B57\u7684\u9879\u76EE\u540D\u79F0"})),r.a.createElement(h.a.Item,{label:"\u9879\u76EE\u5185\u5BB9",name:"content",className:p.a.contentItem},Ie()),r.a.createElement(h.a.Item,{name:"attachment_id",label:"\u4E0A\u4F20\u5C01\u9762\u56FE:"},r.a.createElement(y.a,{getFileProgress:function(He){if(He.file.status==="uploading"){Pe(!0);return}He.file.status==="done"&&Pe(!1)}})),r.a.createElement(h.a.Item,{label:"\u9879\u76EE\u7B80\u4ECB",name:"description",className:"ml8"},r.a.createElement(x,{rows:5,maxLength:800,placeholder:"\u8BF7\u8F93\u5165\u672C\u89C6\u9891\u7B80\u4ECB\uFF0C\u6700\u591A\u4E0D\u8D85\u8FC7800\u5B57"})),r.a.createElement(h.a.Item,{label:"\u77E5\u8BC6\u6807\u7B7E",name:"tag",className:"ml8"},r.a.createElement(c.a,{onKeyUp:Ve})),r.a.createElement("div",{className:p.a["tagsList-content"]},st.map(function(Ge,He){return r.a.createElement(Z.a,{key:He+Ge,closable:!0,onClose:function(Je){et(Je,Ge)}},Ge)})),r.a.createElement("div",{className:"c-grey-999"},r.a.createElement("div",null,"\u6CE8\u610F\uFF1A"),r.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",r.a.createElement(f.a,{to:"/users/".concat((B=G.userInfo)===null||B===void 0?void 0:B.login,"/videos/protocol"),target:"_blank",className:p.a.colorBlue},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),r.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC7",Re,"G\uFF1B"),r.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"),r.a.createElement("div",null,"4\u3001\u5982\u679C\u89C6\u9891\u6765\u81EA\u4E8E\u5916\u90E8\u94FE\u63A5\uFF0C\u672C\u7F51\u7AD9\u4E0D\u63D0\u4F9B\u64AD\u653E\u9875\u9762\uFF0C\u65E0\u6CD5\u63D0\u4F9B\u7EDF\u8BA1\u6570\u636E\u3002"))))};tt.a=Object(g.a)(function(D){var I=D.user,B=D.loading,G=D.globalSetting;return{user:I,globalSetting:G,loading:B}})(R)},sWEp:function(rt,tt,he){rt.exports={wrap:"wrap___3nJXB",title:"title___3AYM5",radioWrap:"radioWrap___dbSML",radio:"radio___3h-_z",colorFF0000:"colorFF0000___2d_ZE",pagination:"pagination___3WP6s"}},ulZh:function(rt,tt,he){typeof window!="undefined"&&function(Z,U){rt.exports=U()}(this,function(){return function(Se){var Z={};function U(b){if(Z[b])return Z[b].exports;var L=Z[b]={i:b,l:!1,exports:{}};return Se[b].call(L.exports,L,L.exports,U),L.l=!0,L.exports}return U.m=Se,U.c=Z,U.d=function(b,L,E){U.o(b,L)||Object.defineProperty(b,L,{enumerable:!0,get:E})},U.r=function(b){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})},U.t=function(b,L){if(L&1&&(b=U(b)),L&8)return b;if(L&4&&typeof b=="object"&&b&&b.__esModule)return b;var E=Object.create(null);if(U.r(E),Object.defineProperty(E,"default",{enumerable:!0,value:b}),L&2&&typeof b!="string")for(var A in b)U.d(E,A,function(w){return b[w]}.bind(null,A));return E},U.n=function(b){var L=b&&b.__esModule?function(){return b.default}:function(){return b};return U.d(L,"a",L),L},U.o=function(b,L){return Object.prototype.hasOwnProperty.call(b,L)},U.p="/dist/",U(U.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Se,Z,U){"use strict";var b=Object.prototype.hasOwnProperty,L="~";function E(){}Object.create&&(E.prototype=Object.create(null),new E().__proto__||(L=!1));function A(h,a,t){this.fn=h,this.context=a,this.once=t||!1}function w(h,a,t,i,l){if(typeof t!="function")throw new TypeError("The listener must be a function");var c=new A(t,i||h,l),o=L?L+a:a;return h._events[o]?h._events[o].fn?h._events[o]=[h._events[o],c]:h._events[o].push(c):(h._events[o]=c,h._eventsCount++),h}function v(h,a){--h._eventsCount===0?h._events=new E:delete h._events[a]}function u(){this._events=new E,this._eventsCount=0}u.prototype.eventNames=function(){var a=[],t,i;if(this._eventsCount===0)return a;for(i in t=this._events)b.call(t,i)&&a.push(L?i.slice(1):i);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(t)):a},u.prototype.listeners=function(a){var t=L?L+a:a,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var l=0,c=i.length,o=new Array(c);l<c;l++)o[l]=i[l].fn;return o},u.prototype.listenerCount=function(a){var t=L?L+a:a,i=this._events[t];return i?i.fn?1:i.length:0},u.prototype.emit=function(a,t,i,l,c,o){var e=L?L+a:a;if(!this._events[e])return!1;var s=this._events[e],r=arguments.length,d,f;if(s.fn){s.once&&this.removeListener(a,s.fn,void 0,!0);switch(r){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,t),!0;case 3:return s.fn.call(s.context,t,i),!0;case 4:return s.fn.call(s.context,t,i,l),!0;case 5:return s.fn.call(s.context,t,i,l,c),!0;case 6:return s.fn.call(s.context,t,i,l,c,o),!0}for(f=1,d=new Array(r-1);f<r;f++)d[f-1]=arguments[f];s.fn.apply(s.context,d)}else{var g=s.length,m;for(f=0;f<g;f++){s[f].once&&this.removeListener(a,s[f].fn,void 0,!0);switch(r){case 1:s[f].fn.call(s[f].context);break;case 2:s[f].fn.call(s[f].context,t);break;case 3:s[f].fn.call(s[f].context,t,i);break;case 4:s[f].fn.call(s[f].context,t,i,l);break;default:if(!d)for(m=1,d=new Array(r-1);m<r;m++)d[m-1]=arguments[m];s[f].fn.apply(s[f].context,d)}}}return!0},u.prototype.on=function(a,t,i){return w(this,a,t,i,!1)},u.prototype.once=function(a,t,i){return w(this,a,t,i,!0)},u.prototype.removeListener=function(a,t,i,l){var c=L?L+a:a;if(!this._events[c])return this;if(!t)return v(this,c),this;var o=this._events[c];if(o.fn)o.fn===t&&(!l||o.once)&&(!i||o.context===i)&&v(this,c);else{for(var e=0,s=[],r=o.length;e<r;e++)(o[e].fn!==t||l&&!o[e].once||i&&o[e].context!==i)&&s.push(o[e]);s.length?this._events[c]=s.length===1?s[0]:s:v(this,c)}return this},u.prototype.removeAllListeners=function(a){var t;return a?(t=L?L+a:a,this._events[t]&&v(this,t)):(this._events=new E,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=L,u.EventEmitter=u,Se.exports=u},"./node_modules/url-toolkit/src/url-toolkit.js":function(Se,Z,U){(function(b){var L=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,E=/^([^\/?#]*)([^]*)$/,A=/(?:\/|^)\.(?=\/)/g,w=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,v={buildAbsoluteURL:function(u,h,a){if(a=a||{},u=u.trim(),h=h.trim(),!h){if(!a.alwaysNormalize)return u;var t=v.parseURL(u);if(!t)throw new Error("Error trying to parse base URL.");return t.path=v.normalizePath(t.path),v.buildURLFromParts(t)}var i=v.parseURL(h);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return a.alwaysNormalize?(i.path=v.normalizePath(i.path),v.buildURLFromParts(i)):h;var l=v.parseURL(u);if(!l)throw new Error("Error trying to parse base URL.");if(!l.netLoc&&l.path&&l.path[0]!=="/"){var c=E.exec(l.path);l.netLoc=c[1],l.path=c[2]}l.netLoc&&!l.path&&(l.path="/");var o={scheme:l.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(o.netLoc=l.netLoc,i.path[0]!=="/"))if(!i.path)o.path=l.path,i.params||(o.params=l.params,i.query||(o.query=l.query));else{var e=l.path,s=e.substring(0,e.lastIndexOf("/")+1)+i.path;o.path=v.normalizePath(s)}return o.path===null&&(o.path=a.alwaysNormalize?v.normalizePath(i.path):i.path),v.buildURLFromParts(o)},parseURL:function(u){var h=L.exec(u);return h?{scheme:h[1]||"",netLoc:h[2]||"",path:h[3]||"",params:h[4]||"",query:h[5]||"",fragment:h[6]||""}:null},normalizePath:function(u){for(u=u.split("").reverse().join("").replace(A,"");u.length!==(u=u.replace(w,"")).length;);return u.split("").reverse().join("")},buildURLFromParts:function(u){return u.scheme+u.netLoc+u.path+u.params+u.query+u.fragment}};Se.exports=v})(this)},"./node_modules/webworkify-webpack/index.js":function(Se,Z,U){function b(a){var t={};function i(c){if(t[c])return t[c].exports;var o=t[c]={i:c,l:!1,exports:{}};return a[c].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=a,i.c=t,i.i=function(c){return c},i.d=function(c,o,e){i.o(c,o)||Object.defineProperty(c,o,{configurable:!1,enumerable:!0,get:e})},i.r=function(c){Object.defineProperty(c,"__esModule",{value:!0})},i.n=function(c){var o=c&&c.__esModule?function(){return c.default}:function(){return c};return i.d(o,"a",o),o},i.o=function(c,o){return Object.prototype.hasOwnProperty.call(c,o)},i.p="/",i.oe=function(c){throw console.error(c),c};var l=i(i.s=ENTRY_MODULE);return l.default||l}var L="[\\.|\\-|\\+|\\w|/|@]+",E="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+L+").*?\\)";function A(a){return(a+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function w(a){return!isNaN(1*a)}function v(a,t,i){var l={};l[i]=[];var c=t.toString(),o=c.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return l;for(var e=o[1],s=new RegExp("(\\\\n|\\W)"+A(e)+E,"g"),r;r=s.exec(c);){if(r[3]==="dll-reference")continue;l[i].push(r[3])}for(s=new RegExp("\\("+A(e)+'\\("(dll-reference\\s('+L+'))"\\)\\)'+E,"g");r=s.exec(c);)a[r[2]]||(l[i].push(r[1]),a[r[2]]=U(r[1]).m),l[r[2]]=l[r[2]]||[],l[r[2]].push(r[4]);for(var d=Object.keys(l),f=0;f<d.length;f++)for(var g=0;g<l[d[f]].length;g++)w(l[d[f]][g])&&(l[d[f]][g]=1*l[d[f]][g]);return l}function u(a){var t=Object.keys(a);return t.reduce(function(i,l){return i||a[l].length>0},!1)}function h(a,t){for(var i={main:[t]},l={main:[]},c={main:{}};u(i);)for(var o=Object.keys(i),e=0;e<o.length;e++){var s=o[e],r=i[s],d=r.pop();if(c[s]=c[s]||{},c[s][d]||!a[s][d])continue;c[s][d]=!0,l[s]=l[s]||[],l[s].push(d);for(var f=v(a,a[s][d],s),g=Object.keys(f),m=0;m<g.length;m++)i[g[m]]=i[g[m]]||[],i[g[m]]=i[g[m]].concat(f[g[m]])}return l}Se.exports=function(a,t){t=t||{};var i={main:U.m},l=t.all?{main:Object.keys(i.main)}:h(i,a),c="";Object.keys(l).filter(function(d){return d!=="main"}).forEach(function(d){for(var f=0;l[d][f];)f++;l[d].push(f),i[d][f]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",c=c+"var "+d+" = ("+b.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+l[d].map(function(g){return""+JSON.stringify(g)+": "+i[d][g].toString()}).join(",")+`});
`}),c=c+"new (("+b.toString().replace("ENTRY_MODULE",JSON.stringify(a))+")({"+l.main.map(function(d){return""+JSON.stringify(d)+": "+i.main[d].toString()}).join(",")+"}))(self);";var o=new window.Blob([c],{type:"text/javascript"});if(t.bare)return o;var e=window.URL||window.webkitURL||window.mozURL||window.msURL,s=e.createObjectURL(o),r=new window.Worker(s);return r.objectURL=s,r}},"./src/config.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"hlsDefaultConfig",function(){return m}),U.d(Z,"mergeConfig",function(){return _}),U.d(Z,"enableStreamingMode",function(){return y});var b=U("./src/controller/abr-controller.ts"),L=U("./src/controller/audio-stream-controller.ts"),E=U("./src/controller/audio-track-controller.ts"),A=U("./src/controller/subtitle-stream-controller.ts"),w=U("./src/controller/subtitle-track-controller.ts"),v=U("./src/controller/buffer-controller.ts"),u=U("./src/controller/timeline-controller.ts"),h=U("./src/controller/cap-level-controller.ts"),a=U("./src/controller/fps-controller.ts"),t=U("./src/controller/eme-controller.ts"),i=U("./src/controller/cmcd-controller.ts"),l=U("./src/utils/xhr-loader.ts"),c=U("./src/utils/fetch-loader.ts"),o=U("./src/utils/cues.ts"),e=U("./src/utils/mediakeys-helper.ts"),s=U("./src/utils/logger.ts");function r(){return r=Object.assign||function(n){for(var x=1;x<arguments.length;x++){var S=arguments[x];for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&(n[T]=S[T])}return n},r.apply(this,arguments)}function d(n,x){var S=Object.keys(n);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(n);x&&(T=T.filter(function(R){return Object.getOwnPropertyDescriptor(n,R).enumerable})),S.push.apply(S,T)}return S}function f(n){for(var x=1;x<arguments.length;x++){var S=arguments[x]!=null?arguments[x]:{};x%2?d(Object(S),!0).forEach(function(T){g(n,T,S[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(S)):d(Object(S)).forEach(function(T){Object.defineProperty(n,T,Object.getOwnPropertyDescriptor(S,T))})}return n}function g(n,x,S){return x in n?Object.defineProperty(n,x,{value:S,enumerable:!0,configurable:!0,writable:!0}):n[x]=S,n}var m=f(f({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:l.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:b.default,bufferController:v.default,capLevelController:h.default,fpsController:a.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:e.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},p()),{},{subtitleStreamController:A.SubtitleStreamController,subtitleTrackController:w.default,timelineController:u.TimelineController,audioStreamController:L.default,audioTrackController:E.default,emeController:t.default,cmcdController:i.default});function p(){return{cueHandler:o.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function _(n,x){if((x.liveSyncDurationCount||x.liveMaxLatencyDurationCount)&&(x.liveSyncDuration||x.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(x.liveMaxLatencyDurationCount!==void 0&&(x.liveSyncDurationCount===void 0||x.liveMaxLatencyDurationCount<=x.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(x.liveMaxLatencyDuration!==void 0&&(x.liveSyncDuration===void 0||x.liveMaxLatencyDuration<=x.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return r({},n,x)}function y(n){var x=n.loader;if(x!==c.default&&x!==l.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),n.progressive=!1;else{var S=Object(c.fetchSupported)();S&&(n.loader=c.default,n.progressive=!0,n.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/polyfills/number.ts"),L=U("./src/utils/ewma-bandwidth-estimator.ts"),E=U("./src/events.ts"),A=U("./src/utils/buffer-helper.ts"),w=U("./src/errors.ts"),v=U("./src/types/loader.ts"),u=U("./src/utils/logger.ts");function h(i,l){for(var c=0;c<l.length;c++){var o=l[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(i,o.key,o)}}function a(i,l,c){return l&&h(i.prototype,l),c&&h(i,c),i}var t=function(){function i(c){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=c;var o=c.config;this.bwEstimator=new L.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var l=i.prototype;return l.registerListeners=function(){var o=this.hls;o.on(E.Events.FRAG_LOADING,this.onFragLoading,this),o.on(E.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(E.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(E.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var o=this.hls;o.off(E.Events.FRAG_LOADING,this.onFragLoading,this),o.off(E.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(E.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(E.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},l.onFragLoading=function(o,e){var s=e.frag;if(s.type===v.PlaylistLevelType.MAIN&&!this.timer){var r;this.fragCurrent=s,this.partCurrent=(r=e.part)!=null?r:null,this.timer=self.setInterval(this.onCheck,100)}},l.onLevelLoaded=function(o,e){var s=this.hls.config;e.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},l._abandonRulesCheck=function(){var o=this.fragCurrent,e=this.partCurrent,s=this.hls,r=s.autoLevelEnabled,d=s.config,f=s.media;if(!o||!f)return;var g=e?e.stats:o.stats,m=e?e.duration:o.duration;if(g.aborted){u.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!r||f.paused||!f.playbackRate||!f.readyState)return;var p=performance.now()-g.loading.start,_=Math.abs(f.playbackRate);if(p<=500*m/_)return;var y=s.levels,n=s.minAutoLevel,x=y[o.level],S=g.total||Math.max(g.loaded,Math.round(m*x.maxBitrate/8)),T=Math.max(1,g.bwEstimate?g.bwEstimate/8:g.loaded*1e3/p),R=(S-g.loaded)/T,D=f.currentTime,I=(A.BufferHelper.bufferInfo(f,D,d.maxBufferHole).end-D)/_;if(I>=2*m/_||R<=I)return;var B=Number.POSITIVE_INFINITY,G;for(G=o.level-1;G>n;G--){var k=y[G].maxBitrate;if(B=m*k/(8*.8*T),B<I)break}if(B>=R)return;var $=this.bwEstimator.getEstimate();u.logger.warn("Fragment "+o.sn+(e?" part "+e.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+`
Current BW estimate: `+(Object(b.isFiniteNumber)($)?($/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+R.toFixed(3)+` s
Estimated load time for the next fragment: `+B.toFixed(3)+` s
Time to underbuffer: `+I.toFixed(3)+" s"),s.nextLoadLevel=G,this.bwEstimator.sample(p,g.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),s.trigger(E.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:e,stats:g})},l.onFragLoaded=function(o,e){var s=e.frag,r=e.part;if(s.type===v.PlaylistLevelType.MAIN&&Object(b.isFiniteNumber)(s.sn)){var d=r?r.stats:s.stats,f=r?r.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var g=this.hls.levels[s.level],m=(g.loaded?g.loaded.bytes:0)+d.loaded,p=(g.loaded?g.loaded.duration:0)+f;g.loaded={bytes:m,duration:p},g.realBitrate=Math.round(8*m/p)}if(s.bitrateTest){var _={stats:d,frag:s,part:r,id:s.type};this.onFragBuffered(E.Events.FRAG_BUFFERED,_),s.bitrateTest=!1}}},l.onFragBuffered=function(o,e){var s=e.frag,r=e.part,d=r?r.stats:s.stats;if(d.aborted)return;if(s.type!==v.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var f=d.parsing.end-d.loading.start;this.bwEstimator.sample(f,d.loaded),d.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=f/1e3:this.bitrateTestDelay=0},l.onError=function(o,e){switch(e.details){case w.ErrorDetails.FRAG_LOAD_ERROR:case w.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},l.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},l.getNextABRAutoLevel=function(){var o=this.fragCurrent,e=this.partCurrent,s=this.hls,r=s.maxAutoLevel,d=s.config,f=s.minAutoLevel,g=s.media,m=e?e.duration:o?o.duration:0,p=g?g.currentTime:0,_=g&&g.playbackRate!==0?Math.abs(g.playbackRate):1,y=this.bwEstimator?this.bwEstimator.getEstimate():d.abrEwmaDefaultEstimate,n=(A.BufferHelper.bufferInfo(g,p,d.maxBufferHole).end-p)/_,x=this.findBestLevel(y,f,r,n,d.abrBandWidthFactor,d.abrBandWidthUpFactor);if(x>=0)return x;u.logger.trace((n?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var S=m?Math.min(m,d.maxStarvationDelay):d.maxStarvationDelay,T=d.abrBandWidthFactor,R=d.abrBandWidthUpFactor;if(!n){var D=this.bitrateTestDelay;if(D){var I=m?Math.min(m,d.maxLoadingDelay):d.maxLoadingDelay;S=I-D,u.logger.trace("bitrate test took "+Math.round(1e3*D)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*S)+" ms"),T=R=1}}return x=this.findBestLevel(y,f,r,n+S,T,R),Math.max(x,0)},l.findBestLevel=function(o,e,s,r,d,f){for(var g,m=this.fragCurrent,p=this.partCurrent,_=this.lastLoadedFragLevel,y=this.hls.levels,n=y[_],x=!!(n!=null&&(g=n.details)!==null&&g!==void 0&&g.live),S=n==null?void 0:n.codecSet,T=p?p.duration:m?m.duration:0,R=s;R>=e;R--){var D=y[R];if(!D||S&&D.codecSet!==S)continue;var I=D.details,B=(p?I==null?void 0:I.partTarget:I==null?void 0:I.averagetargetduration)||T,G=void 0;R<=_?G=d*o:G=f*o;var k=y[R].maxBitrate,$=k*B/G;if(u.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+R+"/"+Math.round(G)+"/"+k+"/"+B+"/"+r+"/"+$),G>k&&(!$||x&&!this.bitrateTestDelay||$<r))return R}return-1},a(i,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,e=this.bwEstimator;if(o!==-1&&(!e||!e.canEstimate()))return o;var s=this.getNextABRAutoLevel();return o!==-1&&(s=Math.min(o,s)),s},set:function(o){this._nextAutoLevel=o}}]),i}();Z.default=t},"./src/controller/audio-stream-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/polyfills/number.ts"),L=U("./src/controller/base-stream-controller.ts"),E=U("./src/events.ts"),A=U("./src/utils/buffer-helper.ts"),w=U("./src/controller/fragment-tracker.ts"),v=U("./src/types/level.ts"),u=U("./src/types/loader.ts"),h=U("./src/loader/fragment.ts"),a=U("./src/demux/chunk-cache.ts"),t=U("./src/demux/transmuxer-interface.ts"),i=U("./src/types/transmuxer.ts"),l=U("./src/controller/fragment-finders.ts"),c=U("./src/utils/discontinuities.ts"),o=U("./src/errors.ts"),e=U("./src/utils/logger.ts");function s(){return s=Object.assign||function(m){for(var p=1;p<arguments.length;p++){var _=arguments[p];for(var y in _)Object.prototype.hasOwnProperty.call(_,y)&&(m[y]=_[y])}return m},s.apply(this,arguments)}function r(m,p){m.prototype=Object.create(p.prototype),m.prototype.constructor=m,d(m,p)}function d(m,p){return d=Object.setPrototypeOf||function(y,n){return y.__proto__=n,y},d(m,p)}var f=100,g=function(m){r(p,m);function p(y,n){var x;return x=m.call(this,y,n,"[audio-stream-controller]")||this,x.videoBuffer=null,x.videoTrackCC=-1,x.waitingVideoCC=-1,x.audioSwitch=!1,x.trackId=-1,x.waitingData=null,x.mainDetails=null,x.bufferFlushed=!1,x._registerListeners(),x}var _=p.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var n=this.hls;n.on(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),n.on(E.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),n.on(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),n.on(E.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),n.on(E.Events.ERROR,this.onError,this),n.on(E.Events.BUFFER_RESET,this.onBufferReset,this),n.on(E.Events.BUFFER_CREATED,this.onBufferCreated,this),n.on(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),n.on(E.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.on(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var n=this.hls;n.off(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),n.off(E.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),n.off(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),n.off(E.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),n.off(E.Events.ERROR,this.onError,this),n.off(E.Events.BUFFER_RESET,this.onBufferReset,this),n.off(E.Events.BUFFER_CREATED,this.onBufferCreated,this),n.off(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),n.off(E.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.off(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onInitPtsFound=function(n,x){var S=x.frag,T=x.id,R=x.initPTS;if(T==="main"){var D=S.cc;this.initPTS[S.cc]=R,this.log("InitPTS for cc: "+D+" found from main: "+R),this.videoTrackCC=D,this.state===L.State.WAITING_INIT_PTS&&this.tick()}},_.startLoad=function(n){if(!this.levels){this.startPosition=n,this.state=L.State.STOPPED;return}var x=this.lastCurrentTime;this.stopLoad(),this.setInterval(f),this.fragLoadError=0,x>0&&n===-1?(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),this.state=L.State.IDLE):(this.loadedmetadata=!1,this.state=L.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=n,this.tick()},_.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_TRACK:{var n,x=this.levels,S=this.trackId,T=x==null||((n=x[S])===null||n===void 0)?void 0:n.details;if(T){if(this.waitForCdnTuneIn(T))break;this.state=L.State.WAITING_INIT_PTS}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var R,D=performance.now(),I=this.retryDate;(!I||D>=I||(R=this.media)!==null&&R!==void 0&&R.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=L.State.IDLE);break}case L.State.WAITING_INIT_PTS:{var B=this.waitingData;if(B){var G=B.frag,k=B.part,$=B.cache,X=B.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.FRAG_LOADING;var V=$.flush(),N={frag:G,part:k,payload:V,networkDetails:null};this._handleFragmentLoadProgress(N),X&&m.prototype._handleFragmentLoadComplete.call(this,N)}else if(this.videoTrackCC!==this.waitingVideoCC)e.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var z=this.getLoadPosition(),q=A.BufferHelper.bufferInfo(this.mediaBuffer,z,this.config.maxBufferHole),ee=Object(l.fragmentWithinToleranceTest)(q.end,this.config.maxFragLookUpTolerance,G);ee<0&&(e.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+q.end+" is needed"),this.clearWaitingFragment())}}else this.state=L.State.IDLE}}this.onTickEnd()},_.clearWaitingFragment=function(){var n=this.waitingData;n&&(this.fragmentTracker.removeFragment(n.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.IDLE)},_.onTickEnd=function(){var n=this.media;if(!n||!n.readyState)return;var x=this.mediaBuffer?this.mediaBuffer:n,S=x.buffered;!this.loadedmetadata&&S.length&&(this.loadedmetadata=!0),this.lastCurrentTime=n.currentTime},_.doTickIdle=function(){var n,x,S=this.hls,T=this.levels,R=this.media,D=this.trackId,I=S.config;if(!T||!T[D])return;if(!R&&(this.startFragRequested||!I.startFragPrefetch))return;var B=T[D],G=B.details;if(!G||G.live&&this.levelLastLoaded!==D||this.waitForCdnTuneIn(G)){this.state=L.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,h.ElementaryStreamTypes.AUDIO,u.PlaylistLevelType.AUDIO));var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,u.PlaylistLevelType.AUDIO);if(k===null)return;var $=k.len,X=this.getMaxBufferLength(),V=this.audioSwitch;if($>=X&&!V)return;if(!V&&this._streamEnded(k,G)){S.trigger(E.Events.BUFFER_EOS,{type:"audio"}),this.state=L.State.ENDED;return}var N=G.fragments,z=N[0].start,q=k.end;if(V){var ee=this.getLoadPosition();q=ee,G.PTSKnown&&ee<z&&((k.end>z||k.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),R.currentTime=z+.05))}var fe=this.getNextFragment(q,G);if(!fe){this.bufferFlushed=!0;return}((n=fe.decryptdata)===null||n===void 0?void 0:n.keyFormat)==="identity"&&!((x=fe.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(fe,G):this.loadFragment(fe,G,q)},_.getMaxBufferLength=function(){var n=m.prototype.getMaxBufferLength.call(this),x=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,u.PlaylistLevelType.MAIN);return x===null?n:Math.max(n,x.len)},_.onMediaDetaching=function(){this.videoBuffer=null,m.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(n,x){var S=x.audioTracks;this.resetTransmuxer(),this.levels=S.map(function(T){return new v.Level(T)})},_.onAudioTrackSwitching=function(n,x){var S=!!x.url;this.trackId=x.id;var T=this.fragCurrent;T!=null&&T.loader&&T.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),S?this.setInterval(f):this.resetTransmuxer(),S?(this.audioSwitch=!0,this.state=L.State.IDLE):this.state=L.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(n,x){this.mainDetails=x.details},_.onAudioTrackLoaded=function(n,x){var S,T=this.levels,R=x.details,D=x.id;if(!T){this.warn("Audio tracks were reset while loading level "+D);return}this.log("Track "+D+" loaded ["+R.startSN+","+R.endSN+"],duration:"+R.totalduration);var I=T[D],B=0;if(R.live||(S=I.details)!==null&&S!==void 0&&S.live){var G=this.mainDetails;if(R.fragments[0]||(R.deltaUpdateFailed=!0),R.deltaUpdateFailed||!G)return;!I.details&&R.hasProgramDateTime&&G.hasProgramDateTime?(Object(c.alignMediaPlaylistByPDT)(R,G),B=R.fragments[0].start):B=this.alignPlaylists(R,I.details)}I.details=R,this.levelLastLoaded=D,!this.startFragRequested&&(this.mainDetails||!R.live)&&this.setStartPosition(I.details,B),this.state===L.State.WAITING_TRACK&&!this.waitForCdnTuneIn(R)&&(this.state=L.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(n){var x,S=n.frag,T=n.part,R=n.payload,D=this.config,I=this.trackId,B=this.levels;if(!B){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+S.sn+" of level "+S.level+" will not be buffered");return}var G=B[I];console.assert(G,"Audio track is defined on fragment load progress");var k=G.details;console.assert(k,"Audio track details are defined on fragment load progress");var $=D.defaultAudioCodec||G.audioCodec||"mp4a.40.2",X=this.transmuxer;X||(X=this.transmuxer=new t.default(this.hls,u.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var V=this.initPTS[S.cc],N=(x=S.initSegment)===null||x===void 0?void 0:x.data;if(V!==void 0){var z=!1,q=T?T.index:-1,ee=q!==-1,fe=new i.ChunkMetadata(S.level,S.sn,S.stats.chunkCount,R.byteLength,q,ee);X.push(R,N,$,"",S,T,k.totalduration,z,fe,V)}else{e.logger.log("Unknown video PTS for cc "+S.cc+", waiting for video PTS before demuxing audio frag "+S.sn+" of ["+k.startSN+" ,"+k.endSN+"],track "+I);var ae=this.waitingData=this.waitingData||{frag:S,part:T,cache:new a.default,complete:!1},pe=ae.cache;pe.push(new Uint8Array(R)),this.waitingVideoCC=this.videoTrackCC,this.state=L.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(n){if(this.waitingData){this.waitingData.complete=!0;return}m.prototype._handleFragmentLoadComplete.call(this,n)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(n,x){var S=x.tracks.audio;S&&(this.mediaBuffer=S.buffer),x.tracks.video&&(this.videoBuffer=x.tracks.video.buffer)},_.onFragBuffered=function(n,x){var S=x.frag,T=x.part;if(S.type!==u.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(S)){this.warn("Fragment "+S.sn+(T?" p: "+T.index:"")+" of level "+S.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}S.sn!=="initSegment"&&(this.fragPrevious=S,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(E.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(S,T)},_.onError=function(n,x){switch(x.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(u.PlaylistLevelType.AUDIO,x);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==L.State.ERROR&&this.state!==L.State.STOPPED&&(this.state=x.fatal?L.State.ERROR:L.State.IDLE,this.warn(x.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="audio"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var S=!0,T=this.getFwdBufferInfo(this.mediaBuffer,u.PlaylistLevelType.AUDIO);T&&T.len>.5&&(S=!this.reduceMaxBufferLength(T.len)),S&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,m.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},_.onBufferFlushed=function(n,x){var S=x.type;S===h.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},_._handleTransmuxComplete=function(n){var x,S="audio",T=this.hls,R=n.remuxResult,D=n.chunkMeta,I=this.getCurrentContext(D);if(!I){this.warn("The loading context changed while buffering fragment "+D.sn+" of level "+D.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(D.level);return}var B=I.frag,G=I.part,k=R.audio,$=R.text,X=R.id3,V=R.initSegment;if(this.fragContextChanged(B))return;if(this.state=L.State.PARSING,this.audioSwitch&&k&&this.completeAudioSwitch(),V!=null&&V.tracks&&(this._bufferInitSegment(V.tracks,B,D),T.trigger(E.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:S,tracks:V.tracks})),k){var N=k.startPTS,z=k.endPTS,q=k.startDTS,ee=k.endDTS;G&&(G.elementaryStreams[h.ElementaryStreamTypes.AUDIO]={startPTS:N,endPTS:z,startDTS:q,endDTS:ee}),B.setElementaryStreamInfo(h.ElementaryStreamTypes.AUDIO,N,z,q,ee),this.bufferFragmentData(k,B,G,D)}if(X!=null&&(x=X.samples)!==null&&x!==void 0&&x.length){var fe=s({frag:B,id:S},X);T.trigger(E.Events.FRAG_PARSING_METADATA,fe)}if($){var ae=s({frag:B,id:S},$);T.trigger(E.Events.FRAG_PARSING_USERDATA,ae)}},_._bufferInitSegment=function(n,x,S){if(this.state!==L.State.PARSING)return;n.video&&delete n.video;var T=n.audio;if(!T)return;T.levelCodec=T.codec,T.id="audio",this.log("Init audio buffer, container:"+T.container+", codecs[parsed]=["+T.codec+"]"),this.hls.trigger(E.Events.BUFFER_CODECS,n);var R=T.initSegment;if(R!=null&&R.byteLength){var D={type:"audio",frag:x,part:null,chunkMeta:S,parent:x.type,data:R};this.hls.trigger(E.Events.BUFFER_APPENDING,D)}this.tick()},_.loadFragment=function(n,x,S){var T=this.fragmentTracker.getState(n);this.fragCurrent=n,(this.audioSwitch||T===w.FragmentState.NOT_LOADED||T===w.FragmentState.PARTIAL)&&(n.sn==="initSegment"?this._loadInitSegment(n):x.live&&!Object(b.isFiniteNumber)(this.initPTS[n.cc])?(this.log("Waiting for video PTS in continuity counter "+n.cc+" of live stream before loading audio fragment "+n.sn+" of level "+this.trackId),this.state=L.State.WAITING_INIT_PTS):(this.startFragRequested=!0,m.prototype.loadFragment.call(this,n,x,S)))},_.completeAudioSwitch=function(){var n=this.hls,x=this.media,S=this.trackId;x&&(this.log("Switching audio track : flushing all audio"),m.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,n.trigger(E.Events.AUDIO_TRACK_SWITCHED,{id:S})},p}(L.default);Z.default=g},"./src/controller/audio-track-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/events.ts"),L=U("./src/errors.ts"),E=U("./src/controller/base-playlist-controller.ts"),A=U("./src/types/loader.ts");function w(t,i){for(var l=0;l<i.length;l++){var c=i[l];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function v(t,i,l){return i&&w(t.prototype,i),l&&w(t,l),t}function u(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t,h(t,i)}function h(t,i){return h=Object.setPrototypeOf||function(c,o){return c.__proto__=o,c},h(t,i)}var a=function(t){u(i,t);function i(c){var o;return o=t.call(this,c,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var l=i.prototype;return l.registerListeners=function(){var o=this.hls;o.on(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(b.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(b.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(b.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(b.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(b.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var o=this.hls;o.off(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(b.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(b.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(b.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(b.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(b.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,t.prototype.destroy.call(this)},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},l.onManifestParsed=function(o,e){this.tracks=e.audioTracks||[]},l.onAudioTrackLoaded=function(o,e){var s=e.id,r=e.details,d=this.tracksInGroup[s];if(!d){this.warn("Invalid audio track id "+s);return}var f=d.details;d.details=e.details,this.log("audioTrack "+s+" loaded ["+r.startSN+"-"+r.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,e,f))},l.onLevelLoading=function(o,e){this.switchLevel(e.level)},l.onLevelSwitching=function(o,e){this.switchLevel(e.level)},l.switchLevel=function(o){var e=this.hls.levels[o];if(!(e!=null&&e.audioGroupIds))return;var s=e.audioGroupIds[e.urlId];if(this.groupId!==s){this.groupId=s;var r=this.tracks.filter(function(f){return!s||f.groupId===s});this.selectDefaultTrack&&!r.some(function(f){return f.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=r;var d={audioTracks:r};this.log("Updating audio tracks, "+r.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(b.Events.AUDIO_TRACKS_UPDATED,d),this.selectInitialTrack()}},l.onError=function(o,e){if(t.prototype.onError.call(this,o,e),e.fatal||!e.context)return;e.context.type===A.PlaylistContextType.AUDIO_TRACK&&e.context.id===this.trackId&&e.context.groupId===this.groupId&&this.retryLoadingOrFail(e)},l.setAudioTrack=function(o){var e=this.tracksInGroup;if(o<0||o>=e.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=e[this.trackId];this.log("Now switching to audio-track index "+o);var r=e[o],d=r.id,f=r.groupId,g=f===void 0?"":f,m=r.name,p=r.type,_=r.url;if(this.trackId=o,this.trackName=m,this.selectDefaultTrack=!1,this.hls.trigger(b.Events.AUDIO_TRACK_SWITCHING,{id:d,groupId:g,name:m,type:p,url:_}),r.details&&!r.details.live)return;var y=this.switchParams(r.url,s==null?void 0:s.details);this.loadPlaylist(y)},l.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var e=this.trackName,s=this.findTrackId(e)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(b.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},l.findTrackId=function(o){for(var e=this.tracksInGroup,s=0;s<e.length;s++){var r=e[s];if((!this.selectDefaultTrack||r.default)&&(!o||o===r.name))return r.id}return-1},l.loadPlaylist=function(o){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var s=e.id,r=e.groupId,d=e.url;if(o)try{d=o.addDirectives(d)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(b.Events.AUDIO_TRACK_LOADING,{url:d,id:s,groupId:r,deliveryDirectives:o||null})}},v(i,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),i}(E.default);Z.default=a},"./src/controller/base-playlist-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return v});var b=U("./src/polyfills/number.ts"),L=U("./src/types/level.ts"),E=U("./src/controller/level-helper.ts"),A=U("./src/utils/logger.ts"),w=U("./src/errors.ts"),v=function(){function u(a,t){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=A.logger.log.bind(A.logger,t+":"),this.warn=A.logger.warn.bind(A.logger,t+":"),this.hls=a}var h=u.prototype;return h.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},h.onError=function(t,i){i.fatal&&i.type===w.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},h.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},h.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},h.stopLoad=function(){this.canLoad=!1,this.clearTimer()},h.switchParams=function(t,i){var l=i==null?void 0:i.renditionReports;if(l)for(var c=0;c<l.length;c++){var o=l[c],e=""+o.URI;if(e===t.substr(-e.length)){var s=parseInt(o["LAST-MSN"]),r=parseInt(o["LAST-PART"]);if(i&&this.hls.config.lowLatencyMode){var d=Math.min(i.age-i.partTarget,i.targetduration);r!==void 0&&d>i.partTarget&&(r+=1)}if(Object(b.isFiniteNumber)(s))return new L.HlsUrlParameters(s,Object(b.isFiniteNumber)(r)?r:void 0,L.HlsSkip.No)}}},h.loadPlaylist=function(t){},h.shouldLoadTrack=function(t){return this.canLoad&&t&&!!t.url&&(!t.details||t.details.live)},h.playlistLoaded=function(t,i,l){var c=this,o=i.details,e=i.stats,s=e.loading.end?Math.max(0,self.performance.now()-e.loading.end):0;if(o.advancedDateTime=Date.now()-s,o.live||l!=null&&l.live){if(o.reloaded(l),l&&this.log("live playlist "+t+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),l&&o.fragments.length>0&&Object(E.mergeDetails)(l,o),!this.canLoad||!o.live)return;var r,d=void 0,f=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var g=this.hls.config.lowLatencyMode,m=o.lastPartSn,p=o.endSN,_=o.lastPartIndex,y=_!==-1,n=m===p,x=g?0:_;y?(d=n?p+1:m,f=n?x:_+1):d=p+1;var S=o.age,T=S+o.ageHeader,R=Math.min(T-o.partTarget,o.targetduration*1.5);if(R>0){if(l&&R>l.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+l.tuneInGoal+" to: "+R+" with playlist age: "+o.age),R=0;else{var D=Math.floor(R/o.targetduration);if(d+=D,f!==void 0){var I=Math.round(R%o.targetduration/o.partTarget);f+=I}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+S.toFixed(2)+"s goal: "+R+" skip sn "+D+" to part "+f)}o.tuneInGoal=R}if(r=this.getDeliveryDirectives(o,i.deliveryDirectives,d,f),g||!n){this.loadPlaylist(r);return}}else r=this.getDeliveryDirectives(o,i.deliveryDirectives,d,f);var B=Object(E.computeReloadInterval)(o,e);d!==void 0&&o.canBlockReload&&(B-=o.partTarget||1),this.log("reload live playlist "+t+" in "+Math.round(B)+" ms"),this.timer=self.setTimeout(function(){return c.loadPlaylist(r)},B)}else this.clearTimer()},h.getDeliveryDirectives=function(t,i,l,c){var o=Object(L.getSkipValue)(t,l);return i!=null&&i.skip&&t.deltaUpdateFailed&&(l=i.msn,c=i.part,o=L.HlsSkip.No),new L.HlsUrlParameters(l,c,o)},h.retryLoadingOrFail=function(t){var i=this,l=this.hls.config,c=this.retryCount<l.levelLoadingMaxRetry;if(c){var o;if(this.retryCount++,t.details.indexOf("LoadTimeOut")>-1&&(o=t.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+t.details+'"'),this.loadPlaylist();else{var e=Math.min(Math.pow(2,this.retryCount)*l.levelLoadingRetryDelay,l.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return i.loadPlaylist()},e),this.warn("retry playlist loading #"+this.retryCount+" in "+e+' ms after "'+t.details+'"')}}else this.warn('cannot recover from error "'+t.details+'"'),this.clearTimer(),t.fatal=!0;return c},u}()},"./src/controller/base-stream-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"State",function(){return p}),U.d(Z,"default",function(){return _});var b=U("./src/polyfills/number.ts"),L=U("./src/task-loop.ts"),E=U("./src/controller/fragment-tracker.ts"),A=U("./src/utils/buffer-helper.ts"),w=U("./src/utils/logger.ts"),v=U("./src/events.ts"),u=U("./src/errors.ts"),h=U("./src/types/transmuxer.ts"),a=U("./src/utils/mp4-tools.ts"),t=U("./src/utils/discontinuities.ts"),i=U("./src/controller/fragment-finders.ts"),l=U("./src/controller/level-helper.ts"),c=U("./src/loader/fragment-loader.ts"),o=U("./src/crypt/decrypter.ts"),e=U("./src/utils/time-ranges.ts"),s=U("./src/types/loader.ts");function r(y,n){for(var x=0;x<n.length;x++){var S=n[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(y,S.key,S)}}function d(y,n,x){return n&&r(y.prototype,n),x&&r(y,x),y}function f(y){if(y===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y}function g(y,n){y.prototype=Object.create(n.prototype),y.prototype.constructor=y,m(y,n)}function m(y,n){return m=Object.setPrototypeOf||function(S,T){return S.__proto__=T,S},m(y,n)}var p={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},_=function(y){g(n,y);function n(S,T,R){var D;return D=y.call(this)||this,D.hls=void 0,D.fragPrevious=null,D.fragCurrent=null,D.fragmentTracker=void 0,D.transmuxer=null,D._state=p.STOPPED,D.media=void 0,D.mediaBuffer=void 0,D.config=void 0,D.bitrateTest=!1,D.lastCurrentTime=0,D.nextLoadPosition=0,D.startPosition=0,D.loadedmetadata=!1,D.fragLoadError=0,D.retryDate=0,D.levels=null,D.fragmentLoader=void 0,D.levelLastLoaded=null,D.startFragRequested=!1,D.decrypter=void 0,D.initPTS=[],D.onvseeking=null,D.onvended=null,D.logPrefix="",D.log=void 0,D.warn=void 0,D.logPrefix=R,D.log=w.logger.log.bind(w.logger,R+":"),D.warn=w.logger.warn.bind(w.logger,R+":"),D.hls=S,D.fragmentLoader=new c.default(S.config),D.fragmentTracker=T,D.config=S.config,D.decrypter=new o.default(S,S.config),S.on(v.Events.KEY_LOADED,D.onKeyLoaded,f(D)),D}var x=n.prototype;return x.doTick=function(){this.onTickEnd()},x.onTickEnd=function(){},x.startLoad=function(T){},x.stopLoad=function(){this.fragmentLoader.abort();var T=this.fragCurrent;T&&this.fragmentTracker.removeFragment(T),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=p.STOPPED},x._streamEnded=function(T,R){var D=this.fragCurrent,I=this.fragmentTracker;if(!R.live&&D&&D.sn===R.endSN&&!T.nextStart){var B=I.getState(D);return B===E.FragmentState.PARTIAL||B===E.FragmentState.OK}return!1},x.onMediaAttached=function(T,R){var D=this.media=this.mediaBuffer=R.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),D.addEventListener("seeking",this.onvseeking),D.addEventListener("ended",this.onvended);var I=this.config;this.levels&&I.autoStartLoad&&this.state===p.STOPPED&&this.startLoad(I.startPosition)},x.onMediaDetaching=function(){var T=this.media;T!=null&&T.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),T&&(T.removeEventListener("seeking",this.onvseeking),T.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},x.onMediaSeeking=function(){var T=this.config,R=this.fragCurrent,D=this.media,I=this.mediaBuffer,B=this.state,G=D?D.currentTime:0,k=A.BufferHelper.bufferInfo(I||D,G,T.maxBufferHole);if(this.log("media seeking to "+(Object(b.isFiniteNumber)(G)?G.toFixed(3):G)+", state: "+B),B===p.ENDED)this.resetLoadingState();else if(R&&!k.len){var $=T.maxFragLookUpTolerance,X=R.start-$,V=R.start+R.duration+$,N=G>V;(G<X||N)&&(N&&R.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),R.loader.abort()),this.resetLoadingState())}D&&(this.lastCurrentTime=G),!this.loadedmetadata&&!k.len&&(this.nextLoadPosition=this.startPosition=G),this.tickImmediate()},x.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},x.onKeyLoaded=function(T,R){if(this.state!==p.KEY_LOADING||R.frag!==this.fragCurrent||!this.levels)return;this.state=p.IDLE;var D=this.levels[R.frag.level].details;D&&this.loadFragment(R.frag,D,R.frag.start)},x.onHandlerDestroying=function(){this.stopLoad(),y.prototype.onHandlerDestroying.call(this)},x.onHandlerDestroyed=function(){this.state=p.STOPPED,this.hls.off(v.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,y.prototype.onHandlerDestroyed.call(this)},x.loadKey=function(T,R){this.log("Loading key for "+T.sn+" of ["+R.startSN+"-"+R.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+T.level),this.state=p.KEY_LOADING,this.fragCurrent=T,this.hls.trigger(v.Events.KEY_LOADING,{frag:T})},x.loadFragment=function(T,R,D){this._loadFragForPlayback(T,R,D)},x._loadFragForPlayback=function(T,R,D){var I=this,B=function(k){if(I.fragContextChanged(T)){I.warn("Fragment "+T.sn+(k.part?" p: "+k.part.index:"")+" of level "+T.level+" was dropped during download."),I.fragmentTracker.removeFragment(T);return}T.stats.chunkCount++,I._handleFragmentLoadProgress(k)};this._doFragLoad(T,R,D,B).then(function(G){if(!G)return;I.fragLoadError=0;var k=I.state;if(I.fragContextChanged(T)){(k===p.FRAG_LOADING||k===p.BACKTRACKING||!I.fragCurrent&&k===p.PARSING)&&(I.fragmentTracker.removeFragment(T),I.state=p.IDLE);return}if("payload"in G&&(I.log("Loaded fragment "+T.sn+" of level "+T.level),I.hls.trigger(v.Events.FRAG_LOADED,G),I.state===p.BACKTRACKING)){I.fragmentTracker.backtrack(T,G),I.resetFragmentLoading(T);return}I._handleFragmentLoadComplete(G)}).catch(function(G){I.warn(G),I.resetFragmentLoading(T)})},x.flushMainBuffer=function(T,R,D){if(D===void 0&&(D=null),!(T-R))return;var I={startOffset:T,endOffset:R,type:D};this.fragLoadError=0,this.hls.trigger(v.Events.BUFFER_FLUSHING,I)},x._loadInitSegment=function(T){var R=this;this._doFragLoad(T).then(function(D){if(!D||R.fragContextChanged(T)||!R.levels)throw new Error("init load aborted");return D}).then(function(D){var I=R.hls,B=D.payload,G=T.decryptdata;if(B&&B.byteLength>0&&G&&G.key&&G.iv&&G.method==="AES-128"){var k=self.performance.now();return R.decrypter.webCryptoDecrypt(new Uint8Array(B),G.key.buffer,G.iv.buffer).then(function($){var X=self.performance.now();return I.trigger(v.Events.FRAG_DECRYPTED,{frag:T,payload:$,stats:{tstart:k,tdecrypt:X}}),D.payload=$,D})}return D}).then(function(D){var I=R.fragCurrent,B=R.hls,G=R.levels;if(!G)throw new Error("init load aborted, missing levels");var k=G[T.level].details;console.assert(k,"Level details are defined when init segment is loaded");var $=T.stats;R.state=p.IDLE,R.fragLoadError=0,T.data=new Uint8Array(D.payload),$.parsing.start=$.buffering.start=self.performance.now(),$.parsing.end=$.buffering.end=self.performance.now(),D.frag===I&&B.trigger(v.Events.FRAG_BUFFERED,{stats:$,frag:I,part:null,id:T.type}),R.tick()}).catch(function(D){R.warn(D),R.resetFragmentLoading(T)})},x.fragContextChanged=function(T){var R=this.fragCurrent;return!T||!R||T.level!==R.level||T.sn!==R.sn||T.urlId!==R.urlId},x.fragBufferedComplete=function(T,R){var D=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+T.type+" sn: "+T.sn+(R?" part: "+R.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+T.level+" "+e.default.toString(A.BufferHelper.getBuffered(D))),this.state=p.IDLE,this.tick()},x._handleFragmentLoadComplete=function(T){var R=this.transmuxer;if(!R)return;var D=T.frag,I=T.part,B=T.partsLoaded,G=!B||B.length===0||B.some(function($){return!$}),k=new h.ChunkMetadata(D.level,D.sn,D.stats.chunkCount+1,0,I?I.index:-1,!G);R.flush(k)},x._handleFragmentLoadProgress=function(T){},x._doFragLoad=function(T,R,D,I){var B=this;if(D===void 0&&(D=null),!this.levels)throw new Error("frag load aborted, missing levels");if(D=Math.max(T.start,D||0),this.config.lowLatencyMode&&R){var G=R.partList;if(G&&I){D>T.end&&R.fragmentHint&&(T=R.fragmentHint);var k=this.getNextPart(G,T,D);if(k>-1){var $=G[k];return this.log("Loading part sn: "+T.sn+" p: "+$.index+" cc: "+T.cc+" of playlist ["+R.startSN+"-"+R.endSN+"] parts [0-"+k+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+T.level+", target: "+parseFloat(D.toFixed(3))),this.nextLoadPosition=$.start+$.duration,this.state=p.FRAG_LOADING,this.hls.trigger(v.Events.FRAG_LOADING,{frag:T,part:G[k],targetBufferTime:D}),this.doFragPartsLoad(T,G,k,I).catch(function(X){return B.handleFragLoadError(X)})}else if(!T.url||this.loadedEndOfParts(G,D))return Promise.resolve(null)}}return this.log("Loading fragment "+T.sn+" cc: "+T.cc+" "+(R?"of ["+R.startSN+"-"+R.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+T.level+", target: "+parseFloat(D.toFixed(3))),Object(b.isFiniteNumber)(T.sn)&&!this.bitrateTest&&(this.nextLoadPosition=T.start+T.duration),this.state=p.FRAG_LOADING,this.hls.trigger(v.Events.FRAG_LOADING,{frag:T,targetBufferTime:D}),this.fragmentLoader.load(T,I).catch(function(X){return B.handleFragLoadError(X)})},x.doFragPartsLoad=function(T,R,D,I){var B=this;return new Promise(function(G,k){var $=[],X=function V(N){var z=R[N];B.fragmentLoader.loadPart(T,z,I).then(function(q){$[z.index]=q;var ee=q.part;B.hls.trigger(v.Events.FRAG_LOADED,q);var fe=R[N+1];if(fe&&fe.fragment===T)V(N+1);else return G({frag:T,part:ee,partsLoaded:$})}).catch(k)};X(D)})},x.handleFragLoadError=function(T){var R=T.data;return R&&R.details===u.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(R.frag,R.part):this.hls.trigger(v.Events.ERROR,R),null},x._handleTransmuxerFlush=function(T){var R=this.getCurrentContext(T);if(!R||this.state!==p.PARSING){this.fragCurrent||(this.state=p.IDLE);return}var D=R.frag,I=R.part,B=R.level,G=self.performance.now();D.stats.parsing.end=G,I&&(I.stats.parsing.end=G),this.updateLevelTiming(D,I,B,T.partial)},x.getCurrentContext=function(T){var R=this.levels,D=T.level,I=T.sn,B=T.part;if(!R||!R[D])return this.warn("Levels object was unset while buffering fragment "+I+" of level "+D+". The current chunk will not be buffered."),null;var G=R[D],k=B>-1?Object(l.getPartWith)(G,I,B):null,$=k?k.fragment:Object(l.getFragmentWithSN)(G,I,this.fragCurrent);return $?{frag:$,part:k,level:G}:null},x.bufferFragmentData=function(T,R,D,I){if(!T||this.state!==p.PARSING)return;var B=T.data1,G=T.data2,k=B;if(B&&G&&(k=Object(a.appendUint8Array)(B,G)),!k||!k.length)return;var $={type:T.type,frag:R,part:D,chunkMeta:I,parent:R.type,data:k};this.hls.trigger(v.Events.BUFFER_APPENDING,$),T.dropped&&T.independent&&!D&&this.flushBufferGap(R)},x.flushBufferGap=function(T){var R=this.media;if(!R)return;if(!A.BufferHelper.isBuffered(R,R.currentTime)){this.flushMainBuffer(0,T.start);return}var D=R.currentTime,I=A.BufferHelper.bufferInfo(R,D,0),B=T.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,B*.25),k=Math.max(Math.min(T.start-G,I.end-G),D+G);T.start-k>G&&this.flushMainBuffer(k,T.start)},x.getFwdBufferInfo=function(T,R){var D=this.config,I=this.getLoadPosition();if(!Object(b.isFiniteNumber)(I))return null;var B=A.BufferHelper.bufferInfo(T,I,D.maxBufferHole);if(B.len===0&&B.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(I,R);if(G&&B.nextStart<G.end)return A.BufferHelper.bufferInfo(T,I,Math.max(B.nextStart,D.maxBufferHole))}return B},x.getMaxBufferLength=function(T){var R=this.config,D;return T?D=Math.max(8*R.maxBufferSize/T,R.maxBufferLength):D=R.maxBufferLength,Math.min(D,R.maxMaxBufferLength)},x.reduceMaxBufferLength=function(T){var R=this.config,D=T||R.maxBufferLength;return R.maxMaxBufferLength>=D?(R.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+R.maxMaxBufferLength+"s"),!0):!1},x.getNextFragment=function(T,R){var D,I,B=R.fragments,G=B.length;if(!G)return null;var k=this.config,$=B[0].start,X;if(R.live){var V=k.initialLiveManifestSize;if(G<V)return this.warn("Not enough fragments to start playback (have: "+G+", need: "+V+")"),null;!R.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(X=this.getInitialLiveFragment(R,B),this.startPosition=X?this.hls.liveSyncPosition||X.start:T)}else T<=$&&(X=B[0]);if(!X){var N=k.lowLatencyMode?R.partEnd:R.fragmentEnd;X=this.getFragmentAtPosition(T,N,R)}return(D=X)!==null&&D!==void 0&&D.initSegment&&!((I=X)!==null&&I!==void 0&&I.initSegment.data)&&!this.bitrateTest&&(X=X.initSegment),X},x.getNextPart=function(T,R,D){for(var I=-1,B=!1,G=!0,k=0,$=T.length;k<$;k++){var X=T[k];if(G=G&&!X.independent,I>-1&&D<X.start)break;var V=X.loaded;!V&&(B||X.independent||G)&&X.fragment===R&&(I=k),B=V}return I},x.loadedEndOfParts=function(T,R){var D=T[T.length-1];return D&&R>D.start&&D.loaded},x.getInitialLiveFragment=function(T,R){var D=this.fragPrevious,I=null;if(D){if(T.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+D.programDateTime),I=Object(i.findFragmentByPDT)(R,D.endProgramDateTime,this.config.maxFragLookUpTolerance)),!I){var B=D.sn+1;if(B>=T.startSN&&B<=T.endSN){var G=R[B-T.startSN];D.cc===G.cc&&(I=G,this.log("Live playlist, switching playlist, load frag with next SN: "+I.sn))}I||(I=Object(i.findFragWithCC)(R,D.cc),I&&this.log("Live playlist, switching playlist, load frag with same CC: "+I.sn))}}else{var k=this.hls.liveSyncPosition;k!==null&&(I=this.getFragmentAtPosition(k,this.bitrateTest?T.fragmentEnd:T.edge,T))}return I},x.getFragmentAtPosition=function(T,R,D){var I=this.config,B=this.fragPrevious,G=D.fragments,k=D.endSN,$=D.fragmentHint,X=I.maxFragLookUpTolerance,V=!!(I.lowLatencyMode&&D.partList&&$);V&&$&&!this.bitrateTest&&(G=G.concat($),k=$.sn);var N;if(T<R){var z=T>R-X?0:X;N=Object(i.findFragmentByPTS)(B,G,T,z)}else N=G[G.length-1];if(N){var q=N.sn-D.startSN,ee=B&&N.level===B.level,fe=G[q+1],ae=this.fragmentTracker.getState(N);if(ae===E.FragmentState.BACKTRACKED){N=null;for(var pe=q;G[pe]&&this.fragmentTracker.getState(G[pe])===E.FragmentState.BACKTRACKED;)B?N=G[pe--]:N=G[--pe];N||(N=fe)}else B&&N.sn===B.sn&&!V&&(ee&&(N.sn<k&&this.fragmentTracker.getState(fe)!==E.FragmentState.OK?(this.log("SN "+N.sn+" just loaded, load next one: "+fe.sn),N=fe):N=null))}return N},x.synchronizeToLiveEdge=function(T){var R=this.config,D=this.media;if(!D)return;var I=this.hls.liveSyncPosition,B=D.currentTime,G=T.fragments[0].start,k=T.edge,$=B>=G-R.maxFragLookUpTolerance&&B<=k;if(I!==null&&D.duration>I&&(B<I||!$)){var X=R.liveMaxLatencyDuration!==void 0?R.liveMaxLatencyDuration:R.liveMaxLatencyDurationCount*T.targetduration;(!$&&D.readyState<4||B<k-X)&&(this.loadedmetadata||(this.nextLoadPosition=I),D.readyState&&(this.warn("Playback: "+B.toFixed(3)+" is located too far from the end of live sliding playlist: "+k+", reset currentTime to : "+I.toFixed(3)),D.currentTime=I))}},x.alignPlaylists=function(T,R){var D=this.levels,I=this.levelLastLoaded,B=this.fragPrevious,G=I!==null?D[I]:null,k=T.fragments.length;if(!k)return this.warn("No fragments in live playlist"),0;var $=T.fragments[0].start,X=!R,V=T.alignedSliding&&Object(b.isFiniteNumber)($);if(X||!V&&!$){Object(t.alignStream)(B,G,T);var N=T.fragments[0].start;return this.log("Live playlist sliding: "+N.toFixed(2)+" start-sn: "+(R?R.startSN:"na")+"->"+T.startSN+" prev-sn: "+(B?B.sn:"na")+" fragments: "+k),N}return $},x.waitForCdnTuneIn=function(T){var R=3;return T.live&&T.canBlockReload&&T.tuneInGoal>Math.max(T.partHoldBack,T.partTarget*R)},x.setStartPosition=function(T,R){var D=this.startPosition;if(D<R&&(D=-1),D===-1||this.lastCurrentTime===-1){var I=T.startTimeOffset;Object(b.isFiniteNumber)(I)?(D=R+I,I<0&&(D+=T.totalduration),D=Math.min(Math.max(R,D),R+T.totalduration),this.log("Start time offset "+I+" found in playlist, adjust startPosition to "+D),this.startPosition=D):T.live?D=this.hls.liveSyncPosition||R:this.startPosition=D=0,this.lastCurrentTime=D}this.nextLoadPosition=D},x.getLoadPosition=function(){var T=this.media,R=0;return this.loadedmetadata&&T?R=T.currentTime:this.nextLoadPosition&&(R=this.nextLoadPosition),R},x.handleFragLoadAborted=function(T,R){this.transmuxer&&T.sn!=="initSegment"&&T.stats.aborted&&(this.warn("Fragment "+T.sn+(R?" part"+R.index:"")+" of level "+T.level+" was aborted"),this.resetFragmentLoading(T))},x.resetFragmentLoading=function(T){(!this.fragCurrent||!this.fragContextChanged(T))&&(this.state=p.IDLE)},x.onFragmentOrKeyLoadError=function(T,R){if(R.fatal)return;var D=R.frag;if(!D||D.type!==T)return;var I=this.fragCurrent;console.assert(I&&D.sn===I.sn&&D.level===I.level&&D.urlId===I.urlId,"Frag load error must match current frag to retry");var B=this.config;if(this.fragLoadError+1<=B.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(D.level))return;var G=Math.min(Math.pow(2,this.fragLoadError)*B.fragLoadingRetryDelay,B.fragLoadingMaxRetryTimeout);this.warn("Fragment "+D.sn+" of "+T+" "+D.level+" failed to load, retrying in "+G+"ms"),this.retryDate=self.performance.now()+G,this.fragLoadError++,this.state=p.FRAG_LOADING_WAITING_RETRY}else R.levelRetry?(T===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=p.IDLE):(w.logger.error(R.details+" reaches max retry, redispatch as fatal ..."),R.fatal=!0,this.hls.stopLoad(),this.state=p.ERROR)},x.afterBufferFlushed=function(T,R,D){if(!T)return;var I=A.BufferHelper.getBuffered(T);this.fragmentTracker.detectEvictedFragments(R,I,D),this.state===p.ENDED&&this.resetLoadingState()},x.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=p.IDLE},x.resetLiveStartWhenNotLoaded=function(T){if(!this.loadedmetadata){this.startFragRequested=!1;var R=this.levels?this.levels[T].details:null;if(R!=null&&R.live)return this.startPosition=-1,this.setStartPosition(R,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},x.updateLevelTiming=function(T,R,D,I){var B=this,G=D.details;console.assert(!!G,"level.details must be defined");var k=Object.keys(T.elementaryStreams).reduce(function($,X){var V=T.elementaryStreams[X];if(V){var N=V.endPTS-V.startPTS;if(N<=0)return B.warn("Could not parse fragment "+T.sn+" "+X+" duration reliably ("+N+") resetting transmuxer to fallback to playlist timing"),B.resetTransmuxer(),$||!1;var z=I?0:Object(l.updateFragPTSDTS)(G,T,V.startPTS,V.endPTS,V.startDTS,V.endDTS);return B.hls.trigger(v.Events.LEVEL_PTS_UPDATED,{details:G,level:D,drift:z,type:X,frag:T,start:V.startPTS,end:V.endPTS}),!0}return $},!1);k?(this.state=p.PARSED,this.hls.trigger(v.Events.FRAG_PARSED,{frag:T,part:R})):this.resetLoadingState()},x.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},d(n,[{key:"state",get:function(){return this._state},set:function(T){var R=this._state;R!==T&&(this._state=T,this.log(R+"->"+T))}}]),n}(L.default)},"./src/controller/buffer-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return i});var b=U("./src/polyfills/number.ts"),L=U("./src/events.ts"),E=U("./src/utils/logger.ts"),A=U("./src/errors.ts"),w=U("./src/utils/buffer-helper.ts"),v=U("./src/utils/mediasource-helper.ts"),u=U("./src/loader/fragment.ts"),h=U("./src/controller/buffer-operation-queue.ts"),a=Object(v.getMediaSource)(),t=/([ha]vc.)(?:\.[^.,]+)+/,i=function(){function l(o){var e=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var s=e.hls,r=e.media,d=e.mediaSource;E.logger.log("[buffer-controller]: Media source opened"),r&&(e.updateMediaElementDuration(),s.trigger(L.Events.MEDIA_ATTACHED,{media:r})),d&&d.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){E.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){E.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var c=l.prototype;return c.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},c.destroy=function(){this.unregisterListeners(),this.details=null},c.registerListeners=function(){var e=this.hls;e.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(L.Events.BUFFER_RESET,this.onBufferReset,this),e.on(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.on(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(L.Events.BUFFER_EOS,this.onBufferEos,this),e.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(L.Events.FRAG_PARSED,this.onFragParsed,this),e.on(L.Events.FRAG_CHANGED,this.onFragChanged,this)},c.unregisterListeners=function(){var e=this.hls;e.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(L.Events.BUFFER_RESET,this.onBufferReset,this),e.off(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.off(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(L.Events.BUFFER_EOS,this.onBufferEos,this),e.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(L.Events.FRAG_PARSED,this.onFragParsed,this),e.off(L.Events.FRAG_CHANGED,this.onFragChanged,this)},c._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new h.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},c.onManifestParsed=function(e,s){var r=2;(s.audio&&!s.video||!s.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,this.details=null,E.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},c.onMediaAttaching=function(e,s){var r=this.media=s.media;if(r&&a){var d=this.mediaSource=new a;d.addEventListener("sourceopen",this._onMediaSourceOpen),d.addEventListener("sourceended",this._onMediaSourceEnded),d.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(d),this._objectUrl=r.src}},c.onMediaDetaching=function(){var e=this.media,s=this.mediaSource,r=this._objectUrl;if(s){if(E.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(d){E.logger.warn("[buffer-controller]: onMediaDetaching: "+d.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(r&&self.URL.revokeObjectURL(r),e.src===r?(e.removeAttribute("src"),e.load()):E.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(L.Events.MEDIA_DETACHED,void 0)},c.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach(function(s){var r=e.sourceBuffer[s];try{r&&(e.removeBufferListeners(s),e.mediaSource&&e.mediaSource.removeSourceBuffer(r),e.sourceBuffer[s]=void 0)}catch(d){E.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",d)}}),this._initSourceBuffer()},c.onBufferCodecs=function(e,s){var r=this,d=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(f){if(d){var g=r.tracks[f];if(g&&typeof g.buffer.changeType=="function"){var m=s[f],p=m.codec,_=m.levelCodec,y=m.container,n=(g.levelCodec||g.codec).replace(t,"$1"),x=(_||p).replace(t,"$1");if(n!==x){var S=y+";codecs="+(_||p);r.appendChangeType(f,S)}}}else r.pendingTracks[f]=s[f]}),d)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},c.appendChangeType=function(e,s){var r=this,d=this.operationQueue,f={execute:function(){var m=r.sourceBuffer[e];m&&(E.logger.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+s),m.changeType(s)),d.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(m){E.logger.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",m)}};d.append(f,e)},c.onBufferAppending=function(e,s){var r=this,d=this.hls,f=this.operationQueue,g=this.tracks,m=s.data,p=s.type,_=s.frag,y=s.part,n=s.chunkMeta,x=n.buffering[p],S=self.performance.now();x.start=S;var T=_.stats.buffering,R=y?y.stats.buffering:null;T.start===0&&(T.start=S),R&&R.start===0&&(R.start=S);var D=g.audio,I=p==="audio"&&n.id===1&&(D==null?void 0:D.container)==="audio/mpeg",B={execute:function(){if(x.executeStart=self.performance.now(),I){var k=r.sourceBuffer[p];if(k){var $=_.start-k.timestampOffset;Math.abs($)>=.1&&(E.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_.start+" (delta: "+$+") sn: "+_.sn+")"),k.timestampOffset=_.start)}}r.appendExecutor(m,p)},onStart:function(){},onComplete:function(){var k=self.performance.now();x.executeEnd=x.end=k,T.first===0&&(T.first=k),R&&R.first===0&&(R.first=k);var $=r.sourceBuffer,X={};for(var V in $)X[V]=w.BufferHelper.getBuffered($[V]);r.appendError=0,r.hls.trigger(L.Events.BUFFER_APPENDED,{type:p,frag:_,part:y,chunkMeta:n,parent:_.type,timeRanges:X})},onError:function(k){E.logger.error("[buffer-controller]: Error encountered while trying to append to the "+p+" SourceBuffer",k);var $={type:A.ErrorTypes.MEDIA_ERROR,parent:_.type,details:A.ErrorDetails.BUFFER_APPEND_ERROR,err:k,fatal:!1};k.code===DOMException.QUOTA_EXCEEDED_ERR?$.details=A.ErrorDetails.BUFFER_FULL_ERROR:(r.appendError++,$.details=A.ErrorDetails.BUFFER_APPEND_ERROR,r.appendError>d.config.appendErrorMaxRetry&&(E.logger.error("[buffer-controller]: Failed "+d.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),$.fatal=!0)),d.trigger(L.Events.ERROR,$)}};f.append(B,p)},c.onBufferFlushing=function(e,s){var r=this,d=this.operationQueue,f=function(m){return{execute:r.removeExecutor.bind(r,m,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){r.hls.trigger(L.Events.BUFFER_FLUSHED,{type:m})},onError:function(_){E.logger.warn("[buffer-controller]: Failed to remove from "+m+" SourceBuffer",_)}}};s.type?d.append(f(s.type),s.type):this.getSourceBufferTypes().forEach(function(g){d.append(f(g),g)})},c.onFragParsed=function(e,s){var r=this,d=s.frag,f=s.part,g=[],m=f?f.elementaryStreams:d.elementaryStreams;m[u.ElementaryStreamTypes.AUDIOVIDEO]?g.push("audiovideo"):(m[u.ElementaryStreamTypes.AUDIO]&&g.push("audio"),m[u.ElementaryStreamTypes.VIDEO]&&g.push("video"));var p=function(){var y=self.performance.now();d.stats.buffering.end=y,f&&(f.stats.buffering.end=y);var n=f?f.stats:d.stats;r.hls.trigger(L.Events.FRAG_BUFFERED,{frag:d,part:f,stats:n,id:d.type})};g.length===0&&E.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+d.type+" level: "+d.level+" sn: "+d.sn),this.blockBuffers(p,g)},c.onFragChanged=function(e,s){this.flushBackBuffer()},c.onBufferEos=function(e,s){var r=this,d=this.getSourceBufferTypes().reduce(function(f,g){var m=r.sourceBuffer[g];return(!s.type||s.type===g)&&(m&&!m.ended&&(m.ended=!0,E.logger.log("[buffer-controller]: "+g+" sourceBuffer now EOS"))),f&&!!(!m||m.ended)},!0);d&&this.blockBuffers(function(){var f=r.mediaSource;if(!f||f.readyState!=="open")return;f.endOfStream()})},c.onLevelUpdated=function(e,s){var r=s.details;if(!r.fragments.length)return;this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},c.flushBackBuffer=function(){var e=this.hls,s=this.details,r=this.media,d=this.sourceBuffer;if(!r||s===null)return;var f=this.getSourceBufferTypes();if(!f.length)return;var g=s.live&&e.config.liveBackBufferLength!==null?e.config.liveBackBufferLength:e.config.backBufferLength;if(!Object(b.isFiniteNumber)(g)||g<0)return;var m=r.currentTime,p=s.levelTargetDuration,_=Math.max(g,p),y=Math.floor(m/p)*p-_;f.forEach(function(n){var x=d[n];if(x){var S=w.BufferHelper.getBuffered(x);S.length>0&&y>S.start(0)&&(e.trigger(L.Events.BACK_BUFFER_REACHED,{bufferEnd:y}),s.live&&e.trigger(L.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:y}),e.trigger(L.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:y,type:n}))}})},c.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var e=this.details,s=this.hls,r=this.media,d=this.mediaSource,f=e.fragments[0].start+e.totalduration,g=r.duration,m=Object(b.isFiniteNumber)(d.duration)?d.duration:0;e.live&&s.config.liveDurationInfinity?(E.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),d.duration=Infinity,this.updateSeekableRange(e)):(f>m&&f>g||!Object(b.isFiniteNumber)(g))&&(E.logger.log("[buffer-controller]: Updating Media Source duration to "+f.toFixed(3)),d.duration=f)},c.updateSeekableRange=function(e){var s=this.mediaSource,r=e.fragments,d=r.length;if(d&&e.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var f=Math.max(0,r[0].start),g=Math.max(f,f+e.totalduration);s.setLiveSeekableRange(f,g)}},c.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,s=this.operationQueue,r=this.pendingTracks,d=Object.keys(r).length;if(d&&!e||d===2){this.createSourceBuffers(r),this.pendingTracks={};var f=this.getSourceBufferTypes();if(f.length===0){this.hls.trigger(L.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}f.forEach(function(g){s.executeNext(g)})}},c.createSourceBuffers=function(e){var s=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");var d=0;for(var f in e)if(!s[f]){var g=e[f];if(!g)throw Error("source buffer exists for track "+f+", however track does not");var m=g.levelCodec||g.codec,p=g.container+";codecs="+m;E.logger.log("[buffer-controller]: creating sourceBuffer("+p+")");try{var _=s[f]=r.addSourceBuffer(p),y=f;this.addBufferListener(y,"updatestart",this._onSBUpdateStart),this.addBufferListener(y,"updateend",this._onSBUpdateEnd),this.addBufferListener(y,"error",this._onSBUpdateError),this.tracks[f]={buffer:_,codec:m,container:g.container,levelCodec:g.levelCodec,id:g.id},d++}catch(n){E.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+n.message),this.hls.trigger(L.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:n,mimeType:p})}}d&&this.hls.trigger(L.Events.BUFFER_CREATED,{tracks:this.tracks})},c._onSBUpdateStart=function(e){var s=this.operationQueue,r=s.current(e);r.onStart()},c._onSBUpdateEnd=function(e){var s=this.operationQueue,r=s.current(e);r.onComplete(),s.shiftAndExecuteNext(e)},c._onSBUpdateError=function(e,s){E.logger.error("[buffer-controller]: "+e+" SourceBuffer error",s),this.hls.trigger(L.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var r=this.operationQueue.current(e);r&&r.onError(s)},c.removeExecutor=function(e,s,r){var d=this.media,f=this.mediaSource,g=this.operationQueue,m=this.sourceBuffer,p=m[e];if(!d||!f||!p){E.logger.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),g.shiftAndExecuteNext(e);return}var _=Object(b.isFiniteNumber)(d.duration)?d.duration:Infinity,y=Object(b.isFiniteNumber)(f.duration)?f.duration:Infinity,n=Math.max(0,s),x=Math.min(r,_,y);x>n?(E.logger.log("[buffer-controller]: Removing ["+n+","+x+"] from the "+e+" SourceBuffer"),console.assert(!p.updating,e+" sourceBuffer must not be updating"),p.remove(n,x)):g.shiftAndExecuteNext(e)},c.appendExecutor=function(e,s){var r=this.operationQueue,d=this.sourceBuffer,f=d[s];if(!f){E.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),r.shiftAndExecuteNext(s);return}f.ended=!1,console.assert(!f.updating,s+" sourceBuffer must not be updating"),f.appendBuffer(e)},c.blockBuffers=function(e,s){var r=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){E.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(e);return}var d=this.operationQueue,f=s.map(function(g){return d.appendBlocker(g)});Promise.all(f).then(function(){e(),s.forEach(function(g){var m=r.sourceBuffer[g];(!m||!m.updating)&&d.shiftAndExecuteNext(g)})})},c.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},c.addBufferListener=function(e,s,r){var d=this.sourceBuffer[e];if(!d)return;var f=r.bind(this,e);this.listeners[e].push({event:s,listener:f}),d.addEventListener(s,f)},c.removeBufferListeners=function(e){var s=this.sourceBuffer[e];if(!s)return;this.listeners[e].forEach(function(r){s.removeEventListener(r.event,r.listener)})},l}()},"./src/controller/buffer-operation-queue.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return L});var b=U("./src/utils/logger.ts"),L=function(){function E(w){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=w}var A=E.prototype;return A.append=function(v,u){var h=this.queues[u];h.push(v),h.length===1&&this.buffers[u]&&this.executeNext(u)},A.insertAbort=function(v,u){var h=this.queues[u];h.unshift(v),this.executeNext(u)},A.appendBlocker=function(v){var u,h=new Promise(function(t){u=t}),a={execute:u,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(a,v),h},A.executeNext=function(v){var u=this.buffers,h=this.queues,a=u[v],t=h[v];if(t.length){var i=t[0];try{i.execute()}catch(l){b.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),i.onError(l),(!a||!a.updating)&&(t.shift(),this.executeNext(v))}}},A.shiftAndExecuteNext=function(v){this.queues[v].shift(),this.executeNext(v)},A.current=function(v){return this.queues[v][0]},E}()},"./src/controller/cap-level-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/events.ts");function L(w,v){for(var u=0;u<v.length;u++){var h=v[u];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(w,h.key,h)}}function E(w,v,u){return v&&L(w.prototype,v),u&&L(w,u),w}var A=function(){function w(u){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=u,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var v=w.prototype;return v.setStreamController=function(h){this.streamController=h},v.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},v.registerListeners=function(){var h=this.hls;h.on(b.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),h.on(b.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.on(b.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(b.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.on(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},v.unregisterListener=function(){var h=this.hls;h.off(b.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),h.off(b.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(b.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(b.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.off(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},v.onFpsDropLevelCapping=function(h,a){w.isLevelAllowed(a.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(a.droppedLevel)},v.onMediaAttaching=function(h,a){this.media=a.media instanceof HTMLVideoElement?a.media:null},v.onManifestParsed=function(h,a){var t=this.hls;this.restrictedLevels=[],this.firstLevel=a.firstLevel,t.config.capLevelToPlayerSize&&a.video&&this.startCapping()},v.onBufferCodecs=function(h,a){var t=this.hls;t.config.capLevelToPlayerSize&&a.video&&this.startCapping()},v.onMediaDetaching=function(){this.stopCapping()},v.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var h=this.hls.levels;if(h.length){var a=this.hls;a.autoLevelCapping=this.getMaxLevel(h.length-1),a.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=a.autoLevelCapping}}},v.getMaxLevel=function(h){var a=this,t=this.hls.levels;if(!t.length)return-1;var i=t.filter(function(l,c){return w.isLevelAllowed(c,a.restrictedLevels)&&c<=h});return this.clientRect=null,w.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},v.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},v.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},v.getDimensions=function(){if(this.clientRect)return this.clientRect;var h=this.media,a={width:0,height:0};if(h){var t=h.getBoundingClientRect();a.width=t.width,a.height=t.height,!a.width&&!a.height&&(a.width=t.right-t.left||h.width||0,a.height=t.bottom-t.top||h.height||0)}return this.clientRect=a,a},w.isLevelAllowed=function(h,a){return a===void 0&&(a=[]),a.indexOf(h)===-1},w.getMaxLevelByMediaSize=function(h,a,t){if(!h||!h.length)return-1;for(var i=function(s,r){return r?s.width!==r.width||s.height!==r.height:!0},l=h.length-1,c=0;c<h.length;c+=1){var o=h[c];if((o.width>=a||o.height>=t)&&i(o,h[c+1])){l=c;break}}return l},E(w,[{key:"mediaWidth",get:function(){return this.getDimensions().width*w.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*w.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var h=1;try{h=self.devicePixelRatio}catch(a){}return h}}]),w}();Z.default=A},"./src/controller/cmcd-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return i});var b=U("./src/events.ts"),L=U("./src/types/cmcd.ts"),E=U("./src/utils/buffer-helper.ts"),A=U("./src/utils/logger.ts");function w(l,c){for(var o=0;o<c.length;o++){var e=c[o];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(l,e.key,e)}}function v(l,c,o){return c&&w(l.prototype,c),o&&w(l,o),l}function u(l,c){var o=typeof Symbol!="undefined"&&l[Symbol.iterator]||l["@@iterator"];if(o)return(o=o.call(l)).next.bind(o);if(Array.isArray(l)||(o=h(l))||c&&l&&typeof l.length=="number"){o&&(l=o);var e=0;return function(){return e>=l.length?{done:!0}:{done:!1,value:l[e++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h(l,c){if(!l)return;if(typeof l=="string")return a(l,c);var o=Object.prototype.toString.call(l).slice(8,-1);if(o==="Object"&&l.constructor&&(o=l.constructor.name),o==="Map"||o==="Set")return Array.from(l);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return a(l,c)}function a(l,c){(c==null||c>l.length)&&(c=l.length);for(var o=0,e=new Array(c);o<c;o++)e[o]=l[o];return e}function t(){return t=Object.assign||function(l){for(var c=1;c<arguments.length;c++){var o=arguments[c];for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&(l[e]=o[e])}return l},t.apply(this,arguments)}var i=function(){function l(o){var e=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){e.initialized&&(e.starved=!0),e.buffering=!0},this.onPlaying=function(){e.initialized||(e.initialized=!0),e.buffering=!1},this.applyPlaylistData=function(d){try{e.apply(d,{ot:L.CMCDObjectType.MANIFEST,su:!e.initialized})}catch(f){A.logger.warn("Could not generate manifest CMCD data.",f)}},this.applyFragmentData=function(d){try{var f=d.frag,g=e.hls.levels[f.level],m=e.getObjectType(f),p={d:f.duration*1e3,ot:m};(m===L.CMCDObjectType.VIDEO||m===L.CMCDObjectType.AUDIO||m==L.CMCDObjectType.MUXED)&&(p.br=g.bitrate/1e3,p.tb=e.getTopBandwidth(m),p.bl=e.getBufferLength(m)),e.apply(d,p)}catch(_){A.logger.warn("Could not generate segment CMCD data.",_)}},this.hls=o;var s=this.config=o.config,r=s.cmcd;r!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=r.sessionId||l.uuid(),this.cid=r.contentId,this.useHeaders=r.useHeaders===!0,this.registerListeners())}var c=l.prototype;return c.registerListeners=function(){var e=this.hls;e.on(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(b.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.on(b.Events.BUFFER_CREATED,this.onBufferCreated,this)},c.unregisterListeners=function(){var e=this.hls;e.off(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(b.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.off(b.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},c.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},c.onMediaAttached=function(e,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},c.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},c.onBufferCreated=function(e,s){var r,d;this.audioBuffer=(r=s.tracks.audio)===null||r===void 0?void 0:r.buffer,this.videoBuffer=(d=s.tracks.video)===null||d===void 0?void 0:d.buffer},c.createData=function(){var e;return{v:L.CMCDVersion,sf:L.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)===null||e===void 0?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},c.apply=function(e,s){s===void 0&&(s={}),t(s,this.createData());var r=s.ot===L.CMCDObjectType.INIT||s.ot===L.CMCDObjectType.VIDEO||s.ot===L.CMCDObjectType.MUXED;if(this.starved&&r&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var d=l.toHeaders(s);if(!Object.keys(d).length)return;e.headers||(e.headers={}),t(e.headers,d)}else{var f=l.toQuery(s);if(!f)return;e.url=l.appendQueryToUri(e.url,f)}},c.getObjectType=function(e){var s=e.type;return s==="subtitle"?L.CMCDObjectType.TIMED_TEXT:e.sn==="initSegment"?L.CMCDObjectType.INIT:s==="audio"?L.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?L.CMCDObjectType.VIDEO:L.CMCDObjectType.MUXED:void 0},c.getTopBandwidth=function(e){for(var s=0,r=e===L.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,d=u(r),f;!(f=d()).done;){var g=f.value;g.bitrate>s&&(s=g.bitrate)}return s>0?s:NaN},c.getBufferLength=function(e){var s=this.hls.media,r=e===L.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!r||!s)return NaN;var d=E.BufferHelper.bufferInfo(r,s.currentTime,this.config.maxBufferHole);return d.len*1e3},c.createPlaylistLoader=function(){var e=this.config.pLoader,s=this.applyPlaylistData,r=e||this.config.loader;return function(){function d(g){this.loader=void 0,this.loader=new r(g)}var f=d.prototype;return f.destroy=function(){this.loader.destroy()},f.abort=function(){this.loader.abort()},f.load=function(m,p,_){s(m),this.loader.load(m,p,_)},v(d,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),d}()},c.createFragmentLoader=function(){var e=this.config.fLoader,s=this.applyFragmentData,r=e||this.config.loader;return function(){function d(g){this.loader=void 0,this.loader=new r(g)}var f=d.prototype;return f.destroy=function(){this.loader.destroy()},f.abort=function(){this.loader.abort()},f.load=function(m,p,_){s(m),this.loader.load(m,p,_)},v(d,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),d}()},l.uuid=function(){var e=URL.createObjectURL(new Blob),s=e.toString();return URL.revokeObjectURL(e),s.substr(s.lastIndexOf("/")+1)},l.serialize=function(e){for(var s=[],r=function(I){return!Number.isNaN(I)&&I!=null&&I!==""&&I!==!1},d=function(I){return Math.round(I)},f=function(I){return d(I/100)*100},g=function(I){return encodeURIComponent(I)},m={br:d,d,bl:f,dl:f,mtp:f,nor:g,rtp:f,tb:d},p=Object.keys(e||{}).sort(),_=u(p),y;!(y=_()).done;){var n=y.value,x=e[n];if(!r(x))continue;if(n==="v"&&x===1)continue;if(n=="pr"&&x===1)continue;var S=m[n];S&&(x=S(x));var T=typeof x,R=void 0;n==="ot"||n==="sf"||n==="st"?R=n+"="+x:T==="boolean"?R=n:T==="number"?R=n+"="+x:R=n+"="+JSON.stringify(x),s.push(R)}return s.join(",")},l.toHeaders=function(e){for(var s=Object.keys(e),r={},d=["Object","Request","Session","Status"],f=[{},{},{},{}],g={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},m=0,p=s;m<p.length;m++){var _=p[m],y=g[_]!=null?g[_]:1;f[y][_]=e[_]}for(var n=0;n<f.length;n++){var x=l.serialize(f[n]);x&&(r["CMCD-"+d[n]]=x)}return r},l.toQuery=function(e){return"CMCD="+encodeURIComponent(l.serialize(e))},l.appendQueryToUri=function(e,s){if(!s)return e;var r=e.includes("?")?"&":"?";return""+e+r+s},l}()},"./src/controller/eme-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/events.ts"),L=U("./src/errors.ts"),E=U("./src/utils/logger.ts"),A=U("./src/utils/mediakeys-helper.ts");function w(i,l){for(var c=0;c<l.length;c++){var o=l[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(i,o.key,o)}}function v(i,l,c){return l&&w(i.prototype,l),c&&w(i,c),i}var u=3,h=function(l,c,o){var e={audioCapabilities:[],videoCapabilities:[]};return l.forEach(function(s){e.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:o.audioRobustness||""})}),c.forEach(function(s){e.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:o.videoRobustness||""})}),[e]},a=function(l,c,o,e){switch(l){case A.KeySystems.WIDEVINE:return h(c,o,e);default:throw new Error("Unknown key-system: "+l)}},t=function(){function i(c){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=c,this._config=c.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var l=i.prototype;return l.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},l._registerListeners=function(){this.hls.on(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(b.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(b.Events.MANIFEST_PARSED,this.onManifestParsed,this)},l._unregisterListeners=function(){this.hls.off(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(b.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(b.Events.MANIFEST_PARSED,this.onManifestParsed,this)},l.getLicenseServerUrl=function(o){switch(o){case A.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+o+'"')},l._attemptKeySystemAccess=function(o,e,s){var r=this,d=a(o,e,s,this._drmSystemOptions);E.logger.log("Requesting encrypted media key-system access");var f=this.requestMediaKeySystemAccess(o,d);this.mediaKeysPromise=f.then(function(g){return r._onMediaKeySystemAccessObtained(o,g)}),f.catch(function(g){E.logger.error('Failed to obtain key-system "'+o+'" access:',g)})},l._onMediaKeySystemAccessObtained=function(o,e){var s=this;E.logger.log('Access for key-system "'+o+'" obtained');var r={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:e,mediaKeySystemDomain:o};this._mediaKeysList.push(r);var d=Promise.resolve().then(function(){return e.createMediaKeys()}).then(function(f){return r.mediaKeys=f,E.logger.log('Media-keys created for key-system "'+o+'"'),s._onMediaKeysCreated(),f});return d.catch(function(f){E.logger.error("Failed to create media-keys:",f)}),d},l._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(e){e.mediaKeysSession||(e.mediaKeysSession=e.mediaKeys.createSession(),o._onNewMediaKeySession(e.mediaKeysSession))})},l._onNewMediaKeySession=function(o){var e=this;E.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(s){e._onKeySessionMessage(o,s.message)},!1)},l._onKeySessionMessage=function(o,e){E.logger.log("Got EME message event, creating license request"),this._requestLicense(e,function(s){E.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),o.update(s)})},l.onMediaEncrypted=function(o){var e=this;if(E.logger.log('Media is encrypted using "'+o.initDataType+'" init data type'),!this.mediaKeysPromise){E.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(b.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(d){if(!e._media)return;e._attemptSetMediaKeys(d),e._generateRequestWithPreferredKeySession(o.initDataType,o.initData)};this.mediaKeysPromise.then(s).catch(s)},l._attemptSetMediaKeys=function(o){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var e=this._mediaKeysList[0];if(!e||!e.mediaKeys){E.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(b.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}E.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(e.mediaKeys),this._hasSetMediaKeys=!0}},l._generateRequestWithPreferredKeySession=function(o,e){var s=this,r=this._mediaKeysList[0];if(!r){E.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(b.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(r.mediaKeysSessionInitialized){E.logger.warn("Key-Session already initialized but requested again");return}var d=r.mediaKeysSession;if(!d){E.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(b.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!e){E.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(b.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}E.logger.log('Generating key-session request for "'+o+'" init data type'),r.mediaKeysSessionInitialized=!0,d.generateRequest(o,e).then(function(){E.logger.debug("Key-session generation succeeded")}).catch(function(f){E.logger.error("Error generating key-session request:",f),s.hls.trigger(b.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},l._createLicenseXhr=function(o,e,s){var r=new XMLHttpRequest;r.responseType="arraybuffer",r.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,r,o,e,s);var d=this._licenseXhrSetup;if(d)try{d.call(this.hls,r,o),d=void 0}catch(f){E.logger.error(f)}try{r.readyState||r.open("POST",o,!0),d&&d.call(this.hls,r,o)}catch(f){throw new Error("issue setting up KeySystem license XHR "+f)}return r},l._onLicenseRequestReadyStageChange=function(o,e,s,r){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,E.logger.log("License request succeeded");var d=o.response,f=this._licenseResponseCallback;if(f)try{d=f.call(this.hls,o,e)}catch(m){E.logger.error(m)}r(d)}else{if(E.logger.error("License Request XHR failed ("+e+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u){this.hls.trigger(b.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var g=u-this._requestLicenseFailureCount+1;E.logger.warn("Retrying license request, "+g+" attempts left"),this._requestLicense(s,r)}break}},l._generateLicenseRequestChallenge=function(o,e){switch(o.mediaKeySystemDomain){case A.KeySystems.WIDEVINE:return e}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},l._requestLicense=function(o,e){E.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){E.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(b.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var r=this.getLicenseServerUrl(s.mediaKeySystemDomain),d=this._createLicenseXhr(r,o,e);E.logger.log("Sending license request to URL: "+r);var f=this._generateLicenseRequestChallenge(s,o);d.send(f)}catch(g){E.logger.error("Failure requesting DRM license: "+g),this.hls.trigger(b.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},l.onMediaAttached=function(o,e){if(!this._emeEnabled)return;var s=e.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},l.onMediaDetached=function(){var o=this._media,e=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},l.onManifestParsed=function(o,e){if(!this._emeEnabled)return;var s=e.levels.map(function(d){return d.audioCodec}).filter(function(d){return!!d}),r=e.levels.map(function(d){return d.videoCodec}).filter(function(d){return!!d});this._attemptKeySystemAccess(A.KeySystems.WIDEVINE,s,r)},v(i,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),i}();Z.default=t},"./src/controller/fps-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/events.ts"),L=U("./src/utils/logger.ts"),E=function(){function A(v){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=v,this.registerListeners()}var w=A.prototype;return w.setStreamController=function(u){this.streamController=u},w.registerListeners=function(){this.hls.on(b.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},w.unregisterListeners=function(){this.hls.off(b.Events.MEDIA_ATTACHING,this.onMediaAttaching)},w.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},w.onMediaAttaching=function(u,h){var a=this.hls.config;if(a.capLevelOnFPSDrop){var t=h.media instanceof self.HTMLVideoElement?h.media:null;this.media=t,t&&typeof t.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),a.fpsDroppedMonitoringPeriod)}},w.checkFPS=function(u,h,a){var t=performance.now();if(h){if(this.lastTime){var i=t-this.lastTime,l=a-this.lastDroppedFrames,c=h-this.lastDecodedFrames,o=1e3*l/i,e=this.hls;if(e.trigger(b.Events.FPS_DROP,{currentDropped:l,currentDecoded:c,totalDroppedFrames:a}),o>0&&l>e.config.fpsDroppedMonitoringThreshold*c){var s=e.currentLevel;L.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(e.autoLevelCapping===-1||e.autoLevelCapping>=s)&&(s=s-1,e.trigger(b.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:e.currentLevel}),e.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=t,this.lastDroppedFrames=a,this.lastDecodedFrames=h}},w.checkFPSInterval=function(){var u=this.media;if(u)if(this.isVideoPlaybackQualityAvailable){var h=u.getVideoPlaybackQuality();this.checkFPS(u,h.totalVideoFrames,h.droppedVideoFrames)}else this.checkFPS(u,u.webkitDecodedFrameCount,u.webkitDroppedFrameCount)},A}();Z.default=E},"./src/controller/fragment-finders.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"findFragmentByPDT",function(){return E}),U.d(Z,"findFragmentByPTS",function(){return A}),U.d(Z,"fragmentWithinToleranceTest",function(){return w}),U.d(Z,"pdtWithinToleranceTest",function(){return v}),U.d(Z,"findFragWithCC",function(){return u});var b=U("./src/polyfills/number.ts"),L=U("./src/utils/binary-search.ts");function E(h,a,t){if(a===null||!Array.isArray(h)||!h.length||!Object(b.isFiniteNumber)(a))return null;var i=h[0].programDateTime;if(a<(i||0))return null;var l=h[h.length-1].endProgramDateTime;if(a>=(l||0))return null;t=t||0;for(var c=0;c<h.length;++c){var o=h[c];if(v(a,t,o))return o}return null}function A(h,a,t,i){t===void 0&&(t=0),i===void 0&&(i=0);var l=null;if(h?l=a[h.sn-a[0].sn+1]||null:t===0&&a[0].start===0&&(l=a[0]),l&&w(t,i,l)===0)return l;var c=L.default.search(a,w.bind(null,t,i));return c||l}function w(h,a,t){h===void 0&&(h=0),a===void 0&&(a=0);var i=Math.min(a,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-i<=h?1:t.start-i>h&&t.start?-1:0}function v(h,a,t){var i=Math.min(a,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3,l=t.endProgramDateTime||0;return l-i>h}function u(h,a){return L.default.search(h,function(t){return t.cc<a?1:t.cc>a?-1:0})}},"./src/controller/fragment-tracker.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"FragmentState",function(){return E}),U.d(Z,"FragmentTracker",function(){return A});var b=U("./src/events.ts"),L=U("./src/types/loader.ts"),E;(function(u){u.NOT_LOADED="NOT_LOADED",u.BACKTRACKED="BACKTRACKED",u.APPENDING="APPENDING",u.PARTIAL="PARTIAL",u.OK="OK"})(E||(E={}));var A=function(){function u(a){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=a,this._registerListeners()}var h=u.prototype;return h._registerListeners=function(){var t=this.hls;t.on(b.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.on(b.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.on(b.Events.FRAG_LOADED,this.onFragLoaded,this)},h._unregisterListeners=function(){var t=this.hls;t.off(b.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.off(b.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.off(b.Events.FRAG_LOADED,this.onFragLoaded,this)},h.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},h.getAppendedFrag=function(t,i){if(i===L.PlaylistLevelType.MAIN){var l=this.activeFragment,c=this.activeParts;if(!l)return null;if(c)for(var o=c.length;o--;){var e=c[o],s=e?e.end:l.appendedPTS;if(e.start<=t&&s!==void 0&&t<=s)return o>9&&(this.activeParts=c.slice(o-9)),e}else if(l.start<=t&&l.appendedPTS!==void 0&&t<=l.appendedPTS)return l}return this.getBufferedFrag(t,i)},h.getBufferedFrag=function(t,i){for(var l=this.fragments,c=Object.keys(l),o=c.length;o--;){var e=l[c[o]];if((e==null?void 0:e.body.type)===i&&e.buffered){var s=e.body;if(s.start<=t&&t<=s.end)return s}}return null},h.detectEvictedFragments=function(t,i,l){var c=this;Object.keys(this.fragments).forEach(function(o){var e=c.fragments[o];if(!e)return;if(!e.buffered){e.body.type===l&&c.removeFragment(e.body);return}var s=e.range[t];if(!s)return;s.time.some(function(r){var d=!c.isTimeBuffered(r.startPTS,r.endPTS,i);return d&&c.removeFragment(e.body),d})})},h.detectPartialFragments=function(t){var i=this,l=this.timeRanges,c=t.frag,o=t.part;if(!l||c.sn==="initSegment")return;var e=v(c),s=this.fragments[e];if(!s)return;Object.keys(l).forEach(function(r){var d=c.elementaryStreams[r];if(!d)return;var f=l[r],g=o!==null||d.partial===!0;s.range[r]=i.getBufferedTimes(c,o,g,f)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},h.fragBuffered=function(t){var i=v(t),l=this.fragments[i];l&&(l.backtrack=l.loaded=null,l.buffered=!0)},h.getBufferedTimes=function(t,i,l,c){for(var o={time:[],partial:l},e=i?i.start:t.start,s=i?i.end:t.end,r=t.minEndPTS||s,d=t.maxStartPTS||e,f=0;f<c.length;f++){var g=c.start(f)-this.bufferPadding,m=c.end(f)+this.bufferPadding;if(d>=g&&r<=m){o.time.push({startPTS:Math.max(e,c.start(f)),endPTS:Math.min(s,c.end(f))});break}else if(e<m&&s>g)o.partial=!0,o.time.push({startPTS:Math.max(e,c.start(f)),endPTS:Math.min(s,c.end(f))});else if(s<=g)break}return o},h.getPartialFragment=function(t){var i=null,l,c,o,e=0,s=this.bufferPadding,r=this.fragments;return Object.keys(r).forEach(function(d){var f=r[d];if(!f)return;w(f)&&(c=f.body.start-s,o=f.body.end+s,t>=c&&t<=o&&(l=Math.min(t-c,o-t),e<=l&&(i=f.body,e=l)))}),i},h.getState=function(t){var i=v(t),l=this.fragments[i];return l?l.buffered?w(l)?E.PARTIAL:E.OK:l.backtrack?E.BACKTRACKED:E.APPENDING:E.NOT_LOADED},h.backtrack=function(t,i){var l=v(t),c=this.fragments[l];if(!c||c.backtrack)return null;var o=c.backtrack=i||c.loaded;return c.loaded=null,o},h.getBacktrackData=function(t){var i=v(t),l=this.fragments[i];if(l){var c,o=l.backtrack;if(o!=null&&(c=o.payload)!==null&&c!==void 0&&c.byteLength)return o;this.removeFragment(t)}return null},h.isTimeBuffered=function(t,i,l){for(var c,o,e=0;e<l.length;e++){if(c=l.start(e)-this.bufferPadding,o=l.end(e)+this.bufferPadding,t>=c&&i<=o)return!0;if(i<=c)return!1}return!1},h.onFragLoaded=function(t,i){var l=i.frag,c=i.part;if(l.sn==="initSegment"||l.bitrateTest||c)return;var o=v(l);this.fragments[o]={body:l,loaded:i,backtrack:null,buffered:!1,range:Object.create(null)}},h.onBufferAppended=function(t,i){var l=this,c=i.frag,o=i.part,e=i.timeRanges;if(c.type===L.PlaylistLevelType.MAIN)if(this.activeFragment=c,o){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(o)}else this.activeParts=null;this.timeRanges=e,Object.keys(e).forEach(function(r){var d=e[r];if(l.detectEvictedFragments(r,d),!o)for(var f=0;f<d.length;f++)c.appendedPTS=Math.max(d.end(f),c.appendedPTS||0)})},h.onFragBuffered=function(t,i){this.detectPartialFragments(i)},h.hasFragment=function(t){var i=v(t);return!!this.fragments[i]},h.removeFragmentsInRange=function(t,i,l){var c=this;Object.keys(this.fragments).forEach(function(o){var e=c.fragments[o];if(!e)return;if(e.buffered){var s=e.body;s.type===l&&s.start<i&&s.end>t&&c.removeFragment(s)}})},h.removeFragment=function(t){var i=v(t);t.stats.loaded=0,t.clearElementaryStreamInfo(),delete this.fragments[i]},h.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},u}();function w(u){var h,a;return u.buffered&&(((h=u.range.video)===null||h===void 0?void 0:h.partial)||((a=u.range.audio)===null||a===void 0?void 0:a.partial))}function v(u){return u.type+"_"+u.level+"_"+u.urlId+"_"+u.sn}},"./src/controller/gap-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"STALL_MINIMUM_DURATION_MS",function(){return w}),U.d(Z,"MAX_START_GAP_JUMP",function(){return v}),U.d(Z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return u}),U.d(Z,"SKIP_BUFFER_RANGE_START",function(){return h}),U.d(Z,"default",function(){return a});var b=U("./src/utils/buffer-helper.ts"),L=U("./src/errors.ts"),E=U("./src/events.ts"),A=U("./src/utils/logger.ts"),w=250,v=2,u=.1,h=.05,a=function(){function t(l,c,o,e){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=l,this.media=c,this.fragmentTracker=o,this.hls=e}var i=t.prototype;return i.destroy=function(){this.hls=this.fragmentTracker=this.media=null},i.poll=function(c){var o=this.config,e=this.media,s=this.stalled,r=e.currentTime,d=e.seeking,f=this.seeking&&!d,g=!this.seeking&&d;if(this.seeking=d,r!==c){if(this.moved=!0,s!==null){if(this.stallReported){var m=self.performance.now()-s;A.logger.warn("playback not stuck anymore @"+r+", after "+Math.round(m)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((g||f)&&(this.stalled=null),e.paused||e.ended||e.playbackRate===0||!b.BufferHelper.getBuffered(e).length)return;var p=b.BufferHelper.bufferInfo(e,r,0),_=p.len>0,y=p.nextStart||0;if(!_&&!y)return;if(d){var n=p.len>v,x=!y||y-r>v&&!this.fragmentTracker.getPartialFragment(r);if(n||x)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var S,T=Math.max(y,p.start||0)-r,R=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,D=R==null||((S=R.details)===null||S===void 0)?void 0:S.live,I=D?R.details.targetduration*2:v;if(T>0&&T<=I){this._trySkipBufferHole(null);return}}var B=self.performance.now();if(s===null){this.stalled=B;return}var G=B-s;!d&&G>=w&&this._reportStall(p.len);var k=b.BufferHelper.bufferInfo(e,r,o.maxBufferHole);this._tryFixBufferStall(k,G)},i._tryFixBufferStall=function(c,o){var e=this.config,s=this.fragmentTracker,r=this.media,d=r.currentTime,f=s.getPartialFragment(d);if(f){var g=this._trySkipBufferHole(f);if(g)return}c.len>e.maxBufferHole&&o>e.highBufferWatchdogPeriod*1e3&&(A.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},i._reportStall=function(c){var o=this.hls,e=this.media,s=this.stallReported;s||(this.stallReported=!0,A.logger.warn("Playback stalling at @"+e.currentTime+" due to low buffer (buffer="+c+")"),o.trigger(E.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:c}))},i._trySkipBufferHole=function(c){for(var o=this.config,e=this.hls,s=this.media,r=s.currentTime,d=0,f=b.BufferHelper.getBuffered(s),g=0;g<f.length;g++){var m=f.start(g);if(r+o.maxBufferHole>=d&&r<m){var p=Math.max(m+h,s.currentTime+u);return A.logger.warn("skipping hole, adjusting currentTime from "+r+" to "+p),this.moved=!0,this.stalled=null,s.currentTime=p,c&&e.trigger(E.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+r+" to "+p,frag:c}),p}d=f.end(g)}return 0},i._tryNudgeBuffer=function(){var c=this.config,o=this.hls,e=this.media,s=e.currentTime,r=(this.nudgeRetry||0)+1;if(this.nudgeRetry=r,r<c.nudgeMaxRetry){var d=s+r*c.nudgeOffset;A.logger.warn("Nudging 'currentTime' from "+s+" to "+d),e.currentTime=d,o.trigger(E.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else A.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+c.nudgeMaxRetry+" nudges"),o.trigger(E.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},t}()},"./src/controller/id3-track-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/events.ts"),L=U("./src/utils/texttrack-utils.ts"),E=U("./src/demux/id3.ts"),A=.25,w=function(){function v(h){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=h,this._registerListeners()}var u=v.prototype;return u.destroy=function(){this._unregisterListeners()},u._registerListeners=function(){var a=this.hls;a.on(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(b.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),a.on(b.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},u._unregisterListeners=function(){var a=this.hls;a.off(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(b.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),a.off(b.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},u.onMediaAttached=function(a,t){this.media=t.media},u.onMediaDetaching=function(){if(!this.id3Track)return;Object(L.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},u.getID3Track=function(a){if(!this.media)return;for(var t=0;t<a.length;t++){var i=a[t];if(i.kind==="metadata"&&i.label==="id3")return Object(L.sendAddTrackEvent)(i,this.media),i}return this.media.addTextTrack("metadata","id3")},u.onFragParsingMetadata=function(a,t){if(!this.media)return;var i=t.frag,l=t.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var c=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<l.length;o++){var e=E.getID3Frames(l[o].data);if(e){var s=l[o].pts,r=o<l.length-1?l[o+1].pts:i.end,d=r-s;d<=0&&(r=s+A);for(var f=0;f<e.length;f++){var g=e[f];if(!E.isTimeStampFrame(g)){var m=new c(s,r,"");m.value=g,this.id3Track.addCue(m)}}}}},u.onBufferFlushing=function(a,t){var i=t.startOffset,l=t.endOffset,c=t.type;if(!c||c==="audio"){var o=this.id3Track;o&&Object(L.removeCuesInRange)(o,i,l)}},v}();Z.default=w},"./src/controller/latency-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return v});var b=U("./src/errors.ts"),L=U("./src/events.ts"),E=U("./src/utils/logger.ts");function A(u,h){for(var a=0;a<h.length;a++){var t=h[a];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}function w(u,h,a){return h&&A(u.prototype,h),a&&A(u,a),u}var v=function(){function u(a){var t=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return t.timeupdate()},this.hls=a,this.config=a.config,this.registerListeners()}var h=u.prototype;return h.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},h.registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(L.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(L.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(L.Events.ERROR,this.onError)},h.onMediaAttached=function(t,i){this.media=i.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},h.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},h.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},h.onLevelUpdated=function(t,i){var l=i.details;this.levelDetails=l,l.advanced&&this.timeupdate(),!l.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},h.onError=function(t,i){if(i.details!==b.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,E.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},h.timeupdate=function(){var t=this.media,i=this.levelDetails;if(!t||!i)return;this.currentTime=t.currentTime;var l=this.computeLatency();if(l===null)return;this._latency=l;var c=this.config,o=c.lowLatencyMode,e=c.maxLiveSyncPlaybackRate;if(!o||e===1)return;var s=this.targetLatency;if(s===null)return;var r=l-s,d=Math.min(this.maxLatency,s+i.targetduration),f=r<d;if(i.live&&f&&r>.05&&this.forwardBufferLength>1){var g=Math.min(2,Math.max(1,e)),m=Math.round(2/(1+Math.exp(-.75*r-this.edgeStalled))*20)/20;t.playbackRate=Math.min(g,Math.max(1,m))}else t.playbackRate!==1&&t.playbackRate!==0&&(t.playbackRate=1)},h.estimateLiveEdge=function(){var t=this.levelDetails;return t===null?null:t.edge+t.age},h.computeLatency=function(){var t=this.estimateLiveEdge();return t===null?null:t-this.currentTime},w(u,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var t=this.config,i=this.levelDetails;return t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:i?t.liveMaxLatencyDurationCount*i.targetduration:0}},{key:"targetLatency",get:function(){var t=this.levelDetails;if(t===null)return null;var i=t.holdBack,l=t.partHoldBack,c=t.targetduration,o=this.config,e=o.liveSyncDuration,s=o.liveSyncDurationCount,r=o.lowLatencyMode,d=this.hls.userConfig,f=r&&l||i;(d.liveSyncDuration||d.liveSyncDurationCount||f===0)&&(f=e!==void 0?e:s*c);var g=c,m=1;return f+Math.min(this.stallCount*m,g)}},{key:"liveSyncPosition",get:function(){var t=this.estimateLiveEdge(),i=this.targetLatency,l=this.levelDetails;if(t===null||i===null||l===null)return null;var c=l.edge,o=t-i-this.edgeStalled,e=c-l.totalduration,s=c-(this.config.lowLatencyMode&&l.partTarget||l.targetduration);return Math.min(Math.max(e,o),s)}},{key:"drift",get:function(){var t=this.levelDetails;return t===null?1:t.drift}},{key:"edgeStalled",get:function(){var t=this.levelDetails;if(t===null)return 0;var i=(this.config.lowLatencyMode&&t.partTarget||t.targetduration)*3;return Math.max(t.age-i,0)}},{key:"forwardBufferLength",get:function(){var t=this.media,i=this.levelDetails;if(!t||!i)return 0;var l=t.buffered.length;return l?t.buffered.end(l-1):i.edge-this.currentTime}}]),u}()},"./src/controller/level-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return o});var b=U("./src/types/level.ts"),L=U("./src/events.ts"),E=U("./src/errors.ts"),A=U("./src/utils/codecs.ts"),w=U("./src/controller/level-helper.ts"),v=U("./src/controller/base-playlist-controller.ts"),u=U("./src/types/loader.ts");function h(){return h=Object.assign||function(e){for(var s=1;s<arguments.length;s++){var r=arguments[s];for(var d in r)Object.prototype.hasOwnProperty.call(r,d)&&(e[d]=r[d])}return e},h.apply(this,arguments)}function a(e,s){for(var r=0;r<s.length;r++){var d=s[r];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,d.key,d)}}function t(e,s,r){return s&&a(e.prototype,s),r&&a(e,r),e}function i(e,s){e.prototype=Object.create(s.prototype),e.prototype.constructor=e,l(e,s)}function l(e,s){return l=Object.setPrototypeOf||function(d,f){return d.__proto__=f,d},l(e,s)}var c=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(e){i(s,e);function s(d){var f;return f=e.call(this,d,"[level-controller]")||this,f._levels=[],f._firstLevel=-1,f._startLevel=void 0,f.currentLevelIndex=-1,f.manualLevelIndex=-1,f.onParsedComplete=void 0,f._registerListeners(),f}var r=s.prototype;return r._registerListeners=function(){var f=this.hls;f.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),f.on(L.Events.ERROR,this.onError,this)},r._unregisterListeners=function(){var f=this.hls;f.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),f.off(L.Events.ERROR,this.onError,this)},r.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,e.prototype.destroy.call(this)},r.startLoad=function(){var f=this._levels;f.forEach(function(g){g.loadError=0}),e.prototype.startLoad.call(this)},r.onManifestLoaded=function(f,g){var m=[],p=[],_=[],y,n={},x,S=!1,T=!1,R=!1;if(g.levels.forEach(function(G){var k=G.attrs;S=S||!!(G.width&&G.height),T=T||!!G.videoCodec,R=R||!!G.audioCodec,c&&G.audioCodec&&G.audioCodec.indexOf("mp4a.40.34")!==-1&&(G.audioCodec=void 0);var $=G.bitrate+"-"+G.attrs.RESOLUTION+"-"+G.attrs.CODECS;x=n[$],x?x.url.push(G.url):(x=new b.Level(G),n[$]=x,m.push(x)),k&&(k.AUDIO&&Object(w.addGroupId)(x,"audio",k.AUDIO),k.SUBTITLES&&Object(w.addGroupId)(x,"text",k.SUBTITLES))}),(S||T)&&R&&(m=m.filter(function(G){var k=G.videoCodec,$=G.width,X=G.height;return!!k||!!($&&X)})),m=m.filter(function(G){var k=G.audioCodec,$=G.videoCodec;return(!k||Object(A.isCodecSupportedInMp4)(k,"audio"))&&(!$||Object(A.isCodecSupportedInMp4)($,"video"))}),g.audioTracks&&(p=g.audioTracks.filter(function(G){return!G.audioCodec||Object(A.isCodecSupportedInMp4)(G.audioCodec,"audio")}),Object(w.assignTrackIdsByGroup)(p)),g.subtitles&&(_=g.subtitles,Object(w.assignTrackIdsByGroup)(_)),m.length>0){y=m[0].bitrate,m.sort(function(G,k){return G.bitrate-k.bitrate}),this._levels=m;for(var D=0;D<m.length;D++)if(m[D].bitrate===y){this._firstLevel=D,this.log("manifest loaded, "+m.length+" level(s) found, first bitrate: "+y);break}var I=R&&!T,B={levels:m,audioTracks:p,subtitleTracks:_,firstLevel:this._firstLevel,stats:g.stats,audio:R,video:T,altAudio:!I&&p.some(function(G){return!!G.url})};this.hls.trigger(L.Events.MANIFEST_PARSED,B),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(L.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:g.url,reason:"no level with compatible codecs found in manifest"})},r.onError=function(f,g){if(e.prototype.onError.call(this,f,g),g.fatal)return;var m=g.context,p=this._levels[this.currentLevelIndex];if(m&&(m.type===u.PlaylistContextType.AUDIO_TRACK&&p.audioGroupIds&&m.groupId===p.audioGroupIds[p.urlId]||m.type===u.PlaylistContextType.SUBTITLE_TRACK&&p.textGroupIds&&m.groupId===p.textGroupIds[p.urlId])){this.redundantFailover(this.currentLevelIndex);return}var _=!1,y=!0,n;switch(g.details){case E.ErrorDetails.FRAG_LOAD_ERROR:case E.ErrorDetails.FRAG_LOAD_TIMEOUT:case E.ErrorDetails.KEY_LOAD_ERROR:case E.ErrorDetails.KEY_LOAD_TIMEOUT:if(g.frag){var x=this._levels[g.frag.level];x?(x.fragmentError++,x.fragmentError>this.hls.config.fragLoadingMaxRetry&&(n=g.frag.level)):n=g.frag.level}break;case E.ErrorDetails.LEVEL_LOAD_ERROR:case E.ErrorDetails.LEVEL_LOAD_TIMEOUT:m&&(m.deliveryDirectives&&(y=!1),n=m.level),_=!0;break;case E.ErrorDetails.REMUX_ALLOC_ERROR:n=g.level,_=!0;break}n!==void 0&&this.recoverLevel(g,n,_,y)},r.recoverLevel=function(f,g,m,p){var _=f.details,y=this._levels[g];if(y.loadError++,m){var n=this.retryLoadingOrFail(f);if(n)f.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(p){var x=y.url.length;if(x>1&&y.loadError<x)f.levelRetry=!0,this.redundantFailover(g);else if(this.manualLevelIndex===-1){var S=g===0?this._levels.length-1:g-1;this.currentLevelIndex!==S&&this._levels[S].loadError===0&&(this.warn(_+": switch to "+S),f.levelRetry=!0,this.hls.nextAutoLevel=S)}}},r.redundantFailover=function(f){var g=this._levels[f],m=g.url.length;if(m>1){var p=(g.urlId+1)%m;this.warn("Switching to redundant URL-id "+p),this._levels.forEach(function(_){_.urlId=p}),this.level=f}},r.onFragLoaded=function(f,g){var m=g.frag;if(m!==void 0&&m.type===u.PlaylistLevelType.MAIN){var p=this._levels[m.level];p!==void 0&&(p.fragmentError=0,p.loadError=0)}},r.onLevelLoaded=function(f,g){var m,p=g.level,_=g.details,y=this._levels[p];if(!y){var n;this.warn("Invalid level index "+p),(n=g.deliveryDirectives)!==null&&n!==void 0&&n.skip&&(_.deltaUpdateFailed=!0);return}p===this.currentLevelIndex?(y.fragmentError===0&&(y.loadError=0,this.retryCount=0),this.playlistLoaded(p,g,y.details)):(m=g.deliveryDirectives)!==null&&m!==void 0&&m.skip&&(_.deltaUpdateFailed=!0)},r.onAudioTrackSwitched=function(f,g){var m=this.hls.levels[this.currentLevelIndex];if(!m)return;if(m.audioGroupIds){for(var p=-1,_=this.hls.audioTracks[g.id].groupId,y=0;y<m.audioGroupIds.length;y++)if(m.audioGroupIds[y]===_){p=y;break}p!==m.urlId&&(m.urlId=p,this.startLoad())}},r.loadPlaylist=function(f){var g=this.currentLevelIndex,m=this._levels[g];if(this.canLoad&&m&&m.url.length>0){var p=m.urlId,_=m.url[p];if(f)try{_=f.addDirectives(_)}catch(y){this.warn("Could not construct new URL with HLS Delivery Directives: "+y)}this.log("Attempt loading level index "+g+(f?" at sn "+f.msn+" part "+f.part:"")+" with URL-id "+p+" "+_),this.clearTimer(),this.hls.trigger(L.Events.LEVEL_LOADING,{url:_,level:g,id:p,deliveryDirectives:f||null})}},r.removeLevel=function(f,g){var m=function(y,n){return n!==g},p=this._levels.filter(function(_,y){return y!==f?!0:_.url.length>1&&g!==void 0?(_.url=_.url.filter(m),_.audioGroupIds&&(_.audioGroupIds=_.audioGroupIds.filter(m)),_.textGroupIds&&(_.textGroupIds=_.textGroupIds.filter(m)),_.urlId=0,!0):!1}).map(function(_,y){var n=_.details;return n!=null&&n.fragments&&n.fragments.forEach(function(x){x.level=y}),_});this._levels=p,this.hls.trigger(L.Events.LEVELS_UPDATED,{levels:p})},t(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(f){var g,m=this._levels;if(m.length===0)return;if(this.currentLevelIndex===f&&(g=m[f])!==null&&g!==void 0&&g.details)return;if(f<0||f>=m.length){var p=f<0;if(this.hls.trigger(L.Events.ERROR,{type:E.ErrorTypes.OTHER_ERROR,details:E.ErrorDetails.LEVEL_SWITCH_ERROR,level:f,fatal:p,reason:"invalid level idx"}),p)return;f=Math.min(f,m.length-1)}this.clearTimer();var _=this.currentLevelIndex,y=m[_],n=m[f];this.log("switching to level "+f+" from "+_),this.currentLevelIndex=f;var x=h({},n,{level:f,maxBitrate:n.maxBitrate,uri:n.uri,urlId:n.urlId});delete x._urlId,this.hls.trigger(L.Events.LEVEL_SWITCHING,x);var S=n.details;if(!S||S.live){var T=this.switchParams(n.uri,y==null?void 0:y.details);this.loadPlaylist(T)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(f){this.manualLevelIndex=f,this._startLevel===void 0&&(this._startLevel=f),f!==-1&&(this.level=f)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(f){this._firstLevel=f}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var f=this.hls.config.startLevel;return f!==void 0?f:this._firstLevel}else return this._startLevel},set:function(f){this._startLevel=f}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(f){this.level=f,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=f)}}]),s}(v.default)},"./src/controller/level-helper.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"addGroupId",function(){return E}),U.d(Z,"assignTrackIdsByGroup",function(){return A}),U.d(Z,"updatePTS",function(){return w}),U.d(Z,"updateFragPTSDTS",function(){return u}),U.d(Z,"mergeDetails",function(){return h}),U.d(Z,"mapPartIntersection",function(){return a}),U.d(Z,"mapFragmentIntersection",function(){return t}),U.d(Z,"adjustSliding",function(){return i}),U.d(Z,"addSliding",function(){return l}),U.d(Z,"computeReloadInterval",function(){return c}),U.d(Z,"getFragmentWithSN",function(){return o}),U.d(Z,"getPartWith",function(){return e});var b=U("./src/polyfills/number.ts"),L=U("./src/utils/logger.ts");function E(s,r,d){switch(r){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(d);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(d);break}}function A(s){var r={};s.forEach(function(d){var f=d.groupId||"";d.id=r[f]=r[f]||0,r[f]++})}function w(s,r,d){var f=s[r],g=s[d];v(f,g)}function v(s,r){var d=r.startPTS;if(Object(b.isFiniteNumber)(d)){var f=0,g;r.sn>s.sn?(f=d-s.start,g=s):(f=s.start-d,g=r),g.duration!==f&&(g.duration=f)}else if(r.sn>s.sn){var m=s.cc===r.cc;m&&s.minEndPTS?r.start=s.start+(s.minEndPTS-s.start):r.start=s.start+s.duration}else r.start=Math.max(s.start-r.duration,0)}function u(s,r,d,f,g,m){var p=f-d;p<=0&&(L.logger.warn("Fragment should have a positive duration",r),f=d+r.duration,m=g+r.duration);var _=d,y=f,n=r.startPTS,x=r.endPTS;if(Object(b.isFiniteNumber)(n)){var S=Math.abs(n-d);Object(b.isFiniteNumber)(r.deltaPTS)?r.deltaPTS=Math.max(S,r.deltaPTS):r.deltaPTS=S,_=Math.max(d,n),d=Math.min(d,n),g=Math.min(g,r.startDTS),y=Math.min(f,x),f=Math.max(f,x),m=Math.max(m,r.endDTS)}r.duration=f-d;var T=d-r.start;r.appendedPTS=f,r.start=r.startPTS=d,r.maxStartPTS=_,r.startDTS=g,r.endPTS=f,r.minEndPTS=y,r.endDTS=m;var R=r.sn;if(!s||R<s.startSN||R>s.endSN)return 0;var D,I=R-s.startSN,B=s.fragments;for(B[I]=r,D=I;D>0;D--)v(B[D],B[D-1]);for(D=I;D<B.length-1;D++)v(B[D],B[D+1]);return s.fragmentHint&&v(B[B.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,T}function h(s,r){for(var d=null,f=s.fragments,g=f.length-1;g>=0;g--){var m=f[g].initSegment;if(m){d=m;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var p=0,_;if(t(s,r,function(D,I){D.relurl&&(p=D.cc-I.cc),Object(b.isFiniteNumber)(D.startPTS)&&Object(b.isFiniteNumber)(D.endPTS)&&(I.start=I.startPTS=D.startPTS,I.startDTS=D.startDTS,I.appendedPTS=D.appendedPTS,I.maxStartPTS=D.maxStartPTS,I.endPTS=D.endPTS,I.endDTS=D.endDTS,I.minEndPTS=D.minEndPTS,I.duration=D.endPTS-D.startPTS,I.duration&&(_=I),r.PTSKnown=r.alignedSliding=!0),I.elementaryStreams=D.elementaryStreams,I.loader=D.loader,I.stats=D.stats,I.urlId=D.urlId,D.initSegment&&(I.initSegment=D.initSegment,d=D.initSegment)}),d){var y=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments;y.forEach(function(D){var I;(!D.initSegment||D.initSegment.relurl===((I=d)===null||I===void 0?void 0:I.relurl))&&(D.initSegment=d)})}if(r.skippedSegments&&(r.deltaUpdateFailed=r.fragments.some(function(D){return!D}),r.deltaUpdateFailed)){L.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var n=r.skippedSegments;n--;)r.fragments.shift();r.startSN=r.fragments[0].sn,r.startCC=r.fragments[0].cc}var x=r.fragments;if(p){L.logger.warn("discontinuity sliding from playlist, take drift into account");for(var S=0;S<x.length;S++)x[S].cc+=p}r.skippedSegments&&(r.startCC=r.fragments[0].cc),a(s.partList,r.partList,function(D,I){I.elementaryStreams=D.elementaryStreams,I.stats=D.stats}),_?u(r,_,_.startPTS,_.endPTS,_.startDTS,_.endDTS):i(s,r),x.length&&(r.totalduration=r.edge-x[0].start),r.driftStartTime=s.driftStartTime,r.driftStart=s.driftStart;var T=r.advancedDateTime;if(r.advanced&&T){var R=r.edge;r.driftStart||(r.driftStartTime=T,r.driftStart=R),r.driftEndTime=T,r.driftEnd=R}else r.driftEndTime=s.driftEndTime,r.driftEnd=s.driftEnd,r.advancedDateTime=s.advancedDateTime}function a(s,r,d){if(s&&r)for(var f=0,g=0,m=s.length;g<=m;g++){var p=s[g],_=r[g+f];p&&_&&p.index===_.index&&p.fragment.sn===_.fragment.sn?d(p,_):f--}}function t(s,r,d){for(var f=r.skippedSegments,g=Math.max(s.startSN,r.startSN)-r.startSN,m=(s.fragmentHint?1:0)+(f?r.endSN:Math.min(s.endSN,r.endSN))-r.startSN,p=r.startSN-s.startSN,_=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments,y=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,n=g;n<=m;n++){var x=y[p+n],S=_[n];f&&!S&&n<f&&(S=r.fragments[n]=x),x&&S&&d(x,S)}}function i(s,r){var d=r.startSN+r.skippedSegments-s.startSN,f=s.fragments;if(d<0||d>=f.length)return;l(r,f[d].start)}function l(s,r){if(r){for(var d=s.fragments,f=s.skippedSegments;f<d.length;f++)d[f].start+=r;s.fragmentHint&&(s.fragmentHint.start+=r)}}function c(s,r){var d=1e3*s.levelTargetDuration,f=d/2,g=s.age,m=g>0&&g<d*3,p=r.loading.end-r.loading.start,_,y=s.availabilityDelay;if(s.updated===!1)if(m){var n=333*s.misses;_=Math.max(Math.min(f,p*2),n),s.availabilityDelay=(s.availabilityDelay||0)+_}else _=f;else m?(y=Math.min(y||d/2,g),s.availabilityDelay=y,_=y+d-g):_=d-p;return Math.round(_)}function o(s,r,d){if(!s||!s.details)return null;var f=s.details,g=f.fragments[r-f.startSN];return g||(g=f.fragmentHint,g&&g.sn===r?g:r<f.startSN&&d&&d.sn===r?d:null)}function e(s,r,d){if(!s||!s.details)return null;var f=s.details.partList;if(f)for(var g=f.length;g--;){var m=f[g];if(m.index===d&&m.fragment.sn===r)return m}return null}},"./src/controller/stream-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return f});var b=U("./src/polyfills/number.ts"),L=U("./src/controller/base-stream-controller.ts"),E=U("./src/is-supported.ts"),A=U("./src/events.ts"),w=U("./src/utils/buffer-helper.ts"),v=U("./src/controller/fragment-tracker.ts"),u=U("./src/types/loader.ts"),h=U("./src/loader/fragment.ts"),a=U("./src/demux/transmuxer-interface.ts"),t=U("./src/types/transmuxer.ts"),i=U("./src/controller/gap-controller.ts"),l=U("./src/errors.ts"),c=U("./src/utils/logger.ts");function o(g,m){for(var p=0;p<m.length;p++){var _=m[p];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(g,_.key,_)}}function e(g,m,p){return m&&o(g.prototype,m),p&&o(g,p),g}function s(g,m){g.prototype=Object.create(m.prototype),g.prototype.constructor=g,r(g,m)}function r(g,m){return r=Object.setPrototypeOf||function(_,y){return _.__proto__=y,_},r(g,m)}var d=100,f=function(g){s(m,g);function m(_,y){var n;return n=g.call(this,_,y,"[stream-controller]")||this,n.audioCodecSwap=!1,n.gapController=null,n.level=-1,n._forceStartLoad=!1,n.altAudio=!1,n.audioOnly=!1,n.fragPlaying=null,n.onvplaying=null,n.onvseeked=null,n.fragLastKbps=0,n.stalled=!1,n.couldBacktrack=!1,n.audioCodecSwitch=!1,n.videoBuffer=null,n._registerListeners(),n}var p=m.prototype;return p._registerListeners=function(){var y=this.hls;y.on(A.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.on(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.on(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.on(A.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(A.Events.LEVEL_LOADING,this.onLevelLoading,this),y.on(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.on(A.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),y.on(A.Events.ERROR,this.onError,this),y.on(A.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),y.on(A.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.on(A.Events.BUFFER_CREATED,this.onBufferCreated,this),y.on(A.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),y.on(A.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),y.on(A.Events.FRAG_BUFFERED,this.onFragBuffered,this)},p._unregisterListeners=function(){var y=this.hls;y.off(A.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.off(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.off(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.off(A.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.off(A.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),y.off(A.Events.ERROR,this.onError,this),y.off(A.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),y.off(A.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.off(A.Events.BUFFER_CREATED,this.onBufferCreated,this),y.off(A.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),y.off(A.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),y.off(A.Events.FRAG_BUFFERED,this.onFragBuffered,this)},p.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},p.startLoad=function(y){if(this.levels){var n=this.lastCurrentTime,x=this.hls;if(this.stopLoad(),this.setInterval(d),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var S=x.startLevel;S===-1&&(x.config.testBandwidth?(S=0,this.bitrateTest=!0):S=x.nextAutoLevel),this.level=x.nextLoadLevel=S,this.loadedmetadata=!1}n>0&&y===-1&&(this.log("Override startPosition with lastCurrentTime @"+n.toFixed(3)),y=n),this.state=L.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=y,this.tick()}else this._forceStartLoad=!0,this.state=L.State.STOPPED},p.stopLoad=function(){this._forceStartLoad=!1,g.prototype.stopLoad.call(this)},p.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_LEVEL:{var y,n=this.levels,x=this.level,S=n==null||((y=n[x])===null||y===void 0)?void 0:y.details;if(S&&(!S.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(S))break;this.state=L.State.IDLE;break}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var T,R=self.performance.now(),D=this.retryDate;(!D||R>=D||(T=this.media)!==null&&T!==void 0&&T.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=L.State.IDLE)}break;default:break}this.onTickEnd()},p.onTickEnd=function(){g.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},p.doTickIdle=function(){var y,n,x=this.hls,S=this.levelLastLoaded,T=this.levels,R=this.media,D=x.config,I=x.nextLoadLevel;if(S===null||!R&&(this.startFragRequested||!D.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!T||!T[I])return;var B=T[I];this.level=x.nextLoadLevel=I;var G=B.details;if(!G||this.state===L.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==I){this.state=L.State.WAITING_LEVEL;return}var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:R,u.PlaylistLevelType.MAIN);if(k===null)return;var $=k.len,X=this.getMaxBufferLength(B.maxBitrate);if($>=X)return;if(this._streamEnded(k,G)){var V={};this.altAudio&&(V.type="video"),this.hls.trigger(A.Events.BUFFER_EOS,V),this.state=L.State.ENDED;return}var N=k.end,z=this.getNextFragment(N,G);if(this.couldBacktrack&&!this.fragPrevious&&z&&z.sn!=="initSegment"){var q=z.sn-G.startSN;q>1&&(z=G.fragments[q-1],this.fragmentTracker.removeFragment(z))}if(z&&this.fragmentTracker.getState(z)===v.FragmentState.OK&&this.nextLoadPosition>N){var ee=this.audioOnly&&!this.altAudio?h.ElementaryStreamTypes.AUDIO:h.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(R,ee,u.PlaylistLevelType.MAIN),z=this.getNextFragment(this.nextLoadPosition,G)}if(!z)return;z.initSegment&&!z.initSegment.data&&!this.bitrateTest&&(z=z.initSegment),((y=z.decryptdata)===null||y===void 0?void 0:y.keyFormat)==="identity"&&!((n=z.decryptdata)!==null&&n!==void 0&&n.key)?this.loadKey(z,G):this.loadFragment(z,G,N)},p.loadFragment=function(y,n,x){var S,T=this.fragmentTracker.getState(y);if(this.fragCurrent=y,T===v.FragmentState.BACKTRACKED){var R=this.fragmentTracker.getBacktrackData(y);if(R){this._handleFragmentLoadProgress(R),this._handleFragmentLoadComplete(R);return}else T=v.FragmentState.NOT_LOADED}T===v.FragmentState.NOT_LOADED||T===v.FragmentState.PARTIAL?y.sn==="initSegment"?this._loadInitSegment(y):this.bitrateTest?(y.bitrateTest=!0,this.log("Fragment "+y.sn+" of level "+y.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(y)):(this.startFragRequested=!0,g.prototype.loadFragment.call(this,y,n,x)):T===v.FragmentState.APPENDING?this.reduceMaxBufferLength(y.duration)&&this.fragmentTracker.removeFragment(y):((S=this.media)===null||S===void 0?void 0:S.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},p.getAppendedFrag=function(y){var n=this.fragmentTracker.getAppendedFrag(y,u.PlaylistLevelType.MAIN);return n&&"fragment"in n?n.fragment:n},p.getBufferedFrag=function(y){return this.fragmentTracker.getBufferedFrag(y,u.PlaylistLevelType.MAIN)},p.followingBufferedFrag=function(y){return y?this.getBufferedFrag(y.end+.5):null},p.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},p.nextLevelSwitch=function(){var y=this.levels,n=this.media;if(n!=null&&n.readyState){var x,S=this.getAppendedFrag(n.currentTime);if(S&&S.start>1&&this.flushMainBuffer(0,S.start-1),!n.paused&&y){var T=this.hls.nextLoadLevel,R=y[T],D=this.fragLastKbps;D&&this.fragCurrent?x=this.fragCurrent.duration*R.maxBitrate/(1e3*D)+1:x=0}else x=0;var I=this.getBufferedFrag(n.currentTime+x);if(I){var B=this.followingBufferedFrag(I);if(B){this.abortCurrentFrag();var G=B.maxStartPTS?B.maxStartPTS:B.start,k=B.duration,$=Math.max(I.end,G+Math.min(Math.max(k-this.config.maxFragLookUpTolerance,k*.5),k*.75));this.flushMainBuffer($,Number.POSITIVE_INFINITY)}}}},p.abortCurrentFrag=function(){var y=this.fragCurrent;this.fragCurrent=null,y!=null&&y.loader&&y.loader.abort(),this.state===L.State.KEY_LOADING&&(this.state=L.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},p.flushMainBuffer=function(y,n){g.prototype.flushMainBuffer.call(this,y,n,this.altAudio?"video":null)},p.onMediaAttached=function(y,n){g.prototype.onMediaAttached.call(this,y,n);var x=n.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),x.addEventListener("playing",this.onvplaying),x.addEventListener("seeked",this.onvseeked),this.gapController=new i.default(this.config,x,this.fragmentTracker,this.hls)},p.onMediaDetaching=function(){var y=this.media;y&&(y.removeEventListener("playing",this.onvplaying),y.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),g.prototype.onMediaDetaching.call(this)},p.onMediaPlaying=function(){this.tick()},p.onMediaSeeked=function(){var y=this.media,n=y?y.currentTime:null;Object(b.isFiniteNumber)(n)&&this.log("Media seeked to "+n.toFixed(3)),this.tick()},p.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(A.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},p.onManifestParsed=function(y,n){var x=!1,S=!1,T;n.levels.forEach(function(R){T=R.audioCodec,T&&(T.indexOf("mp4a.40.2")!==-1&&(x=!0),T.indexOf("mp4a.40.5")!==-1&&(S=!0))}),this.audioCodecSwitch=x&&S&&!Object(E.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=n.levels,this.startFragRequested=!1},p.onLevelLoading=function(y,n){var x=this.levels;if(!x||this.state!==L.State.IDLE)return;var S=x[n.level];(!S.details||S.details.live&&this.levelLastLoaded!==n.level||this.waitForCdnTuneIn(S.details))&&(this.state=L.State.WAITING_LEVEL)},p.onLevelLoaded=function(y,n){var x,S=this.levels,T=n.level,R=n.details,D=R.totalduration;if(!S){this.warn("Levels were reset while loading level "+T);return}this.log("Level "+T+" loaded ["+R.startSN+","+R.endSN+"], cc ["+R.startCC+", "+R.endCC+"] duration:"+D);var I=this.fragCurrent;I&&(this.state===L.State.FRAG_LOADING||this.state===L.State.FRAG_LOADING_WAITING_RETRY)&&(I.level!==n.level&&I.loader&&(this.state=L.State.IDLE,I.loader.abort()));var B=S[T],G=0;if(R.live||(x=B.details)!==null&&x!==void 0&&x.live){if(R.fragments[0]||(R.deltaUpdateFailed=!0),R.deltaUpdateFailed)return;G=this.alignPlaylists(R,B.details)}if(B.details=R,this.levelLastLoaded=T,this.hls.trigger(A.Events.LEVEL_UPDATED,{details:R,level:T}),this.state===L.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(R))return;this.state=L.State.IDLE}this.startFragRequested?R.live&&this.synchronizeToLiveEdge(R):this.setStartPosition(R,G),this.tick()},p._handleFragmentLoadProgress=function(y){var n,x=y.frag,S=y.part,T=y.payload,R=this.levels;if(!R){this.warn("Levels were reset while fragment load was in progress. Fragment "+x.sn+" of level "+x.level+" will not be buffered");return}var D=R[x.level],I=D.details;if(!I){this.warn("Dropping fragment "+x.sn+" of level "+x.level+" after level details were reset");return}var B=D.videoCodec,G=I.PTSKnown||!I.live,k=(n=x.initSegment)===null||n===void 0?void 0:n.data,$=this._getAudioCodec(D),X=this.transmuxer=this.transmuxer||new a.default(this.hls,u.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),V=S?S.index:-1,N=V!==-1,z=new t.ChunkMetadata(x.level,x.sn,x.stats.chunkCount,T.byteLength,V,N),q=this.initPTS[x.cc];X.push(T,k,$,B,x,S,I.totalduration,G,z,q)},p.onAudioTrackSwitching=function(y,n){var x=this.altAudio,S=!!n.url,T=n.id;if(!S){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var R=this.fragCurrent;R!=null&&R.loader&&(this.log("Switching to main audio track, cancel main fragment load"),R.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var D=this.hls;x&&D.trigger(A.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),D.trigger(A.Events.AUDIO_TRACK_SWITCHED,{id:T})}},p.onAudioTrackSwitched=function(y,n){var x=n.id,S=!!this.hls.audioTracks[x].url;if(S){var T=this.videoBuffer;T&&this.mediaBuffer!==T&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=T)}this.altAudio=S,this.tick()},p.onBufferCreated=function(y,n){var x=n.tracks,S,T,R=!1;for(var D in x){var I=x[D];if(I.id==="main"){if(T=D,S=I,D==="video"){var B=x[D];B&&(this.videoBuffer=B.buffer)}}else R=!0}R&&S?(this.log("Alternate track found, use "+T+".buffered to schedule main fragment loading"),this.mediaBuffer=S.buffer):this.mediaBuffer=this.media},p.onFragBuffered=function(y,n){var x=n.frag,S=n.part;if(x&&x.type!==u.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(x)){this.warn("Fragment "+x.sn+(S?" p: "+S.index:"")+" of level "+x.level+" finished buffering, but was aborted. state: "+this.state),this.state===L.State.PARSED&&(this.state=L.State.IDLE);return}var T=S?S.stats:x.stats;this.fragLastKbps=Math.round(8*T.total/(T.buffering.end-T.loading.first)),x.sn!=="initSegment"&&(this.fragPrevious=x),this.fragBufferedComplete(x,S)},p.onError=function(y,n){switch(n.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(u.PlaylistLevelType.MAIN,n);break;case l.ErrorDetails.LEVEL_LOAD_ERROR:case l.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==L.State.ERROR&&(n.fatal?(this.warn(""+n.details),this.state=L.State.ERROR):!n.levelRetry&&this.state===L.State.WAITING_LEVEL&&(this.state=L.State.IDLE));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(n.parent==="main"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var x=!0,S=this.getFwdBufferInfo(this.media,u.PlaylistLevelType.MAIN);S&&S.len>.5&&(x=!this.reduceMaxBufferLength(S.len)),x&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},p.checkBuffer=function(){var y=this.media,n=this.gapController;if(!y||!n||!y.readyState)return;var x=w.BufferHelper.getBuffered(y);!this.loadedmetadata&&x.length?(this.loadedmetadata=!0,this.seekToStartPos()):n.poll(this.lastCurrentTime),this.lastCurrentTime=y.currentTime},p.onFragLoadEmergencyAborted=function(){this.state=L.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},p.onBufferFlushed=function(y,n){var x=n.type;if(x!==h.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var S=(x===h.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(S,x,u.PlaylistLevelType.MAIN)}},p.onLevelsUpdated=function(y,n){this.levels=n.levels},p.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},p.seekToStartPos=function(){var y=this.media,n=y.currentTime,x=this.startPosition;if(x>=0&&n<x){if(y.seeking){c.logger.log("could not seek to "+x+", already seeking at "+n);return}var S=w.BufferHelper.getBuffered(y),T=S.length?S.start(0):0,R=T-x;R>0&&(R<this.config.maxBufferHole||R<this.config.maxFragLookUpTolerance)&&(c.logger.log("adjusting start position by "+R+" to match buffer start"),x+=R,this.startPosition=x),this.log("seek to target start position "+x+" from current time "+n),y.currentTime=x}},p._getAudioCodec=function(y){var n=this.config.defaultAudioCodec||y.audioCodec;return this.audioCodecSwap&&n&&(this.log("Swapping audio codec"),n.indexOf("mp4a.40.5")!==-1?n="mp4a.40.2":n="mp4a.40.5"),n},p._loadBitrateTestFrag=function(y){var n=this;this._doFragLoad(y).then(function(x){var S=n.hls;if(!x||S.nextLoadLevel||n.fragContextChanged(y))return;n.fragLoadError=0,n.state=L.State.IDLE,n.startFragRequested=!1,n.bitrateTest=!1;var T=y.stats;T.parsing.start=T.parsing.end=T.buffering.start=T.buffering.end=self.performance.now(),S.trigger(A.Events.FRAG_LOADED,x)})},p._handleTransmuxComplete=function(y){var n,x="main",S=this.hls,T=y.remuxResult,R=y.chunkMeta,D=this.getCurrentContext(R);if(!D){this.warn("The loading context changed while buffering fragment "+R.sn+" of level "+R.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(R.level);return}var I=D.frag,B=D.part,G=D.level,k=T.video,$=T.text,X=T.id3,V=T.initSegment,N=this.altAudio?void 0:T.audio;if(this.fragContextChanged(I))return;if(this.state=L.State.PARSING,V){V.tracks&&(this._bufferInitSegment(G,V.tracks,I,R),S.trigger(A.Events.FRAG_PARSING_INIT_SEGMENT,{frag:I,id:x,tracks:V.tracks}));var z=V.initPTS,q=V.timescale;Object(b.isFiniteNumber)(z)&&(this.initPTS[I.cc]=z,S.trigger(A.Events.INIT_PTS_FOUND,{frag:I,id:x,initPTS:z,timescale:q}))}if(k&&T.independent!==!1){if(G.details){var ee=k.startPTS,fe=k.endPTS,ae=k.startDTS,pe=k.endDTS;if(B)B.elementaryStreams[k.type]={startPTS:ee,endPTS:fe,startDTS:ae,endDTS:pe};else if(k.firstKeyFrame&&k.independent&&(this.couldBacktrack=!0),k.dropped&&k.independent){var se=this.getLoadPosition()+this.config.maxBufferHole;if(se<ee){this.backtrack(I);return}I.setElementaryStreamInfo(k.type,I.start,fe,I.start,pe,!0)}I.setElementaryStreamInfo(k.type,ee,fe,ae,pe),this.bufferFragmentData(k,I,B,R)}}else if(T.independent===!1){this.backtrack(I);return}if(N){var ge=N.startPTS,ie=N.endPTS,te=N.startDTS,Q=N.endDTS;B&&(B.elementaryStreams[h.ElementaryStreamTypes.AUDIO]={startPTS:ge,endPTS:ie,startDTS:te,endDTS:Q}),I.setElementaryStreamInfo(h.ElementaryStreamTypes.AUDIO,ge,ie,te,Q),this.bufferFragmentData(N,I,B,R)}if(X!=null&&(n=X.samples)!==null&&n!==void 0&&n.length){var me={frag:I,id:x,samples:X.samples};S.trigger(A.Events.FRAG_PARSING_METADATA,me)}if($){var re={frag:I,id:x,samples:$.samples};S.trigger(A.Events.FRAG_PARSING_USERDATA,re)}},p._bufferInitSegment=function(y,n,x,S){var T=this;if(this.state!==L.State.PARSING)return;this.audioOnly=!!n.audio&&!n.video,this.altAudio&&!this.audioOnly&&delete n.audio;var R=n.audio,D=n.video,I=n.audiovideo;if(R){var B=y.audioCodec,G=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(B&&(B.indexOf("mp4a.40.5")!==-1?B="mp4a.40.2":B="mp4a.40.5"),R.metadata.channelCount!==1&&G.indexOf("firefox")===-1&&(B="mp4a.40.5")),G.indexOf("android")!==-1&&R.container!=="audio/mpeg"&&(B="mp4a.40.2",this.log("Android: force audio codec to "+B)),y.audioCodec&&y.audioCodec!==B&&this.log('Swapping manifest audio codec "'+y.audioCodec+'" for "'+B+'"'),R.levelCodec=B,R.id="main",this.log("Init audio buffer, container:"+R.container+", codecs[selected/level/parsed]=["+(B||"")+"/"+(y.audioCodec||"")+"/"+R.codec+"]")}D&&(D.levelCodec=y.videoCodec,D.id="main",this.log("Init video buffer, container:"+D.container+", codecs[level/parsed]=["+(y.videoCodec||"")+"/"+D.codec+"]")),I&&this.log("Init audiovideo buffer, container:"+I.container+", codecs[level/parsed]=["+(y.attrs.CODECS||"")+"/"+I.codec+"]"),this.hls.trigger(A.Events.BUFFER_CODECS,n),Object.keys(n).forEach(function(k){var $=n[k],X=$.initSegment;X!=null&&X.byteLength&&T.hls.trigger(A.Events.BUFFER_APPENDING,{type:k,data:X,frag:x,part:null,chunkMeta:S,parent:x.type})}),this.tick()},p.backtrack=function(y){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(y);var n=this.fragmentTracker.backtrack(y);this.fragPrevious=null,this.nextLoadPosition=y.start,n?this.resetFragmentLoading(y):this.state=L.State.BACKTRACKING},p.checkFragmentChanged=function(){var y=this.media,n=null;if(y&&y.readyState>1&&y.seeking===!1){var x=y.currentTime;if(w.BufferHelper.isBuffered(y,x)?n=this.getAppendedFrag(x):w.BufferHelper.isBuffered(y,x+.1)&&(n=this.getAppendedFrag(x+.1)),n){var S=this.fragPlaying,T=n.level;(!S||n.sn!==S.sn||S.level!==T||n.urlId!==S.urlId)&&(this.hls.trigger(A.Events.FRAG_CHANGED,{frag:n}),(!S||S.level!==T)&&this.hls.trigger(A.Events.LEVEL_SWITCHED,{level:T}),this.fragPlaying=n)}}},e(m,[{key:"nextLevel",get:function(){var y=this.nextBufferedFrag;return y?y.level:-1}},{key:"currentLevel",get:function(){var y=this.media;if(y){var n=this.getAppendedFrag(y.currentTime);if(n)return n.level}return-1}},{key:"nextBufferedFrag",get:function(){var y=this.media;if(y){var n=this.getAppendedFrag(y.currentTime);return this.followingBufferedFrag(n)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),m}(L.default)},"./src/controller/subtitle-stream-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"SubtitleStreamController",function(){return s});var b=U("./src/events.ts"),L=U("./src/utils/logger.ts"),E=U("./src/utils/buffer-helper.ts"),A=U("./src/controller/fragment-finders.ts"),w=U("./src/utils/discontinuities.ts"),v=U("./src/controller/level-helper.ts"),u=U("./src/controller/fragment-tracker.ts"),h=U("./src/controller/base-stream-controller.ts"),a=U("./src/types/loader.ts"),t=U("./src/types/level.ts");function i(r,d){for(var f=0;f<d.length;f++){var g=d[f];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(r,g.key,g)}}function l(r,d,f){return d&&i(r.prototype,d),f&&i(r,f),r}function c(r,d){r.prototype=Object.create(d.prototype),r.prototype.constructor=r,o(r,d)}function o(r,d){return o=Object.setPrototypeOf||function(g,m){return g.__proto__=m,g},o(r,d)}var e=500,s=function(r){c(d,r);function d(g,m){var p;return p=r.call(this,g,m,"[subtitle-stream-controller]")||this,p.levels=[],p.currentTrackId=-1,p.tracksBuffered=[],p.mainDetails=null,p._registerListeners(),p}var f=d.prototype;return f.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},f._registerListeners=function(){var m=this.hls;m.on(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.on(b.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(b.Events.ERROR,this.onError,this),m.on(b.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),m.on(b.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),m.on(b.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),m.on(b.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),m.on(b.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},f._unregisterListeners=function(){var m=this.hls;m.off(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.off(b.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(b.Events.ERROR,this.onError,this),m.off(b.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),m.off(b.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),m.off(b.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),m.off(b.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),m.off(b.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},f.startLoad=function(){this.stopLoad(),this.state=h.State.IDLE,this.setInterval(e),this.tick()},f.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},f.onLevelLoaded=function(m,p){this.mainDetails=p.details},f.onSubtitleFragProcessed=function(m,p){var _=p.frag,y=p.success;if(this.fragPrevious=_,this.state=h.State.IDLE,!y)return;var n=this.tracksBuffered[this.currentTrackId];if(!n)return;for(var x,S=_.start,T=0;T<n.length;T++)if(S>=n[T].start&&S<=n[T].end){x=n[T];break}var R=_.start+_.duration;x?x.end=R:(x={start:S,end:R},n.push(x)),this.fragmentTracker.fragBuffered(_)},f.onBufferFlushing=function(m,p){var _=p.startOffset,y=p.endOffset;if(_===0&&y!==Number.POSITIVE_INFINITY){var n=this.currentTrackId,x=this.levels;if(!x.length||!x[n]||!x[n].details)return;var S=x[n].details,T=S.targetduration,R=y-T;if(R<=0)return;p.endOffsetSubtitles=Math.max(0,R),this.tracksBuffered.forEach(function(D){for(var I=0;I<D.length;){if(D[I].end<=R){D.shift();continue}else if(D[I].start<R)D[I].start=R;else break;I++}}),this.fragmentTracker.removeFragmentsInRange(_,R,a.PlaylistLevelType.SUBTITLE)}},f.onError=function(m,p){var _,y=p.frag;if(!y||y.type!==a.PlaylistLevelType.SUBTITLE)return;(_=this.fragCurrent)!==null&&_!==void 0&&_.loader&&this.fragCurrent.loader.abort(),this.state=h.State.IDLE},f.onSubtitleTracksUpdated=function(m,p){var _=this,y=p.subtitleTracks;this.tracksBuffered=[],this.levels=y.map(function(n){return new t.Level(n)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(n){_.tracksBuffered[n.id]=[]}),this.mediaBuffer=null},f.onSubtitleTrackSwitch=function(m,p){if(this.currentTrackId=p.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var _=this.levels[this.currentTrackId];_!=null&&_.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,_&&this.setInterval(e)},f.onSubtitleTrackLoaded=function(m,p){var _,y=p.details,n=p.id,x=this.currentTrackId,S=this.levels;if(!S.length)return;var T=S[x];if(n>=S.length||n!==x||!T)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,y.live||(_=T.details)!==null&&_!==void 0&&_.live){var R=this.mainDetails;if(y.deltaUpdateFailed||!R)return;var D=R.fragments[0];if(!T.details)y.hasProgramDateTime&&R.hasProgramDateTime?Object(w.alignMediaPlaylistByPDT)(y,R):D&&Object(v.addSliding)(y,D.start);else{var I=this.alignPlaylists(y,T.details);I===0&&D&&Object(v.addSliding)(y,D.start)}}if(T.details=y,this.levelLastLoaded=n,this.tick(),y.live&&!this.fragCurrent&&this.media&&this.state===h.State.IDLE){var B=Object(A.findFragmentByPTS)(null,y.fragments,this.media.currentTime,0);B||(this.warn("Subtitle playlist not aligned with playback"),T.details=void 0)}},f._handleFragmentLoadComplete=function(m){var p=m.frag,_=m.payload,y=p.decryptdata,n=this.hls;if(this.fragContextChanged(p))return;if(_&&_.byteLength>0&&y&&y.key&&y.iv&&y.method==="AES-128"){var x=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(_),y.key.buffer,y.iv.buffer).then(function(S){var T=performance.now();n.trigger(b.Events.FRAG_DECRYPTED,{frag:p,payload:S,stats:{tstart:x,tdecrypt:T}})})}},f.doTick=function(){if(!this.media){this.state=h.State.IDLE;return}if(this.state===h.State.IDLE){var m,p=this.currentTrackId,_=this.levels;if(!_.length||!_[p]||!_[p].details)return;var y=_[p].details,n=y.targetduration,x=this.config,S=this.media,T=E.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,S.currentTime-n,x.maxBufferHole),R=T.end,D=T.len,I=this.getMaxBufferLength()+n;if(D>I)return;console.assert(y,"Subtitle track details are defined on idle subtitle stream controller tick");var B=y.fragments,G=B.length,k=y.edge,$,X=this.fragPrevious;if(R<k){var V=x.maxFragLookUpTolerance;X&&y.hasProgramDateTime&&($=Object(A.findFragmentByPDT)(B,X.endProgramDateTime,V)),$||($=Object(A.findFragmentByPTS)(X,B,R,V),!$&&X&&X.start<B[0].start&&($=B[0]))}else $=B[G-1];(m=$)!==null&&m!==void 0&&m.encrypted?(L.logger.log("Loading key for "+$.sn),this.state=h.State.KEY_LOADING,this.hls.trigger(b.Events.KEY_LOADING,{frag:$})):$&&this.fragmentTracker.getState($)===u.FragmentState.NOT_LOADED&&this.loadFragment($,y,R)}},f.loadFragment=function(m,p,_){this.fragCurrent=m,r.prototype.loadFragment.call(this,m,p,_)},l(d,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),d}(h.default)},"./src/controller/subtitle-track-controller.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/events.ts"),L=U("./src/utils/texttrack-utils.ts"),E=U("./src/controller/base-playlist-controller.ts"),A=U("./src/types/loader.ts");function w(i,l){for(var c=0;c<l.length;c++){var o=l[c];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(i,o.key,o)}}function v(i,l,c){return l&&w(i.prototype,l),c&&w(i,c),i}function u(i,l){i.prototype=Object.create(l.prototype),i.prototype.constructor=i,h(i,l)}function h(i,l){return h=Object.setPrototypeOf||function(o,e){return o.__proto__=e,o},h(i,l)}var a=function(i){u(l,i);function l(o){var e;return e=i.call(this,o,"[subtitle-track-controller]")||this,e.media=null,e.tracks=[],e.groupId=null,e.tracksInGroup=[],e.trackId=-1,e.selectDefaultTrack=!0,e.queuedDefaultTrack=-1,e.trackChangeListener=function(){return e.onTextTracksChanged()},e.asyncPollTrackChange=function(){return e.pollTrackChange(0)},e.useTextTrackPolling=!1,e.subtitlePollingInterval=-1,e.subtitleDisplay=!0,e.registerListeners(),e}var c=l.prototype;return c.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,i.prototype.destroy.call(this)},c.registerListeners=function(){var e=this.hls;e.on(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(b.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(b.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(b.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(b.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){var e=this.hls;e.off(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(b.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(b.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(b.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(b.Events.ERROR,this.onError,this)},c.onMediaAttached=function(e,s){if(this.media=s.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},c.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},c.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var e=t(this.media.textTracks);e.forEach(function(s){Object(L.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},c.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},c.onManifestParsed=function(e,s){this.tracks=s.subtitleTracks},c.onSubtitleTrackLoaded=function(e,s){var r=s.id,d=s.details,f=this.trackId,g=this.tracksInGroup[f];if(!g){this.warn("Invalid subtitle track id "+r);return}var m=g.details;g.details=s.details,this.log("subtitle track "+r+" loaded ["+d.startSN+"-"+d.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,s,m))},c.onLevelLoading=function(e,s){this.switchLevel(s.level)},c.onLevelSwitching=function(e,s){this.switchLevel(s.level)},c.switchLevel=function(e){var s=this.hls.levels[e];if(!(s!=null&&s.textGroupIds))return;var r=s.textGroupIds[s.urlId];if(this.groupId!==r){var d=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,f=this.tracks.filter(function(p){return!r||p.groupId===r});this.tracksInGroup=f;var g=this.findTrackId(d==null?void 0:d.name)||this.findTrackId();this.groupId=r;var m={subtitleTracks:f};this.log("Updating subtitle tracks, "+f.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(b.Events.SUBTITLE_TRACKS_UPDATED,m),g!==-1&&this.setSubtitleTrack(g,d)}},c.findTrackId=function(e){for(var s=this.tracksInGroup,r=0;r<s.length;r++){var d=s[r];if((!this.selectDefaultTrack||d.default)&&(!e||e===d.name))return d.id}return-1},c.onError=function(e,s){if(i.prototype.onError.call(this,e,s),s.fatal||!s.context)return;s.context.type===A.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},c.loadPlaylist=function(e){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var r=s.id,d=s.groupId,f=s.url;if(e)try{f=e.addDirectives(f)}catch(g){this.warn("Could not construct new URL with HLS Delivery Directives: "+g)}this.log("Loading subtitle playlist for id "+r),this.hls.trigger(b.Events.SUBTITLE_TRACK_LOADING,{url:f,id:r,groupId:d,deliveryDirectives:e||null})}},c.toggleTrackModes=function(e){var s=this,r=this.media,d=this.subtitleDisplay,f=this.trackId;if(!r)return;var g=t(r.textTracks),m=g.filter(function(y){return y.groupId===s.groupId});if(e===-1)[].slice.call(g).forEach(function(y){y.mode="disabled"});else{var p=m[f];p&&(p.mode="disabled")}var _=m[e];_&&(_.mode=d?"showing":"hidden")},c.setSubtitleTrack=function(e,s){var r,d=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(e===-1||(r=d[e])!==null&&r!==void 0&&r.details)||e<-1||e>=d.length)return;this.clearTimer();var f=d[e];if(this.log("Switching to subtitle track "+e),this.trackId=e,f){var g=f.id,m=f.groupId,p=m===void 0?"":m,_=f.name,y=f.type,n=f.url;this.hls.trigger(b.Events.SUBTITLE_TRACK_SWITCH,{id:g,groupId:p,name:_,type:y,url:n});var x=this.switchParams(f.url,s==null?void 0:s.details);this.loadPlaylist(x)}else this.hls.trigger(b.Events.SUBTITLE_TRACK_SWITCH,{id:e})},c.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var e=-1,s=t(this.media.textTracks),r=0;r<s.length;r++)if(s[r].mode==="hidden")e=r;else if(s[r].mode==="showing"){e=r;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)},v(l,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,s)}}]),l}(E.default);function t(i){for(var l=[],c=0;c<i.length;c++){var o=i[c];o.kind==="subtitles"&&o.label&&l.push(i[c])}return l}Z.default=a},"./src/controller/timeline-controller.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"TimelineController",function(){return t});var b=U("./src/polyfills/number.ts"),L=U("./src/events.ts"),E=U("./src/utils/cea-608-parser.ts"),A=U("./src/utils/output-filter.ts"),w=U("./src/utils/webvtt-parser.ts"),v=U("./src/utils/texttrack-utils.ts"),u=U("./src/utils/imsc1-ttml-parser.ts"),h=U("./src/types/loader.ts"),a=U("./src/utils/logger.ts"),t=function(){function o(s){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=c(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var r=new A.default(this,"textTrack1"),d=new A.default(this,"textTrack2"),f=new A.default(this,"textTrack3"),g=new A.default(this,"textTrack4");this.cea608Parser1=new E.default(1,r,d),this.cea608Parser2=new E.default(3,f,g)}s.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(L.Events.FRAG_LOADING,this.onFragLoading,this),s.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var e=o.prototype;return e.destroy=function(){var r=this.hls;r.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),r.off(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.off(L.Events.FRAG_LOADING,this.onFragLoading,this),r.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),r.off(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.off(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),r.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.off(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},e.addCues=function(r,d,f,g,m){for(var p=!1,_=m.length;_--;){var y=m[_],n=l(y[0],y[1],d,f);if(n>=0&&(y[0]=Math.min(y[0],d),y[1]=Math.max(y[1],f),p=!0,n/(f-d)>.5))return}if(p||m.push([d,f]),this.config.renderTextTracksNatively){var x=this.captionsTracks[r];this.Cues.newCue(x,d,f,g)}else{var S=this.Cues.newCue(null,d,f,g);this.hls.trigger(L.Events.CUES_PARSED,{type:"captions",cues:S,track:r})}},e.onInitPtsFound=function(r,d){var f=this,g=d.frag,m=d.id,p=d.initPTS,_=d.timescale,y=this.unparsedVttFrags;m==="main"&&(this.initPTS[g.cc]=p,this.timescale[g.cc]=_),y.length&&(this.unparsedVttFrags=[],y.forEach(function(n){f.onFragLoaded(L.Events.FRAG_LOADED,n)}))},e.getExistingTrack=function(r){var d=this.media;if(d)for(var f=0;f<d.textTracks.length;f++){var g=d.textTracks[f];if(g[r])return g}return null},e.createCaptionsTrack=function(r){this.config.renderTextTracksNatively?this.createNativeTrack(r):this.createNonNativeTrack(r)},e.createNativeTrack=function(r){if(this.captionsTracks[r])return;var d=this.captionsProperties,f=this.captionsTracks,g=this.media,m=d[r],p=m.label,_=m.languageCode,y=this.getExistingTrack(r);if(y)f[r]=y,Object(v.clearCurrentCues)(f[r]),Object(v.sendAddTrackEvent)(f[r],g);else{var n=this.createTextTrack("captions",p,_);n&&(n[r]=!0,f[r]=n)}},e.createNonNativeTrack=function(r){if(this.nonNativeCaptionsTracks[r])return;var d=this.captionsProperties[r];if(!d)return;var f=d.label,g={_id:r,label:f,kind:"captions",default:d.media?!!d.media.default:!1,closedCaptions:d.media};this.nonNativeCaptionsTracks[r]=g,this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[g]})},e.createTextTrack=function(r,d,f){var g=this.media;return g?g.addTextTrack(r,d,f):void 0},e.onMediaAttaching=function(r,d){this.media=d.media,this._cleanTracks()},e.onMediaDetaching=function(){var r=this.captionsTracks;Object.keys(r).forEach(function(d){Object(v.clearCurrentCues)(r[d]),delete r[d]}),this.nonNativeCaptionsTracks={}},e.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=c(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},e._cleanTracks=function(){var r=this.media;if(!r)return;var d=r.textTracks;if(d)for(var f=0;f<d.length;f++)Object(v.clearCurrentCues)(d[f])},e.onSubtitleTracksUpdated=function(r,d){var f=this;this.textTracks=[];var g=d.subtitleTracks||[],m=g.some(function(n){return n.textCodec===u.IMSC1_CODEC});if(this.config.enableWebVTT||m&&this.config.enableIMSC1){var p=this.tracks&&g&&this.tracks.length===g.length;if(this.tracks=g||[],this.config.renderTextTracksNatively){var _=this.media?this.media.textTracks:[];this.tracks.forEach(function(n,x){var S;if(x<_.length){for(var T=null,R=0;R<_.length;R++)if(i(_[R],n)){T=_[R];break}T&&(S=T)}S?Object(v.clearCurrentCues)(S):(S=f.createTextTrack("subtitles",n.name,n.lang),S&&(S.mode="disabled")),S&&(S.groupId=n.groupId,f.textTracks.push(S))})}else if(!p&&this.tracks&&this.tracks.length){var y=this.tracks.map(function(n){return{label:n.name,kind:n.type.toLowerCase(),default:n.default,subtitleTrack:n}});this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:y})}}},e.onManifestLoaded=function(r,d){var f=this;this.config.enableCEA708Captions&&d.captions&&d.captions.forEach(function(g){var m=/(?:CC|SERVICE)([1-4])/.exec(g.instreamId);if(!m)return;var p="textTrack"+m[1],_=f.captionsProperties[p];if(!_)return;_.label=g.name,g.lang&&(_.languageCode=g.lang),_.media=g})},e.onFragLoading=function(r,d){var f=this.cea608Parser1,g=this.cea608Parser2,m=this.lastSn,p=this.lastPartIndex;if(!this.enabled||!(f&&g))return;if(d.frag.type===h.PlaylistLevelType.MAIN){var _,y,n=d.frag.sn,x=(_=d==null||((y=d.part)===null||y===void 0)?void 0:y.index)!=null?_:-1;n===m+1||n===m&&x===p+1||(f.reset(),g.reset()),this.lastSn=n,this.lastPartIndex=x}},e.onFragLoaded=function(r,d){var f=d.frag,g=d.payload,m=this.initPTS,p=this.unparsedVttFrags;if(f.type===h.PlaylistLevelType.SUBTITLE)if(g.byteLength){if(!Object(b.isFiniteNumber)(m[f.cc])){p.push(d),m.length&&this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:new Error("Missing initial subtitle PTS")});return}var _=f.decryptdata;if(_==null||_.key==null||_.method!=="AES-128"){var y=this.tracks[f.level],n=this.vttCCs;n[f.cc]||(n[f.cc]={start:f.start,prevCC:this.prevCC,new:!0},this.prevCC=f.cc),y&&y.textCodec===u.IMSC1_CODEC?this._parseIMSC1(f,g):this._parseVTTs(f,g,n)}}else this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:new Error("Empty subtitle payload")})},e._parseIMSC1=function(r,d){var f=this,g=this.hls;Object(u.parseIMSC1)(d,this.initPTS[r.cc],this.timescale[r.cc],function(m){f._appendCues(m,r.level),g.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},function(m){a.logger.log("Failed to parse IMSC1: "+m),g.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:m})})},e._parseVTTs=function(r,d,f){var g=this,m=this.hls;Object(w.parseWebVTT)(d,this.initPTS[r.cc],this.timescale[r.cc],f,r.cc,r.start,function(p){g._appendCues(p,r.level),m.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},function(p){g._fallbackToIMSC1(r,d),a.logger.log("Failed to parse VTT cue: "+p),m.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:p})})},e._fallbackToIMSC1=function(r,d){var f=this,g=this.tracks[r.level];g.textCodec||Object(u.parseIMSC1)(d,this.initPTS[r.cc],this.timescale[r.cc],function(){g.textCodec=u.IMSC1_CODEC,f._parseIMSC1(r,d)},function(){g.textCodec="wvtt"})},e._appendCues=function(r,d){var f=this.hls;if(this.config.renderTextTracksNatively){var g=this.textTracks[d];if(g.mode==="disabled")return;r.forEach(function(_){return Object(v.addCueToTrack)(g,_)})}else{var m=this.tracks[d],p=m.default?"default":"subtitles"+d;f.trigger(L.Events.CUES_PARSED,{type:"subtitles",cues:r,track:p})}},e.onFragDecrypted=function(r,d){var f=d.frag;if(f.type===h.PlaylistLevelType.SUBTITLE){if(!Object(b.isFiniteNumber)(this.initPTS[f.cc])){this.unparsedVttFrags.push(d);return}this.onFragLoaded(L.Events.FRAG_LOADED,d)}},e.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},e.onFragParsingUserdata=function(r,d){var f=this.cea608Parser1,g=this.cea608Parser2;if(!this.enabled||!(f&&g))return;for(var m=0;m<d.samples.length;m++){var p=d.samples[m].bytes;if(p){var _=this.extractCea608Data(p);f.addData(d.samples[m].pts,_[0]),g.addData(d.samples[m].pts,_[1])}}},e.onBufferFlushing=function(r,d){var f=d.startOffset,g=d.endOffset,m=d.endOffsetSubtitles,p=d.type,_=this.media;if(!_||_.currentTime<g)return;if(!p||p==="video"){var y=this.captionsTracks;Object.keys(y).forEach(function(x){return Object(v.removeCuesInRange)(y[x],f,g)})}if(this.config.renderTextTracksNatively&&(f===0&&m!==void 0)){var n=this.textTracks;Object.keys(n).forEach(function(x){return Object(v.removeCuesInRange)(n[x],f,m)})}},e.extractCea608Data=function(r){for(var d=r[0]&31,f=2,g=[[],[]],m=0;m<d;m++){var p=r[f++],_=127&r[f++],y=127&r[f++],n=(4&p)!==0,x=3&p;if(_===0&&y===0)continue;n&&((x===0||x===1)&&(g[x].push(_),g[x].push(y)))}return g},o}();function i(o,e){return o&&o.label===e.name&&!(o.textTrack1||o.textTrack2)}function l(o,e,s,r){return Math.min(e,r)-Math.max(o,s)}function c(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return b});var b=function(){function L(A,w){this.subtle=void 0,this.aesIV=void 0,this.subtle=A,this.aesIV=w}var E=L.prototype;return E.decrypt=function(w,v){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},v,w)},L}()},"./src/crypt/aes-decryptor.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"removePadding",function(){return L}),U.d(Z,"default",function(){return E});var b=U("./src/utils/typed-array.ts");function L(A){var w=A.byteLength,v=w&&new DataView(A.buffer).getUint8(w-1);return v?Object(b.sliceUint8)(A,0,w-v):A}var E=function(){function A(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var w=A.prototype;return w.uint8ArrayToUint32Array_=function(u){for(var h=new DataView(u),a=new Uint32Array(4),t=0;t<4;t++)a[t]=h.getUint32(t*4);return a},w.initTable=function(){var u=this.sBox,h=this.invSBox,a=this.subMix,t=a[0],i=a[1],l=a[2],c=a[3],o=this.invSubMix,e=o[0],s=o[1],r=o[2],d=o[3],f=new Uint32Array(256),g=0,m=0,p=0;for(p=0;p<256;p++)p<128?f[p]=p<<1:f[p]=p<<1^283;for(p=0;p<256;p++){var _=m^m<<1^m<<2^m<<3^m<<4;_=_>>>8^_&255^99,u[g]=_,h[_]=g;var y=f[g],n=f[y],x=f[n],S=f[_]*257^_*16843008;t[g]=S<<24|S>>>8,i[g]=S<<16|S>>>16,l[g]=S<<8|S>>>24,c[g]=S,S=x*16843009^n*65537^y*257^g*16843008,e[_]=S<<24|S>>>8,s[_]=S<<16|S>>>16,r[_]=S<<8|S>>>24,d[_]=S,g?(g=y^f[f[f[x^y]]],m^=f[f[m]]):g=m=1}},w.expandKey=function(u){for(var h=this.uint8ArrayToUint32Array_(u),a=!0,t=0;t<h.length&&a;)a=h[t]===this.key[t],t++;if(a)return;this.key=h;var i=this.keySize=h.length;if(i!==4&&i!==6&&i!==8)throw new Error("Invalid aes key size="+i);var l=this.ksRows=(i+6+1)*4,c,o,e=this.keySchedule=new Uint32Array(l),s=this.invKeySchedule=new Uint32Array(l),r=this.sBox,d=this.rcon,f=this.invSubMix,g=f[0],m=f[1],p=f[2],_=f[3],y,n;for(c=0;c<l;c++){if(c<i){y=e[c]=h[c];continue}n=y,c%i===0?(n=n<<8|n>>>24,n=r[n>>>24]<<24|r[n>>>16&255]<<16|r[n>>>8&255]<<8|r[n&255],n^=d[c/i|0]<<24):i>6&&c%i===4&&(n=r[n>>>24]<<24|r[n>>>16&255]<<16|r[n>>>8&255]<<8|r[n&255]),e[c]=y=(e[c-i]^n)>>>0}for(o=0;o<l;o++)c=l-o,o&3?n=e[c]:n=e[c-4],o<4||c<=4?s[o]=n:s[o]=g[r[n>>>24]]^m[r[n>>>16&255]]^p[r[n>>>8&255]]^_[r[n&255]],s[o]=s[o]>>>0},w.networkToHostOrderSwap=function(u){return u<<24|(u&65280)<<8|(u&16711680)>>8|u>>>24},w.decrypt=function(u,h,a){for(var t=this.keySize+6,i=this.invKeySchedule,l=this.invSBox,c=this.invSubMix,o=c[0],e=c[1],s=c[2],r=c[3],d=this.uint8ArrayToUint32Array_(a),f=d[0],g=d[1],m=d[2],p=d[3],_=new Int32Array(u),y=new Int32Array(_.length),n,x,S,T,R,D,I,B,G,k,$,X,V,N,z=this.networkToHostOrderSwap;h<_.length;){for(G=z(_[h]),k=z(_[h+1]),$=z(_[h+2]),X=z(_[h+3]),R=G^i[0],D=X^i[1],I=$^i[2],B=k^i[3],V=4,N=1;N<t;N++)n=o[R>>>24]^e[D>>16&255]^s[I>>8&255]^r[B&255]^i[V],x=o[D>>>24]^e[I>>16&255]^s[B>>8&255]^r[R&255]^i[V+1],S=o[I>>>24]^e[B>>16&255]^s[R>>8&255]^r[D&255]^i[V+2],T=o[B>>>24]^e[R>>16&255]^s[D>>8&255]^r[I&255]^i[V+3],R=n,D=x,I=S,B=T,V=V+4;n=l[R>>>24]<<24^l[D>>16&255]<<16^l[I>>8&255]<<8^l[B&255]^i[V],x=l[D>>>24]<<24^l[I>>16&255]<<16^l[B>>8&255]<<8^l[R&255]^i[V+1],S=l[I>>>24]<<24^l[B>>16&255]<<16^l[R>>8&255]<<8^l[D&255]^i[V+2],T=l[B>>>24]<<24^l[R>>16&255]<<16^l[D>>8&255]<<8^l[I&255]^i[V+3],y[h]=z(n^f),y[h+1]=z(T^g),y[h+2]=z(S^m),y[h+3]=z(x^p),f=G,g=k,m=$,p=X,h=h+4}return y.buffer},A}()},"./src/crypt/decrypter.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return h});var b=U("./src/crypt/aes-crypto.ts"),L=U("./src/crypt/fast-aes-key.ts"),E=U("./src/crypt/aes-decryptor.ts"),A=U("./src/utils/logger.ts"),w=U("./src/utils/mp4-tools.ts"),v=U("./src/utils/typed-array.ts"),u=16,h=function(){function a(i,l,c){var o=c===void 0?{}:c,e=o.removePKCS7Padding,s=e===void 0?!0:e;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=i,this.config=l,this.removePKCS7Padding=s,s)try{var r=self.crypto;r&&(this.subtle=r.subtle||r.webkitSubtle)}catch(d){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var t=a.prototype;return t.destroy=function(){this.observer=null},t.isSync=function(){return this.config.enableSoftwareAES},t.flush=function(){var l=this.currentResult;if(!l){this.reset();return}var c=new Uint8Array(l);return this.reset(),this.removePKCS7Padding?Object(E.removePadding)(c):c},t.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},t.decrypt=function(l,c,o,e){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(l),c,o);var s=this.flush();s&&e(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(l),c,o).then(e)},t.softwareDecrypt=function(l,c,o){var e=this.currentIV,s=this.currentResult,r=this.remainderData;this.logOnce("JS AES decrypt"),r&&(l=Object(w.appendUint8Array)(r,l),this.remainderData=null);var d=this.getValidChunk(l);if(!d.length)return null;e&&(o=e);var f=this.softwareDecrypter;f||(f=this.softwareDecrypter=new E.default),f.expandKey(c);var g=s;return this.currentResult=f.decrypt(d.buffer,0,o),this.currentIV=Object(v.sliceUint8)(d,-16).buffer,g||null},t.webCryptoDecrypt=function(l,c,o){var e=this,s=this.subtle;return(this.key!==c||!this.fastAesKey)&&(this.key=c,this.fastAesKey=new L.default(s,c)),this.fastAesKey.expandKey().then(function(r){if(!s)return Promise.reject(new Error("web crypto not initialized"));var d=new b.default(s,o);return d.decrypt(l.buffer,r)}).catch(function(r){return e.onWebCryptoError(r,l,c,o)})},t.onWebCryptoError=function(l,c,o,e){return A.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",l),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(c,o,e)},t.getValidChunk=function(l){var c=l,o=l.length-l.length%u;return o!==l.length&&(c=Object(v.sliceUint8)(l,0,o),this.remainderData=Object(v.sliceUint8)(l,o)),c},t.logOnce=function(l){if(!this.logEnabled)return;A.logger.log("[decrypter.ts]: "+l),this.logEnabled=!1},a}()},"./src/crypt/fast-aes-key.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return b});var b=function(){function L(A,w){this.subtle=void 0,this.key=void 0,this.subtle=A,this.key=w}var E=L.prototype;return E.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},L}()},"./src/demux/aacdemuxer.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/demux/base-audio-demuxer.ts"),L=U("./src/demux/adts.ts"),E=U("./src/utils/logger.ts"),A=U("./src/demux/id3.ts");function w(h,a){h.prototype=Object.create(a.prototype),h.prototype.constructor=h,v(h,a)}function v(h,a){return v=Object.setPrototypeOf||function(i,l){return i.__proto__=l,i},v(h,a)}var u=function(h){w(a,h);function a(i,l){var c;return c=h.call(this)||this,c.observer=void 0,c.config=void 0,c.observer=i,c.config=l,c}var t=a.prototype;return t.resetInitSegment=function(l,c,o){h.prototype.resetInitSegment.call(this,l,c,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:l,duration:o,inputTimeScale:9e4,dropped:0}},a.probe=function(l){if(!l)return!1;for(var c=A.getID3Data(l,0)||[],o=c.length,e=l.length;o<e;o++)if(L.probe(l,o))return E.logger.log("ADTS sync word found !"),!0;return!1},t.canParse=function(l,c){return L.canParse(l,c)},t.appendFrame=function(l,c,o){L.initTrackConfig(l,this.observer,c,o,l.manifestCodec);var e=L.appendFrame(l,c,o,this.initPTS,this.frameIndex);if(e&&e.missing===0)return e},a}(b.default);u.minProbeByteLength=9,Z.default=u},"./src/demux/adts.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"getAudioConfig",function(){return A}),U.d(Z,"isHeaderPattern",function(){return w}),U.d(Z,"getHeaderLength",function(){return v}),U.d(Z,"getFullFrameLength",function(){return u}),U.d(Z,"canGetFrameLength",function(){return h}),U.d(Z,"isHeader",function(){return a}),U.d(Z,"canParse",function(){return t}),U.d(Z,"probe",function(){return i}),U.d(Z,"initTrackConfig",function(){return l}),U.d(Z,"getFrameDuration",function(){return c}),U.d(Z,"parseFrameHeader",function(){return o}),U.d(Z,"appendFrame",function(){return e});var b=U("./src/utils/logger.ts"),L=U("./src/errors.ts"),E=U("./src/events.ts");function A(s,r,d,f){var g,m,p,_,y=navigator.userAgent.toLowerCase(),n=f,x=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];g=((r[d+2]&192)>>>6)+1;var S=(r[d+2]&60)>>>2;if(S>x.length-1){s.trigger(E.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+S});return}return p=(r[d+2]&1)<<2,p|=(r[d+3]&192)>>>6,b.logger.log("manifest codec:"+f+", ADTS type:"+g+", samplingIndex:"+S),/firefox/i.test(y)?S>=6?(g=5,_=new Array(4),m=S-3):(g=2,_=new Array(2),m=S):y.indexOf("android")!==-1?(g=2,_=new Array(2),m=S):(g=5,_=new Array(4),f&&(f.indexOf("mp4a.40.29")!==-1||f.indexOf("mp4a.40.5")!==-1)||!f&&S>=6?m=S-3:((f&&f.indexOf("mp4a.40.2")!==-1&&(S>=6&&p===1||/vivaldi/i.test(y))||!f&&p===1)&&(g=2,_=new Array(2)),m=S)),_[0]=g<<3,_[0]|=(S&14)>>1,_[1]|=(S&1)<<7,_[1]|=p<<3,g===5&&(_[1]|=(m&14)>>1,_[2]=(m&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:x[S],channelCount:p,codec:"mp4a.40."+g,manifestCodec:n}}function w(s,r){return s[r]===255&&(s[r+1]&246)===240}function v(s,r){return s[r+1]&1?7:9}function u(s,r){return(s[r+3]&3)<<11|s[r+4]<<3|(s[r+5]&224)>>>5}function h(s,r){return r+5<s.length}function a(s,r){return r+1<s.length&&w(s,r)}function t(s,r){return h(s,r)&&w(s,r)&&u(s,r)<=s.length-r}function i(s,r){if(a(s,r)){var d=v(s,r);if(r+d>=s.length)return!1;var f=u(s,r);if(f<=d)return!1;var g=r+f;return g===s.length||a(s,g)}return!1}function l(s,r,d,f,g){if(!s.samplerate){var m=A(r,d,f,g);if(!m)return;s.config=m.config,s.samplerate=m.samplerate,s.channelCount=m.channelCount,s.codec=m.codec,s.manifestCodec=m.manifestCodec,b.logger.log("parsed codec:"+s.codec+", rate:"+m.samplerate+", channels:"+m.channelCount)}}function c(s){return 1024*9e4/s}function o(s,r,d,f,g){var m=v(s,r),p=u(s,r);if(p-=m,p>0){var _=d+f*g;return{headerLength:m,frameLength:p,stamp:_}}}function e(s,r,d,f,g){var m=c(s.samplerate),p=o(r,d,f,g,m);if(p){var _=p.frameLength,y=p.headerLength,n=p.stamp,x=y+_,S=Math.max(0,d+x-r.length),T;S?(T=new Uint8Array(x-y),T.set(r.subarray(d+y,r.length),0)):T=r.subarray(d+y,d+x);var R={unit:T,pts:n};return S||s.samples.push(R),{sample:R,length:x,missing:S}}}},"./src/demux/base-audio-demuxer.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"initPTSFn",function(){return u});var b=U("./src/polyfills/number.ts"),L=U("./src/demux/id3.ts"),E=U("./src/demux/dummy-demuxed-track.ts"),A=U("./src/utils/mp4-tools.ts"),w=U("./src/utils/typed-array.ts"),v=function(){function h(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var a=h.prototype;return a.resetInitSegment=function(i,l,c){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},a.resetTimeStamp=function(){},a.resetContiguity=function(){},a.canParse=function(i,l){return!1},a.appendFrame=function(i,l,c){},a.demux=function(i,l){this.cachedData&&(i=Object(A.appendUint8Array)(this.cachedData,i),this.cachedData=null);var c=L.getID3Data(i,0),o=c?c.length:0,e,s,r=this._audioTrack,d=this._id3Track,f=c?L.getTimeStamp(c):void 0,g=i.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=u(f,l)),c&&c.length>0&&d.samples.push({pts:this.initPTS,dts:this.initPTS,data:c}),s=this.initPTS;o<g;){if(this.canParse(i,o)){var m=this.appendFrame(r,i,o);m?(this.frameIndex++,s=m.sample.pts,o+=m.length,e=o):o=g}else L.canParse(i,o)?(c=L.getID3Data(i,o),d.samples.push({pts:s,dts:s,data:c}),o+=c.length,e=o):o++;if(o===g&&e!==g){var p=Object(w.sliceUint8)(i,e);this.cachedData?this.cachedData=Object(A.appendUint8Array)(this.cachedData,p):this.cachedData=p}}return{audioTrack:r,avcTrack:Object(E.dummyTrack)(),id3Track:d,textTrack:Object(E.dummyTrack)()}},a.demuxSampleAes=function(i,l,c){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},a.flush=function(i){var l=this.cachedData;return l&&(this.cachedData=null,this.demux(l,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(E.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(E.dummyTrack)()}},a.destroy=function(){},h}(),u=function(a,t){return Object(b.isFiniteNumber)(a)?a*90:t*9e4};Z.default=v},"./src/demux/chunk-cache.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return b});var b=function(){function E(){this.chunks=[],this.dataLength=0}var A=E.prototype;return A.push=function(v){this.chunks.push(v),this.dataLength+=v.length},A.flush=function(){var v=this.chunks,u=this.dataLength,h;if(v.length)v.length===1?h=v[0]:h=L(v,u);else return new Uint8Array(0);return this.reset(),h},A.reset=function(){this.chunks.length=0,this.dataLength=0},E}();function L(E,A){for(var w=new Uint8Array(A),v=0,u=0;u<E.length;u++){var h=E[u];w.set(h,v),v+=h.length}return w}},"./src/demux/dummy-demuxed-track.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"dummyTrack",function(){return b});function b(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/utils/logger.ts"),L=function(){function E(w){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=w,this.bytesAvailable=w.byteLength,this.word=0,this.bitsAvailable=0}var A=E.prototype;return A.loadWord=function(){var v=this.data,u=this.bytesAvailable,h=v.byteLength-u,a=new Uint8Array(4),t=Math.min(4,u);if(t===0)throw new Error("no bytes available");a.set(v.subarray(h,h+t)),this.word=new DataView(a.buffer).getUint32(0),this.bitsAvailable=t*8,this.bytesAvailable-=t},A.skipBits=function(v){var u;this.bitsAvailable>v?(this.word<<=v,this.bitsAvailable-=v):(v-=this.bitsAvailable,u=v>>3,v-=u>>3,this.bytesAvailable-=u,this.loadWord(),this.word<<=v,this.bitsAvailable-=v)},A.readBits=function(v){var u=Math.min(this.bitsAvailable,v),h=this.word>>>32-u;return v>32&&b.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=u,this.bitsAvailable>0?this.word<<=u:this.bytesAvailable>0&&this.loadWord(),u=v-u,u>0&&this.bitsAvailable?h<<u|this.readBits(u):h},A.skipLZ=function(){var v;for(v=0;v<this.bitsAvailable;++v)if((this.word&2147483648>>>v)!==0)return this.word<<=v,this.bitsAvailable-=v,v;return this.loadWord(),v+this.skipLZ()},A.skipUEG=function(){this.skipBits(1+this.skipLZ())},A.skipEG=function(){this.skipBits(1+this.skipLZ())},A.readUEG=function(){var v=this.skipLZ();return this.readBits(v+1)-1},A.readEG=function(){var v=this.readUEG();return 1&v?1+v>>>1:-1*(v>>>1)},A.readBoolean=function(){return this.readBits(1)===1},A.readUByte=function(){return this.readBits(8)},A.readUShort=function(){return this.readBits(16)},A.readUInt=function(){return this.readBits(32)},A.skipScalingList=function(v){for(var u=8,h=8,a,t=0;t<v;t++)h!==0&&(a=this.readEG(),h=(u+a+256)%256),u=h===0?u:h},A.readSPS=function(){var v=0,u=0,h=0,a=0,t,i,l,c=this.readUByte.bind(this),o=this.readBits.bind(this),e=this.readUEG.bind(this),s=this.readBoolean.bind(this),r=this.skipBits.bind(this),d=this.skipEG.bind(this),f=this.skipUEG.bind(this),g=this.skipScalingList.bind(this);c();var m=c();if(o(5),r(3),c(),f(),m===100||m===110||m===122||m===244||m===44||m===83||m===86||m===118||m===128){var p=e();if(p===3&&r(1),f(),f(),r(1),s())for(i=p!==3?8:12,l=0;l<i;l++)s()&&(l<6?g(16):g(64))}f();var _=e();if(_===0)e();else if(_===1)for(r(1),d(),d(),t=e(),l=0;l<t;l++)d();f(),r(1);var y=e(),n=e(),x=o(1);x===0&&r(1),r(1),s()&&(v=e(),u=e(),h=e(),a=e());var S=[1,1];if(s()&&s()){var T=c();switch(T){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:{S=[c()<<8|c(),c()<<8|c()];break}}}return{width:Math.ceil((y+1)*16-v*2-u*2),height:(2-x)*(n+1)*16-(x?2:4)*(h+a),pixelRatio:S}},A.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},E}();Z.default=L},"./src/demux/id3.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"isHeader",function(){return b}),U.d(Z,"isFooter",function(){return L}),U.d(Z,"getID3Data",function(){return E}),U.d(Z,"canParse",function(){return w}),U.d(Z,"getTimeStamp",function(){return v}),U.d(Z,"isTimeStampFrame",function(){return u}),U.d(Z,"getID3Frames",function(){return a}),U.d(Z,"decodeFrame",function(){return t}),U.d(Z,"utf8ArrayToStr",function(){return e}),U.d(Z,"testables",function(){return s});var b=function(g,m){return m+10<=g.length&&(g[m]===73&&g[m+1]===68&&g[m+2]===51&&(g[m+3]<255&&g[m+4]<255&&(g[m+6]<128&&g[m+7]<128&&g[m+8]<128&&g[m+9]<128)))},L=function(g,m){return m+10<=g.length&&(g[m]===51&&g[m+1]===68&&g[m+2]===73&&(g[m+3]<255&&g[m+4]<255&&(g[m+6]<128&&g[m+7]<128&&g[m+8]<128&&g[m+9]<128)))},E=function(g,m){for(var p=m,_=0;b(g,m);){_+=10;var y=A(g,m+6);_+=y,L(g,m+10)&&(_+=10),m+=_}return _>0?g.subarray(p,p+_):void 0},A=function(g,m){var p=0;return p=(g[m]&127)<<21,p|=(g[m+1]&127)<<14,p|=(g[m+2]&127)<<7,p|=g[m+3]&127,p},w=function(g,m){return b(g,m)&&A(g,m+6)+10<=g.length-m},v=function(g){for(var m=a(g),p=0;p<m.length;p++){var _=m[p];if(u(_))return o(_)}return},u=function(g){return g&&g.key==="PRIV"&&g.info==="com.apple.streaming.transportStreamTimestamp"},h=function(g){var m=String.fromCharCode(g[0],g[1],g[2],g[3]),p=A(g,4),_=10;return{type:m,size:p,data:g.subarray(_,_+p)}},a=function(g){for(var m=0,p=[];b(g,m);){var _=A(g,m+6);m+=10;for(var y=m+_;m+8<y;){var n=h(g.subarray(m)),x=t(n);x&&p.push(x),m+=n.size+10}L(g,m)&&(m+=10)}return p},t=function(g){return g.type==="PRIV"?i(g):g.type[0]==="W"?c(g):l(g)},i=function(g){if(g.size<2)return;var m=e(g.data,!0),p=new Uint8Array(g.data.subarray(m.length+1));return{key:g.type,info:m,data:p.buffer}},l=function(g){if(g.size<2)return;if(g.type==="TXXX"){var m=1,p=e(g.data.subarray(m),!0);m+=p.length+1;var _=e(g.data.subarray(m));return{key:g.type,info:p,data:_}}var y=e(g.data.subarray(1));return{key:g.type,data:y}},c=function(g){if(g.type==="WXXX"){if(g.size<2)return;var m=1,p=e(g.data.subarray(m),!0);m+=p.length+1;var _=e(g.data.subarray(m));return{key:g.type,info:p,data:_}}var y=e(g.data);return{key:g.type,data:y}},o=function(g){if(g.data.byteLength===8){var m=new Uint8Array(g.data),p=m[3]&1,_=(m[4]<<23)+(m[5]<<15)+(m[6]<<7)+m[7];return _/=45,p&&(_+=4772185884e-2),Math.round(_)}return},e=function(g,m){m===void 0&&(m=!1);var p=d();if(p){var _=p.decode(g);if(m){var y=_.indexOf("\0");return y!==-1?_.substring(0,y):_}return _.replace(/\0/g,"")}for(var n=g.length,x,S,T,R="",D=0;D<n;){if(x=g[D++],x===0&&m)return R;if(x===0||x===3)continue;switch(x>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:R+=String.fromCharCode(x);break;case 12:case 13:S=g[D++],R+=String.fromCharCode((x&31)<<6|S&63);break;case 14:S=g[D++],T=g[D++],R+=String.fromCharCode((x&15)<<12|(S&63)<<6|(T&63)<<0);break;default:}}return R},s={decodeTextFrame:l},r;function d(){return!r&&typeof self.TextDecoder!="undefined"&&(r=new self.TextDecoder("utf-8")),r}},"./src/demux/mp3demuxer.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/demux/base-audio-demuxer.ts"),L=U("./src/demux/id3.ts"),E=U("./src/utils/logger.ts"),A=U("./src/demux/mpegaudio.ts");function w(h,a){h.prototype=Object.create(a.prototype),h.prototype.constructor=h,v(h,a)}function v(h,a){return v=Object.setPrototypeOf||function(i,l){return i.__proto__=l,i},v(h,a)}var u=function(h){w(a,h);function a(){return h.apply(this,arguments)||this}var t=a.prototype;return t.resetInitSegment=function(l,c,o){h.prototype.resetInitSegment.call(this,l,c,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:l,duration:o,inputTimeScale:9e4,dropped:0}},a.probe=function(l){if(!l)return!1;for(var c=L.getID3Data(l,0)||[],o=c.length,e=l.length;o<e;o++)if(A.probe(l,o))return E.logger.log("MPEG Audio sync word found !"),!0;return!1},t.canParse=function(l,c){return A.canParse(l,c)},t.appendFrame=function(l,c,o){return this.initPTS===null?void 0:A.appendFrame(l,c,o,this.initPTS,this.frameIndex)},a}(b.default);u.minProbeByteLength=4,Z.default=u},"./src/demux/mp4demuxer.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/utils/mp4-tools.ts"),L=U("./src/demux/dummy-demuxed-track.ts"),E=function(){function A(v,u){this.remainderData=null,this.config=void 0,this.config=u}var w=A.prototype;return w.resetTimeStamp=function(){},w.resetInitSegment=function(){},w.resetContiguity=function(){},A.probe=function(u){return Object(b.findBox)({data:u,start:0,end:Math.min(u.length,16384)},["moof"]).length>0},w.demux=function(u){var h=u,a=Object(L.dummyTrack)();if(this.config.progressive){this.remainderData&&(h=Object(b.appendUint8Array)(this.remainderData,u));var t=Object(b.segmentValidRange)(h);this.remainderData=t.remainder,a.samples=t.valid||new Uint8Array}else a.samples=h;return{audioTrack:Object(L.dummyTrack)(),avcTrack:a,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},w.flush=function(){var u=Object(L.dummyTrack)();return u.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(L.dummyTrack)(),avcTrack:u,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},w.demuxSampleAes=function(u,h,a){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},w.destroy=function(){},A}();E.minProbeByteLength=1024,Z.default=E},"./src/demux/mpegaudio.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"appendFrame",function(){return v}),U.d(Z,"parseHeader",function(){return u}),U.d(Z,"isHeaderPattern",function(){return h}),U.d(Z,"isHeader",function(){return a}),U.d(Z,"canParse",function(){return t}),U.d(Z,"probe",function(){return i});var b=null,L=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],E=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],A=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],w=[0,1,1,4];function v(l,c,o,e,s){if(o+24>c.length)return;var r=u(c,o);if(r&&o+r.frameLength<=c.length){var d=r.samplesPerFrame*9e4/r.sampleRate,f=e+s*d,g={unit:c.subarray(o,o+r.frameLength),pts:f,dts:f};return l.config=[],l.channelCount=r.channelCount,l.samplerate=r.sampleRate,l.samples.push(g),{sample:g,length:r.frameLength,missing:0}}}function u(l,c){var o=l[c+1]>>3&3,e=l[c+1]>>1&3,s=l[c+2]>>4&15,r=l[c+2]>>2&3;if(o!==1&&s!==0&&s!==15&&r!==3){var d=l[c+2]>>1&1,f=l[c+3]>>6,g=o===3?3-e:e===3?3:4,m=L[g*14+s-1]*1e3,p=o===3?0:o===2?1:2,_=E[p*3+r],y=f===3?1:2,n=A[o][e],x=w[e],S=n*8*x,T=Math.floor(n*m/_+d)*x;if(b===null){var R=navigator.userAgent||"",D=R.match(/Chrome\/(\d+)/i);b=D?parseInt(D[1]):0}var I=!!b&&b<=87;return I&&e===2&&m>=224e3&&f===0&&(l[c+3]=l[c+3]|128),{sampleRate:_,channelCount:y,frameLength:T,samplesPerFrame:S}}}function h(l,c){return l[c]===255&&(l[c+1]&224)===224&&(l[c+1]&6)!==0}function a(l,c){return c+1<l.length&&h(l,c)}function t(l,c){var o=4;return h(l,c)&&o<=l.length-c}function i(l,c){if(c+1<l.length&&h(l,c)){var o=4,e=u(l,c),s=o;e!=null&&e.frameLength&&(s=e.frameLength);var r=c+s;return r===l.length||a(l,r)}return!1}},"./src/demux/sample-aes.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/crypt/decrypter.ts"),L=U("./src/demux/tsdemuxer.ts"),E=function(){function A(v,u,h){this.keyData=void 0,this.decrypter=void 0,this.keyData=h,this.decrypter=new b.default(v,u,{removePKCS7Padding:!1})}var w=A.prototype;return w.decryptBuffer=function(u,h){this.decrypter.decrypt(u,this.keyData.key.buffer,this.keyData.iv.buffer,h)},w.decryptAacSample=function(u,h,a,t){var i=u[h].unit,l=i.subarray(16,i.length-i.length%16),c=l.buffer.slice(l.byteOffset,l.byteOffset+l.length),o=this;this.decryptBuffer(c,function(e){var s=new Uint8Array(e);i.set(s,16),t||o.decryptAacSamples(u,h+1,a)})},w.decryptAacSamples=function(u,h,a){for(;;h++){if(h>=u.length){a();return}if(u[h].unit.length<32)continue;var t=this.decrypter.isSync();if(this.decryptAacSample(u,h,a,t),!t)return}},w.getAvcEncryptedData=function(u){for(var h=Math.floor((u.length-48)/160)*16+16,a=new Int8Array(h),t=0,i=32;i<=u.length-16;i+=160,t+=16)a.set(u.subarray(i,i+16),t);return a},w.getAvcDecryptedUnit=function(u,h){for(var a=new Uint8Array(h),t=0,i=32;i<=u.length-16;i+=160,t+=16)u.set(a.subarray(t,t+16),i);return u},w.decryptAvcSample=function(u,h,a,t,i,l){var c=Object(L.discardEPB)(i.data),o=this.getAvcEncryptedData(c),e=this;this.decryptBuffer(o.buffer,function(s){i.data=e.getAvcDecryptedUnit(c,s),l||e.decryptAvcSamples(u,h,a+1,t)})},w.decryptAvcSamples=function(u,h,a,t){if(u instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;h++,a=0){if(h>=u.length){t();return}for(var i=u[h].units;!(a>=i.length);a++){var l=i[a];if(l.data.length<=48||l.type!==1&&l.type!==5)continue;var c=this.decrypter.isSync();if(this.decryptAvcSample(u,h,a,t,l,c),!c)return}}},A}();Z.default=E},"./src/demux/transmuxer-interface.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return i});var b=U("./node_modules/webworkify-webpack/index.js"),L=U.n(b),E=U("./src/events.ts"),A=U("./src/demux/transmuxer.ts"),w=U("./src/utils/logger.ts"),v=U("./src/errors.ts"),u=U("./src/utils/mediasource-helper.ts"),h=U("./node_modules/eventemitter3/index.js"),a=U.n(h),t=Object(u.getMediaSource)()||{isTypeSupported:function(){return!1}},i=function(){function l(o,e,s,r){var d=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=o,this.id=e,this.onTransmuxComplete=s,this.onFlush=r;var f=o.config,g=function(n,x){x=x||{},x.frag=d.frag,x.id=d.id,o.trigger(n,x)};this.observer=new h.EventEmitter,this.observer.on(E.Events.FRAG_DECRYPTED,g),this.observer.on(E.Events.ERROR,g);var m={mp4:t.isTypeSupported("video/mp4"),mpeg:t.isTypeSupported("audio/mpeg"),mp3:t.isTypeSupported('audio/mp4; codecs="mp3"')},p=navigator.vendor;if(f.enableWorker&&typeof Worker!="undefined"){w.logger.log("demuxing in webworker");var _;try{_=this.worker=b("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),_.addEventListener("message",this.onwmsg),_.onerror=function(y){o.trigger(E.Events.ERROR,{type:v.ErrorTypes.OTHER_ERROR,details:v.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(y.message+" ("+y.filename+":"+y.lineno+")")})},_.postMessage({cmd:"init",typeSupported:m,vendor:p,id:e,config:JSON.stringify(f)})}catch(y){w.logger.warn("Error in worker:",y),w.logger.error("Error while initializing DemuxerWorker, fallback to inline"),_&&self.URL.revokeObjectURL(_.objectURL),this.transmuxer=new A.default(this.observer,m,f,p,e),this.worker=null}}else this.transmuxer=new A.default(this.observer,m,f,p,e)}var c=l.prototype;return c.destroy=function(){var e=this.worker;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var r=this.observer;r&&r.removeAllListeners(),this.observer=null},c.push=function(e,s,r,d,f,g,m,p,_,y){var n=this;_.transmuxing.start=self.performance.now();var x=this.transmuxer,S=this.worker,T=g?g.start:f.start,R=f.decryptdata,D=this.frag,I=!(D&&f.cc===D.cc),B=!(D&&_.level===D.level),G=D?_.sn-D.sn:-1,k=this.part?_.part-this.part.index:1,$=!B&&(G===1||G===0&&k===1),X=self.performance.now();(B||G||f.stats.parsing.start===0)&&(f.stats.parsing.start=X),g&&(k||!$)&&(g.stats.parsing.start=X);var V=new A.TransmuxState(I,$,p,B,T);if(!$||I){w.logger.log("[transmuxer-interface, "+f.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+`
discontinuity: `+I+`
trackSwitch: `+B+`
contiguous: `+$+`
accurateTimeOffset: `+p+`
timeOffset: `+T);var N=new A.TransmuxConfig(r,d,s,m,y);this.configureTransmuxer(N)}if(this.frag=f,this.part=g,S)S.postMessage({cmd:"demux",data:e,decryptdata:R,chunkMeta:_,state:V},e instanceof ArrayBuffer?[e]:[]);else if(x){var z=x.push(e,R,_,V);Object(A.isPromise)(z)?z.then(function(q){n.handleTransmuxComplete(q)}):this.handleTransmuxComplete(z)}},c.flush=function(e){var s=this;e.transmuxing.start=self.performance.now();var r=this.transmuxer,d=this.worker;if(d)d.postMessage({cmd:"flush",chunkMeta:e});else if(r){var f=r.flush(e);Object(A.isPromise)(f)?f.then(function(g){s.handleFlushResult(g,e)}):this.handleFlushResult(f,e)}},c.handleFlushResult=function(e,s){var r=this;e.forEach(function(d){r.handleTransmuxComplete(d)}),this.onFlush(s)},c.onWorkerMessage=function(e){var s=e.data,r=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,r.trigger(s.event,s.data);break}}},c.configureTransmuxer=function(e){var s=this.worker,r=this.transmuxer;s?s.postMessage({cmd:"configure",config:e}):r&&r.configure(e)},c.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},l}()},"./src/demux/transmuxer-worker.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return v});var b=U("./src/demux/transmuxer.ts"),L=U("./src/events.ts"),E=U("./src/utils/logger.ts"),A=U("./node_modules/eventemitter3/index.js"),w=U.n(A);function v(i){var l=new A.EventEmitter,c=function(e,s){i.postMessage({event:e,data:s})};l.on(L.Events.FRAG_DECRYPTED,c),l.on(L.Events.ERROR,c),i.addEventListener("message",function(o){var e=o.data;switch(e.cmd){case"init":{var s=JSON.parse(e.config);i.transmuxer=new b.default(l,e.typeSupported,s,e.vendor,e.id),Object(E.enableLogs)(s.debug),c("init",null);break}case"configure":{i.transmuxer.configure(e.config);break}case"demux":{var r=i.transmuxer.push(e.data,e.decryptdata,e.chunkMeta,e.state);Object(b.isPromise)(r)?r.then(function(g){u(i,g)}):u(i,r);break}case"flush":{var d=e.chunkMeta,f=i.transmuxer.flush(d);Object(b.isPromise)(f)?f.then(function(g){a(i,g,d)}):a(i,f,d);break}default:break}})}function u(i,l){if(t(l.remuxResult))return;var c=[],o=l.remuxResult,e=o.audio,s=o.video;e&&h(c,e),s&&h(c,s),i.postMessage({event:"transmuxComplete",data:l},c)}function h(i,l){l.data1&&i.push(l.data1.buffer),l.data2&&i.push(l.data2.buffer)}function a(i,l,c){l.forEach(function(o){u(i,o)}),i.postMessage({event:"flush",data:c})}function t(i){return!i.audio&&!i.video&&!i.text&&!i.id3&&!i.initSegment}},"./src/demux/transmuxer.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return s}),U.d(Z,"isPromise",function(){return f}),U.d(Z,"TransmuxConfig",function(){return g}),U.d(Z,"TransmuxState",function(){return m});var b=U("./src/events.ts"),L=U("./src/errors.ts"),E=U("./src/crypt/decrypter.ts"),A=U("./src/demux/aacdemuxer.ts"),w=U("./src/demux/mp4demuxer.ts"),v=U("./src/demux/tsdemuxer.ts"),u=U("./src/demux/mp3demuxer.ts"),h=U("./src/remux/mp4-remuxer.ts"),a=U("./src/remux/passthrough-remuxer.ts"),t=U("./src/demux/chunk-cache.ts"),i=U("./src/utils/mp4-tools.ts"),l=U("./src/utils/logger.ts"),c;try{c=self.performance.now.bind(self.performance)}catch(p){l.logger.debug("Unable to use Performance API on this environment"),c=self.Date.now}var o=[{demux:v.default,remux:h.default},{demux:w.default,remux:a.default},{demux:A.default,remux:h.default},{demux:u.default,remux:h.default}],e=1024;o.forEach(function(p){var _=p.demux;e=Math.max(e,_.minProbeByteLength)});var s=function(){function p(y,n,x,S,T){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new t.default,this.observer=y,this.typeSupported=n,this.config=x,this.vendor=S,this.id=T}var _=p.prototype;return _.configure=function(n){this.transmuxConfig=n,this.decrypter&&this.decrypter.reset()},_.push=function(n,x,S,T){var R=this,D=S.transmuxing;D.executeStart=c();var I=new Uint8Array(n),B=this.cache,G=this.config,k=this.currentTransmuxState,$=this.transmuxConfig;T&&(this.currentTransmuxState=T);var X=r(I,x);if(X&&X.method==="AES-128"){var V=this.getDecrypter();if(G.enableSoftwareAES){var N=V.softwareDecrypt(I,X.key.buffer,X.iv.buffer);if(!N)return D.executeEnd=c(),d(S);I=new Uint8Array(N)}else return this.decryptionPromise=V.webCryptoDecrypt(I,X.key.buffer,X.iv.buffer).then(function(be){var Ee=R.push(be,null,S);return R.decryptionPromise=null,Ee}),this.decryptionPromise}var z=T||k,q=z.contiguous,ee=z.discontinuity,fe=z.trackSwitch,ae=z.accurateTimeOffset,pe=z.timeOffset,se=$.audioCodec,ge=$.videoCodec,ie=$.defaultInitPts,te=$.duration,Q=$.initSegmentData;if((ee||fe)&&this.resetInitSegment(Q,se,ge,te),ee&&this.resetInitialTimestamp(ie),q||this.resetContiguity(),this.needsProbing(I,ee,fe)){if(B.dataLength){var me=B.flush();I=Object(i.appendUint8Array)(me,I)}this.configureTransmuxer(I,$)}var re=this.transmux(I,X,pe,ae,S),J=this.currentTransmuxState;return J.contiguous=!0,J.discontinuity=!1,J.trackSwitch=!1,D.executeEnd=c(),re},_.flush=function(n){var x=this,S=n.transmuxing;S.executeStart=c();var T=this.decrypter,R=this.cache,D=this.currentTransmuxState,I=this.decryptionPromise;if(I)return I.then(function(){return x.flush(n)});var B=[],G=D.timeOffset;if(T){var k=T.flush();k&&B.push(this.push(k,null,n))}var $=R.dataLength;R.reset();var X=this.demuxer,V=this.remuxer;if(!X||!V)return $>=e&&this.observer.emit(b.Events.ERROR,b.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),S.executeEnd=c(),[d(n)];var N=X.flush(G);return f(N)?N.then(function(z){return x.flushRemux(B,z,n),B}):(this.flushRemux(B,N,n),B)},_.flushRemux=function(n,x,S){var T=x.audioTrack,R=x.avcTrack,D=x.id3Track,I=x.textTrack,B=this.currentTransmuxState,G=B.accurateTimeOffset,k=B.timeOffset;l.logger.log("[transmuxer.ts]: Flushed fragment "+S.sn+(S.part>-1?" p: "+S.part:"")+" of level "+S.level);var $=this.remuxer.remux(T,R,D,I,k,G,!0,this.id);n.push({remuxResult:$,chunkMeta:S}),S.transmuxing.executeEnd=c()},_.resetInitialTimestamp=function(n){var x=this.demuxer,S=this.remuxer;if(!x||!S)return;x.resetTimeStamp(n),S.resetTimeStamp(n)},_.resetContiguity=function(){var n=this.demuxer,x=this.remuxer;if(!n||!x)return;n.resetContiguity(),x.resetNextTimestamp()},_.resetInitSegment=function(n,x,S,T){var R=this.demuxer,D=this.remuxer;if(!R||!D)return;R.resetInitSegment(x,S,T),D.resetInitSegment(n,x,S)},_.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},_.transmux=function(n,x,S,T,R){var D;return x&&x.method==="SAMPLE-AES"?D=this.transmuxSampleAes(n,x,S,T,R):D=this.transmuxUnencrypted(n,S,T,R),D},_.transmuxUnencrypted=function(n,x,S,T){var R=this.demuxer.demux(n,x,!1,!this.config.progressive),D=R.audioTrack,I=R.avcTrack,B=R.id3Track,G=R.textTrack,k=this.remuxer.remux(D,I,B,G,x,S,!1,this.id);return{remuxResult:k,chunkMeta:T}},_.transmuxSampleAes=function(n,x,S,T,R){var D=this;return this.demuxer.demuxSampleAes(n,x,S).then(function(I){var B=D.remuxer.remux(I.audioTrack,I.avcTrack,I.id3Track,I.textTrack,S,T,!1,D.id);return{remuxResult:B,chunkMeta:R}})},_.configureTransmuxer=function(n,x){for(var S=this.config,T=this.observer,R=this.typeSupported,D=this.vendor,I=x.audioCodec,B=x.defaultInitPts,G=x.duration,k=x.initSegmentData,$=x.videoCodec,X,V=0,N=o.length;V<N;V++)if(o[V].demux.probe(n)){X=o[V];break}X||(l.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),X={demux:w.default,remux:a.default});var z=this.demuxer,q=this.remuxer,ee=X.remux,fe=X.demux;(!q||!(q instanceof ee))&&(this.remuxer=new ee(T,S,R,D)),(!z||!(z instanceof fe))&&(this.demuxer=new fe(T,S,R),this.probe=fe.probe),this.resetInitSegment(k,I,$,G),this.resetInitialTimestamp(B)},_.needsProbing=function(n,x,S){return!this.demuxer||!this.remuxer||x||S},_.getDecrypter=function(){var n=this.decrypter;return n||(n=this.decrypter=new E.default(this.observer,this.config)),n},p}();function r(p,_){var y=null;return p.byteLength>0&&_!=null&&_.key!=null&&_.iv!==null&&_.method!=null&&(y=_),y}var d=function(_){return{remuxResult:{},chunkMeta:_}};function f(p){return"then"in p&&p.then instanceof Function}var g=function(_,y,n,x,S){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=_,this.videoCodec=y,this.initSegmentData=n,this.duration=x,this.defaultInitPts=S},m=function(_,y,n,x,S){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=_,this.contiguous=y,this.accurateTimeOffset=n,this.trackSwitch=x,this.timeOffset=S}},"./src/demux/tsdemuxer.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"discardEPB",function(){return d});var b=U("./src/demux/adts.ts"),L=U("./src/demux/mpegaudio.ts"),E=U("./src/demux/exp-golomb.ts"),A=U("./src/demux/id3.ts"),w=U("./src/demux/sample-aes.ts"),v=U("./src/events.ts"),u=U("./src/utils/mp4-tools.ts"),h=U("./src/utils/logger.ts"),a=U("./src/errors.ts"),t={video:1,audio:2,id3:3,text:4},i=function(){function f(m,p,_){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=m,this.config=p,this.typeSupported=_}f.probe=function(p){var _=f.syncOffset(p);return _<0?!1:(_&&h.logger.warn("MPEG2-TS detected but first sync word found @ offset "+_+", junk ahead ?"),!0)},f.syncOffset=function(p){for(var _=Math.min(1e3,p.length-3*188),y=0;y<_;){if(p[y]===71&&p[y+188]===71&&p[y+2*188]===71)return y;y++}return-1},f.createTrack=function(p,_){return{container:p==="video"||p==="audio"?"video/mp2t":void 0,type:p,id:t[p],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:p==="audio"?_:void 0}};var g=f.prototype;return g.resetInitSegment=function(p,_,y){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=f.createTrack("video",y),this._audioTrack=f.createTrack("audio",y),this._id3Track=f.createTrack("id3",y),this._txtTrack=f.createTrack("text",y),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=p,this.videoCodec=_,this._duration=y},g.resetTimeStamp=function(){},g.resetContiguity=function(){var p=this._audioTrack,_=this._avcTrack,y=this._id3Track;p&&(p.pesData=null),_&&(_.pesData=null),y&&(y.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},g.demux=function(p,_,y,n){y===void 0&&(y=!1),n===void 0&&(n=!1),y||(this.sampleAes=null);var x,S=this._avcTrack,T=this._audioTrack,R=this._id3Track,D=S.pid,I=S.pesData,B=T.pid,G=R.pid,k=T.pesData,$=R.pesData,X=!1,V=this.pmtParsed,N=this._pmtId,z=p.length;if(this.remainderData&&(p=Object(u.appendUint8Array)(this.remainderData,p),z=p.length,this.remainderData=null),z<188&&!n)return this.remainderData=p,{audioTrack:T,avcTrack:S,id3Track:R,textTrack:this._txtTrack};var q=Math.max(0,f.syncOffset(p));z-=(z+q)%188,z<p.byteLength&&!n&&(this.remainderData=new Uint8Array(p.buffer,z,p.buffer.byteLength-z));for(var ee=q;ee<z;ee+=188)if(p[ee]===71){var fe=!!(p[ee+1]&64),ae=((p[ee+1]&31)<<8)+p[ee+2],pe=(p[ee+3]&48)>>4,se=void 0;if(pe>1){if(se=ee+5+p[ee+4],se===ee+188)continue}else se=ee+4;switch(ae){case D:fe&&(I&&(x=e(I))&&this.parseAVCPES(x,!1),I={data:[],size:0}),I&&(I.data.push(p.subarray(se,ee+188)),I.size+=ee+188-se);break;case B:fe&&(k&&(x=e(k))&&(T.isAAC?this.parseAACPES(x):this.parseMPEGPES(x)),k={data:[],size:0}),k&&(k.data.push(p.subarray(se,ee+188)),k.size+=ee+188-se);break;case G:fe&&($&&(x=e($))&&this.parseID3PES(x),$={data:[],size:0}),$&&($.data.push(p.subarray(se,ee+188)),$.size+=ee+188-se);break;case 0:fe&&(se+=p[se]+1),N=this._pmtId=c(p,se);break;case N:{fe&&(se+=p[se]+1);var ge=o(p,se,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,y);D=ge.avc,D>0&&(S.pid=D),B=ge.audio,B>0&&(T.pid=B,T.isAAC=ge.isAAC),G=ge.id3,G>0&&(R.pid=G),X&&!V&&(h.logger.log("reparse from beginning"),X=!1,ee=q-188),V=this.pmtParsed=!0;break}case 17:case 8191:break;default:X=!0;break}}else this.observer.emit(v.Events.ERROR,v.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});S.pesData=I,T.pesData=k,R.pesData=$;var ie={audioTrack:T,avcTrack:S,id3Track:R,textTrack:this._txtTrack};return n&&this.extractRemainingSamples(ie),ie},g.flush=function(){var p=this.remainderData;this.remainderData=null;var _;return p?_=this.demux(p,-1,!1,!0):_={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(_),this.sampleAes?this.decrypt(_,this.sampleAes):_},g.extractRemainingSamples=function(p){var _=p.audioTrack,y=p.avcTrack,n=p.id3Track,x=y.pesData,S=_.pesData,T=n.pesData,R;x&&(R=e(x))?(this.parseAVCPES(R,!0),y.pesData=null):y.pesData=x,S&&(R=e(S))?(_.isAAC?this.parseAACPES(R):this.parseMPEGPES(R),_.pesData=null):(S!=null&&S.size&&h.logger.log("last AAC PES packet truncated,might overlap between fragments"),_.pesData=S),T&&(R=e(T))?(this.parseID3PES(R),n.pesData=null):n.pesData=T},g.demuxSampleAes=function(p,_,y){var n=this.demux(p,y,!0,!this.config.progressive),x=this.sampleAes=new w.default(this.observer,this.config,_);return this.decrypt(n,x)},g.decrypt=function(p,_){return new Promise(function(y){var n=p.audioTrack,x=p.avcTrack;n.samples&&n.isAAC?_.decryptAacSamples(n.samples,0,function(){x.samples?_.decryptAvcSamples(x.samples,0,0,function(){y(p)}):y(p)}):x.samples&&_.decryptAvcSamples(x.samples,0,0,function(){y(p)})})},g.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},g.parseAVCPES=function(p,_){var y=this,n=this._avcTrack,x=this.parseAVCNALu(p.data),S=!1,T=this.avcSample,R,D=!1;p.data=null,T&&x.length&&!n.audFound&&(s(T,n),T=this.avcSample=l(!1,p.pts,p.dts,"")),x.forEach(function(I){switch(I.type){case 1:{R=!0,T||(T=y.avcSample=l(!0,p.pts,p.dts,"")),S&&(T.debug+="NDR "),T.frame=!0;var B=I.data;if(D&&B.length>4){var G=new E.default(B).readSliceType();(G===2||G===4||G===7||G===9)&&(T.key=!0)}break}case 5:R=!0,T||(T=y.avcSample=l(!0,p.pts,p.dts,"")),S&&(T.debug+="IDR "),T.key=!0,T.frame=!0;break;case 6:{R=!0,S&&T&&(T.debug+="SEI ");var k=new E.default(d(I.data));k.readUByte();for(var $=0,X=0,V=!1,N=0;!V&&k.bytesAvailable>1;){$=0;do N=k.readUByte(),$+=N;while(N===255);X=0;do N=k.readUByte(),X+=N;while(N===255);if($===4&&k.bytesAvailable!==0){V=!0;var z=k.readUByte();if(z===181){var q=k.readUShort();if(q===49){var ee=k.readUInt();if(ee===1195456820){var fe=k.readUByte();if(fe===3){for(var ae=k.readUByte(),pe=k.readUByte(),se=31&ae,ge=[ae,pe],ie=0;ie<se;ie++)ge.push(k.readUByte()),ge.push(k.readUByte()),ge.push(k.readUByte());r(y._txtTrack.samples,{type:3,pts:p.pts,bytes:ge})}}}}}else if($===5&&k.bytesAvailable!==0){if(V=!0,X>16){for(var te=[],Q=0;Q<16;Q++)te.push(k.readUByte().toString(16)),(Q===3||Q===5||Q===7||Q===9)&&te.push("-");for(var me=X-16,re=new Uint8Array(me),J=0;J<me;J++)re[J]=k.readUByte();r(y._txtTrack.samples,{pts:p.pts,payloadType:$,uuid:te.join(""),userData:Object(A.utf8ArrayToStr)(re),userDataBytes:re})}}else if(X<k.bytesAvailable)for(var be=0;be<X;be++)k.readUByte()}break}case 7:if(R=!0,D=!0,S&&T&&(T.debug+="SPS "),!n.sps){var Ee=new E.default(I.data),Le=Ee.readSPS();n.width=Le.width,n.height=Le.height,n.pixelRatio=Le.pixelRatio,n.sps=[I.data],n.duration=y._duration;for(var H=I.data.subarray(1,4),C="avc1.",O=0;O<3;O++){var j=H[O].toString(16);j.length<2&&(j="0"+j),C+=j}n.codec=C}break;case 8:R=!0,S&&T&&(T.debug+="PPS "),n.pps||(n.pps=[I.data]);break;case 9:R=!1,n.audFound=!0,T&&s(T,n),T=y.avcSample=l(!1,p.pts,p.dts,S?"AUD ":"");break;case 12:R=!1;break;default:R=!1,T&&(T.debug+="unknown NAL "+I.type+" ");break}if(T&&R){var M=T.units;M.push(I)}}),_&&T&&(s(T,n),this.avcSample=null)},g.getLastNalUnit=function(){var p,_=this.avcSample,y;if(!_||_.units.length===0){var n=this._avcTrack.samples;_=n[n.length-1]}if((p=_)!==null&&p!==void 0&&p.units){var x=_.units;y=x[x.length-1]}return y},g.parseAVCNALu=function(p){var _=p.byteLength,y=this._avcTrack,n=y.naluState||0,x=n,S=[],T=0,R,D,I,B=-1,G=0;for(n===-1&&(B=0,G=p[0]&31,n=0,T=1);T<_;){if(R=p[T++],!n){n=R?0:1;continue}if(n===1){n=R?0:2;continue}if(!R)n=3;else if(R===1){if(B>=0){var k={data:p.subarray(B,T-n-1),type:G};S.push(k)}else{var $=this.getLastNalUnit();if($&&(x&&T<=4-x&&($.state&&($.data=$.data.subarray(0,$.data.byteLength-x))),D=T-n-1,D>0)){var X=new Uint8Array($.data.byteLength+D);X.set($.data,0),X.set(p.subarray(0,D),$.data.byteLength),$.data=X,$.state=0}}T<_?(I=p[T]&31,B=T,G=I,n=0):n=-1}else n=0}if(B>=0&&n>=0){var V={data:p.subarray(B,_),type:G,state:n};S.push(V)}if(S.length===0){var N=this.getLastNalUnit();if(N){var z=new Uint8Array(N.data.byteLength+p.byteLength);z.set(N.data,0),z.set(p,N.data.byteLength),N.data=z}}return y.naluState=n,S},g.parseAACPES=function(p){var _=0,y=this._audioTrack,n=this.aacOverFlow,x=p.data;if(n){this.aacOverFlow=null;var S=n.sample.unit.byteLength,T=Math.min(n.missing,S),R=S-T;n.sample.unit.set(x.subarray(0,T),R),y.samples.push(n.sample),_=n.missing}var D,I;for(D=_,I=x.length;D<I-1&&!b.isHeader(x,D);D++);if(D!==_){var B,G;if(D<I-1?(B="AAC PES did not start with ADTS header,offset:"+D,G=!1):(B="no ADTS header found in AAC PES",G=!0),h.logger.warn("parsing error:"+B),this.observer.emit(v.Events.ERROR,v.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_PARSING_ERROR,fatal:G,reason:B}),G)return}b.initTrackConfig(y,this.observer,x,D,this.audioCodec);var k;if(p.pts!==void 0)k=p.pts;else if(n){var $=b.getFrameDuration(y.samplerate);k=n.sample.pts+$}else{h.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var X=0;D<I;)if(b.isHeader(x,D)){if(D+5<I){var V=b.appendFrame(y,x,D,k,X);if(V)if(V.missing)this.aacOverFlow=V;else{D+=V.length,X++;continue}}break}else D++},g.parseMPEGPES=function(p){var _=p.data,y=_.length,n=0,x=0,S=p.pts;if(S===void 0){h.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;x<y;)if(L.isHeader(_,x)){var T=L.appendFrame(this._audioTrack,_,x,S,n);if(T)x+=T.length,n++;else break}else x++},g.parseID3PES=function(p){if(p.pts===void 0){h.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(p)},f}();i.minProbeByteLength=188;function l(f,g,m,p){return{key:f,frame:!1,pts:g,dts:m,units:[],debug:p,length:0}}function c(f,g){return(f[g+10]&31)<<8|f[g+11]}function o(f,g,m,p){var _={audio:-1,avc:-1,id3:-1,isAAC:!0},y=(f[g+1]&15)<<8|f[g+2],n=g+3+y-4,x=(f[g+10]&15)<<8|f[g+11];for(g+=12+x;g<n;){var S=(f[g+1]&31)<<8|f[g+2];switch(f[g]){case 207:if(!p){h.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:_.audio===-1&&(_.audio=S);break;case 21:_.id3===-1&&(_.id3=S);break;case 219:if(!p){h.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:_.avc===-1&&(_.avc=S);break;case 3:case 4:m?_.audio===-1&&(_.audio=S,_.isAAC=!1):h.logger.log("MPEG audio found, not supported in this browser");break;case 36:h.logger.warn("Unsupported HEVC stream type found");break;default:break}g+=((f[g+3]&15)<<8|f[g+4])+5}return _}function e(f){var g=0,m,p,_,y,n,x=f.data;if(!f||f.size===0)return null;for(;x[0].length<19&&x.length>1;){var S=new Uint8Array(x[0].length+x[1].length);S.set(x[0]),S.set(x[1],x[0].length),x[0]=S,x.splice(1,1)}m=x[0];var T=(m[0]<<16)+(m[1]<<8)+m[2];if(T===1){if(p=(m[4]<<8)+m[5],p&&p>f.size-6)return null;var R=m[7];R&192&&(y=(m[9]&14)*536870912+(m[10]&255)*4194304+(m[11]&254)*16384+(m[12]&255)*128+(m[13]&254)/2,R&64?(n=(m[14]&14)*536870912+(m[15]&255)*4194304+(m[16]&254)*16384+(m[17]&255)*128+(m[18]&254)/2,y-n>60*9e4&&(h.logger.warn(Math.round((y-n)/9e4)+"s delta between PTS and DTS, align them"),y=n)):n=y),_=m[8];var D=_+9;if(f.size<=D)return null;f.size-=D;for(var I=new Uint8Array(f.size),B=0,G=x.length;B<G;B++){m=x[B];var k=m.byteLength;if(D)if(D>k){D-=k;continue}else m=m.subarray(D),k-=D,D=0;I.set(m,g),g+=k}return p&&(p-=_+3),{data:I,pts:y,dts:n,len:p}}return null}function s(f,g){if(f.units.length&&f.frame){if(f.pts===void 0){var m=g.samples,p=m.length;if(p){var _=m[p-1];f.pts=_.pts,f.dts=_.dts}else{g.dropped++;return}}g.samples.push(f)}f.debug.length&&h.logger.log(f.pts+"/"+f.dts+":"+f.debug)}function r(f,g){var m=f.length;if(m>0){if(g.pts>=f[m-1].pts)f.push(g);else for(var p=m-1;p>=0;p--)if(g.pts<f[p].pts){f.splice(p,0,g);break}}else f.push(g)}function d(f){for(var g=f.byteLength,m=[],p=1;p<g-2;)f[p]===0&&f[p+1]===0&&f[p+2]===3?(m.push(p+2),p+=2):p++;if(m.length===0)return f;var _=g-m.length,y=new Uint8Array(_),n=0;for(p=0;p<_;n++,p++)n===m[0]&&(n++,m.shift()),y[p]=f[n];return y}Z.default=i},"./src/errors.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"ErrorTypes",function(){return b}),U.d(Z,"ErrorDetails",function(){return L});var b;(function(E){E.NETWORK_ERROR="networkError",E.MEDIA_ERROR="mediaError",E.KEY_SYSTEM_ERROR="keySystemError",E.MUX_ERROR="muxError",E.OTHER_ERROR="otherError"})(b||(b={}));var L;(function(E){E.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",E.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",E.KEY_SYSTEM_NO_SESSION="keySystemNoSession",E.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",E.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",E.MANIFEST_LOAD_ERROR="manifestLoadError",E.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",E.MANIFEST_PARSING_ERROR="manifestParsingError",E.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",E.LEVEL_EMPTY_ERROR="levelEmptyError",E.LEVEL_LOAD_ERROR="levelLoadError",E.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",E.LEVEL_SWITCH_ERROR="levelSwitchError",E.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",E.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",E.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",E.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",E.FRAG_LOAD_ERROR="fragLoadError",E.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",E.FRAG_DECRYPT_ERROR="fragDecryptError",E.FRAG_PARSING_ERROR="fragParsingError",E.REMUX_ALLOC_ERROR="remuxAllocError",E.KEY_LOAD_ERROR="keyLoadError",E.KEY_LOAD_TIMEOUT="keyLoadTimeOut",E.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",E.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",E.BUFFER_APPEND_ERROR="bufferAppendError",E.BUFFER_APPENDING_ERROR="bufferAppendingError",E.BUFFER_STALLED_ERROR="bufferStalledError",E.BUFFER_FULL_ERROR="bufferFullError",E.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",E.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",E.INTERNAL_EXCEPTION="internalException",E.INTERNAL_ABORTED="aborted",E.UNKNOWN="unknown"})(L||(L={}))},"./src/events.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"Events",function(){return b});var b;(function(L){L.MEDIA_ATTACHING="hlsMediaAttaching",L.MEDIA_ATTACHED="hlsMediaAttached",L.MEDIA_DETACHING="hlsMediaDetaching",L.MEDIA_DETACHED="hlsMediaDetached",L.BUFFER_RESET="hlsBufferReset",L.BUFFER_CODECS="hlsBufferCodecs",L.BUFFER_CREATED="hlsBufferCreated",L.BUFFER_APPENDING="hlsBufferAppending",L.BUFFER_APPENDED="hlsBufferAppended",L.BUFFER_EOS="hlsBufferEos",L.BUFFER_FLUSHING="hlsBufferFlushing",L.BUFFER_FLUSHED="hlsBufferFlushed",L.MANIFEST_LOADING="hlsManifestLoading",L.MANIFEST_LOADED="hlsManifestLoaded",L.MANIFEST_PARSED="hlsManifestParsed",L.LEVEL_SWITCHING="hlsLevelSwitching",L.LEVEL_SWITCHED="hlsLevelSwitched",L.LEVEL_LOADING="hlsLevelLoading",L.LEVEL_LOADED="hlsLevelLoaded",L.LEVEL_UPDATED="hlsLevelUpdated",L.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",L.LEVELS_UPDATED="hlsLevelsUpdated",L.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",L.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",L.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",L.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",L.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",L.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",L.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",L.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",L.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",L.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",L.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",L.CUES_PARSED="hlsCuesParsed",L.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",L.INIT_PTS_FOUND="hlsInitPtsFound",L.FRAG_LOADING="hlsFragLoading",L.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",L.FRAG_LOADED="hlsFragLoaded",L.FRAG_DECRYPTED="hlsFragDecrypted",L.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",L.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",L.FRAG_PARSING_METADATA="hlsFragParsingMetadata",L.FRAG_PARSED="hlsFragParsed",L.FRAG_BUFFERED="hlsFragBuffered",L.FRAG_CHANGED="hlsFragChanged",L.FPS_DROP="hlsFpsDrop",L.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",L.ERROR="hlsError",L.DESTROYING="hlsDestroying",L.KEY_LOADING="hlsKeyLoading",L.KEY_LOADED="hlsKeyLoaded",L.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",L.BACK_BUFFER_REACHED="hlsBackBufferReached"})(b||(b={}))},"./src/hls.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return f});var b=U("./node_modules/url-toolkit/src/url-toolkit.js"),L=U.n(b),E=U("./src/loader/playlist-loader.ts"),A=U("./src/loader/key-loader.ts"),w=U("./src/controller/id3-track-controller.ts"),v=U("./src/controller/latency-controller.ts"),u=U("./src/controller/level-controller.ts"),h=U("./src/controller/fragment-tracker.ts"),a=U("./src/controller/stream-controller.ts"),t=U("./src/is-supported.ts"),i=U("./src/utils/logger.ts"),l=U("./src/config.ts"),c=U("./node_modules/eventemitter3/index.js"),o=U.n(c),e=U("./src/events.ts"),s=U("./src/errors.ts");function r(g,m){for(var p=0;p<m.length;p++){var _=m[p];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(g,_.key,_)}}function d(g,m,p){return m&&r(g.prototype,m),p&&r(g,p),g}var f=function(){g.isSupported=function(){return Object(t.isSupported)()};function g(p){p===void 0&&(p={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new c.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var _=this.config=Object(l.mergeConfig)(g.DefaultConfig,p);this.userConfig=p,Object(i.enableLogs)(_.debug),this._autoLevelCapping=-1,_.progressive&&Object(l.enableStreamingMode)(_);var y=_.abrController,n=_.bufferController,x=_.capLevelController,S=_.fpsController,T=this.abrController=new y(this),R=this.bufferController=new n(this),D=this.capLevelController=new x(this),I=new S(this),B=new E.default(this),G=new A.default(this),k=new w.default(this),$=this.levelController=new u.default(this),X=new h.FragmentTracker(this),V=this.streamController=new a.default(this,X);D.setStreamController(V),I.setStreamController(V);var N=[$,V];this.networkControllers=N;var z=[B,G,T,R,D,I,k,X];this.audioTrackController=this.createController(_.audioTrackController,null,N),this.createController(_.audioStreamController,X,N),this.subtitleTrackController=this.createController(_.subtitleTrackController,null,N),this.createController(_.subtitleStreamController,X,N),this.createController(_.timelineController,null,z),this.emeController=this.createController(_.emeController,null,z),this.cmcdController=this.createController(_.cmcdController,null,z),this.latencyController=this.createController(v.default,null,z),this.coreComponents=z}var m=g.prototype;return m.createController=function(_,y,n){if(_){var x=y?new _(this,y):new _(this);return n&&n.push(x),x}return null},m.on=function(_,y,n){n===void 0&&(n=this),this._emitter.on(_,y,n)},m.once=function(_,y,n){n===void 0&&(n=this),this._emitter.once(_,y,n)},m.removeAllListeners=function(_){this._emitter.removeAllListeners(_)},m.off=function(_,y,n,x){n===void 0&&(n=this),this._emitter.off(_,y,n,x)},m.listeners=function(_){return this._emitter.listeners(_)},m.emit=function(_,y,n){return this._emitter.emit(_,y,n)},m.trigger=function(_,y){if(this.config.debug)return this.emit(_,_,y);try{return this.emit(_,_,y)}catch(n){i.logger.error("An internal error happened while handling event "+_+'. Error message: "'+n.message+'". Here is a stacktrace:',n),this.trigger(e.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:_,error:n})}return!1},m.listenerCount=function(_){return this._emitter.listenerCount(_)},m.destroy=function(){i.logger.log("destroy"),this.trigger(e.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(_){return _.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(_){return _.destroy()}),this.coreComponents.length=0},m.attachMedia=function(_){i.logger.log("attachMedia"),this._media=_,this.trigger(e.Events.MEDIA_ATTACHING,{media:_})},m.detachMedia=function(){i.logger.log("detachMedia"),this.trigger(e.Events.MEDIA_DETACHING,void 0),this._media=null},m.loadSource=function(_){this.stopLoad();var y=this.media,n=this.url,x=this.url=b.buildAbsoluteURL(self.location.href,_,{alwaysNormalize:!0});i.logger.log("loadSource:"+x),y&&n&&n!==x&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(y)),this.trigger(e.Events.MANIFEST_LOADING,{url:_})},m.startLoad=function(_){_===void 0&&(_=-1),i.logger.log("startLoad("+_+")"),this.networkControllers.forEach(function(y){y.startLoad(_)})},m.stopLoad=function(){i.logger.log("stopLoad"),this.networkControllers.forEach(function(_){_.stopLoad()})},m.swapAudioCodec=function(){i.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},m.recoverMediaError=function(){i.logger.log("recoverMediaError");var _=this._media;this.detachMedia(),_&&this.attachMedia(_)},m.removeLevel=function(_,y){y===void 0&&(y=0),this.levelController.removeLevel(_,y)},d(g,[{key:"levels",get:function(){var _=this.levelController.levels;return _||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(_){i.logger.log("set currentLevel:"+_),this.loadLevel=_,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(_){i.logger.log("set nextLevel:"+_),this.levelController.manualLevel=_,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(_){i.logger.log("set loadLevel:"+_),this.levelController.manualLevel=_}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(_){this.levelController.nextLoadLevel=_}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(_){i.logger.log("set firstLevel:"+_),this.levelController.firstLevel=_}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(_){i.logger.log("set startLevel:"+_),_!==-1&&(_=Math.max(_,this.minAutoLevel)),this.levelController.startLevel=_}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(_){var y=!!_;y!==this.config.capLevelToPlayerSize&&(y?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=y)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(_){this._autoLevelCapping!==_&&(i.logger.log("set autoLevelCapping:"+_),this._autoLevelCapping=_)}},{key:"bandwidthEstimate",get:function(){var _=this.abrController.bwEstimator;return _?_.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var _=this.levels,y=this.config.minAutoBitrate;if(!_)return 0;for(var n=_.length,x=0;x<n;x++)if(_[x].maxBitrate>y)return x;return 0}},{key:"maxAutoLevel",get:function(){var _=this.levels,y=this.autoLevelCapping,n;return y===-1&&_&&_.length?n=_.length-1:n=y,n}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(_){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,_)}},{key:"audioTracks",get:function(){var _=this.audioTrackController;return _?_.audioTracks:[]}},{key:"audioTrack",get:function(){var _=this.audioTrackController;return _?_.audioTrack:-1},set:function(_){var y=this.audioTrackController;y&&(y.audioTrack=_)}},{key:"subtitleTracks",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTrack:-1},set:function(_){var y=this.subtitleTrackController;y&&(y.subtitleTrack=_)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var _=this.subtitleTrackController;return _?_.subtitleDisplay:!1},set:function(_){var y=this.subtitleTrackController;y&&(y.subtitleDisplay=_)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(_){this.config.lowLatencyMode=_}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return e.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return g.defaultConfig?g.defaultConfig:l.hlsDefaultConfig},set:function(_){g.defaultConfig=_}}]),g}();f.defaultConfig=void 0},"./src/is-supported.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"isSupported",function(){return E}),U.d(Z,"changeTypeSupported",function(){return A});var b=U("./src/utils/mediasource-helper.ts");function L(){return self.SourceBuffer||self.WebKitSourceBuffer}function E(){var w=Object(b.getMediaSource)();if(!w)return!1;var v=L(),u=w&&typeof w.isTypeSupported=="function"&&w.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),h=!v||v.prototype&&typeof v.prototype.appendBuffer=="function"&&typeof v.prototype.remove=="function";return!!u&&!!h}function A(){var w,v=L();return typeof(v==null||((w=v.prototype)===null||w===void 0)?void 0:w.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return i}),U.d(Z,"LoadError",function(){return c});var b=U("./src/polyfills/number.ts"),L=U("./src/errors.ts");function E(o,e){o.prototype=Object.create(e.prototype),o.prototype.constructor=o,h(o,e)}function A(o){var e=typeof Map=="function"?new Map:void 0;return A=function(r){if(r===null||!u(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(r))return e.get(r);e.set(r,d)}function d(){return w(r,arguments,a(this).constructor)}return d.prototype=Object.create(r.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),h(d,r)},A(o)}function w(o,e,s){return v()?w=Reflect.construct:w=function(d,f,g){var m=[null];m.push.apply(m,f);var p=Function.bind.apply(d,m),_=new p;return g&&h(_,g.prototype),_},w.apply(null,arguments)}function v(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(o){return!1}}function u(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function h(o,e){return h=Object.setPrototypeOf||function(r,d){return r.__proto__=d,r},h(o,e)}function a(o){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},a(o)}var t=Math.pow(2,17),i=function(){function o(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var e=o.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(r,d){var f=this,g=r.url;if(!g)return Promise.reject(new c({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:r,networkDetails:null},"Fragment does not have a "+(g?"part list":"url")));this.abort();var m=this.config,p=m.fLoader,_=m.loader;return new Promise(function(y,n){f.loader&&f.loader.destroy();var x=f.loader=r.loader=p?new p(m):new _(m),S=l(r),T={timeout:m.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:m.fragLoadingMaxRetryTimeout,highWaterMark:t};r.stats=x.stats,x.load(S,T,{onSuccess:function(D,I,B,G){f.resetLoader(r,x),y({frag:r,part:null,payload:D.data,networkDetails:G})},onError:function(D,I,B){f.resetLoader(r,x),n(new c({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:r,response:D,networkDetails:B}))},onAbort:function(D,I,B){f.resetLoader(r,x),n(new c({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:r,networkDetails:B}))},onTimeout:function(D,I,B){f.resetLoader(r,x),n(new c({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:r,networkDetails:B}))},onProgress:function(D,I,B,G){d&&d({frag:r,part:null,payload:B,networkDetails:G})}})})},e.loadPart=function(r,d,f){var g=this;this.abort();var m=this.config,p=m.fLoader,_=m.loader;return new Promise(function(y,n){g.loader&&g.loader.destroy();var x=g.loader=r.loader=p?new p(m):new _(m),S=l(r,d),T={timeout:m.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:m.fragLoadingMaxRetryTimeout,highWaterMark:t};d.stats=x.stats,x.load(S,T,{onSuccess:function(D,I,B,G){g.resetLoader(r,x),g.updateStatsFromPart(r,d);var k={frag:r,part:d,payload:D.data,networkDetails:G};f(k),y(k)},onError:function(D,I,B){g.resetLoader(r,x),n(new c({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:r,part:d,response:D,networkDetails:B}))},onAbort:function(D,I,B){r.stats.aborted=d.stats.aborted,g.resetLoader(r,x),n(new c({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:r,part:d,networkDetails:B}))},onTimeout:function(D,I,B){g.resetLoader(r,x),n(new c({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:r,part:d,networkDetails:B}))}})})},e.updateStatsFromPart=function(r,d){var f=r.stats,g=d.stats,m=g.total;if(f.loaded+=g.loaded,m){var p=Math.round(r.duration/d.duration),_=Math.min(Math.round(f.loaded/m),p),y=p-_,n=y*Math.round(f.loaded/_);f.total=f.loaded+n}else f.total=Math.max(f.loaded,f.total);var x=f.loading,S=g.loading;x.start?x.first+=S.first-S.start:(x.start=S.start,x.first=S.first),x.end=S.end},e.resetLoader=function(r,d){r.loader=null,this.loader===d&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),d.destroy()},o}();function l(o,e){e===void 0&&(e=null);var s=e||o,r={frag:o,part:e,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},d=s.byteRangeStartOffset,f=s.byteRangeEndOffset;return Object(b.isFiniteNumber)(d)&&Object(b.isFiniteNumber)(f)&&(r.rangeStart=d,r.rangeEnd=f),r}var c=function(o){E(e,o);function e(s){for(var r,d=arguments.length,f=new Array(d>1?d-1:0),g=1;g<d;g++)f[g-1]=arguments[g];return r=o.call.apply(o,[this].concat(f))||this,r.data=void 0,r.data=s,r}return e}(A(Error))},"./src/loader/fragment.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"ElementaryStreamTypes",function(){return i}),U.d(Z,"BaseSegment",function(){return l}),U.d(Z,"Fragment",function(){return c}),U.d(Z,"Part",function(){return o});var b=U("./src/polyfills/number.ts"),L=U("./node_modules/url-toolkit/src/url-toolkit.js"),E=U.n(L),A=U("./src/utils/logger.ts"),w=U("./src/loader/level-key.ts"),v=U("./src/loader/load-stats.ts");function u(e,s){e.prototype=Object.create(s.prototype),e.prototype.constructor=e,h(e,s)}function h(e,s){return h=Object.setPrototypeOf||function(d,f){return d.__proto__=f,d},h(e,s)}function a(e,s){for(var r=0;r<s.length;r++){var d=s[r];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,d.key,d)}}function t(e,s,r){return s&&a(e.prototype,s),r&&a(e,r),e}var i;(function(e){e.AUDIO="audio",e.VIDEO="video",e.AUDIOVIDEO="audiovideo"})(i||(i={}));var l=function(){function e(r){var d;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(d={},d[i.AUDIO]=null,d[i.VIDEO]=null,d[i.AUDIOVIDEO]=null,d),this.baseurl=r}var s=e.prototype;return s.setByteRange=function(d,f){var g=d.split("@",2),m=[];g.length===1?m[0]=f?f.byteRangeEndOffset:0:m[0]=parseInt(g[1]),m[1]=parseInt(g[0])+m[0],this._byteRange=m},t(e,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(L.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(d){this._url=d}}]),e}(),c=function(e){u(s,e);function s(d,f){var g;return g=e.call(this,f)||this,g._decryptdata=null,g.rawProgramDateTime=null,g.programDateTime=null,g.tagList=[],g.duration=0,g.sn=0,g.levelkey=void 0,g.type=void 0,g.loader=null,g.level=-1,g.cc=0,g.startPTS=void 0,g.endPTS=void 0,g.appendedPTS=void 0,g.startDTS=void 0,g.endDTS=void 0,g.start=0,g.deltaPTS=void 0,g.maxStartPTS=void 0,g.minEndPTS=void 0,g.stats=new v.LoadStats,g.urlId=0,g.data=void 0,g.bitrateTest=!1,g.title=null,g.initSegment=null,g.type=d,g}var r=s.prototype;return r.createInitializationVector=function(f){for(var g=new Uint8Array(16),m=12;m<16;m++)g[m]=f>>8*(15-m)&255;return g},r.setDecryptDataFromLevelKey=function(f,g){var m=f;return(f==null?void 0:f.method)==="AES-128"&&f.uri&&!f.iv&&(m=w.LevelKey.fromURI(f.uri),m.method=f.method,m.iv=this.createInitializationVector(g),m.keyFormat="identity"),m},r.setElementaryStreamInfo=function(f,g,m,p,_,y){y===void 0&&(y=!1);var n=this.elementaryStreams,x=n[f];if(!x){n[f]={startPTS:g,endPTS:m,startDTS:p,endDTS:_,partial:y};return}x.startPTS=Math.min(x.startPTS,g),x.endPTS=Math.max(x.endPTS,m),x.startDTS=Math.min(x.startDTS,p),x.endDTS=Math.max(x.endDTS,_)},r.clearElementaryStreamInfo=function(){var f=this.elementaryStreams;f[i.AUDIO]=null,f[i.VIDEO]=null,f[i.AUDIOVIDEO]=null},t(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var f=this.sn;typeof f!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&A.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),f=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,f)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(b.isFiniteNumber)(this.programDateTime))return null;var f=Object(b.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+f*1e3}},{key:"encrypted",get:function(){var f;return!!((f=this.decryptdata)!==null&&f!==void 0&&f.keyFormat&&this.decryptdata.uri)}}]),s}(l),o=function(e){u(s,e);function s(r,d,f,g,m){var p;p=e.call(this,f)||this,p.fragOffset=0,p.duration=0,p.gap=!1,p.independent=!1,p.relurl=void 0,p.fragment=void 0,p.index=void 0,p.stats=new v.LoadStats,p.duration=r.decimalFloatingPoint("DURATION"),p.gap=r.bool("GAP"),p.independent=r.bool("INDEPENDENT"),p.relurl=r.enumeratedString("URI"),p.fragment=d,p.index=g;var _=r.enumeratedString("BYTERANGE");return _&&p.setByteRange(_,m),m&&(p.fragOffset=m.fragOffset+m.duration),p}return t(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var d=this.elementaryStreams;return!!(d.audio||d.video||d.audiovideo)}}]),s}(l)},"./src/loader/key-loader.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return A});var b=U("./src/events.ts"),L=U("./src/errors.ts"),E=U("./src/utils/logger.ts"),A=function(){function w(u){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=u,this._registerListeners()}var v=w.prototype;return v._registerListeners=function(){this.hls.on(b.Events.KEY_LOADING,this.onKeyLoading,this)},v._unregisterListeners=function(){this.hls.off(b.Events.KEY_LOADING,this.onKeyLoading)},v.destroy=function(){this._unregisterListeners();for(var h in this.loaders){var a=this.loaders[h];a&&a.destroy()}this.loaders={}},v.onKeyLoading=function(h,a){var t=a.frag,i=t.type,l=this.loaders[i];if(!t.decryptdata){E.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var c=t.decryptdata.uri;if(c!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(l&&(E.logger.warn("abort previous key loader for type:"+i),l.abort()),!c){E.logger.warn("key uri is falsy");return}var e=o.loader,s=t.loader=this.loaders[i]=new e(o);this.decrypturl=c,this.decryptkey=null;var r={url:c,frag:t,responseType:"arraybuffer"},d={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(r,d,f)}else this.decryptkey&&(t.decryptdata.key=this.decryptkey,this.hls.trigger(b.Events.KEY_LOADED,{frag:t}))},v.loadsuccess=function(h,a,t){var i=t.frag;if(!i.decryptdata){E.logger.error("after key load, decryptdata unset");return}this.decryptkey=i.decryptdata.key=new Uint8Array(h.data),i.loader=null,delete this.loaders[i.type],this.hls.trigger(b.Events.KEY_LOADED,{frag:i})},v.loaderror=function(h,a){var t=a.frag,i=t.loader;i&&i.abort(),delete this.loaders[t.type],this.hls.trigger(b.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:t,response:h})},v.loadtimeout=function(h,a){var t=a.frag,i=t.loader;i&&i.abort(),delete this.loaders[t.type],this.hls.trigger(b.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:t})},w}()},"./src/loader/level-details.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"LevelDetails",function(){return w});var b=U("./src/polyfills/number.ts");function L(v,u){for(var h=0;h<u.length;h++){var a=u[h];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(v,a.key,a)}}function E(v,u,h){return u&&L(v.prototype,u),h&&L(v,h),v}var A=10,w=function(){function v(h){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=h}var u=v.prototype;return u.reloaded=function(a){if(!a){this.advanced=!0,this.updated=!0;return}var t=this.lastPartSn-a.lastPartSn,i=this.lastPartIndex-a.lastPartIndex;this.updated=this.endSN!==a.endSN||!!i||!!t,this.advanced=this.endSN>a.endSN||t>0||t===0&&i>0,this.updated||this.advanced?this.misses=Math.floor(a.misses*.6):this.misses=a.misses+1,this.availabilityDelay=a.availabilityDelay},E(v,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(b.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||A}},{key:"drift",get:function(){var a=this.driftEndTime-this.driftStartTime;if(a>0){var t=this.driftEnd-this.driftStart;return t*1e3/a}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var a;return(a=this.partList)!==null&&a!==void 0&&a.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var a;return(a=this.fragments)!==null&&a!==void 0&&a.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var a;return(a=this.partList)!==null&&a!==void 0&&a.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var a;return(a=this.partList)!==null&&a!==void 0&&a.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),v}()},"./src/loader/level-key.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"LevelKey",function(){return w});var b=U("./node_modules/url-toolkit/src/url-toolkit.js"),L=U.n(b);function E(v,u){for(var h=0;h<u.length;h++){var a=u[h];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(v,a.key,a)}}function A(v,u,h){return u&&E(v.prototype,u),h&&E(v,h),v}var w=function(){v.fromURL=function(h,a){return new v(h,a)},v.fromURI=function(h){return new v(h)};function v(u,h){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,h?this._uri=Object(b.buildAbsoluteURL)(u,h,{alwaysNormalize:!0}):this._uri=u}return A(v,[{key:"uri",get:function(){return this._uri}}]),v}()},"./src/loader/load-stats.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"LoadStats",function(){return b});var b=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return s});var b=U("./src/polyfills/number.ts"),L=U("./node_modules/url-toolkit/src/url-toolkit.js"),E=U.n(L),A=U("./src/loader/fragment.ts"),w=U("./src/loader/level-details.ts"),v=U("./src/loader/level-key.ts"),u=U("./src/utils/attr-list.ts"),h=U("./src/utils/logger.ts"),a=U("./src/utils/codecs.ts"),t=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,i=/#EXT-X-MEDIA:(.*)/g,l=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),c=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),o=/\.(mp4|m4s|m4v|m4a)$/i;function e(m){var p,_;return o.test((p=(_=L.parseURL(m))===null||_===void 0?void 0:_.path)!=null?p:"")}var s=function(){function m(){}return m.findGroup=function(_,y){for(var n=0;n<_.length;n++){var x=_[n];if(x.id===y)return x}},m.convertAVC1ToAVCOTI=function(_){var y=_.split(".");if(y.length>2){var n=y.shift()+".";return n+=parseInt(y.shift()).toString(16),n+=("000"+parseInt(y.shift()).toString(16)).substr(-4),n}return _},m.resolve=function(_,y){return L.buildAbsoluteURL(y,_,{alwaysNormalize:!0})},m.parseMasterPlaylist=function(_,y){var n=[],x={},S=!1;t.lastIndex=0;for(var T;(T=t.exec(_))!=null;)if(T[1]){var R=new u.AttrList(T[1]),D={attrs:R,bitrate:R.decimalInteger("AVERAGE-BANDWIDTH")||R.decimalInteger("BANDWIDTH"),name:R.NAME,url:m.resolve(T[2],y)},I=R.decimalResolution("RESOLUTION");I&&(D.width=I.width,D.height=I.height),r((R.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),D),D.videoCodec&&D.videoCodec.indexOf("avc1")!==-1&&(D.videoCodec=m.convertAVC1ToAVCOTI(D.videoCodec)),n.push(D)}else if(T[3]){var B=new u.AttrList(T[3]);B["DATA-ID"]&&(S=!0,x[B["DATA-ID"]]=B)}return{levels:n,sessionData:S?x:null}},m.parseMasterPlaylistMedia=function(_,y,n,x){x===void 0&&(x=[]);var S,T=[],R=0;for(i.lastIndex=0;(S=i.exec(_))!==null;){var D=new u.AttrList(S[1]);if(D.TYPE===n){var I={attrs:D,bitrate:0,id:R++,groupId:D["GROUP-ID"],instreamId:D["INSTREAM-ID"],name:D.NAME||D.LANGUAGE||"",type:n,default:D.bool("DEFAULT"),autoselect:D.bool("AUTOSELECT"),forced:D.bool("FORCED"),lang:D.LANGUAGE,url:D.URI?m.resolve(D.URI,y):""};if(x.length){var B=m.findGroup(x,I.groupId)||x[0];d(I,B,"audioCodec"),d(I,B,"textCodec")}T.push(I)}}return T},m.parseLevelPlaylist=function(_,y,n,x,S){var T=new w.LevelDetails(y),R=T.fragments,D=null,I=0,B=0,G=0,k=0,$=null,X=new A.Fragment(x,y),V,N,z,q=-1,ee=!1;for(l.lastIndex=0,T.m3u8=_;(V=l.exec(_))!==null;){ee&&(ee=!1,X=new A.Fragment(x,y),X.start=G,X.sn=I,X.cc=k,X.level=n,D&&(X.initSegment=D,X.rawProgramDateTime=D.rawProgramDateTime));var fe=V[1];if(fe){X.duration=parseFloat(fe);var ae=(" "+V[2]).slice(1);X.title=ae||null,X.tagList.push(ae?["INF",fe,ae]:["INF",fe])}else if(V[3])Object(b.isFiniteNumber)(X.duration)&&(X.start=G,z&&(X.levelkey=z),X.sn=I,X.level=n,X.cc=k,X.urlId=S,R.push(X),X.relurl=(" "+V[3]).slice(1),g(X,$),$=X,G+=X.duration,I++,B=0,ee=!0);else if(V[4]){var pe=(" "+V[4]).slice(1);$?X.setByteRange(pe,$):X.setByteRange(pe)}else if(V[5])X.rawProgramDateTime=(" "+V[5]).slice(1),X.tagList.push(["PROGRAM-DATE-TIME",X.rawProgramDateTime]),q===-1&&(q=R.length);else{if(V=V[0].match(c),!V){h.logger.warn("No matches on slow regex match for level playlist!");continue}for(N=1;N<V.length&&!(typeof V[N]!="undefined");N++);var se=(" "+V[N]).slice(1),ge=(" "+V[N+1]).slice(1),ie=V[N+2]?(" "+V[N+2]).slice(1):"";switch(se){case"PLAYLIST-TYPE":T.type=ge.toUpperCase();break;case"MEDIA-SEQUENCE":I=T.startSN=parseInt(ge);break;case"SKIP":{var te=new u.AttrList(ge),Q=te.decimalInteger("SKIPPED-SEGMENTS");if(Object(b.isFiniteNumber)(Q)){T.skippedSegments=Q;for(var me=Q;me--;)R.unshift(null);I+=Q}var re=te.enumeratedString("RECENTLY-REMOVED-DATERANGES");re&&(T.recentlyRemovedDateranges=re.split(" "));break}case"TARGETDURATION":T.targetduration=parseFloat(ge);break;case"VERSION":T.version=parseInt(ge);break;case"EXTM3U":break;case"ENDLIST":T.live=!1;break;case"#":(ge||ie)&&X.tagList.push(ie?[ge,ie]:[ge]);break;case"DIS":k++;case"GAP":X.tagList.push([se]);break;case"BITRATE":X.tagList.push([se,ge]);break;case"DISCONTINUITY-SEQ":k=parseInt(ge);break;case"KEY":{var J,be=new u.AttrList(ge),Ee=be.enumeratedString("METHOD"),Le=be.URI,H=be.hexadecimalInteger("IV"),C=be.enumeratedString("KEYFORMATVERSIONS"),O=be.enumeratedString("KEYID"),j=(J=be.enumeratedString("KEYFORMAT"))!=null?J:"identity",M=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(M.indexOf(j)>-1){h.logger.warn("Keyformat "+j+" is not supported from the manifest");continue}else if(j!=="identity")continue;Ee&&(z=v.LevelKey.fromURL(y,Le),Le&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ee)>=0&&(z.method=Ee,z.keyFormat=j,O&&(z.keyID=O),C&&(z.keyFormatVersions=C),z.iv=H));break}case"START":{var F=new u.AttrList(ge),oe=F.decimalFloatingPoint("TIME-OFFSET");Object(b.isFiniteNumber)(oe)&&(T.startTimeOffset=oe);break}case"MAP":{var ve=new u.AttrList(ge);X.relurl=ve.URI,ve.BYTERANGE&&X.setByteRange(ve.BYTERANGE),X.level=n,X.sn="initSegment",z&&(X.levelkey=z),X.initSegment=null,D=X,ee=!0;break}case"SERVER-CONTROL":{var ke=new u.AttrList(ge);T.canBlockReload=ke.bool("CAN-BLOCK-RELOAD"),T.canSkipUntil=ke.optionalFloat("CAN-SKIP-UNTIL",0),T.canSkipDateRanges=T.canSkipUntil>0&&ke.bool("CAN-SKIP-DATERANGES"),T.partHoldBack=ke.optionalFloat("PART-HOLD-BACK",0),T.holdBack=ke.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Oe=new u.AttrList(ge);T.partTarget=Oe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var De=T.partList;De||(De=T.partList=[]);var Ue=B>0?De[De.length-1]:void 0,Ke=B++,Pe=new A.Part(new u.AttrList(ge),X,y,Ke,Ue);De.push(Pe),X.duration+=Pe.duration;break}case"PRELOAD-HINT":{var Re=new u.AttrList(ge);T.preloadHint=Re;break}case"RENDITION-REPORT":{var xe=new u.AttrList(ge);T.renditionReports=T.renditionReports||[],T.renditionReports.push(xe);break}default:h.logger.warn("line parsed but not handled: "+V);break}}}$&&!$.relurl?(R.pop(),G-=$.duration,T.partList&&(T.fragmentHint=$)):T.partList&&(g(X,$),X.cc=k,T.fragmentHint=X);var we=R.length,Te=R[0],ue=R[we-1];if(G+=T.skippedSegments*T.targetduration,G>0&&we&&ue){T.averagetargetduration=G/we;var de=ue.sn;T.endSN=de!=="initSegment"?de:0,Te&&(T.startCC=Te.cc,Te.initSegment||T.fragments.every(function(_e){return _e.relurl&&e(_e.relurl)})&&(h.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),X=new A.Fragment(x,y),X.relurl=ue.relurl,X.level=n,X.sn="initSegment",Te.initSegment=X,T.needSidxRanges=!0))}else T.endSN=0,T.startCC=0;return T.fragmentHint&&(G+=T.fragmentHint.duration),T.totalduration=G,T.endCC=k,q>0&&f(R,q),T},m}();function r(m,p){["video","audio","text"].forEach(function(_){var y=m.filter(function(x){return Object(a.isCodecType)(x,_)});if(y.length){var n=y.filter(function(x){return x.lastIndexOf("avc1",0)===0||x.lastIndexOf("mp4a",0)===0});p[_+"Codec"]=n.length>0?n[0]:y[0],m=m.filter(function(x){return y.indexOf(x)===-1})}}),p.unknownCodecs=m}function d(m,p,_){var y=p[_];y&&(m[_]=y)}function f(m,p){for(var _=m[p],y=p;y--;){var n=m[y];if(!n)return;n.programDateTime=_.programDateTime-n.duration*1e3,_=n}}function g(m,p){m.rawProgramDateTime?m.programDateTime=Date.parse(m.rawProgramDateTime):p!=null&&p.programDateTime&&(m.programDateTime=p.endProgramDateTime),Object(b.isFiniteNumber)(m.programDateTime)||(m.programDateTime=null,m.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/polyfills/number.ts"),L=U("./src/events.ts"),E=U("./src/errors.ts"),A=U("./src/utils/logger.ts"),w=U("./src/utils/mp4-tools.ts"),v=U("./src/loader/m3u8-parser.ts"),u=U("./src/types/loader.ts"),h=U("./src/utils/attr-list.ts");function a(l){var c=l.type;switch(c){case u.PlaylistContextType.AUDIO_TRACK:return u.PlaylistLevelType.AUDIO;case u.PlaylistContextType.SUBTITLE_TRACK:return u.PlaylistLevelType.SUBTITLE;default:return u.PlaylistLevelType.MAIN}}function t(l,c){var o=l.url;return(o===void 0||o.indexOf("data:")===0)&&(o=c.url),o}var i=function(){function l(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var c=l.prototype;return c.registerListeners=function(){var e=this.hls;e.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},c.unregisterListeners=function(){var e=this.hls;e.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},c.createInternalLoader=function(e){var s=this.hls.config,r=s.pLoader,d=s.loader,f=r||d,g=new f(s);return e.loader=g,this.loaders[e.type]=g,g},c.getInternalLoader=function(e){return this.loaders[e.type]},c.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},c.destroyInternalLoaders=function(){for(var e in this.loaders){var s=this.loaders[e];s&&s.destroy(),this.resetInternalLoader(e)}},c.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},c.onManifestLoading=function(e,s){var r=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:u.PlaylistContextType.MANIFEST,url:r,deliveryDirectives:null})},c.onLevelLoading=function(e,s){var r=s.id,d=s.level,f=s.url,g=s.deliveryDirectives;this.load({id:r,groupId:null,level:d,responseType:"text",type:u.PlaylistContextType.LEVEL,url:f,deliveryDirectives:g})},c.onAudioTrackLoading=function(e,s){var r=s.id,d=s.groupId,f=s.url,g=s.deliveryDirectives;this.load({id:r,groupId:d,level:null,responseType:"text",type:u.PlaylistContextType.AUDIO_TRACK,url:f,deliveryDirectives:g})},c.onSubtitleTrackLoading=function(e,s){var r=s.id,d=s.groupId,f=s.url,g=s.deliveryDirectives;this.load({id:r,groupId:d,level:null,responseType:"text",type:u.PlaylistContextType.SUBTITLE_TRACK,url:f,deliveryDirectives:g})},c.load=function(e){var s,r=this.hls.config,d=this.getInternalLoader(e);if(d){var f=d.context;if(f&&f.url===e.url){A.logger.trace("[playlist-loader]: playlist request ongoing");return}A.logger.log("[playlist-loader]: aborting previous loader for type: "+e.type),d.abort()}var g,m,p,_;switch(e.type){case u.PlaylistContextType.MANIFEST:g=r.manifestLoadingMaxRetry,m=r.manifestLoadingTimeOut,p=r.manifestLoadingRetryDelay,_=r.manifestLoadingMaxRetryTimeout;break;case u.PlaylistContextType.LEVEL:case u.PlaylistContextType.AUDIO_TRACK:case u.PlaylistContextType.SUBTITLE_TRACK:g=0,m=r.levelLoadingTimeOut;break;default:g=r.levelLoadingMaxRetry,m=r.levelLoadingTimeOut,p=r.levelLoadingRetryDelay,_=r.levelLoadingMaxRetryTimeout;break}if(d=this.createInternalLoader(e),(s=e.deliveryDirectives)!==null&&s!==void 0&&s.part){var y;if(e.type===u.PlaylistContextType.LEVEL&&e.level!==null?y=this.hls.levels[e.level].details:e.type===u.PlaylistContextType.AUDIO_TRACK&&e.id!==null?y=this.hls.audioTracks[e.id].details:e.type===u.PlaylistContextType.SUBTITLE_TRACK&&e.id!==null&&(y=this.hls.subtitleTracks[e.id].details),y){var n=y.partTarget,x=y.targetduration;n&&x&&(m=Math.min(Math.max(n*3,x*.8)*1e3,m))}}var S={timeout:m,maxRetry:g,retryDelay:p,maxRetryDelay:_,highWaterMark:0},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};d.load(e,S,T)},c.loadsuccess=function(e,s,r,d){if(d===void 0&&(d=null),r.isSidxRequest){this.handleSidxRequest(e,r),this.handlePlaylistLoaded(e,s,r,d);return}this.resetInternalLoader(r.type);var f=e.data;if(f.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(e,r,"no EXTM3U delimiter",d);return}s.parsing.start=performance.now(),f.indexOf("#EXTINF:")>0||f.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(e,s,r,d):this.handleMasterPlaylist(e,s,r,d)},c.loaderror=function(e,s,r){r===void 0&&(r=null),this.handleNetworkError(s,r,!1,e)},c.loadtimeout=function(e,s,r){r===void 0&&(r=null),this.handleNetworkError(s,r,!0)},c.handleMasterPlaylist=function(e,s,r,d){var f=this.hls,g=e.data,m=t(e,r),p=v.default.parseMasterPlaylist(g,m),_=p.levels,y=p.sessionData;if(!_.length){this.handleManifestParsingError(e,r,"no level found in manifest",d);return}var n=_.map(function(I){return{id:I.attrs.AUDIO,audioCodec:I.audioCodec}}),x=_.map(function(I){return{id:I.attrs.SUBTITLES,textCodec:I.textCodec}}),S=v.default.parseMasterPlaylistMedia(g,m,"AUDIO",n),T=v.default.parseMasterPlaylistMedia(g,m,"SUBTITLES",x),R=v.default.parseMasterPlaylistMedia(g,m,"CLOSED-CAPTIONS");if(S.length){var D=S.some(function(I){return!I.url});!D&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(A.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),S.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new h.AttrList({}),bitrate:0,url:""}))}f.trigger(L.Events.MANIFEST_LOADED,{levels:_,audioTracks:S,subtitles:T,captions:R,url:m,stats:s,networkDetails:d,sessionData:y})},c.handleTrackOrLevelPlaylist=function(e,s,r,d){var f=this.hls,g=r.id,m=r.level,p=r.type,_=t(e,r),y=Object(b.isFiniteNumber)(g)?g:0,n=Object(b.isFiniteNumber)(m)?m:y,x=a(r),S=v.default.parseLevelPlaylist(e.data,_,n,x,y);if(!S.fragments.length){f.trigger(L.Events.ERROR,{type:E.ErrorTypes.NETWORK_ERROR,details:E.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof r.level=="number"?r.level:void 0});return}if(p===u.PlaylistContextType.MANIFEST){var T={attrs:new h.AttrList({}),bitrate:0,details:S,name:"",url:_};f.trigger(L.Events.MANIFEST_LOADED,{levels:[T],audioTracks:[],url:_,stats:s,networkDetails:d,sessionData:null})}if(s.parsing.end=performance.now(),S.needSidxRanges){var R,D=(R=S.fragments[0].initSegment)===null||R===void 0?void 0:R.url;this.load({url:D,isSidxRequest:!0,type:p,level:m,levelDetails:S,id:g,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}r.levelDetails=S,this.handlePlaylistLoaded(e,s,r,d)},c.handleSidxRequest=function(e,s){var r=Object(w.parseSegmentIndex)(new Uint8Array(e.data));if(!r)return;var d=r.references,f=s.levelDetails;d.forEach(function(g,m){var p=g.info,_=f.fragments[m];_.byteRange.length===0&&_.setByteRange(String(1+p.end-p.start)+"@"+String(p.start)),_.initSegment&&_.initSegment.setByteRange(String(r.moovEndOffset)+"@0")})},c.handleManifestParsingError=function(e,s,r,d){this.hls.trigger(L.Events.ERROR,{type:E.ErrorTypes.NETWORK_ERROR,details:E.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===u.PlaylistContextType.MANIFEST,url:e.url,reason:r,response:e,context:s,networkDetails:d})},c.handleNetworkError=function(e,s,r,d){r===void 0&&(r=!1),A.logger.warn("[playlist-loader]: A network "+(r?"timeout":"error")+" occurred while loading "+e.type+" level: "+e.level+" id: "+e.id+' group-id: "'+e.groupId+'"');var f=E.ErrorDetails.UNKNOWN,g=!1,m=this.getInternalLoader(e);switch(e.type){case u.PlaylistContextType.MANIFEST:f=r?E.ErrorDetails.MANIFEST_LOAD_TIMEOUT:E.ErrorDetails.MANIFEST_LOAD_ERROR,g=!0;break;case u.PlaylistContextType.LEVEL:f=r?E.ErrorDetails.LEVEL_LOAD_TIMEOUT:E.ErrorDetails.LEVEL_LOAD_ERROR,g=!1;break;case u.PlaylistContextType.AUDIO_TRACK:f=r?E.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:E.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,g=!1;break;case u.PlaylistContextType.SUBTITLE_TRACK:f=r?E.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:E.ErrorDetails.SUBTITLE_LOAD_ERROR,g=!1;break}m&&this.resetInternalLoader(e.type);var p={type:E.ErrorTypes.NETWORK_ERROR,details:f,fatal:g,url:e.url,loader:m,context:e,networkDetails:s};d&&(p.response=d),this.hls.trigger(L.Events.ERROR,p)},c.handlePlaylistLoaded=function(e,s,r,d){var f=r.type,g=r.level,m=r.id,p=r.groupId,_=r.loader,y=r.levelDetails,n=r.deliveryDirectives;if(!(y!=null&&y.targetduration)){this.handleManifestParsingError(e,r,"invalid target duration",d);return}if(!_)return;y.live&&(_.getCacheAge&&(y.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(y.ageHeader))&&(y.ageHeader=0));switch(f){case u.PlaylistContextType.MANIFEST:case u.PlaylistContextType.LEVEL:this.hls.trigger(L.Events.LEVEL_LOADED,{details:y,level:g||0,id:m||0,stats:s,networkDetails:d,deliveryDirectives:n});break;case u.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(L.Events.AUDIO_TRACK_LOADED,{details:y,id:m||0,groupId:p||"",stats:s,networkDetails:d,deliveryDirectives:n});break;case u.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(L.Events.SUBTITLE_TRACK_LOADED,{details:y,id:m||0,groupId:p||"",stats:s,networkDetails:d,deliveryDirectives:n});break}},l}();Z.default=i},"./src/polyfills/number.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"isFiniteNumber",function(){return b}),U.d(Z,"MAX_SAFE_INTEGER",function(){return L});var b=Number.isFinite||function(E){return typeof E=="number"&&isFinite(E)},L=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Se,Z,U){"use strict";U.r(Z);var b=function(){function L(){}return L.getSilentFrame=function(A,w){switch(A){case"mp4a.40.2":if(w===1)return new Uint8Array([0,200,0,128,35,128]);if(w===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(w===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(w===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(w===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(w===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(w===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(w===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(w===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},L}();Z.default=b},"./src/remux/mp4-generator.ts":function(Se,Z,U){"use strict";U.r(Z);var b=Math.pow(2,32)-1,L=function(){function E(){}return E.init=function(){E.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var w;for(w in E.types)E.types.hasOwnProperty(w)&&(E.types[w]=[w.charCodeAt(0),w.charCodeAt(1),w.charCodeAt(2),w.charCodeAt(3)]);var v=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),u=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);E.HDLR_TYPES={video:v,audio:u};var h=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);E.STTS=E.STSC=E.STCO=a,E.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),E.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),E.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),E.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var t=new Uint8Array([105,115,111,109]),i=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);E.FTYP=E.box(E.types.ftyp,t,l,t,i),E.DINF=E.box(E.types.dinf,E.box(E.types.dref,h))},E.box=function(w){for(var v=8,u=arguments.length,h=new Array(u>1?u-1:0),a=1;a<u;a++)h[a-1]=arguments[a];for(var t=h.length,i=t;t--;)v+=h[t].byteLength;var l=new Uint8Array(v);for(l[0]=v>>24&255,l[1]=v>>16&255,l[2]=v>>8&255,l[3]=v&255,l.set(w,4),t=0,v=8;t<i;t++)l.set(h[t],v),v+=h[t].byteLength;return l},E.hdlr=function(w){return E.box(E.types.hdlr,E.HDLR_TYPES[w])},E.mdat=function(w){return E.box(E.types.mdat,w)},E.mdhd=function(w,v){v*=w;var u=Math.floor(v/(b+1)),h=Math.floor(v%(b+1));return E.box(E.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,w>>24&255,w>>16&255,w>>8&255,w&255,u>>24,u>>16&255,u>>8&255,u&255,h>>24,h>>16&255,h>>8&255,h&255,85,196,0,0]))},E.mdia=function(w){return E.box(E.types.mdia,E.mdhd(w.timescale,w.duration),E.hdlr(w.type),E.minf(w))},E.mfhd=function(w){return E.box(E.types.mfhd,new Uint8Array([0,0,0,0,w>>24,w>>16&255,w>>8&255,w&255]))},E.minf=function(w){return w.type==="audio"?E.box(E.types.minf,E.box(E.types.smhd,E.SMHD),E.DINF,E.stbl(w)):E.box(E.types.minf,E.box(E.types.vmhd,E.VMHD),E.DINF,E.stbl(w))},E.moof=function(w,v,u){return E.box(E.types.moof,E.mfhd(w),E.traf(u,v))},E.moov=function(w){for(var v=w.length,u=[];v--;)u[v]=E.trak(w[v]);return E.box.apply(null,[E.types.moov,E.mvhd(w[0].timescale,w[0].duration)].concat(u).concat(E.mvex(w)))},E.mvex=function(w){for(var v=w.length,u=[];v--;)u[v]=E.trex(w[v]);return E.box.apply(null,[E.types.mvex].concat(u))},E.mvhd=function(w,v){v*=w;var u=Math.floor(v/(b+1)),h=Math.floor(v%(b+1)),a=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,w>>24&255,w>>16&255,w>>8&255,w&255,u>>24,u>>16&255,u>>8&255,u&255,h>>24,h>>16&255,h>>8&255,h&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return E.box(E.types.mvhd,a)},E.sdtp=function(w){var v=w.samples||[],u=new Uint8Array(4+v.length),h,a;for(h=0;h<v.length;h++)a=v[h].flags,u[h+4]=a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy;return E.box(E.types.sdtp,u)},E.stbl=function(w){return E.box(E.types.stbl,E.stsd(w),E.box(E.types.stts,E.STTS),E.box(E.types.stsc,E.STSC),E.box(E.types.stsz,E.STSZ),E.box(E.types.stco,E.STCO))},E.avc1=function(w){var v=[],u=[],h,a,t;for(h=0;h<w.sps.length;h++)a=w.sps[h],t=a.byteLength,v.push(t>>>8&255),v.push(t&255),v=v.concat(Array.prototype.slice.call(a));for(h=0;h<w.pps.length;h++)a=w.pps[h],t=a.byteLength,u.push(t>>>8&255),u.push(t&255),u=u.concat(Array.prototype.slice.call(a));var i=E.box(E.types.avcC,new Uint8Array([1,v[3],v[4],v[5],252|3,224|w.sps.length].concat(v).concat([w.pps.length]).concat(u))),l=w.width,c=w.height,o=w.pixelRatio[0],e=w.pixelRatio[1];return E.box(E.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,c>>8&255,c&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),i,E.box(E.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),E.box(E.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,e>>24,e>>16&255,e>>8&255,e&255])))},E.esds=function(w){var v=w.config.length;return new Uint8Array([0,0,0,0,3,23+v,0,1,0,4,15+v,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([v]).concat(w.config).concat([6,1,2]))},E.mp4a=function(w){var v=w.samplerate;return E.box(E.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,w.channelCount,0,16,0,0,0,0,v>>8&255,v&255,0,0]),E.box(E.types.esds,E.esds(w)))},E.mp3=function(w){var v=w.samplerate;return E.box(E.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,w.channelCount,0,16,0,0,0,0,v>>8&255,v&255,0,0]))},E.stsd=function(w){return w.type==="audio"?!w.isAAC&&w.codec==="mp3"?E.box(E.types.stsd,E.STSD,E.mp3(w)):E.box(E.types.stsd,E.STSD,E.mp4a(w)):E.box(E.types.stsd,E.STSD,E.avc1(w))},E.tkhd=function(w){var v=w.id,u=w.duration*w.timescale,h=w.width,a=w.height,t=Math.floor(u/(b+1)),i=Math.floor(u%(b+1));return E.box(E.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,v>>24&255,v>>16&255,v>>8&255,v&255,0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,i>>24,i>>16&255,i>>8&255,i&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,h>>8&255,h&255,0,0,a>>8&255,a&255,0,0]))},E.traf=function(w,v){var u=E.sdtp(w),h=w.id,a=Math.floor(v/(b+1)),t=Math.floor(v%(b+1));return E.box(E.types.traf,E.box(E.types.tfhd,new Uint8Array([0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255])),E.box(E.types.tfdt,new Uint8Array([1,0,0,0,a>>24,a>>16&255,a>>8&255,a&255,t>>24,t>>16&255,t>>8&255,t&255])),E.trun(w,u.length+16+20+8+16+8+8),u)},E.trak=function(w){return w.duration=w.duration||4294967295,E.box(E.types.trak,E.tkhd(w),E.mdia(w))},E.trex=function(w){var v=w.id;return E.box(E.types.trex,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},E.trun=function(w,v){var u=w.samples||[],h=u.length,a=12+16*h,t=new Uint8Array(a),i,l,c,o,e,s;for(v+=8+a,t.set([0,0,15,1,h>>>24&255,h>>>16&255,h>>>8&255,h&255,v>>>24&255,v>>>16&255,v>>>8&255,v&255],0),i=0;i<h;i++)l=u[i],c=l.duration,o=l.size,e=l.flags,s=l.cts,t.set([c>>>24&255,c>>>16&255,c>>>8&255,c&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,e.isLeading<<2|e.dependsOn,e.isDependedOn<<6|e.hasRedundancy<<4|e.paddingValue<<1|e.isNonSync,e.degradPrio&240<<8,e.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*i);return E.box(E.types.trun,t)},E.initSegment=function(w){E.types||E.init();var v=E.moov(w),u=new Uint8Array(E.FTYP.byteLength+v.byteLength);return u.set(E.FTYP),u.set(v,E.FTYP.byteLength),u},E}();L.types=void 0,L.HDLR_TYPES=void 0,L.STTS=void 0,L.STSC=void 0,L.STCO=void 0,L.STSZ=void 0,L.VMHD=void 0,L.SMHD=void 0,L.STSD=void 0,L.FTYP=void 0,L.DINF=void 0,Z.default=L},"./src/remux/mp4-remuxer.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return s}),U.d(Z,"normalizePts",function(){return r});var b=U("./src/polyfills/number.ts"),L=U("./src/remux/aac-helper.ts"),E=U("./src/remux/mp4-generator.ts"),A=U("./src/events.ts"),w=U("./src/errors.ts"),v=U("./src/utils/logger.ts"),u=U("./src/types/loader.ts"),h=U("./src/utils/timescale-conversion.ts");function a(){return a=Object.assign||function(m){for(var p=1;p<arguments.length;p++){var _=arguments[p];for(var y in _)Object.prototype.hasOwnProperty.call(_,y)&&(m[y]=_[y])}return m},a.apply(this,arguments)}var t=10*1e3,i=1024,l=1152,c=null,o=null,e=!1,s=function(){function m(_,y,n,x){if(x===void 0&&(x=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=_,this.config=y,this.typeSupported=n,this.ISGenerated=!1,c===null){var S=navigator.userAgent||"",T=S.match(/Chrome\/(\d+)/i);c=T?parseInt(T[1]):0}if(o===null){var R=navigator.userAgent.match(/Safari\/(\d+)/i);o=R?parseInt(R[1]):0}e=!!c&&c<75||!!o&&o<600}var p=m.prototype;return p.destroy=function(){},p.resetTimeStamp=function(y){v.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=y},p.resetNextTimestamp=function(){v.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},p.resetInitSegment=function(){v.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},p.getVideoStartPts=function(y){var n=!1,x=y.reduce(function(S,T){var R=T.pts-S;return R<-4294967296?(n=!0,r(S,T.pts)):R>0?S:T.pts},y[0].pts);return n&&v.logger.debug("PTS rollover detected"),x},p.remux=function(y,n,x,S,T,R,D,I){var B,G,k,$,X,V,N=T,z=T,q=y.pid>-1,ee=n.pid>-1,fe=n.samples.length,ae=y.samples.length>0,pe=fe>1,se=(!q||ae)&&(!ee||pe)||this.ISGenerated||D;if(se){this.ISGenerated||(k=this.generateIS(y,n,T));var ge=this.isVideoContiguous,ie=-1;if(pe&&(ie=d(n.samples),!ge&&this.config.forceKeyFrameOnDiscontinuity))if(V=!0,ie>0){v.logger.warn("[mp4-remuxer]: Dropped "+ie+" out of "+fe+" video samples due to a missing keyframe");var te=this.getVideoStartPts(n.samples);n.samples=n.samples.slice(ie),n.dropped+=ie,z+=(n.samples[0].pts-te)/(n.timescale||9e4)}else ie===-1&&(v.logger.warn("[mp4-remuxer]: No keyframe found out of "+fe+" video samples"),V=!1);if(this.ISGenerated){if(ae&&pe){var Q=this.getVideoStartPts(n.samples),me=r(y.samples[0].pts,Q)-Q,re=me/n.inputTimeScale;N+=Math.max(0,re),z+=Math.max(0,-re)}if(ae){if(y.samplerate||(v.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),k=this.generateIS(y,n,T)),G=this.remuxAudio(y,N,this.isAudioContiguous,R,ee||pe||I===u.PlaylistLevelType.AUDIO?z:void 0),pe){var J=G?G.endPTS-G.startPTS:0;n.inputTimeScale||(v.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),k=this.generateIS(y,n,T)),B=this.remuxVideo(n,z,ge,J)}}else pe&&(B=this.remuxVideo(n,z,ge,0));B&&(B.firstKeyFrame=ie,B.independent=ie!==-1)}}return this.ISGenerated&&(x.samples.length&&(X=this.remuxID3(x,T)),S.samples.length&&($=this.remuxText(S,T))),{audio:G,video:B,initSegment:k,independent:V,text:$,id3:X}},p.generateIS=function(y,n,x){var S=y.samples,T=n.samples,R=this.typeSupported,D={},I=!Object(b.isFiniteNumber)(this._initPTS),B="audio/mp4",G,k,$;if(I&&(G=k=Infinity),y.config&&S.length&&(y.timescale=y.samplerate,y.isAAC||(R.mpeg?(B="audio/mpeg",y.codec=""):R.mp3&&(y.codec="mp3")),D.audio={id:"audio",container:B,codec:y.codec,initSegment:!y.isAAC&&R.mpeg?new Uint8Array(0):E.default.initSegment([y]),metadata:{channelCount:y.channelCount}},I&&($=y.inputTimeScale,G=k=S[0].pts-Math.round($*x))),n.sps&&n.pps&&T.length&&(n.timescale=n.inputTimeScale,D.video={id:"main",container:"video/mp4",codec:n.codec,initSegment:E.default.initSegment([n]),metadata:{width:n.width,height:n.height}},I)){$=n.inputTimeScale;var X=this.getVideoStartPts(T),V=Math.round($*x);k=Math.min(k,r(T[0].dts,X)-V),G=Math.min(G,X-V)}if(Object.keys(D).length)return this.ISGenerated=!0,I&&(this._initPTS=G,this._initDTS=k),{tracks:D,initPTS:G,timescale:$}},p.remuxVideo=function(y,n,x,S){var T=y.inputTimeScale,R=y.samples,D=[],I=R.length,B=this._initPTS,G=this.nextAvcDts,k=8,$,X,V,N=Number.POSITIVE_INFINITY,z=Number.NEGATIVE_INFINITY,q=0,ee=!1;if(!x||G===null){var fe=n*T,ae=R[0].pts-r(R[0].dts,R[0].pts);G=fe-ae}for(var pe=0;pe<I;pe++){var se=R[pe];if(se.pts=r(se.pts-B,G),se.dts=r(se.dts-B,G),se.dts>se.pts){var ge=9e4*.2;q=Math.max(Math.min(q,se.pts-se.dts),-1*ge)}se.dts<R[pe>0?pe-1:pe].dts&&(ee=!0)}ee&&R.sort(function(et,Ge){var He=et.dts-Ge.dts,Ye=et.pts-Ge.pts;return He||Ye}),X=R[0].dts,V=R[R.length-1].dts;var ie=Math.round((V-X)/(I-1));if(q<0){if(q<ie*-2){v.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(h.toMsFromMpegTsClock)(-ie,!0)+" ms");for(var te=q,Q=0;Q<I;Q++)R[Q].dts=te=Math.max(te,R[Q].pts-ie),R[Q].pts=Math.max(te,R[Q].pts)}else{v.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(h.toMsFromMpegTsClock)(q,!0)+" ms to overcome this issue");for(var me=0;me<I;me++)R[me].dts=R[me].dts+q}X=R[0].dts}if(x){var re=X-G,J=re>ie,be=re<-1;if(J||be){J?v.logger.warn("AVC: "+Object(h.toMsFromMpegTsClock)(re,!0)+" ms ("+re+"dts) hole between fragments detected, filling it"):v.logger.warn("AVC: "+Object(h.toMsFromMpegTsClock)(-re,!0)+" ms ("+re+"dts) overlapping between fragments detected"),X=G;var Ee=R[0].pts-re;R[0].dts=X,R[0].pts=Ee,v.logger.log("Video: First PTS/DTS adjusted: "+Object(h.toMsFromMpegTsClock)(Ee,!0)+"/"+Object(h.toMsFromMpegTsClock)(X,!0)+", delta: "+Object(h.toMsFromMpegTsClock)(re,!0)+" ms")}}e&&(X=Math.max(0,X));for(var Le=0,H=0,C=0;C<I;C++){for(var O=R[C],j=O.units,M=j.length,F=0,oe=0;oe<M;oe++)F+=j[oe].data.length;H+=F,Le+=M,O.length=F,O.dts=Math.max(O.dts,X),O.pts=Math.max(O.pts,O.dts,0),N=Math.min(O.pts,N),z=Math.max(O.pts,z)}V=R[I-1].dts;var ve=H+4*Le+8,ke;try{ke=new Uint8Array(ve)}catch(et){this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:w.ErrorTypes.MUX_ERROR,details:w.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ve,reason:"fail allocating video mdat "+ve});return}var Oe=new DataView(ke.buffer);Oe.setUint32(0,ve),ke.set(E.default.types.mdat,4);for(var De=0;De<I;De++){for(var Ue=R[De],Ke=Ue.units,Pe=0,Re=0,xe=Ke.length;Re<xe;Re++){var we=Ke[Re],Te=we.data,ue=we.data.byteLength;Oe.setUint32(k,ue),k+=4,ke.set(Te,k),k+=ue,Pe+=4+ue}if(De<I-1)$=R[De+1].dts-Ue.dts;else{var de=this.config,_e=Ue.dts-R[De>0?De-1:De].dts;if(de.stretchShortVideoTrack&&this.nextAudioPts!==null){var ye=Math.floor(de.maxBufferHole*T),Ie=(S?N+S*T:this.nextAudioPts)-Ue.pts;Ie>ye?($=Ie-_e,$<0&&($=_e),v.logger.log("[mp4-remuxer]: It is approximately "+Ie/90+" ms to the next segment; using duration "+$/90+" ms for the last video frame.")):$=_e}else $=_e}var Me=Math.round(Ue.pts-Ue.dts);D.push(new f(Ue.key,$,Pe,Me))}if(D.length&&c&&c<70){var ze=D[0].flags;ze.dependsOn=2,ze.isNonSync=0}console.assert($!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=V+$,this.isVideoContiguous=!0;var st=E.default.moof(y.sequenceNumber++,X,a({},y,{samples:D})),nt="video",Ve={data1:st,data2:ke,startPTS:N/T,endPTS:(z+$)/T,startDTS:X/T,endDTS:G/T,type:nt,hasAudio:!1,hasVideo:!0,nb:D.length,dropped:y.dropped};return y.samples=[],y.dropped=0,console.assert(ke.length,"MDAT length must not be zero"),Ve},p.remuxAudio=function(y,n,x,S,T){var R=y.inputTimeScale,D=y.samplerate?y.samplerate:R,I=R/D,B=y.isAAC?i:l,G=B*I,k=this._initPTS,$=!y.isAAC&&this.typeSupported.mpeg,X=[],V=y.samples,N=$?0:8,z=this.nextAudioPts||-1,q=n*R;if(this.isAudioContiguous=x=x||V.length&&z>0&&(S&&Math.abs(q-z)<9e3||Math.abs(r(V[0].pts-k,q)-z)<20*G),V.forEach(function(Te){Te.pts=r(Te.pts-k,q)}),!x||z<0){if(V=V.filter(function(Te){return Te.pts>=0}),!V.length)return;T===0?z=0:S?z=Math.max(0,q):z=V[0].pts}if(y.isAAC)for(var ee=T!==void 0,fe=this.config.maxAudioFramesDrift,ae=0,pe=z;ae<V.length;ae++){var se=V[ae],ge=se.pts,ie=ge-pe,te=Math.abs(1e3*ie/R);if(ie<=-fe*G&&ee)ae===0&&(v.logger.warn("Audio frame @ "+(ge/R).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ie/R)+" ms."),this.nextAudioPts=z=pe=ge);else if(ie>=fe*G&&te<t&&ee){var Q=Math.round(ie/G);pe=ge-Q*G,pe<0&&(Q--,pe+=G),ae===0&&(this.nextAudioPts=z=pe),v.logger.warn("[mp4-remuxer]: Injecting "+Q+" audio frame @ "+(pe/R).toFixed(3)+"s due to "+Math.round(1e3*ie/R)+" ms gap.");for(var me=0;me<Q;me++){var re=Math.max(pe,0),J=L.default.getSilentFrame(y.manifestCodec||y.codec,y.channelCount);J||(v.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),J=se.unit.subarray()),V.splice(ae,0,{unit:J,pts:re}),pe+=G,ae++}}se.pts=pe,pe+=G}for(var be=null,Ee=null,Le,H=0,C=V.length;C--;)H+=V[C].unit.byteLength;for(var O=0,j=V.length;O<j;O++){var M=V[O],F=M.unit,oe=M.pts;if(Ee!==null){var ve=X[O-1];ve.duration=Math.round((oe-Ee)/I)}else if(x&&y.isAAC&&(oe=z),be=oe,H>0){H+=N;try{Le=new Uint8Array(H)}catch(Te){this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:w.ErrorTypes.MUX_ERROR,details:w.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:H,reason:"fail allocating audio mdat "+H});return}if(!$){var ke=new DataView(Le.buffer);ke.setUint32(0,H),Le.set(E.default.types.mdat,4)}}else return;Le.set(F,N);var Oe=F.byteLength;N+=Oe,X.push(new f(!0,B,Oe,0)),Ee=oe}var De=X.length;if(!De)return;var Ue=X[X.length-1];this.nextAudioPts=z=Ee+I*Ue.duration;var Ke=$?new Uint8Array(0):E.default.moof(y.sequenceNumber++,be/I,a({},y,{samples:X}));y.samples=[];var Pe=be/R,Re=z/R,xe="audio",we={data1:Ke,data2:Le,startPTS:Pe,endPTS:Re,startDTS:Pe,endDTS:Re,type:xe,hasAudio:!0,hasVideo:!1,nb:De};return this.isAudioContiguous=!0,console.assert(Le.length,"MDAT length must not be zero"),we},p.remuxEmptyAudio=function(y,n,x,S){var T=y.inputTimeScale,R=y.samplerate?y.samplerate:T,D=T/R,I=this.nextAudioPts,B=(I!==null?I:S.startDTS*T)+this._initDTS,G=S.endDTS*T+this._initDTS,k=D*i,$=Math.ceil((G-B)/k),X=L.default.getSilentFrame(y.manifestCodec||y.codec,y.channelCount);if(v.logger.warn("[mp4-remuxer]: remux empty Audio"),!X){v.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var V=[],N=0;N<$;N++){var z=B+N*k;V.push({unit:X,pts:z,dts:z})}return y.samples=V,this.remuxAudio(y,n,x,!1)},p.remuxID3=function(y,n){var x=y.samples.length;if(!x)return;for(var S=y.inputTimeScale,T=this._initPTS,R=this._initDTS,D=0;D<x;D++){var I=y.samples[D];I.pts=r(I.pts-T,n*S)/S,I.dts=r(I.dts-R,n*S)/S}var B=y.samples;return y.samples=[],{samples:B}},p.remuxText=function(y,n){var x=y.samples.length;if(!x)return;for(var S=y.inputTimeScale,T=this._initPTS,R=0;R<x;R++){var D=y.samples[R];D.pts=r(D.pts-T,n*S)/S}y.samples.sort(function(B,G){return B.pts-G.pts});var I=y.samples;return y.samples=[],{samples:I}},m}();function r(m,p){var _;if(p===null)return m;for(p<m?_=-8589934592:_=8589934592;Math.abs(m-p)>4294967296;)m+=_;return m}function d(m){for(var p=0;p<m.length;p++)if(m[p].key)return p;return-1}var f=function(p,_,y,n){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=_,this.size=y,this.cts=n,this.flags=new g(p)},g=function(p){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=p?2:1,this.isNonSync=p?0:1}},"./src/remux/passthrough-remuxer.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/polyfills/number.ts"),L=U("./src/utils/mp4-tools.ts"),E=U("./src/loader/fragment.ts"),A=U("./src/utils/logger.ts"),w=function(){function h(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var a=h.prototype;return a.destroy=function(){},a.resetTimeStamp=function(i){this.initPTS=i,this.lastEndDTS=null},a.resetNextTimestamp=function(){this.lastEndDTS=null},a.resetInitSegment=function(i,l,c){this.audioCodec=l,this.videoCodec=c,this.generateInitSegment(i),this.emitInitSegment=!0},a.generateInitSegment=function(i){var l=this.audioCodec,c=this.videoCodec;if(!i||!i.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(L.parseInitSegment)(i);l||(l=u(o.audio,E.ElementaryStreamTypes.AUDIO)),c||(c=u(o.video,E.ElementaryStreamTypes.VIDEO));var e={};o.audio&&o.video?e.audiovideo={container:"video/mp4",codec:l+","+c,initSegment:i,id:"main"}:o.audio?e.audio={container:"audio/mp4",codec:l,initSegment:i,id:"audio"}:o.video?e.video={container:"video/mp4",codec:c,initSegment:i,id:"main"}:A.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=e},a.remux=function(i,l,c,o,e){var s=this.initPTS,r=this.lastEndDTS,d={audio:void 0,video:void 0,text:o,id3:c,initSegment:void 0};Object(b.isFiniteNumber)(r)||(r=this.lastEndDTS=e||0);var f=l.samples;if(!f||!f.length)return d;var g={initPTS:void 0,timescale:1},m=this.initData;if((!m||!m.length)&&(this.generateInitSegment(f),m=this.initData),!m||!m.length)return A.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),d;this.emitInitSegment&&(g.tracks=this.initTracks,this.emitInitSegment=!1),Object(b.isFiniteNumber)(s)||(this.initPTS=g.initPTS=s=v(m,f,r));var p=Object(L.getDuration)(f,m),_=r,y=p+_;Object(L.offsetStartDTS)(m,f,s),p>0?this.lastEndDTS=y:(A.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var n=!!m.audio,x=!!m.video,S="";n&&(S+="audio"),x&&(S+="video");var T={data1:f,startPTS:_,startDTS:_,endPTS:y,endDTS:y,type:S,hasAudio:n,hasVideo:x,nb:1,dropped:0};return d.audio=T.type==="audio"?T:void 0,d.video=T.type!=="audio"?T:void 0,d.text=o,d.id3=c,d.initSegment=g,d},h}(),v=function(a,t,i){return Object(L.getStartDTS)(a,t)-i};function u(h,a){var t=h==null?void 0:h.codec;return t&&t.length>4?t:t==="hvc1"?"hvc1.1.c.L120.90":t==="av01"?"av01.0.04M.08":t==="avc1"||a===E.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Z.default=w},"./src/task-loop.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return b});var b=function(){function L(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var E=L.prototype;return E.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},E.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},E.onHandlerDestroyed=function(){},E.hasInterval=function(){return!!this._tickInterval},E.hasNextTick=function(){return!!this._tickTimer},E.setInterval=function(w){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,w),!0)},E.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},E.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},E.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},E.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},E.doTick=function(){},L}()},"./src/types/cmcd.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"CMCDVersion",function(){return b}),U.d(Z,"CMCDObjectType",function(){return L}),U.d(Z,"CMCDStreamingFormat",function(){return E}),U.d(Z,"CMCDStreamType",function(){return A});var b=1,L;(function(w){w.MANIFEST="m",w.AUDIO="a",w.VIDEO="v",w.MUXED="av",w.INIT="i",w.CAPTION="c",w.TIMED_TEXT="tt",w.KEY="k",w.OTHER="o"})(L||(L={}));var E;(function(w){w.DASH="d",w.HLS="h",w.SMOOTH="s",w.OTHER="o"})(E||(E={}));var A;(function(w){w.VOD="v",w.LIVE="l"})(A||(A={}))},"./src/types/level.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"HlsSkip",function(){return E}),U.d(Z,"getSkipValue",function(){return A}),U.d(Z,"HlsUrlParameters",function(){return w}),U.d(Z,"Level",function(){return v});function b(u,h){for(var a=0;a<h.length;a++){var t=h[a];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}function L(u,h,a){return h&&b(u.prototype,h),a&&b(u,a),u}var E;(function(u){u.No="",u.Yes="YES",u.v2="v2"})(E||(E={}));function A(u,h){var a=u.canSkipUntil,t=u.canSkipDateRanges,i=u.endSN,l=h!==void 0?h-i:0;return a&&l<a?t?E.v2:E.Yes:E.No}var w=function(){function u(a,t,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=a,this.part=t,this.skip=i}var h=u.prototype;return h.addDirectives=function(t){var i=new self.URL(t);return this.msn!==void 0&&i.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&i.searchParams.set("_HLS_part",this.part.toString()),this.skip&&i.searchParams.set("_HLS_skip",this.skip),i.toString()},u}(),v=function(){function u(h){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[h.url],this.attrs=h.attrs,this.bitrate=h.bitrate,h.details&&(this.details=h.details),this.id=h.id||0,this.name=h.name,this.width=h.width||0,this.height=h.height||0,this.audioCodec=h.audioCodec,this.videoCodec=h.videoCodec,this.unknownCodecs=h.unknownCodecs,this.codecSet=[h.videoCodec,h.audioCodec].filter(function(a){return a}).join(",").replace(/\.[^.,]+/g,"")}return L(u,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(a){var t=a%this.url.length;this._urlId!==t&&(this.details=void 0,this._urlId=t)}}]),u}()},"./src/types/loader.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"PlaylistContextType",function(){return b}),U.d(Z,"PlaylistLevelType",function(){return L});var b;(function(E){E.MANIFEST="manifest",E.LEVEL="level",E.AUDIO_TRACK="audioTrack",E.SUBTITLE_TRACK="subtitleTrack"})(b||(b={}));var L;(function(E){E.MAIN="main",E.AUDIO="audio",E.SUBTITLE="subtitle"})(L||(L={}))},"./src/types/transmuxer.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"ChunkMetadata",function(){return b});var b=function(A,w,v,u,h,a){u===void 0&&(u=0),h===void 0&&(h=-1),a===void 0&&(a=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=L(),this.buffering={audio:L(),video:L(),audiovideo:L()},this.level=A,this.sn=w,this.id=v,this.size=u,this.part=h,this.partial=a};function L(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"AttrList",function(){return E});var b=/^(\d+)x(\d+)$/,L=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,E=function(){function A(v){typeof v=="string"&&(v=A.parseAttrList(v));for(var u in v)v.hasOwnProperty(u)&&(this[u]=v[u])}var w=A.prototype;return w.decimalInteger=function(u){var h=parseInt(this[u],10);return h>Number.MAX_SAFE_INTEGER?Infinity:h},w.hexadecimalInteger=function(u){if(this[u]){var h=(this[u]||"0x").slice(2);h=(h.length&1?"0":"")+h;for(var a=new Uint8Array(h.length/2),t=0;t<h.length/2;t++)a[t]=parseInt(h.slice(t*2,t*2+2),16);return a}else return null},w.hexadecimalIntegerAsNumber=function(u){var h=parseInt(this[u],16);return h>Number.MAX_SAFE_INTEGER?Infinity:h},w.decimalFloatingPoint=function(u){return parseFloat(this[u])},w.optionalFloat=function(u,h){var a=this[u];return a?parseFloat(a):h},w.enumeratedString=function(u){return this[u]},w.bool=function(u){return this[u]==="YES"},w.decimalResolution=function(u){var h=b.exec(this[u]);return h===null?void 0:{width:parseInt(h[1],10),height:parseInt(h[2],10)}},A.parseAttrList=function(u){var h,a={},t='"';for(L.lastIndex=0;(h=L.exec(u))!==null;){var i=h[2];i.indexOf(t)===0&&i.lastIndexOf(t)===i.length-1&&(i=i.slice(1,-1)),a[h[1]]=i}return a},A}()},"./src/utils/binary-search.ts":function(Se,Z,U){"use strict";U.r(Z);var b={search:function(E,A){for(var w=0,v=E.length-1,u=null,h=null;w<=v;){u=(w+v)/2|0,h=E[u];var a=A(h);if(a>0)w=u+1;else if(a<0)v=u-1;else return h}return null}};Z.default=b},"./src/utils/buffer-helper.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"BufferHelper",function(){return E});var b=U("./src/utils/logger.ts"),L={length:0,start:function(){return 0},end:function(){return 0}},E=function(){function A(){}return A.isBuffered=function(v,u){try{if(v){for(var h=A.getBuffered(v),a=0;a<h.length;a++)if(u>=h.start(a)&&u<=h.end(a))return!0}}catch(t){}return!1},A.bufferInfo=function(v,u,h){try{if(v){var a=A.getBuffered(v),t=[],i;for(i=0;i<a.length;i++)t.push({start:a.start(i),end:a.end(i)});return this.bufferedInfo(t,u,h)}}catch(l){}return{len:0,start:u,end:u,nextStart:void 0}},A.bufferedInfo=function(v,u,h){u=Math.max(0,u),v.sort(function(g,m){var p=g.start-m.start;return p||m.end-g.end});var a=[];if(h)for(var t=0;t<v.length;t++){var i=a.length;if(i){var l=a[i-1].end;v[t].start-l<h?v[t].end>l&&(a[i-1].end=v[t].end):a.push(v[t])}else a.push(v[t])}else a=v;for(var c=0,o,e=u,s=u,r=0;r<a.length;r++){var d=a[r].start,f=a[r].end;if(u+h>=d&&u<f)e=d,s=f,c=s-u;else if(u+h<d){o=d;break}}return{len:c,start:e||0,end:s||0,nextStart:o}},A.getBuffered=function(v){try{return v.buffered}catch(u){return b.logger.log("failed to get media.buffered",u),L}},A}()},"./src/utils/cea-608-parser.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"Row",function(){return s}),U.d(Z,"CaptionScreen",function(){return r});var b=U("./src/utils/logger.ts"),L={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},E=function(y){var n=y;return L.hasOwnProperty(y)&&(n=L[y]),String.fromCharCode(n)},A=15,w=100,v={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},u={17:2,18:4,21:6,22:8,23:10,19:13,20:15},h={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},a={25:2,26:4,29:6,30:8,31:10,27:13,28:15},t=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],i;(function(_){_[_.ERROR=0]="ERROR",_[_.TEXT=1]="TEXT",_[_.WARNING=2]="WARNING",_[_.INFO=2]="INFO",_[_.DEBUG=3]="DEBUG",_[_.DATA=3]="DATA"})(i||(i={}));var l=function(){function _(){this.time=null,this.verboseLevel=i.ERROR}var y=_.prototype;return y.log=function(x,S){this.verboseLevel>=x&&b.logger.log(this.time+" ["+x+"] "+S)},_}(),c=function(y){for(var n=[],x=0;x<y.length;x++)n.push(y[x].toString(16));return n},o=function(){function _(n,x,S,T,R){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=n||"white",this.underline=x||!1,this.italics=S||!1,this.background=T||"black",this.flash=R||!1}var y=_.prototype;return y.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},y.setStyles=function(x){for(var S=["foreground","underline","italics","background","flash"],T=0;T<S.length;T++){var R=S[T];x.hasOwnProperty(R)&&(this[R]=x[R])}},y.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},y.equals=function(x){return this.foreground===x.foreground&&this.underline===x.underline&&this.italics===x.italics&&this.background===x.background&&this.flash===x.flash},y.copy=function(x){this.foreground=x.foreground,this.underline=x.underline,this.italics=x.italics,this.background=x.background,this.flash=x.flash},y.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},_}(),e=function(){function _(n,x,S,T,R,D){this.uchar=void 0,this.penState=void 0,this.uchar=n||" ",this.penState=new o(x,S,T,R,D)}var y=_.prototype;return y.reset=function(){this.uchar=" ",this.penState.reset()},y.setChar=function(x,S){this.uchar=x,this.penState.copy(S)},y.setPenState=function(x){this.penState.copy(x)},y.equals=function(x){return this.uchar===x.uchar&&this.penState.equals(x.penState)},y.copy=function(x){this.uchar=x.uchar,this.penState.copy(x.penState)},y.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},_}(),s=function(){function _(n){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var x=0;x<w;x++)this.chars.push(new e);this.logger=n,this.pos=0,this.currPenState=new o}var y=_.prototype;return y.equals=function(x){for(var S=!0,T=0;T<w;T++)if(!this.chars[T].equals(x.chars[T])){S=!1;break}return S},y.copy=function(x){for(var S=0;S<w;S++)this.chars[S].copy(x.chars[S])},y.isEmpty=function(){for(var x=!0,S=0;S<w;S++)if(!this.chars[S].isEmpty()){x=!1;break}return x},y.setCursor=function(x){this.pos!==x&&(this.pos=x),this.pos<0?(this.logger.log(i.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>w&&(this.logger.log(i.DEBUG,"Too large cursor position "+this.pos),this.pos=w)},y.moveCursor=function(x){var S=this.pos+x;if(x>1)for(var T=this.pos+1;T<S+1;T++)this.chars[T].setPenState(this.currPenState);this.setCursor(S)},y.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},y.insertChar=function(x){x>=144&&this.backSpace();var S=E(x);if(this.pos>=w){this.logger.log(i.ERROR,"Cannot insert "+x.toString(16)+" ("+S+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(S,this.currPenState),this.moveCursor(1)},y.clearFromPos=function(x){var S;for(S=x;S<w;S++)this.chars[S].reset()},y.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},y.clearToEndOfRow=function(){this.clearFromPos(this.pos)},y.getTextString=function(){for(var x=[],S=!0,T=0;T<w;T++){var R=this.chars[T].uchar;R!==" "&&(S=!1),x.push(R)}return S?"":x.join("")},y.setPenStyles=function(x){this.currPenState.setStyles(x);var S=this.chars[this.pos];S.setPenState(this.currPenState)},_}(),r=function(){function _(n){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var x=0;x<A;x++)this.rows.push(new s(n));this.logger=n,this.currRow=A-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var y=_.prototype;return y.reset=function(){for(var x=0;x<A;x++)this.rows[x].clear();this.currRow=A-1},y.equals=function(x){for(var S=!0,T=0;T<A;T++)if(!this.rows[T].equals(x.rows[T])){S=!1;break}return S},y.copy=function(x){for(var S=0;S<A;S++)this.rows[S].copy(x.rows[S])},y.isEmpty=function(){for(var x=!0,S=0;S<A;S++)if(!this.rows[S].isEmpty()){x=!1;break}return x},y.backSpace=function(){var x=this.rows[this.currRow];x.backSpace()},y.clearToEndOfRow=function(){var x=this.rows[this.currRow];x.clearToEndOfRow()},y.insertChar=function(x){var S=this.rows[this.currRow];S.insertChar(x)},y.setPen=function(x){var S=this.rows[this.currRow];S.setPenStyles(x)},y.moveCursor=function(x){var S=this.rows[this.currRow];S.moveCursor(x)},y.setCursor=function(x){this.logger.log(i.INFO,"setCursor: "+x);var S=this.rows[this.currRow];S.setCursor(x)},y.setPAC=function(x){this.logger.log(i.INFO,"pacData = "+JSON.stringify(x));var S=x.row-1;if(this.nrRollUpRows&&S<this.nrRollUpRows-1&&(S=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==S){for(var T=0;T<A;T++)this.rows[T].clear();var R=this.currRow+1-this.nrRollUpRows,D=this.lastOutputScreen;if(D){var I=D.rows[R].cueStartTime,B=this.logger.time;if(I&&B!==null&&I<B)for(var G=0;G<this.nrRollUpRows;G++)this.rows[S-this.nrRollUpRows+G+1].copy(D.rows[R+G])}}this.currRow=S;var k=this.rows[this.currRow];if(x.indent!==null){var $=x.indent,X=Math.max($-1,0);k.setCursor(x.indent),x.color=k.chars[X].penState.foreground}var V={foreground:x.color,underline:x.underline,italics:x.italics,background:"black",flash:!1};this.setPen(V)},y.setBkgData=function(x){this.logger.log(i.INFO,"bkgData = "+JSON.stringify(x)),this.backSpace(),this.setPen(x),this.insertChar(32)},y.setRollUpRows=function(x){this.nrRollUpRows=x},y.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(i.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(i.TEXT,this.getDisplayText());var x=this.currRow+1-this.nrRollUpRows,S=this.rows.splice(x,1)[0];S.clear(),this.rows.splice(this.currRow,0,S),this.logger.log(i.INFO,"Rolling up")},y.getDisplayText=function(x){x=x||!1;for(var S=[],T="",R=-1,D=0;D<A;D++){var I=this.rows[D].getTextString();I&&(R=D+1,x?S.push("Row "+R+": '"+I+"'"):S.push(I.trim()))}return S.length>0&&(x?T="["+S.join(" | ")+"]":T=S.join(`
`)),T},y.getTextAndFormat=function(){return this.rows},_}(),d=function(){function _(n,x,S){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=n,this.outputFilter=x,this.mode=null,this.verbose=0,this.displayedMemory=new r(S),this.nonDisplayedMemory=new r(S),this.lastOutputScreen=new r(S),this.currRollUpRow=this.displayedMemory.rows[A-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=S}var y=_.prototype;return y.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[A-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},y.getHandler=function(){return this.outputFilter},y.setHandler=function(x){this.outputFilter=x},y.setPAC=function(x){this.writeScreen.setPAC(x)},y.setBkgData=function(x){this.writeScreen.setBkgData(x)},y.setMode=function(x){if(x===this.mode)return;this.mode=x,this.logger.log(i.INFO,"MODE="+x),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=x},y.insertChars=function(x){for(var S=0;S<x.length;S++)this.writeScreen.insertChar(x[S]);var T=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(i.INFO,T+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(i.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},y.ccRCL=function(){this.logger.log(i.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},y.ccBS=function(){if(this.logger.log(i.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},y.ccAOF=function(){},y.ccAON=function(){},y.ccDER=function(){this.logger.log(i.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},y.ccRU=function(x){this.logger.log(i.INFO,"RU("+x+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(x)},y.ccFON=function(){this.logger.log(i.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},y.ccRDC=function(){this.logger.log(i.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},y.ccTR=function(){this.logger.log(i.INFO,"TR"),this.setMode("MODE_TEXT")},y.ccRTD=function(){this.logger.log(i.INFO,"RTD"),this.setMode("MODE_TEXT")},y.ccEDM=function(){this.logger.log(i.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},y.ccCR=function(){this.logger.log(i.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},y.ccENM=function(){this.logger.log(i.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},y.ccEOC=function(){if(this.logger.log(i.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var x=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=x,this.writeScreen=this.nonDisplayedMemory,this.logger.log(i.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},y.ccTO=function(x){this.logger.log(i.INFO,"TO("+x+") - Tab Offset"),this.writeScreen.moveCursor(x)},y.ccMIDROW=function(x){var S={flash:!1};if(S.underline=x%2===1,S.italics=x>=46,S.italics)S.foreground="white";else{var T=Math.floor(x/2)-16,R=["white","green","blue","cyan","red","yellow","magenta"];S.foreground=R[T]}this.logger.log(i.INFO,"MIDROW: "+JSON.stringify(S)),this.writeScreen.setPen(S)},y.outputDataUpdate=function(x){x===void 0&&(x=!1);var S=this.logger.time;if(S===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=S:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,S,this.lastOutputScreen),x&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:S),this.lastOutputScreen.copy(this.displayedMemory))},y.cueSplitAtTime=function(x){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,x,this.displayedMemory),this.cueStartTime=x))},_}(),f=function(){function _(n,x,S){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var T=new l;this.channels=[null,new d(n,x,T),new d(n+1,S,T)],this.cmdHistory=p(),this.logger=T}var y=_.prototype;return y.getHandler=function(x){return this.channels[x].getHandler()},y.setHandler=function(x,S){this.channels[x].setHandler(S)},y.addData=function(x,S){var T,R,D,I=!1;this.logger.time=x;for(var B=0;B<S.length;B+=2){if(R=S[B]&127,D=S[B+1]&127,R===0&&D===0)continue;if(this.logger.log(i.DATA,"["+c([S[B],S[B+1]])+"] -> ("+c([R,D])+")"),T=this.parseCmd(R,D),T||(T=this.parseMidrow(R,D)),T||(T=this.parsePAC(R,D)),T||(T=this.parseBackgroundAttributes(R,D)),!T&&(I=this.parseChars(R,D),I)){var G=this.currentChannel;if(G&&G>0){var k=this.channels[G];k.insertChars(I)}else this.logger.log(i.WARNING,"No channel found yet. TEXT-MODE?")}!T&&!I&&this.logger.log(i.WARNING,"Couldn't parse cleaned data "+c([R,D])+" orig: "+c([S[B],S[B+1]]))}},y.parseCmd=function(x,S){var T=this.cmdHistory,R=(x===20||x===28||x===21||x===29)&&S>=32&&S<=47,D=(x===23||x===31)&&S>=33&&S<=35;if(!(R||D))return!1;if(m(x,S,T))return g(null,null,T),this.logger.log(i.DEBUG,"Repeated command ("+c([x,S])+") is dropped"),!0;var I=x===20||x===21||x===23?1:2,B=this.channels[I];return x===20||x===21||x===28||x===29?S===32?B.ccRCL():S===33?B.ccBS():S===34?B.ccAOF():S===35?B.ccAON():S===36?B.ccDER():S===37?B.ccRU(2):S===38?B.ccRU(3):S===39?B.ccRU(4):S===40?B.ccFON():S===41?B.ccRDC():S===42?B.ccTR():S===43?B.ccRTD():S===44?B.ccEDM():S===45?B.ccCR():S===46?B.ccENM():S===47&&B.ccEOC():B.ccTO(S-32),g(x,S,T),this.currentChannel=I,!0},y.parseMidrow=function(x,S){var T=0;if((x===17||x===25)&&S>=32&&S<=47){if(x===17?T=1:T=2,T!==this.currentChannel)return this.logger.log(i.ERROR,"Mismatch channel in midrow parsing"),!1;var R=this.channels[T];return R?(R.ccMIDROW(S),this.logger.log(i.DEBUG,"MIDROW ("+c([x,S])+")"),!0):!1}return!1},y.parsePAC=function(x,S){var T,R=this.cmdHistory,D=(x>=17&&x<=23||x>=25&&x<=31)&&S>=64&&S<=127,I=(x===16||x===24)&&S>=64&&S<=95;if(!(D||I))return!1;if(m(x,S,R))return g(null,null,R),!0;var B=x<=23?1:2;S>=64&&S<=95?T=B===1?v[x]:h[x]:T=B===1?u[x]:a[x];var G=this.channels[B];return G?(G.setPAC(this.interpretPAC(T,S)),g(x,S,R),this.currentChannel=B,!0):!1},y.interpretPAC=function(x,S){var T,R={color:null,italics:!1,indent:null,underline:!1,row:x};return S>95?T=S-96:T=S-64,R.underline=(T&1)===1,T<=13?R.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(T/2)]:T<=15?(R.italics=!0,R.color="white"):R.indent=Math.floor((T-16)/2)*4,R},y.parseChars=function(x,S){var T,R=null,D=null;if(x>=25?(T=2,D=x-8):(T=1,D=x),D>=17&&D<=19){var I;D===17?I=S+80:D===18?I=S+112:I=S+144,this.logger.log(i.INFO,"Special char '"+E(I)+"' in channel "+T),R=[I]}else x>=32&&x<=127&&(R=S===0?[x]:[x,S]);if(R){var B=c(R);this.logger.log(i.DEBUG,"Char codes = "+B.join(",")),g(x,S,this.cmdHistory)}return R},y.parseBackgroundAttributes=function(x,S){var T=(x===16||x===24)&&S>=32&&S<=47,R=(x===23||x===31)&&S>=45&&S<=47;if(!(T||R))return!1;var D,I={};x===16||x===24?(D=Math.floor((S-32)/2),I.background=t[D],S%2===1&&(I.background=I.background+"_semi")):S===45?I.background="transparent":(I.foreground="black",S===47&&(I.underline=!0));var B=x<=23?1:2,G=this.channels[B];return G.setBkgData(I),g(x,S,this.cmdHistory),!0},y.reset=function(){for(var x=0;x<Object.keys(this.channels).length;x++){var S=this.channels[x];S&&S.reset()}this.cmdHistory=p()},y.cueSplitAtTime=function(x){for(var S=0;S<this.channels.length;S++){var T=this.channels[S];T&&T.cueSplitAtTime(x)}},_}();function g(_,y,n){n.a=_,n.b=y}function m(_,y,n){return n.a===_&&n.b===y}function p(){return{a:null,b:null}}Z.default=f},"./src/utils/codecs.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"isCodecType",function(){return L}),U.d(Z,"isCodecSupportedInMp4",function(){return E});var b={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function L(A,w){var v=b[w];return!!v&&v[A.slice(0,4)]===!0}function E(A,w){return MediaSource.isTypeSupported((w||"video")+'/mp4;codecs="'+A+'"')}},"./src/utils/cues.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/utils/vttparser.ts"),L=U("./src/utils/webvtt-parser.ts"),E=U("./src/utils/texttrack-utils.ts"),A=/\s/,w={newCue:function(u,h,a,t){for(var i=[],l,c,o,e,s,r=self.VTTCue||self.TextTrackCue,d=0;d<t.rows.length;d++)if(l=t.rows[d],o=!0,e=0,s="",!l.isEmpty()){for(var f=0;f<l.chars.length;f++)A.test(l.chars[f].uchar)&&o?e++:(s+=l.chars[f].uchar,o=!1);l.cueStartTime=h,h===a&&(a+=1e-4),e>=16?e--:e++;var g=Object(b.fixLineBreaks)(s.trim()),m=Object(L.generateCueId)(h,a,g);(!u||!u.cues||!u.cues.getCueById(m))&&(c=new r(h,a,g),c.id=m,c.line=d+1,c.align="left",c.position=10+Math.min(80,Math.floor(e*8/32)*10),i.push(c))}return u&&i.length&&(i.sort(function(p,_){return p.line==="auto"||_.line==="auto"?0:p.line>8&&_.line>8?_.line-p.line:p.line-_.line}),i.forEach(function(p){return Object(E.addCueToTrack)(u,p)})),i}};Z.default=w},"./src/utils/discontinuities.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"findFirstFragWithCC",function(){return A}),U.d(Z,"shouldAlignOnDiscontinuities",function(){return w}),U.d(Z,"findDiscontinuousReferenceFrag",function(){return v}),U.d(Z,"adjustSlidingStart",function(){return h}),U.d(Z,"alignStream",function(){return a}),U.d(Z,"alignPDT",function(){return i}),U.d(Z,"alignFragmentByPDTDelta",function(){return l}),U.d(Z,"alignMediaPlaylistByPDT",function(){return c});var b=U("./src/polyfills/number.ts"),L=U("./src/utils/logger.ts"),E=U("./src/controller/level-helper.ts");function A(o,e){for(var s=null,r=0,d=o.length;r<d;r++){var f=o[r];if(f&&f.cc===e){s=f;break}}return s}function w(o,e,s){return!!(e.details&&(s.endCC>s.startCC||o&&o.cc<s.startCC))}function v(o,e){var s=o.fragments,r=e.fragments;if(!r.length||!s.length){L.logger.log("No fragments to align");return}var d=A(s,r[0].cc);if(!d||d&&!d.startPTS){L.logger.log("No frag in previous level to align on");return}return d}function u(o,e){if(o){var s=o.start+e;o.start=o.startPTS=s,o.endPTS=s+o.duration}}function h(o,e){for(var s=e.fragments,r=0,d=s.length;r<d;r++)u(s[r],o);e.fragmentHint&&u(e.fragmentHint,o),e.alignedSliding=!0}function a(o,e,s){if(!e)return;t(o,s,e),!s.alignedSliding&&e.details&&i(s,e.details),!s.alignedSliding&&e.details&&!s.skippedSegments&&Object(E.adjustSliding)(e.details,s)}function t(o,e,s){if(w(o,s,e)){var r=v(s.details,e);r&&Object(b.isFiniteNumber)(r.start)&&(L.logger.log("Adjusting PTS using last level due to CC increase within current level "+e.url),h(r.start,e))}}function i(o,e){if(!e.fragments.length||!o.hasProgramDateTime||!e.hasProgramDateTime)return;var s=e.fragments[0].programDateTime,r=o.fragments[0].programDateTime,d=(r-s)/1e3+e.fragments[0].start;d&&Object(b.isFiniteNumber)(d)&&(L.logger.log("Adjusting PTS using programDateTime delta "+(r-s)+"ms, sliding:"+d.toFixed(3)+" "+o.url+" "),h(d,o))}function l(o,e){var s=o.programDateTime;if(!s)return;var r=(s-e)/1e3;o.start=o.startPTS=r,o.endPTS=r+o.duration}function c(o,e){if(!e.fragments.length||!o.hasProgramDateTime||!e.hasProgramDateTime)return;var s=e.fragments[0].programDateTime,r=e.fragments[0].start,d=s-r*1e3;o.fragments.forEach(function(f){l(f,d)}),o.fragmentHint&&l(o.fragmentHint,d),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/utils/ewma.ts"),L=function(){function E(w,v,u){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=u,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new b.default(w),this.fast_=new b.default(v)}var A=E.prototype;return A.update=function(v,u){var h=this.slow_,a=this.fast_;this.slow_.halfLife!==v&&(this.slow_=new b.default(v,h.getEstimate(),h.getTotalWeight())),this.fast_.halfLife!==u&&(this.fast_=new b.default(u,a.getEstimate(),a.getTotalWeight()))},A.sample=function(v,u){v=Math.max(v,this.minDelayMs_);var h=8*u,a=v/1e3,t=h/a;this.fast_.sample(a,t),this.slow_.sample(a,t)},A.canEstimate=function(){var v=this.fast_;return v&&v.getTotalWeight()>=this.minWeight_},A.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},A.destroy=function(){},E}();Z.default=L},"./src/utils/ewma.ts":function(Se,Z,U){"use strict";U.r(Z);var b=function(){function L(A,w,v){w===void 0&&(w=0),v===void 0&&(v=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=A,this.alpha_=A?Math.exp(Math.log(.5)/A):0,this.estimate_=w,this.totalWeight_=v}var E=L.prototype;return E.sample=function(w,v){var u=Math.pow(this.alpha_,w);this.estimate_=v*(1-u)+u*this.estimate_,this.totalWeight_+=w},E.getTotalWeight=function(){return this.totalWeight_},E.getEstimate=function(){if(this.alpha_){var w=1-Math.pow(this.alpha_,this.totalWeight_);if(w)return this.estimate_/w}return this.estimate_},L}();Z.default=b},"./src/utils/fetch-loader.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"fetchSupported",function(){return l});var b=U("./src/polyfills/number.ts"),L=U("./src/loader/load-stats.ts"),E=U("./src/demux/chunk-cache.ts");function A(r,d){r.prototype=Object.create(d.prototype),r.prototype.constructor=r,a(r,d)}function w(r){var d=typeof Map=="function"?new Map:void 0;return w=function(g){if(g===null||!h(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof d!="undefined"){if(d.has(g))return d.get(g);d.set(g,m)}function m(){return v(g,arguments,t(this).constructor)}return m.prototype=Object.create(g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),a(m,g)},w(r)}function v(r,d,f){return u()?v=Reflect.construct:v=function(m,p,_){var y=[null];y.push.apply(y,p);var n=Function.bind.apply(m,y),x=new n;return _&&a(x,_.prototype),x},v.apply(null,arguments)}function u(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}function h(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function a(r,d){return a=Object.setPrototypeOf||function(g,m){return g.__proto__=m,g},a(r,d)}function t(r){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)},t(r)}function i(){return i=Object.assign||function(r){for(var d=1;d<arguments.length;d++){var f=arguments[d];for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(r[g]=f[g])}return r},i.apply(this,arguments)}function l(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(r){}return!1}var c=function(){function r(f){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=f.fetchSetup||e,this.controller=new self.AbortController,this.stats=new L.LoadStats}var d=r.prototype;return d.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},d.abortInternal=function(){var g=this.response;(!g||!g.ok)&&(this.stats.aborted=!0,this.controller.abort())},d.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},d.load=function(g,m,p){var _=this,y=this.stats;if(y.loading.start)throw new Error("Loader can only be used once.");y.loading.start=self.performance.now();var n=o(g,this.controller.signal),x=p.onProgress,S=g.responseType==="arraybuffer",T=S?"byteLength":"length";this.context=g,this.config=m,this.callbacks=p,this.request=this.fetchSetup(g,n),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){_.abortInternal(),p.onTimeout(y,g,_.response)},m.timeout),self.fetch(this.request).then(function(R){if(_.response=_.loader=R,!R.ok){var D=R.status,I=R.statusText;throw new s(I||"fetch, bad network response",D,R)}return y.loading.first=Math.max(self.performance.now(),y.loading.start),y.total=parseInt(R.headers.get("Content-Length")||"0"),x&&Object(b.isFiniteNumber)(m.highWaterMark)?_.loadProgressively(R,y,g,m.highWaterMark,x):S?R.arrayBuffer():R.text()}).then(function(R){var D=_.response;self.clearTimeout(_.requestTimeout),y.loading.end=Math.max(self.performance.now(),y.loading.first),y.loaded=y.total=R[T];var I={url:D.url,data:R};x&&!Object(b.isFiniteNumber)(m.highWaterMark)&&x(y,g,R,D),p.onSuccess(I,y,g,D)}).catch(function(R){if(self.clearTimeout(_.requestTimeout),y.aborted)return;var D=R.code||0;p.onError({code:D,text:R.message},g,R.details)})},d.getCacheAge=function(){var g=null;if(this.response){var m=this.response.headers.get("age");g=m?parseFloat(m):null}return g},d.loadProgressively=function(g,m,p,_,y){_===void 0&&(_=0);var n=new E.default,x=g.body.getReader(),S=function T(){return x.read().then(function(R){if(R.done)return n.dataLength&&y(m,p,n.flush(),g),Promise.resolve(new ArrayBuffer(0));var D=R.value,I=D.length;return m.loaded+=I,I<_||n.dataLength?(n.push(D),n.dataLength>=_&&y(m,p,n.flush(),g)):y(m,p,D,g),T()}).catch(function(){return Promise.reject()})};return S()},r}();function o(r,d){var f={method:"GET",mode:"cors",credentials:"same-origin",signal:d,headers:new self.Headers(i({},r.headers))};return r.rangeEnd&&f.headers.set("Range","bytes="+r.rangeStart+"-"+String(r.rangeEnd-1)),f}function e(r,d){return new self.Request(r.url,d)}var s=function(r){A(d,r);function d(f,g,m){var p;return p=r.call(this,f)||this,p.code=void 0,p.details=void 0,p.code=g,p.details=m,p}return d}(w(Error));Z.default=c},"./src/utils/imsc1-ttml-parser.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"IMSC1_CODEC",function(){return h}),U.d(Z,"parseIMSC1",function(){return l});var b=U("./src/utils/mp4-tools.ts"),L=U("./src/utils/vttparser.ts"),E=U("./src/utils/vttcue.ts"),A=U("./src/demux/id3.ts"),w=U("./src/utils/timescale-conversion.ts"),v=U("./src/utils/webvtt-parser.ts");function u(){return u=Object.assign||function(_){for(var y=1;y<arguments.length;y++){var n=arguments[y];for(var x in n)Object.prototype.hasOwnProperty.call(n,x)&&(_[x]=n[x])}return _},u.apply(this,arguments)}var h="stpp.ttml.im1t",a=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,t=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,i={left:"start",center:"center",right:"end",start:"start",end:"end"};function l(_,y,n,x,S){var T=Object(b.findBox)(new Uint8Array(_),["mdat"]);if(T.length===0){S(new Error("Could not parse IMSC1 mdat"));return}var R=T[0],D=Object(A.utf8ArrayToStr)(new Uint8Array(_,R.start,R.end-R.start)),I=Object(w.toTimescaleFromScale)(y,1,n);try{x(c(D,I))}catch(B){S(B)}}function c(_,y){var n=new DOMParser,x=n.parseFromString(_,"text/xml"),S=x.getElementsByTagName("tt")[0];if(!S)throw new Error("Invalid ttml");var T={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},R=Object.keys(T).reduce(function(k,$){return k[$]=S.getAttribute("ttp:"+$)||T[$],k},{}),D=S.getAttribute("xml:space")!=="preserve",I=e(o(S,"styling","style")),B=e(o(S,"layout","region")),G=o(S,"body","[begin]");return[].map.call(G,function(k){var $=s(k,D);if(!$||!k.hasAttribute("begin"))return null;var X=g(k.getAttribute("begin"),R),V=g(k.getAttribute("dur"),R),N=g(k.getAttribute("end"),R);if(X===null)throw f(k);if(N===null){if(V===null)throw f(k);N=X+V}var z=new E.default(X-y,N-y,$);z.id=Object(v.generateCueId)(z.startTime,z.endTime,z.text);var q=B[k.getAttribute("region")],ee=I[k.getAttribute("style")];z.position=10,z.size=80;var fe=r(q,ee),ae=fe.textAlign;if(ae){var pe=i[ae];pe&&(z.lineAlign=pe),z.align=ae}return u(z,fe),z}).filter(function(k){return k!==null})}function o(_,y,n){var x=_.getElementsByTagName(y)[0];return x?[].slice.call(x.querySelectorAll(n)):[]}function e(_){return _.reduce(function(y,n){var x=n.getAttribute("xml:id");return x&&(y[x]=n),y},{})}function s(_,y){return[].slice.call(_.childNodes).reduce(function(n,x,S){var T;return x.nodeName==="br"&&S?n+`
`:(T=x.childNodes)!==null&&T!==void 0&&T.length?s(x,y):y?n+x.textContent.trim().replace(/\s+/g," "):n+x.textContent},"")}function r(_,y){var n="http://www.w3.org/ns/ttml#styling",x=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return x.reduce(function(S,T){var R=d(y,n,T)||d(_,n,T);return R&&(S[T]=R),S},{})}function d(_,y,n){return _.hasAttributeNS(y,n)?_.getAttributeNS(y,n):null}function f(_){return new Error("Could not parse ttml timestamp "+_)}function g(_,y){if(!_)return null;var n=Object(L.parseTimeStamp)(_);return n===null&&(a.test(_)?n=m(_,y):t.test(_)&&(n=p(_,y))),n}function m(_,y){var n=a.exec(_),x=(n[4]|0)+(n[5]|0)/y.subFrameRate;return(n[1]|0)*3600+(n[2]|0)*60+(n[3]|0)+x/y.frameRate}function p(_,y){var n=t.exec(_),x=Number(n[1]),S=n[2];switch(S){case"h":return x*3600;case"m":return x*60;case"ms":return x*1e3;case"f":return x/y.frameRate;case"t":return x/y.tickRate}return x}},"./src/utils/logger.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"enableLogs",function(){return v}),U.d(Z,"logger",function(){return u});var b=function(){},L={trace:b,debug:b,log:b,warn:b,info:b,error:b},E=L;function A(h){var a=self.console[h];return a?a.bind(self.console,"["+h+"] >"):b}function w(h){for(var a=arguments.length,t=new Array(a>1?a-1:0),i=1;i<a;i++)t[i-1]=arguments[i];t.forEach(function(l){E[l]=h[l]?h[l].bind(h):A(l)})}function v(h){if(self.console&&h===!0||typeof h=="object"){w(h,"debug","log","info","warn","error");try{E.log()}catch(a){E=L}}else E=L}var u=E},"./src/utils/mediakeys-helper.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"KeySystems",function(){return b}),U.d(Z,"requestMediaKeySystemAccess",function(){return L});var b;(function(E){E.WIDEVINE="com.widevine.alpha",E.PLAYREADY="com.microsoft.playready"})(b||(b={}));var L=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"getMediaSource",function(){return b});function b(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"bin2str",function(){return w}),U.d(Z,"readUint16",function(){return v}),U.d(Z,"readUint32",function(){return u}),U.d(Z,"writeUint32",function(){return h}),U.d(Z,"findBox",function(){return a}),U.d(Z,"parseSegmentIndex",function(){return t}),U.d(Z,"parseInitSegment",function(){return i}),U.d(Z,"getStartDTS",function(){return l}),U.d(Z,"getDuration",function(){return c}),U.d(Z,"computeRawDurationFromSamples",function(){return o}),U.d(Z,"offsetStartDTS",function(){return e}),U.d(Z,"segmentValidRange",function(){return s}),U.d(Z,"appendUint8Array",function(){return r});var b=U("./src/utils/typed-array.ts"),L=U("./src/loader/fragment.ts"),E=Math.pow(2,32)-1,A=[].push;function w(d){return String.fromCharCode.apply(null,d)}function v(d,f){"data"in d&&(f+=d.start,d=d.data);var g=d[f]<<8|d[f+1];return g<0?65536+g:g}function u(d,f){"data"in d&&(f+=d.start,d=d.data);var g=d[f]<<24|d[f+1]<<16|d[f+2]<<8|d[f+3];return g<0?4294967296+g:g}function h(d,f,g){"data"in d&&(f+=d.start,d=d.data),d[f]=g>>24,d[f+1]=g>>16&255,d[f+2]=g>>8&255,d[f+3]=g&255}function a(d,f){var g=[];if(!f.length)return g;var m,p,_;"data"in d?(m=d.data,p=d.start,_=d.end):(m=d,p=0,_=m.byteLength);for(var y=p;y<_;){var n=u(m,y),x=w(m.subarray(y+4,y+8)),S=n>1?y+n:_;if(x===f[0])if(f.length===1)g.push({data:m,start:y+8,end:S});else{var T=a({data:m,start:y+8,end:S},f.slice(1));T.length&&A.apply(g,T)}y=S}return g}function t(d){var f=a(d,["moov"]),g=f[0],m=g?g.end:null,p=a(d,["sidx"]);if(!p||!p[0])return null;var _=[],y=p[0],n=y.data[0],x=n===0?8:16,S=u(y,x);x+=4;var T=0,R=0;n===0?x+=8:x+=16,x+=2;var D=y.end+R,I=v(y,x);x+=2;for(var B=0;B<I;B++){var G=x,k=u(y,G);G+=4;var $=k&2147483647,X=(k&2147483648)>>>31;if(X===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var V=u(y,G);G+=4,_.push({referenceSize:$,subsegmentDuration:V,info:{duration:V/S,start:D,end:D+$-1}}),D+=$,G+=4,x=G}return{earliestPresentationTime:T,timescale:S,version:n,referencesCount:I,references:_,moovEndOffset:m}}function i(d){for(var f=[],g=a(d,["moov","trak"]),m=0;m<g.length;m++){var p=g[m],_=a(p,["tkhd"])[0];if(_){var y=_.data[_.start],n=y===0?12:20,x=u(_,n),S=a(p,["mdia","mdhd"])[0];if(S){y=S.data[S.start],n=y===0?12:20;var T=u(S,n),R=a(p,["mdia","hdlr"])[0];if(R){var D=w(R.data.subarray(R.start+8,R.start+12)),I={soun:L.ElementaryStreamTypes.AUDIO,vide:L.ElementaryStreamTypes.VIDEO}[D];if(I){var B=a(p,["mdia","minf","stbl","stsd"])[0],G=void 0;B&&(G=w(B.data.subarray(B.start+12,B.start+16))),f[x]={timescale:T,type:I},f[I]={timescale:T,id:x,codec:G}}}}}}var k=a(d,["moov","mvex","trex"]);return k.forEach(function($){var X=u($,4),V=f[X];V&&(V.default={duration:u($,12),flags:u($,20)})}),f}function l(d,f){return a(f,["moof","traf"]).reduce(function(g,m){var p=a(m,["tfdt"])[0],_=p.data[p.start],y=a(m,["tfhd"]).reduce(function(n,x){var S=u(x,4),T=d[S];if(T){var R=u(p,4);_===1&&(R*=Math.pow(2,32),R+=u(p,8));var D=T.timescale||9e4,I=R/D;if(isFinite(I)&&(n===null||I<n))return I}return n},null);return y!==null&&isFinite(y)&&(g===null||y<g)?y:g},null)||0}function c(d,f){for(var g=0,m=0,p=0,_=a(d,["moof","traf"]),y=0;y<_.length;y++){var n=_[y],x=a(n,["tfhd"])[0],S=u(x,4),T=f[S];if(!T)continue;var R=T.default,D=u(x,0)|(R==null?void 0:R.flags),I=R==null?void 0:R.duration;D&8&&(D&2?I=u(x,12):I=u(x,8));for(var B=T.timescale||9e4,G=a(n,["trun"]),k=0;k<G.length;k++){if(I){var $=u(G[k],4);g=I*$}else g=o(G[k]);T.type===L.ElementaryStreamTypes.VIDEO?m+=g/B:T.type===L.ElementaryStreamTypes.AUDIO&&(p+=g/B)}}if(m===0&&p===0){var X=t(d);if(X!=null&&X.references)return X.references.reduce(function(V,N){return V+N.info.duration||0},0)}return m||p}function o(d){var f=u(d,0),g=8;f&1&&(g+=4),f&4&&(g+=4);for(var m=0,p=u(d,4),_=0;_<p;_++){if(f&256){var y=u(d,g);m+=y,g+=4}f&512&&(g+=4),f&1024&&(g+=4),f&2048&&(g+=4)}return m}function e(d,f,g){a(f,["moof","traf"]).forEach(function(m){a(m,["tfhd"]).forEach(function(p){var _=u(p,4),y=d[_];if(!y)return;var n=y.timescale||9e4;a(m,["tfdt"]).forEach(function(x){var S=x.data[x.start],T=u(x,4);if(S===0)h(x,4,T-g*n);else{T*=Math.pow(2,32),T+=u(x,8),T-=g*n,T=Math.max(T,0);var R=Math.floor(T/(E+1)),D=Math.floor(T%(E+1));h(x,4,R),h(x,8,D)}})})})}function s(d){var f={valid:null,remainder:null},g=a(d,["moof"]);if(g){if(g.length<2)return f.remainder=d,f}else return f;var m=g[g.length-1];return f.valid=Object(b.sliceUint8)(d,0,m.start-8),f.remainder=Object(b.sliceUint8)(d,m.start-8),f}function r(d,f){var g=new Uint8Array(d.length+f.length);return g.set(d),g.set(f,d.length),g}},"./src/utils/output-filter.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return b});var b=function(){function L(A,w){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=A,this.trackName=w}var E=L.prototype;return E.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},E.newCue=function(w,v,u){(this.startTime===null||this.startTime>w)&&(this.startTime=w),this.endTime=v,this.screen=u,this.timelineController.createCaptionsTrack(this.trackName)},E.reset=function(){this.cueRanges=[]},L}()},"./src/utils/texttrack-utils.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"sendAddTrackEvent",function(){return L}),U.d(Z,"addCueToTrack",function(){return E}),U.d(Z,"clearCurrentCues",function(){return A}),U.d(Z,"removeCuesInRange",function(){return w}),U.d(Z,"getCuesInRange",function(){return u});var b=U("./src/utils/logger.ts");function L(h,a){var t;try{t=new Event("addtrack")}catch(i){t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=h,a.dispatchEvent(t)}function E(h,a){var t=h.mode;if(t==="disabled"&&(h.mode="hidden"),h.cues&&!h.cues.getCueById(a.id))try{if(h.addCue(a),!h.cues.getCueById(a.id))throw new Error("addCue is failed for: "+a)}catch(l){b.logger.debug("[texttrack-utils]: "+l);var i=new self.TextTrackCue(a.startTime,a.endTime,a.text);i.id=a.id,h.addCue(i)}t==="disabled"&&(h.mode=t)}function A(h){var a=h.mode;if(a==="disabled"&&(h.mode="hidden"),h.cues)for(var t=h.cues.length;t--;)h.removeCue(h.cues[t]);a==="disabled"&&(h.mode=a)}function w(h,a,t){var i=h.mode;if(i==="disabled"&&(h.mode="hidden"),h.cues&&h.cues.length>0)for(var l=u(h.cues,a,t),c=0;c<l.length;c++)h.removeCue(l[c]);i==="disabled"&&(h.mode=i)}function v(h,a){if(a<h[0].startTime)return 0;var t=h.length-1;if(a>h[t].endTime)return-1;for(var i=0,l=t;i<=l;){var c=Math.floor((l+i)/2);if(a<h[c].startTime)l=c-1;else if(a>h[c].startTime&&i<t)i=c+1;else return c}return h[i].startTime-a<a-h[l].startTime?i:l}function u(h,a,t){var i=[],l=v(h,a);if(l>-1)for(var c=l,o=h.length;c<o;c++){var e=h[c];if(e.startTime>=a&&e.endTime<=t)i.push(e);else if(e.startTime>t)return i}return i}},"./src/utils/time-ranges.ts":function(Se,Z,U){"use strict";U.r(Z);var b={toString:function(E){for(var A="",w=E.length,v=0;v<w;v++)A+="["+E.start(v).toFixed(3)+","+E.end(v).toFixed(3)+"]";return A}};Z.default=b},"./src/utils/timescale-conversion.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"toTimescaleFromBase",function(){return L}),U.d(Z,"toTimescaleFromScale",function(){return E}),U.d(Z,"toMsFromMpegTsClock",function(){return A}),U.d(Z,"toMpegTsClockFromTimescale",function(){return w});var b=9e4;function L(v,u,h,a){h===void 0&&(h=1),a===void 0&&(a=!1);var t=v*u*h;return a?Math.round(t):t}function E(v,u,h,a){return h===void 0&&(h=1),a===void 0&&(a=!1),L(v,u,1/h,a)}function A(v,u){return u===void 0&&(u=!1),L(v,1e3,1/b,u)}function w(v,u){return u===void 0&&(u=1),L(v,b,1/u)}},"./src/utils/typed-array.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"sliceUint8",function(){return b});function b(L,E,A){return Uint8Array.prototype.slice?L.slice(E,A):new Uint8Array(Array.prototype.slice.call(L,E,A))}},"./src/utils/vttcue.ts":function(Se,Z,U){"use strict";U.r(Z),Z.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var b=["","lr","rl"],L=["start","middle","end","left","right"];function E(h,a){if(typeof a!="string")return!1;if(!Array.isArray(h))return!1;var t=a.toLowerCase();return~h.indexOf(t)?t:!1}function A(h){return E(b,h)}function w(h){return E(L,h)}function v(h){for(var a=arguments.length,t=new Array(a>1?a-1:0),i=1;i<a;i++)t[i-1]=arguments[i];for(var l=1;l<arguments.length;l++){var c=arguments[l];for(var o in c)h[o]=c[o]}return h}function u(h,a,t){var i=this,l={enumerable:!0};i.hasBeenReset=!1;var c="",o=!1,e=h,s=a,r=t,d=null,f="",g=!0,m="auto",p="start",_=50,y="middle",n=50,x="middle";Object.defineProperty(i,"id",v({},l,{get:function(){return c},set:function(T){c=""+T}})),Object.defineProperty(i,"pauseOnExit",v({},l,{get:function(){return o},set:function(T){o=!!T}})),Object.defineProperty(i,"startTime",v({},l,{get:function(){return e},set:function(T){if(typeof T!="number")throw new TypeError("Start time must be set to a number.");e=T,this.hasBeenReset=!0}})),Object.defineProperty(i,"endTime",v({},l,{get:function(){return s},set:function(T){if(typeof T!="number")throw new TypeError("End time must be set to a number.");s=T,this.hasBeenReset=!0}})),Object.defineProperty(i,"text",v({},l,{get:function(){return r},set:function(T){r=""+T,this.hasBeenReset=!0}})),Object.defineProperty(i,"region",v({},l,{get:function(){return d},set:function(T){d=T,this.hasBeenReset=!0}})),Object.defineProperty(i,"vertical",v({},l,{get:function(){return f},set:function(T){var R=A(T);if(R===!1)throw new SyntaxError("An invalid or illegal string was specified.");f=R,this.hasBeenReset=!0}})),Object.defineProperty(i,"snapToLines",v({},l,{get:function(){return g},set:function(T){g=!!T,this.hasBeenReset=!0}})),Object.defineProperty(i,"line",v({},l,{get:function(){return m},set:function(T){if(typeof T!="number"&&T!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");m=T,this.hasBeenReset=!0}})),Object.defineProperty(i,"lineAlign",v({},l,{get:function(){return p},set:function(T){var R=w(T);if(!R)throw new SyntaxError("An invalid or illegal string was specified.");p=R,this.hasBeenReset=!0}})),Object.defineProperty(i,"position",v({},l,{get:function(){return _},set:function(T){if(T<0||T>100)throw new Error("Position must be between 0 and 100.");_=T,this.hasBeenReset=!0}})),Object.defineProperty(i,"positionAlign",v({},l,{get:function(){return y},set:function(T){var R=w(T);if(!R)throw new SyntaxError("An invalid or illegal string was specified.");y=R,this.hasBeenReset=!0}})),Object.defineProperty(i,"size",v({},l,{get:function(){return n},set:function(T){if(T<0||T>100)throw new Error("Size must be between 0 and 100.");n=T,this.hasBeenReset=!0}})),Object.defineProperty(i,"align",v({},l,{get:function(){return x},set:function(T){var R=w(T);if(!R)throw new SyntaxError("An invalid or illegal string was specified.");x=R,this.hasBeenReset=!0}})),i.displayState=void 0}return u.prototype.getCueAsHTML=function(){var h=self.WebVTT;return h.convertCueToDOMTree(self,this.text)},u}()},"./src/utils/vttparser.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"parseTimeStamp",function(){return E}),U.d(Z,"fixLineBreaks",function(){return a}),U.d(Z,"VTTParser",function(){return t});var b=U("./src/utils/vttcue.ts"),L=function(){function i(){}var l=i.prototype;return l.decode=function(o,e){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},i}();function E(i){function l(o,e,s,r){return(o|0)*3600+(e|0)*60+(s|0)+parseFloat(r||0)}var c=i.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return c?parseFloat(c[2])>59?l(c[2],c[3],0,c[4]):l(c[1],c[2],c[3],c[4]):null}var A=function(){function i(){this.values=Object.create(null)}var l=i.prototype;return l.set=function(o,e){!this.get(o)&&e!==""&&(this.values[o]=e)},l.get=function(o,e,s){return s?this.has(o)?this.values[o]:e[s]:this.has(o)?this.values[o]:e},l.has=function(o){return o in this.values},l.alt=function(o,e,s){for(var r=0;r<s.length;++r)if(e===s[r]){this.set(o,e);break}},l.integer=function(o,e){/^-?\d+$/.test(e)&&this.set(o,parseInt(e,10))},l.percent=function(o,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var s=parseFloat(e);if(s>=0&&s<=100)return this.set(o,s),!0}return!1},i}();function w(i,l,c,o){var e=o?i.split(o):[i];for(var s in e){if(typeof e[s]!="string")continue;var r=e[s].split(c);if(r.length!==2)continue;var d=r[0],f=r[1];l(d,f)}}var v=new b.default(0,0,""),u=v.align==="middle"?"middle":"center";function h(i,l,c){var o=i;function e(){var d=E(i);if(d===null)throw new Error("Malformed timestamp: "+o);return i=i.replace(/^[^\sa-zA-Z-]+/,""),d}function s(d,f){var g=new A;w(d,function(_,y){var n;switch(_){case"region":for(var x=c.length-1;x>=0;x--)if(c[x].id===y){g.set(_,c[x].region);break}break;case"vertical":g.alt(_,y,["rl","lr"]);break;case"line":n=y.split(","),g.integer(_,n[0]),g.percent(_,n[0])&&g.set("snapToLines",!1),g.alt(_,n[0],["auto"]),n.length===2&&g.alt("lineAlign",n[1],["start",u,"end"]);break;case"position":n=y.split(","),g.percent(_,n[0]),n.length===2&&g.alt("positionAlign",n[1],["start",u,"end","line-left","line-right","auto"]);break;case"size":g.percent(_,y);break;case"align":g.alt(_,y,["start",u,"end","left","right"]);break}},/:/,/\s/),f.region=g.get("region",null),f.vertical=g.get("vertical","");var m=g.get("line","auto");m==="auto"&&v.line===-1&&(m=-1),f.line=m,f.lineAlign=g.get("lineAlign","start"),f.snapToLines=g.get("snapToLines",!0),f.size=g.get("size",100),f.align=g.get("align",u);var p=g.get("position","auto");p==="auto"&&v.position===50&&(p=f.align==="start"||f.align==="left"?0:f.align==="end"||f.align==="right"?100:50),f.position=p}function r(){i=i.replace(/^\s+/,"")}if(r(),l.startTime=e(),r(),i.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);i=i.substr(3),r(),l.endTime=e(),r(),s(i,l)}function a(i){return i.replace(/<br(?: \/)?>/gi,`
`)}var t=function(){function i(){this.state="INITIAL",this.buffer="",this.decoder=new L,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var l=i.prototype;return l.parse=function(o){var e=this;o&&(e.buffer+=e.decoder.decode(o,{stream:!0}));function s(){var p=e.buffer,_=0;for(p=a(p);_<p.length&&p[_]!=="\r"&&p[_]!==`
`;)++_;var y=p.substr(0,_);return p[_]==="\r"&&++_,p[_]===`
`&&++_,e.buffer=p.substr(_),y}function r(p){w(p,function(_,y){},/:/)}try{var d="";if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer))return this;d=s();var f=d.match(/^()?WEBVTT([ \t].*)?$/);if(!f||!f[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}for(var g=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;g?g=!1:d=s();switch(e.state){case"HEADER":/:/.test(d)?r(d):d||(e.state="ID");continue;case"NOTE":d||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(d)){e.state="NOTE";break}if(!d)continue;if(e.cue=new b.default(0,0,""),e.state="CUE",d.indexOf("-->")===-1){e.cue.id=d;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{h(d,e.cue,e.regionList)}catch(p){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":{var m=d.indexOf("-->")!==-1;if(!d||m&&(g=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(e.cue===null)continue;e.cue.text&&(e.cue.text+=`
`),e.cue.text+=d}continue;case"BADCUE":d||(e.state="ID")}}}catch(p){e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},l.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=`
`,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(e){o.onparsingerror&&o.onparsingerror(e)}return o.onflush&&o.onflush(),this},i}()},"./src/utils/webvtt-parser.ts":function(Se,Z,U){"use strict";U.r(Z),U.d(Z,"generateCueId",function(){return t}),U.d(Z,"parseWebVTT",function(){return l});var b=U("./src/polyfills/number.ts"),L=U("./src/utils/vttparser.ts"),E=U("./src/demux/id3.ts"),A=U("./src/utils/timescale-conversion.ts"),w=U("./src/remux/mp4-remuxer.ts"),v=/\r\n|\n\r|\n|\r/g,u=function(o,e,s){return s===void 0&&(s=0),o.substr(s,e.length)===e},h=function(o){var e=parseInt(o.substr(-3)),s=parseInt(o.substr(-6,2)),r=parseInt(o.substr(-9,2)),d=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(b.isFiniteNumber)(e)||!Object(b.isFiniteNumber)(s)||!Object(b.isFiniteNumber)(r)||!Object(b.isFiniteNumber)(d))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return e+=1e3*s,e+=60*1e3*r,e+=60*60*1e3*d,e},a=function(o){for(var e=5381,s=o.length;s;)e=e*33^o.charCodeAt(--s);return(e>>>0).toString()};function t(c,o,e){return a(c.toString())+a(o.toString())+a(e)}var i=function(o,e,s){var r=o[e],d=o[r.prevCC];if(!d||!d.new&&r.new){o.ccOffset=o.presentationOffset=r.start,r.new=!1;return}for(;(f=d)!==null&&f!==void 0&&f.new;){var f;o.ccOffset+=r.start-d.start,r.new=!1,r=d,d=o[r.prevCC]}o.presentationOffset=s};function l(c,o,e,s,r,d,f,g){var m=new L.VTTParser,p=Object(E.utf8ArrayToStr)(new Uint8Array(c)).trim().replace(v,`
`).split(`
`),_=[],y=Object(A.toMpegTsClockFromTimescale)(o,e),n="00:00.000",x=0,S=0,T,R=!0,D=!1;m.oncue=function(I){var B=s[r],G=s.ccOffset,k=(x-y)/9e4;if(B!=null&&B.new&&(S!==void 0?G=s.ccOffset=B.start:i(s,r,k)),k&&(G=k-s.presentationOffset),D){var $=I.endTime-I.startTime,X=Object(w.normalizePts)((I.startTime+G-S)*9e4,d*9e4)/9e4;I.startTime=X,I.endTime=X+$}var V=I.text.trim();I.text=decodeURIComponent(encodeURIComponent(V)),I.id||(I.id=t(I.startTime,I.endTime,V)),I.endTime>0&&_.push(I)},m.onparsingerror=function(I){T=I},m.onflush=function(){if(T){g(T);return}f(_)},p.forEach(function(I){if(R)if(u(I,"X-TIMESTAMP-MAP=")){R=!1,D=!0,I.substr(16).split(",").forEach(function(B){u(B,"LOCAL:")?n=B.substr(6):u(B,"MPEGTS:")&&(x=parseInt(B.substr(7)))});try{S=h(n)/1e3}catch(B){D=!1,T=B}return}else I===""&&(R=!1);m.parse(I+`
`)}),m.flush()}},"./src/utils/xhr-loader.ts":function(Se,Z,U){"use strict";U.r(Z);var b=U("./src/utils/logger.ts"),L=U("./src/loader/load-stats.ts"),E=/^age:\s*[\d.]+\s*$/m,A=function(){function w(u){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=u?u.xhrSetup:null,this.stats=new L.LoadStats,this.retryDelay=0}var v=w.prototype;return v.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},v.abortInternal=function(){var h=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),h&&(h.onreadystatechange=null,h.onprogress=null,h.readyState!==4&&(this.stats.aborted=!0,h.abort()))},v.abort=function(){var h;this.abortInternal(),(h=this.callbacks)!==null&&h!==void 0&&h.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},v.load=function(h,a,t){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=h,this.config=a,this.callbacks=t,this.retryDelay=a.retryDelay,this.loadInternal()},v.loadInternal=function(){var h=this.config,a=this.context;if(!h)return;var t=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0;var l=this.xhrSetup;try{if(l)try{l(t,a.url)}catch(e){t.open("GET",a.url,!0),l(t,a.url)}t.readyState||t.open("GET",a.url,!0);var c=this.context.headers;if(c)for(var o in c)t.setRequestHeader(o,c[o])}catch(e){this.callbacks.onError({code:t.status,text:e.message},a,t);return}a.rangeEnd&&t.setRequestHeader("Range","bytes="+a.rangeStart+"-"+(a.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=a.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),h.timeout),t.send()},v.readystatechange=function(){var h=this.context,a=this.loader,t=this.stats;if(!h||!a)return;var i=a.readyState,l=this.config;if(t.aborted)return;if(i>=2)if(self.clearTimeout(this.requestTimeout),t.loading.first===0&&(t.loading.first=Math.max(self.performance.now(),t.loading.start)),i===4){a.onreadystatechange=null,a.onprogress=null;var c=a.status;if(c>=200&&c<300){t.loading.end=Math.max(self.performance.now(),t.loading.first);var o,e;if(h.responseType==="arraybuffer"?(o=a.response,e=o.byteLength):(o=a.responseText,e=o.length),t.loaded=t.total=e,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(t,h,o,a),!this.callbacks)return;var r={url:a.responseURL,data:o};this.callbacks.onSuccess(r,t,h,a)}else t.retry>=l.maxRetry||c>=400&&c<499?(b.logger.error(c+" while loading "+h.url),this.callbacks.onError({code:c,text:a.statusText},h,a)):(b.logger.warn(c+" while loading "+h.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,l.maxRetryDelay),t.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),l.timeout)},v.loadtimeout=function(){b.logger.warn("timeout while loading "+this.context.url);var h=this.callbacks;h&&(this.abortInternal(),h.onTimeout(this.stats,this.context,this.loader))},v.loadprogress=function(h){var a=this.stats;a.loaded=h.loaded,h.lengthComputable&&(a.total=h.total)},v.getCacheAge=function(){var h=null;if(this.loader&&E.test(this.loader.getAllResponseHeaders())){var a=this.loader.getResponseHeader("age");h=a?parseFloat(a):null}return h},w}();Z.default=A}}).default})},vHTk:function(rt,tt,he){rt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vZDz:function(rt,tt,he){rt.exports={contentWrap:"contentWrap___3Fc2r",footer:"footer___4nxVN",radioGroup:"radioGroup___359yE",wrap:"wrap___1OqR3",introName:"introName___3saG-",rating:"rating___3X95K",modalRating:"modalRating___A4qeN"}},w8Aa:function(rt,tt,he){rt.exports={img:"img___3e4yQ"}}}]);