|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[194,3,5,7,8,20],{"++UQ":function(nt,Le,F){},"+NIl":function(nt,Le,F){(function(ue){ue(F("VrN/"))})(function(ue){"use strict";ue.defineMode("stex",function(Q,j){"use strict";function S(l,s){l.cmdState.push(s)}function D(l){return l.cmdState.length>0?l.cmdState[l.cmdState.length-1]:null}function x(l){var s=l.cmdState.pop();s&&s.closeBracket()}function T(l){for(var s=l.cmdState,h=s.length-1;h>=0;h--){var r=s[h];if(r.name=="DEFAULT")continue;return r}return{styleIdentifier:function(){return null}}}function w(l,s,h){return function(){this.name=l,this.bracketNo=0,this.style=s,this.styles=h,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var f={};f.importmodule=w("importmodule","tag",["string","builtin"]),f.documentclass=w("documentclass","tag",["","atom"]),f.usepackage=w("usepackage","tag",["atom"]),f.begin=w("begin","tag",["atom"]),f.end=w("end","tag",["atom"]),f.label=w("label","tag",["atom"]),f.ref=w("ref","tag",["atom"]),f.eqref=w("eqref","tag",["atom"]),f.cite=w("cite","tag",["atom"]),f.bibitem=w("bibitem","tag",["atom"]),f.Bibitem=w("Bibitem","tag",["atom"]),f.RBibitem=w("RBibitem","tag",["atom"]),f.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function p(l,s){l.f=s}function u(l,s){var h;if(l.match(/^\\[a-zA-Z@]+/)){var r=l.current().slice(1);return h=f.hasOwnProperty(r)?f[r]:f.DEFAULT,h=new h,S(s,h),p(s,i),h.style}if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/\\]/))return"tag";if(l.match("\\["))return p(s,function(n,c){return o(n,c,"\\]")}),"keyword";if(l.match("\\("))return p(s,function(n,c){return o(n,c,"\\)")}),"keyword";if(l.match("$$"))return p(s,function(n,c){return o(n,c,"$$")}),"keyword";if(l.match("$"))return p(s,function(n,c){return o(n,c,"$")}),"keyword";var t=l.next();if(t=="%")return l.skipToEnd(),"comment";if(t=="}"||t=="]"){if(h=D(s),h)h.closeBracket(t),p(s,i);else return"error";return"bracket"}else return t=="{"||t=="["?(h=f.DEFAULT,h=new h,S(s,h),"bracket"):/\d/.test(t)?(l.eatWhile(/[\w.%]/),"atom"):(l.eatWhile(/[\w\-_]/),h=T(s),h.name=="begin"&&(h.argument=l.current()),h.styleIdentifier())}function o(l,s,h){if(l.eatSpace())return null;if(h&&l.match(h))return p(s,u),"keyword";if(l.match(/^\\[a-zA-Z@]+/))return"tag";if(l.match(/^[a-zA-Z]+/))return"variable-2";if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/]/))return"tag";if(l.match(/^[\^_&]/))return"tag";if(l.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(l.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=l.next();return r=="{"||r=="}"||r=="["||r=="]"||r=="("||r==")"?"bracket":r=="%"?(l.skipToEnd(),"comment"):"error"}function i(l,s){var h=l.peek(),r;return h=="{"||h=="["?(r=D(s),r.openBracket(h),l.eat(h),p(s,u),"bracket"):/[ \t\r]/.test(h)?(l.eat(h),null):(p(s,u),x(s),u(l,s))}return{startState:function(){var l=j.inMathMode?function(s,h){return o(s,h)}:u;return{cmdState:[],f:l}},copyState:function(l){return{cmdState:l.cmdState.slice(),f:l.f}},token:function(l,s){return s.f(l,s)},blankLine:function(l){l.f=u,l.cmdState.length=0},lineComment:"%"}}),ue.defineMIME("text/x-stex","stex"),ue.defineMIME("text/x-latex","stex")})},"+QRC":function(nt,Le,F){"use strict";var ue=F("E9nw"),Q={"text/plain":"Text","text/html":"Url",default:"Text"},j="Copy to clipboard: #{key}, Enter";function S(x){var T=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return x.replace(/#{\s*key\s*}/g,T)}function D(x,T){var w,f,p,u,o,i,l=!1;T||(T={}),w=T.debug||!1;try{p=ue(),u=document.createRange(),o=document.getSelection(),i=document.createElement("span"),i.textContent=x,i.style.all="unset",i.style.position="fixed",i.style.top=0,i.style.clip="rect(0, 0, 0, 0)",i.style.whiteSpace="pre",i.style.webkitUserSelect="text",i.style.MozUserSelect="text",i.style.msUserSelect="text",i.style.userSelect="text",i.addEventListener("copy",function(h){if(h.stopPropagation(),T.format)if(h.preventDefault(),typeof h.clipboardData=="undefined"){w&&console.warn("unable to use e.clipboardData"),w&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=Q[T.format]||Q.default;window.clipboardData.setData(r,x)}else h.clipboardData.clearData(),h.clipboardData.setData(T.format,x);T.onCopy&&(h.preventDefault(),T.onCopy(h.clipboardData))}),document.body.appendChild(i),u.selectNodeContents(i),o.addRange(u);var s=document.execCommand("copy");if(!s)throw new Error("copy command was unsuccessful");l=!0}catch(h){w&&console.error("unable to copy using execCommand: ",h),w&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(T.format||"text",x),T.onCopy&&T.onCopy(window.clipboardData),l=!0}catch(r){w&&console.error("unable to copy using clipboardData: ",r),w&&console.error("falling back to prompt"),f=S("message"in T?T.message:j),window.prompt(f,x)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(u):o.removeAllRanges()),i&&document.body.removeChild(i),p()}return l}nt.exports=D},"+ua5":function(nt,Le,F){},"/cxE":function(nt,Le,F){"use strict";F.d(Le,"e",function(){return j}),F.d(Le,"f",function(){return S}),F.d(Le,"g",function(){return D}),F.d(Le,"d",function(){return T}),F.d(Le,"a",function(){return w}),F.d(Le,"b",function(){return f}),F.d(Le,"c",function(){return p});var ue=function(){function u(){this.listeners=[],this.unexpectedErrorHandler=function(o){setTimeout(function(){throw o.stack?new Error(o.message+`
|
|
|
|
|
|
`+o.stack):o},0)}}return u.prototype.emit=function(o){this.listeners.forEach(function(i){i(o)})},u.prototype.onUnexpectedError=function(o){this.unexpectedErrorHandler(o),this.emit(o)},u.prototype.onUnexpectedExternalError=function(o){this.unexpectedErrorHandler(o)},u}(),Q=new ue;function j(u){T(u)||Q.onUnexpectedError(u);return}function S(u){T(u)||Q.onUnexpectedExternalError(u);return}function D(u){if(u instanceof Error){var o=u.name,i=u.message,l=u.stacktrace||u.stack;return{$isError:!0,name:o,message:i,stack:l}}return u}var x="Canceled";function T(u){return u instanceof Error&&u.name===x&&u.message===x}function w(){var u=new Error(x);return u.name=u.message,u}function f(u){return u?new Error("Illegal argument: "+u):new Error("Illegal argument")}function p(u){return u?new Error("Illegal state: "+u):new Error("Illegal state")}},"07cG":function(nt,Le,F){nt.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":function(nt,Le){var F=arguments[3],ue=arguments[4],Q=arguments[5],j=JSON.stringify;nt.exports=function(S,D){for(var x,T=Object.keys(Q),w=0,f=T.length;w<f;w++){var p=T[w],u=Q[p].exports;if(u===S||u&&u.default===S){x=p;break}}if(!x){x=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var o={},w=0,f=T.length;w<f;w++){var p=T[w];o[p]=p}ue[x]=["function(require,module,exports){"+S+"(self); }",o]}var i=Math.floor(Math.pow(16,8)*Math.random()).toString(16),l={};l[x]=x,ue[i]=["function(require,module,exports){var f = require("+j(x)+");(f.default ? f.default : f)(self);}",l];var s={};h(i);function h(v){s[v]=!0;for(var b in ue[v][1]){var E=ue[v][1][b];s[E]||h(E)}}var r="("+F+")({"+Object.keys(s).map(function(v){return j(v)+":["+ue[v][0]+","+j(ue[v][1])+"]"}).join(",")+"},{},["+j(i)+"])",t=window.URL||window.webkitURL||window.mozURL||window.msURL,n=new Blob([r],{type:"text/javascript"});if(D&&D.bare)return n;var c=t.createObjectURL(n),m=new Worker(c);return m.objectURL=c,m}},"19Vz":function(nt,Le,F){(function(ue){ue(F("VrN/"))})(function(ue){ue.defineOption("placeholder","",function(w,f,p){var u=p&&p!=ue.Init;if(f&&!u)w.on("blur",D),w.on("change",x),w.on("swapDoc",x),ue.on(w.getInputField(),"compositionupdate",w.state.placeholderCompose=function(){S(w)}),x(w);else if(!f&&u){w.off("blur",D),w.off("change",x),w.off("swapDoc",x),ue.off(w.getInputField(),"compositionupdate",w.state.placeholderCompose),Q(w);var o=w.getWrapperElement();o.className=o.className.replace(" CodeMirror-empty","")}f&&!w.hasFocus()&&D(w)});function Q(w){w.state.placeholder&&(w.state.placeholder.parentNode.removeChild(w.state.placeholder),w.state.placeholder=null)}function j(w){Q(w);var f=w.state.placeholder=document.createElement("pre");f.style.cssText="height: 0; overflow: visible",f.style.direction=w.getOption("direction"),f.className="CodeMirror-placeholder CodeMirror-line-like";var p=w.getOption("placeholder");typeof p=="string"&&(p=document.createTextNode(p)),f.appendChild(p),w.display.lineSpace.insertBefore(f,w.display.lineSpace.firstChild)}function S(w){setTimeout(function(){var f=!1,p=w.getInputField();p.nodeName=="TEXTAREA"?f=!p.value:w.lineCount()==1&&(f=!/[^\u200b]/.test(p.querySelector(".CodeMirror-line").textContent)),f?j(w):Q(w)},20)}function D(w){T(w)&&j(w)}function x(w){var f=w.getWrapperElement(),p=T(w);f.className=f.className.replace(" CodeMirror-empty","")+(p?" CodeMirror-empty":""),p?j(w):Q(w)}function T(w){return w.lineCount()===1&&w.getLine(0)===""}})},"1FX+":function(nt,Le,F){nt.exports={flex_box_center:"flex_box_center___t3HuD",flex_space_between:"flex_space_between___3eY6W",flex_box_vertical_center:"flex_box_vertical_center___SMD2f",flex_box_center_end:"flex_box_center_end___1qy96",flex_box_column:"flex_box_column___1iEso",wrap:"wrap___3Vyua",head:"head___HUi2n",sort:"sort___1UPxB",btn:"btn___2b6SJ",listWarp:"listWarp___1pNnP",pagination:"pagination___3I0F3",fixedRight:"fixedRight___527Xj","oj-width-input":"oj-width-input___QQMFK"}},"1eCo":function(nt,Le,F){(function(ue){ue(F("VrN/"))})(function(ue){"use strict";var Q={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},j={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ue.defineMode("xml",function(S,D){var x=S.indentUnit,T={},w=D.htmlMode?Q:j;for(var f in w)T[f]=w[f];for(var f in D)T[f]=D[f];var p,u;function o(_,O){function A(W){return O.tokenize=W,W(_,O)}var P=_.next();if(P=="<")return _.eat("!")?_.eat("[")?_.match("CDATA[")?A(s("atom","]]>")):null:_.match("--")?A(s("comment","-->")):_.match("DOCTYPE",!0,!0)?(_.eatWhile(/[\w\._\-]/),A(h(1))):null:_.eat("?")?(_.eatWhile(/[\w\._\-]/),O.tokenize=s("meta","?>"),"meta"):(p=_.eat("/")?"closeTag":"openTag",O.tokenize=i,"tag bracket");if(P=="&"){var I;return _.eat("#")?_.eat("x")?I=_.eatWhile(/[a-fA-F\d]/)&&_.eat(";"):I=_.eatWhile(/[\d]/)&&_.eat(";"):I=_.eatWhile(/[\w\.\-:]/)&&_.eat(";"),I?"atom":"error"}else return _.eatWhile(/[^&<]/),null}o.isInText=!0;function i(_,O){var A=_.next();if(A==">"||A=="/"&&_.eat(">"))return O.tokenize=o,p=A==">"?"endTag":"selfcloseTag","tag bracket";if(A=="=")return p="equals",null;if(A=="<"){O.tokenize=o,O.state=c,O.tagName=O.tagStart=null;var P=O.tokenize(_,O);return P?P+" tag error":"tag error"}else return/[\'\"]/.test(A)?(O.tokenize=l(A),O.stringStartCol=_.column(),O.tokenize(_,O)):(_.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(_){var O=function(A,P){for(;!A.eol();)if(A.next()==_){P.tokenize=i;break}return"string"};return O.isInAttribute=!0,O}function s(_,O){return function(A,P){for(;!A.eol();){if(A.match(O)){P.tokenize=o;break}A.next()}return _}}function h(_){return function(O,A){for(var P;(P=O.next())!=null;){if(P=="<")return A.tokenize=h(_+1),A.tokenize(O,A);if(P==">")if(_==1){A.tokenize=o;break}else return A.tokenize=h(_-1),A.tokenize(O,A)}return"meta"}}function r(_,O,A){this.prev=_.context,this.tagName=O,this.indent=_.indented,this.startOfLine=A,(T.doNotIndent.hasOwnProperty(O)||_.context&&_.context.noIndent)&&(this.noIndent=!0)}function t(_){_.context&&(_.context=_.context.prev)}function n(_,O){for(var A;;){if(!_.context)return;if(A=_.context.tagName,!T.contextGrabbers.hasOwnProperty(A)||!T.contextGrabbers[A].hasOwnProperty(O))return;t(_)}}function c(_,O,A){return _=="openTag"?(A.tagStart=O.column(),m):_=="closeTag"?v:c}function m(_,O,A){return _=="word"?(A.tagName=O.current(),u="tag",g):T.allowMissingTagName&&_=="endTag"?(u="tag bracket",g(_,O,A)):(u="error",m)}function v(_,O,A){if(_=="word"){var P=O.current();return A.context&&A.context.tagName!=P&&T.implicitlyClosed.hasOwnProperty(A.context.tagName)&&t(A),A.context&&A.context.tagName==P||T.matchClosing===!1?(u="tag",b):(u="tag error",E)}else return T.allowMissingTagName&&_=="endTag"?(u="tag bracket",b(_,O,A)):(u="error",E)}function b(_,O,A){return _!="endTag"?(u="error",b):(t(A),c)}function E(_,O,A){return u="error",b(_,O,A)}function g(_,O,A){if(_=="word")return u="attribute",y;if(_=="endTag"||_=="selfcloseTag"){var P=A.tagName,I=A.tagStart;return A.tagName=A.tagStart=null,_=="selfcloseTag"||T.autoSelfClosers.hasOwnProperty(P)?n(A,P):(n(A,P),A.context=new r(A,P,I==A.indented)),c}return u="error",g}function y(_,O,A){return _=="equals"?C:(T.allowMissing||(u="error"),g(_,O,A))}function C(_,O,A){return _=="string"?d:_=="word"&&T.allowUnquoted?(u="string",g):(u="error",g(_,O,A))}function d(_,O,A){return _=="string"?d:g(_,O,A)}return{startState:function(_){var O={tokenize:o,state:c,indented:_||0,tagName:null,tagStart:null,context:null};return _!=null&&(O.baseIndent=_),O},token:function(_,O){if(!O.tagName&&_.sol()&&(O.indented=_.indentation()),_.eatSpace())return null;p=null;var A=O.tokenize(_,O);return(A||p)&&A!="comment"&&(u=null,O.state=O.state(p||A,_,O),u&&(A=u=="error"?A+" error":u)),A},indent:function(_,O,A){var P=_.context;if(_.tokenize.isInAttribute)return _.tagStart==_.indented?_.stringStartCol+1:_.indented+x;if(P&&P.noIndent)return ue.Pass;if(_.tokenize!=i&&_.tokenize!=o)return A?A.match(/^(\s*)/)[0].length:0;if(_.tagName)return T.multilineTagIndentPastTag!==!1?_.tagStart+_.tagName.length+2:_.tagStart+x*(T.multilineTagIndentFactor||1);if(T.alignCDATA&&/<!\[CDATA\[/.test(O))return 0;var I=O&&/^<(\/)?([\w_:\.-]*)/.exec(O);if(I&&I[1])for(;P;)if(P.tagName==I[2]){P=P.prev;break}else if(T.implicitlyClosed.hasOwnProperty(P.tagName))P=P.prev;else break;else if(I)for(;P;){var W=T.contextGrabbers[P.tagName];if(W&&W.hasOwnProperty(I[2]))P=P.prev;else break}for(;P&&P.prev&&!P.startOfLine;)P=P.prev;return P?P.indent+x:_.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:T.htmlMode?"html":"xml",helperType:T.htmlMode?"html":"xml",skipAttribute:function(_){_.state==C&&(_.state=g)},xmlCurrentTag:function(_){return _.tagName?{name:_.tagName,close:_.type=="closeTag"}:null},xmlCurrentContext:function(_){for(var O=[],A=_.context;A;A=A.prev)A.tagName&&O.push(A.tagName);return O.reverse()}}}),ue.defineMIME("text/xml","xml"),ue.defineMIME("application/xml","xml"),ue.mimeModes.hasOwnProperty("text/html")||ue.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(nt,Le,F){"use strict";F.d(Le,"d",function(){return q}),F.d(Le,"b",function(){return rt}),F.d(Le,"c",function(){return xt}),F.d(Le,"a",function(){return Bt});var ue=F("VTBJ"),Q=F("1OyB"),j=F("vuIU"),S=F("JX7q"),D=F("Ji7U"),x=F("LK+K"),T=F("q1tI"),w=F("I8Z2"),f=F("BGR+"),p=F("wx14"),u=F("rePB"),o=F("4IlW"),i=F("2GS6"),l=F("Gytx"),s=F.n(l),h=F("TSYQ"),r=F.n(h),t=F("U8pU"),n=F("ODXe"),c=/iPhone/i,m=/iPod/i,v=/iPad/i,b=/\bAndroid(?:.+)Mobile\b/i,E=/Android/i,g=/\bAndroid(?:.+)SD4930UR\b/i,y=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,C=/Windows Phone/i,d=/\bWindows(?:.+)ARM\b/i,_=/BlackBerry/i,O=/BB10/i,A=/Opera Mini/i,P=/\b(CriOS|Chrome)(?:.+)Mobile/i,I=/Mobile(?:.+)Firefox\b/i;function W(Dt,lt){return Dt.test(lt)}function K(Dt){var lt=Dt||(typeof navigator!="undefined"?navigator.userAgent:""),pt=lt.split("[FBAN");if(typeof pt[1]!="undefined"){var ut=pt,Pe=Object(n.a)(ut,1);lt=Pe[0]}if(pt=lt.split("Twitter"),typeof pt[1]!="undefined"){var Ve=pt,yt=Object(n.a)(Ve,1);lt=yt[0]}var st={apple:{phone:W(c,lt)&&!W(C,lt),ipod:W(m,lt),tablet:!W(c,lt)&&W(v,lt)&&!W(C,lt),device:(W(c,lt)||W(m,lt)||W(v,lt))&&!W(C,lt)},amazon:{phone:W(g,lt),tablet:!W(g,lt)&&W(y,lt),device:W(g,lt)||W(y,lt)},android:{phone:!W(C,lt)&&W(g,lt)||!W(C,lt)&&W(b,lt),tablet:!W(C,lt)&&!W(g,lt)&&!W(b,lt)&&(W(y,lt)||W(E,lt)),device:!W(C,lt)&&(W(g,lt)||W(y,lt)||W(b,lt)||W(E,lt))||W(/\bokhttp\b/i,lt)},windows:{phone:W(C,lt),tablet:W(d,lt),device:W(C,lt)||W(d,lt)},other:{blackberry:W(_,lt),blackberry10:W(O,lt),opera:W(A,lt),firefox:W(I,lt),chrome:W(P,lt),device:W(_,lt)||W(O,lt)||W(A,lt)||W(I,lt)||W(P,lt)},any:null,phone:null,tablet:null};return st.any=st.apple.device||st.android.device||st.windows.device||st.other.device,st.phone=st.apple.phone||st.android.phone||st.windows.phone,st.tablet=st.apple.tablet||st.android.tablet||st.windows.tablet,st}var te=Object(ue.a)(Object(ue.a)({},K()),{},{isMobile:K}),H=te;function G(){}function V(Dt,lt,pt){var ut=lt||"";return Dt.key||"".concat(ut,"item_").concat(pt)}function re(Dt){return"".concat(Dt,"-menu-")}function $(Dt,lt){var pt=-1;T.Children.forEach(Dt,function(ut){pt+=1,ut&&ut.type&&ut.type.isMenuItemGroup?T.Children.forEach(ut.props.children,function(Pe){pt+=1,lt(Pe,pt)}):lt(ut,pt)})}function ne(Dt,lt,pt){if(!Dt||pt.find)return;T.Children.forEach(Dt,function(ut){if(ut){var Pe=ut.type;if(!Pe||!(Pe.isSubMenu||Pe.isMenuItem||Pe.isMenuItemGroup))return;lt.indexOf(ut.key)!==-1?pt.find=!0:ut.props.children&&ne(ut.props.children,lt,pt)}})}var he=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],pe=function(lt){var pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ut=lt&&typeof lt.getBoundingClientRect=="function"&<.getBoundingClientRect().width;if(ut){if(pt){var Pe=getComputedStyle(lt),Ve=Pe.marginLeft,yt=Pe.marginRight;ut+=+Ve.replace("px","")+ +yt.replace("px","")}ut=+ut.toFixed(6)}return ut||0},Te=function(lt,pt,ut){lt&&Object(t.a)(lt.style)==="object"&&(lt.style[pt]=ut)},we=function(){return H.any},Me=F("KQm4"),Ee=F("Ff2n"),xe=F("i8i4"),Ge=F("bdgK"),je=F("uciX"),We=F("8XRh"),ze={adjustX:1,adjustY:1},de={topLeft:{points:["bl","tl"],overflow:ze,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ze,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:ze,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:ze,offset:[4,0]}},le={topLeft:{points:["bl","tl"],overflow:ze,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ze,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:ze,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:ze,offset:[4,0]}},Oe=de,Ie=0,qe={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},ee=function(lt,pt,ut){var Pe=re(pt),Ve=lt.getState();lt.setState({defaultActiveFirst:Object(ue.a)(Object(ue.a)({},Ve.defaultActiveFirst),{},Object(u.a)({},Pe,ut))})},k=function(Dt){Object(D.a)(pt,Dt);var lt=Object(x.a)(pt);function pt(ut){var Pe;Object(Q.a)(this,pt),Pe=lt.call(this,ut),Pe.onDestroy=function(it){Pe.props.onDestroy(it)},Pe.onKeyDown=function(it){var mt=it.keyCode,bt=Pe.menuInstance,At=Pe.props,Xt=At.isOpen,Ae=At.store;if(mt===o.a.ENTER)return Pe.onTitleClick(it),ee(Ae,Pe.props.eventKey,!0),!0;if(mt===o.a.RIGHT)return Xt?bt.onKeyDown(it):(Pe.triggerOpenChange(!0),ee(Ae,Pe.props.eventKey,!0)),!0;if(mt===o.a.LEFT){var ge;if(Xt)ge=bt.onKeyDown(it);else return;return ge||(Pe.triggerOpenChange(!1),ge=!0),ge}return Xt&&(mt===o.a.UP||mt===o.a.DOWN)?bt.onKeyDown(it):void 0},Pe.onOpenChange=function(it){Pe.props.onOpenChange(it)},Pe.onPopupVisibleChange=function(it){Pe.triggerOpenChange(it,it?"mouseenter":"mouseleave")},Pe.onMouseEnter=function(it){var mt=Pe.props,bt=mt.eventKey,At=mt.onMouseEnter,Xt=mt.store;ee(Xt,Pe.props.eventKey,!1),At({key:bt,domEvent:it})},Pe.onMouseLeave=function(it){var mt=Pe.props,bt=mt.parentMenu,At=mt.eventKey,Xt=mt.onMouseLeave;bt.subMenuInstance=Object(S.a)(Pe),Xt({key:At,domEvent:it})},Pe.onTitleMouseEnter=function(it){var mt=Pe.props,bt=mt.eventKey,At=mt.onItemHover,Xt=mt.onTitleMouseEnter;At({key:bt,hover:!0}),Xt({key:bt,domEvent:it})},Pe.onTitleMouseLeave=function(it){var mt=Pe.props,bt=mt.parentMenu,At=mt.eventKey,Xt=mt.onItemHover,Ae=mt.onTitleMouseLeave;bt.subMenuInstance=Object(S.a)(Pe),Xt({key:At,hover:!1}),Ae({key:At,domEvent:it})},Pe.onTitleClick=function(it){var mt=Object(S.a)(Pe),bt=mt.props;if(bt.onTitleClick({key:bt.eventKey,domEvent:it}),bt.triggerSubMenuAction==="hover")return;Pe.triggerOpenChange(!bt.isOpen,"click"),ee(bt.store,Pe.props.eventKey,!1)},Pe.onSubMenuClick=function(it){typeof Pe.props.onClick=="function"&&Pe.props.onClick(Pe.addKeyPath(it))},Pe.onSelect=function(it){Pe.props.onSelect(it)},Pe.onDeselect=function(it){Pe.props.onDeselect(it)},Pe.getPrefixCls=function(){return"".concat(Pe.props.rootPrefixCls,"-submenu")},Pe.getActiveClassName=function(){return"".concat(Pe.getPrefixCls(),"-active")},Pe.getDisabledClassName=function(){return"".concat(Pe.getPrefixCls(),"-disabled")},Pe.getSelectedClassName=function(){return"".concat(Pe.getPrefixCls(),"-selected")},Pe.getOpenClassName=function(){return"".concat(Pe.props.rootPrefixCls,"-submenu-open")},Pe.saveMenuInstance=function(it){Pe.menuInstance=it},Pe.addKeyPath=function(it){return Object(ue.a)(Object(ue.a)({},it),{},{keyPath:(it.keyPath||[]).concat(Pe.props.eventKey)})},Pe.triggerOpenChange=function(it,mt){var bt=Pe.props.eventKey,At=function(){Pe.onOpenChange({key:bt,item:Object(S.a)(Pe),trigger:mt,open:it})};mt==="mouseenter"?Pe.mouseenterTimeout=setTimeout(function(){At()},0):At()},Pe.isChildrenSelected=function(){var it={find:!1};return ne(Pe.props.children,Pe.props.selectedKeys,it),it.find},Pe.isOpen=function(){return Pe.props.openKeys.indexOf(Pe.props.eventKey)!==-1},Pe.adjustWidth=function(){if(!Pe.subMenuTitle||!Pe.menuInstance)return;var it=xe.findDOMNode(Pe.menuInstance);if(it.offsetWidth>=Pe.subMenuTitle.offsetWidth)return;it.style.minWidth="".concat(Pe.subMenuTitle.offsetWidth,"px")},Pe.saveSubMenuTitle=function(it){Pe.subMenuTitle=it},Pe.getBaseProps=function(){var it=Object(S.a)(Pe),mt=it.props;return{mode:mt.mode==="horizontal"?"vertical":mt.mode,visible:Pe.props.isOpen,level:mt.level+1,inlineIndent:mt.inlineIndent,focusable:!1,onClick:Pe.onSubMenuClick,onSelect:Pe.onSelect,onDeselect:Pe.onDeselect,onDestroy:Pe.onDestroy,selectedKeys:mt.selectedKeys,eventKey:"".concat(mt.eventKey,"-menu-"),openKeys:mt.openKeys,motion:mt.motion,onOpenChange:Pe.onOpenChange,subMenuOpenDelay:mt.subMenuOpenDelay,parentMenu:Object(S.a)(Pe),subMenuCloseDelay:mt.subMenuCloseDelay,forceSubMenuRender:mt.forceSubMenuRender,triggerSubMenuAction:mt.triggerSubMenuAction,builtinPlacements:mt.builtinPlacements,defaultActiveFirst:mt.store.getState().defaultActiveFirst[re(mt.eventKey)],multiple:mt.multiple,prefixCls:mt.rootPrefixCls,id:Pe.internalMenuId,manualRef:Pe.saveMenuInstance,itemIcon:mt.itemIcon,expandIcon:mt.expandIcon,direction:mt.direction}},Pe.getMotion=function(it,mt){var bt=Object(S.a)(Pe),At=bt.haveRendered,Xt=Pe.props,Ae=Xt.motion,ge=Xt.rootPrefixCls,z=Object(ue.a)(Object(ue.a)({},Ae),{},{leavedClassName:"".concat(ge,"-hidden"),removeOnLeave:!1,motionAppear:At||!mt||it!=="inline"});return z};var Ve=ut.store,yt=ut.eventKey,st=Ve.getState(),Nt=st.defaultActiveFirst;Pe.isRootMenu=!1;var Ut=!1;return Nt&&(Ut=Nt[yt]),ee(Ve,yt,Ut),Pe}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var Pe=this,Ve=this.props,yt=Ve.mode,st=Ve.parentMenu,Nt=Ve.manualRef;if(Nt&&Nt(this),yt!=="horizontal"||!st.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return Pe.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var Pe=this.props,Ve=Pe.onDestroy,yt=Pe.eventKey;Ve&&Ve(yt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(Pe){var Ve=this,yt=this.getBaseProps(),st=this.getMotion(yt.mode,yt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||yt.visible||yt.forceSubMenuRender,!this.haveOpened)return T.createElement("div",null);var Nt=yt.direction;return T.createElement(We.default,Object.assign({visible:yt.visible},st),function(Ut){var it=Ut.className,mt=Ut.style,bt=r()("".concat(yt.prefixCls,"-sub"),it,Object(u.a)({},"".concat(yt.prefixCls,"-rtl"),Nt==="rtl"));return T.createElement(Ke,Object.assign({},yt,{id:Ve.internalMenuId,className:bt,style:mt}),Pe)})}},{key:"render",value:function(){var Pe,Ve=Object(ue.a)({},this.props),yt=Ve.isOpen,st=this.getPrefixCls(),Nt=Ve.mode==="inline",Ut=r()(st,"".concat(st,"-").concat(Ve.mode),(Pe={},Object(u.a)(Pe,Ve.className,!!Ve.className),Object(u.a)(Pe,this.getOpenClassName(),yt),Object(u.a)(Pe,this.getActiveClassName(),Ve.active||yt&&!Nt),Object(u.a)(Pe,this.getDisabledClassName(),Ve.disabled),Object(u.a)(Pe,this.getSelectedClassName(),this.isChildrenSelected()),Pe));this.internalMenuId||(Ve.eventKey?this.internalMenuId="".concat(Ve.eventKey,"$Menu"):(Ie+=1,this.internalMenuId="$__$".concat(Ie,"$Menu")));var it={},mt={},bt={};Ve.disabled||(it={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},mt={onClick:this.onTitleClick},bt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var At={},Xt=Ve.direction;Nt&&(Xt==="rtl"?At.paddingRight=Ve.inlineIndent*Ve.level:At.paddingLeft=Ve.inlineIndent*Ve.level);var Ae={};this.props.isOpen&&(Ae={"aria-owns":this.internalMenuId});var ge=null;Ve.mode!=="horizontal"&&(ge=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ge=T.createElement(this.props.expandIcon,Object(ue.a)({},this.props))));var z=T.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:At,className:"".concat(st,"-title"),role:"button"},bt,mt,{"aria-expanded":yt},Ae,{"aria-haspopup":"true",title:typeof Ve.title=="string"?Ve.title:void 0}),Ve.title,ge||T.createElement("i",{className:"".concat(st,"-arrow")})),Z=this.renderChildren(Ve.children),oe=Ve.parentMenu.isRootMenu?Ve.parentMenu.props.getPopupContainer:function(Qt){return Qt.parentNode},me=qe[Ve.mode],Re=Ve.popupOffset?{offset:Ve.popupOffset}:{},Je=Ve.mode==="inline"?"":Ve.popupClassName;Je+=Xt==="rtl"?" ".concat(st,"-rtl"):"";var at=Ve.disabled,kt=Ve.triggerSubMenuAction,jt=Ve.subMenuOpenDelay,ot=Ve.forceSubMenuRender,wt=Ve.subMenuCloseDelay,Kt=Ve.builtinPlacements;he.forEach(function(Qt){return delete Ve[Qt]}),delete Ve.onClick;var Et=Xt==="rtl"?Object.assign({},le,Kt):Object.assign({},de,Kt);return delete Ve.direction,T.createElement("li",Object.assign({},Ve,it,{className:Ut,role:"menuitem"}),Nt&&z,Nt&&Z,!Nt&&T.createElement(je.a,{prefixCls:st,popupClassName:r()("".concat(st,"-popup"),Je),getPopupContainer:oe,builtinPlacements:Et,popupPlacement:me,popupVisible:yt,popupAlign:Re,popup:Z,action:at?[]:[kt],mouseEnterDelay:jt,mouseLeaveDelay:wt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ot},z))}}]),pt}(T.Component);k.defaultProps={onMouseEnter:G,onMouseLeave:G,onTitleMouseEnter:G,onTitleMouseLeave:G,onTitleClick:G,manualRef:G,mode:"vertical",title:""};var U=Object(w.b)(function(Dt,lt){var pt=Dt.openKeys,ut=Dt.activeKey,Pe=Dt.selectedKeys,Ve=lt.eventKey,yt=lt.subMenuKey;return{isOpen:pt.indexOf(Ve)>-1,active:ut[yt]===Ve,selectedKeys:Pe}})(k);U.isSubMenu=!0;var q=U,Y="menuitem-overflowed",J=.5,be=function(Dt){Object(D.a)(pt,Dt);var lt=Object(x.a)(pt);function pt(){var ut;return Object(Q.a)(this,pt),ut=lt.apply(this,arguments),ut.resizeObserver=null,ut.mutationObserver=null,ut.originalTotalWidth=0,ut.overflowedItems=[],ut.menuItemSizes=[],ut.cancelFrameId=null,ut.state={lastVisibleIndex:void 0},ut.getMenuItemNodes=function(){var Pe=ut.props.prefixCls,Ve=xe.findDOMNode(Object(S.a)(ut));return Ve?[].slice.call(Ve.children).filter(function(yt){return yt.className.split(" ").indexOf("".concat(Pe,"-overflowed-submenu"))<0}):[]},ut.getOverflowedSubMenuItem=function(Pe,Ve,yt){var st=ut.props,Nt=st.overflowedIndicator,Ut=st.level,it=st.mode,mt=st.prefixCls,bt=st.theme;if(Ut!==1||it!=="horizontal")return null;var At=ut.props.children[0],Xt=At.props,Ae=Xt.children,ge=Xt.title,z=Xt.style,Z=Object(Ee.a)(Xt,["children","title","style"]),oe=Object(ue.a)({},z),me="".concat(Pe,"-overflowed-indicator"),Re="".concat(Pe,"-overflowed-indicator");Ve.length===0&&yt!==!0?oe=Object(ue.a)(Object(ue.a)({},oe),{},{display:"none"}):yt&&(oe=Object(ue.a)(Object(ue.a)({},oe),{},{visibility:"hidden",position:"absolute"}),me="".concat(me,"-placeholder"),Re="".concat(Re,"-placeholder"));var Je=bt?"".concat(mt,"-").concat(bt):"",at={};return he.forEach(function(kt){Z[kt]!==void 0&&(at[kt]=Z[kt])}),T.createElement(q,Object.assign({title:Nt,className:"".concat(mt,"-overflowed-submenu"),popupClassName:Je},at,{key:me,eventKey:Re,disabled:!1,style:oe}),Ve)},ut.setChildrenWidthAndResize=function(){if(ut.props.mode!=="horizontal")return;var Pe=xe.findDOMNode(Object(S.a)(ut));if(!Pe)return;var Ve=Pe.children;if(!Ve||Ve.length===0)return;var yt=Pe.children[Ve.length-1];Te(yt,"display","inline-block");var st=ut.getMenuItemNodes(),Nt=st.filter(function(Ut){return Ut.className.split(" ").indexOf(Y)>=0});Nt.forEach(function(Ut){Te(Ut,"display","inline-block")}),ut.menuItemSizes=st.map(function(Ut){return pe(Ut,!0)}),Nt.forEach(function(Ut){Te(Ut,"display","none")}),ut.overflowedIndicatorWidth=pe(Pe.children[Pe.children.length-1],!0),ut.originalTotalWidth=ut.menuItemSizes.reduce(function(Ut,it){return Ut+it},0),ut.handleResize(),Te(yt,"display","none")},ut.handleResize=function(){if(ut.props.mode!=="horizontal")return;var Pe=xe.findDOMNode(Object(S.a)(ut));if(!Pe)return;var Ve=pe(Pe);ut.overflowedItems=[];var yt=0,st;ut.originalTotalWidth>Ve+J&&(st=-1,ut.menuItemSizes.forEach(function(Nt){yt+=Nt,yt+ut.overflowedIndicatorWidth<=Ve&&(st+=1)})),ut.setState({lastVisibleIndex:st})},ut}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){var Pe=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ve=xe.findDOMNode(this);if(!Ve)return;this.resizeObserver=new Ge.default(function(yt){yt.forEach(function(){var st=Pe.cancelFrameId;cancelAnimationFrame(st),Pe.cancelFrameId=requestAnimationFrame(Pe.setChildrenWidthAndResize)})}),[].slice.call(Ve.children).concat(Ve).forEach(function(yt){Pe.resizeObserver.observe(yt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){Pe.resizeObserver.disconnect(),[].slice.call(Ve.children).concat(Ve).forEach(function(yt){Pe.resizeObserver.observe(yt)}),Pe.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ve,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(Pe){var Ve=this,yt=this.state.lastVisibleIndex;return(Pe||[]).reduce(function(st,Nt,Ut){var it=Nt;if(Ve.props.mode==="horizontal"){var mt=Ve.getOverflowedSubMenuItem(Nt.props.eventKey,[]);yt!==void 0&&Ve.props.className.indexOf("".concat(Ve.props.prefixCls,"-root"))!==-1&&(Ut>yt&&(it=T.cloneElement(Nt,{style:{display:"none"},eventKey:"".concat(Nt.props.eventKey,"-hidden"),className:"".concat(Y)})),Ut===yt+1&&(Ve.overflowedItems=Pe.slice(yt+1).map(function(At){return T.cloneElement(At,{key:At.props.eventKey,mode:"vertical-left"})}),mt=Ve.getOverflowedSubMenuItem(Nt.props.eventKey,Ve.overflowedItems)));var bt=[].concat(Object(Me.a)(st),[mt,it]);return Ut===Pe.length-1&&bt.push(Ve.getOverflowedSubMenuItem(Nt.props.eventKey,[],!0)),bt}return[].concat(Object(Me.a)(st),[it])},[])}},{key:"render",value:function(){var Pe=this.props,Ve=Pe.visible,yt=Pe.prefixCls,st=Pe.overflowedIndicator,Nt=Pe.mode,Ut=Pe.level,it=Pe.tag,mt=Pe.children,bt=Pe.theme,At=Object(Ee.a)(Pe,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Xt=it;return T.createElement(Xt,Object.assign({},At),this.renderChildren(mt))}}]),pt}(T.Component);be.defaultProps={tag:"div",className:""};var ke=be;function ct(Dt){return Dt.length?Dt.every(function(lt){return!!lt.props.disabled}):!0}function He(Dt,lt,pt){var ut=Dt.getState();Dt.setState({activeKey:Object(ue.a)(Object(ue.a)({},ut.activeKey),{},Object(u.a)({},lt,pt))})}function Be(Dt){return Dt.eventKey||"0-menu-"}function Ze(Dt,lt){var pt=lt,ut=Dt.children,Pe=Dt.eventKey;if(pt){var Ve;if($(ut,function(yt,st){yt&&yt.props&&!yt.props.disabled&&pt===V(yt,Pe,st)&&(Ve=!0)}),Ve)return pt}return pt=null,Dt.defaultActiveFirst&&$(ut,function(yt,st){!pt&&yt&&!yt.props.disabled&&(pt=V(yt,Pe,st))}),pt}function ht(Dt){if(Dt){var lt=this.instanceArray.indexOf(Dt);lt!==-1?this.instanceArray[lt]=Dt:this.instanceArray.push(Dt)}}var Qe=function(Dt){Object(D.a)(pt,Dt);var lt=Object(x.a)(pt);function pt(ut){var Pe;return Object(Q.a)(this,pt),Pe=lt.call(this,ut),Pe.onKeyDown=function(Ve,yt){var st=Ve.keyCode,Nt;if(Pe.getFlatInstanceArray().forEach(function(it){it&&it.props.active&&it.onKeyDown&&(Nt=it.onKeyDown(Ve))}),Nt)return 1;var Ut=null;return(st===o.a.UP||st===o.a.DOWN)&&(Ut=Pe.step(st===o.a.UP?-1:1)),Ut?(Ve.preventDefault(),He(Pe.props.store,Be(Pe.props),Ut.props.eventKey),typeof yt=="function"&&yt(Ut),1):void 0},Pe.onItemHover=function(Ve){var yt=Ve.key,st=Ve.hover;He(Pe.props.store,Be(Pe.props),st?yt:null)},Pe.onDeselect=function(Ve){Pe.props.onDeselect(Ve)},Pe.onSelect=function(Ve){Pe.props.onSelect(Ve)},Pe.onClick=function(Ve){Pe.props.onClick(Ve)},Pe.onOpenChange=function(Ve){Pe.props.onOpenChange(Ve)},Pe.onDestroy=function(Ve){Pe.props.onDestroy(Ve)},Pe.getFlatInstanceArray=function(){return Pe.instanceArray},Pe.step=function(Ve){var yt=Pe.getFlatInstanceArray(),st=Pe.props.store.getState().activeKey[Be(Pe.props)],Nt=yt.length;if(!Nt)return null;Ve<0&&(yt=yt.concat().reverse());var Ut=-1;if(yt.every(function(At,Xt){return At&&At.props.eventKey===st?(Ut=Xt,!1):!0}),!Pe.props.defaultActiveFirst&&Ut!==-1&&ct(yt.slice(Ut,Nt-1)))return;var it=(Ut+1)%Nt,mt=it;do{var bt=yt[mt];if(!bt||bt.props.disabled)mt=(mt+1)%Nt;else return bt}while(mt!==it);return null},Pe.renderCommonMenuItem=function(Ve,yt,st){var Nt=Pe.props.store.getState(),Ut=Object(S.a)(Pe),it=Ut.props,mt=V(Ve,it.eventKey,yt),bt=Ve.props;if(!bt||typeof Ve.type=="string")return Ve;var At=mt===Nt.activeKey,Xt=Object(ue.a)(Object(ue.a)({mode:bt.mode||it.mode,level:it.level,inlineIndent:it.inlineIndent,renderMenuItem:Pe.renderMenuItem,rootPrefixCls:it.prefixCls,index:yt,parentMenu:it.parentMenu,manualRef:bt.disabled?void 0:Object(i.a)(Ve.ref,ht.bind(Object(S.a)(Pe))),eventKey:mt,active:!bt.disabled&&At,multiple:it.multiple,onClick:function(ge){(bt.onClick||G)(ge),Pe.onClick(ge)},onItemHover:Pe.onItemHover,motion:it.motion,subMenuOpenDelay:it.subMenuOpenDelay,subMenuCloseDelay:it.subMenuCloseDelay,forceSubMenuRender:it.forceSubMenuRender,onOpenChange:Pe.onOpenChange,onDeselect:Pe.onDeselect,onSelect:Pe.onSelect,builtinPlacements:it.builtinPlacements,itemIcon:bt.itemIcon||Pe.props.itemIcon,expandIcon:bt.expandIcon||Pe.props.expandIcon},st),{},{direction:it.direction});return(it.mode==="inline"||we())&&(Xt.triggerSubMenuAction="click"),T.cloneElement(Ve,Xt)},Pe.renderMenuItem=function(Ve,yt,st){if(!Ve)return null;var Nt=Pe.props.store.getState(),Ut={openKeys:Nt.openKeys,selectedKeys:Nt.selectedKeys,triggerSubMenuAction:Pe.props.triggerSubMenuAction,subMenuKey:st};return Pe.renderCommonMenuItem(Ve,yt,Ut)},ut.store.setState({activeKey:Object(ue.a)(Object(ue.a)({},ut.store.getState().activeKey),{},Object(u.a)({},ut.eventKey,Ze(ut,ut.activeKey)))}),Pe.instanceArray=[],Pe}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(Pe){return this.props.visible||Pe.visible||this.props.className!==Pe.className||!s()(this.props.style,Pe.style)}},{key:"componentDidUpdate",value:function(Pe){var Ve=this.props,yt="activeKey"in Ve?Ve.activeKey:Ve.store.getState().activeKey[Be(Ve)],st=Ze(Ve,yt);if(st!==yt)He(Ve.store,Be(Ve),st);else if("activeKey"in Pe){var Nt=Ze(Pe,Pe.activeKey);st!==Nt&&He(Ve.store,Be(Ve),st)}}},{key:"render",value:function(){var Pe=this,Ve=Object(p.a)({},this.props);this.instanceArray=[];var yt=r()(Ve.prefixCls,Ve.className,"".concat(Ve.prefixCls,"-").concat(Ve.mode)),st={className:yt,role:Ve.role||"menu"};Ve.id&&(st.id=Ve.id),Ve.focusable&&(st.tabIndex=0,st.onKeyDown=this.onKeyDown);var Nt=Ve.prefixCls,Ut=Ve.eventKey,it=Ve.visible,mt=Ve.level,bt=Ve.mode,At=Ve.overflowedIndicator,Xt=Ve.theme;return he.forEach(function(Ae){return delete Ve[Ae]}),delete Ve.onClick,T.createElement(ke,Object.assign({},Ve,{prefixCls:Nt,mode:bt,tag:"ul",level:mt,theme:Xt,visible:it,overflowedIndicator:At},st),T.Children.map(Ve.children,function(Ae,ge){return Pe.renderMenuItem(Ae,ge,Ut||"0-menu-")}))}}]),pt}(T.Component);Qe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:G};var Xe=Object(w.b)()(Qe),Ke=Xe,Fe=F("Kwbf");function Ue(Dt,lt,pt){var ut=Dt.prefixCls,Pe=Dt.motion,Ve=Dt.defaultMotions,yt=Ve===void 0?{}:Ve,st=Dt.openAnimation,Nt=Dt.openTransitionName,Ut=lt.switchingModeFromInline;if(Pe)return Pe;if(Object(t.a)(st)==="object"&&st)Object(Fe.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof st=="string")return{motionName:"".concat(ut,"-open-").concat(st)};if(Nt)return{motionName:Nt};var it=yt[pt];return it||(Ut?null:yt.other)}var _e=function(Dt){Object(D.a)(pt,Dt);var lt=Object(x.a)(pt);function pt(ut){var Pe;Object(Q.a)(this,pt),Pe=lt.call(this,ut),Pe.inlineOpenKeys=[],Pe.onSelect=function(st){var Nt=Object(S.a)(Pe),Ut=Nt.props;if(Ut.selectable){var it=Pe.store.getState(),mt=it.selectedKeys,bt=st.key;Ut.multiple?mt=mt.concat([bt]):mt=[bt],"selectedKeys"in Ut||Pe.store.setState({selectedKeys:mt}),Ut.onSelect(Object(ue.a)(Object(ue.a)({},st),{},{selectedKeys:mt}))}},Pe.onClick=function(st){var Nt=Pe.getRealMenuMode(),Ut=Object(S.a)(Pe),it=Ut.store,mt=Ut.props.onOpenChange;Nt!=="inline"&&!("openKeys"in Pe.props)&&(it.setState({openKeys:[]}),mt([])),Pe.props.onClick(st)},Pe.onKeyDown=function(st,Nt){Pe.innerMenu.getWrappedInstance().onKeyDown(st,Nt)},Pe.onOpenChange=function(st){var Nt=Object(S.a)(Pe),Ut=Nt.props,it=Pe.store.getState().openKeys.concat(),mt=!1,bt=function(Xt){var Ae=!1;if(Xt.open)Ae=it.indexOf(Xt.key)===-1,Ae&&it.push(Xt.key);else{var ge=it.indexOf(Xt.key);Ae=ge!==-1,Ae&&it.splice(ge,1)}mt=mt||Ae};Array.isArray(st)?st.forEach(bt):bt(st),mt&&("openKeys"in Pe.props||Pe.store.setState({openKeys:it}),Ut.onOpenChange(it))},Pe.onDeselect=function(st){var Nt=Object(S.a)(Pe),Ut=Nt.props;if(Ut.selectable){var it=Pe.store.getState().selectedKeys.concat(),mt=st.key,bt=it.indexOf(mt);bt!==-1&&it.splice(bt,1),"selectedKeys"in Ut||Pe.store.setState({selectedKeys:it}),Ut.onDeselect(Object(ue.a)(Object(ue.a)({},st),{},{selectedKeys:it}))}},Pe.onMouseEnter=function(st){Pe.restoreModeVerticalFromInline();var Nt=Pe.props.onMouseEnter;Nt&&Nt(st)},Pe.onTransitionEnd=function(st){var Nt=st.propertyName==="width"&&st.target===st.currentTarget,Ut=st.target.className,it=Object.prototype.toString.call(Ut)==="[object SVGAnimatedString]"?Ut.animVal:Ut,mt=st.propertyName==="font-size"&&it.indexOf("anticon")>=0;(Nt||mt)&&Pe.restoreModeVerticalFromInline()},Pe.setInnerMenu=function(st){Pe.innerMenu=st},Pe.isRootMenu=!0;var Ve=ut.defaultSelectedKeys,yt=ut.defaultOpenKeys;return"selectedKeys"in ut&&(Ve=ut.selectedKeys||[]),"openKeys"in ut&&(yt=ut.openKeys||[]),Pe.store=Object(w.c)({selectedKeys:Ve,openKeys:yt,activeKey:{"0-menu-":Ze(ut,ut.activeKey)}}),Pe.state={switchingModeFromInline:!1},Pe}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(Pe){this.updateOpentKeysWhenSwitchMode(Pe),this.updateMiniStore();var Ve=this.props,yt=Ve.siderCollapsed,st=Ve.inlineCollapsed,Nt=Ve.onOpenChange;(!Pe.inlineCollapsed&&st||!Pe.siderCollapsed&&yt)&&Nt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(Pe){var Ve=this.props,yt=this.store,st=this.inlineOpenKeys,Nt=yt.getState(),Ut={};Pe.mode==="inline"&&Ve.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Ve||((Ve.inlineCollapsed&&!Pe.inlineCollapsed||Ve.siderCollapsed&&!Pe.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Nt.openKeys.concat(),Ut.openKeys=[]),(!Ve.inlineCollapsed&&Pe.inlineCollapsed||!Ve.siderCollapsed&&Pe.siderCollapsed)&&(Ut.openKeys=st,this.inlineOpenKeys=[])),Object.keys(Ut).length&&yt.setState(Ut)}},{key:"updateMenuDisplay",value:function(){var Pe=this.props.collapsedWidth,Ve=this.store,yt=this.prevOpenKeys,st=this.getInlineCollapsed()&&(Pe===0||Pe==="0"||Pe==="0px");st?(this.prevOpenKeys=Ve.getState().openKeys.concat(),this.store.setState({openKeys:[]})):yt&&(this.store.setState({openKeys:yt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var Pe=this.props.mode,Ve=this.state.switchingModeFromInline,yt=this.getInlineCollapsed();return Ve&&yt?"inline":yt?"vertical":Pe}},{key:"getInlineCollapsed",value:function(){var Pe=this.props,Ve=Pe.inlineCollapsed,yt=Pe.siderCollapsed;return yt!==void 0?yt:Ve}},{key:"restoreModeVerticalFromInline",value:function(){var Pe=this.state.switchingModeFromInline;Pe&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var Pe=Object(ue.a)({},Object(f.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ve=this.getRealMenuMode();return Pe.className+=" ".concat(Pe.prefixCls,"-root"),Pe.direction==="rtl"&&(Pe.className+=" ".concat(Pe.prefixCls,"-rtl")),Pe=Object(ue.a)(Object(ue.a)({},Pe),{},{mode:Ve,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Ue(this.props,this.state,Ve)}),delete Pe.openAnimation,delete Pe.openTransitionName,T.createElement(w.a,{store:this.store},T.createElement(Ke,Object.assign({},Pe,{ref:this.setInnerMenu}),this.props.children))}}]),pt}(T.Component);_e.defaultProps={selectable:!0,onClick:G,onSelect:G,onOpenChange:G,onDeselect:G,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:T.createElement("span",null,"\xB7\xB7\xB7")};var Ce=_e,Ne=function(Dt){Object(D.a)(pt,Dt);var lt=Object(x.a)(pt);function pt(){var ut;return Object(Q.a)(this,pt),ut=lt.apply(this,arguments),ut.onKeyDown=function(Pe){var Ve=Pe.keyCode;return Ve===o.a.ENTER?(ut.onClick(Pe),!0):void 0},ut.onMouseLeave=function(Pe){var Ve=ut.props,yt=Ve.eventKey,st=Ve.onItemHover,Nt=Ve.onMouseLeave;st({key:yt,hover:!1}),Nt({key:yt,domEvent:Pe})},ut.onMouseEnter=function(Pe){var Ve=ut.props,yt=Ve.eventKey,st=Ve.onItemHover,Nt=Ve.onMouseEnter;st({key:yt,hover:!0}),Nt({key:yt,domEvent:Pe})},ut.onClick=function(Pe){var Ve=ut.props,yt=Ve.eventKey,st=Ve.multiple,Nt=Ve.onClick,Ut=Ve.onSelect,it=Ve.onDeselect,mt=Ve.isSelected,bt={key:yt,keyPath:[yt],item:Object(S.a)(ut),domEvent:Pe};Nt(bt),st?mt?it(bt):Ut(bt):mt||Ut(bt)},ut.saveNode=function(Pe){ut.node=Pe},ut}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var Pe=this.props;Pe.onDestroy&&Pe.onDestroy(Pe.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var Pe,Ve=Object(ue.a)({},this.props),yt=r()(this.getPrefixCls(),Ve.className,(Pe={},Object(u.a)(Pe,this.getActiveClassName(),!Ve.disabled&&Ve.active),Object(u.a)(Pe,this.getSelectedClassName(),Ve.isSelected),Object(u.a)(Pe,this.getDisabledClassName(),Ve.disabled),Pe)),st=Object(ue.a)(Object(ue.a)({},Ve.attribute),{},{title:typeof Ve.title=="string"?Ve.title:void 0,className:yt,role:Ve.role||"menuitem","aria-disabled":Ve.disabled});Ve.role==="option"?st=Object(ue.a)(Object(ue.a)({},st),{},{role:"option","aria-selected":Ve.isSelected}):(Ve.role===null||Ve.role==="none")&&(st.role="none");var Nt={onClick:Ve.disabled?null:this.onClick,onMouseLeave:Ve.disabled?null:this.onMouseLeave,onMouseEnter:Ve.disabled?null:this.onMouseEnter},Ut=Object(ue.a)({},Ve.style);Ve.mode==="inline"&&(Ve.direction==="rtl"?Ut.paddingRight=Ve.inlineIndent*Ve.level:Ut.paddingLeft=Ve.inlineIndent*Ve.level),he.forEach(function(mt){return delete Ve[mt]}),delete Ve.direction;var it=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(it=T.createElement(this.props.itemIcon,this.props)),T.createElement("li",Object.assign({},Object(f.default)(Ve,["onClick","onMouseEnter","onMouseLeave","onSelect"]),st,Nt,{style:Ut,ref:this.saveNode}),Ve.children,it)}}]),pt}(T.Component);Ne.isMenuItem=!0,Ne.defaultProps={onSelect:G,onMouseEnter:G,onMouseLeave:G,manualRef:G};var De=Object(w.b)(function(Dt,lt){var pt=Dt.activeKey,ut=Dt.selectedKeys,Pe=lt.eventKey,Ve=lt.subMenuKey;return{active:pt[Ve]===Pe,isSelected:ut.indexOf(Pe)!==-1}})(Ne),rt=De,tt=function(Dt){Object(D.a)(pt,Dt);var lt=Object(x.a)(pt);function pt(){var ut;return Object(Q.a)(this,pt),ut=lt.apply(this,arguments),ut.renderInnerMenuItem=function(Pe){var Ve=ut.props,yt=Ve.renderMenuItem,st=Ve.index;return yt(Pe,st,ut.props.subMenuKey)},ut}return Object(j.a)(pt,[{key:"render",value:function(){var Pe=Object(p.a)({},this.props),Ve=Pe.className,yt=Ve===void 0?"":Ve,st=Pe.rootPrefixCls,Nt="".concat(st,"-item-group-title"),Ut="".concat(st,"-item-group-list"),it=Pe.title,mt=Pe.children;return he.forEach(function(bt){return delete Pe[bt]}),delete Pe.onClick,delete Pe.direction,T.createElement("li",Object.assign({},Pe,{className:"".concat(yt," ").concat(st,"-item-group")}),T.createElement("div",{className:Nt,title:typeof it=="string"?it:void 0},it),T.createElement("ul",{className:Ut},T.Children.map(mt,this.renderInnerMenuItem)))}}]),pt}(T.Component);tt.isMenuItemGroup=!0,tt.defaultProps={disabled:!0};var xt=tt,Mt=function(lt){var pt=lt.className,ut=lt.rootPrefixCls,Pe=lt.style;return T.createElement("li",{className:"".concat(pt," ").concat(ut,"-item-divider"),style:Pe})};Mt.defaultProps={disabled:!0,className:"",style:{}};var Bt=Mt,It=Le.e=Ce},"24hK":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return j});var ue=F("JYp7"),Q=function(){function S(D){this.element=D,this.next=S.Undefined,this.prev=S.Undefined}return S.Undefined=new S(void 0),S}(),j=function(){function S(){this._first=Q.Undefined,this._last=Q.Undefined,this._size=0}return Object.defineProperty(S.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),S.prototype.isEmpty=function(){return this._first===Q.Undefined},S.prototype.clear=function(){this._first=Q.Undefined,this._last=Q.Undefined,this._size=0},S.prototype.unshift=function(D){return this._insert(D,!1)},S.prototype.push=function(D){return this._insert(D,!0)},S.prototype._insert=function(D,x){var T=this,w=new Q(D);if(this._first===Q.Undefined)this._first=w,this._last=w;else if(x){var f=this._last;this._last=w,w.prev=f,f.next=w}else{var p=this._first;this._first=w,w.next=p,p.prev=w}this._size+=1;var u=!1;return function(){u||(u=!0,T._remove(w))}},S.prototype.shift=function(){if(this._first===Q.Undefined)return;var D=this._first.element;return this._remove(this._first),D},S.prototype.pop=function(){if(this._last===Q.Undefined)return;var D=this._last.element;return this._remove(this._last),D},S.prototype._remove=function(D){if(D.prev!==Q.Undefined&&D.next!==Q.Undefined){var x=D.prev;x.next=D.next,D.next.prev=x}else D.prev===Q.Undefined&&D.next===Q.Undefined?(this._first=Q.Undefined,this._last=Q.Undefined):D.next===Q.Undefined?(this._last=this._last.prev,this._last.next=Q.Undefined):D.prev===Q.Undefined&&(this._first=this._first.next,this._first.prev=Q.Undefined);this._size-=1},S.prototype.iterator=function(){var D,x=this._first;return{next:function(){return x===Q.Undefined?ue.c:(D?D.value=x.element:D={done:!1,value:x.element},x=x.next,D)}}},S.prototype.toArray=function(){for(var D=[],x=this._first;x!==Q.Undefined;x=x.next)D.push(x.element);return D},S}()},"3tLw":function(nt,Le,F){nt.exports=F.p+"static/a.39070d50.svg"},"4xil":function(nt,Le,F){nt.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","volume-controls":"volume-controls___QLaWH","fullscreen-button":"fullscreen-button___2nHzc","pip-button":"pip-button___18qQG","playback-animation":"playback-animation___gCL6X",volume:"volume___10eUe",hidden:"hidden___2JBJW"}},"55Ip":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return n}),F.d(Le,"b",function(){return g});var ue=F("Ty5D"),Q=F("dI71"),j=F("q1tI"),S=F.n(j),D=F("YS25"),x=F("17x9"),T=F.n(x),w=F("wx14"),f=F("zLVn"),p=F("9R94"),u=function(C){Object(Q.a)(d,C);function d(){for(var O,A=arguments.length,P=new Array(A),I=0;I<A;I++)P[I]=arguments[I];return O=C.call.apply(C,[this].concat(P))||this,O.history=Object(D.a)(O.props),O}var _=d.prototype;return _.render=function(){return S.a.createElement(ue.c,{history:this.history,children:this.props.children})},d}(S.a.Component),o=function(C){Object(Q.a)(d,C);function d(){for(var O,A=arguments.length,P=new Array(A),I=0;I<A;I++)P[I]=arguments[I];return O=C.call.apply(C,[this].concat(P))||this,O.history=Object(D.b)(O.props),O}var _=d.prototype;return _.render=function(){return S.a.createElement(ue.c,{history:this.history,children:this.props.children})},d}(S.a.Component),i=function(d,_){return typeof d=="function"?d(_):d},l=function(d,_){return typeof d=="string"?Object(D.c)(d,null,null,_):d},s=function(d){return d},h=S.a.forwardRef;typeof h=="undefined"&&(h=s);function r(C){return!!(C.metaKey||C.altKey||C.ctrlKey||C.shiftKey)}var t=h(function(C,d){var _=C.innerRef,O=C.navigate,A=C.onClick,P=Object(f.a)(C,["innerRef","navigate","onClick"]),I=P.target,W=Object(w.a)({},P,{onClick:function(te){try{A&&A(te)}catch(H){throw te.preventDefault(),H}!te.defaultPrevented&&te.button===0&&(!I||I==="_self")&&!r(te)&&(te.preventDefault(),O())}});return s!==h?W.ref=d||_:W.ref=_,S.a.createElement("a",W)}),n=h(function(C,d){var _=C.component,O=_===void 0?t:_,A=C.replace,P=C.to,I=C.innerRef,W=Object(f.a)(C,["component","replace","to","innerRef"]);return S.a.createElement(ue.e.Consumer,null,function(K){K||Object(p.a)(!1);var te=K.history,H=l(i(P,K.location),K.location),G=H?te.createHref(H):"",V=Object(w.a)({},W,{href:G,navigate:function(){var $=i(P,K.location),ne=A?te.replace:te.push;ne($)}});return s!==h?V.ref=d||I:V.innerRef=I,S.a.createElement(O,V)})});if(!1)var c,m;var v=function(d){return d},b=S.a.forwardRef;typeof b=="undefined"&&(b=v);function E(){for(var C=arguments.length,d=new Array(C),_=0;_<C;_++)d[_]=arguments[_];return d.filter(function(O){return O}).join(" ")}var g=b(function(C,d){var _=C["aria-current"],O=_===void 0?"page":_,A=C.activeClassName,P=A===void 0?"active":A,I=C.activeStyle,W=C.className,K=C.exact,te=C.isActive,H=C.location,G=C.sensitive,V=C.strict,re=C.style,$=C.to,ne=C.innerRef,he=Object(f.a)(C,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return S.a.createElement(ue.e.Consumer,null,function(pe){pe||Object(p.a)(!1);var Te=H||pe.location,we=l(i($,Te),Te),Me=we.pathname,Ee=Me&&Me.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),xe=Ee?Object(ue.f)(Te.pathname,{path:Ee,exact:K,sensitive:G,strict:V}):null,Ge=!!(te?te(xe,Te):xe),je=Ge?E(W,P):W,We=Ge?Object(w.a)({},re,{},I):re,ze=Object(w.a)({"aria-current":Ge&&O||null,className:je,style:We,to:we},he);return v!==b?ze.ref=d||ne:ze.innerRef=ne,S.a.createElement(n,ze)})});if(!1)var y},"5nXd":function(nt,Le,F){var ue=F("MFOe"),Q=ue.slice,j=ue.pluck,S=ue.each,D=ue.bind,x=ue.create,T=ue.isList,w=ue.isFunction,f=ue.isObject;nt.exports={createStore:o};var p={version:"2.0.12",enabled:!1,get:function(i,l){var s=this.storage.read(this._namespacePrefix+i);return this._deserialize(s,l)},set:function(i,l){return l===void 0?this.remove(i):(this.storage.write(this._namespacePrefix+i,this._serialize(l)),l)},remove:function(i){this.storage.remove(this._namespacePrefix+i)},each:function(i){var l=this;this.storage.each(function(s,h){i.call(l,l._deserialize(s),(h||"").replace(l._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(i){return this._namespacePrefix=="__storejs_"+i+"_"},createStore:function(){return o.apply(this,arguments)},addPlugin:function(i){this._addPlugin(i)},namespace:function(i){return o(this.storage,this.plugins,i)}};function u(){var i=typeof console=="undefined"?null:console;if(!i)return;var l=i.warn?i.warn:i.log;l.apply(i,arguments)}function o(i,l,s){s||(s=""),i&&!T(i)&&(i=[i]),l&&!T(l)&&(l=[l]);var h=s?"__storejs_"+s+"_":"",r=s?new RegExp("^"+h):null,t=/^[a-zA-Z0-9_\-]*$/;if(!t.test(s))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var n={_namespacePrefix:h,_namespaceRegexp:r,_testStorage:function(m){try{var v="__storejs__test__";m.write(v,v);var b=m.read(v)===v;return m.remove(v),b}catch(E){return!1}},_assignPluginFnProp:function(m,v){var b=this[v];this[v]=function(){var g=Q(arguments,0),y=this;function C(){return b?(S(arguments,function(_,O){g[O]=_}),b.apply(y,g)):void 0}var d=[C].concat(g);return m.apply(y,d)}},_serialize:function(m){return JSON.stringify(m)},_deserialize:function(m,v){if(!m)return v;var b="";try{b=JSON.parse(m)}catch(E){b=m}return b!==void 0?b:v},_addStorage:function(m){if(this.enabled)return;this._testStorage(m)&&(this.storage=m,this.enabled=!0)},_addPlugin:function(m){var v=this;if(T(m)){S(m,function(g){v._addPlugin(g)});return}var b=j(this.plugins,function(g){return m===g});if(b)return;if(this.plugins.push(m),!w(m))throw new Error("Plugins must be function values that return objects");var E=m.call(this);if(!f(E))throw new Error("Plugins must return an object of function properties");S(E,function(g,y){if(!w(g))throw new Error("Bad plugin property: "+y+" from plugin "+m.name+". Plugins should only return functions.");v._assignPluginFnProp(g,y)})},addStorage:function(m){u("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(m)}},c=x(n,p,{plugins:[]});return c.raw={},S(c,function(m,v){w(m)&&(c.raw[v]=D(c,m))}),S(i,function(m){c._addStorage(m)}),S(l,function(m){c._addPlugin(m)}),c}},"6+eU":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return b});var ue=F("wx14"),Q=F("rePB"),j=F("VTBJ"),S=F("1OyB"),D=F("vuIU"),x=F("Ji7U"),T=F("LK+K"),w=F("q1tI"),f=F.n(w),p=F("TSYQ"),u=F.n(p),o=function(g){var y,C="".concat(g.rootPrefixCls,"-item"),d=u()(C,"".concat(C,"-").concat(g.page),(y={},Object(Q.a)(y,"".concat(C,"-active"),g.active),Object(Q.a)(y,g.className,!!g.className),Object(Q.a)(y,"".concat(C,"-disabled"),!g.page),y)),_=function(){g.onClick(g.page)},O=function(P){g.onKeyPress(P,g.onClick,g.page)};return f.a.createElement("li",{title:g.showTitle?g.page:null,className:d,onClick:_,onKeyPress:O,tabIndex:"0"},g.itemRender(g.page,"page",f.a.createElement("a",{rel:"nofollow"},g.page)))},i=o,l={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},s=function(E){Object(x.a)(y,E);var g=Object(T.a)(y);function y(){var C;Object(S.a)(this,y);for(var d=arguments.length,_=new Array(d),O=0;O<d;O++)_[O]=arguments[O];return C=g.call.apply(g,[this].concat(_)),C.state={goInputText:""},C.buildOptionText=function(A){return"".concat(A," ").concat(C.props.locale.items_per_page)},C.changeSize=function(A){C.props.changeSize(Number(A))},C.handleChange=function(A){C.setState({goInputText:A.target.value})},C.handleBlur=function(A){var P=C.props,I=P.goButton,W=P.quickGo,K=P.rootPrefixCls,te=C.state.goInputText;if(I||te==="")return;if(A.relatedTarget&&(A.relatedTarget.className.indexOf("".concat(K,"-prev"))>=0||A.relatedTarget.className.indexOf("".concat(K,"-next"))>=0))return;C.setState({goInputText:""}),W(C.getValidValue())},C.go=function(A){var P=C.state.goInputText;if(P==="")return;(A.keyCode===l.ENTER||A.type==="click")&&(C.setState({goInputText:""}),C.props.quickGo(C.getValidValue()))},C}return Object(D.a)(y,[{key:"getValidValue",value:function(){var d=this.state,_=d.goInputText,O=d.current;return!_||isNaN(_)?O:Number(_)}},{key:"getPageSizeOptions",value:function(){var d=this.props,_=d.pageSize,O=d.pageSizeOptions;return O.some(function(A){return A.toString()===_.toString()})?O:O.concat([_.toString()]).sort(function(A,P){var I=isNaN(Number(A))?0:Number(A),W=isNaN(Number(P))?0:Number(P);return I-W})}},{key:"render",value:function(){var d=this,_=this.props,O=_.pageSize,A=_.locale,P=_.rootPrefixCls,I=_.changeSize,W=_.quickGo,K=_.goButton,te=_.selectComponentClass,H=_.buildOptionText,G=_.selectPrefixCls,V=_.disabled,re=this.state.goInputText,$="".concat(P,"-options"),ne=te,he=null,pe=null,Te=null;if(!I&&!W)return null;var we=this.getPageSizeOptions();if(I&&ne){var Me=we.map(function(Ee,xe){return f.a.createElement(ne.Option,{key:xe,value:Ee.toString()},(H||d.buildOptionText)(Ee))});he=f.a.createElement(ne,{disabled:V,prefixCls:G,showSearch:!1,className:"".concat($,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(O||we[0]).toString(),onChange:this.changeSize,getPopupContainer:function(xe){return xe.parentNode}},Me)}return W&&(K&&(Te=typeof K=="boolean"?f.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:V,className:"".concat($,"-quick-jumper-button")},A.jump_to_confirm):f.a.createElement("span",{onClick:this.go,onKeyUp:this.go},K)),pe=f.a.createElement("div",{className:"".concat($,"-quick-jumper")},A.jump_to,f.a.createElement("input",{disabled:V,type:"text",value:re,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),A.page,Te)),f.a.createElement("li",{className:"".concat($)},he,pe)}}]),y}(f.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var h=s,r=F("N2Kk");function t(){}function n(E){return typeof E=="number"&&isFinite(E)&&Math.floor(E)===E}function c(E,g,y){return y}function m(E,g,y){var C=typeof E=="undefined"?g.pageSize:E;return Math.floor((y.total-1)/C)+1}var v=function(E){Object(x.a)(y,E);var g=Object(T.a)(y);function y(C){var d;Object(S.a)(this,y),d=g.call(this,C),d.getJumpPrevPage=function(){return Math.max(1,d.state.current-(d.props.showLessItems?3:5))},d.getJumpNextPage=function(){return Math.min(m(void 0,d.state,d.props),d.state.current+(d.props.showLessItems?3:5))},d.getItemIcon=function(I,W){var K=d.props.prefixCls,te=I||f.a.createElement("button",{type:"button","aria-label":W,className:"".concat(K,"-item-link")});return typeof I=="function"&&(te=f.a.createElement(I,Object(j.a)({},d.props))),te},d.savePaginationNode=function(I){d.paginationNode=I},d.isValid=function(I){return n(I)&&I!==d.state.current},d.shouldDisplayQuickJumper=function(){var I=d.props,W=I.showQuickJumper,K=I.pageSize,te=I.total;return te<=K?!1:W},d.handleKeyDown=function(I){(I.keyCode===l.ARROW_UP||I.keyCode===l.ARROW_DOWN)&&I.preventDefault()},d.handleKeyUp=function(I){var W=d.getValidValue(I),K=d.state.currentInputValue;W!==K&&d.setState({currentInputValue:W}),I.keyCode===l.ENTER?d.handleChange(W):I.keyCode===l.ARROW_UP?d.handleChange(W-1):I.keyCode===l.ARROW_DOWN&&d.handleChange(W+1)},d.changePageSize=function(I){var W=d.state.current,K=m(I,d.state,d.props);W=W>K?K:W,K===0&&(W=d.state.current),typeof I=="number"&&("pageSize"in d.props||d.setState({pageSize:I}),"current"in d.props||d.setState({current:W,currentInputValue:W})),d.props.onShowSizeChange(W,I),"onChange"in d.props&&d.props.onChange&&d.props.onChange(W,I)},d.handleChange=function(I){var W=d.props.disabled,K=I;if(d.isValid(K)&&!W){var te=m(void 0,d.state,d.props);K>te?K=te:K<1&&(K=1),"current"in d.props||d.setState({current:K,currentInputValue:K});var H=d.state.pageSize;return d.props.onChange(K,H),K}return d.state.current},d.prev=function(){d.hasPrev()&&d.handleChange(d.state.current-1)},d.next=function(){d.hasNext()&&d.handleChange(d.state.current+1)},d.jumpPrev=function(){d.handleChange(d.getJumpPrevPage())},d.jumpNext=function(){d.handleChange(d.getJumpNextPage())},d.hasPrev=function(){return d.state.current>1},d.hasNext=function(){return d.state.current<m(void 0,d.state,d.props)},d.runIfEnter=function(I,W){if(I.key==="Enter"||I.charCode===13){for(var K=arguments.length,te=new Array(K>2?K-2:0),H=2;H<K;H++)te[H-2]=arguments[H];W.apply(void 0,te)}},d.runIfEnterPrev=function(I){d.runIfEnter(I,d.prev)},d.runIfEnterNext=function(I){d.runIfEnter(I,d.next)},d.runIfEnterJumpPrev=function(I){d.runIfEnter(I,d.jumpPrev)},d.runIfEnterJumpNext=function(I){d.runIfEnter(I,d.jumpNext)},d.handleGoTO=function(I){(I.keyCode===l.ENTER||I.type==="click")&&d.handleChange(d.state.currentInputValue)};var _=C.onChange!==t,O="current"in C;O&&!_&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var A=C.defaultCurrent;"current"in C&&(A=C.current);var P=C.defaultPageSize;return"pageSize"in C&&(P=C.pageSize),A=Math.min(A,m(P,void 0,C)),d.state={current:A,currentInputValue:A,pageSize:P},d}return Object(D.a)(y,[{key:"componentDidUpdate",value:function(d,_){var O=this.props.prefixCls;if(_.current!==this.state.current&&this.paginationNode){var A=this.paginationNode.querySelector(".".concat(O,"-item-").concat(_.current));A&&document.activeElement===A&&A.blur()}}},{key:"getValidValue",value:function(d){var _=d.target.value,O=m(void 0,this.state,this.props),A=this.state.currentInputValue,P;return _===""?P=_:isNaN(Number(_))?P=A:_>=O?P=O:P=Number(_),P}},{key:"getShowSizeChanger",value:function(){var d=this.props,_=d.showSizeChanger,O=d.total,A=d.totalBoundaryShowSizeChanger;return typeof _!="undefined"?_:O>A}},{key:"renderPrev",value:function(d){var _=this.props,O=_.prevIcon,A=_.itemRender,P=A(d,"prev",this.getItemIcon(O,"prev page")),I=!this.hasPrev();return Object(w.isValidElement)(P)?Object(w.cloneElement)(P,{disabled:I}):P}},{key:"renderNext",value:function(d){var _=this.props,O=_.nextIcon,A=_.itemRender,P=A(d,"next",this.getItemIcon(O,"next page")),I=!this.hasNext();return Object(w.isValidElement)(P)?Object(w.cloneElement)(P,{disabled:I}):P}},{key:"render",value:function(){var d=this,_=this.props,O=_.prefixCls,A=_.className,P=_.style,I=_.disabled,W=_.hideOnSinglePage,K=_.total,te=_.locale,H=_.showQuickJumper,G=_.showLessItems,V=_.showTitle,re=_.showTotal,$=_.simple,ne=_.itemRender,he=_.showPrevNextJumpers,pe=_.jumpPrevIcon,Te=_.jumpNextIcon,we=_.selectComponentClass,Me=_.selectPrefixCls,Ee=_.pageSizeOptions,xe=this.state,Ge=xe.current,je=xe.pageSize,We=xe.currentInputValue;if(W===!0&&K<=je)return null;var ze=m(void 0,this.state,this.props),de=[],le=null,Oe=null,Ie=null,qe=null,ee=null,k=H&&H.goButton,U=G?1:2,q=Ge-1>0?Ge-1:0,Y=Ge+1<ze?Ge+1:ze,J=Object.keys(this.props).reduce(function(_e,Ce){return(Ce.substr(0,5)==="data-"||Ce.substr(0,5)==="aria-"||Ce==="role")&&(_e[Ce]=d.props[Ce]),_e},{});if($)return k&&(typeof k=="boolean"?ee=f.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},te.jump_to_confirm):ee=f.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},k),ee=f.a.createElement("li",{title:V?"".concat(te.jump_to).concat(Ge,"/").concat(ze):null,className:"".concat(O,"-simple-pager")},ee)),f.a.createElement("ul",Object(ue.a)({className:u()(O,"".concat(O,"-simple"),Object(Q.a)({},"".concat(O,"-disabled"),I),A),style:P,ref:this.savePaginationNode},J),f.a.createElement("li",{title:V?te.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:u()("".concat(O,"-prev"),Object(Q.a)({},"".concat(O,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(q)),f.a.createElement("li",{title:V?"".concat(Ge,"/").concat(ze):null,className:"".concat(O,"-simple-pager")},f.a.createElement("input",{type:"text",value:We,disabled:I,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),f.a.createElement("span",{className:"".concat(O,"-slash")},"/"),ze),f.a.createElement("li",{title:V?te.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:u()("".concat(O,"-next"),Object(Q.a)({},"".concat(O,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Y)),ee);if(ze<=3+U*2){var be={locale:te,rootPrefixCls:O,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:V,itemRender:ne};ze||de.push(f.a.createElement(i,Object(ue.a)({},be,{key:"noPager",page:ze,className:"".concat(O,"-disabled")})));for(var ke=1;ke<=ze;ke+=1){var ct=Ge===ke;de.push(f.a.createElement(i,Object(ue.a)({},be,{key:ke,page:ke,active:ct})))}}else{var He=G?te.prev_3:te.prev_5,Be=G?te.next_3:te.next_5;he&&(le=f.a.createElement("li",{title:V?He:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:u()("".concat(O,"-jump-prev"),Object(Q.a)({},"".concat(O,"-jump-prev-custom-icon"),!!pe))},ne(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(pe,"prev page"))),Oe=f.a.createElement("li",{title:V?Be:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:u()("".concat(O,"-jump-next"),Object(Q.a)({},"".concat(O,"-jump-next-custom-icon"),!!Te))},ne(this.getJumpNextPage(),"jump-next",this.getItemIcon(Te,"next page")))),qe=f.a.createElement(i,{locale:te,last:!0,rootPrefixCls:O,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ze,page:ze,active:!1,showTitle:V,itemRender:ne}),Ie=f.a.createElement(i,{locale:te,rootPrefixCls:O,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:V,itemRender:ne});var Ze=Math.max(1,Ge-U),ht=Math.min(Ge+U,ze);Ge-1<=U&&(ht=1+U*2),ze-Ge<=U&&(Ze=ze-U*2);for(var Qe=Ze;Qe<=ht;Qe+=1){var Xe=Ge===Qe;de.push(f.a.createElement(i,{locale:te,rootPrefixCls:O,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Qe,page:Qe,active:Xe,showTitle:V,itemRender:ne}))}Ge-1>=U*2&&Ge!==1+2&&(de[0]=Object(w.cloneElement)(de[0],{className:"".concat(O,"-item-after-jump-prev")}),de.unshift(le)),ze-Ge>=U*2&&Ge!==ze-2&&(de[de.length-1]=Object(w.cloneElement)(de[de.length-1],{className:"".concat(O,"-item-before-jump-next")}),de.push(Oe)),Ze!==1&&de.unshift(Ie),ht!==ze&&de.push(qe)}var Ke=null;re&&(Ke=f.a.createElement("li",{className:"".concat(O,"-total-text")},re(K,[K===0?0:(Ge-1)*je+1,Ge*je>K?K:Ge*je])));var Fe=!this.hasPrev()||!ze,Ue=!this.hasNext()||!ze;return f.a.createElement("ul",Object(ue.a)({className:u()(O,A,Object(Q.a)({},"".concat(O,"-disabled"),I)),style:P,unselectable:"unselectable",ref:this.savePaginationNode},J),Ke,f.a.createElement("li",{title:V?te.prev_page:null,onClick:this.prev,tabIndex:Fe?null:0,onKeyPress:this.runIfEnterPrev,className:u()("".concat(O,"-prev"),Object(Q.a)({},"".concat(O,"-disabled"),Fe)),"aria-disabled":Fe},this.renderPrev(q)),de,f.a.createElement("li",{title:V?te.next_page:null,onClick:this.next,tabIndex:Ue?null:0,onKeyPress:this.runIfEnterNext,className:u()("".concat(O,"-next"),Object(Q.a)({},"".concat(O,"-disabled"),Ue)),"aria-disabled":Ue},this.renderNext(Y)),f.a.createElement(h,{disabled:I,locale:te,rootPrefixCls:O,selectComponentClass:we,selectPrefixCls:Me,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ge,pageSize:je,pageSizeOptions:Ee,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:k}))}}],[{key:"getDerivedStateFromProps",value:function(d,_){var O={};if("current"in d&&(O.current=d.current,d.current!==_.current&&(O.currentInputValue=O.current)),"pageSize"in d&&d.pageSize!==_.pageSize){var A=_.current,P=m(d.pageSize,_,d);A=A>P?P:A,"current"in d||(O.current=A,O.currentInputValue=A),O.pageSize=d.pageSize}return O}}]),y}(f.a.Component);v.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:t,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:t,locale:r.a,style:{},itemRender:c,totalBoundaryShowSizeChanger:50};var b=v},"6RRn":function(nt,Le,F){"use strict";var ue=F("wCXF"),Q=F("n6Qo");F.d(Le,"b",function(){return Q.a});var j=F("IBYe"),S=F("6eGT"),D=F("hW8S");F.d(Le,"a",function(){return D.a}),Le.c=ue.b},"6eGT":function(nt,Le,F){"use strict";function ue(Q){return null}Le.a=ue},"7+5b":function(nt,Le,F){nt.exports=F.p+"static/v.e7f297d6.svg"},"746U":function(nt,Le,F){"use strict";F.d(Le,"d",function(){return Q}),F.d(Le,"j",function(){return j}),F.d(Le,"i",function(){return S}),F.d(Le,"h",function(){return D}),F.d(Le,"e",function(){return x}),F.d(Le,"k",function(){return T}),F.d(Le,"l",function(){return w}),F.d(Le,"a",function(){return f}),F.d(Le,"f",function(){return u}),F.d(Le,"g",function(){return o}),F.d(Le,"m",function(){return i}),F.d(Le,"c",function(){return h}),F.d(Le,"b",function(){return r}),F.d(Le,"n",function(){return t}),F.d(Le,"o",function(){return n});var ue={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function Q(c){return Array.isArray?Array.isArray(c):!!(c&&typeof c.length===ue.number&&c.constructor===Array)}function j(c){return typeof c===ue.string||c instanceof String}function S(c){return typeof c===ue.object&&c!==null&&!Array.isArray(c)&&!(c instanceof RegExp)&&!(c instanceof Date)}function D(c){return(typeof c===ue.number||c instanceof Number)&&!isNaN(c)}function x(c){return c===!0||c===!1}function T(c){return typeof c===ue.undefined}function w(c){return T(c)||c===null}function f(c,m){if(!c)throw new Error(m?"Unexpected type, expected '"+m+"'":"Unexpected type")}var p=Object.prototype.hasOwnProperty;function u(c){if(!S(c))return!1;for(var m in c)if(p.call(c,m))return!1;return!0}function o(c){return typeof c===ue.function}function i(c,m){for(var v=Math.min(c.length,m.length),b=0;b<v;b++)l(c[b],m[b])}function l(c,m){if(j(m)){if(typeof c!==m)throw new Error("argument does not match constraint: typeof "+m)}else if(o(m)){try{if(c instanceof m)return}catch(v){}if(!w(c)&&c.constructor===m)return;if(m.length===1&&m.call(void 0,c)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function s(c){for(var m=[],v=Object.getPrototypeOf(c);Object.prototype!==v;)m=m.concat(Object.getOwnPropertyNames(v)),v=Object.getPrototypeOf(v);return m}function h(c){for(var m=[],v=0,b=s(c);v<b.length;v++){var E=b[v];typeof c[E]=="function"&&m.push(E)}return m}function r(c,m){for(var v=function(C){return function(){var d=Array.prototype.slice.call(arguments,0);return m(C,d)}},b={},E=0,g=c;E<g.length;E++){var y=g[E];b[y]=v(y)}return b}function t(c){return c===null?void 0:c}function n(c){return typeof c=="undefined"?null:c}},"7Cbv":function(nt,Le,F){"use strict";var ue=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Q=new Uint8Array(16);function j(){if(!ue)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ue(Q)}var S=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function D(i){return typeof i=="string"&&S.test(i)}for(var x=D,T=[],w=0;w<256;++w)T.push((w+256).toString(16).substr(1));function f(i){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(T[i[l+0]]+T[i[l+1]]+T[i[l+2]]+T[i[l+3]]+"-"+T[i[l+4]]+T[i[l+5]]+"-"+T[i[l+6]]+T[i[l+7]]+"-"+T[i[l+8]]+T[i[l+9]]+"-"+T[i[l+10]]+T[i[l+11]]+T[i[l+12]]+T[i[l+13]]+T[i[l+14]]+T[i[l+15]]).toLowerCase();if(!x(s))throw TypeError("Stringified UUID is invalid");return s}var p=f;function u(i,l,s){i=i||{};var h=i.random||(i.rng||j)();if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,l){s=s||0;for(var r=0;r<16;++r)l[s+r]=h[r];return l}return p(h)}var o=Le.a=u},"7ahc":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return m});var ue=F("k1fw"),Q=F("0Owb"),j=F("+L6B"),S=F("2/Rp"),D=F("y8nQ"),x=F("Vl3Y"),T=F("tJVT"),w=F("OaEy"),f=F("2fM7"),p=F("q1tI"),u=F.n(p),o=F("VrN/"),i=F.n(o),l=F("p77/"),s=F.n(l),h=F("c5Ni"),r=F.n(h),t=f.a.Option,n={labelCol:{span:4},wrapperCol:{span:20}},c={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Le.b=function(v){var b=v.callback,E=v.onCancel,g=Object(p.useState)("python"),y=Object(T.a)(g,2),C=y[0],d=y[1];function _(A){d(c[A][1])}function O(A){b(A)}return u.a.createElement(x.a,Object(Q.a)({},n,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:O}),u.a.createElement(x.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},u.a.createElement(f.a,{onChange:_},Object.keys(c).map(function(A){return u.a.createElement(t,{key:A,value:A},c[A][0])}))),u.a.createElement(x.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},u.a.createElement(m,{mode:C})),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(S.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),u.a.createElement(S.a,{type:"ghost",onClick:E},"\u53D6\u6D88")))};function m(v){var b=v.value,E=v.onChange,g=v.mode,y=v.options,C=y===void 0?{}:y,d=Object(p.useRef)(),_=Object(p.useState)(),O=Object(T.a)(_,2),A=O[0],P=O[1];return Object(p.useEffect)(function(){if(A){function I(W){var K=W.getValue();E&&E(K)}return A.on("change",I),function(){A.off("change",I)}}},[A,E]),Object(p.useEffect)(function(){A&&A.setOption("mode",g)},[A,g]),Object(p.useEffect)(function(){A&&((b!==A.getValue()||b==="")&&setTimeout(function(){A.setValue(b||" ")},300))},[A,b]),Object(p.useEffect)(function(){if(d.current&&!A){var I=i.a.fromTextArea(d.current,Object(ue.a)({mode:g,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},C));P(I)}},[d.current,A]),u.a.createElement("div",{className:"my-codemirror-container"},u.a.createElement("textarea",{ref:d}))}},"7ixt":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return j});var ue={adjustX:1,adjustY:1},Q=[0,0],j={left:{points:["cr","cl"],overflow:ue,offset:[-4,0],targetOffset:Q},right:{points:["cl","cr"],overflow:ue,offset:[4,0],targetOffset:Q},top:{points:["bc","tc"],overflow:ue,offset:[0,-4],targetOffset:Q},bottom:{points:["tc","bc"],overflow:ue,offset:[0,4],targetOffset:Q},topLeft:{points:["bl","tl"],overflow:ue,offset:[0,-4],targetOffset:Q},leftTop:{points:["tr","tl"],overflow:ue,offset:[-4,0],targetOffset:Q},topRight:{points:["br","tr"],overflow:ue,offset:[0,-4],targetOffset:Q},rightTop:{points:["tl","tr"],overflow:ue,offset:[4,0],targetOffset:Q},bottomRight:{points:["tr","br"],overflow:ue,offset:[0,4],targetOffset:Q},rightBottom:{points:["bl","br"],overflow:ue,offset:[4,0],targetOffset:Q},bottomLeft:{points:["tl","bl"],overflow:ue,offset:[0,4],targetOffset:Q},leftBottom:{points:["br","bl"],overflow:ue,offset:[-4,0],targetOffset:Q}},S=j},"7qur":function(nt,Le,F){"use strict";F.d(Le,"m",function(){return Q}),F.d(Le,"s",function(){return j}),F.d(Le,"h",function(){return S}),F.d(Le,"o",function(){return D}),F.d(Le,"n",function(){return x}),F.d(Le,"l",function(){return T}),F.d(Le,"b",function(){return w}),F.d(Le,"q",function(){return f}),F.d(Le,"t",function(){return p}),F.d(Le,"v",function(){return u}),F.d(Le,"w",function(){return o}),F.d(Le,"u",function(){return i}),F.d(Le,"p",function(){return l}),F.d(Le,"f",function(){return s}),F.d(Le,"a",function(){return h}),F.d(Le,"j",function(){return r}),F.d(Le,"k",function(){return t}),F.d(Le,"d",function(){return n}),F.d(Le,"g",function(){return c}),F.d(Le,"c",function(){return m}),F.d(Le,"e",function(){return v}),F.d(Le,"i",function(){return b}),F.d(Le,"r",function(){return E});var ue=F("ErOA");function Q(g){return Object(ue.c)("mypractices/".concat(g,".json"),{hidePopLogin:!0})}function j(g,y){return Object(ue.f)("mypractices/".concat(g,"/code_submit.json"),y)}function S(g,y){return Object(ue.c)("mypractices/".concat(g,"/code_debug.json"),y)}function D(g,y){return Object(ue.c)("mypractices/".concat(g,"/submit_records.json"),y)}function x(g){return Object(ue.c)("mypractices/record_detail.json",{id:g})}function T(g,y){return Object(ue.c)("mypractices/".concat(g,"/result.json"),{mode:y})}function w(g,y){return Object(ue.f)("mypractices/".concat(g,"/add_notes.json"),y)}function f(g,y){return Object(ue.f)("mypractices/".concat(g,"/restore_initial_code.json"),y)}function p(g,y){return Object(ue.f)("mypractices/".concat(g,"/sync_code.json"),y)}function u(g,y){return Object(ue.f)("mypractices/".concat(g,"/update_code.json"),y)}function o(g){return Object(ue.f)("mypractices/".concat(g,"/initial_codes.json"))}function i(g,y){return Object(ue.f)("discusses/".concat(g,"/plus.json"),y)}function l(g){return Object(ue.c)("practices/practices_list.json",g)}function s(g,y){return Object(ue.c)("practices/".concat(g,"/question_solution_articles"),y)}function h(g,y){return Object(ue.f)("practices/".concat(g,"/question_solution_articles"),y)}function r(g,y){return Object(ue.g)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function t(g,y){return Object(ue.c)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/edit"),y)}function n(g,y){return Object(ue.c)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function c(g,y){return Object(ue.f)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/set_authority_or_excellent"),y)}function m(g,y){return Object(ue.f)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/praise_or_treads"),y)}function v(g,y){return Object(ue.f)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/hide"))}function b(g,y){return Object(ue.b)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function E(g,y){return Object(ue.f)("mypractices/".concat(g,"/update_practice_time_sum"),y)}},"815F":function(nt,Le,F){"use strict";F.d(Le,"e",function(){return T}),F.d(Le,"c",function(){return f}),F.d(Le,"d",function(){return p}),F.d(Le,"a",function(){return o}),F.d(Le,"f",function(){return i}),F.d(Le,"b",function(){return l});var ue=F("KQm4"),Q=F("VTBJ"),j=F("Ff2n"),S=F("Zm9Q"),D=F("Kwbf"),x=F("OZM5");function T(s,h){return s!=null?s:h}function w(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=new Map;function r(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(t||[]).forEach(function(c){var m=c.key,v=c.children;Object(D.a)(m!=null,"Tree node must have a certain key: [".concat(n).concat(m,"]"));var b=String(m);Object(D.a)(!h.has(b)||m===null||m===void 0,"Same 'key' exist in the Tree: ".concat(b)),h.set(b,!0),r(v,"".concat(n).concat(b," > "))})}r(s)}function f(s){function h(r){var t=Object(S.a)(r);return t.map(function(n){if(!Object(x.i)(n))return Object(D.a)(!n,"Tree/TreeNode can only accept TreeNode as children."),null;var c=n.key,m=n.props,v=m.children,b=Object(j.a)(m,["children"]),E=Object(Q.a)({key:c},b),g=h(v);return g.length&&(E.children=g),E}).filter(function(n){return n})}return h(s)}function p(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=new Set(h===!0?[]:h),t=[];function n(c){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return c.map(function(v,b){var E=Object(x.h)(m?m.pos:"0",b),g=T(v.key,E),y=Object(Q.a)(Object(Q.a)({},v),{},{parent:m,pos:E,children:null,data:v,isStart:[].concat(Object(ue.a)(m?m.isStart:[]),[b===0]),isEnd:[].concat(Object(ue.a)(m?m.isEnd:[]),[b===c.length-1])});return t.push(y),h===!0||r.has(g)?y.children=n(v.children||[],y):y.children=[],y})}return n(s),t}function u(s,h,r){var t;r?typeof r=="string"?t=function(m){return m[r]}:typeof r=="function"&&(t=function(m){return r(m)}):t=function(m,v){return T(m.key,v)};function n(c,m,v){var b=c?c.children:s,E=c?Object(x.h)(v.pos,m):"0";if(c){var g=t(c,E),y={node:c,index:m,pos:E,key:g,parentPos:v.node?v.pos:null,level:v.level+1};h(y)}b&&b.forEach(function(C,d){n(C,d,{node:c,pos:E,level:v?v.level+1:-1})})}n(null)}function o(s){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=h.initWrapper,t=h.processEntity,n=h.onProcessFinished,c=arguments.length>2?arguments[2]:void 0,m={},v={},b={posEntities:m,keyEntities:v};return r&&(b=r(b)||b),u(s,function(E){var g=E.node,y=E.index,C=E.pos,d=E.key,_=E.parentPos,O=E.level,A={node:g,index:y,key:d,pos:C,level:O},P=T(d,C);m[C]=A,v[P]=A,A.parent=m[_],A.parent&&(A.parent.children=A.parent.children||[],A.parent.children.push(A)),t&&t(A,b)},c),n&&n(b),b}function i(s,h){var r=h.expandedKeys,t=h.selectedKeys,n=h.loadedKeys,c=h.loadingKeys,m=h.checkedKeys,v=h.halfCheckedKeys,b=h.dragOverNodeKey,E=h.dropPosition,g=h.keyEntities,y=g[s],C={eventKey:s,expanded:r.indexOf(s)!==-1,selected:t.indexOf(s)!==-1,loaded:n.indexOf(s)!==-1,loading:c.indexOf(s)!==-1,checked:m.indexOf(s)!==-1,halfChecked:v.indexOf(s)!==-1,pos:String(y?y.pos:""),dragOver:b===s&&E===0,dragOverGapTop:b===s&&E===-1,dragOverGapBottom:b===s&&E===1};return C}function l(s){var h=s.data,r=s.expanded,t=s.selected,n=s.checked,c=s.loaded,m=s.loading,v=s.halfChecked,b=s.dragOver,E=s.dragOverGapTop,g=s.dragOverGapBottom,y=s.pos,C=s.active,d=Object(Q.a)(Object(Q.a)({},h),{},{expanded:r,selected:t,checked:n,loaded:c,loading:m,halfChecked:v,dragOver:b,dragOverGapTop:E,dragOverGapBottom:g,pos:y,active:C});return"props"in d||Object.defineProperty(d,"props",{get:function(){return Object(D.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),d}},"8EBN":function(nt,Le,F){(function(ue){ue(F("VrN/"))})(function(ue){"use strict";ue.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Q=0;Q<ue.modeInfo.length;Q++){var j=ue.modeInfo[Q];j.mimes&&(j.mime=j.mimes[0])}ue.findModeByMIME=function(S){S=S.toLowerCase();for(var D=0;D<ue.modeInfo.length;D++){var x=ue.modeInfo[D];if(x.mime==S)return x;if(x.mimes){for(var T=0;T<x.mimes.length;T++)if(x.mimes[T]==S)return x}}if(/\+xml$/.test(S))return ue.findModeByMIME("application/xml");if(/\+json$/.test(S))return ue.findModeByMIME("application/json")},ue.findModeByExtension=function(S){S=S.toLowerCase();for(var D=0;D<ue.modeInfo.length;D++){var x=ue.modeInfo[D];if(x.ext){for(var T=0;T<x.ext.length;T++)if(x.ext[T]==S)return x}}},ue.findModeByFileName=function(S){for(var D=0;D<ue.modeInfo.length;D++){var x=ue.modeInfo[D];if(x.file&&x.file.test(S))return x}var T=S.lastIndexOf("."),w=T>-1&&S.substring(T+1,S.length);if(w)return ue.findModeByExtension(w)},ue.findModeByName=function(S){S=S.toLowerCase();for(var D=0;D<ue.modeInfo.length;D++){var x=ue.modeInfo[D];if(x.name.toLowerCase()==S)return x;if(x.alias){for(var T=0;T<x.alias.length;T++)if(x.alias[T].toLowerCase()==S)return x}}}})},"8HAY":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return x}),F.d(Le,"b",function(){return T});var ue=F("pmY6"),Q=F("MI8n"),j=function(){var w=function(f,p){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,o){u.__proto__=o}||function(u,o){for(var i in o)o.hasOwnProperty(i)&&(u[i]=o[i])},w(f,p)};return function(f,p){w(f,p);function u(){this.constructor=f}f.prototype=p===null?Object.create(p):(u.prototype=p.prototype,new u)}}(),S=function(w,f,p,u){function o(i){return i instanceof p?i:new p(function(l){l(i)})}return new(p||(p=Promise))(function(i,l){function s(t){try{r(u.next(t))}catch(n){l(n)}}function h(t){try{r(u.throw(t))}catch(n){l(n)}}function r(t){t.done?i(t.value):o(t.value).then(s,h)}r((u=u.apply(w,f||[])).next())})},D=function(w,f){var p={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},u,o,i,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(r){return function(t){return h([r,t])}}function h(r){if(u)throw new TypeError("Generator is already executing.");for(;p;)try{if(u=1,o&&(i=r[0]&2?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;(o=0,i)&&(r=[r[0]&2,i.value]);switch(r[0]){case 0:case 1:i=r;break;case 4:return p.label++,{value:r[1],done:!1};case 5:p.label++,o=r[1],r=[0];continue;case 7:r=p.ops.pop(),p.trys.pop();continue;default:if(!(i=p.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){p=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){p.label=r[1];break}if(r[0]===6&&p.label<i[1]){p.label=i[1],i=r;break}if(i&&p.label<i[2]){p.label=i[2],p.ops.push(r);break}i[2]&&p.ops.pop(),p.trys.pop();continue}r=f.call(w,p)}catch(t){r=[6,t],o=0}finally{u=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}},x=function(w){j(f,w);function f(p,u,o,i,l){u===void 0&&(u=""),o===void 0&&(o=""),i===void 0&&(i=!0);var s=w.call(this)||this;return s._onDidChange=s._register(new Q.a),s.onDidChange=s._onDidChange.event,s._enabled=!0,s._checked=!1,s._id=p,s._label=u,s._cssClass=o,s._enabled=i,s._actionCallback=l,s}return Object.defineProperty(f.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"label",{get:function(){return this._label},set:function(p){this._setLabel(p)},enumerable:!0,configurable:!0}),f.prototype._setLabel=function(p){this._label!==p&&(this._label=p,this._onDidChange.fire({label:p}))},Object.defineProperty(f.prototype,"tooltip",{get:function(){return this._tooltip||""},set:function(p){this._setTooltip(p)},enumerable:!0,configurable:!0}),f.prototype._setTooltip=function(p){this._tooltip!==p&&(this._tooltip=p,this._onDidChange.fire({tooltip:p}))},Object.defineProperty(f.prototype,"class",{get:function(){return this._cssClass},set:function(p){this._setClass(p)},enumerable:!0,configurable:!0}),f.prototype._setClass=function(p){this._cssClass!==p&&(this._cssClass=p,this._onDidChange.fire({class:p}))},Object.defineProperty(f.prototype,"enabled",{get:function(){return this._enabled},set:function(p){this._setEnabled(p)},enumerable:!0,configurable:!0}),f.prototype._setEnabled=function(p){this._enabled!==p&&(this._enabled=p,this._onDidChange.fire({enabled:p}))},Object.defineProperty(f.prototype,"checked",{get:function(){return this._checked},set:function(p){this._setChecked(p)},enumerable:!0,configurable:!0}),f.prototype._setChecked=function(p){this._checked!==p&&(this._checked=p,this._onDidChange.fire({checked:p}))},f.prototype.run=function(p,u){return this._actionCallback?this._actionCallback(p):Promise.resolve(!0)},f}(ue.a),T=function(w){j(f,w);function f(){var p=w!==null&&w.apply(this,arguments)||this;return p._onDidBeforeRun=p._register(new Q.a),p.onDidBeforeRun=p._onDidBeforeRun.event,p._onDidRun=p._register(new Q.a),p.onDidRun=p._onDidRun.event,p}return f.prototype.run=function(p,u){return S(this,void 0,void 0,function(){var o,i;return D(this,function(l){switch(l.label){case 0:if(!p.enabled)return[2,Promise.resolve(null)];this._onDidBeforeRun.fire({action:p}),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.runAction(p,u)];case 2:return o=l.sent(),this._onDidRun.fire({action:p,result:o}),[3,4];case 3:return i=l.sent(),this._onDidRun.fire({action:p,error:i}),[3,4];case 4:return[2]}})})},f.prototype.runAction=function(p,u){var o=u?p.run(u):p.run();return Promise.resolve(o)},f}(ue.a)},"8hTe":function(nt,Le,F){nt.exports={button:"button___1wy9m"}},"9Bee":function(nt,Le,F){"use strict";var ue=F("DYRE"),Q=F("zeV3"),j=F("+L6B"),S=F("2/Rp"),D=F("k1fw"),x=F("9og8"),T=F("tJVT"),w=F("WmNS"),f=F.n(w),p=F("q1tI"),u=F.n(p),o=F("vg9a"),i=F("DlQD"),l=F.n(i),s=F("rUJ1");function h(ie,N){var B=ie.match(/^(\s+)(?:```)/);if(B===null)return N;var ae=B[1];return N.split(`
|
|
|
`).map(function(fe){var se=fe.match(/^\s+/);if(se===null)return fe;var $e=Object(T.a)(se,1),St=$e[0];return St.length>=ae.length?fe.slice(ae.length):fe}).join(`
|
|
|
`)}var r=[],t=["<ul>"],n=new l.a.Renderer,c=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function m(){r.length=0,t=["<ul>"]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function b(ie,N,B,ae){if(N>=ie.length||ie[N].level<=B)return N;var fe=ie[N];ae.push("<li><a href='#"+fe.anchor+"'>"+fe.text+"</a>"),N++;var se=[];return N=b(ie,N,fe.level,se),se.length>0&&(ae.push("<ul>"),se.forEach(function($e){ae.push($e)}),ae.push("</ul>")),ae.push("</li>"),N=b(ie,N,B,ae),N}function E(){return b(r,0,0,t),t.push("</ul>"),t.join("")}var g={heading:function(N){var B=c.exec(N);if(B)return{type:"heading",raw:B[0],depth:B[1].length,text:B[2]}},fences:function(N){var B=this.rules.block.fences.exec(N);if(B){var ae=B[0],fe=h(ae,B[3]||""),se=B[2]?B[2].trim():B[2];if(["latex","katex","math"].indexOf(se)>=0){var $e=d(),St=fe;fe=$e,_[$e]={type:"block",expression:St}}return{type:"code",raw:ae,lang:se,text:fe}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,C=0,d=function(){return"__special_katext_id_".concat(C++,"__")},_={};function O(){return _}function A(){C=0,_={}}function P(ie){return ie=ie.replace(y,function(N,B){var ae=d();return _[ae]={type:"inline",expression:B},ae}),ie}var I=n.listitem;n.listitem=function(ie){return I(P(ie))};var W=n.paragraph;n.paragraph=function(ie){return W(P(ie))};var K=n.tablecell;n.tablecell=function(ie,N){return K(P(ie),N)},n.code=function(ie,N,B){var ae=(N||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?"<p class='editormd-tex'>".concat(ie,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(N,'">').concat(B?ie:Object(s.escape)(ie,!0),`</code></pre>
|
|
|
`):'<pre class="prettyprint linenums"><code>'+(B?ie:Object(s.escape)(ie,!0))+"</code></pre>"},n.heading=function(ie,N,B){var ae=this.options.headerPrefix+B.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return r.push({anchor:ae,level:N,text:ie}),"<h"+N+' id="'+ae+'">'+ie+"</h"+N+">"},l.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),l.a.use({tokenizer:g,renderer:n});var te=l.a,H=F("SJMd"),G=F("ulZh"),V=F.n(G),re=F("m3rI"),$=F("Oy/b"),ne=F("p5ED"),he=F("ErOA");/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */var pe=function(ie,N){return(pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,ae){B.__proto__=ae}||function(B,ae){for(var fe in ae)Object.prototype.hasOwnProperty.call(ae,fe)&&(B[fe]=ae[fe])})(ie,N)};function Te(ie,N){function B(){this.constructor=ie}pe(ie,N),ie.prototype=N===null?Object.create(N):(B.prototype=N.prototype,new B)}function we(ie,N,B,ae){return new(B||(B=Promise))(function(fe,se){function $e($t){try{Pt(ae.next($t))}catch(Ot){se(Ot)}}function St($t){try{Pt(ae.throw($t))}catch(Ot){se(Ot)}}function Pt($t){var Ot;$t.done?fe($t.value):(Ot=$t.value,Ot instanceof B?Ot:new B(function(zt){zt(Ot)})).then($e,St)}Pt((ae=ae.apply(ie,N||[])).next())})}function Me(ie,N){var B,ae,fe,se,$e={label:0,sent:function(){if(1&fe[0])throw fe[1];return fe[1]},trys:[],ops:[]};return se={next:St(0),throw:St(1),return:St(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function St(Pt){return function($t){return function(Ot){if(B)throw new TypeError("Generator is already executing.");for(;$e;)try{if(B=1,ae&&(fe=2&Ot[0]?ae.return:Ot[0]?ae.throw||((fe=ae.return)&&fe.call(ae),0):ae.next)&&!(fe=fe.call(ae,Ot[1])).done)return fe;switch(ae=0,fe&&(Ot=[2&Ot[0],fe.value]),Ot[0]){case 0:case 1:fe=Ot;break;case 4:return $e.label++,{value:Ot[1],done:!1};case 5:$e.label++,ae=Ot[1],Ot=[0];continue;case 7:Ot=$e.ops.pop(),$e.trys.pop();continue;default:if(!(fe=$e.trys,(fe=fe.length>0&&fe[fe.length-1])||Ot[0]!==6&&Ot[0]!==2)){$e=0;continue}if(Ot[0]===3&&(!fe||Ot[1]>fe[0]&&Ot[1]<fe[3])){$e.label=Ot[1];break}if(Ot[0]===6&&$e.label<fe[1]){$e.label=fe[1],fe=Ot;break}if(fe&&$e.label<fe[2]){$e.label=fe[2],$e.ops.push(Ot);break}fe[2]&&$e.ops.pop(),$e.trys.pop();continue}Ot=N.call(ie,$e)}catch(zt){Ot=[6,zt],ae=0}finally{B=fe=0}if(5&Ot[0])throw Ot[1];return{value:Ot[0]?Ot[1]:void 0,done:!0}}([Pt,$t])}}}function Ee(){for(var ie=0,N=0,B=arguments.length;N<B;N++)ie+=arguments[N].length;var ae=Array(ie),fe=0;for(N=0;N<B;N++)for(var se=arguments[N],$e=0,St=se.length;$e<St;$e++,fe++)ae[fe]=se[$e];return ae}var xe=function(){function ie(){}return ie.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ie.setAttributes=function(N,B){for(var ae=0,fe=B;ae<fe.length;ae++){var se=fe[ae],$e=se[0],St=se[1];N.setAttribute($e,St)}},ie.createRect=function(N,B,ae){var fe=document.createElementNS("http://www.w3.org/2000/svg","rect");return fe.setAttribute("width",N.toString()),fe.setAttribute("height",B.toString()),ae&&ie.setAttributes(fe,ae),fe},ie.createLine=function(N,B,ae,fe,se){var $e=document.createElementNS("http://www.w3.org/2000/svg","line");return $e.setAttribute("x1",N.toString()),$e.setAttribute("y1",B.toString()),$e.setAttribute("x2",ae.toString()),$e.setAttribute("y2",fe.toString()),se&&ie.setAttributes($e,se),$e},ie.createPolygon=function(N,B){var ae=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ae.setAttribute("points",N),B&&ie.setAttributes(ae,B),ae},ie.createCircle=function(N,B){var ae=document.createElementNS("http://www.w3.org/2000/svg","circle");return ae.setAttribute("cx",(N/2).toString()),ae.setAttribute("cy",(N/2).toString()),ae.setAttribute("r",N.toString()),B&&ie.setAttributes(ae,B),ae},ie.createEllipse=function(N,B,ae){var fe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return fe.setAttribute("cx",(N/2).toString()),fe.setAttribute("cy",(B/2).toString()),fe.setAttribute("rx",(N/2).toString()),fe.setAttribute("ry",(B/2).toString()),ae&&ie.setAttributes(fe,ae),fe},ie.createGroup=function(N){var B=document.createElementNS("http://www.w3.org/2000/svg","g");return N&&ie.setAttributes(B,N),B},ie.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ie.createMarker=function(N,B,ae,fe,se,$e,St){var Pt=document.createElementNS("http://www.w3.org/2000/svg","marker");return ie.setAttributes(Pt,[["id",N],["orient",B],["markerWidth",ae.toString()],["markerHeight",fe.toString()],["refX",se.toString()],["refY",$e.toString()]]),Pt.appendChild(St),Pt},ie.createText=function(N){var B=document.createElementNS("http://www.w3.org/2000/svg","text");return B.setAttribute("x","0"),B.setAttribute("y","0"),N&&ie.setAttributes(B,N),B},ie.createTSpan=function(N,B){var ae=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ae.textContent=N,B&&ie.setAttributes(ae,B),ae},ie.createImage=function(N){var B=document.createElementNS("http://www.w3.org/2000/svg","image");return N&&ie.setAttributes(B,N),B},ie.createPoint=function(N,B){var ae=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ae.x=N,ae.y=B,ae},ie.createPath=function(N,B){var ae=document.createElementNS("http://www.w3.org/2000/svg","path");return ae.setAttribute("d",N),B&&ie.setAttributes(ae,B),ae},ie}(),Ge=function(){function ie(){}return ie.addKey=function(N){ie.key=N},Object.defineProperty(ie,"isLicensed",{get:function(){return!!ie.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ie.key)},enumerable:!1,configurable:!0}),ie}(),je=function(){function ie(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ie.prototype.rasterize=function(N,B,ae){var fe=this;return new Promise(function(se){var $e=ae!==void 0?ae:document.createElement("canvas");N===null&&(fe.markersOnly=!0,fe.naturalSize=!1);var St=document.createElementNS("http://www.w3.org/2000/svg","svg");St.setAttribute("xmlns","http://www.w3.org/2000/svg"),St.setAttribute("width",B.width.baseVal.valueAsString),St.setAttribute("height",B.height.baseVal.valueAsString),St.setAttribute("viewBox","0 0 "+B.viewBox.baseVal.width.toString()+" "+B.viewBox.baseVal.height.toString()),St.innerHTML=B.innerHTML,fe.naturalSize===!0?(St.width.baseVal.value=N.naturalWidth,St.height.baseVal.value=N.naturalHeight):fe.width!==void 0&&fe.height!==void 0&&(St.width.baseVal.value=fe.width,St.height.baseVal.value=fe.height),$e.width=St.width.baseVal.value,$e.height=St.height.baseVal.value;var Pt=St.outerHTML,$t=$e.getContext("2d");fe.markersOnly!==!0&&$t.drawImage(N,0,0,$e.width,$e.height);var Ot=window.URL,zt=new Image($e.width,$e.height);zt.setAttribute("crossOrigin","anonymous");var an=new Blob([Pt],{type:"image/svg+xml"}),jn=Ot.createObjectURL(an);zt.onload=function(){$t.drawImage(zt,0,0),Ot.revokeObjectURL(jn);var Dr=$e.toDataURL(fe.imageType,fe.imageQuality);se(Dr)},zt.src=jn})},ie}(),We=function(){},ze=function(){function ie(N){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+N+"_"}return Object.defineProperty(ie.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ie.prototype.addClass=function(N){return this.styleSheet===void 0&&this.addStyleSheet(),N.name=""+this.classNamePrefix+N.localName,this.classes.push(N),this.styleSheet.sheet.insertRule("."+N.name+" {"+N.style+"}",this.styleSheet.sheet.cssRules.length),N},ie.prototype.addRule=function(N){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(N),this.styleSheet.sheet.insertRule(N.selector+" {"+N.style+"}",this.styleSheet.sheet.cssRules.length)},ie.prototype.addStyleSheet=function(){var N;this.styleSheet=document.createElement("style"),((N=this.styleSheetRoot)!==null&&N!==void 0?N:document.head).appendChild(this.styleSheet),this.addRule(new de("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new de("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new de("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new le("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new le("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},ie.prototype.removeStyleSheet=function(){var N;this.styleSheet&&(((N=this.styleSheetRoot)!==null&&N!==void 0?N:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ie}(),de=function(ie,N){this.selector=ie,this.style=N},le=function(ie,N){this.localName=ie,this.style=N},Oe=function(){function ie(N,B,ae,fe,se){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=N,this.displayMode=B,this.markerItems=ae,this.uiStyleSettings=fe,this.styles=se,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ie.prototype.show=function(N){var B=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=N,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var ae=document.createElement("div");ae.className=this.toolbarBlockStyleClass.name,ae.style.whiteSpace="nowrap",this.uiContainer.appendChild(ae),this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(ae,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(se){var $e=document.createElement("div");$e.className=""+B.toolbarButtonStyleClass.name,$e.setAttribute("data-type-name",se.typeName),$e.innerHTML=se.icon,$e.addEventListener("click",function(){B.markerToolbarButtonClicked($e,se)}),B.buttons.push($e),B.markerButtons.push($e)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var fe=document.createElement("div");fe.className=this.toolbarBlockStyleClass.name,fe.style.whiteSpace="nowrap",fe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(fe),this.addActionButton(fe,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(fe,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},ie.prototype.addButtonClickListener=function(N){this.buttonClickListeners.push(N)},ie.prototype.removeButtonClickListener=function(N){this.buttonClickListeners.indexOf(N)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(N),1)},ie.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ie.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var N=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var B=0;B<this.markerButtons.length;B++)B<N||B===N&&this.markerButtons.length-1===N?this.markerButtonBlock.appendChild(this.markerButtons[B]):(B===N&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[B]))}},ie.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},ie.prototype.resetButtonStyles=function(){var N=this;this.buttons.forEach(function(B){B.className=B.className.replace(N.uiStyleSettings.toolbarButtonStyleColorsClassName?N.uiStyleSettings.toolbarButtonStyleColorsClassName:N.toolbarButtonStyleColorsClass.name,"").trim(),B.className=B.className.replace(N.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?N.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:N.toolbarActiveButtonStyleColorsClass.name,"").trim(),B.className+=" "+(N.uiStyleSettings.toolbarButtonStyleColorsClassName?N.uiStyleSettings.toolbarButtonStyleColorsClassName:N.toolbarButtonStyleColorsClass.name)})},ie.prototype.addActionButton=function(N,B,ae){var fe=this,se=document.createElement("div");switch(se.className=""+this.toolbarButtonStyleClass.name,se.innerHTML=B,se.setAttribute("data-action",ae),se.addEventListener("click",function(){fe.actionToolbarButtonClicked(se,ae)}),ae){case"select":se.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":se.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":se.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":se.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":se.style.fill=this.uiStyleSettings.closeButtonColor}N.appendChild(se),this.buttons.push(se)},ie.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new le("toolbar",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new le("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new le("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new le("toolbar-overflow-block",`
|
|
|
position: absolute;
|
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
z-index: 10;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new le("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var N=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new le("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
|
|
|
padding: `+N+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new le("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new le("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new de("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new de("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},ie.prototype.markerToolbarButtonClicked=function(N,B){this.setActiveButton(N),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ae){return ae("marker",B)}),this.markerButtonOverflowBlock.style.display="none"},ie.prototype.actionToolbarButtonClicked=function(N,B){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ae){return ae("action",B)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ie.prototype.setActiveButton=function(N){this.resetButtonStyles(),N.className=N.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),N.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ie.prototype.setActiveMarkerButton=function(N){var B=this.markerButtons.find(function(ae){return ae.getAttribute("data-type-name")===N});B&&this.setActiveButton(B)},ie.prototype.setCurrentMarker=function(N){var B=this;this.currentMarker=N,this.buttons.filter(function(ae){return/delete|notes/.test(ae.getAttribute("data-action"))}).forEach(function(ae){B.currentMarker===void 0?(ae.style.fillOpacity="0.4",ae.style.pointerEvents="none"):(ae.style.fillOpacity="1",ae.style.pointerEvents="all")})},ie}(),Ie=function(){function ie(N,B,ae,fe){this.panels=[],this.panelButtons=[],this.markerjsContainer=N,this.displayMode=B,this.uiStyleSettings=ae,this.styles=fe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ie.prototype.addStyles=function(){var N;this.toolboxStyleClass=this.styles.addClass(new le("toolbox",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
font-family: sans-serif;
|
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new le("toolbox_colors",`
|
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
|
`));var B=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new le("toolbox-button-row",`
|
|
|
display: flex;
|
|
|
cursor: default;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new le("toolbox-button-row_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new le("toolbox-panel-row",`
|
|
|
display: flex;
|
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
cursor: default;
|
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new le("toolbox-panel-row_colors",`
|
|
|
background-color: `+((N=this.uiStyleSettings.toolboxBackgroundColor)!==null&&N!==void 0?N:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new le("toolbox_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px;
|
|
|
padding: `+B+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new le("toolbox-button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new le("toolbox-active-button_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.styles.addRule(new de("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new de("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`))},ie.prototype.show=function(N){var B;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=N,this.uiContainer.className=this.toolboxStyleClass.name+" "+((B=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&B!==void 0?B:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ie.prototype.setPanelButtons=function(N){var B,ae,fe=this;this.panels=N,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((B=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&B!==void 0?B:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ae=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ae!==void 0?ae:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(se){var $e;se.uiStyleSettings=fe.uiStyleSettings;var St=document.createElement("div");St.className=fe.toolboxButtonStyleClass.name+" "+(($e=fe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$e!==void 0?$e:fe.toolboxButtonStyleColorsClass.name),St.innerHTML=se.icon,St.title=se.title,St.addEventListener("click",function(){fe.panelButtonClick(se)}),fe.panelButtons.push(St),fe.buttonRow.appendChild(St)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ie.prototype.panelButtonClick=function(N){var B=this,ae=-1;if(N!==this.activePanel){ae=this.panels.indexOf(N),this.panelRow.innerHTML="";var fe=N.getUi();fe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(fe),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=N}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){B.displayMode==="inline"?B.panelRow.style.display="none":B.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(se,$e){var St,Pt;se.className=B.toolboxButtonStyleClass.name+" "+($e===ae?""+((St=B.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&St!==void 0?St:B.toolboxActiveButtonStyleColorsClass.name):""+((Pt=B.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pt!==void 0?Pt:B.toolboxButtonStyleColorsClass.name))})},ie}(),qe=function(ie,N){this.title=ie,this.icon=N},ee=function(ie){function N(B,ae,fe,se){var $e=ie.call(this,B,se||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return $e.colors=[],$e.addTransparent=!1,$e.colorBoxes=[],$e.colors=ae,$e.currentColor=fe,$e.setCurrentColor=$e.setCurrentColor.bind($e),$e.getColorBox=$e.getColorBox.bind($e),$e}return Te(N,ie),N.prototype.getUi=function(){var B=this,ae=document.createElement("div");return ae.style.overflow="hidden",ae.style.whiteSpace="nowrap",this.colors.forEach(function(fe){var se=B.getColorBox(fe);ae.appendChild(se),B.colorBoxes.push(se)}),ae},N.prototype.getColorBox=function(B){var ae=this,fe=this.uiStyleSettings.toolbarHeight/4,se=this.uiStyleSettings.toolbarHeight-fe,$e=document.createElement("div");$e.style.display="inline-block",$e.style.boxSizing="content-box",$e.style.width=se-2+"px",$e.style.height=se-2+"px",$e.style.padding="1px",$e.style.marginRight="2px",$e.style.marginBottom="2px",$e.style.borderWidth="2px",$e.style.borderStyle="solid",$e.style.borderRadius=(se+2)/2+"px",$e.style.borderColor=B===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",$e.addEventListener("click",function(){ae.setCurrentColor(B,$e)});var St=document.createElement("div");return St.style.display="inline-block",St.style.width=se-2+"px",St.style.height=se-2+"px",St.style.backgroundColor=B,St.style.borderRadius=se/2+"px",B==="transparent"&&(St.style.fill=this.uiStyleSettings.toolboxAccentColor,St.innerHTML=`<svg viewBox="0 0 24 24">
|
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
|
</svg>`),$e.appendChild(St),$e},N.prototype.setCurrentColor=function(B,ae){var fe=this;this.currentColor=B,this.colorBoxes.forEach(function(se){se.style.borderColor=se===ae?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(B)},N}(qe),k=function(){function ie(N,B,ae){this._state="new",this._isSelected=!1,this._container=N,this._overlayContainer=B,this.globalSettings=ae,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ie.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ie.prototype.ownsTarget=function(N){return!1},Object.defineProperty(ie.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ie.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ie.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ie.prototype.pointerDown=function(N,B){},ie.prototype.dblClick=function(N,B){},ie.prototype.manipulate=function(N){},ie.prototype.pointerUp=function(N){this.stateChanged()},ie.prototype.dispose=function(){},ie.prototype.addMarkerVisualToContainer=function(N){this.container.childNodes.length>0?this.container.insertBefore(N,this.container.childNodes[0]):this.container.appendChild(N)},ie.prototype.getState=function(){return{typeName:ie.typeName,state:this.state,notes:this.notes}},ie.prototype.restoreState=function(N){this._state=N.state,this.notes=N.notes},ie.prototype.scale=function(N,B){},ie.prototype.colorChanged=function(N){this.onColorChanged&&this.onColorChanged(N),this.stateChanged()},ie.prototype.fillColorChanged=function(N){this.onFillColorChanged&&this.onFillColorChanged(N),this.stateChanged()},ie.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var N=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),N.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(N)&&this.onStateChanged(this)}},ie.typeName="MarkerBase",ie}(),U=function(){function ie(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ie.prototype.findGripByVisual=function(N){return this.topLeft.ownsTarget(N)?this.topLeft:this.topCenter.ownsTarget(N)?this.topCenter:this.topRight.ownsTarget(N)?this.topRight:this.centerLeft.ownsTarget(N)?this.centerLeft:this.centerRight.ownsTarget(N)?this.centerRight:this.bottomLeft.ownsTarget(N)?this.bottomLeft:this.bottomCenter.ownsTarget(N)?this.bottomCenter:this.bottomRight.ownsTarget(N)?this.bottomRight:void 0},ie}(),q=function(){function ie(){this.GRIP_SIZE=10,this.visual=xe.createGroup(),this.visual.appendChild(xe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(xe.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ie.prototype.ownsTarget=function(N){return N===this.visual||N===this.visual.childNodes[0]||N===this.visual.childNodes[1]},ie}(),Y=function(){function ie(){}return ie.toITransformMatrix=function(N){return{a:N.a,b:N.b,c:N.c,d:N.d,e:N.e,f:N.f}},ie.toSVGMatrix=function(N,B){return N.a=B.a,N.b=B.b,N.c=B.c,N.d=B.d,N.e=B.e,N.f=B.f,N},ie}(),J=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.left=0,se.top=0,se.width=0,se.height=0,se.defaultSize={x:50,y:20},se.offsetX=0,se.offsetY=0,se.rotationAngle=0,se.CB_DISTANCE=10,se._suppressMarkerCreateEvent=!1,se.container.transform.baseVal.appendItem(xe.createTransform()),se.setupControlBox(),se}return Te(N,ie),Object.defineProperty(N.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"visual",{get:function(){return this._visual},set:function(B){this._visual=B;var ae=xe.createTransform();this._visual.transform.baseVal.appendItem(ae)},enumerable:!1,configurable:!0}),N.prototype.ownsTarget=function(B){return!!ie.prototype.ownsTarget.call(this,B)||!!(this.controlGrips.findGripByVisual(B)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(B))},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.state==="new"&&(this.left=B.x,this.top=B.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var fe=this.unrotatePoint(B);if(this.manipulationStartX=fe.x,this.manipulationStartY=fe.y,this.offsetX=fe.x-this.left,this.offsetY=fe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ae),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ae)){this.activeGrip=this.rotatorGrip;var se=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=se.x-this.width/2,this.top=se.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var $e=this.container.transform.baseVal.getItem(0);$e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem($e,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},N.prototype.pointerUp=function(B){var ae=this.state;ie.prototype.pointerUp.call(this,B),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(B),this._state="select",ae==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},N.prototype.moveVisual=function(B){this.visual.style.transform="translate("+B.x+"px, "+B.y+"px)"},N.prototype.manipulate=function(B){var ae=this.unrotatePoint(B);this.state==="creating"?this.resize(B):this.state==="move"?(this.left=this.manipulationStartLeft+(ae.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ae.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ae):this.state==="rotate"&&this.rotate(B)},N.prototype.resize=function(B){var ae=this.manipulationStartLeft,fe=this.manipulationStartWidth,se=this.manipulationStartTop,$e=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ae=this.manipulationStartLeft+B.x-this.manipulationStartX,fe=this.manipulationStartWidth+this.manipulationStartLeft-ae;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:fe=this.manipulationStartWidth+B.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:se=this.manipulationStartTop+B.y-this.manipulationStartY,$e=this.manipulationStartHeight+this.manipulationStartTop-se;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:$e=this.manipulationStartHeight+B.y-this.manipulationStartY}fe>=0?(this.left=ae,this.width=fe):(this.left=ae+fe,this.width=-fe),$e>=0?(this.top=se,this.height=$e):(this.top=se+$e,this.height=-$e),this.setSize()},N.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},N.prototype.rotate=function(B){if(Math.abs(B.x-this.centerX)>.1){var ae=Math.sign(B.x-this.centerX);this.rotationAngle=180*Math.atan((B.y-this.centerY)/(B.x-this.centerX))/Math.PI+90*ae,this.applyRotation()}},N.prototype.applyRotation=function(){var B=this.container.transform.baseVal.getItem(0);B.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(B,0)},N.prototype.rotatePoint=function(B){if(this.rotationAngle===0)return B;var ae=this.container.getCTM(),fe=xe.createPoint(B.x,B.y);return{x:(fe=fe.matrixTransform(ae)).x,y:fe.y}},N.prototype.unrotatePoint=function(B){if(this.rotationAngle===0)return B;var ae=this.container.getCTM();ae=ae.inverse();var fe=xe.createPoint(B.x,B.y);return{x:(fe=fe.matrixTransform(ae)).x,y:fe.y}},N.prototype.select=function(){ie.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},N.prototype.deselect=function(){ie.prototype.deselect.call(this),this.controlBox.style.display="none"},N.prototype.setupControlBox=function(){this.controlBox=xe.createGroup();var B=xe.createTransform();B.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(B),this.container.appendChild(this.controlBox),this.controlRect=xe.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=xe.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new U,this.addControlGrips(),this.controlBox.style.display="none"},N.prototype.adjustControlBox=function(){var B=this.controlBox.transform.baseVal.getItem(0);B.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(B,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},N.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},N.prototype.createGrip=function(){var B=new q;return B.visual.transform.baseVal.appendItem(xe.createTransform()),this.controlBox.appendChild(B.visual),B},N.prototype.positionGrips=function(){var B=this.controlGrips.topLeft.GRIP_SIZE,ae=-B/2,fe=ae,se=(this.width+this.CB_DISTANCE)/2-B/2,$e=(this.height+this.CB_DISTANCE)/2-B/2,St=this.height+this.CB_DISTANCE-B/2,Pt=this.width+this.CB_DISTANCE-B/2;this.positionGrip(this.controlGrips.topLeft.visual,ae,fe),this.positionGrip(this.controlGrips.topCenter.visual,se,fe),this.positionGrip(this.controlGrips.topRight.visual,Pt,fe),this.positionGrip(this.controlGrips.centerLeft.visual,ae,$e),this.positionGrip(this.controlGrips.centerRight.visual,Pt,$e),this.positionGrip(this.controlGrips.bottomLeft.visual,ae,St),this.positionGrip(this.controlGrips.bottomCenter.visual,se,St),this.positionGrip(this.controlGrips.bottomRight.visual,Pt,St),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,se,fe-3*this.CB_DISTANCE)},N.prototype.positionGrip=function(B,ae,fe){var se=B.transform.baseVal.getItem(0);se.setTranslate(ae,fe),B.transform.baseVal.replaceItem(se,0)},N.prototype.hideControlBox=function(){this.controlBox.style.display="none"},N.prototype.showControlBox=function(){this.controlBox.style.display=""},N.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Y.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Y.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ie.prototype.getState.call(this))},N.prototype.restoreState=function(B){ie.prototype.restoreState.call(this,B);var ae=B;this.left=ae.left,this.top=ae.top,this.width=ae.width,this.height=ae.height,this.rotationAngle=ae.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Y.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ae.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Y.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ae.containerTransformMatrix))},N.prototype.scale=function(B,ae){ie.prototype.scale.call(this,B,ae);var fe=this.rotatePoint({x:this.left,y:this.top}),se=this.unrotatePoint({x:fe.x*B,y:fe.y*ae});this.left=se.x,this.top=se.y,this.width=this.width*B,this.height=this.height*ae,this.adjustControlBox()},N}(k),be=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.fillColor="transparent",se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.opacity=1,se.setStrokeColor=se.setStrokeColor.bind(se),se.setFillColor=se.setFillColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.createVisual=se.createVisual.bind(se),se}return Te(N,ie),N.prototype.ownsTarget=function(B){return!(!ie.prototype.ownsTarget.call(this,B)&&B!==this.visual)},N.prototype.createVisual=function(){this.visual=xe.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.state==="new"&&(this.createVisual(),this.moveVisual(B),this._state="creating")},N.prototype.manipulate=function(B){ie.prototype.manipulate.call(this,B)},N.prototype.resize=function(B){ie.prototype.resize.call(this,B),this.setSize()},N.prototype.setSize=function(){ie.prototype.setSize.call(this),xe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},N.prototype.pointerUp=function(B){ie.prototype.pointerUp.call(this,B),this.setSize()},N.prototype.setStrokeColor=function(B){this.strokeColor=B,this.visual&&xe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(B),this.stateChanged()},N.prototype.setFillColor=function(B){this.fillColor=B,this.visual&&xe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},N.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.visual&&xe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},N.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.visual&&xe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},N.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ie.prototype.getState.call(this))},N.prototype.restoreState=function(B){var ae=B;this.fillColor=ae.fillColor,this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.opacity=ae.opacity,this.createVisual(),ie.prototype.restoreState.call(this,B),this.setSize()},N.prototype.scale=function(B,ae){ie.prototype.scale.call(this,B,ae),this.setSize()},N.title="Rectangle marker",N}(J),ke=function(ie){function N(B,ae,fe,se){var $e=ie.call(this,B,se||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return $e.widths=[],$e.widthBoxes=[],$e.widths=ae,$e.currentWidth=fe,$e.setCurrentWidth=$e.setCurrentWidth.bind($e),$e}return Te(N,ie),N.prototype.getUi=function(){var B=this,ae=document.createElement("div");return ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2",this.widths.forEach(function(fe){var se=document.createElement("div");se.style.display="flex",se.style.flexGrow="2",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=fe===B.currentWidth?B.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){B.setCurrentWidth(fe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.innerText=fe.toString(),$e.style.marginRight="5px",se.appendChild($e);var St=document.createElement("div");St.style.minHeight="20px",St.style.flexGrow="2",St.style.display="flex",St.style.alignItems="center";var Pt=document.createElement("hr");Pt.style.minWidth="20px",Pt.style.border="0px",Pt.style.borderTop=fe+"px solid "+B.uiStyleSettings.toolboxColor,Pt.style.flexGrow="2",St.appendChild(Pt),se.appendChild(St),B.widthBoxes.push(se)}),ae},N.prototype.setCurrentWidth=function(B,ae){var fe=this;this.currentWidth=B,this.widthBoxes.forEach(function(se){se.style.borderColor=se===ae?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},N}(qe),ct=function(ie){function N(B,ae,fe,se){var $e=ie.call(this,B,se||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return $e.styles=[],$e.styleBoxes=[],$e.styles=ae,$e.currentStyle=fe,$e.setCurrentStyle=$e.setCurrentStyle.bind($e),$e}return Te(N,ie),N.prototype.getUi=function(){var B=this,ae=document.createElement("div");return ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2",this.styles.forEach(function(fe){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/B.styles.length-5+"%",se.style.borderColor=fe===B.currentStyle?B.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){B.setCurrentStyle(fe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.overflow="hidden";var St=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+B.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(fe!==""?'stroke-dasharray="'+fe+'"':"")+` />
|
|
|
</svg>`;$e.innerHTML=St,se.appendChild($e),B.styleBoxes.push(se)}),ae},N.prototype.setCurrentStyle=function(B,ae){var fe=this;this.currentStyle=B,this.styleBoxes.forEach(function(se){se.style.borderColor=se===ae?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},N}(qe),He=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.strokeColor=fe.defaultColor,se.strokeWidth=fe.defaultStrokeWidth,se.strokeDasharray=fe.defaultStrokeDasharray,se.strokePanel=new ee("Line color",fe.defaultColorSet,fe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new ct("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Te(N,ie),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ie.prototype.getState.call(this);return B.typeName=N.typeName,B},N.typeName="FrameMarker",N.title="Frame marker",N.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',N}(be),Be=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Ze=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.x1=0,se.y1=0,se.x2=0,se.y2=0,se.defaultLength=50,se.manipulationStartX=0,se.manipulationStartY=0,se.manipulationStartX1=0,se.manipulationStartY1=0,se.manipulationStartX2=0,se.manipulationStartY2=0,se.setupControlBox(),se}return Te(N,ie),N.prototype.ownsTarget=function(B){return!!ie.prototype.ownsTarget.call(this,B)||!(!this.grip1.ownsTarget(B)&&!this.grip2.ownsTarget(B))},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.manipulationStartX=B.x,this.manipulationStartY=B.y,this.state==="new"&&(this.x1=B.x,this.y1=B.y,this.x2=B.x,this.y2=B.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(ae)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ae)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},N.prototype.pointerUp=function(B){var ae=this.state;ie.prototype.pointerUp.call(this,B),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(B),this._state="select",ae==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},N.prototype.adjustVisual=function(){},N.prototype.manipulate=function(B){this.state==="creating"?this.resize(B):this.state==="move"?(this.x1=this.manipulationStartX1+B.x-this.manipulationStartX,this.y1=this.manipulationStartY1+B.y-this.manipulationStartY,this.x2=this.manipulationStartX2+B.x-this.manipulationStartX,this.y2=this.manipulationStartY2+B.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(B)},N.prototype.resize=function(B){switch(this.activeGrip){case this.grip1:this.x1=B.x,this.y1=B.y;break;case this.grip2:case void 0:this.x2=B.x,this.y2=B.y}this.adjustVisual(),this.adjustControlBox()},N.prototype.select=function(){ie.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},N.prototype.deselect=function(){ie.prototype.deselect.call(this),this.controlBox.style.display="none"},N.prototype.setupControlBox=function(){this.controlBox=xe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},N.prototype.adjustControlBox=function(){this.positionGrips()},N.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},N.prototype.createGrip=function(){var B=new q;return B.visual.transform.baseVal.appendItem(xe.createTransform()),this.controlBox.appendChild(B.visual),B},N.prototype.positionGrips=function(){var B=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-B/2,this.y1-B/2),this.positionGrip(this.grip2.visual,this.x2-B/2,this.y2-B/2)},N.prototype.positionGrip=function(B,ae,fe){var se=B.transform.baseVal.getItem(0);se.setTranslate(ae,fe),B.transform.baseVal.replaceItem(se,0)},N.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ie.prototype.getState.call(this))},N.prototype.restoreState=function(B){ie.prototype.restoreState.call(this,B);var ae=B;this.x1=ae.x1,this.y1=ae.y1,this.x2=ae.x2,this.y2=ae.y2},N.prototype.scale=function(B,ae){ie.prototype.scale.call(this,B,ae),this.x1=this.x1*B,this.y1=this.y1*ae,this.x2=this.x2*B,this.y2=this.y2*ae,this.adjustVisual(),this.adjustControlBox()},N}(k),ht=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.strokeColor=fe.defaultColor,se.strokeWidth=fe.defaultStrokeWidth,se.strokeDasharray=fe.defaultStrokeDasharray,se.strokePanel=new ee("Line color",fe.defaultColorSet,fe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new ct("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Te(N,ie),N.prototype.ownsTarget=function(B){return!(!ie.prototype.ownsTarget.call(this,B)&&B!==this.visual&&B!==this.selectorLine&&B!==this.visibleLine)},N.prototype.createVisual=function(){this.visual=xe.createGroup(),this.selectorLine=xe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=xe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},N.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),xe.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),xe.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),xe.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},N.prototype.setStrokeColor=function(B){this.strokeColor=B,this.adjustVisual(),this.colorChanged(B)},N.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.adjustVisual()},N.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.adjustVisual(),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ie.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){ie.prototype.restoreState.call(this,B);var ae=B;this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.createVisual(),this.adjustVisual()},N.typeName="LineMarker",N.title="Line marker",N.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',N}(Ze),Qe=function(ie){function N(B,ae,fe,se){var $e=ie.call(this,B,se||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return $e.fonts=[],$e.fontBoxes=[],$e.fonts=ae,$e.currentFont=fe,$e.setCurrentFont=$e.setCurrentFont.bind($e),$e}return Te(N,ie),N.prototype.getUi=function(){var B=this,ae=document.createElement("div");return ae.style.overflow="hidden",ae.style.flexGrow="2",this.fonts.forEach(function(fe){var se=document.createElement("div");se.style.display="inline-block",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/B.fonts.length-5+"%",se.style.borderColor=fe===B.currentFont?B.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){B.setCurrentFont(fe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.style.display="flex",$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.fontFamily=fe,$e.style.overflow="hidden";var St=document.createElement("div");St.style.whiteSpace="nowrap",St.style.overflow="hidden",St.style.textOverflow="ellipsis",St.innerHTML="The quick brown fox jumps over the lazy dog",$e.appendChild(St),se.appendChild($e),B.fontBoxes.push(se)}),ae},N.prototype.setCurrentFont=function(B,ae){var fe=this;this.currentFont=B,this.fontBoxes.forEach(function(se){se.style.borderColor=se===ae?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},N}(qe),Xe=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.color="transparent",se.padding=5,se.DEFAULT_TEXT="your text here",se.text=se.DEFAULT_TEXT,se.isMoved=!1,se.color=fe.defaultColor,se.fontFamily=fe.defaultFontFamily,se.defaultSize={x:100,y:30},se.setColor=se.setColor.bind(se),se.setFont=se.setFont.bind(se),se.renderText=se.renderText.bind(se),se.sizeText=se.sizeText.bind(se),se.textEditDivClicked=se.textEditDivClicked.bind(se),se.showTextEditor=se.showTextEditor.bind(se),se.setSize=se.setSize.bind(se),se.positionTextEditor=se.positionTextEditor.bind(se),se.colorPanel=new ee("Color",fe.defaultColorSet,fe.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.fontFamilyPanel=new Qe("Font",fe.defaultFontFamilies,fe.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se}return Te(N,ie),N.prototype.ownsTarget=function(B){if(ie.prototype.ownsTarget.call(this,B)||B===this.visual||B===this.textElement||B===this.bgRectangle)return!0;var ae=!1;return this.textElement.childNodes.forEach(function(fe){fe===B&&(ae=!0)}),ae},N.prototype.createVisual=function(){this.visual=xe.createGroup(),this.bgRectangle=xe.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=xe.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(xe.createTransform()),this.textElement.transform.baseVal.appendItem(xe.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.isMoved=!1,this.pointerDownPoint=B,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(B),this._state="creating")},N.prototype.renderText=function(){var B=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(ae){B.textElement.appendChild(xe.createTSpan(ae.trim()===""?" ":ae.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},N.prototype.getTextScale=function(){var B=this.textElement.getBBox(),ae=1;if(B.width>0&&B.height>0){var fe=(1*this.width-this.width*this.padding*2/100)/B.width,se=(1*this.height-this.height*this.padding*2/100)/B.height;ae=Math.min(fe,se)}return ae},N.prototype.getTextPosition=function(B){var ae=this.textElement.getBBox(),fe=0,se=0;return ae.width>0&&ae.height>0&&(fe=(this.width-ae.width*B)/2,se=this.height/2-ae.height*B/2),{x:fe,y:se}},N.prototype.sizeText=function(){var B=this.textElement.getBBox(),ae=this.getTextScale(),fe=this.getTextPosition(ae);fe.y-=B.y*ae,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+fe.x+"px, "+fe.y+"px) scale("+ae+", "+ae+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(fe.x,fe.y),this.textElement.transform.baseVal.getItem(1).setScale(ae,ae))},N.prototype.manipulate=function(B){ie.prototype.manipulate.call(this,B),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(B.x-this.pointerDownPoint.x)>5||Math.abs(B.y-this.pointerDownPoint.y)>5)},N.prototype.resize=function(B){ie.prototype.resize.call(this,B),this.isMoved=!0,this.setSize(),this.sizeText()},N.prototype.setSize=function(){ie.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(xe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),xe.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},N.prototype.pointerUp=function(B){var ae=this.state;ae==="creating"&&(this._suppressMarkerCreateEvent=!0),ie.prototype.pointerUp.call(this,B),this.setSize(),(ae==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},N.prototype.showTextEditor=function(){var B=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(ae){ae.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ae=Number.parseFloat(B.textEditor.style.fontSize);B.textEditor.clientWidth>=Number.parseInt(B.textEditor.style.maxWidth)&&ae>.9;)ae-=.1,B.textEditor.style.fontSize=Math.max(ae,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ae){ae.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ae){if(ae.clipboardData){var fe=ae.clipboardData.getData("text"),se=window.getSelection();if(!se.rangeCount)return!1;se.deleteFromDocument(),se.getRangeAt(0).insertNode(document.createTextNode(fe)),ae.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){B.textEditDivClicked(B.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},N.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var B=this.getTextScale(),ae=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),fe=this.textElement.getBBox(),se={x:fe.width*B,y:fe.height*B};ae.x-=se.x/2,ae.y-=se.y/2,this.textEditor.style.top=ae.y+"px",this.textEditor.style.left=ae.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ae.x+"px",this.textEditor.style.fontSize=Math.max(16*B,12)+"px",this.textElement.style.display="none"}},N.prototype.textEditDivClicked=function(B){this.text=B.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},N.prototype.select=function(){ie.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},N.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ie.prototype.deselect.call(this)},N.prototype.dblClick=function(B,ae){ie.prototype.dblClick.call(this,B,ae),this.showTextEditor()},N.prototype.setColor=function(B){this.textElement&&xe.setAttributes(this.textElement,[["fill",B]]),this.color=B,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(B)},N.prototype.setFont=function(B){this.textElement&&xe.setAttributes(this.textElement,[["font-family",B]]),this.fontFamily=B,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},N.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},N.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ie.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){var ae=B;this.color=ae.color,this.fontFamily=ae.fontFamily,this.padding=ae.padding,this.text=ae.text,this.createVisual(),ie.prototype.restoreState.call(this,B),this.setSize()},N.prototype.scale=function(B,ae){ie.prototype.scale.call(this,B,ae),this.setSize(),this.sizeText(),this.positionTextEditor()},N.typeName="TextMarker",N.title="Text marker",N.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',N}(J),Ke=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.color="transparent",se.lineWidth=3,se.drawing=!1,se.pixelRatio=1,se.color=fe.defaultColor,se.lineWidth=fe.defaultStrokeWidth,se.pixelRatio=fe.freehandPixelRatio,se.setColor=se.setColor.bind(se),se.addCanvas=se.addCanvas.bind(se),se.finishCreation=se.finishCreation.bind(se),se.setLineWidth=se.setLineWidth.bind(se),se.colorPanel=new ee("Color",fe.defaultColorSet,fe.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.lineWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),se.lineWidthPanel.onWidthChanged=se.setLineWidth,se}return Te(N,ie),N.prototype.ownsTarget=function(B){return!(!ie.prototype.ownsTarget.call(this,B)&&B!==this.visual&&B!==this.drawingImage)},N.prototype.createVisual=function(){this.visual=xe.createGroup(),this.drawingImage=xe.createImage(),this.visual.appendChild(this.drawingImage);var B=xe.createTransform();this.visual.transform.baseVal.appendItem(B),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(B,ae){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(B.x,B.y),this.drawing=!0):ie.prototype.pointerDown.call(this,B,ae)},N.prototype.manipulate=function(B){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(B.x,B.y),this.canvasContext.stroke()):ie.prototype.manipulate.call(this,B)},N.prototype.resize=function(B){ie.prototype.resize.call(this,B),xe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),xe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},N.prototype.pointerUp=function(B){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ie.prototype.pointerUp.call(this,B)},N.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},N.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ie.prototype.select.call(this)},N.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ie.prototype.deselect.call(this)},N.prototype.finishCreation=function(){for(var B=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ae=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],fe=ae[0],se=ae[1],$e=ae[2],St=ae[3],Pt=!1,$t=0;$t<this.canvasElement.height;$t++)for(var Ot=0;Ot<this.canvasElement.width;Ot++)B.data[$t*this.canvasElement.width*4+4*Ot+3]>0&&(Pt=!0,$t<se&&(se=$t),Ot<fe&&(fe=Ot),$t>St&&(St=$t),Ot>$e&&($e=Ot));if(Pt){this.left=fe/this.pixelRatio,this.top=se/this.pixelRatio,this.width=($e-fe)/this.pixelRatio,this.height=(St-se)/this.pixelRatio;var zt=document.createElement("canvas");zt.width=$e-fe,zt.height=St-se,zt.getContext("2d").putImageData(this.canvasContext.getImageData(fe,se,$e-fe,St-se),0,0),this.drawingImgUrl=zt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},N.prototype.setDrawingImage=function(){xe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),xe.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},N.prototype.setColor=function(B){this.color=B,this.colorChanged(B)},N.prototype.setLineWidth=function(B){this.lineWidth=B},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({drawingImgUrl:this.drawingImgUrl},ie.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){this.createVisual(),ie.prototype.restoreState.call(this,B),this.drawingImgUrl=B.drawingImgUrl,this.setDrawingImage()},N.prototype.scale=function(B,ae){ie.prototype.scale.call(this,B,ae),this.setDrawingImage()},N.typeName="FreehandMarker",N.title="Freehand marker",N.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',N}(J),Fe=function(ie){function N(B,ae,fe){var se=ie.call(this,B,fe||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return se.typeBoxes=[],se.currentType=ae,se.setCurrentType=se.setCurrentType.bind(se),se}return Te(N,ie),N.prototype.getUi=function(){var B=this,ae=document.createElement("div");ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2";for(var fe=function(St){var Pt="both";switch(St){case 0:Pt="both";break;case 1:Pt="start";break;case 2:Pt="end";break;case 3:Pt="none"}var $t=document.createElement("div");if($t.style.display="flex",$t.style.flexGrow="2",$t.style.alignItems="center",$t.style.justifyContent="space-between",$t.style.padding="5px",$t.style.borderWidth="2px",$t.style.borderStyle="solid",$t.style.borderColor=Pt===se.currentType?se.uiStyleSettings.toolboxAccentColor:"transparent",$t.addEventListener("click",function(){B.setCurrentType(Pt,$t)}),ae.appendChild($t),Pt==="both"||Pt==="start"){var Ot=document.createElement("div");Ot.style.display="flex",Ot.style.alignItems="center",Ot.style.minHeight="20px",Ot.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,5 10,0 10,10" fill="`+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,Ot.style.marginLeft="5px",$t.appendChild(Ot)}var zt=document.createElement("div");zt.style.display="flex",zt.style.alignItems="center",zt.style.minHeight="20px",zt.style.flexGrow="2";var an=document.createElement("hr");if(an.style.minWidth="20px",an.style.border="0px",an.style.borderTop="3px solid "+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee"),an.style.flexGrow="2",zt.appendChild(an),$t.appendChild(zt),Pt==="both"||Pt==="end"){var jn=document.createElement("div");jn.style.display="flex",jn.style.alignItems="center",jn.style.minHeight="20px",jn.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,0 10,5 0,10" fill="`+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,jn.style.marginRight="5px",$t.appendChild(jn)}se.typeBoxes.push($t)},se=this,$e=0;$e<4;$e++)fe($e);return ae},N.prototype.setCurrentType=function(B,ae){var fe=this;this.currentType=B,this.typeBoxes.forEach(function(se){se.style.borderColor=se===ae?fe.uiStyleSettings!==void 0?fe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},N}(qe),Ue=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.arrowType="end",se.arrowBaseHeight=10,se.arrowBaseWidth=10,se.getArrowPoints=se.getArrowPoints.bind(se),se.setArrowType=se.setArrowType.bind(se),se.arrowTypePanel=new Fe("Arrow type","end"),se.arrowTypePanel.onArrowTypeChanged=se.setArrowType,se}return Te(N,ie),N.prototype.ownsTarget=function(B){return!(!ie.prototype.ownsTarget.call(this,B)&&B!==this.arrow1&&B!==this.arrow2)},N.prototype.getArrowPoints=function(B,ae){var fe=this.arrowBaseWidth+2*this.strokeWidth,se=this.arrowBaseHeight+2*this.strokeWidth;return B-fe/2+","+(ae+se/2)+" "+B+","+(ae-se/2)+" "+(B+fe/2)+","+(ae+se/2)},N.prototype.createTips=function(){this.arrow1=xe.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(xe.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=xe.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(xe.createTransform()),this.visual.appendChild(this.arrow2)},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.state==="creating"&&this.createTips()},N.prototype.adjustVisual=function(){if(ie.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",xe.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),xe.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var B=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ae=this.arrow1.transform.baseVal.getItem(0);ae.setRotate(B,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ae,0);var fe=this.arrow2.transform.baseVal.getItem(0);fe.setRotate(B+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(fe,0)}},N.prototype.setArrowType=function(B){this.arrowType=B,this.adjustVisual(),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({arrowType:this.arrowType},ie.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){ie.prototype.restoreState.call(this,B);var ae=B;this.arrowType=ae.arrowType,this.createTips(),this.adjustVisual()},N.typeName="ArrowMarker",N.title="Arrow marker",N.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',N}(ht),_e=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.fillColor=fe.defaultFillColor,se.strokeWidth=0,se.fillPanel=new ee("Color",fe.defaultColorSet,fe.defaultFillColor),se.fillPanel.onColorChanged=se.setFillColor,se}return Te(N,ie),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ie.prototype.getState.call(this);return B.typeName=N.typeName,B},N.typeName="CoverMarker",N.title="Cover marker",N.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',N}(be),Ce=function(ie){function N(B,ae,fe,se){var $e=ie.call(this,B,se||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return $e.opacities=[],$e.opacityBoxes=[],$e.opacities=ae,$e.currentOpacity=fe,$e.setCurrentOpacity=$e.setCurrentOpacity.bind($e),$e}return Te(N,ie),N.prototype.getUi=function(){var B=this,ae=document.createElement("div");return ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2",ae.style.justifyContent="space-between",this.opacities.forEach(function(fe){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="center",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=fe===B.currentOpacity?B.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){B.setCurrentOpacity(fe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.innerText=100*fe+"%",se.appendChild($e),B.opacityBoxes.push(se)}),ae},N.prototype.setCurrentOpacity=function(B,ae){var fe=this;this.currentOpacity=B,this.opacityBoxes.forEach(function(se){se.style.borderColor=se===ae?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},N}(qe),Ne=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.setOpacity=se.setOpacity.bind(se),se.fillColor=fe.defaultHighlightColor,se.strokeWidth=0,se.opacity=fe.defaultHighlightOpacity,se.fillPanel=new ee("Color",fe.defaultColorSet,se.fillColor),se.fillPanel.onColorChanged=se.setFillColor,se.opacityPanel=new Ce("Opacity",fe.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return Te(N,ie),N.prototype.setOpacity=function(B){this.opacity=B,this.visual&&xe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ie.prototype.getState.call(this);return B.typeName=N.typeName,B},N.typeName="HighlightMarker",N.title="Highlight marker",N.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',N}(_e),De='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',rt=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.bgColor="transparent",se.tipPosition={x:0,y:0},se.tipBase1Position={x:0,y:0},se.tipBase2Position={x:0,y:0},se.tipMoving=!1,se.color=fe.defaultStrokeColor,se.bgColor=fe.defaultFillColor,se.fontFamily=fe.defaultFontFamily,se.defaultSize={x:100,y:30},se.setBgColor=se.setBgColor.bind(se),se.getTipPoints=se.getTipPoints.bind(se),se.positionTip=se.positionTip.bind(se),se.setTipPoints=se.setTipPoints.bind(se),se.colorPanel=new ee("Text color",fe.defaultColorSet,se.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),se.colorPanel.onColorChanged=se.setColor,se.bgColorPanel=new ee("Fill color",fe.defaultColorSet,se.bgColor,De),se.bgColorPanel.onColorChanged=se.setBgColor,se.fontFamilyPanel=new Qe("Font",fe.defaultFontFamilies,fe.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se.tipGrip=new q,se.tipGrip.visual.transform.baseVal.appendItem(xe.createTransform()),se.controlBox.appendChild(se.tipGrip.visual),se}return Te(N,ie),N.prototype.ownsTarget=function(B){return ie.prototype.ownsTarget.call(this,B)||this.tipGrip.ownsTarget(B)||this.tip===B},N.prototype.createTip=function(){xe.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=xe.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},N.prototype.pointerDown=function(B,ae){this.state==="new"&&ie.prototype.pointerDown.call(this,B,ae),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ae)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ie.prototype.pointerDown.call(this,B,ae)},N.prototype.pointerUp=function(B){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ie.prototype.pointerUp.call(this,B);else{var ae=this.state==="creating";ie.prototype.pointerUp.call(this,B),this.setTipPoints(ae),this.positionTip()}},N.prototype.manipulate=function(B){if(this.tipMoving){var ae=this.unrotatePoint(B);this.tipPosition={x:ae.x-this.manipulationStartLeft,y:ae.y-this.manipulationStartTop},this.positionTip()}else ie.prototype.manipulate.call(this,B)},N.prototype.setBgColor=function(B){this.bgRectangle&&this.tip&&(xe.setAttributes(this.bgRectangle,[["fill",B]]),xe.setAttributes(this.tip,[["fill",B]])),this.bgColor=B,this.fillColorChanged(B)},N.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},N.prototype.setTipPoints=function(B){B===void 0&&(B=!1);var ae=Math.min(this.height/2,15),fe=this.height/5;B&&(this.tipPosition={x:ae+fe/2,y:this.height+20});var se=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?se<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(fe=this.width/5,ae=Math.min(this.width/2,15),this.tipBase1Position={x:ae,y:0},this.tipBase2Position={x:ae+fe,y:0}):(this.tipBase1Position={x:0,y:ae},this.tipBase2Position={x:0,y:ae+fe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?se<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(fe=this.width/5,ae=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ae-fe,y:0},this.tipBase2Position={x:this.width-ae,y:0}):(this.tipBase1Position={x:this.width,y:ae},this.tipBase2Position={x:this.width,y:ae+fe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?se<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(fe=this.width/5,ae=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ae-fe,y:this.height},this.tipBase2Position={x:this.width-ae,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-ae-fe},this.tipBase2Position={x:this.width,y:this.height-ae}):se<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(fe=this.width/5,ae=Math.min(this.width/2,15),this.tipBase1Position={x:ae,y:this.height},this.tipBase2Position={x:ae+fe,y:this.height}):(this.tipBase1Position={x:0,y:this.height-ae},this.tipBase2Position={x:0,y:this.height-ae-fe})},N.prototype.resize=function(B){ie.prototype.resize.call(this,B),this.positionTip()},N.prototype.positionTip=function(){xe.setAttributes(this.tip,[["points",this.getTipPoints()]]);var B=this.tipGrip.visual.transform.baseVal.getItem(0);B.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(B,0)},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),N.prototype.select=function(){this.positionTip(),ie.prototype.select.call(this)},N.prototype.getState=function(){var B=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ie.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){var ae=B;this.bgColor=ae.bgColor,this.tipPosition=ae.tipPosition,ie.prototype.restoreState.call(this,B),this.createTip(),this.setTipPoints()},N.prototype.scale=function(B,ae){ie.prototype.scale.call(this,B,ae),this.tipPosition={x:this.tipPosition.x*B,y:this.tipPosition.y*ae},this.positionTip()},N.typeName="CalloutMarker",N.title="Callout marker",N.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',N}(Xe),tt=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.fillColor="transparent",se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.opacity=1,se.strokeColor=fe.defaultColor,se.strokeWidth=fe.defaultStrokeWidth,se.strokeDasharray=fe.defaultStrokeDasharray,se.fillColor=fe.defaultFillColor,se.setStrokeColor=se.setStrokeColor.bind(se),se.setFillColor=se.setFillColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.setOpacity=se.setOpacity.bind(se),se.createVisual=se.createVisual.bind(se),se.strokePanel=new ee("Line color",Ee(fe.defaultColorSet,["transparent"]),fe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.fillPanel=new ee("Fill color",Ee(fe.defaultColorSet,["transparent"]),se.fillColor,De),se.fillPanel.onColorChanged=se.setFillColor,se.strokeWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new ct("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se.opacityPanel=new Ce("Opacity",fe.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return Te(N,ie),N.prototype.ownsTarget=function(B){return!(!ie.prototype.ownsTarget.call(this,B)&&B!==this.visual)},N.prototype.createVisual=function(){this.visual=xe.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.state==="new"&&(this.createVisual(),this.moveVisual(B),this._state="creating")},N.prototype.manipulate=function(B){ie.prototype.manipulate.call(this,B)},N.prototype.resize=function(B){ie.prototype.resize.call(this,B),this.setSize()},N.prototype.setSize=function(){ie.prototype.setSize.call(this),xe.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},N.prototype.pointerUp=function(B){ie.prototype.pointerUp.call(this,B),this.setSize()},N.prototype.setStrokeColor=function(B){this.strokeColor=B,this.visual&&xe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(B),this.stateChanged()},N.prototype.setFillColor=function(B){this.fillColor=B,this.visual&&xe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(B),this.stateChanged()},N.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.visual&&xe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},N.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.visual&&xe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},N.prototype.setOpacity=function(B){this.opacity=B,this.visual&&xe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ie.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){var ae=B;this.fillColor=ae.fillColor,this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.opacity=ae.opacity,this.createVisual(),ie.prototype.restoreState.call(this,B),this.setSize()},N.prototype.scale=function(B,ae){ie.prototype.scale.call(this,B,ae),this.setSize()},N.typeName="EllipseMarker",N.title="Ellipse marker",N.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',N}(J),xt=function(ie){function N(B,ae,fe){return ie.call(this,B,ae,fe)||this}return Te(N,ie),Object.defineProperty(N.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),N.prototype.ownsTarget=function(B){return!(!ie.prototype.ownsTarget.call(this,B)&&B!==this.tip1&&B!==this.tip2)},N.prototype.createTips=function(){this.tip1=xe.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(xe.createTransform()),this.visual.appendChild(this.tip1),this.tip2=xe.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(xe.createTransform()),this.visual.appendChild(this.tip2)},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.state==="creating"&&this.createTips()},N.prototype.adjustVisual=function(){if(ie.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(xe.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),xe.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var B=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ae=this.tip1.transform.baseVal.getItem(0);ae.setRotate(B,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ae,0);var fe=this.tip2.transform.baseVal.getItem(0);fe.setRotate(B+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(fe,0)}},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ie.prototype.getState.call(this);return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){ie.prototype.restoreState.call(this,B),this.createTips(),this.adjustVisual()},N.typeName="MeasurementMarker",N.title="Measurement marker",N.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',N}(ht),Mt=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.strokePanel.colors=fe.defaultColorSet,se.fillColor="transparent",se}return Te(N,ie),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ie.prototype.getState.call(this);return B.typeName=N.typeName,B},N.typeName="EllipseFrameMarker",N.title="Ellipse frame marker",N.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',N}(tt),Bt=function(){function ie(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ie.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ie.prototype.addUndoStep=function(N){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(N)||(this.undoStack.push(N),JSON.stringify(this.lastRedoStep)!==JSON.stringify(N)&&this.redoStack.splice(0,this.redoStack.length))},ie.prototype.replaceLastUndoStep=function(N){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=N)},ie.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ie.prototype.undo=function(){if(this.undoStack.length>1){var N=this.undoStack.pop();return N!==void 0&&this.redoStack.push(N),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ie.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ie}(),It=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.curveX=0,se.curveY=0,se.manipulationStartCurveX=0,se.manipulationStartCurveY=0,se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.positionGrips=se.positionGrips.bind(se),se.addControlGrips=se.addControlGrips.bind(se),se.adjustVisual=se.adjustVisual.bind(se),se.setupControlBox=se.setupControlBox.bind(se),se.resize=se.resize.bind(se),se.strokeColor=fe.defaultColor,se.strokeWidth=fe.defaultStrokeWidth,se.strokeDasharray=fe.defaultStrokeDasharray,se.strokePanel=new ee("Line color",fe.defaultColorSet,fe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new ct("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Te(N,ie),N.prototype.ownsTarget=function(B){return!(!ie.prototype.ownsTarget.call(this,B)&&B!==this.visual&&B!==this.selectorCurve&&B!==this.visibleCurve&&!this.curveGrip.ownsTarget(B))},N.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},N.prototype.createVisual=function(){this.visual=xe.createGroup(),this.selectorCurve=xe.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=xe.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=B.x,this.curveY=B.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ae)&&(this.activeGrip=this.curveGrip,this._state="resize")},N.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),xe.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),xe.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),xe.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},N.prototype.setupControlBox=function(){ie.prototype.setupControlBox.call(this),this.curveControlLine1=xe.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=xe.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},N.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ie.prototype.addControlGrips.call(this)},N.prototype.positionGrips=function(){ie.prototype.positionGrips.call(this);var B=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-B/2,this.curveY-B/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},N.prototype.manipulate=function(B){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+B.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+B.y-this.manipulationStartY),ie.prototype.manipulate.call(this,B)},N.prototype.resize=function(B){this.activeGrip===this.curveGrip&&(this.curveX=B.x,this.curveY=B.y),ie.prototype.resize.call(this,B),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},N.prototype.setStrokeColor=function(B){this.strokeColor=B,this.adjustVisual(),this.colorChanged(B)},N.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.adjustVisual()},N.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.adjustVisual()},N.prototype.scale=function(B,ae){this.curveX=this.curveX*B,this.curveY=this.curveY*ae,ie.prototype.scale.call(this,B,ae)},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ie.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){ie.prototype.restoreState.call(this,B);var ae=B;this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.curveX=ae.curveX,this.curveY=ae.curveY,this.createVisual(),this.adjustVisual()},N.typeName="CurveMarker",N.title="Curve marker",N.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',N}(Ze),Dt=function(){function ie(N,B){B===void 0&&(B=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=N,this.cancelable=B}return Object.defineProperty(ie.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ie.prototype.preventDefault=function(){this._defaultPrevented=!0},ie}(),lt=function(ie){function N(B,ae,fe){var se=ie.call(this,B,!1)||this;return se.dataUrl=ae,se.state=fe,se}return Te(N,ie),N}(Dt),pt=function(ie){function N(B,ae,fe){fe===void 0&&(fe=!1);var se=ie.call(this,B,fe)||this;return se.marker=ae,se}return Te(N,ie),N}(Dt),ut=function(){function ie(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return ie.prototype.addEventListener=function(N,B){this[N].push(B)},ie.prototype.removeEventListener=function(N,B){var ae=this[N].indexOf(B);ae>-1&&this[N].splice(ae,1)},ie}(),Pe=function(){function ie(N){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Be,this._isOpen=!1,this.undoRedoManager=new Bt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new ut,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ie.instanceCounter++,this.styles=new ze(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=N,this.targetRoot=document.body,this.width=N.clientWidth,this.height=N.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(ie.prototype,"ALL_MARKER_TYPES",{get:function(){return[He,Ke,Ue,Xe,Mt,tt,Ne,rt,xt,_e,ht,It]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[He,Ke,Ue,Xe,tt,Ne,rt]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"BASIC_MARKER_TYPES",{get:function(){return[He,Ke,Ue,Xe,Ne]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(N){var B=this;this._availableMarkerTypes.splice(0),N.forEach(function(ae){if(typeof ae=="string"){var fe=B.ALL_MARKER_TYPES.find(function(se){return se.typeName===ae});fe!==void 0&&B._availableMarkerTypes.push(fe)}else B._availableMarkerTypes.push(ae)})},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(N){this._zoomLevel=N,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ie.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ge.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ie.prototype.show=function(){var N=this;this.styles.styleSheetRoot===void 0&&We.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=We.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(B){return B(new Dt(N))})},ie.prototype.render=function(){return we(this,void 0,void 0,function(){var N;return Me(this,function(B){switch(B.label){case 0:return this.setCurrentMarker(),(N=new je).naturalSize=this.renderAtNaturalSize,N.imageType=this.renderImageType,N.imageQuality=this.renderImageQuality,N.markersOnly=this.renderMarkersOnly,N.width=this.renderWidth,N.height=this.renderHeight,[4,N.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return B.sent(),[4,N.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,B.sent()]}})})},ie.prototype.close=function(N){var B=this;if(N===void 0&&(N=!1),this.isOpen){var ae=!1;N||this.eventListeners.beforeclose.forEach(function(fe){var se=new Dt(B,!0);fe(se),se.defaultPrevented&&(ae=!0)}),ae||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(fe){return fe(new Dt(B))}),this.detachEvents(),this._isOpen=!1)}},ie.prototype.addMarkersToToolbar=function(){for(var N,B=[],ae=0;ae<arguments.length;ae++)B[ae]=arguments[ae];(N=this._availableMarkerTypes).push.apply(N,B)},ie.prototype.addRenderEventListener=function(N){this.addEventListener("render",function(B){N(B.dataUrl,B.state)})},ie.prototype.removeRenderEventListener=function(N){},ie.prototype.addCloseEventListener=function(N){this.addEventListener("close",function(){N()})},ie.prototype.removeCloseEventListener=function(N){},ie.prototype.setupResizeObserver=function(){var N=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){N.resize(N.target.clientWidth,N.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return N.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ie.prototype.onPopupTargetResize=function(){var N=1*this.target.clientWidth/this.target.clientHeight,B=this.editorCanvas.clientWidth/N>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*N:this.editorCanvas.clientWidth,ae=B<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/N;this.resize(B,ae)},ie.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ie.prototype.resize=function(N,B){this._isResizing=!0;var ae=N/this.imageWidth,fe=B/this.imageHeight;this.imageWidth=Math.round(N),this.imageHeight=Math.round(B),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(ae,fe),this._isResizing=!1},ie.prototype.scaleMarkers=function(N,B){var ae,fe=this;this._currentMarker&&this._currentMarker instanceof Xe?this._currentMarker.scale(N,B):(ae=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(se){se!==fe._currentMarker&&se.scale(N,B)}),ae!==void 0&&this.setCurrentMarker(ae)},ie.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},ie.prototype.setTopLeft=function(){var N=this.editingTarget.getBoundingClientRect(),B=this.editorCanvas.getBoundingClientRect();this.left=N.left-B.left,this.top=N.top-B.top},ie.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},ie.prototype.addDefs=function(){for(var N,B=[],ae=0;ae<arguments.length;ae++)B[ae]=arguments[ae];this.defs=xe.createDefs(),this.addDefsToImage(),(N=this.defs).append.apply(N,B)},ie.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ie.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},ie.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ie.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ie.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},ie.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ie.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},ie.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var N=document.createElement("a");N.href="https://markerjs.com/",N.target="_blank",N.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',N.title="Powered by marker.js",N.style.display="grid",N.style.alignItems="center",N.style.justifyItems="center",N.style.padding="3px",N.style.width="20px",N.style.height="20px",this.logoUI.appendChild(N),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ie.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},ie.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},ie.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ie.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var N=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=N+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Oe(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Ie(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ie.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ie.prototype.removeMarker=function(N){this.markerImage.removeChild(N.container),this.markers.indexOf(N)>-1&&this.markers.splice(this.markers.indexOf(N),1),N.dispose()},ie.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},ie.prototype.toolbarButtonClicked=function(N,B){if(N==="marker"&&B!==void 0)this.createNewMarker(B);else if(N==="action")switch(B){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},ie.prototype.deleteSelectedMarker=function(){var N=this;if(this._currentMarker!==void 0){var B=!1;if(this.eventListeners.markerbeforedelete.forEach(function(fe){var se=new pt(N,N._currentMarker,!0);fe(se),se.defaultPrevented&&(B=!0)}),!B){var ae=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(fe){return fe(new pt(N,ae))})}}},ie.prototype.clear=function(){var N=this,B=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function($e){var St=new pt(N,void 0,!0);$e(St),St.defaultPrevented&&(B=!0)}),!B)){this.setCurrentMarker();for(var ae=function($e){var St=fe.markers[$e];fe.setCurrentMarker(fe.markers[$e]),fe._currentMarker.dispose(),fe.markerImage.removeChild(fe._currentMarker.container),fe.markers.splice(fe.markers.indexOf(fe._currentMarker),1),fe.eventListeners.markerdelete.forEach(function(Pt){return Pt(new pt(N,St))})},fe=this,se=this.markers.length-1;se>=0;se--)ae(se);this.addUndoStep()}},Object.defineProperty(ie.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ie.prototype.showNotesEditor=function(){var N;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(N=this._currentMarker.notes)!==null&&N!==void 0?N:"",this.overlayContainer.appendChild(this.notesArea))},ie.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},ie.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ie.prototype.addUndoStep=function(){var N=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var B=this.getState(),ae=this.undoRedoManager.getLastUndoStep();if(!ae||ae.width===B.width&&ae.height===B.height){var fe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(B),fe<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(se){return se(new Dt(N))})}else this.undoRedoManager.replaceLastUndoStep(B),this.eventListeners.statechange.forEach(function(se){return se(new Dt(N))})}},ie.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ie.prototype.undoStep=function(){var N=this,B=this.undoRedoManager.undo();B!==void 0&&(this.restoreState(B),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ae){return ae(new Dt(N))}))},ie.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ie.prototype.redoStep=function(){var N=this,B=this.undoRedoManager.redo();B!==void 0&&(this.restoreState(B),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ae){return ae(new Dt(N))}))},ie.prototype.stepZoom=function(){var N=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=N<this.zoomSteps.length-1?this.zoomSteps[N+1]:this.zoomSteps[0]},ie.prototype.panTo=function(N){this.contentDiv.scrollBy({left:this.prevPanPoint.x-N.x,top:this.prevPanPoint.y-N.y}),this.prevPanPoint=N},ie.prototype.startRenderAndClose=function(){return we(this,void 0,void 0,function(){var N,B,ae=this;return Me(this,function(fe){switch(fe.label){case 0:return[4,this.render()];case 1:return N=fe.sent(),B=this.getState(),this.eventListeners.render.forEach(function(se){return se(new lt(ae,N,B))}),this.close(!0),[2]}})})},ie.prototype.getState=function(N){N===!0&&this.setCurrentMarker();var B={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(ae){return B.markers.push(ae.getState())}),B},ie.prototype.restoreState=function(N){var B=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);N.markers.forEach(function(ae){var fe=B._availableMarkerTypes.find(function($e){return $e.typeName===ae.typeName});if(fe!==void 0){var se=B.addNewMarker(fe);se.restoreState(ae),B.markers.push(se)}}),N.width&&N.height&&(N.width!==this.imageWidth||N.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/N.width,this.imageHeight/N.height),this.eventListeners.restorestate.forEach(function(ae){return ae(new Dt(B))})},ie.prototype.addNewMarker=function(N){var B=xe.createGroup();return this.markerImage.appendChild(B),new N(B,this.overlayContainer,this.settings)},ie.prototype.createNewMarker=function(N){var B,ae=this;(B=typeof N=="string"?this._availableMarkerTypes.find(function(fe){return fe.typeName===N}):N)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(B),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(B.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(fe){return fe(new pt(ae,ae._currentMarker))}))},ie.prototype.markerCreated=function(N){var B=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(N),this.setCurrentMarker(N),N instanceof Ke&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ke):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(ae){return ae(new pt(B,B._currentMarker))})},ie.prototype.colorChanged=function(N){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=N,this.settings.defaultStrokeColor=N)},ie.prototype.fillColorChanged=function(N){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=N)},ie.prototype.markerStateChanged=function(N){var B=this;this.eventListeners.markerchange.forEach(function(ae){return ae(new pt(B,N))})},ie.prototype.setCurrentMarker=function(N){var B=this;this._currentMarker!==N&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(ae){return ae(new pt(B,B._currentMarker))})),this._currentMarker=N,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(ae){return ae(new pt(B,B._currentMarker))}))},ie.prototype.onPointerDown=function(N){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||N.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var B=this.markers.find(function(ae){return ae.ownsTarget(N.target)});B!==void 0?(this.setCurrentMarker(B),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(N.clientX,N.clientY),N.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:N.clientX,y:N.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(N.clientX,N.clientY))},ie.prototype.onDblClick=function(N){if(this._isFocused||this.focus(),this.mode==="select"){var B=this.markers.find(function(ae){return ae.ownsTarget(N.target)});B!==void 0&&B!==this._currentMarker&&this.setCurrentMarker(B),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(N.clientX,N.clientY),N.target):this.setCurrentMarker()}},ie.prototype.onPointerMove=function(N){this.touchPoints!==1&&N.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||N.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(N.clientX,N.clientY)):this.zoomLevel>1&&this.panTo({x:N.clientX,y:N.clientY}))},ie.prototype.onPointerUp=function(N){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(N.clientX,N.clientY)),this.isDragging=!1,this.addUndoStep()},ie.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ie.prototype.onKeyUp=function(N){this._currentMarker===void 0||this.notesArea!==void 0||N.key!=="Delete"&&N.key!=="Backspace"||this.deleteSelectedMarker()},ie.prototype.clientToLocalCoordinates=function(N,B){var ae=this.markerImage.getBoundingClientRect();return{x:(N-ae.left)/this.zoomLevel,y:(B-ae.top)/this.zoomLevel}},ie.prototype.onWindowResize=function(){this.positionUI()},ie.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var N=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=N+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},ie.prototype.addLicenseKey=function(N){Ge.addKey(N)},ie.prototype.addEventListener=function(N,B){this.eventListeners.addEventListener(N,B)},ie.prototype.removeEventListener=function(N,B){this.eventListeners.removeEventListener(N,B)},ie.prototype.renderState=function(N){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(N),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ie.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ie.prototype.focus=function(){var N=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(B){return B(new Dt(N))}))},ie.prototype.blur=function(){var N=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(B){return B(new Dt(N))}))},ie.instanceCounter=0,ie}();/* **********************************
|
|
|
cropro version 1.2.0
|
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
|
|
copyright Alan Mendelevich
|
|
|
see README and LICENSE for details
|
|
|
********************************** *//*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */var Ve=function(ie,N){return(Ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,ae){B.__proto__=ae}||function(B,ae){for(var fe in ae)Object.prototype.hasOwnProperty.call(ae,fe)&&(B[fe]=ae[fe])})(ie,N)};function yt(ie,N){if(typeof N!="function"&&N!==null)throw new TypeError("Class extends value "+String(N)+" is not a constructor or null");function B(){this.constructor=ie}Ve(ie,N),ie.prototype=N===null?Object.create(N):(B.prototype=N.prototype,new B)}function st(ie,N,B,ae){return new(B||(B=Promise))(function(fe,se){function $e($t){try{Pt(ae.next($t))}catch(Ot){se(Ot)}}function St($t){try{Pt(ae.throw($t))}catch(Ot){se(Ot)}}function Pt($t){var Ot;$t.done?fe($t.value):(Ot=$t.value,Ot instanceof B?Ot:new B(function(zt){zt(Ot)})).then($e,St)}Pt((ae=ae.apply(ie,N||[])).next())})}function Nt(ie,N){var B,ae,fe,se,$e={label:0,sent:function(){if(1&fe[0])throw fe[1];return fe[1]},trys:[],ops:[]};return se={next:St(0),throw:St(1),return:St(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function St(Pt){return function($t){return function(Ot){if(B)throw new TypeError("Generator is already executing.");for(;$e;)try{if(B=1,ae&&(fe=2&Ot[0]?ae.return:Ot[0]?ae.throw||((fe=ae.return)&&fe.call(ae),0):ae.next)&&!(fe=fe.call(ae,Ot[1])).done)return fe;switch(ae=0,fe&&(Ot=[2&Ot[0],fe.value]),Ot[0]){case 0:case 1:fe=Ot;break;case 4:return $e.label++,{value:Ot[1],done:!1};case 5:$e.label++,ae=Ot[1],Ot=[0];continue;case 7:Ot=$e.ops.pop(),$e.trys.pop();continue;default:if(!(fe=$e.trys,(fe=fe.length>0&&fe[fe.length-1])||Ot[0]!==6&&Ot[0]!==2)){$e=0;continue}if(Ot[0]===3&&(!fe||Ot[1]>fe[0]&&Ot[1]<fe[3])){$e.label=Ot[1];break}if(Ot[0]===6&&$e.label<fe[1]){$e.label=fe[1],fe=Ot;break}if(fe&&$e.label<fe[2]){$e.label=fe[2],$e.ops.push(Ot);break}fe[2]&&$e.ops.pop(),$e.trys.pop();continue}Ot=N.call(ie,$e)}catch(zt){Ot=[6,zt],ae=0}finally{B=fe=0}if(5&Ot[0])throw Ot[1];return{value:Ot[0]?Ot[1]:void 0,done:!0}}([Pt,$t])}}}var Ut=function(){function ie(){}return ie.addKey=function(N){ie.key=N},Object.defineProperty(ie,"isLicensed",{get:function(){return!!ie.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ie.key)},enumerable:!1,configurable:!0}),ie}(),it=function(){function ie(){}return ie.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ie.setAttributes=function(N,B){for(var ae=0,fe=B;ae<fe.length;ae++){var se=fe[ae],$e=se[0],St=se[1];N.setAttribute($e,St)}},ie.createRect=function(N,B,ae){var fe=document.createElementNS("http://www.w3.org/2000/svg","rect");return fe.setAttribute("width",N.toString()),fe.setAttribute("height",B.toString()),ae&&ie.setAttributes(fe,ae),fe},ie.createLine=function(N,B,ae,fe,se){var $e=document.createElementNS("http://www.w3.org/2000/svg","line");return $e.setAttribute("x1",N.toString()),$e.setAttribute("y1",B.toString()),$e.setAttribute("x2",ae.toString()),$e.setAttribute("y2",fe.toString()),se&&ie.setAttributes($e,se),$e},ie.createPolygon=function(N,B){var ae=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ae.setAttribute("points",N),B&&ie.setAttributes(ae,B),ae},ie.createCircle=function(N,B){var ae=document.createElementNS("http://www.w3.org/2000/svg","circle");return ae.setAttribute("cx",(N/2).toString()),ae.setAttribute("cy",(N/2).toString()),ae.setAttribute("r",N.toString()),B&&ie.setAttributes(ae,B),ae},ie.createEllipse=function(N,B,ae){var fe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return fe.setAttribute("cx",(N/2).toString()),fe.setAttribute("cy",(B/2).toString()),fe.setAttribute("rx",(N/2).toString()),fe.setAttribute("ry",(B/2).toString()),ae&&ie.setAttributes(fe,ae),fe},ie.createGroup=function(N){var B=document.createElementNS("http://www.w3.org/2000/svg","g");return N&&ie.setAttributes(B,N),B},ie.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ie.createMarker=function(N,B,ae,fe,se,$e,St){var Pt=document.createElementNS("http://www.w3.org/2000/svg","marker");return ie.setAttributes(Pt,[["id",N],["orient",B],["markerWidth",ae.toString()],["markerHeight",fe.toString()],["refX",se.toString()],["refY",$e.toString()]]),Pt.appendChild(St),Pt},ie.createText=function(N){var B=document.createElementNS("http://www.w3.org/2000/svg","text");return B.setAttribute("x","0"),B.setAttribute("y","0"),N&&ie.setAttributes(B,N),B},ie.createTSpan=function(N,B){var ae=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ae.textContent=N,B&&ie.setAttributes(ae,B),ae},ie.createImage=function(N){var B=document.createElementNS("http://www.w3.org/2000/svg","image");return N&&ie.setAttributes(B,N),B},ie.createPoint=function(N,B){var ae=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ae.x=N,ae.y=B,ae},ie.createPath=function(N,B){var ae=document.createElementNS("http://www.w3.org/2000/svg","path");return ae.setAttribute("d",N),B&&ie.setAttributes(ae,B),ae},ie.createElement=function(N,B){var ae=document.createElementNS("http://www.w3.org/2000/svg",N);return B&&ie.setAttributes(ae,B),ae},ie.getHollowRectanglePath=function(N,B,ae,fe,se,$e,St,Pt){return"M"+N+","+B+"V"+(B+fe)+"H"+(N+ae)+"V"+B+"H"+se+"V"+$e+"H"+(se+St)+"V"+($e+Pt)+"H"+se+"V"+B+"Z"},ie}(),mt=function(){function ie(N){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+N+"_"}return Object.defineProperty(ie.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ie.prototype.addClass=function(N){return this.styleSheet===void 0&&this.addStyleSheet(),N.name=""+this.classNamePrefix+N.localName,this.classes.push(N),this.styleSheet.sheet.insertRule("."+N.name+" {"+N.style+"}",this.styleSheet.sheet.cssRules.length),N},ie.prototype.addRule=function(N){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(N),this.styleSheet.sheet.insertRule(N.selector+" {"+N.style+"}",this.styleSheet.sheet.cssRules.length)},ie.prototype.addStyleSheet=function(){var N;this.styleSheet=document.createElement("style"),((N=this.styleSheetRoot)!==null&&N!==void 0?N:document.head).appendChild(this.styleSheet),this.addRule(new bt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new bt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new bt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new At("_fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new At("_fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},ie.prototype.removeStyleSheet=function(){var N;this.styleSheet&&(((N=this.styleSheetRoot)!==null&&N!==void 0?N:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ie}(),bt=function(ie,N){this.selector=ie,this.style=N},At=function(ie,N){this.localName=ie,this.style=N},Xt=function(){function ie(){this.blocks=[],this.display=""}return ie.prototype.addButtonBlock=function(N){N.className=this.blockClassName,N.buttonClassName=this.buttonClassName,N.buttonColorsClassName=this.buttonColorsClassName,N.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(N)},ie.prototype.addElementBlock=function(N){N.className===void 0&&(N.className=this.blockClassName),this.blocks.push(N)},ie.prototype.getUI=function(){var N=document.createElement("div");return N.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,N.style.display=this.display,this.blocks.forEach(function(B){return N.appendChild(B.getUI())}),N},ie}(),Ae=function(){function ie(){}return ie.prototype.getUI=function(){var N=document.createElement("div");if(N.className=this.className,this.minWidth!==void 0&&(N.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":N.style.justifyContent="flex-start";break;case"center":N.style.justifyContent="center";break;case"end":N.style.justifyContent="flex-end"}return N.style.whiteSpace="nowrap",N},ie}(),ge=function(ie){function N(){var B=ie!==null&&ie.apply(this,arguments)||this;return B.buttons=[],B}return yt(N,ie),N.prototype.addButton=function(B){B.className=this.buttonClassName,B.colorsClassName=this.buttonColorsClassName,B.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(B)},N.prototype.getUI=function(){var B=ie.prototype.getUI.call(this);return this.buttons.forEach(function(ae){return B.appendChild(ae.getUI())}),B},N}(Ae),z=function(){function ie(N,B){this._isActive=!1,this._isHidden=!1,this._icon=N,this.title=B,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ie.prototype,"icon",{get:function(){return this._icon},set:function(N){this._icon=N,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isActive",{get:function(){return this._isActive},set:function(N){this._isActive=N,this.adjustClassName()},enumerable:!1,configurable:!0}),ie.prototype.getUI=function(){var N=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return N.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ie.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},ie.prototype.hide=function(){this._isHidden=!0},ie}(),Z=function(ie){function N(){var B=ie!==null&&ie.apply(this,arguments)||this;return B.elements=[],B}return yt(N,ie),N.prototype.addElement=function(B){this.elements.push(B)},N.prototype.getUI=function(){var B=ie.prototype.getUI.call(this);return this.elements.forEach(function(ae){return B.appendChild(ae)}),B},N}(Ae),oe=function(){function ie(N,B){this.horizontal=N,this.vertical=B}return Object.defineProperty(ie.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ie.prototype.getVerticalLength=function(N){return N/this.ratio},ie.prototype.getHorizontalLength=function(N){return N*this.ratio},ie}(),me=function(){function ie(){}return ie.getIcon=function(N,B){if(N>0&&B>0){var ae=new oe(N,B),fe=ae.ratio>=1?20:ae.getHorizontalLength(20),se=ae.ratio<1?20:ae.getVerticalLength(20),$e=document.createElementNS("http://www.w3.org/2000/svg","svg");$e.setAttribute("xmlns","http://www.w3.org/2000/svg"),$e.setAttribute("viewBox","0 0 24 24"),document.body.appendChild($e);var St=it.createDefs();$e.appendChild(St);var Pt=it.createElement("clipPath",[["id","text-bg-clip"]]);St.appendChild(Pt);var $t=it.createPath(it.getHollowRectanglePath((24-fe)/2,(24-se)/2,fe,se,(24-fe)/2+2,(24-se)/2+2,fe-4,se-4));$e.appendChild($t);var Ot=it.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ot.appendChild(it.createTSpan(N+":"+B)),$e.appendChild(Ot);var zt=Ot.getBBox();it.setAttributes(Ot,[["x",((24-zt.width)/2).toString()],["y",((24-zt.height)/2-zt.y).toString()]]);var an=it.createPath(it.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(zt.width))/2,(24-Math.ceil(zt.height))/2,Math.ceil(zt.width),Math.ceil(zt.height)));return Pt.appendChild(an),it.setAttributes($t,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild($e),$e.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},ie}(),Re=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae)||this;return se.isDropdownOpen=!1,se.onClick=se.dropdownButtonClicked,se.dropdownButtons=fe,se}return yt(N,ie),N.prototype.setupDropdown=function(){var B=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ae){ae.className=B.className,ae.colorsClassName=B.colorsClassName,B.dropdownBlock.appendChild(ae.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},N.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},N.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},N.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},N.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},N.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},N}(z),Je=function(){function ie(N,B){this.GRIP_SIZE=10,this.color=N,this.fillColor=B,this.visual=it.createGroup(),this.visual.appendChild(it.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(it.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ie.prototype.ownsTarget=function(N){return N===this.visual||N===this.visual.childNodes[0]||N===this.visual.childNodes[1]},ie.prototype.setCenter=function(N,B){this.visual.childNodes.forEach(function(ae){return it.setAttributes(ae,[["cx",N.toString()],["cy",B.toString()]])})},ie}(),at=function(){function ie(N,B,ae,fe){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=N,this.canvasHeight=B,this.margin=ae,this.container=fe,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(ie.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(N){this._aspectRatio=N,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(N){this._isGridVisible=N,this.gridContainer&&it.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(N){this._zoomFactor=N,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ie.prototype.open=function(){var N=this;this.cropShadeElement=it.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=it.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var B=0;B<this.numberOfGridLines;B++)this.horizontalGridLines.push(it.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(it.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ae){return N.gridContainer.appendChild(ae)}),this.verticalGridLines.forEach(function(ae){return N.gridContainer.appendChild(ae)}),this.cropRectElement=it.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Je(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Je(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Je(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Je(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ie.prototype.setCropRectangle=function(N){this.cropRect=N;var B=Object.assign({},this.cropRect);this.zoomFactor!==1&&(B.width=this.cropRect.width*this.zoomFactor,B.height=this.cropRect.height*this.zoomFactor,B.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-B.width/2,B.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-B.height/2),it.setAttributes(this.cropRectElement,[["x",B.x.toString()],["y",B.y.toString()],["width",B.width.toString()],["height",B.height.toString()]]);var ae=B.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(se,$e){var St=B.y+ae*($e+1);it.setAttributes(se,[["x1",""+B.x],["y1",""+St],["x2",""+(B.x+B.width)],["y2",""+St]])});var fe=B.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(se,$e){var St=B.x+fe*($e+1);it.setAttributes(se,[["x1",""+St],["y1",""+B.y],["x2",""+St],["y2",""+(B.y+B.height)]])}),it.setAttributes(this.cropShadeElement,[["d",it.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,B.x,B.y,B.width,B.height)]]),this.topLeftGrip.setCenter(B.x,B.y),this.topRightGrip.setCenter(B.x+B.width,B.y),this.bottomLeftGrip.setCenter(B.x,B.y+B.height),this.bottomRightGrip.setCenter(B.x+B.width,B.y+B.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ie.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},ie.prototype.clientToLocalCoordinates=function(N,B){var ae=this.container.getBoundingClientRect();return{x:N-ae.left+this.margin,y:B-ae.top+this.margin}},ie.prototype.onPointerDown=function(N){this.container.setPointerCapture(N.pointerId),this.previousPoint=this.clientToLocalCoordinates(N.clientX,N.clientY),this.cropRectElement===N.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(N.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(N.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(N.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(N.target)&&(this.activeGrip=this.bottomRightGrip)},ie.prototype.onPointerMove=function(N){if(this.isMoving)this.move(this.clientToLocalCoordinates(N.clientX,N.clientY));else if(this.activeGrip){var B=this.clientToLocalCoordinates(N.clientX,N.clientY);this.resize(B)}N.preventDefault()},ie.prototype.onPointerUp=function(N){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(N.pointerId)},ie.prototype.move=function(N){var B=N.x-this.previousPoint.x,ae=N.y-this.previousPoint.y;this.zoomFactor!==1&&(B=-B/this.zoomFactor,ae=-ae/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+B),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ae),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=N},ie.prototype.resize=function(N){var B=Object.assign({},this.cropRect),ae=N.x-this.previousPoint.x,fe=N.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:B.x+ae<this.margin&&(ae=this.margin-B.x),B.x+=ae,B.width=this.cropRect.x+this.cropRect.width-B.x;break;case this.bottomRightGrip:case this.topRightGrip:B.width+ae>this.canvasWidth*this.zoomFactor&&(ae=this.canvasWidth*this.zoomFactor-B.width),B.width+=ae}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(B.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ae),B.height=this.aspectRatio.getVerticalLength(B.width)):(B.y+=fe,B.height=this.cropRect.y+this.cropRect.height-B.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?B.height=this.aspectRatio.getVerticalLength(B.width):B.height+=fe}B.width<10&&(B.x=this.cropRect.x,B.width=10),B.height<10&&(B.y=this.cropRect.y,B.height=10),this.previousPoint=N,B.x>=this.margin&&B.y>=this.margin&&B.x-this.margin+B.width<=this.canvasWidth&&B.y-this.margin+B.height<=this.canvasHeight&&(this.cropRect=B,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ie.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var N=this.cropRect.x+this.cropRect.width/2,B=this.cropRect.y+this.cropRect.height/2,ae=this.aspectRatio.getHorizontalLength(this.cropRect.height),fe=this.aspectRatio.getVerticalLength(this.cropRect.width);ae/this.canvasWidth<fe/this.canvasHeight?this.cropRect.width=ae:this.cropRect.height=fe,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=N-this.cropRect.width/2,this.cropRect.y=B-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},ie.prototype.getRescaledRect=function(N,B,ae,fe,se,$e){var St=ae/N,Pt=fe/B;return{x:(se.x-$e)*St+$e,y:(se.y-$e)*Pt+$e,width:se.width*St,height:se.height*Pt}},ie.prototype.scaleCanvas=function(N,B){var ae=this.getRescaledRect(this.canvasWidth,this.canvasHeight,N,B,this.cropRect,this.margin);this.canvasWidth=N,this.canvasHeight=B,this.onCropChange&&this.onCropChange(ae),this.setCropRectangle(ae)},ie}(),kt=function(){function ie(N){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=N,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(ie.prototype,"angle",{get:function(){return this._angle},set:function(N){this._angle=N,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ie.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},ie.prototype.onPointerDown=function(N){this.controlContainer.setPointerCapture(N.pointerId),this.isDragging=!0,this.previousPoint={x:N.clientX,y:N.clientY}},ie.prototype.onPointerMove=function(N){this.isDragging&&(this.onAngleChange&&this.onAngleChange((N.clientX-this.previousPoint.x)/5),this.previousPoint.x=N.clientX)},ie.prototype.onPointerUp=function(N){this.isDragging&&this.onAngleChange&&this.onAngleChange((N.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(N.pointerId)},ie.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var N=this.angleLabelText.getBBox();it.setAttributes(this.angleLabelElement,[["x",((this.width-N.width)/2).toString()],["y",(this.height/2).toString()]])}},ie.prototype.positionScaleShape=function(){if(this.scaleShape){var N=this.scaleShape.transform.baseVal.getItem(0);N.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(N,0)}},ie.prototype.getVisual=function(){var N=document.createElementNS("http://www.w3.org/2000/svg","svg");N.setAttribute("xmlns","http://www.w3.org/2000/svg"),N.setAttribute("width",this.width+"px"),N.setAttribute("height",this.height+"px"),N.setAttribute("viewBox","0 0 "+this.width+" "+this.height),N.style.flexShrink="0",document.body.appendChild(N);for(var B="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ae=1;ae<=this.width/5+10;ae++){var fe=ae%5==0?this.height/3:this.height/6;B+="h4v"+-fe+"h1v"+fe}B+="v1H0Z",this.scaleShape=it.createPath(B);var se=it.createTransform();this.scaleShape.transform.baseVal.appendItem(se),N.appendChild(this.scaleShape),this.angleLabelElement=it.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=it.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var $e=it.createTSpan("");return $e.innerHTML="°",this.angleLabelElement.appendChild($e),N.appendChild(this.angleLabelElement),document.body.removeChild(N),N},ie}(),jt=function(){function ie(){this.naturalSize=!1,this.imageType="image/png"}return ie.prototype.rasterize=function(N,B,ae,fe,se,$e,St){var Pt=this;return new Promise(function($t){var Ot=document.createElement("canvas");Ot.width=N.width.baseVal.value-2*fe,Ot.height=N.height.baseVal.value-2*fe;var zt=1,an=1;Pt.naturalSize===!0?(zt=B.naturalWidth/(N.width.baseVal.value-2*fe)/$e,an=B.naturalHeight/(N.height.baseVal.value-2*fe)/St,Ot.width=B.naturalWidth/$e,Ot.height=B.naturalHeight/St):Pt.width!==void 0&&Pt.height!==void 0&&(zt=Pt.width/ae.width,an=Pt.height/ae.height,Ot.width*=zt,Ot.height*=an);var jn=Ot.getContext("2d");jn.translate(Ot.width/2,Ot.height/2),jn.rotate(se*Math.PI/180),jn.scale($e,St),jn.translate(-Ot.width/2,-Ot.height/2),jn.drawImage(B,0,0,Ot.width,Ot.height);var Dr=document.createElement("canvas");Dr.width=ae.width*zt,Dr.height=ae.height*an,Dr.getContext("2d").putImageData(jn.getImageData((ae.x-fe)*zt,(ae.y-fe)*an,ae.width*zt,ae.height*an),0,0),$t(Dr.toDataURL(Pt.imageType,Pt.imageQuality))})},ie}(),ot=function(){function ie(N){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=ie.instanceCounter++,this.styles=new mt(this.instanceNo),this.target=N,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(ie.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(N){this._zoomToCropEnabled=N,N?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(N){this._isGridVisible=N,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"gridLines",{get:function(){return this._gridLines},set:function(N){this._gridLines=N,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(N){this._rotationAngle=N,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"aspectRatio",{get:function(){var N;return(N=this._aspectRatio)!==null&&N!==void 0?N:this.aspectRatios[0]},set:function(N){this._aspectRatio=N},enumerable:!1,configurable:!0}),ie.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},ie.prototype.show=function(){this.showUI(),this.open()},ie.prototype.close=function(N){N===void 0&&(N=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),N||this.closeEventListeners.forEach(function(B){return B()}),this._isOpen=!1)},ie.prototype.addRenderEventListener=function(N){this.renderEventListeners.push(N)},ie.prototype.removeRenderEventListener=function(N){this.renderEventListeners.indexOf(N)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(N),1)},ie.prototype.addCloseEventListener=function(N){this.closeEventListeners.push(N)},ie.prototype.removeCloseEventListener=function(N){this.closeEventListeners.indexOf(N)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(N),1)},ie.prototype.setupResizeObserver=function(){var N=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){N.resize(N.target.clientWidth,N.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},ie.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var N=1*this.target.clientWidth/this.target.clientHeight,B=this.contentDiv.clientWidth/N>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*N:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ae=B+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/N;this.resize(B,ae)}},ie.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ie.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",it.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ie.prototype.resize=function(N,B){this.imageWidth=Math.round(N),this.imageHeight=Math.round(B),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},ie.prototype.setEditingTarget=function(){var N=document.createElement("canvas");N.width=this.target.naturalWidth,N.height=this.target.naturalHeight,N.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var B=N.toDataURL();it.setAttributes(this.editingTarget,[["href",B]]),this.setEditingTargetSize()},ie.prototype.setTopLeft=function(){var N=this.target.getBoundingClientRect(),B=this.editorCanvas.getBoundingClientRect();this.left=N.left-B.left-this.CANVAS_MARGIN,this.top=N.top-B.top-this.CANVAS_MARGIN},ie.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=it.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=it.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=it.createGroup(),this.editingTargetRotationScaleContainer=it.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var N=it.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(N);var B=it.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(B),this.editingTargetContainer=it.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},ie.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ie.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=it.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new at(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},ie.prototype.zoomToCrop=function(){if(this.cropRect){var N=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,B=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=N+"px "+B+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-N+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-B+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ie.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},ie.prototype.cropRectChanged=function(N){this.cropRect=N,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ie.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ie.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},ie.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ie.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var N=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,B=this.target.offsetTop>N+this.CANVAS_MARGIN?this.target.offsetTop-(N+this.CANVAS_MARGIN):0;this.coverDiv.style.top=B+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},ie.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ie.prototype.addTopToolbar=function(){var N=this;this.topToolbar=new Xt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var B=new ge;B.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(B);var ae=[];this.aspectRatios.forEach(function(an){var jn=new z(me.getIcon(an.horizontal,an.vertical),an.horizontal===0&&an.vertical===0?"FREE":an.horizontal+":"+an.vertical);jn.onClick=function(){return N.ratioButtonClicked(an)},ae.push(jn)}),this.aspectRatioButton=new Re(me.getIcon(0,0),"Aspect ratio",ae),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,B.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var fe=new z('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");fe.isActive=this.isGridVisible,fe.onClick=function(){N.isGridVisible=!N.isGridVisible,fe.isActive=N.isGridVisible},B.addButton(fe);var se=new z('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(se.isActive=this.zoomToCropEnabled,se.onClick=function(){N.zoomToCropEnabled=!N.zoomToCropEnabled,se.isActive=N.zoomToCropEnabled},B.addButton(se),!Ut.isLicensed){var $e=new Z;this.topToolbar.addElementBlock($e);var St=document.createElement("div");St.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Pt=document.createElement("a");Pt.style.color="currentColor",Pt.href="https://markerjs.com/products/cropro",Pt.target="_blank",Pt.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',St.appendChild(Pt),$e.addElement(St)}var $t=new ge;$t.minWidth=3*this.toolbarHeight+"px",$t.contentAlign="end",this.topToolbar.addButtonBlock($t);var Ot=new z('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Ot.onClick=this.startRenderAndClose,$t.addButton(Ot),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ot.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var zt=new z('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");zt.onClick=this.close,$t.addButton(zt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(zt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ie.prototype.addBottomToolbar=function(){var N=this;this.bottomToolbar=new Xt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var B=new ge;B.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(B);var ae=new z('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");ae.onClick=this.rotateLeftButtonClicked,B.addButton(ae);var fe=new z('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");fe.onClick=this.rotateRightButtonClicked,B.addButton(fe);var se=new Z;se.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(se),this.straightener=new kt("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function($t){N.rotateBy($t),N.straightener.angle=N.rotationAngle},se.addElement(this.straightener.getUI());var $e=new ge;$e.minWidth=2*this.toolbarHeight+"px",$e.contentAlign="end",this.bottomToolbar.addButtonBlock($e);var St=new z('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");St.onClick=this.flipHorizontallyButtonClicked,$e.addButton(St);var Pt=new z('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");Pt.onClick=this.flipVerticallyButtonClicked,$e.addButton(Pt)},ie.prototype.ratioButtonClicked=function(N){this.aspectRatio=N,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ie.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=me.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ie.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new oe(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ie.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ie.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ie.prototype.restoreState=function(N){if(N){var B=this.cropLayer.getRescaledRect(N.width,N.height,this.imageWidth,this.imageHeight,N.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(B),this.cropRectChanged(B),this.flippedHorizontally=N.flippedHorizontally,this.flippedVertically=N.flippedVertically,this.applyFlip(),this.rotationAngle=N.rotationAngle,this.applyRotation()}},ie.prototype.clientToLocalCoordinates=function(N,B){var ae=this.cropImage.getBoundingClientRect();return{x:N-ae.left,y:B-ae.top}},ie.prototype.onWindowResize=function(){this.positionUI()},ie.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var N=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=N+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},ie.prototype.rotateLeftButtonClicked=function(){var N=this.rotationAngle-90;this.rotationAngle%90!=0&&(N+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(N)},ie.prototype.rotateRightButtonClicked=function(){var N=this.rotationAngle+90;this.rotationAngle%90!=0&&(N-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(N)},ie.prototype.rotateTo=function(N){N=(N=N>180?N-360:N)<=-180?N+360:N,this.rotationAngle=N,this.applyRotation()},ie.prototype.rotateBy=function(N){this.rotateTo((this.rotationAngle+N)%360)},ie.prototype.applyRotation=function(){var N=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var B=this.editingTargetRotationContainer.transform.baseVal.getItem(0);B.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(B,0);var ae=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ae.width,this.imageHeight/ae.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=N},ie.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ie.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ie.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ie.prototype.startRenderAndClose=function(){return st(this,void 0,void 0,function(){var N,B;return Nt(this,function(ae){switch(ae.label){case 0:return[4,this.render()];case 1:return N=ae.sent(),B=this.getState(),this.renderEventListeners.forEach(function(fe){return fe(N,B)}),this.close(!0),[2]}})})},ie.prototype.render=function(){return st(this,void 0,void 0,function(){var N;return Nt(this,function(B){switch(B.label){case 0:return(N=new jt).naturalSize=this.renderAtNaturalSize,N.imageType=this.renderImageType,N.imageQuality=this.renderImageQuality,N.width=this.renderWidth,N.height=this.renderHeight,this.unzoomFromCrop(),it.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,N.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return B.sent(),[4,N.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,B.sent()]}})})},ie.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new At("toolbar",`
|
|
|
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
overflow: hidden;
|
|
|
line-height: 0px;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new At("toolbar_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new At("toolbar-block",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
box-sizing: content-box;
|
|
|
`));var N=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new At("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.toolbarHeight-2*N)+`px;
|
|
|
height: `+(this.toolbarHeight-2*N)+`px;
|
|
|
padding: `+N+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new At("toolbar_button_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new At("toolbar_active_button",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
|
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new At("toolbar_dropdown",`
|
|
|
position: absolute;
|
|
|
max-width: `+4*this.toolbarHeight+`px;
|
|
|
z-index: 20;
|
|
|
white-space: normal;
|
|
|
box-sizing: content-box;
|
|
|
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
|
|
|
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
|
|
|
line-height: 0px;
|
|
|
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new At("toolbar_dropdown_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new At("toolbar_straightener_block",`
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
|
justify-content: center;
|
|
|
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
|
|
|
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new At("toolbar_straightener",`
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
|
justify-content: center;
|
|
|
height: `+(this.toolbarHeight-2*N)+`px;
|
|
|
padding: `+N+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new At("toolbar_straightener_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`))},ie.instanceCounter=0,ie}(),wt=F("8hTe"),Kt=F.n(wt),Et=/<pre[^>]*>/g;function Qt(ie){var N=document.createElement("div");return N.innerHTML=ie,N.childNodes.length===0?"":N.childNodes[0].nodeValue}var Vt=Le.a=function(ie){var N=ie.value,B=N===void 0?"":N,ae=ie.edit,fe=ae===void 0?!1:ae,se=ie.className,$e=ie.showTextOnly,St=ie.showLines,Pt=ie.replaces,$t=ie.zoomImg,Ot=ie.hasMask,zt=ie.style,an=zt===void 0?{}:zt,jn=ie.stylesPrev,Dr=jn===void 0?{}:jn,Cr=String(B),Nn=Object(p.useRef)(),hr=Object(p.useRef)(),mi=Object(p.useState)(""),Or=Object(T.a)(mi,2),yr=Or[0],pr=Or[1],Yr=Object(p.useState)("office"),Mr=Object(T.a)(Yr,2),Zr=Mr[0],wr=Mr[1],vi=function(){var Sn=new ot(hr.current);Sn.displayMode="popup",Sn.addRenderEventListener(function(){var _r=Object(x.a)(f.a.mark(function zn(Lr){var rr;return f.a.wrap(function(Pr){for(;;)switch(Pr.prev=Pr.next){case 0:return Nn.current.style.display="none",Pr.next=3,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Lr}});case 3:rr=Pr.sent,rr!=null&&rr.id&&Pt(hr.current.getAttribute("src").replace(re.a.API_SERVER,""),"/api/attachments/".concat(rr==null?void 0:rr.id,"?type=").concat(rr.content_type));case 5:case"end":return Pr.stop()}},zn)}));return function(zn){return _r.apply(this,arguments)}}()),Sn.show()},li=function(){var Sn=new Pe(hr.current);Sn.settings.displayMode="popup",Sn.addEventListener("render",function(){var _r=Object(x.a)(f.a.mark(function zn(Lr){var rr;return f.a.wrap(function(Pr){for(;;)switch(Pr.prev=Pr.next){case 0:if(Nn.current.style.display="none",!hr.current){Pr.next=6;break}return Pr.next=4,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Lr.dataUrl}});case 4:rr=Pr.sent,rr!=null&&rr.id&&Pt(hr.current.getAttribute("src").replace(re.a.API_SERVER,""),"/api/attachments/".concat(rr==null?void 0:rr.id,"?type=").concat(rr.content_type));case 6:case"end":return Pr.stop()}},zn)}));return function(zn){return _r.apply(this,arguments)}}()),Sn.show(),window.markerArea=Sn},Kr=Object(p.useMemo)(function(){try{var Fn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Sn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,_r=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Cr=Cr.replace(Fn,"("+re.a.API_SERVER+"/api/attachments/").replace(Sn,'"'+re.a.API_SERVER+"/api/attachments/").replace(_r,'"'+re.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,`
|
|
|
`),Cr=Cr.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
|
`)}catch(Ri){}var zn=te(Cr),Lr=O();if(Cr.match(/\[TOC\]/)&&(zn=zn.replace("<p>[TOC]</p>",E()),m()),zn=zn.replace(/(__special_katext_id_\d+__)/g,function(Ri,Pr){var ni=Lr[Pr],ji=ni.type,ui=ni.expression;return Object($.renderToString)(Qt(ui)||"",{displayMode:ji==="block",throwOnError:!1,output:"html"})}),zn=zn.replace(/▁/g,"\u2581\u2581\u2581"),A(),$e){var rr=document.createElement("div");return rr.innerHTML=zn,rr.innerText}return setTimeout(function(){return gi()},500),zn},[Cr]),zr=Object(p.useRef)();v.WebkitLineClamp=St,St&&(an=Object(D.a)(Object(D.a)({},an),v));function xi(Fn){var Sn=Fn.target;if(Sn.tagName.toUpperCase()==="IMG"){if($t){var _r=Sn.getAttribute("src");pr(_r),wr("image")}}else if(Sn.tagName.toUpperCase()==="A"){var zn=Sn.getAttribute("href");if(zn.indexOf("office")>-1)Fn.preventDefault(),pr(zn),wr("office");else if(zn.indexOf("application/pdf")>-1)Fn.preventDefault(),pr(zn),wr("pdf");else if(zn.indexOf("type=text")>-1)Fn.preventDefault(),pr(zn),wr("html");else if(zn.startsWith("#")){Fn.preventDefault();var Lr=document.getElementById(zn.replace("#",""));Lr&&Lr.scrollIntoView(!0)}}}var gi=function(){var Sn,_r=(Sn=zr.current)===null||Sn===void 0?void 0:Sn.querySelectorAll("video");_r==null||_r.forEach(function(zn){if(zn.oncontextmenu=function(){return!1},zn.src.indexOf(".m3u8")>-1&&!zn.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var Lr=new V.a;Lr.loadSource(zn.src),Lr.attachMedia(zn)}}})};Object(p.useEffect)(function(){if(zr.current&&Kr&&(Kr.match(Et)&&window.PR.prettyPrint()),zr.current)return zr.current.addEventListener("click",xi),function(){zr.current.removeEventListener("click",xi),A(),m()}},[Kr,zr.current,xi]);var Si=function(Sn){if(!fe)return;Sn.target.nodeName==="IMG"?(Nn.current.style.display="flex",Nn.current.style.width=Sn.target.clientWidth+"px",Nn.current.style.height=Sn.target.clientHeight+"px",Nn.current.style.top=Sn.target.offsetTop+"px",Nn.current.style.left=Sn.target.offsetLeft+"px",hr.current.src=Sn.target.getAttribute("src")):Nn.current.style.display="none"};return u.a.createElement("div",{style:{position:"relative"}},u.a.createElement("div",{ref:zr,style:Object(D.a)({},an),className:"".concat(se||""," markdown-body ").concat(Kt.a.mdBody),onMouseOver:Si,dangerouslySetInnerHTML:{__html:Kr}}),u.a.createElement("div",{ref:Nn,className:Kt.a.button},u.a.createElement(Q.a,null,u.a.createElement(S.a,{onClick:function(){return vi()}},"\u88C1\u526A"),u.a.createElement(S.a,{onClick:function(){return li()}},"\u7F16\u8F91"))),u.a.createElement("img",{ref:hr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),u.a.createElement(ne.a,{close:!0,data:yr,hasMask:Ot,type:yr!=null&&yr.length?Zr:"",style:Object(D.a)({},Dr),onClose:function(){return pr("")}}))}},"9VGf":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return j});var ue=F("q1tI"),Q=F.n(ue);function j(S,D){var x=Object(ue.useRef)();Object(ue.useEffect)(function(){x.current=S}),Object(ue.useEffect)(function(){function T(){x.current()}if(D!==null){var w=setInterval(T,D);return function(){return clearInterval(w)}}},[D])}},AMnG:function(nt,Le,F){"use strict";var ue=F("miYZ"),Q=F("tsqr"),j=F("tJVT"),S=F("q1tI"),D=F.n(S),x=F("nWbc"),T=F.n(x),w=F("Ot1p");Le.a=function(f){var p=f.id,u=f.activeDiscussIndex,o=f.onReplyDiscuss,i=Object(S.useState)(""),l=Object(j.a)(i,2),s=l[0],h=l[1];function r(n){h(n)}function t(){if(!s){Q.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}o(p,s),h("")}return D.a.createElement("div",{key:p,className:"discuss-item-editor",style:{display:u===p?"block":"none",width:"100%"}},D.a.createElement(w.a,{miniToolbar:!0,startInit:u===p,defaultValue:s,id:p,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:r}),D.a.createElement("a",{onClick:t,className:"btn-send"},"\u53D1\u9001"))}},Aky1:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return f});var ue=F("ErOA"),Q=F("ppsT"),j=F.n(Q),S="",D,x="";function T(p){w(p)}function w(p){D=new j.a.Vod({timeout:6e4,partSize:1048576,parallel:5,retryCount:3,retryDuration:2,region:"ap-southeast-1",userId:1829848226361863,enableUploadProgress:!1,addFileSuccess:function(o){console.log("addFileSuccess: "+o.file.name),p.addFileSuccess&&p.addFileSuccess(o),D.startUpload()},onUploadstarted:function(o){var i=o.file.name;if(o.videoId){var h="/api/users/".concat(S,"/video_auths.json");Object(ue.a)(h,{method:"put",body:{video_id:o.videoId,title:i,file_name:i,virtual_classroom_id:x}}).then(function(r){if(r.status==-1){p.onUploadError&&p.onUploadError(o);return}var t=r.data,n=t.UploadAuth,c=t.UploadAddress,m=t.VideoId;D.setUploadAuthAndAddress(o,n,c)}).catch(function(r){D.deleteFile(D._curIndex),D.nextUpload(),console.log(r)})}else{var l="/api/users/".concat(S,"/video_auths.json"),s="";Object(ue.a)(l,{method:"Post",body:{title:s+i,file_name:s+i,virtual_classroom_id:x}}).then(function(r){if(r){var t=r.data,n=t.UploadAuth,c=t.UploadAddress,m=t.VideoId;D.setUploadAuthAndAddress(o,n,c,m)}}).catch(function(r){D.deleteFile(D._curIndex),D.nextUpload(),console.log(r)}),console.log("\u6587\u4EF6\u5F00\u59CB\u4E0A\u4F20...")}},onUploadSucceed:function(o){p.onUploadSucceed&&p.onUploadSucceed(o),console.log("\u6587\u4EF6\u4E0A\u4F20\u6210\u529F!")},onUploadFailed:function(o,i,l){p.onUploadFailed&&p.onUploadFailed(o),console.log("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25!")},onUploadCanceled:function(o,i,l){console.log("\u6587\u4EF6\u4E0A\u4F20\u5DF2\u6682\u505C!")},onUploadProgress:function(o,i,l){p.onUploadProgress&&p.onUploadProgress(o,i,l);var s=Math.ceil(l*100);console.log("\u6587\u4EF6\u4E0A\u4F20\u4E2D...")},onUploadTokenExpired:function(o){console.log("\u6587\u4EF6\u4E0A\u4F20\u8D85\u65F6!");var i="/api/users/".concat(S,"/video_auths.json");Object(ue.a)(i,{method:"put",body:{video_id:o.videoId}}).then(function(l){var s=l.data,h=s.UploadAuth;D.resumeUploadWithAuth(h)}).catch(function(l){console.log(l)})},onUploadEnd:function(o){p.onUploadEnd&&p.onUploadEnd(o),console.log("onUploadEnd: uploaded all the files")}}),p.gotUploader&&p.gotUploader(D)}function f(p,u,o){p&&(S=p),u&&(x=u),T(o)}},BU3w:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return x});var ue=F("MNnm"),Q="rc-util-key";function j(T){if(T.attachTo)return T.attachTo;var w=document.querySelector("head");return w||document.body}function S(T){var w,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ue.a)())return null;var p=document.createElement("style");if((w=f.csp)===null||w===void 0?void 0:w.nonce){var u;p.nonce=(u=f.csp)===null||u===void 0?void 0:u.nonce}p.innerHTML=T;var o=j(f),i=o.firstChild;return f.prepend&&o.prepend?o.prepend(p):f.prepend&&i?o.insertBefore(p,i):o.appendChild(p),p}var D=new Map;function x(T,w){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=j(f);if(!D.has(p)){var u=S("",f),o=u.parentNode;D.set(p,o),o.removeChild(u)}var i=Array.from(D.get(p).children).find(function(t){return t.tagName==="STYLE"&&t[Q]===w});if(i){var l,s;if(((l=f.csp)===null||l===void 0?void 0:l.nonce)&&i.nonce!==((s=f.csp)===null||s===void 0?void 0:s.nonce)){var h;i.nonce=(h=f.csp)===null||h===void 0?void 0:h.nonce}return i.innerHTML!==T&&(i.innerHTML=T),i}var r=S(T,f);return r[Q]=w,r}},Bd2K:function(nt,Le,F){(function(ue){ue(F("VrN/"),F("osHv"))})(function(ue){ue.defineOption("autoCloseTags",!1,function(f,p,u){if(u!=ue.Init&&u&&f.removeKeyMap("autoCloseTags"),!p)return;var o={name:"autoCloseTags"};(typeof p!="object"||p.whenClosing!==!1)&&(o["'/'"]=function(i){return x(i)}),(typeof p!="object"||p.whenOpening!==!1)&&(o["'>'"]=function(i){return S(i)}),f.addKeyMap(o)});var Q=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],j=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function S(f){if(f.getOption("disableInput"))return ue.Pass;for(var p=f.listSelections(),u=[],o=f.getOption("autoCloseTags"),i=0;i<p.length;i++){if(!p[i].empty())return ue.Pass;var l=p[i].head,s=f.getTokenAt(l),h=ue.innerMode(f.getMode(),s.state),r=h.state,t=h.mode.xmlCurrentTag&&h.mode.xmlCurrentTag(r),n=t&&t.name;if(!n)return ue.Pass;var c=h.mode.configuration=="html",m=typeof o=="object"&&o.dontCloseTags||c&&Q,v=typeof o=="object"&&o.indentTags||c&&j;s.end>l.ch&&(n=n.slice(0,n.length-s.end+l.ch));var b=n.toLowerCase();if(!n||s.type=="string"&&(s.end!=l.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&t.close||s.string.indexOf("/")==l.ch-s.start-1||m&&T(m,b)>-1||w(f,h.mode.xmlCurrentContext&&h.mode.xmlCurrentContext(r)||[],n,l,!0))return ue.Pass;var E=typeof o=="object"&&o.emptyTags;if(E&&T(E,n)>-1){u[i]={text:"/>",newPos:ue.Pos(l.line,l.ch+2)};continue}var g=v&&T(v,b)>-1;u[i]={indent:g,text:">"+(g?`
|
|
|
|
|
|
`:"")+"</"+n+">",newPos:g?ue.Pos(l.line+1,0):ue.Pos(l.line,l.ch+1)}}for(var y=typeof o=="object"&&o.dontIndentOnAutoClose,i=p.length-1;i>=0;i--){var C=u[i];f.replaceRange(C.text,p[i].head,p[i].anchor,"+insert");var d=f.listSelections().slice(0);d[i]={head:C.newPos,anchor:C.newPos},f.setSelections(d),!y&&C.indent&&(f.indentLine(C.newPos.line,null,!0),f.indentLine(C.newPos.line+1,null,!0))}}function D(f,p){for(var u=f.listSelections(),o=[],i=p?"/":"</",l=f.getOption("autoCloseTags"),s=typeof l=="object"&&l.dontIndentOnSlash,h=0;h<u.length;h++){if(!u[h].empty())return ue.Pass;var r=u[h].head,t=f.getTokenAt(r),n=ue.innerMode(f.getMode(),t.state),c=n.state;if(p&&(t.type=="string"||t.string.charAt(0)!="<"||t.start!=r.ch-1))return ue.Pass;var m,v=n.mode.name!="xml"&&f.getMode().name=="htmlmixed";if(v&&n.mode.name=="javascript")m=i+"script";else if(v&&n.mode.name=="css")m=i+"style";else{var b=n.mode.xmlCurrentContext&&n.mode.xmlCurrentContext(c);if(!b||b.length&&w(f,b,b[b.length-1],r))return ue.Pass;m=i+b[b.length-1]}f.getLine(r.line).charAt(t.end)!=">"&&(m+=">"),o[h]=m}if(f.replaceSelections(o),u=f.listSelections(),!s)for(var h=0;h<u.length;h++)(h==u.length-1||u[h].head.line<u[h+1].head.line)&&f.indentLine(u[h].head.line)}function x(f){return f.getOption("disableInput")?ue.Pass:D(f,!0)}ue.commands.closeTag=function(f){return D(f)};function T(f,p){if(f.indexOf)return f.indexOf(p);for(var u=0,o=f.length;u<o;++u)if(f[u]==p)return u;return-1}function w(f,p,u,o,i){if(!ue.scanForClosingTag)return!1;var l=Math.min(f.lastLine()+1,o.line+500),s=ue.scanForClosingTag(f,o,null,l);if(!s||s.tag!=u)return!1;for(var h=i?1:0,r=p.length-1;r>=0&&p[r]==u;r--)++h;o=s.to;for(var r=1;r<h;r++){var t=ue.scanForClosingTag(f,o,null,l);if(!t||t.tag!=u)return!1;o=t.to}return!0}})},BdwD:function(nt,Le,F){"use strict";var ue=F("+L6B"),Q=F("2/Rp"),j=F("0Owb"),S=F("k1fw"),D=F("q1tI"),x=F.n(D),T=F("FOrL"),w=F.n(T),f=function(u){var o=u.buttonProps,i=o===void 0?{}:o,l=u.styles,s=l===void 0?{}:l,h=u.customText,r=u.ButtonText,t=u.ButtonClick,n=u.Buttonclass,c=u.ButtonTwo;return x.a.createElement("section",{className:"tc animated fadeIn",style:Object(S.a)(Object(S.a)({},{color:"#999",margin:"200px auto"}),s)},x.a.createElement("img",{src:w.a}),x.a.createElement("p",{className:"mt20 font14"},h||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),r&&x.a.createElement(Q.a,Object(j.a)({className:n,onClick:t},i),r),c&&c)};Le.a=f},BjJ7:function(nt,Le,F){"use strict";F.d(Le,"d",function(){return Q}),F.d(Le,"c",function(){return j}),F.d(Le,"e",function(){return S}),F.d(Le,"b",function(){return D}),F.d(Le,"a",function(){return T});var ue=F("m3rI");function Q(w){var f=!0;if(w.length>0){for(var p=0;p<w.length;p++)if(w[p].compile_success==0||!w[p].compile_success){f=!1;break}}else f=!1;return f}function j(w){for(var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",p=[],u=0;u<w.length;u++){var o=w[u],i=f?"".concat(f,"/").concat(o.name):"".concat(o.name);p.push({title:o.name,isLeaf:!(o.type==="tree"),key:i})}return p}function S(w,f,p){for(var u=0;u<w.length;u++){var o=w[u];if(o.key===f){o.children=p;break}o.children&&S(o.children,f,p)}return w}function D(w,f,p){var u;return function(){var o=this,i=arguments,l=function(){u=null,p||w.apply(o,i)},s=p&&!u;clearTimeout(u),u=setTimeout(l,f),s&&w.apply(o,i)}}var x=!0,T=ue.a.API_SERVER},"C+DQ":function(nt,Le,F){},"C/vA":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return ue});function ue(Q){var j=this,S=!1,D;return function(){return S||(S=!0,D=Q.apply(j,arguments)),D}}},CNDd:function(nt,Le,F){nt.exports=F.p+"static/c1.7850f139.svg"},CaVn:function(nt,Le,F){nt.exports={flex_box_center:"flex_box_center___2wZ0h",flex_space_between:"flex_space_between___3MVWH",flex_box_vertical_center:"flex_box_vertical_center___O0jNB",flex_box_center_end:"flex_box_center_end___2q4xj",flex_box_column:"flex_box_column___13R-8",listDetails:"listDetails___3lMam",head:"head___2jzWe",name:"name___3xIfG",title:"title___3-ce8",a:"a___1ZME1",b:"b___oiiqU",tag:"tag___32Ulf",btn:"btn___lJ5fA",scroll:"scroll___anvih",video:"video___1gujl",html:"html___z0BU7",g:"g___3sfQf",btns:"btns___OWbut"}},"Cg/j":function(nt,Le,F){"use strict";F.d(Le,"b",function(){return ue}),F.d(Le,"a",function(){return Q}),F.d(Le,"c",function(){return S}),F.d(Le,"d",function(){return D});var ue;(function(x){x.serviceIds=new Map,x.DI_TARGET="$di$target",x.DI_DEPENDENCIES="$di$dependencies";function T(w){return w[x.DI_DEPENDENCIES]||[]}x.getServiceDependencies=T})(ue||(ue={}));var Q=S("instantiationService");function j(x,T,w,f){T[ue.DI_TARGET]===T?T[ue.DI_DEPENDENCIES].push({id:x,index:w,optional:f}):(T[ue.DI_DEPENDENCIES]=[{id:x,index:w,optional:f}],T[ue.DI_TARGET]=T)}function S(x){if(ue.serviceIds.has(x))return ue.serviceIds.get(x);var T=function(w,f,p){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");j(T,w,p,!1)};return T.toString=function(){return x},ue.serviceIds.set(x,T),T}function D(x){return function(T,w,f){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");j(x,T,f,!0)}}},CrYA:function(nt,Le,F){var ue=F("MFOe"),Q=ue.Global;nt.exports={name:"sessionStorage",read:S,write:D,each:x,remove:T,clearAll:w};function j(){return Q.sessionStorage}function S(f){return j().getItem(f)}function D(f,p){return j().setItem(f,p)}function x(f){for(var p=j().length-1;p>=0;p--){var u=j().key(p);f(S(u),u)}}function T(f){return j().removeItem(f)}function w(){return j().clear()}},DlQD:function(nt,Le,F){(function(ue,Q){nt.exports=Q()})(this,function(){"use strict";function ue(Ke,Fe){for(var Ue=0;Ue<Fe.length;Ue++){var _e=Fe[Ue];_e.enumerable=_e.enumerable||!1,_e.configurable=!0,"value"in _e&&(_e.writable=!0),Object.defineProperty(Ke,_e.key,_e)}}function Q(Ke,Fe,Ue){return Fe&&ue(Ke.prototype,Fe),Ue&&ue(Ke,Ue),Ke}function j(Ke,Fe){if(!Ke)return;if(typeof Ke=="string")return S(Ke,Fe);var Ue=Object.prototype.toString.call(Ke).slice(8,-1);if(Ue==="Object"&&Ke.constructor&&(Ue=Ke.constructor.name),Ue==="Map"||Ue==="Set")return Array.from(Ke);if(Ue==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ue))return S(Ke,Fe)}function S(Ke,Fe){(Fe==null||Fe>Ke.length)&&(Fe=Ke.length);for(var Ue=0,_e=new Array(Fe);Ue<Fe;Ue++)_e[Ue]=Ke[Ue];return _e}function D(Ke,Fe){var Ue;if(typeof Symbol=="undefined"||Ke[Symbol.iterator]==null){if(Array.isArray(Ke)||(Ue=j(Ke))||Fe&&Ke&&typeof Ke.length=="number"){Ue&&(Ke=Ue);var _e=0;return function(){return _e>=Ke.length?{done:!0}:{done:!1,value:Ke[_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.`)}return Ue=Ke[Symbol.iterator](),Ue.next.bind(Ue)}function x(Ke,Fe){return Fe={exports:{}},Ke(Fe,Fe.exports),Fe.exports}var T=x(function(Ke){function Fe(){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 Ue(_e){Ke.exports.defaults=_e}Ke.exports={defaults:Fe(),getDefaults:Fe,changeDefaults:Ue}}),w=T.defaults,f=T.getDefaults,p=T.changeDefaults,u=/[&<>"']/,o=/[&<>"']/g,i=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(Fe){return s[Fe]};function r(Ke,Fe){if(Fe){if(u.test(Ke))return Ke.replace(o,h)}else if(i.test(Ke))return Ke.replace(l,h);return Ke}var t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function n(Ke){return Ke.replace(t,function(Fe,Ue){return Ue=Ue.toLowerCase(),Ue==="colon"?":":Ue.charAt(0)==="#"?Ue.charAt(1)==="x"?String.fromCharCode(parseInt(Ue.substring(2),16)):String.fromCharCode(+Ue.substring(1)):""})}var c=/(^|[^\[])\^/g;function m(Ke,Fe){Ke=Ke.source||Ke,Fe=Fe||"";var Ue={replace:function(Ce,Ne){return Ne=Ne.source||Ne,Ne=Ne.replace(c,"$1"),Ke=Ke.replace(Ce,Ne),Ue},getRegex:function(){return new RegExp(Ke,Fe)}};return Ue}var v=/[^\w:]/g,b=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(Ke,Fe,Ue){if(Ke){var _e;try{_e=decodeURIComponent(n(Ue)).replace(v,"").toLowerCase()}catch(Ce){return null}if(_e.indexOf("javascript:")===0||_e.indexOf("vbscript:")===0||_e.indexOf("data:")===0)return null}Fe&&!b.test(Ue)&&(Ue=_(Fe,Ue));try{Ue=encodeURI(Ue).replace(/%25/g,"%")}catch(Ce){return null}return Ue}var g={},y=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(Ke,Fe){g[" "+Ke]||(y.test(Ke)?g[" "+Ke]=Ke+"/":g[" "+Ke]=I(Ke,"/",!0)),Ke=g[" "+Ke];var Ue=Ke.indexOf(":")===-1;return Fe.substring(0,2)==="//"?Ue?Fe:Ke.replace(C,"$1")+Fe:Fe.charAt(0)==="/"?Ue?Fe:Ke.replace(d,"$1")+Fe:Ke+Fe}var O={exec:function(){}};function A(Ke){for(var Fe=1,Ue,_e;Fe<arguments.length;Fe++){Ue=arguments[Fe];for(_e in Ue)Object.prototype.hasOwnProperty.call(Ue,_e)&&(Ke[_e]=Ue[_e])}return Ke}function P(Ke,Fe){var Ue=Ke.replace(/\|/g,function(Ne,De,rt){for(var tt=!1,xt=De;--xt>=0&&rt[xt]==="\\";)tt=!tt;return tt?"|":" |"}),_e=Ue.split(/ \|/),Ce=0;if(_e.length>Fe)_e.splice(Fe);else for(;_e.length<Fe;)_e.push("");for(;Ce<_e.length;Ce++)_e[Ce]=_e[Ce].trim().replace(/\\\|/g,"|");return _e}function I(Ke,Fe,Ue){var _e=Ke.length;if(_e===0)return"";for(var Ce=0;Ce<_e;){var Ne=Ke.charAt(_e-Ce-1);if(Ne===Fe&&!Ue)Ce++;else if(Ne!==Fe&&Ue)Ce++;else break}return Ke.substr(0,_e-Ce)}function W(Ke,Fe){if(Ke.indexOf(Fe[1])===-1)return-1;for(var Ue=Ke.length,_e=0,Ce=0;Ce<Ue;Ce++)if(Ke[Ce]==="\\")Ce++;else if(Ke[Ce]===Fe[0])_e++;else if(Ke[Ce]===Fe[1]&&(_e--,_e<0))return Ce;return-1}function K(Ke){Ke&&Ke.sanitize&&!Ke.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 te={escape:r,unescape:n,edit:m,cleanUrl:E,resolveUrl:_,noopTest:O,merge:A,splitCells:P,rtrim:I,findClosingBracket:W,checkSanitizeDeprecation:K},H=T.defaults,G=te.rtrim,V=te.splitCells,re=te.escape,$=te.findClosingBracket;function ne(Ke,Fe,Ue){var _e=Fe.href,Ce=Fe.title?re(Fe.title):null,Ne=Ke[1].replace(/\\([\[\]])/g,"$1");return Ke[0].charAt(0)!=="!"?{type:"link",raw:Ue,href:_e,title:Ce,text:Ne}:{type:"image",raw:Ue,href:_e,title:Ce,text:re(Ne)}}function he(Ke,Fe){var Ue=Ke.match(/^(\s+)(?:```)/);if(Ue===null)return Fe;var _e=Ue[1];return Fe.split(`
|
|
|
`).map(function(Ce){var Ne=Ce.match(/^\s+/);if(Ne===null)return Ce;var De=Ne[0];return De.length>=_e.length?Ce.slice(_e.length):Ce}).join(`
|
|
|
`)}var pe=function(){function Ke(Ue){this.options=Ue||H}var Fe=Ke.prototype;return Fe.space=function(_e){var Ce=this.rules.block.newline.exec(_e);if(Ce)return Ce[0].length>1?{type:"space",raw:Ce[0]}:{raw:`
|
|
|
`}},Fe.code=function(_e,Ce){var Ne=this.rules.block.code.exec(_e);if(Ne){var De=Ce[Ce.length-1];if(De&&De.type==="paragraph")return{raw:Ne[0],text:Ne[0].trimRight()};var rt=Ne[0].replace(/^ {4}/gm,"");return{type:"code",raw:Ne[0],codeBlockStyle:"indented",text:this.options.pedantic?rt:G(rt,`
|
|
|
`)}}},Fe.fences=function(_e){var Ce=this.rules.block.fences.exec(_e);if(Ce){var Ne=Ce[0],De=he(Ne,Ce[3]||"");return{type:"code",raw:Ne,lang:Ce[2]?Ce[2].trim():Ce[2],text:De}}},Fe.heading=function(_e){var Ce=this.rules.block.heading.exec(_e);if(Ce)return{type:"heading",raw:Ce[0],depth:Ce[1].length,text:Ce[2]}},Fe.nptable=function(_e){var Ce=this.rules.block.nptable.exec(_e);if(Ce){var Ne={type:"table",header:V(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:Ce[0]};if(Ne.header.length===Ne.align.length){var De=Ne.align.length,rt;for(rt=0;rt<De;rt++)/^ *-+: *$/.test(Ne.align[rt])?Ne.align[rt]="right":/^ *:-+: *$/.test(Ne.align[rt])?Ne.align[rt]="center":/^ *:-+ *$/.test(Ne.align[rt])?Ne.align[rt]="left":Ne.align[rt]=null;for(De=Ne.cells.length,rt=0;rt<De;rt++)Ne.cells[rt]=V(Ne.cells[rt],Ne.header.length);return Ne}}},Fe.hr=function(_e){var Ce=this.rules.block.hr.exec(_e);if(Ce)return{type:"hr",raw:Ce[0]}},Fe.blockquote=function(_e){var Ce=this.rules.block.blockquote.exec(_e);if(Ce){var Ne=Ce[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Ce[0],text:Ne}}},Fe.list=function(_e){var Ce=this.rules.block.list.exec(_e);if(Ce){for(var Ne=Ce[0],De=Ce[2],rt=De.length>1,tt=De[De.length-1]===")",xt={type:"list",raw:Ne,ordered:rt,start:rt?+De.slice(0,-1):"",loose:!1,items:[]},Mt=Ce[0].match(this.rules.block.item),Bt=!1,It,Dt,lt,pt,ut,Pe,Ve,yt=Mt.length,st=0;st<yt;st++)It=Mt[st],Ne=It,Dt=It.length,It=It.replace(/^ *([*+-]|\d+[.)]) */,""),~It.indexOf(`
|
|
|
`)&&(Dt-=It.length,It=this.options.pedantic?It.replace(/^ {1,4}/gm,""):It.replace(new RegExp("^ {1,"+Dt+"}","gm"),"")),st!==yt-1&&(lt=this.rules.block.bullet.exec(Mt[st+1])[0],(rt?lt.length===1||!tt&<[lt.length-1]===")":lt.length>1||this.options.smartLists&<!==De)&&(pt=Mt.slice(st+1).join(`
|
|
|
`),xt.raw=xt.raw.substring(0,xt.raw.length-pt.length),st=yt-1)),ut=Bt||/\n\n(?!\s*$)/.test(It),st!==yt-1&&(Bt=It.charAt(It.length-1)===`
|
|
|
`,ut||(ut=Bt)),ut&&(xt.loose=!0),Pe=/^\[[ xX]\] /.test(It),Ve=void 0,Pe&&(Ve=It[1]!==" ",It=It.replace(/^\[[ xX]\] +/,"")),xt.items.push({type:"list_item",raw:Ne,task:Pe,checked:Ve,loose:ut,text:It});return xt}},Fe.html=function(_e){var Ce=this.rules.block.html.exec(_e);if(Ce)return{type:this.options.sanitize?"paragraph":"html",raw:Ce[0],pre:!this.options.sanitizer&&(Ce[1]==="pre"||Ce[1]==="script"||Ce[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ce[0]):re(Ce[0]):Ce[0]}},Fe.def=function(_e){var Ce=this.rules.block.def.exec(_e);if(Ce){Ce[3]&&(Ce[3]=Ce[3].substring(1,Ce[3].length-1));var Ne=Ce[1].toLowerCase().replace(/\s+/g," ");return{tag:Ne,raw:Ce[0],href:Ce[2],title:Ce[3]}}},Fe.table=function(_e){var Ce=this.rules.block.table.exec(_e);if(Ce){var Ne={type:"table",header:V(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(Ne.header.length===Ne.align.length){Ne.raw=Ce[0];var De=Ne.align.length,rt;for(rt=0;rt<De;rt++)/^ *-+: *$/.test(Ne.align[rt])?Ne.align[rt]="right":/^ *:-+: *$/.test(Ne.align[rt])?Ne.align[rt]="center":/^ *:-+ *$/.test(Ne.align[rt])?Ne.align[rt]="left":Ne.align[rt]=null;for(De=Ne.cells.length,rt=0;rt<De;rt++)Ne.cells[rt]=V(Ne.cells[rt].replace(/^ *\| *| *\| *$/g,""),Ne.header.length);return Ne}}},Fe.lheading=function(_e){var Ce=this.rules.block.lheading.exec(_e);if(Ce)return{type:"heading",raw:Ce[0],depth:Ce[2].charAt(0)==="="?1:2,text:Ce[1]}},Fe.paragraph=function(_e){var Ce=this.rules.block.paragraph.exec(_e);if(Ce)return{type:"paragraph",raw:Ce[0],text:Ce[1].charAt(Ce[1].length-1)===`
|
|
|
`?Ce[1].slice(0,-1):Ce[1]}},Fe.text=function(_e,Ce){var Ne=this.rules.block.text.exec(_e);if(Ne){var De=Ce[Ce.length-1];return De&&De.type==="text"?{raw:Ne[0],text:Ne[0]}:{type:"text",raw:Ne[0],text:Ne[0]}}},Fe.escape=function(_e){var Ce=this.rules.inline.escape.exec(_e);if(Ce)return{type:"escape",raw:Ce[0],text:re(Ce[1])}},Fe.tag=function(_e,Ce,Ne){var De=this.rules.inline.tag.exec(_e);if(De)return!Ce&&/^<a /i.test(De[0])?Ce=!0:Ce&&/^<\/a>/i.test(De[0])&&(Ce=!1),!Ne&&/^<(pre|code|kbd|script)(\s|>)/i.test(De[0])?Ne=!0:Ne&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(De[0])&&(Ne=!1),{type:this.options.sanitize?"text":"html",raw:De[0],inLink:Ce,inRawBlock:Ne,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(De[0]):re(De[0]):De[0]}},Fe.link=function(_e){var Ce=this.rules.inline.link.exec(_e);if(Ce){var Ne=$(Ce[2],"()");if(Ne>-1){var De=Ce[0].indexOf("!")===0?5:4,rt=De+Ce[1].length+Ne;Ce[2]=Ce[2].substring(0,Ne),Ce[0]=Ce[0].substring(0,rt).trim(),Ce[3]=""}var tt=Ce[2],xt="";if(this.options.pedantic){var Mt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(tt);Mt?(tt=Mt[1],xt=Mt[3]):xt=""}else xt=Ce[3]?Ce[3].slice(1,-1):"";tt=tt.trim().replace(/^<([\s\S]*)>$/,"$1");var Bt=ne(Ce,{href:tt&&tt.replace(this.rules.inline._escapes,"$1"),title:xt&&xt.replace(this.rules.inline._escapes,"$1")},Ce[0]);return Bt}},Fe.reflink=function(_e,Ce){var Ne;if((Ne=this.rules.inline.reflink.exec(_e))||(Ne=this.rules.inline.nolink.exec(_e))){var De=(Ne[2]||Ne[1]).replace(/\s+/g," ");if(De=Ce[De.toLowerCase()],!De||!De.href){var rt=Ne[0].charAt(0);return{type:"text",raw:rt,text:rt}}var tt=ne(Ne,De,Ne[0]);return tt}},Fe.strong=function(_e,Ce,Ne){Ne===void 0&&(Ne="");var De=this.rules.inline.strong.start.exec(_e);if(De&&(!De[1]||De[1]&&(Ne===""||this.rules.inline.punctuation.exec(Ne)))){Ce=Ce.slice(-1*_e.length);var rt=De[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;rt.lastIndex=0;for(var tt;(De=rt.exec(Ce))!=null;)if(tt=this.rules.inline.strong.middle.exec(Ce.slice(0,De.index+3)),tt)return{type:"strong",raw:_e.slice(0,tt[0].length),text:_e.slice(2,tt[0].length-2)}}},Fe.em=function(_e,Ce,Ne){Ne===void 0&&(Ne="");var De=this.rules.inline.em.start.exec(_e);if(De&&(!De[1]||De[1]&&(Ne===""||this.rules.inline.punctuation.exec(Ne)))){Ce=Ce.slice(-1*_e.length);var rt=De[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;rt.lastIndex=0;for(var tt;(De=rt.exec(Ce))!=null;)if(tt=this.rules.inline.em.middle.exec(Ce.slice(0,De.index+2)),tt)return{type:"em",raw:_e.slice(0,tt[0].length),text:_e.slice(1,tt[0].length-1)}}},Fe.codespan=function(_e){var Ce=this.rules.inline.code.exec(_e);if(Ce){var Ne=Ce[2].replace(/\n/g," "),De=/[^ ]/.test(Ne),rt=Ne.startsWith(" ")&&Ne.endsWith(" ");return De&&rt&&(Ne=Ne.substring(1,Ne.length-1)),Ne=re(Ne,!0),{type:"codespan",raw:Ce[0],text:Ne}}},Fe.br=function(_e){var Ce=this.rules.inline.br.exec(_e);if(Ce)return{type:"br",raw:Ce[0]}},Fe.del=function(_e){var Ce=this.rules.inline.del.exec(_e);if(Ce)return{type:"del",raw:Ce[0],text:Ce[1]}},Fe.autolink=function(_e,Ce){var Ne=this.rules.inline.autolink.exec(_e);if(Ne){var De,rt;return Ne[2]==="@"?(De=re(this.options.mangle?Ce(Ne[1]):Ne[1]),rt="mailto:"+De):(De=re(Ne[1]),rt=De),{type:"link",raw:Ne[0],text:De,href:rt,tokens:[{type:"text",raw:De,text:De}]}}},Fe.url=function(_e,Ce){var Ne;if(Ne=this.rules.inline.url.exec(_e)){var De,rt;if(Ne[2]==="@")De=re(this.options.mangle?Ce(Ne[0]):Ne[0]),rt="mailto:"+De;else{var tt;do tt=Ne[0],Ne[0]=this.rules.inline._backpedal.exec(Ne[0])[0];while(tt!==Ne[0]);De=re(Ne[0]),Ne[1]==="www."?rt="http://"+De:rt=De}return{type:"link",raw:Ne[0],text:De,href:rt,tokens:[{type:"text",raw:De,text:De}]}}},Fe.inlineText=function(_e,Ce,Ne){var De=this.rules.inline.text.exec(_e);if(De){var rt;return Ce?rt=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(De[0]):re(De[0]):De[0]:rt=re(this.options.smartypants?Ne(De[0]):De[0]),{type:"text",raw:De[0],text:rt}}},Ke}(),Te=te.noopTest,we=te.edit,Me=te.merge,Ee={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:Te,table:Te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Ee._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Ee._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ee.def=we(Ee.def).replace("label",Ee._label).replace("title",Ee._title).getRegex(),Ee.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ee.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Ee.item=we(Ee.item,"gm").replace(/bull/g,Ee.bullet).getRegex(),Ee.list=we(Ee.list).replace(/bull/g,Ee.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ee.def.source+")").getRegex(),Ee._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",Ee._comment=/<!--(?!-?>)[\s\S]*?-->/,Ee.html=we(Ee.html,"i").replace("comment",Ee._comment).replace("tag",Ee._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ee.paragraph=we(Ee._paragraph).replace("hr",Ee.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",Ee._tag).getRegex(),Ee.blockquote=we(Ee.blockquote).replace("paragraph",Ee.paragraph).getRegex(),Ee.normal=Me({},Ee),Ee.gfm=Me({},Ee.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*|$)"}),Ee.gfm.nptable=we(Ee.gfm.nptable).replace("hr",Ee.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",Ee._tag).getRegex(),Ee.gfm.table=we(Ee.gfm.table).replace("hr",Ee.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",Ee._tag).getRegex(),Ee.pedantic=Me({},Ee.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ee._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:Te,paragraph:we(Ee.normal._paragraph).replace("hr",Ee.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",Ee.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var xe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Te,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:Te,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};xe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",xe.punctuation=we(xe.punctuation).replace(/punctuation/g,xe._punctuation).getRegex(),xe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",xe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",xe.em.start=we(xe.em.start).replace(/punctuation/g,xe._punctuation).getRegex(),xe.em.middle=we(xe.em.middle).replace(/punctuation/g,xe._punctuation).replace(/overlapSkip/g,xe._overlapSkip).getRegex(),xe.em.endAst=we(xe.em.endAst,"g").replace(/punctuation/g,xe._punctuation).getRegex(),xe.em.endUnd=we(xe.em.endUnd,"g").replace(/punctuation/g,xe._punctuation).getRegex(),xe.strong.start=we(xe.strong.start).replace(/punctuation/g,xe._punctuation).getRegex(),xe.strong.middle=we(xe.strong.middle).replace(/punctuation/g,xe._punctuation).replace(/blockSkip/g,xe._blockSkip).getRegex(),xe.strong.endAst=we(xe.strong.endAst,"g").replace(/punctuation/g,xe._punctuation).getRegex(),xe.strong.endUnd=we(xe.strong.endUnd,"g").replace(/punctuation/g,xe._punctuation).getRegex(),xe.blockSkip=we(xe._blockSkip,"g").getRegex(),xe.overlapSkip=we(xe._overlapSkip,"g").getRegex(),xe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,xe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,xe._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])?)+(?![-_])/,xe.autolink=we(xe.autolink).replace("scheme",xe._scheme).replace("email",xe._email).getRegex(),xe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,xe.tag=we(xe.tag).replace("comment",Ee._comment).replace("attribute",xe._attribute).getRegex(),xe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,xe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,xe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,xe.link=we(xe.link).replace("label",xe._label).replace("href",xe._href).replace("title",xe._title).getRegex(),xe.reflink=we(xe.reflink).replace("label",xe._label).getRegex(),xe.reflinkSearch=we(xe.reflinkSearch,"g").replace("reflink",xe.reflink).replace("nolink",xe.nolink).getRegex(),xe.normal=Me({},xe),xe.pedantic=Me({},xe.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:we(/^!?\[(label)\]\((.*?)\)/).replace("label",xe._label).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xe._label).getRegex()}),xe.gfm=Me({},xe.normal,{escape:we(xe.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),xe.gfm.url=we(xe.gfm.url,"i").replace("email",xe.gfm._extended_email).getRegex(),xe.breaks=Me({},xe.gfm,{br:we(xe.br).replace("{2,}","*").getRegex(),text:we(xe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ge={block:Ee,inline:xe},je=T.defaults,We=Ge.block,ze=Ge.inline;function de(Ke){return Ke.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 le(Ke){var Fe="",Ue,_e,Ce=Ke.length;for(Ue=0;Ue<Ce;Ue++)_e=Ke.charCodeAt(Ue),Math.random()>.5&&(_e="x"+_e.toString(16)),Fe+="&#"+_e+";";return Fe}var Oe=function(){function Ke(Ue){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ue||je,this.options.tokenizer=this.options.tokenizer||new pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var _e={block:We.normal,inline:ze.normal};this.options.pedantic?(_e.block=We.pedantic,_e.inline=ze.pedantic):this.options.gfm&&(_e.block=We.gfm,this.options.breaks?_e.inline=ze.breaks:_e.inline=ze.gfm),this.tokenizer.rules=_e}Ke.lex=function(_e,Ce){var Ne=new Ke(Ce);return Ne.lex(_e)};var Fe=Ke.prototype;return Fe.lex=function(_e){return _e=_e.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(_e,this.tokens,!0),this.inline(this.tokens),this.tokens},Fe.blockTokens=function(_e,Ce,Ne){Ce===void 0&&(Ce=[]),Ne===void 0&&(Ne=!0),_e=_e.replace(/^ +$/gm,"");for(var De,rt,tt,xt;_e;){if(De=this.tokenizer.space(_e)){_e=_e.substring(De.raw.length),De.type&&Ce.push(De);continue}if(De=this.tokenizer.code(_e,Ce)){_e=_e.substring(De.raw.length),De.type?Ce.push(De):(xt=Ce[Ce.length-1],xt.raw+=`
|
|
|
`+De.raw,xt.text+=`
|
|
|
`+De.text);continue}if(De=this.tokenizer.fences(_e)){_e=_e.substring(De.raw.length),Ce.push(De);continue}if(De=this.tokenizer.heading(_e)){_e=_e.substring(De.raw.length),Ce.push(De);continue}if(De=this.tokenizer.nptable(_e)){_e=_e.substring(De.raw.length),Ce.push(De);continue}if(De=this.tokenizer.hr(_e)){_e=_e.substring(De.raw.length),Ce.push(De);continue}if(De=this.tokenizer.blockquote(_e)){_e=_e.substring(De.raw.length),De.tokens=this.blockTokens(De.text,[],Ne),Ce.push(De);continue}if(De=this.tokenizer.list(_e)){for(_e=_e.substring(De.raw.length),tt=De.items.length,rt=0;rt<tt;rt++)De.items[rt].tokens=this.blockTokens(De.items[rt].text,[],!1);Ce.push(De);continue}if(De=this.tokenizer.html(_e)){_e=_e.substring(De.raw.length),Ce.push(De);continue}if(Ne&&(De=this.tokenizer.def(_e))){_e=_e.substring(De.raw.length),this.tokens.links[De.tag]||(this.tokens.links[De.tag]={href:De.href,title:De.title});continue}if(De=this.tokenizer.table(_e)){_e=_e.substring(De.raw.length),Ce.push(De);continue}if(De=this.tokenizer.lheading(_e)){_e=_e.substring(De.raw.length),Ce.push(De);continue}if(Ne&&(De=this.tokenizer.paragraph(_e))){_e=_e.substring(De.raw.length),Ce.push(De);continue}if(De=this.tokenizer.text(_e,Ce)){_e=_e.substring(De.raw.length),De.type?Ce.push(De):(xt=Ce[Ce.length-1],xt.raw+=`
|
|
|
`+De.raw,xt.text+=`
|
|
|
`+De.text);continue}if(_e){var Mt="Infinite loop on byte: "+_e.charCodeAt(0);if(this.options.silent){console.error(Mt);break}else throw new Error(Mt)}}return Ce},Fe.inline=function(_e){var Ce,Ne,De,rt,tt,xt,Mt=_e.length;for(Ce=0;Ce<Mt;Ce++){xt=_e[Ce];switch(xt.type){case"paragraph":case"text":case"heading":{xt.tokens=[],this.inlineTokens(xt.text,xt.tokens);break}case"table":{for(xt.tokens={header:[],cells:[]},rt=xt.header.length,Ne=0;Ne<rt;Ne++)xt.tokens.header[Ne]=[],this.inlineTokens(xt.header[Ne],xt.tokens.header[Ne]);for(rt=xt.cells.length,Ne=0;Ne<rt;Ne++)for(tt=xt.cells[Ne],xt.tokens.cells[Ne]=[],De=0;De<tt.length;De++)xt.tokens.cells[Ne][De]=[],this.inlineTokens(tt[De],xt.tokens.cells[Ne][De]);break}case"blockquote":{this.inline(xt.tokens);break}case"list":{for(rt=xt.items.length,Ne=0;Ne<rt;Ne++)this.inline(xt.items[Ne].tokens);break}}}return _e},Fe.inlineTokens=function(_e,Ce,Ne,De,rt){Ce===void 0&&(Ce=[]),Ne===void 0&&(Ne=!1),De===void 0&&(De=!1),rt===void 0&&(rt="");var tt,xt=_e,Mt;if(this.tokens.links){var Bt=Object.keys(this.tokens.links);if(Bt.length>0)for(;(Mt=this.tokenizer.rules.inline.reflinkSearch.exec(xt))!=null;)Bt.includes(Mt[0].slice(Mt[0].lastIndexOf("[")+1,-1))&&(xt=xt.slice(0,Mt.index)+"["+"a".repeat(Mt[0].length-2)+"]"+xt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Mt=this.tokenizer.rules.inline.blockSkip.exec(xt))!=null;)xt=xt.slice(0,Mt.index)+"["+"a".repeat(Mt[0].length-2)+"]"+xt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;_e;){if(tt=this.tokenizer.escape(_e)){_e=_e.substring(tt.raw.length),Ce.push(tt);continue}if(tt=this.tokenizer.tag(_e,Ne,De)){_e=_e.substring(tt.raw.length),Ne=tt.inLink,De=tt.inRawBlock,Ce.push(tt);continue}if(tt=this.tokenizer.link(_e)){_e=_e.substring(tt.raw.length),tt.type==="link"&&(tt.tokens=this.inlineTokens(tt.text,[],!0,De)),Ce.push(tt);continue}if(tt=this.tokenizer.reflink(_e,this.tokens.links)){_e=_e.substring(tt.raw.length),tt.type==="link"&&(tt.tokens=this.inlineTokens(tt.text,[],!0,De)),Ce.push(tt);continue}if(tt=this.tokenizer.strong(_e,xt,rt)){_e=_e.substring(tt.raw.length),tt.tokens=this.inlineTokens(tt.text,[],Ne,De),Ce.push(tt);continue}if(tt=this.tokenizer.em(_e,xt,rt)){_e=_e.substring(tt.raw.length),tt.tokens=this.inlineTokens(tt.text,[],Ne,De),Ce.push(tt);continue}if(tt=this.tokenizer.codespan(_e)){_e=_e.substring(tt.raw.length),Ce.push(tt);continue}if(tt=this.tokenizer.br(_e)){_e=_e.substring(tt.raw.length),Ce.push(tt);continue}if(tt=this.tokenizer.del(_e)){_e=_e.substring(tt.raw.length),tt.tokens=this.inlineTokens(tt.text,[],Ne,De),Ce.push(tt);continue}if(tt=this.tokenizer.autolink(_e,le)){_e=_e.substring(tt.raw.length),Ce.push(tt);continue}if(!Ne&&(tt=this.tokenizer.url(_e,le))){_e=_e.substring(tt.raw.length),Ce.push(tt);continue}if(tt=this.tokenizer.inlineText(_e,De,de)){_e=_e.substring(tt.raw.length),rt=tt.raw.slice(-1),Ce.push(tt);continue}if(_e){var It="Infinite loop on byte: "+_e.charCodeAt(0);if(this.options.silent){console.error(It);break}else throw new Error(It)}}return Ce},Q(Ke,null,[{key:"rules",get:function(){return{block:We,inline:ze}}}]),Ke}(),Ie=T.defaults,qe=te.cleanUrl,ee=te.escape,k=function(){function Ke(Ue){this.options=Ue||Ie}var Fe=Ke.prototype;return Fe.code=function(_e,Ce,Ne){var De=(Ce||"").match(/\S*/)[0];if(this.options.highlight){var rt=this.options.highlight(_e,De);rt!=null&&rt!==_e&&(Ne=!0,_e=rt)}return De?'<pre><code class="'+this.options.langPrefix+ee(De,!0)+'">'+(Ne?_e:ee(_e,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(Ne?_e:ee(_e,!0))+`</code></pre>
|
|
|
`},Fe.blockquote=function(_e){return`<blockquote>
|
|
|
`+_e+`</blockquote>
|
|
|
`},Fe.html=function(_e){return _e},Fe.heading=function(_e,Ce,Ne,De){return this.options.headerIds?"<h"+Ce+' id="'+this.options.headerPrefix+De.slug(Ne)+'">'+_e+"</h"+Ce+`>
|
|
|
`:"<h"+Ce+">"+_e+"</h"+Ce+`>
|
|
|
`},Fe.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},Fe.list=function(_e,Ce,Ne){var De=Ce?"ol":"ul",rt=Ce&&Ne!==1?' start="'+Ne+'"':"";return"<"+De+rt+`>
|
|
|
`+_e+"</"+De+`>
|
|
|
`},Fe.listitem=function(_e){return"<li>"+_e+`</li>
|
|
|
`},Fe.checkbox=function(_e){return"<input "+(_e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Fe.paragraph=function(_e){return"<p>"+_e+`</p>
|
|
|
`},Fe.table=function(_e,Ce){return Ce&&(Ce="<tbody>"+Ce+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+_e+`</thead>
|
|
|
`+Ce+`</table>
|
|
|
`},Fe.tablerow=function(_e){return`<tr>
|
|
|
`+_e+`</tr>
|
|
|
`},Fe.tablecell=function(_e,Ce){var Ne=Ce.header?"th":"td",De=Ce.align?"<"+Ne+' align="'+Ce.align+'">':"<"+Ne+">";return De+_e+"</"+Ne+`>
|
|
|
`},Fe.strong=function(_e){return"<strong>"+_e+"</strong>"},Fe.em=function(_e){return"<em>"+_e+"</em>"},Fe.codespan=function(_e){return"<code>"+_e+"</code>"},Fe.br=function(){return this.options.xhtml?"<br/>":"<br>"},Fe.del=function(_e){return"<del>"+_e+"</del>"},Fe.link=function(_e,Ce,Ne){if(_e=qe(this.options.sanitize,this.options.baseUrl,_e),_e===null)return Ne;var De='<a href="'+ee(_e)+'"';return Ce&&(De+=' title="'+Ce+'"'),De+=">"+Ne+"</a>",De},Fe.image=function(_e,Ce,Ne){if(_e=qe(this.options.sanitize,this.options.baseUrl,_e),_e===null)return Ne;var De='<img src="'+_e+'" alt="'+Ne+'"';return Ce&&(De+=' title="'+Ce+'"'),De+=this.options.xhtml?"/>":">",De},Fe.text=function(_e){return _e},Ke}(),U=function(){function Ke(){}var Fe=Ke.prototype;return Fe.strong=function(_e){return _e},Fe.em=function(_e){return _e},Fe.codespan=function(_e){return _e},Fe.del=function(_e){return _e},Fe.html=function(_e){return _e},Fe.text=function(_e){return _e},Fe.link=function(_e,Ce,Ne){return""+Ne},Fe.image=function(_e,Ce,Ne){return""+Ne},Fe.br=function(){return""},Ke}(),q=function(){function Ke(){this.seen={}}var Fe=Ke.prototype;return Fe.slug=function(_e){var Ce=_e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ce)){var Ne=Ce;do this.seen[Ne]++,Ce=Ne+"-"+this.seen[Ne];while(this.seen.hasOwnProperty(Ce))}return this.seen[Ce]=0,Ce},Ke}(),Y=T.defaults,J=te.unescape,be=function(){function Ke(Ue){this.options=Ue||Y,this.options.renderer=this.options.renderer||new k,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new U,this.slugger=new q}Ke.parse=function(_e,Ce){var Ne=new Ke(Ce);return Ne.parse(_e)};var Fe=Ke.prototype;return Fe.parse=function(_e,Ce){Ce===void 0&&(Ce=!0);var Ne="",De,rt,tt,xt,Mt,Bt,It,Dt,lt,pt,ut,Pe,Ve,yt,st,Nt,Ut,it,mt=_e.length;for(De=0;De<mt;De++){pt=_e[De];switch(pt.type){case"space":continue;case"hr":{Ne+=this.renderer.hr();continue}case"heading":{Ne+=this.renderer.heading(this.parseInline(pt.tokens),pt.depth,J(this.parseInline(pt.tokens,this.textRenderer)),this.slugger);continue}case"code":{Ne+=this.renderer.code(pt.text,pt.lang,pt.escaped);continue}case"table":{for(Dt="",It="",xt=pt.header.length,rt=0;rt<xt;rt++)It+=this.renderer.tablecell(this.parseInline(pt.tokens.header[rt]),{header:!0,align:pt.align[rt]});for(Dt+=this.renderer.tablerow(It),lt="",xt=pt.cells.length,rt=0;rt<xt;rt++){for(Bt=pt.tokens.cells[rt],It="",Mt=Bt.length,tt=0;tt<Mt;tt++)It+=this.renderer.tablecell(this.parseInline(Bt[tt]),{header:!1,align:pt.align[tt]});lt+=this.renderer.tablerow(It)}Ne+=this.renderer.table(Dt,lt);continue}case"blockquote":{lt=this.parse(pt.tokens),Ne+=this.renderer.blockquote(lt);continue}case"list":{for(ut=pt.ordered,Pe=pt.start,Ve=pt.loose,xt=pt.items.length,lt="",rt=0;rt<xt;rt++)st=pt.items[rt],Nt=st.checked,Ut=st.task,yt="",st.task&&(it=this.renderer.checkbox(Nt),Ve?st.tokens.length>0&&st.tokens[0].type==="text"?(st.tokens[0].text=it+" "+st.tokens[0].text,st.tokens[0].tokens&&st.tokens[0].tokens.length>0&&st.tokens[0].tokens[0].type==="text"&&(st.tokens[0].tokens[0].text=it+" "+st.tokens[0].tokens[0].text)):st.tokens.unshift({type:"text",text:it}):yt+=it),yt+=this.parse(st.tokens,Ve),lt+=this.renderer.listitem(yt,Ut,Nt);Ne+=this.renderer.list(lt,ut,Pe);continue}case"html":{Ne+=this.renderer.html(pt.text);continue}case"paragraph":{Ne+=this.renderer.paragraph(this.parseInline(pt.tokens));continue}case"text":{for(lt=pt.tokens?this.parseInline(pt.tokens):pt.text;De+1<mt&&_e[De+1].type==="text";)pt=_e[++De],lt+=`
|
|
|
`+(pt.tokens?this.parseInline(pt.tokens):pt.text);Ne+=Ce?this.renderer.paragraph(lt):lt;continue}default:{var bt='Token with "'+pt.type+'" type was not found.';if(this.options.silent){console.error(bt);return}else throw new Error(bt)}}}return Ne},Fe.parseInline=function(_e,Ce){Ce=Ce||this.renderer;var Ne="",De,rt,tt=_e.length;for(De=0;De<tt;De++){rt=_e[De];switch(rt.type){case"escape":{Ne+=Ce.text(rt.text);break}case"html":{Ne+=Ce.html(rt.text);break}case"link":{Ne+=Ce.link(rt.href,rt.title,this.parseInline(rt.tokens,Ce));break}case"image":{Ne+=Ce.image(rt.href,rt.title,rt.text);break}case"strong":{Ne+=Ce.strong(this.parseInline(rt.tokens,Ce));break}case"em":{Ne+=Ce.em(this.parseInline(rt.tokens,Ce));break}case"codespan":{Ne+=Ce.codespan(rt.text);break}case"br":{Ne+=Ce.br();break}case"del":{Ne+=Ce.del(this.parseInline(rt.tokens,Ce));break}case"text":{Ne+=Ce.text(rt.text);break}default:{var xt='Token with "'+rt.type+'" type was not found.';if(this.options.silent){console.error(xt);return}else throw new Error(xt)}}}return Ne},Ke}(),ke=te.merge,ct=te.checkSanitizeDeprecation,He=te.escape,Be=T.getDefaults,Ze=T.changeDefaults,ht=T.defaults;function Qe(Ke,Fe,Ue){if(typeof Ke=="undefined"||Ke===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ke!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ke)+", string expected");if(typeof Fe=="function"&&(Ue=Fe,Fe=null),Fe=ke({},Qe.defaults,Fe||{}),ct(Fe),Ue){var _e=Fe.highlight,Ce;try{Ce=Oe.lex(Ke,Fe)}catch(tt){return Ue(tt)}var Ne=function(xt){var Mt;if(!xt)try{Mt=be.parse(Ce,Fe)}catch(Bt){xt=Bt}return Fe.highlight=_e,xt?Ue(xt):Ue(null,Mt)};if(!_e||_e.length<3)return Ne();if(delete Fe.highlight,!Ce.length)return Ne();var De=0;Qe.walkTokens(Ce,function(tt){tt.type==="code"&&(De++,setTimeout(function(){_e(tt.text,tt.lang,function(xt,Mt){if(xt)return Ne(xt);Mt!=null&&Mt!==tt.text&&(tt.text=Mt,tt.escaped=!0),De--,De===0&&Ne()})},0))}),De===0&&Ne();return}try{var rt=Oe.lex(Ke,Fe);return Fe.walkTokens&&Qe.walkTokens(rt,Fe.walkTokens),be.parse(rt,Fe)}catch(tt){if(tt.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,Fe.silent)return"<p>An error occurred:</p><pre>"+He(tt.message+"",!0)+"</pre>";throw tt}}Qe.options=Qe.setOptions=function(Ke){return ke(Qe.defaults,Ke),Ze(Qe.defaults),Qe},Qe.getDefaults=Be,Qe.defaults=ht,Qe.use=function(Ke){var Fe=ke({},Ke);if(Ke.renderer&&function(){var _e=Qe.defaults.renderer||new k,Ce=function(rt){var tt=_e[rt];_e[rt]=function(){for(var xt=arguments.length,Mt=new Array(xt),Bt=0;Bt<xt;Bt++)Mt[Bt]=arguments[Bt];var It=Ke.renderer[rt].apply(_e,Mt);return It===!1&&(It=tt.apply(_e,Mt)),It}};for(var Ne in Ke.renderer)Ce(Ne);Fe.renderer=_e}(),Ke.tokenizer&&function(){var _e=Qe.defaults.tokenizer||new pe,Ce=function(rt){var tt=_e[rt];_e[rt]=function(){for(var xt=arguments.length,Mt=new Array(xt),Bt=0;Bt<xt;Bt++)Mt[Bt]=arguments[Bt];var It=Ke.tokenizer[rt].apply(_e,Mt);return It===!1&&(It=tt.apply(_e,Mt)),It}};for(var Ne in Ke.tokenizer)Ce(Ne);Fe.tokenizer=_e}(),Ke.walkTokens){var Ue=Qe.defaults.walkTokens;Fe.walkTokens=function(_e){Ke.walkTokens(_e),Ue&&Ue(_e)}}Qe.setOptions(Fe)},Qe.walkTokens=function(Ke,Fe){for(var Ue=D(Ke),_e;!(_e=Ue()).done;){var Ce=_e.value;Fe(Ce);switch(Ce.type){case"table":{for(var Ne=D(Ce.tokens.header),De;!(De=Ne()).done;){var rt=De.value;Qe.walkTokens(rt,Fe)}for(var tt=D(Ce.tokens.cells),xt;!(xt=tt()).done;)for(var Mt=xt.value,Bt=D(Mt),It;!(It=Bt()).done;){var Dt=It.value;Qe.walkTokens(Dt,Fe)}break}case"list":{Qe.walkTokens(Ce.items,Fe);break}default:Ce.tokens&&Qe.walkTokens(Ce.tokens,Fe)}}},Qe.Parser=be,Qe.parser=be.parse,Qe.Renderer=k,Qe.TextRenderer=U,Qe.Lexer=Oe,Qe.lexer=Oe.lex,Qe.Tokenizer=pe,Qe.Slugger=q,Qe.parse=Qe;var Xe=Qe;return Xe})},"DlR+":function(nt,Le,F){var ue=F("MFOe"),Q=ue.Global,j=ue.trim;nt.exports={name:"cookieStorage",read:D,write:T,each:x,remove:w,clearAll:f};var S=Q.document;function D(u){if(!u||!p(u))return null;var o="(?:^|.*;\\s*)"+escape(u).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(S.cookie.replace(new RegExp(o),"$1"))}function x(u){for(var o=S.cookie.split(/; ?/g),i=o.length-1;i>=0;i--){if(!j(o[i]))continue;var l=o[i].split("="),s=unescape(l[0]),h=unescape(l[1]);u(h,s)}}function T(u,o){if(!u)return;S.cookie=escape(u)+"="+escape(o)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function w(u){if(!u||!p(u))return;S.cookie=escape(u)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function f(){x(function(u,o){w(o)})}function p(u){return new RegExp("(?:^|;\\s*)"+escape(u).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(S.cookie)}},E2g8:function(nt,Le,F){(function(ue,Q){/*!
|
|
|
* @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(j,S){nt.exports=S()})(this,function(){"use strict";function j(k){var U=typeof k;return k!==null&&(U==="object"||U==="function")}function S(k){return typeof k=="function"}var D=void 0;Array.isArray?D=Array.isArray:D=function(k){return Object.prototype.toString.call(k)==="[object Array]"};var x=D,T=0,w=void 0,f=void 0,p=function(U,q){b[T]=U,b[T+1]=q,T+=2,T===2&&(f?f(E):y())};function u(k){f=k}function o(k){p=k}var i=typeof window!="undefined"?window:void 0,l=i||{},s=l.MutationObserver||l.WebKitMutationObserver,h=typeof self=="undefined"&&typeof ue!="undefined"&&{}.toString.call(ue)==="[object process]",r=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function t(){return function(){return ue.nextTick(E)}}function n(){return typeof w!="undefined"?function(){w(E)}:v()}function c(){var k=0,U=new s(E),q=document.createTextNode("");return U.observe(q,{characterData:!0}),function(){q.data=k=++k%2}}function m(){var k=new MessageChannel;return k.port1.onmessage=E,function(){return k.port2.postMessage(0)}}function v(){var k=setTimeout;return function(){return k(E,1)}}var b=new Array(1e3);function E(){for(var k=0;k<T;k+=2){var U=b[k],q=b[k+1];U(q),b[k]=void 0,b[k+1]=void 0}T=0}function g(){try{var k=Function("return this")().require("vertx");return w=k.runOnLoop||k.runOnContext,n()}catch(U){return v()}}var y=void 0;h?y=t():s?y=c():r?y=m():i===void 0&&!0?y=g():y=v();function C(k,U){var q=this,Y=new this.constructor(O);Y[_]===void 0&&Ge(Y);var J=q._state;if(J){var be=arguments[J-1];p(function(){return we(J,Y,be,q._result)})}else pe(q,Y,k,U);return Y}function d(k){var U=this;if(k&&typeof k=="object"&&k.constructor===U)return k;var q=new U(O);return re(q,k),q}var _=Math.random().toString(36).substring(2);function O(){}var A=void 0,P=1,I=2;function W(){return new TypeError("You cannot resolve a promise with itself")}function K(){return new TypeError("A promises callback cannot return that same promise.")}function te(k,U,q,Y){try{k.call(U,q,Y)}catch(J){return J}}function H(k,U,q){p(function(Y){var J=!1,be=te(q,U,function(ke){if(J)return;J=!0,U!==ke?re(Y,ke):ne(Y,ke)},function(ke){if(J)return;J=!0,he(Y,ke)},"Settle: "+(Y._label||" unknown promise"));!J&&be&&(J=!0,he(Y,be))},k)}function G(k,U){U._state===P?ne(k,U._result):U._state===I?he(k,U._result):pe(U,void 0,function(q){return re(k,q)},function(q){return he(k,q)})}function V(k,U,q){U.constructor===k.constructor&&q===C&&U.constructor.resolve===d?G(k,U):q===void 0?ne(k,U):S(q)?H(k,U,q):ne(k,U)}function re(k,U){if(k===U)he(k,W());else if(j(U)){var q=void 0;try{q=U.then}catch(Y){he(k,Y);return}V(k,U,q)}else ne(k,U)}function $(k){k._onerror&&k._onerror(k._result),Te(k)}function ne(k,U){if(k._state!==A)return;k._result=U,k._state=P,k._subscribers.length!==0&&p(Te,k)}function he(k,U){if(k._state!==A)return;k._state=I,k._result=U,p($,k)}function pe(k,U,q,Y){var J=k._subscribers,be=J.length;k._onerror=null,J[be]=U,J[be+P]=q,J[be+I]=Y,be===0&&k._state&&p(Te,k)}function Te(k){var U=k._subscribers,q=k._state;if(U.length===0)return;for(var Y=void 0,J=void 0,be=k._result,ke=0;ke<U.length;ke+=3)Y=U[ke],J=U[ke+q],Y?we(q,Y,J,be):J(be);k._subscribers.length=0}function we(k,U,q,Y){var J=S(q),be=void 0,ke=void 0,ct=!0;if(J){try{be=q(Y)}catch(He){ct=!1,ke=He}if(U===be){he(U,K());return}}else be=Y;U._state!==A||(J&&ct?re(U,be):ct===!1?he(U,ke):k===P?ne(U,be):k===I&&he(U,be))}function Me(k,U){try{U(function(Y){re(k,Y)},function(Y){he(k,Y)})}catch(q){he(k,q)}}var Ee=0;function xe(){return Ee++}function Ge(k){k[_]=Ee++,k._state=void 0,k._result=void 0,k._subscribers=[]}function je(){return new Error("Array Methods must be provided an Array")}var We=function(){function k(U,q){this._instanceConstructor=U,this.promise=new U(O),this.promise[_]||Ge(this.promise),x(q)?(this.length=q.length,this._remaining=q.length,this._result=new Array(this.length),this.length===0?ne(this.promise,this._result):(this.length=this.length||0,this._enumerate(q),this._remaining===0&&ne(this.promise,this._result))):he(this.promise,je())}return k.prototype._enumerate=function(q){for(var Y=0;this._state===A&&Y<q.length;Y++)this._eachEntry(q[Y],Y)},k.prototype._eachEntry=function(q,Y){var J=this._instanceConstructor,be=J.resolve;if(be===d){var ke=void 0,ct=void 0,He=!1;try{ke=q.then}catch(Ze){He=!0,ct=Ze}if(ke===C&&q._state!==A)this._settledAt(q._state,Y,q._result);else if(typeof ke!="function")this._remaining--,this._result[Y]=q;else if(J===qe){var Be=new J(O);He?he(Be,ct):V(Be,q,ke),this._willSettleAt(Be,Y)}else this._willSettleAt(new J(function(Ze){return Ze(q)}),Y)}else this._willSettleAt(be(q),Y)},k.prototype._settledAt=function(q,Y,J){var be=this.promise;be._state===A&&(this._remaining--,q===I?he(be,J):this._result[Y]=J),this._remaining===0&&ne(be,this._result)},k.prototype._willSettleAt=function(q,Y){var J=this;pe(q,void 0,function(be){return J._settledAt(P,Y,be)},function(be){return J._settledAt(I,Y,be)})},k}();function ze(k){return new We(this,k).promise}function de(k){var U=this;return x(k)?new U(function(q,Y){for(var J=k.length,be=0;be<J;be++)U.resolve(k[be]).then(q,Y)}):new U(function(q,Y){return Y(new TypeError("You must pass an array to race."))})}function le(k){var U=this,q=new U(O);return he(q,k),q}function Oe(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Ie(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var qe=function(){function k(U){this[_]=xe(),this._result=this._state=void 0,this._subscribers=[],O!==U&&(typeof U!="function"&&Oe(),this instanceof k?Me(this,U):Ie())}return k.prototype.catch=function(q){return this.then(null,q)},k.prototype.finally=function(q){var Y=this,J=Y.constructor;return S(q)?Y.then(function(be){return J.resolve(q()).then(function(){return be})},function(be){return J.resolve(q()).then(function(){throw be})}):Y.then(q,q)},k}();qe.prototype.then=C,qe.all=ze,qe.race=de,qe.resolve=d,qe.reject=le,qe._setScheduler=u,qe._setAsap=o,qe._asap=p;function ee(){var k=void 0;if(typeof Q!="undefined")k=Q;else if(typeof self!="undefined")k=self;else try{k=Function("return this")()}catch(Y){throw new Error("polyfill failed because global object is unavailable in this environment")}var U=k.Promise;if(U){var q=null;try{q=Object.prototype.toString.call(U.resolve())}catch(Y){}if(q==="[object Promise]"&&!U.cast)return}k.Promise=qe}return qe.polyfill=ee,qe.Promise=qe,qe})}).call(this,F("Q2Ig"),F("IyRk"))},E9nw:function(nt,Le){nt.exports=function(){var F=document.getSelection();if(!F.rangeCount)return function(){};for(var ue=document.activeElement,Q=[],j=0;j<F.rangeCount;j++)Q.push(F.getRangeAt(j));switch(ue.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":ue.blur();break;default:ue=null;break}return F.removeAllRanges(),function(){F.type==="Caret"&&F.removeAllRanges(),F.rangeCount||Q.forEach(function(S){F.addRange(S)}),ue&&ue.focus()}}},EHPI:function(nt,Le,F){"use strict";var ue=F("bbsP"),Q=F("/wGt"),j=F("tJVT"),S=F("k1fw"),D=F("q1tI"),x=F.n(D),T=F("ZW9T"),w=F("ZD9Y"),f=F("M8RZ"),p=F("bCnd"),u=F("fcyK"),o=F.n(u),i={theme:Object(p.a)("cmCodeMode","vs-dark"),fontSize:Object(p.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(p.a)("cmTabToSpace",!0)},l;(function(r){r[r.set_font_size=0]="set_font_size",r[r.set_theme=1]="set_theme",r[r.on_tab_to_space=2]="on_tab_to_space",r[r.set_show_editor_setting=3]="set_show_editor_setting"})(l||(l={}));function s(r,t){switch(t.type){case l.set_show_editor_setting:return Object(S.a)(Object(S.a)({},r),{},{showEditorSetting:t.payload});case l.set_theme:return Object(S.a)(Object(S.a)({},r),{},{theme:t.payload});case l.set_font_size:return Object(S.a)(Object(S.a)({},r),{},{fontSize:t.payload});case l.on_tab_to_space:return Object(S.a)(Object(S.a)({},r),{},{tabToSpace:t.payload});default:throw new Error}}Le.a=function(r){var t=r.value,n=r.onChange,c=r.language,m=r.ActionBarRender,v=m===void 0?function(K){return x.a.createElement(h,{onShowCodeSetting:K})}:m,b=Object(D.useReducer)(s,i),E=Object(j.a)(b,2),g=E[0],y=E[1],C=g.theme,d=g.fontSize,_=g.showEditorSetting,O=g.tabToSpace,A={onFontSizeChange:function(te){y({type:l.set_font_size,payload:te}),Object(p.b)("cmFontSize",te)},tabToSpace:O,cmFontSize:d,className:"oj",cmCodeMode:C,onTabToSpace:function(te){y({type:l.on_tab_to_space,payload:te}),Object(p.b)("cmTabToSpace",te)},onCodeModeChange:function(te){y({type:l.set_theme,payload:te}),Object(p.b)("cmCodeMode",te)}};function P(){y({type:l.set_show_editor_setting,payload:!1})}function I(){y({type:l.set_show_editor_setting,payload:!0})}var W={value:t,language:c,onChange:n,theme:C,height:"calc(100% - 56px)",options:{fontSize:d,insertSpaces:O}};return x.a.createElement(D.Fragment,null,x.a.createElement("div",{className:"code-panel-container"},v(I),x.a.createElement(T.b,W)),x.a.createElement(f.a,null,x.a.createElement(Q.a,{className:"oj",title:null,placement:"right",closable:!1,visible:_,onClose:P},x.a.createElement(w.a,A))))};function h(r){var t=r.onShowCodeSetting;return x.a.createElement("div",{className:"action-bar"},x.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),x.a.createElement("a",{onClick:t},x.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(nt,Le,F){(function(ue){ue(F("VrN/"))})(function(ue){var Q={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},j=ue.Pos;ue.defineOption("autoCloseBrackets",!1,function(s,h,r){r&&r!=ue.Init&&(s.removeKeyMap(D),s.state.closeBrackets=null),h&&(x(S(h,"pairs")),s.state.closeBrackets=h,s.addKeyMap(D))});function S(s,h){return h=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[h]!=null?s[h]:Q[h]}var D={Backspace:f,Enter:p};function x(s){for(var h=0;h<s.length;h++){var r=s.charAt(h),t="'"+r+"'";D[t]||(D[t]=T(r))}}x(Q.pairs+"`");function T(s){return function(h){return o(h,s)}}function w(s){var h=s.state.closeBrackets;if(!h||h.override)return h;var r=s.getModeAt(s.getCursor());return r.closeBrackets||h}function f(s){var h=w(s);if(!h||s.getOption("disableInput"))return ue.Pass;for(var r=S(h,"pairs"),t=s.listSelections(),n=0;n<t.length;n++){if(!t[n].empty())return ue.Pass;var c=i(s,t[n].head);if(!c||r.indexOf(c)%2!=0)return ue.Pass}for(var n=t.length-1;n>=0;n--){var m=t[n].head;s.replaceRange("",j(m.line,m.ch-1),j(m.line,m.ch+1),"+delete")}}function p(s){var h=w(s),r=h&&S(h,"explode");if(!r||s.getOption("disableInput"))return ue.Pass;for(var t=s.listSelections(),n=0;n<t.length;n++){if(!t[n].empty())return ue.Pass;var c=i(s,t[n].head);if(!c||r.indexOf(c)%2!=0)return ue.Pass}s.operation(function(){var m=s.lineSeparator()||`
|
|
|
`;s.replaceSelection(m+m,null),s.execCommand("goCharLeft"),t=s.listSelections();for(var v=0;v<t.length;v++){var b=t[v].head.line;s.indentLine(b,null,!0),s.indentLine(b+1,null,!0)}})}function u(s){var h=ue.cmpPos(s.anchor,s.head)>0;return{anchor:new j(s.anchor.line,s.anchor.ch+(h?-1:1)),head:new j(s.head.line,s.head.ch+(h?1:-1))}}function o(s,h){var r=w(s);if(!r||s.getOption("disableInput"))return ue.Pass;var t=S(r,"pairs"),n=t.indexOf(h);if(n==-1)return ue.Pass;for(var c=S(r,"closeBefore"),m=S(r,"triples"),v=t.charAt(n+1)==h,b=s.listSelections(),E=n%2==0,g,y=0;y<b.length;y++){var C=b[y],d=C.head,_,O=s.getRange(d,j(d.line,d.ch+1));if(E&&!C.empty())_="surround";else if((v||!E)&&O==h)v&&l(s,d)?_="both":m.indexOf(h)>=0&&s.getRange(d,j(d.line,d.ch+3))==h+h+h?_="skipThree":_="skip";else if(v&&d.ch>1&&m.indexOf(h)>=0&&s.getRange(j(d.line,d.ch-2),d)==h+h){if(d.ch>2&&/\bstring/.test(s.getTokenTypeAt(j(d.line,d.ch-2))))return ue.Pass;_="addFour"}else if(v){var A=d.ch==0?" ":s.getRange(j(d.line,d.ch-1),d);if(!ue.isWordChar(O)&&A!=h&&!ue.isWordChar(A))_="both";else return ue.Pass}else if(E&&(O.length===0||/\s/.test(O)||c.indexOf(O)>-1))_="both";else return ue.Pass;if(!g)g=_;else if(g!=_)return ue.Pass}var P=n%2?t.charAt(n-1):h,I=n%2?h:t.charAt(n+1);s.operation(function(){if(g=="skip")s.execCommand("goCharRight");else if(g=="skipThree")for(var W=0;W<3;W++)s.execCommand("goCharRight");else if(g=="surround"){for(var K=s.getSelections(),W=0;W<K.length;W++)K[W]=P+K[W]+I;s.replaceSelections(K,"around"),K=s.listSelections().slice();for(var W=0;W<K.length;W++)K[W]=u(K[W]);s.setSelections(K)}else g=="both"?(s.replaceSelection(P+I,null),s.triggerElectric(P+I),s.execCommand("goCharLeft")):g=="addFour"&&(s.replaceSelection(P+P+P+P,"before"),s.execCommand("goCharRight"))})}function i(s,h){var r=s.getRange(j(h.line,h.ch-1),j(h.line,h.ch+1));return r.length==2?r:null}function l(s,h){var r=s.getTokenAt(j(h.line,h.ch+1));return/\bstring/.test(r.type)&&r.start==h.ch&&(h.ch==0||!/\bstring/.test(s.getTokenTypeAt(h)))}})},FOrL:function(nt,Le,F){nt.exports=F.p+"static/nodata.a6b3f948.png"},GUcZ:function(nt,Le,F){"use strict";var ue=F("fWQN"),Q=F("mtLc"),j=function(){function Ae(){Object(ue.a)(this,Ae)}return Object(Q.a)(Ae,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(z,Z){return z.__proto__=Z,z},Object.assign=Object.assign||function(z){if(z==null)throw new TypeError("Cannot convert undefined or null to object");for(var Z=Object(z),oe=1;oe<arguments.length;oe++){var me=arguments[oe];if(me!=null)for(var Re in me)me.hasOwnProperty(Re)&&(Z[Re]=me[Re])}return Z},typeof self.Promise!="function"&&F("E2g8").polyfill()}}]),Ae}();j.install();var S=j,D=F("+qE3"),x=F.n(D),T=function(){function Ae(){Object(ue.a)(this,Ae)}return Object(Q.a)(Ae,null,[{key:"e",value:function(z,Z){(!z||Ae.FORCE_GLOBAL_TAG)&&(z=Ae.GLOBAL_TAG);var oe="[".concat(z,"] > ").concat(Z);if(Ae.ENABLE_CALLBACK&&Ae.emitter.emit("log","error",oe),!Ae.ENABLE_ERROR)return;console.error?console.error(oe):console.warn?console.warn(oe):console.log(oe)}},{key:"i",value:function(z,Z){(!z||Ae.FORCE_GLOBAL_TAG)&&(z=Ae.GLOBAL_TAG);var oe="[".concat(z,"] > ").concat(Z);if(Ae.ENABLE_CALLBACK&&Ae.emitter.emit("log","info",oe),!Ae.ENABLE_INFO)return;console.info?console.info(oe):console.log(oe)}},{key:"w",value:function(z,Z){(!z||Ae.FORCE_GLOBAL_TAG)&&(z=Ae.GLOBAL_TAG);var oe="[".concat(z,"] > ").concat(Z);if(Ae.ENABLE_CALLBACK&&Ae.emitter.emit("log","warn",oe),!Ae.ENABLE_WARN)return;console.warn?console.warn(oe):console.log(oe)}},{key:"d",value:function(z,Z){(!z||Ae.FORCE_GLOBAL_TAG)&&(z=Ae.GLOBAL_TAG);var oe="[".concat(z,"] > ").concat(Z);if(Ae.ENABLE_CALLBACK&&Ae.emitter.emit("log","debug",oe),!Ae.ENABLE_DEBUG)return;console.debug?console.debug(oe):console.log(oe)}},{key:"v",value:function(z,Z){(!z||Ae.FORCE_GLOBAL_TAG)&&(z=Ae.GLOBAL_TAG);var oe="[".concat(z,"] > ").concat(Z);if(Ae.ENABLE_CALLBACK&&Ae.emitter.emit("log","verbose",oe),!Ae.ENABLE_VERBOSE)return;console.log(oe)}}]),Ae}();T.GLOBAL_TAG="flv.js",T.FORCE_GLOBAL_TAG=!1,T.ENABLE_ERROR=!0,T.ENABLE_INFO=!0,T.ENABLE_WARN=!0,T.ENABLE_DEBUG=!0,T.ENABLE_VERBOSE=!0,T.ENABLE_CALLBACK=!1,T.emitter=new x.a;var w=T,f=function(){function Ae(){Object(ue.a)(this,Ae),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(Q.a)(Ae,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(z){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=z,this._totalBytes+=z):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=z,this._totalBytes+=z):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=z,this._totalBytes+=z,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var z=(this._now()-this._lastCheckpoint)/1e3;return z==0&&(z=1),this._intervalBytes/z/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 z=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/z/1024}}]),Ae}(),p=f,u=F("yKVA"),o=F("879j"),i=function(){function Ae(ge){Object(ue.a)(this,Ae),this._message=ge}return Object(Q.a)(Ae,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),Ae}(),l=function(Ae){Object(u.a)(z,Ae);var ge=Object(o.a)(z);function z(Z){return Object(ue.a)(this,z),ge.call(this,Z)}return Object(Q.a)(z,[{key:"name",get:function(){return"IllegalStateException"}}]),z}(i),s=function(Ae){Object(u.a)(z,Ae);var ge=Object(o.a)(z);function z(Z){return Object(ue.a)(this,z),ge.call(this,Z)}return Object(Q.a)(z,[{key:"name",get:function(){return"InvalidArgumentException"}}]),z}(i),h=function(Ae){Object(u.a)(z,Ae);var ge=Object(o.a)(z);function z(Z){return Object(ue.a)(this,z),ge.call(this,Z)}return Object(Q.a)(z,[{key:"name",get:function(){return"NotImplementedException"}}]),z}(i),r={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},t={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},n=function(){function Ae(ge){Object(ue.a)(this,Ae),this._type=ge||"undefined",this._status=r.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(Q.a)(Ae,[{key:"destroy",value:function(){this._status=r.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===r.kConnecting||this._status===r.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(z){this._onContentLengthKnown=z}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(z){this._onURLRedirect=z}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(z){this._onDataArrival=z}},{key:"onError",get:function(){return this._onError},set:function(z){this._onError=z}},{key:"onComplete",get:function(){return this._onComplete},set:function(z){this._onComplete=z}},{key:"open",value:function(z,Z){throw new h("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new h("Unimplemented abstract function!")}}]),Ae}(),c=F("oZsa");function m(Ae,ge){for(;!Object.prototype.hasOwnProperty.call(Ae,ge)&&!(Ae=Object(c.a)(Ae),Ae===null););return Ae}function v(Ae,ge,z){return typeof Reflect!="undefined"&&Reflect.get?v=Reflect.get:v=function(oe,me,Re){var Je=m(oe,me);if(!Je)return;var at=Object.getOwnPropertyDescriptor(Je,me);return at.get?at.get.call(Re):at.value},v(Ae,ge,z||Ae)}var b={};function E(){var Ae=self.navigator.userAgent.toLowerCase(),ge=/(edge)\/([\w.]+)/.exec(Ae)||/(opr)[\/]([\w.]+)/.exec(Ae)||/(chrome)[ \/]([\w.]+)/.exec(Ae)||/(iemobile)[\/]([\w.]+)/.exec(Ae)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Ae)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Ae)||/(webkit)[ \/]([\w.]+)/.exec(Ae)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(Ae)||/(msie) ([\w.]+)/.exec(Ae)||Ae.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(Ae)||Ae.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(Ae)||[],z=/(ipad)/.exec(Ae)||/(ipod)/.exec(Ae)||/(windows phone)/.exec(Ae)||/(iphone)/.exec(Ae)||/(kindle)/.exec(Ae)||/(android)/.exec(Ae)||/(windows)/.exec(Ae)||/(mac)/.exec(Ae)||/(linux)/.exec(Ae)||/(cros)/.exec(Ae)||[],Z={browser:ge[5]||ge[3]||ge[1]||"",version:ge[2]||ge[4]||"0",majorVersion:ge[4]||ge[2]||"0",platform:z[0]||""},oe={};if(Z.browser){oe[Z.browser]=!0;var me=Z.majorVersion.split(".");oe.version={major:parseInt(Z.majorVersion,10),string:Z.version},me.length>1&&(oe.version.minor=parseInt(me[1],10)),me.length>2&&(oe.version.build=parseInt(me[2],10))}if(Z.platform&&(oe[Z.platform]=!0),(oe.chrome||oe.opr||oe.safari)&&(oe.webkit=!0),oe.rv||oe.iemobile){oe.rv&&delete oe.rv;var Re="msie";Z.browser=Re,oe[Re]=!0}if(oe.edge){delete oe.edge;var Je="msedge";Z.browser=Je,oe[Je]=!0}if(oe.opr){var at="opera";Z.browser=at,oe[at]=!0}if(oe.safari&&oe.android){var kt="android";Z.browser=kt,oe[kt]=!0}oe.name=Z.browser,oe.platform=Z.platform;for(var jt in b)b.hasOwnProperty(jt)&&delete b[jt];Object.assign(b,oe)}E();var g=b,y=function(Ae){Object(u.a)(z,Ae);var ge=Object(o.a)(z);function z(Z,oe){var me;return Object(ue.a)(this,z),me=ge.call(this,"fetch-stream-loader"),me.TAG="FetchStreamLoader",me._seekHandler=Z,me._config=oe,me._needStash=!0,me._requestAbort=!1,me._contentLength=null,me._receivedLength=0,me}return Object(Q.a)(z,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),v(Object(c.a)(z.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,me){var Re=this;this._dataSource=oe,this._range=me;var Je=oe.url;this._config.reuseRedirectedURL&&oe.redirectedURL!=null&&(Je=oe.redirectedURL);var at=this._seekHandler.getConfig(Je,me),kt=new self.Headers;if(typeof at.headers=="object"){var jt=at.headers;for(var ot in jt)jt.hasOwnProperty(ot)&&kt.append(ot,jt[ot])}var wt={method:"GET",headers:kt,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var Kt in this._config.headers)kt.append(Kt,this._config.headers[Kt]);oe.cors===!1&&(wt.mode="same-origin"),oe.withCredentials&&(wt.credentials="include"),oe.referrerPolicy&&(wt.referrerPolicy=oe.referrerPolicy),this._status=r.kConnecting,self.fetch(at.url,wt).then(function(Et){if(Re._requestAbort){Re._requestAbort=!1,Re._status=r.kIdle;return}if(Et.ok&&Et.status>=200&&Et.status<=299){if(Et.url!==at.url&&Re._onURLRedirect){var Qt=Re._seekHandler.removeURLParameters(Et.url);Re._onURLRedirect(Qt)}var Vt=Et.headers.get("Content-Length");return Vt!=null&&(Re._contentLength=parseInt(Vt),Re._contentLength!==0&&(Re._onContentLengthKnown&&Re._onContentLengthKnown(Re._contentLength))),Re._pump.call(Re,Et.body.getReader())}else if(Re._status=r.kError,Re._onError)Re._onError(t.HTTP_STATUS_CODE_INVALID,{code:Et.status,msg:Et.statusText});else throw new i("FetchStreamLoader: Http code invalid, "+Et.status+" "+Et.statusText)}).catch(function(Et){if(Re._status=r.kError,Re._onError)Re._onError(t.EXCEPTION,{code:-1,msg:Et.message});else throw Et})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(oe){var me=this;return oe.read().then(function(Re){if(Re.done)if(me._contentLength!==null&&me._receivedLength<me._contentLength){me._status=r.kError;var Je=t.EARLY_EOF,at={code:-1,msg:"Fetch stream meet Early-EOF"};if(me._onError)me._onError(Je,at);else throw new i(at.msg)}else me._status=r.kComplete,me._onComplete&&me._onComplete(me._range.from,me._range.from+me._receivedLength-1);else{if(me._requestAbort===!0)return me._requestAbort=!1,me._status=r.kComplete,oe.cancel();me._status=r.kBuffering;var kt=Re.value.buffer,jt=me._range.from+me._receivedLength;me._receivedLength+=kt.byteLength,me._onDataArrival&&me._onDataArrival(kt,jt,me._receivedLength),me._pump(oe)}}).catch(function(Re){if(Re.code===11&&g.msedge)return;me._status=r.kError;var Je=0,at=null;if((Re.code===19||Re.message==="network error")&&(me._contentLength===null||me._contentLength!==null&&me._receivedLength<me._contentLength)?(Je=t.EARLY_EOF,at={code:Re.code,msg:"Fetch stream meet Early-EOF"}):(Je=t.EXCEPTION,at={code:Re.code,msg:Re.message}),me._onError)me._onError(Je,at);else throw new i(at.msg)})}}],[{key:"isSupported",value:function(){try{var oe=g.msedge&&g.version.minor>=15048,me=g.msedge?oe:!0;return self.fetch&&self.ReadableStream&&me}catch(Re){return!1}}}]),z}(n),C=y,d=function(Ae){Object(u.a)(z,Ae);var ge=Object(o.a)(z);function z(Z,oe){var me;return Object(ue.a)(this,z),me=ge.call(this,"xhr-moz-chunked-loader"),me.TAG="MozChunkedLoader",me._seekHandler=Z,me._config=oe,me._needStash=!0,me._xhr=null,me._requestAbort=!1,me._contentLength=null,me._receivedLength=0,me}return Object(Q.a)(z,[{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),v(Object(c.a)(z.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,me){this._dataSource=oe,this._range=me;var Re=oe.url;this._config.reuseRedirectedURL&&oe.redirectedURL!=null&&(Re=oe.redirectedURL);var Je=this._seekHandler.getConfig(Re,me);this._requestURL=Je.url;var at=this._xhr=new XMLHttpRequest;if(at.open("GET",Je.url,!0),at.responseType="moz-chunked-arraybuffer",at.onreadystatechange=this._onReadyStateChange.bind(this),at.onprogress=this._onProgress.bind(this),at.onloadend=this._onLoadEnd.bind(this),at.onerror=this._onXhrError.bind(this),oe.withCredentials&&(at.withCredentials=!0),typeof Je.headers=="object"){var kt=Je.headers;for(var jt in kt)kt.hasOwnProperty(jt)&&at.setRequestHeader(jt,kt[jt])}if(typeof this._config.headers=="object"){var ot=this._config.headers;for(var wt in ot)ot.hasOwnProperty(wt)&&at.setRequestHeader(wt,ot[wt])}this._status=r.kConnecting,at.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=r.kComplete}},{key:"_onReadyStateChange",value:function(oe){var me=oe.target;if(me.readyState===2){if(me.responseURL!=null&&me.responseURL!==this._requestURL&&this._onURLRedirect){var Re=this._seekHandler.removeURLParameters(me.responseURL);this._onURLRedirect(Re)}if(me.status!==0&&(me.status<200||me.status>299))if(this._status=r.kError,this._onError)this._onError(t.HTTP_STATUS_CODE_INVALID,{code:me.status,msg:me.statusText});else throw new i("MozChunkedLoader: Http code invalid, "+me.status+" "+me.statusText);else this._status=r.kBuffering}}},{key:"_onProgress",value:function(oe){if(this._status===r.kError)return;this._contentLength===null&&(oe.total!==null&&oe.total!==0&&(this._contentLength=oe.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var me=oe.target.response,Re=this._range.from+this._receivedLength;this._receivedLength+=me.byteLength,this._onDataArrival&&this._onDataArrival(me,Re,this._receivedLength)}},{key:"_onLoadEnd",value:function(oe){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===r.kError)return;this._status=r.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function(oe){this._status=r.kError;var me=0,Re=null;if(this._contentLength&&oe.loaded<this._contentLength?(me=t.EARLY_EOF,Re={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(me=t.EXCEPTION,Re={code:-1,msg:oe.constructor.name+" "+oe.type}),this._onError)this._onError(me,Re);else throw new i(Re.msg)}}],[{key:"isSupported",value:function(){try{var oe=new XMLHttpRequest;return oe.open("GET","https://example.com",!0),oe.responseType="moz-chunked-arraybuffer",oe.responseType==="moz-chunked-arraybuffer"}catch(me){return w.w("MozChunkedLoader",me.message),!1}}}]),z}(n),_=d,O=function(Ae){Object(u.a)(z,Ae);var ge=Object(o.a)(z);function z(Z,oe){var me;return Object(ue.a)(this,z),me=ge.call(this,"xhr-msstream-loader"),me.TAG="MSStreamLoader",me._seekHandler=Z,me._config=oe,me._needStash=!0,me._xhr=null,me._reader=null,me._totalRange=null,me._currentRange=null,me._currentRequestURL=null,me._currentRedirectedURL=null,me._contentLength=null,me._receivedLength=0,me._bufferLimit=16*1024*1024,me._lastTimeBufferSize=0,me._isReconnecting=!1,me}return Object(Q.a)(z,[{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),v(Object(c.a)(z.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,me){this._internalOpen(oe,me,!1)}},{key:"_internalOpen",value:function(oe,me,Re){this._dataSource=oe,Re?this._currentRange=me:this._totalRange=me;var Je=oe.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Je=this._currentRedirectedURL:oe.redirectedURL!=null&&(Je=oe.redirectedURL));var at=this._seekHandler.getConfig(Je,me);this._currentRequestURL=at.url;var kt=this._reader=new self.MSStreamReader;kt.onprogress=this._msrOnProgress.bind(this),kt.onload=this._msrOnLoad.bind(this),kt.onerror=this._msrOnError.bind(this);var jt=this._xhr=new XMLHttpRequest;if(jt.open("GET",at.url,!0),jt.responseType="ms-stream",jt.onreadystatechange=this._xhrOnReadyStateChange.bind(this),jt.onerror=this._xhrOnError.bind(this),oe.withCredentials&&(jt.withCredentials=!0),typeof at.headers=="object"){var ot=at.headers;for(var wt in ot)ot.hasOwnProperty(wt)&&jt.setRequestHeader(wt,ot[wt])}if(typeof this._config.headers=="object"){var Kt=this._config.headers;for(var Et in Kt)Kt.hasOwnProperty(Et)&&jt.setRequestHeader(Et,Kt[Et])}this._isReconnecting?this._isReconnecting=!1:this._status=r.kConnecting,jt.send()}},{key:"abort",value:function(){this._internalAbort(),this._status=r.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(oe){var me=oe.target;if(me.readyState===2)if(me.status>=200&&me.status<=299){if(this._status=r.kBuffering,me.responseURL!=null){var Re=this._seekHandler.removeURLParameters(me.responseURL);me.responseURL!==this._currentRequestURL&&Re!==this._currentRedirectedURL&&(this._currentRedirectedURL=Re,this._onURLRedirect&&this._onURLRedirect(Re))}var Je=me.getResponseHeader("Content-Length");if(Je!=null&&this._contentLength==null){var at=parseInt(Je);at>0&&(this._contentLength=at,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=r.kError,this._onError)this._onError(t.HTTP_STATUS_CODE_INVALID,{code:me.status,msg:me.statusText});else throw new i("MSStreamLoader: Http code invalid, "+me.status+" "+me.statusText);else if(me.readyState===3&&(me.status>=200&&me.status<=299)){this._status=r.kBuffering;var kt=me.response;this._reader.readAsArrayBuffer(kt)}}},{key:"_xhrOnError",value:function(oe){this._status=r.kError;var me=t.EXCEPTION,Re={code:-1,msg:oe.constructor.name+" "+oe.type};if(this._onError)this._onError(me,Re);else throw new i(Re.msg)}},{key:"_msrOnProgress",value:function(oe){var me=oe.target,Re=me.result;if(Re==null){this._doReconnectIfNeeded();return}var Je=Re.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=Re.byteLength;var at=this._totalRange.from+this._receivedLength;this._receivedLength+=Je.byteLength,this._onDataArrival&&this._onDataArrival(Je,at,this._receivedLength),Re.byteLength>=this._bufferLimit&&(w.v(this.TAG,"MSStream buffer exceeded max size near ".concat(at+Je.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 oe={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,oe,!0)}}},{key:"_msrOnLoad",value:function(oe){this._status=r.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}},{key:"_msrOnError",value:function(oe){this._status=r.kError;var me=0,Re=null;if(this._contentLength&&this._receivedLength<this._contentLength?(me=t.EARLY_EOF,Re={code:-1,msg:"MSStream meet Early-Eof"}):(me=t.EARLY_EOF,Re={code:-1,msg:oe.constructor.name+" "+oe.type}),this._onError)this._onError(me,Re);else throw new i(Re.msg)}}],[{key:"isSupported",value:function(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;var oe=new XMLHttpRequest;return oe.open("GET","https://example.com",!0),oe.responseType="ms-stream",oe.responseType==="ms-stream"}catch(me){return w.w("MSStreamLoader",me.message),!1}}}]),z}(n),A=O,P=function(Ae){Object(u.a)(z,Ae);var ge=Object(o.a)(z);function z(Z,oe){var me;return Object(ue.a)(this,z),me=ge.call(this,"xhr-range-loader"),me.TAG="RangeLoader",me._seekHandler=Z,me._config=oe,me._needStash=!1,me._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],me._currentChunkSizeKB=384,me._currentSpeedNormalized=0,me._zeroSpeedChunkCount=0,me._xhr=null,me._speedSampler=new p,me._requestAbort=!1,me._waitForTotalLength=!1,me._totalLengthReceived=!1,me._currentRequestURL=null,me._currentRedirectedURL=null,me._currentRequestRange=null,me._totalLength=null,me._contentLength=null,me._receivedLength=0,me._lastTimeLoaded=0,me}return Object(Q.a)(z,[{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),v(Object(c.a)(z.prototype),"destroy",this).call(this)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}},{key:"open",value:function(oe,me){this._dataSource=oe,this._range=me,this._status=r.kConnecting;var Re=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(Re=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!Re?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}},{key:"_openSubRange",value:function(){var oe=this._currentChunkSizeKB*1024,me=this._range.from+this._receivedLength,Re=me+oe;this._contentLength!=null&&(Re-this._range.from>=this._contentLength&&(Re=this._range.from+this._contentLength-1)),this._currentRequestRange={from:me,to:Re},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(oe,me){this._lastTimeLoaded=0;var Re=oe.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Re=this._currentRedirectedURL:oe.redirectedURL!=null&&(Re=oe.redirectedURL));var Je=this._seekHandler.getConfig(Re,me);this._currentRequestURL=Je.url;var at=this._xhr=new XMLHttpRequest;if(at.open("GET",Je.url,!0),at.responseType="arraybuffer",at.onreadystatechange=this._onReadyStateChange.bind(this),at.onprogress=this._onProgress.bind(this),at.onload=this._onLoad.bind(this),at.onerror=this._onXhrError.bind(this),oe.withCredentials&&(at.withCredentials=!0),typeof Je.headers=="object"){var kt=Je.headers;for(var jt in kt)kt.hasOwnProperty(jt)&&at.setRequestHeader(jt,kt[jt])}if(typeof this._config.headers=="object"){var ot=this._config.headers;for(var wt in ot)ot.hasOwnProperty(wt)&&at.setRequestHeader(wt,ot[wt])}at.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=r.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(oe){var me=oe.target;if(me.readyState===2){if(me.responseURL!=null){var Re=this._seekHandler.removeURLParameters(me.responseURL);me.responseURL!==this._currentRequestURL&&Re!==this._currentRedirectedURL&&(this._currentRedirectedURL=Re,this._onURLRedirect&&this._onURLRedirect(Re))}if(me.status>=200&&me.status<=299){if(this._waitForTotalLength)return;this._status=r.kBuffering}else if(this._status=r.kError,this._onError)this._onError(t.HTTP_STATUS_CODE_INVALID,{code:me.status,msg:me.statusText});else throw new i("RangeLoader: Http code invalid, "+me.status+" "+me.statusText)}}},{key:"_onProgress",value:function(oe){if(this._status===r.kError)return;if(this._contentLength===null){var me=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,me=!0;var Re=oe.total;this._internalAbort(),Re!=null&Re!==0&&(this._totalLength=Re)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,me){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Je=oe.loaded-this._lastTimeLoaded;this._lastTimeLoaded=oe.loaded,this._speedSampler.addBytes(Je)}},{key:"_normalizeSpeed",value:function(oe){var me=this._chunkSizeKBList,Re=me.length-1,Je=0,at=0,kt=Re;if(oe<me[0])return me[0];for(;at<=kt;){if(Je=at+Math.floor((kt-at)/2),Je===Re||oe>=me[Je]&&oe<me[Je+1])return me[Je];me[Je]<oe?at=Je+1:kt=Je-1}}},{key:"_onLoad",value:function(oe){if(this._status===r.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var me=this._speedSampler.lastSecondKBps;if(me===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(me=this._speedSampler.currentKBps)),me!==0){var Re=this._normalizeSpeed(me);this._currentSpeedNormalized!==Re&&(this._currentSpeedNormalized=Re,this._currentChunkSizeKB=Re)}var Je=oe.target.response,at=this._range.from+this._receivedLength;this._receivedLength+=Je.byteLength;var kt=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():kt=!0,this._onDataArrival&&this._onDataArrival(Je,at,this._receivedLength),kt&&(this._status=r.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},{key:"_onXhrError",value:function(oe){this._status=r.kError;var me=0,Re=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(me=t.EARLY_EOF,Re={code:-1,msg:"RangeLoader meet Early-Eof"}):(me=t.EXCEPTION,Re={code:-1,msg:oe.constructor.name+" "+oe.type}),this._onError)this._onError(me,Re);else throw new i(Re.msg)}}],[{key:"isSupported",value:function(){try{var oe=new XMLHttpRequest;return oe.open("GET","https://example.com",!0),oe.responseType="arraybuffer",oe.responseType==="arraybuffer"}catch(me){return w.w("RangeLoader",me.message),!1}}}]),z}(n),I=P,W=function(Ae){Object(u.a)(z,Ae);var ge=Object(o.a)(z);function z(){var Z;return Object(ue.a)(this,z),Z=ge.call(this,"websocket-loader"),Z.TAG="WebSocketLoader",Z._needStash=!0,Z._ws=null,Z._requestAbort=!1,Z._receivedLength=0,Z}return Object(Q.a)(z,[{key:"destroy",value:function(){this._ws&&this.abort(),v(Object(c.a)(z.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe){try{var me=this._ws=new self.WebSocket(oe.url);me.binaryType="arraybuffer",me.onopen=this._onWebSocketOpen.bind(this),me.onclose=this._onWebSocketClose.bind(this),me.onmessage=this._onWebSocketMessage.bind(this),me.onerror=this._onWebSocketError.bind(this),this._status=r.kConnecting}catch(Je){this._status=r.kError;var Re={code:Je.code,msg:Je.message};if(this._onError)this._onError(t.EXCEPTION,Re);else throw new i(Re.msg)}}},{key:"abort",value:function(){var oe=this._ws;oe&&(oe.readyState===0||oe.readyState===1)&&(this._requestAbort=!0,oe.close()),this._ws=null,this._status=r.kComplete}},{key:"_onWebSocketOpen",value:function(oe){this._status=r.kBuffering}},{key:"_onWebSocketClose",value:function(oe){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=r.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}},{key:"_onWebSocketMessage",value:function(oe){var me=this;if(oe.data instanceof ArrayBuffer)this._dispatchArrayBuffer(oe.data);else if(oe.data instanceof Blob){var Re=new FileReader;Re.onload=function(){me._dispatchArrayBuffer(Re.result)},Re.readAsArrayBuffer(oe.data)}else{this._status=r.kError;var Je={code:-1,msg:"Unsupported WebSocket message type: "+oe.data.constructor.name};if(this._onError)this._onError(t.EXCEPTION,Je);else throw new i(Je.msg)}}},{key:"_dispatchArrayBuffer",value:function(oe){var me=oe,Re=this._receivedLength;this._receivedLength+=me.byteLength,this._onDataArrival&&this._onDataArrival(me,Re,this._receivedLength)}},{key:"_onWebSocketError",value:function(oe){this._status=r.kError;var me={code:oe.code,msg:oe.message};if(this._onError)this._onError(t.EXCEPTION,me);else throw new i(me.msg)}}],[{key:"isSupported",value:function(){try{return typeof self.WebSocket!="undefined"}catch(oe){return!1}}}]),z}(n),K=W,te=function(){function Ae(ge){Object(ue.a)(this,Ae),this._zeroStart=ge||!1}return Object(Q.a)(Ae,[{key:"getConfig",value:function(z,Z){var oe={};if(Z.from!==0||Z.to!==-1){var me;Z.to!==-1?me="bytes=".concat(Z.from.toString(),"-").concat(Z.to.toString()):me="bytes=".concat(Z.from.toString(),"-"),oe.Range=me}else this._zeroStart&&(oe.Range="bytes=0-");return{url:z,headers:oe}}},{key:"removeURLParameters",value:function(z){return z}}]),Ae}(),H=te,G=function(){function Ae(ge,z){Object(ue.a)(this,Ae),this._startName=ge,this._endName=z}return Object(Q.a)(Ae,[{key:"getConfig",value:function(z,Z){var oe=z;if(Z.from!==0||Z.to!==-1){var me=!0;oe.indexOf("?")===-1&&(oe+="?",me=!1),me&&(oe+="&"),oe+="".concat(this._startName,"=").concat(Z.from.toString()),Z.to!==-1&&(oe+="&".concat(this._endName,"=").concat(Z.to.toString()))}return{url:oe,headers:{}}}},{key:"removeURLParameters",value:function(z){var Z=z.split("?")[0],oe=void 0,me=z.indexOf("?");me!==-1&&(oe=z.substring(me+1));var Re="";if(oe!=null&&oe.length>0)for(var Je=oe.split("&"),at=0;at<Je.length;at++){var kt=Je[at].split("="),jt=at>0;kt[0]!==this._startName&&kt[0]!==this._endName&&(jt&&(Re+="&"),Re+=Je[at])}return Re.length===0?Z:Z+"?"+Re}}]),Ae}(),V=G,re=function(){function Ae(ge,z,Z){Object(ue.a)(this,Ae),this.TAG="IOController",this._config=z,this._extraData=Z,this._stashInitialSize=1024*384,z.stashInitialSize!=null&&z.stashInitialSize>0&&(this._stashInitialSize=z.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,z.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=ge,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(ge.url),this._refTotalLength=ge.filesize?ge.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new p,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(Q.a)(Ae,[{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(z){this._extraData=z}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(z){this._onDataArrival=z}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(z){this._onSeeked=z}},{key:"onError",get:function(){return this._onError},set:function(z){this._onError=z}},{key:"onComplete",get:function(){return this._onComplete},set:function(z){this._onComplete=z}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(z){this._onRedirect=z}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(z){this._onRecoveredEarlyEof=z}},{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===I?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var z=this._config;if(z.seekType==="range")this._seekHandler=new H(this._config.rangeLoadZeroStart);else if(z.seekType==="param"){var Z=z.seekParamStart||"bstart",oe=z.seekParamEnd||"bend";this._seekHandler=new V(Z,oe)}else if(z.seekType==="custom"){if(typeof z.customSeekHandler!="function")throw new s("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new z.customSeekHandler}else throw new s("Invalid seekType in config: ".concat(z.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=K;else if(C.isSupported())this._loaderClass=C;else if(_.isSupported())this._loaderClass=_;else if(I.isSupported())this._loaderClass=I;else throw new i("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(z){this._currentRange={from:0,to:-1},z&&(this._currentRange.from=z),this._speedSampler.reset(),z||(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 z=this._resumeFrom;this._resumeFrom=0,this._internalSeek(z,!0)}}},{key:"seek",value:function(z){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(z,!0)}},{key:"_internalSeek",value:function(z,Z){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(Z),this._loader.destroy(),this._loader=null;var oe={from:z,to:-1};this._currentRange={from:oe.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,oe),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(z){if(!z||typeof z!="string"||z.length===0)throw new s("Url must be a non-empty string!");this._dataSource.url=z}},{key:"_expandBuffer",value:function(z){for(var Z=this._stashSize;Z+1024*1024*1<z;)Z*=2;if(Z+=1024*1024*1,Z===this._bufferSize)return;var oe=new ArrayBuffer(Z);if(this._stashUsed>0){var me=new Uint8Array(this._stashBuffer,0,this._stashUsed),Re=new Uint8Array(oe,0,Z);Re.set(me,0)}this._stashBuffer=oe,this._bufferSize=Z}},{key:"_normalizeSpeed",value:function(z){var Z=this._speedNormalizeList,oe=Z.length-1,me=0,Re=0,Je=oe;if(z<Z[0])return Z[0];for(;Re<=Je;){if(me=Re+Math.floor((Je-Re)/2),me===oe||z>=Z[me]&&z<Z[me+1])return Z[me];Z[me]<z?Re=me+1:Je=me-1}}},{key:"_adjustStashSize",value:function(z){var Z=0;this._config.isLive||z<512?Z=z:z>=512&&z<=1024?Z=Math.floor(z*1.5):Z=z*2,Z>8192&&(Z=8192);var oe=Z*1024+1024*1024*1;this._bufferSize<oe&&this._expandBuffer(oe),this._stashSize=Z*1024}},{key:"_dispatchChunks",value:function(z,Z){return this._currentRange.to=Z+z.byteLength-1,this._onDataArrival(z,Z)}},{key:"_onURLRedirect",value:function(z){this._redirectedURL=z,this._onRedirect&&this._onRedirect(z)}},{key:"_onContentLengthKnown",value:function(z){z&&this._fullRequestFlag&&(this._totalLength=z,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(z,Z,oe){if(!this._onDataArrival)throw new l("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(z.byteLength);var me=this._speedSampler.lastSecondKBps;if(me!==0){var Re=this._normalizeSpeed(me);this._speedNormalized!==Re&&(this._speedNormalized=Re,this._adjustStashSize(Re))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=Z),this._stashUsed+z.byteLength<=this._stashSize){var Kt=new Uint8Array(this._stashBuffer,0,this._stashSize);Kt.set(new Uint8Array(z),this._stashUsed),this._stashUsed+=z.byteLength}else{var Et=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var Qt=this._stashBuffer.slice(0,this._stashUsed),Vt=this._dispatchChunks(Qt,this._stashByteStart);if(Vt<Qt.byteLength){if(Vt>0){var ie=new Uint8Array(Qt,Vt);Et.set(ie,0),this._stashUsed=ie.byteLength,this._stashByteStart+=Vt}}else this._stashUsed=0,this._stashByteStart+=Vt;this._stashUsed+z.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+z.byteLength),Et=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Et.set(new Uint8Array(z),this._stashUsed),this._stashUsed+=z.byteLength}else{var N=this._dispatchChunks(z,Z);if(N<z.byteLength){var B=z.byteLength-N;B>this._bufferSize&&(this._expandBuffer(B),Et=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Et.set(new Uint8Array(z,N),0),this._stashUsed+=B,this._stashByteStart=Z+N}}}else if(this._stashUsed===0){var Je=this._dispatchChunks(z,Z);if(Je<z.byteLength){var at=z.byteLength-Je;at>this._bufferSize&&this._expandBuffer(at);var kt=new Uint8Array(this._stashBuffer,0,this._bufferSize);kt.set(new Uint8Array(z,Je),0),this._stashUsed+=at,this._stashByteStart=Z+Je}}else{this._stashUsed+z.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+z.byteLength);var jt=new Uint8Array(this._stashBuffer,0,this._bufferSize);jt.set(new Uint8Array(z),this._stashUsed),this._stashUsed+=z.byteLength;var ot=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(ot<this._stashUsed&&ot>0){var wt=new Uint8Array(this._stashBuffer,ot);jt.set(wt,0)}this._stashUsed-=ot,this._stashByteStart+=ot}}},{key:"_flushStashBuffer",value:function(z){if(this._stashUsed>0){var Z=this._stashBuffer.slice(0,this._stashUsed),oe=this._dispatchChunks(Z,this._stashByteStart),me=Z.byteLength-oe;if(oe<Z.byteLength)if(z)w.w(this.TAG,"".concat(me," bytes unconsumed data remain when flush buffer, dropped"));else{if(oe>0){var Re=new Uint8Array(this._stashBuffer,0,this._bufferSize),Je=new Uint8Array(Z,oe);Re.set(Je,0),this._stashUsed=Je.byteLength,this._stashByteStart+=oe}return 0}return this._stashUsed=0,this._stashByteStart=0,me}return 0}},{key:"_onLoaderComplete",value:function(z,Z){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(z,Z){w.e(this.TAG,"Loader error, code = ".concat(Z.code,", msg = ").concat(Z.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,z=t.UNRECOVERABLE_EARLY_EOF);switch(z){case t.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var oe=this._currentRange.to+1;oe<this._totalLength&&(w.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(oe,!1));return}z=t.UNRECOVERABLE_EARLY_EOF;break}case t.UNRECOVERABLE_EARLY_EOF:case t.CONNECTING_TIMEOUT:case t.HTTP_STATUS_CODE_INVALID:case t.EXCEPTION:break}if(this._onError)this._onError(z,Z);else throw new i("IOException: "+Z.msg)}}]),Ae}(),$=re,ne={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 he(){return Object.assign({},ne)}var pe=function(){function Ae(){Object(ue.a)(this,Ae)}return Object(Q.a)(Ae,null,[{key:"supportMSEH264Playback",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"supportNetworkStreamIO",value:function(){var z=new $({},he()),Z=z.loaderType;return z.destroy(),Z=="fetch-stream-loader"||Z=="xhr-moz-chunked-loader"}},{key:"getNetworkLoaderTypeName",value:function(){var z=new $({},he()),Z=z.loaderType;return z.destroy(),Z}},{key:"supportNativeMediaPlayback",value:function(z){Ae.videoElement==null&&(Ae.videoElement=window.document.createElement("video"));var Z=Ae.videoElement.canPlayType(z);return Z==="probably"||Z=="maybe"}},{key:"getFeatureList",value:function(){var z={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return z.mseFlvPlayback=Ae.supportMSEH264Playback(),z.networkStreamIO=Ae.supportNetworkStreamIO(),z.networkLoaderName=Ae.getNetworkLoaderTypeName(),z.mseLiveFlvPlayback=z.mseFlvPlayback&&z.networkStreamIO,z.nativeMP4H264Playback=Ae.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),z.nativeWebmVP8Playback=Ae.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),z.nativeWebmVP9Playback=Ae.supportNativeMediaPlayback('video/webm; codecs="vp9"'),z}}]),Ae}(),Te=pe,we={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"},Me=we,Ee=function(){function Ae(){Object(ue.a)(this,Ae)}return Object(Q.a)(Ae,null,[{key:"forceGlobalTag",get:function(){return w.FORCE_GLOBAL_TAG},set:function(z){w.FORCE_GLOBAL_TAG=z,Ae._notifyChange()}},{key:"globalTag",get:function(){return w.GLOBAL_TAG},set:function(z){w.GLOBAL_TAG=z,Ae._notifyChange()}},{key:"enableAll",get:function(){return w.ENABLE_VERBOSE&&w.ENABLE_DEBUG&&w.ENABLE_INFO&&w.ENABLE_WARN&&w.ENABLE_ERROR},set:function(z){w.ENABLE_VERBOSE=z,w.ENABLE_DEBUG=z,w.ENABLE_INFO=z,w.ENABLE_WARN=z,w.ENABLE_ERROR=z,Ae._notifyChange()}},{key:"enableDebug",get:function(){return w.ENABLE_DEBUG},set:function(z){w.ENABLE_DEBUG=z,Ae._notifyChange()}},{key:"enableVerbose",get:function(){return w.ENABLE_VERBOSE},set:function(z){w.ENABLE_VERBOSE=z,Ae._notifyChange()}},{key:"enableInfo",get:function(){return w.ENABLE_INFO},set:function(z){w.ENABLE_INFO=z,Ae._notifyChange()}},{key:"enableWarn",get:function(){return w.ENABLE_WARN},set:function(z){w.ENABLE_WARN=z,Ae._notifyChange()}},{key:"enableError",get:function(){return w.ENABLE_ERROR},set:function(z){w.ENABLE_ERROR=z,Ae._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(z){w.GLOBAL_TAG=z.globalTag,w.FORCE_GLOBAL_TAG=z.forceGlobalTag,w.ENABLE_VERBOSE=z.enableVerbose,w.ENABLE_DEBUG=z.enableDebug,w.ENABLE_INFO=z.enableInfo,w.ENABLE_WARN=z.enableWarn,w.ENABLE_ERROR=z.enableError,w.ENABLE_CALLBACK=z.enableCallback}},{key:"_notifyChange",value:function(){var z=Ae.emitter;if(z.listenerCount("change")>0){var Z=Ae.getConfig();z.emit("change",Z)}}},{key:"registerListener",value:function(z){Ae.emitter.addListener("change",z)}},{key:"removeListener",value:function(z){Ae.emitter.removeListener("change",z)}},{key:"addLogListener",value:function(z){w.emitter.addListener("log",z),w.emitter.listenerCount("log")>0&&(w.ENABLE_CALLBACK=!0,Ae._notifyChange())}},{key:"removeLogListener",value:function(z){w.emitter.removeListener("log",z),w.emitter.listenerCount("log")===0&&(w.ENABLE_CALLBACK=!1,Ae._notifyChange())}}]),Ae}();Ee.emitter=new x.a;var xe=Ee,Ge=function(){function Ae(){Object(ue.a)(this,Ae),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(Q.a)(Ae,[{key:"isComplete",value:function(){var z=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,Z=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&&z&&Z}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(z){if(this.keyframesIndex==null)return null;var Z=this.keyframesIndex,oe=this._search(Z.times,z);return{index:oe,milliseconds:Z.times[oe],fileposition:Z.filepositions[oe]}}},{key:"_search",value:function(z,Z){var oe=0,me=z.length-1,Re=0,Je=0,at=me;for(Z<z[0]&&(oe=0,Je=at+1);Je<=at;)if(Re=Je+Math.floor((at-Je)/2),Re===me||Z>=z[Re]&&Z<z[Re+1]){oe=Re;break}else z[Re]<Z?Je=Re+1:at=Re-1;return oe}}]),Ae}(),je=Ge;function We(Ae,ge,z){var Z=Ae;if(ge+z<Z.length){for(;z--;)if((Z[++ge]&192)!==128)return!1;return!0}else return!1}function ze(Ae){for(var ge=[],z=Ae,Z=0,oe=Ae.length;Z<oe;){if(z[Z]<128){ge.push(String.fromCharCode(z[Z])),++Z;continue}else if(!(z[Z]<192)){if(z[Z]<224){if(We(z,Z,1)){var me=(z[Z]&31)<<6|z[Z+1]&63;if(me>=128){ge.push(String.fromCharCode(me&65535)),Z+=2;continue}}}else if(z[Z]<240){if(We(z,Z,2)){var Re=(z[Z]&15)<<12|(z[Z+1]&63)<<6|z[Z+2]&63;if(Re>=2048&&(Re&63488)!==55296){ge.push(String.fromCharCode(Re&65535)),Z+=3;continue}}}else if(z[Z]<248&&We(z,Z,3)){var Je=(z[Z]&7)<<18|(z[Z+1]&63)<<12|(z[Z+2]&63)<<6|z[Z+3]&63;if(Je>65536&&Je<1114112){Je-=65536,ge.push(String.fromCharCode(Je>>>10|55296)),ge.push(String.fromCharCode(Je&1023|56320)),Z+=4;continue}}}ge.push(String.fromCharCode(65533)),++Z}return ge.join("")}var de=ze,le=function(){var Ae=new ArrayBuffer(2);return new DataView(Ae).setInt16(0,256,!0),new Int16Array(Ae)[0]===256}(),Oe=function(){function Ae(){Object(ue.a)(this,Ae)}return Object(Q.a)(Ae,null,[{key:"parseScriptData",value:function(z,Z,oe){var me={};try{var Re=Ae.parseValue(z,Z,oe),Je=Ae.parseValue(z,Z+Re.size,oe-Re.size);me[Re.data]=Je.data}catch(at){w.e("AMF",at.toString())}return me}},{key:"parseObject",value:function(z,Z,oe){if(oe<3)throw new l("Data not enough when parse ScriptDataObject");var me=Ae.parseString(z,Z,oe),Re=Ae.parseValue(z,Z+me.size,oe-me.size),Je=Re.objectEnd;return{data:{name:me.data,value:Re.data},size:me.size+Re.size,objectEnd:Je}}},{key:"parseVariable",value:function(z,Z,oe){return Ae.parseObject(z,Z,oe)}},{key:"parseString",value:function(z,Z,oe){if(oe<2)throw new l("Data not enough when parse String");var me=new DataView(z,Z,oe),Re=me.getUint16(0,!le),Je;return Re>0?Je=de(new Uint8Array(z,Z+2,Re)):Je="",{data:Je,size:2+Re}}},{key:"parseLongString",value:function(z,Z,oe){if(oe<4)throw new l("Data not enough when parse LongString");var me=new DataView(z,Z,oe),Re=me.getUint32(0,!le),Je;return Re>0?Je=de(new Uint8Array(z,Z+4,Re)):Je="",{data:Je,size:4+Re}}},{key:"parseDate",value:function(z,Z,oe){if(oe<10)throw new l("Data size invalid when parse Date");var me=new DataView(z,Z,oe),Re=me.getFloat64(0,!le),Je=me.getInt16(8,!le);return Re+=Je*60*1e3,{data:new Date(Re),size:8+2}}},{key:"parseValue",value:function(z,Z,oe){if(oe<1)throw new l("Data not enough when parse Value");var me=new DataView(z,Z,oe),Re=1,Je=me.getUint8(0),at,kt=!1;try{switch(Je){case 0:at=me.getFloat64(1,!le),Re+=8;break;case 1:{var jt=me.getUint8(1);at=!!jt,Re+=1;break}case 2:{var ot=Ae.parseString(z,Z+1,oe-1);at=ot.data,Re+=ot.size;break}case 3:{at={};var wt=0;for((me.getUint32(oe-4,!le)&16777215)===9&&(wt=3);Re<oe-4;){var Kt=Ae.parseObject(z,Z+Re,oe-Re-wt);if(Kt.objectEnd)break;at[Kt.data.name]=Kt.data.value,Re+=Kt.size}if(Re<=oe-3){var Et=me.getUint32(Re-1,!le)&16777215;Et===9&&(Re+=3)}break}case 8:{at={},Re+=4;var Qt=0;for((me.getUint32(oe-4,!le)&16777215)===9&&(Qt=3);Re<oe-8;){var Vt=Ae.parseVariable(z,Z+Re,oe-Re-Qt);if(Vt.objectEnd)break;at[Vt.data.name]=Vt.data.value,Re+=Vt.size}if(Re<=oe-3){var ie=me.getUint32(Re-1,!le)&16777215;ie===9&&(Re+=3)}break}case 9:at=void 0,Re=1,kt=!0;break;case 10:{at=[];var N=me.getUint32(1,!le);Re+=4;for(var B=0;B<N;B++){var ae=Ae.parseValue(z,Z+Re,oe-Re);at.push(ae.data),Re+=ae.size}break}case 11:{var fe=Ae.parseDate(z,Z+1,oe-1);at=fe.data,Re+=fe.size;break}case 12:{var se=Ae.parseString(z,Z+1,oe-1);at=se.data,Re+=se.size;break}default:Re=oe,w.w("AMF","Unsupported AMF value type "+Je)}}catch($e){w.e("AMF",$e.toString())}return{data:at,size:Re,objectEnd:kt}}}]),Ae}(),Ie=Oe,qe=function(){function Ae(ge){Object(ue.a)(this,Ae),this.TAG="ExpGolomb",this._buffer=ge,this._buffer_index=0,this._total_bytes=ge.byteLength,this._total_bits=ge.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return Object(Q.a)(Ae,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var z=this._total_bytes-this._buffer_index;if(z<=0)throw new l("ExpGolomb: _fillCurrentWord() but no bytes available");var Z=Math.min(4,z),oe=new Uint8Array(4);oe.set(this._buffer.subarray(this._buffer_index,this._buffer_index+Z)),this._current_word=new DataView(oe.buffer).getUint32(0,!1),this._buffer_index+=Z,this._current_word_bits_left=Z*8}},{key:"readBits",value:function(z){if(z>32)throw new s("ExpGolomb: readBits() bits exceeded max 32bits!");if(z<=this._current_word_bits_left){var Z=this._current_word>>>32-z;return this._current_word<<=z,this._current_word_bits_left-=z,Z}var oe=this._current_word_bits_left?this._current_word:0;oe=oe>>>32-this._current_word_bits_left;var me=z-this._current_word_bits_left;this._fillCurrentWord();var Re=Math.min(me,this._current_word_bits_left),Je=this._current_word>>>32-Re;return this._current_word<<=Re,this._current_word_bits_left-=Re,oe=oe<<Re|Je,oe}},{key:"readBool",value:function(){return this.readBits(1)===1}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var z;for(z=0;z<this._current_word_bits_left;z++)if((this._current_word&2147483648>>>z)!==0)return this._current_word<<=z,this._current_word_bits_left-=z,z;return this._fillCurrentWord(),z+this._skipLeadingZero()}},{key:"readUEG",value:function(){var z=this._skipLeadingZero();return this.readBits(z+1)-1}},{key:"readSEG",value:function(){var z=this.readUEG();return z&1?z+1>>>1:-1*(z>>>1)}}]),Ae}(),ee=qe,k=function(){function Ae(){Object(ue.a)(this,Ae)}return Object(Q.a)(Ae,null,[{key:"_ebsp2rbsp",value:function(z){for(var Z=z,oe=Z.byteLength,me=new Uint8Array(oe),Re=0,Je=0;Je<oe;Je++){if(Je>=2&&(Z[Je]===3&&Z[Je-1]===0&&Z[Je-2]===0))continue;me[Re]=Z[Je],Re++}return new Uint8Array(me.buffer,0,Re)}},{key:"parseSPS",value:function(z){var Z=Ae._ebsp2rbsp(z),oe=new ee(Z);oe.readByte();var me=oe.readByte();oe.readByte();var Re=oe.readByte();oe.readUEG();var Je=Ae.getProfileString(me),at=Ae.getLevelString(Re),kt=1,jt=420,ot=[0,420,422,444],wt=8;if((me===100||me===110||me===122||me===244||me===44||me===83||me===86||me===118||me===128||me===138||me===144)&&(kt=oe.readUEG(),kt===3&&oe.readBits(1),kt<=3&&(jt=ot[kt]),wt=oe.readUEG()+8,oe.readUEG(),oe.readBits(1),oe.readBool()))for(var Kt=kt!==3?8:12,Et=0;Et<Kt;Et++)oe.readBool()&&(Et<6?Ae._skipScalingList(oe,16):Ae._skipScalingList(oe,64));oe.readUEG();var Qt=oe.readUEG();if(Qt===0)oe.readUEG();else if(Qt===1){oe.readBits(1),oe.readSEG(),oe.readSEG();for(var Vt=oe.readUEG(),ie=0;ie<Vt;ie++)oe.readSEG()}var N=oe.readUEG();oe.readBits(1);var B=oe.readUEG(),ae=oe.readUEG(),fe=oe.readBits(1);fe===0&&oe.readBits(1),oe.readBits(1);var se=0,$e=0,St=0,Pt=0,$t=oe.readBool();$t&&(se=oe.readUEG(),$e=oe.readUEG(),St=oe.readUEG(),Pt=oe.readUEG());var Ot=1,zt=1,an=0,jn=!0,Dr=0,Cr=0,Nn=oe.readBool();if(Nn){if(oe.readBool()){var hr=oe.readByte(),mi=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Or=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];hr>0&&hr<16?(Ot=mi[hr-1],zt=Or[hr-1]):hr===255&&(Ot=oe.readByte()<<8|oe.readByte(),zt=oe.readByte()<<8|oe.readByte())}if(oe.readBool()&&oe.readBool(),oe.readBool()&&(oe.readBits(4),oe.readBool()&&oe.readBits(24)),oe.readBool()&&(oe.readUEG(),oe.readUEG()),oe.readBool()){var yr=oe.readBits(32),pr=oe.readBits(32);jn=oe.readBool(),Dr=pr,Cr=yr*2,an=Dr/Cr}}var Yr=1;(Ot!==1||zt!==1)&&(Yr=Ot/zt);var Mr=0,Zr=0;if(kt===0)Mr=1,Zr=2-fe;else{var wr=kt===3?1:2,vi=kt===1?2:1;Mr=wr,Zr=vi*(2-fe)}var li=(B+1)*16,Kr=(2-fe)*((ae+1)*16);li-=(se+$e)*Mr,Kr-=(St+Pt)*Zr;var zr=Math.ceil(li*Yr);return oe.destroy(),oe=null,{profile_string:Je,level_string:at,bit_depth:wt,ref_frames:N,chroma_format:jt,chroma_format_string:Ae.getChromaFormatString(jt),frame_rate:{fixed:jn,fps:an,fps_den:Cr,fps_num:Dr},sar_ratio:{width:Ot,height:zt},codec_size:{width:li,height:Kr},present_size:{width:zr,height:Kr}}}},{key:"_skipScalingList",value:function(z,Z){for(var oe=8,me=8,Re=0,Je=0;Je<Z;Je++)me!==0&&(Re=z.readSEG(),me=(oe+Re+256)%256),oe=me===0?oe:me}},{key:"getProfileString",value:function(z){switch(z){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(z){return(z/10).toFixed(1)}},{key:"getChromaFormatString",value:function(z){switch(z){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),Ae}(),U=k,q={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"},Y=q;function J(Ae){return Ae>>>8&255|(Ae&255)<<8}function be(Ae){return(Ae&4278190080)>>>24|(Ae&16711680)>>>8|(Ae&65280)<<8|(Ae&255)<<24}function ke(Ae,ge){return Ae[ge]<<24|Ae[ge+1]<<16|Ae[ge+2]<<8|Ae[ge+3]}var ct=function(){function Ae(ge,z){Object(ue.a)(this,Ae),this.TAG="FLVDemuxer",this._config=z,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=ge.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=ge.hasAudioTrack,this._hasVideo=ge.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new je,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 Z=new ArrayBuffer(2);return new DataView(Z).setInt16(0,256,!0),new Int16Array(Z)[0]===256}()}return Object(Q.a)(Ae,[{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(z){return z.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(z){this._onTrackMetadata=z}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(z){this._onMediaInfo=z}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(z){this._onMetaDataArrived=z}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(z){this._onScriptDataArrived=z}},{key:"onError",get:function(){return this._onError},set:function(z){this._onError=z}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(z){this._onDataAvailable=z}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(z){this._timestampBase=z}},{key:"overridedDuration",get:function(){return this._duration},set:function(z){this._durationOverrided=!0,this._duration=z,this._mediaInfo.duration=z}},{key:"overridedHasAudio",set:function(z){this._hasAudioFlagOverrided=!0,this._hasAudio=z,this._mediaInfo.hasAudio=z}},{key:"overridedHasVideo",set:function(z){this._hasVideoFlagOverrided=!0,this._hasVideo=z,this._mediaInfo.hasVideo=z}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new je}},{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(z,Z){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new l("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var oe=0,me=this._littleEndian;if(Z===0)if(z.byteLength>13){var Re=Ae.probe(z);oe=Re.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,Z+oe!==this._dataOffset&&w.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Je=new DataView(z,oe),at=Je.getUint32(0,!me);at!==0&&w.w(this.TAG,"PrevTagSize0 !== 0 !!!"),oe+=4}for(;oe<z.byteLength;){this._dispatch=!0;var kt=new DataView(z,oe);if(oe+11+4>z.byteLength)break;var jt=kt.getUint8(0),ot=kt.getUint32(0,!me)&16777215;if(oe+11+ot+4>z.byteLength)break;if(jt!==8&&jt!==9&&jt!==18){w.w(this.TAG,"Unsupported tag type ".concat(jt,", skipped")),oe+=11+ot+4;continue}var wt=kt.getUint8(4),Kt=kt.getUint8(5),Et=kt.getUint8(6),Qt=kt.getUint8(7),Vt=Et|Kt<<8|wt<<16|Qt<<24,ie=kt.getUint32(7,!me)&16777215;ie!==0&&w.w(this.TAG,"Meet tag which has StreamID != 0!");var N=oe+11;switch(jt){case 8:this._parseAudioData(z,N,ot,Vt);break;case 9:this._parseVideoData(z,N,ot,Vt,Z+oe);break;case 18:this._parseScriptData(z,N,ot);break}var B=kt.getUint32(11+ot,!me);B!==11+ot&&w.w(this.TAG,"Invalid PrevTagSize ".concat(B)),oe+=11+ot+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),oe}},{key:"_parseScriptData",value:function(z,Z,oe){var me=Ie.parseScriptData(z,Z,oe);if(me.hasOwnProperty("onMetaData")){if(me.onMetaData==null||typeof me.onMetaData!="object"){w.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&w.w(this.TAG,"Found another onMetaData tag!"),this._metadata=me;var Re=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},Re)),typeof Re.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=Re.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof Re.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=Re.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof Re.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=Re.audiodatarate),typeof Re.videodatarate=="number"&&(this._mediaInfo.videoDataRate=Re.videodatarate),typeof Re.width=="number"&&(this._mediaInfo.width=Re.width),typeof Re.height=="number"&&(this._mediaInfo.height=Re.height),typeof Re.duration=="number"){if(!this._durationOverrided){var Je=Math.floor(Re.duration*this._timescale);this._duration=Je,this._mediaInfo.duration=Je}}else this._mediaInfo.duration=0;if(typeof Re.framerate=="number"){var at=Math.floor(Re.framerate*1e3);if(at>0){var kt=at/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=kt,this._referenceFrameRate.fps_num=at,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=kt}}if(typeof Re.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var jt=Re.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(jt),Re.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=Re,w.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(me).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},me)))}},{key:"_parseKeyframesIndex",value:function(z){for(var Z=[],oe=[],me=1;me<z.times.length;me++){var Re=this._timestampBase+Math.floor(z.times[me]*1e3);Z.push(Re),oe.push(z.filepositions[me])}return{times:Z,filepositions:oe}}},{key:"_parseAudioData",value:function(z,Z,oe,me){if(oe<=1){w.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;var Re=this._littleEndian,Je=new DataView(z,Z,oe),at=Je.getUint8(0),kt=at>>>4;if(kt!==2&&kt!==10){this._onError(Y.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+kt);return}var jt=0,ot=(at&12)>>>2;if(ot>=0&&ot<=4)jt=this._flvSoundRateTable[ot];else{this._onError(Y.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+ot);return}var wt=(at&2)>>>1,Kt=at&1,Et=this._audioMetadata,Qt=this._audioTrack;if(Et||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),Et=this._audioMetadata={},Et.type="audio",Et.id=Qt.id,Et.timescale=this._timescale,Et.duration=this._duration,Et.audioSampleRate=jt,Et.channelCount=Kt===0?1:2),kt===10){var Vt=this._parseAACAudioData(z,Z+1,oe-1);if(Vt==null)return;if(Vt.packetType===0){Et.config&&w.w(this.TAG,"Found another AudioSpecificConfig!");var ie=Vt.data;Et.audioSampleRate=ie.samplingRate,Et.channelCount=ie.channelCount,Et.codec=ie.codec,Et.originalCodec=ie.originalCodec,Et.config=ie.config,Et.refSampleDuration=1024/Et.audioSampleRate*Et.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",Et);var N=this._mediaInfo;N.audioCodec=Et.originalCodec,N.audioSampleRate=Et.audioSampleRate,N.audioChannelCount=Et.channelCount,N.hasVideo?N.videoCodec!=null&&(N.mimeType='video/x-flv; codecs="'+N.videoCodec+","+N.audioCodec+'"'):N.mimeType='video/x-flv; codecs="'+N.audioCodec+'"',N.isComplete()&&this._onMediaInfo(N)}else if(Vt.packetType===1){var B=this._timestampBase+me,ae={unit:Vt.data,length:Vt.data.byteLength,dts:B,pts:B};Qt.samples.push(ae),Qt.length+=Vt.data.length}else w.e(this.TAG,"Flv: Unsupported AAC data type ".concat(Vt.packetType))}else if(kt===2){if(!Et.codec){var fe=this._parseMP3AudioData(z,Z+1,oe-1,!0);if(fe==null)return;Et.audioSampleRate=fe.samplingRate,Et.channelCount=fe.channelCount,Et.codec=fe.codec,Et.originalCodec=fe.originalCodec,Et.refSampleDuration=1152/Et.audioSampleRate*Et.timescale,w.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",Et);var se=this._mediaInfo;se.audioCodec=Et.codec,se.audioSampleRate=Et.audioSampleRate,se.audioChannelCount=Et.channelCount,se.audioDataRate=fe.bitRate,se.hasVideo?se.videoCodec!=null&&(se.mimeType='video/x-flv; codecs="'+se.videoCodec+","+se.audioCodec+'"'):se.mimeType='video/x-flv; codecs="'+se.audioCodec+'"',se.isComplete()&&this._onMediaInfo(se)}var $e=this._parseMP3AudioData(z,Z+1,oe-1,!1);if($e==null)return;var St=this._timestampBase+me,Pt={unit:$e,length:$e.byteLength,dts:St,pts:St};Qt.samples.push(Pt),Qt.length+=$e.length}}},{key:"_parseAACAudioData",value:function(z,Z,oe){if(oe<=1){w.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var me={},Re=new Uint8Array(z,Z,oe);return me.packetType=Re[0],Re[0]===0?me.data=this._parseAACAudioSpecificConfig(z,Z+1,oe-1):me.data=Re.subarray(1),me}},{key:"_parseAACAudioSpecificConfig",value:function(z,Z,oe){var me=new Uint8Array(z,Z,oe),Re=null,Je=0,at=0,kt=null,jt=0,ot=null;if(Je=at=me[0]>>>3,jt=(me[0]&7)<<1|me[1]>>>7,jt<0||jt>=this._mpegSamplingRates.length){this._onError(Y.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var wt=this._mpegSamplingRates[jt],Kt=(me[1]&120)>>>3;if(Kt<0||Kt>=8){this._onError(Y.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Je===5&&(ot=(me[1]&7)<<1|me[2]>>>7,kt=(me[2]&124)>>>2);var Et=self.navigator.userAgent.toLowerCase();return Et.indexOf("firefox")!==-1?jt>=6?(Je=5,Re=new Array(4),ot=jt-3):(Je=2,Re=new Array(2),ot=jt):Et.indexOf("android")!==-1?(Je=2,Re=new Array(2),ot=jt):(Je=5,ot=jt,Re=new Array(4),jt>=6?ot=jt-3:Kt===1&&(Je=2,Re=new Array(2),ot=jt)),Re[0]=Je<<3,Re[0]|=(jt&15)>>>1,Re[1]=(jt&15)<<7,Re[1]|=(Kt&15)<<3,Je===5&&(Re[1]|=(ot&15)>>>1,Re[2]=(ot&1)<<7,Re[2]|=2<<2,Re[3]=0),{config:Re,samplingRate:wt,channelCount:Kt,codec:"mp4a.40."+Je,originalCodec:"mp4a.40."+at}}},{key:"_parseMP3AudioData",value:function(z,Z,oe,me){if(oe<4){w.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var Re=this._littleEndian,Je=new Uint8Array(z,Z,oe),at=null;if(me){if(Je[0]!==255)return;var kt=Je[1]>>>3&3,jt=(Je[1]&6)>>1,ot=(Je[2]&240)>>>4,wt=(Je[2]&12)>>>2,Kt=Je[3]>>>6&3,Et=Kt!==3?2:1,Qt=0,Vt=0,ie=34,N="mp3";switch(kt){case 0:Qt=this._mpegAudioV25SampleRateTable[wt];break;case 2:Qt=this._mpegAudioV20SampleRateTable[wt];break;case 3:Qt=this._mpegAudioV10SampleRateTable[wt];break}switch(jt){case 1:ie=34,ot<this._mpegAudioL3BitRateTable.length&&(Vt=this._mpegAudioL3BitRateTable[ot]);break;case 2:ie=33,ot<this._mpegAudioL2BitRateTable.length&&(Vt=this._mpegAudioL2BitRateTable[ot]);break;case 3:ie=32,ot<this._mpegAudioL1BitRateTable.length&&(Vt=this._mpegAudioL1BitRateTable[ot]);break}at={bitRate:Vt,samplingRate:Qt,channelCount:Et,codec:N,originalCodec:N}}else at=Je;return at}},{key:"_parseVideoData",value:function(z,Z,oe,me,Re){if(oe<=1){w.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;var Je=new Uint8Array(z,Z,oe)[0],at=(Je&240)>>>4,kt=Je&15;if(kt!==7){this._onError(Y.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(kt));return}this._parseAVCVideoPacket(z,Z+1,oe-1,me,Re,at)}},{key:"_parseAVCVideoPacket",value:function(z,Z,oe,me,Re,Je){if(oe<4){w.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var at=this._littleEndian,kt=new DataView(z,Z,oe),jt=kt.getUint8(0),ot=kt.getUint32(0,!at)&16777215,wt=ot<<8>>8;if(jt===0)this._parseAVCDecoderConfigurationRecord(z,Z+4,oe-4);else if(jt===1)this._parseAVCVideoData(z,Z+4,oe-4,me,Re,Je,wt);else if(!(jt===2)){this._onError(Y.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(jt));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(z,Z,oe){if(oe<7){w.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var me=this._videoMetadata,Re=this._videoTrack,Je=this._littleEndian,at=new DataView(z,Z,oe);me?typeof me.avcc!="undefined"&&w.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),me=this._videoMetadata={},me.type="video",me.id=Re.id,me.timescale=this._timescale,me.duration=this._duration);var kt=at.getUint8(0),jt=at.getUint8(1),ot=at.getUint8(2),wt=at.getUint8(3);if(kt!==1||jt===0){this._onError(Y.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(at.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(Y.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var Kt=at.getUint8(5)&31;if(Kt===0){this._onError(Y.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Kt>1&&w.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(Kt));for(var Et=6,Qt=0;Qt<Kt;Qt++){var Vt=at.getUint16(Et,!Je);if(Et+=2,Vt===0)continue;var ie=new Uint8Array(z,Z+Et,Vt);Et+=Vt;var N=U.parseSPS(ie);if(Qt!==0)continue;me.codecWidth=N.codec_size.width,me.codecHeight=N.codec_size.height,me.presentWidth=N.present_size.width,me.presentHeight=N.present_size.height,me.profile=N.profile_string,me.level=N.level_string,me.bitDepth=N.bit_depth,me.chromaFormat=N.chroma_format,me.sarRatio=N.sar_ratio,me.frameRate=N.frame_rate,(N.frame_rate.fixed===!1||N.frame_rate.fps_num===0||N.frame_rate.fps_den===0)&&(me.frameRate=this._referenceFrameRate);var B=me.frameRate.fps_den,ae=me.frameRate.fps_num;me.refSampleDuration=me.timescale*(B/ae);for(var fe=ie.subarray(1,4),se="avc1.",$e=0;$e<3;$e++){var St=fe[$e].toString(16);St.length<2&&(St="0"+St),se+=St}me.codec=se;var Pt=this._mediaInfo;Pt.width=me.codecWidth,Pt.height=me.codecHeight,Pt.fps=me.frameRate.fps,Pt.profile=me.profile,Pt.level=me.level,Pt.refFrames=N.ref_frames,Pt.chromaFormat=N.chroma_format_string,Pt.sarNum=me.sarRatio.width,Pt.sarDen=me.sarRatio.height,Pt.videoCodec=se,Pt.hasAudio?Pt.audioCodec!=null&&(Pt.mimeType='video/x-flv; codecs="'+Pt.videoCodec+","+Pt.audioCodec+'"'):Pt.mimeType='video/x-flv; codecs="'+Pt.videoCodec+'"',Pt.isComplete()&&this._onMediaInfo(Pt)}var $t=at.getUint8(Et);if($t===0){this._onError(Y.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else $t>1&&w.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat($t));Et++;for(var Ot=0;Ot<$t;Ot++){var zt=at.getUint16(Et,!Je);if(Et+=2,zt===0)continue;Et+=zt}me.avcc=new Uint8Array(oe),me.avcc.set(new Uint8Array(z,Z,oe),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",me)}},{key:"_parseAVCVideoData",value:function(z,Z,oe,me,Re,Je,at){for(var kt=this._littleEndian,jt=new DataView(z,Z,oe),ot=[],wt=0,Kt=0,Et=this._naluLengthSize,Qt=this._timestampBase+me,Vt=Je===1;Kt<oe;){if(Kt+4>=oe){w.w(this.TAG,"Malformed Nalu near timestamp ".concat(Qt,", offset = ").concat(Kt,", dataSize = ").concat(oe));break}var ie=jt.getUint32(Kt,!kt);if(Et===3&&(ie>>>=8),ie>oe-Et){w.w(this.TAG,"Malformed Nalus near timestamp ".concat(Qt,", NaluSize > DataSize!"));return}var N=jt.getUint8(Kt+Et)&31;N===5&&(Vt=!0);var B=new Uint8Array(z,Z+Kt,Et+ie),ae={type:N,data:B};ot.push(ae),wt+=B.byteLength,Kt+=Et+ie}if(ot.length){var fe=this._videoTrack,se={units:ot,length:wt,isKeyframe:Vt,dts:Qt,cts:at,pts:Qt+at};Vt&&(se.fileposition=Re),fe.samples.push(se),fe.length+=wt}}}],[{key:"probe",value:function(z){var Z=new Uint8Array(z),oe={match:!1};if(Z[0]!==70||Z[1]!==76||Z[2]!==86||Z[3]!==1)return oe;var me=(Z[4]&4)>>>2!==0,Re=(Z[4]&1)!==0,Je=ke(Z,5);return Je<9?oe:{match:!0,consumed:Je,dataOffset:Je,hasAudioTrack:me,hasVideoTrack:Re}}}]),Ae}(),He=ct,Be=function(){function Ae(){Object(ue.a)(this,Ae)}return Object(Q.a)(Ae,null,[{key:"init",value:function(){Ae.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 z in Ae.types)Ae.types.hasOwnProperty(z)&&(Ae.types[z]=[z.charCodeAt(0),z.charCodeAt(1),z.charCodeAt(2),z.charCodeAt(3)]);var Z=Ae.constants={};Z.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),Z.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),Z.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),Z.STSC=Z.STCO=Z.STTS,Z.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Z.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]),Z.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]),Z.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Z.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Z.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(z){for(var Z=8,oe=null,me=Array.prototype.slice.call(arguments,1),Re=me.length,Je=0;Je<Re;Je++)Z+=me[Je].byteLength;oe=new Uint8Array(Z),oe[0]=Z>>>24&255,oe[1]=Z>>>16&255,oe[2]=Z>>>8&255,oe[3]=Z&255,oe.set(z,4);for(var at=8,kt=0;kt<Re;kt++)oe.set(me[kt],at),at+=me[kt].byteLength;return oe}},{key:"generateInitSegment",value:function(z){var Z=Ae.box(Ae.types.ftyp,Ae.constants.FTYP),oe=Ae.moov(z),me=new Uint8Array(Z.byteLength+oe.byteLength);return me.set(Z,0),me.set(oe,Z.byteLength),me}},{key:"moov",value:function(z){var Z=Ae.mvhd(z.timescale,z.duration),oe=Ae.trak(z),me=Ae.mvex(z);return Ae.box(Ae.types.moov,Z,oe,me)}},{key:"mvhd",value:function(z,Z){return Ae.box(Ae.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,z>>>24&255,z>>>16&255,z>>>8&255,z&255,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&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(z){return Ae.box(Ae.types.trak,Ae.tkhd(z),Ae.mdia(z))}},{key:"tkhd",value:function(z){var Z=z.id,oe=z.duration,me=z.presentWidth,Re=z.presentHeight;return Ae.box(Ae.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,0,0,0,0,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&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,me>>>8&255,me&255,0,0,Re>>>8&255,Re&255,0,0]))}},{key:"mdia",value:function(z){return Ae.box(Ae.types.mdia,Ae.mdhd(z),Ae.hdlr(z),Ae.minf(z))}},{key:"mdhd",value:function(z){var Z=z.timescale,oe=z.duration;return Ae.box(Ae.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255,85,196,0,0]))}},{key:"hdlr",value:function(z){var Z=null;return z.type==="audio"?Z=Ae.constants.HDLR_AUDIO:Z=Ae.constants.HDLR_VIDEO,Ae.box(Ae.types.hdlr,Z)}},{key:"minf",value:function(z){var Z=null;return z.type==="audio"?Z=Ae.box(Ae.types.smhd,Ae.constants.SMHD):Z=Ae.box(Ae.types.vmhd,Ae.constants.VMHD),Ae.box(Ae.types.minf,Z,Ae.dinf(),Ae.stbl(z))}},{key:"dinf",value:function(){var z=Ae.box(Ae.types.dinf,Ae.box(Ae.types.dref,Ae.constants.DREF));return z}},{key:"stbl",value:function(z){var Z=Ae.box(Ae.types.stbl,Ae.stsd(z),Ae.box(Ae.types.stts,Ae.constants.STTS),Ae.box(Ae.types.stsc,Ae.constants.STSC),Ae.box(Ae.types.stsz,Ae.constants.STSZ),Ae.box(Ae.types.stco,Ae.constants.STCO));return Z}},{key:"stsd",value:function(z){return z.type==="audio"?z.codec==="mp3"?Ae.box(Ae.types.stsd,Ae.constants.STSD_PREFIX,Ae.mp3(z)):Ae.box(Ae.types.stsd,Ae.constants.STSD_PREFIX,Ae.mp4a(z)):Ae.box(Ae.types.stsd,Ae.constants.STSD_PREFIX,Ae.avc1(z))}},{key:"mp3",value:function(z){var Z=z.channelCount,oe=z.audioSampleRate,me=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Z,0,16,0,0,0,0,oe>>>8&255,oe&255,0,0]);return Ae.box(Ae.types[".mp3"],me)}},{key:"mp4a",value:function(z){var Z=z.channelCount,oe=z.audioSampleRate,me=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Z,0,16,0,0,0,0,oe>>>8&255,oe&255,0,0]);return Ae.box(Ae.types.mp4a,me,Ae.esds(z))}},{key:"esds",value:function(z){var Z=z.config||[],oe=Z.length,me=new Uint8Array([0,0,0,0,3,23+oe,0,1,0,4,15+oe,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([oe]).concat(Z).concat([6,1,2]));return Ae.box(Ae.types.esds,me)}},{key:"avc1",value:function(z){var Z=z.avcc,oe=z.codecWidth,me=z.codecHeight,Re=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,oe>>>8&255,oe&255,me>>>8&255,me&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 Ae.box(Ae.types.avc1,Re,Ae.box(Ae.types.avcC,Z))}},{key:"mvex",value:function(z){return Ae.box(Ae.types.mvex,Ae.trex(z))}},{key:"trex",value:function(z){var Z=z.id,oe=new Uint8Array([0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return Ae.box(Ae.types.trex,oe)}},{key:"moof",value:function(z,Z){return Ae.box(Ae.types.moof,Ae.mfhd(z.sequenceNumber),Ae.traf(z,Z))}},{key:"mfhd",value:function(z){var Z=new Uint8Array([0,0,0,0,z>>>24&255,z>>>16&255,z>>>8&255,z&255]);return Ae.box(Ae.types.mfhd,Z)}},{key:"traf",value:function(z,Z){var oe=z.id,me=Ae.box(Ae.types.tfhd,new Uint8Array([0,0,0,0,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255])),Re=Ae.box(Ae.types.tfdt,new Uint8Array([0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255])),Je=Ae.sdtp(z),at=Ae.trun(z,Je.byteLength+16+16+8+16+8+8);return Ae.box(Ae.types.traf,me,Re,at,Je)}},{key:"sdtp",value:function(z){for(var Z=z.samples||[],oe=Z.length,me=new Uint8Array(4+oe),Re=0;Re<oe;Re++){var Je=Z[Re].flags;me[Re+4]=Je.isLeading<<6|Je.dependsOn<<4|Je.isDependedOn<<2|Je.hasRedundancy}return Ae.box(Ae.types.sdtp,me)}},{key:"trun",value:function(z,Z){var oe=z.samples||[],me=oe.length,Re=12+16*me,Je=new Uint8Array(Re);Z+=8+Re,Je.set([0,0,15,1,me>>>24&255,me>>>16&255,me>>>8&255,me&255,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255],0);for(var at=0;at<me;at++){var kt=oe[at].duration,jt=oe[at].size,ot=oe[at].flags,wt=oe[at].cts;Je.set([kt>>>24&255,kt>>>16&255,kt>>>8&255,kt&255,jt>>>24&255,jt>>>16&255,jt>>>8&255,jt&255,ot.isLeading<<2|ot.dependsOn,ot.isDependedOn<<6|ot.hasRedundancy<<4|ot.isNonSync,0,0,wt>>>24&255,wt>>>16&255,wt>>>8&255,wt&255],12+16*at)}return Ae.box(Ae.types.trun,Je)}},{key:"mdat",value:function(z){return Ae.box(Ae.types.mdat,z)}}]),Ae}();Be.init();var Ze=Be,ht=function(){function Ae(){Object(ue.a)(this,Ae)}return Object(Q.a)(Ae,null,[{key:"getSilentFrame",value:function(z,Z){if(z==="mp4a.40.2"){if(Z===1)return new Uint8Array([0,200,0,128,35,128]);if(Z===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(Z===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(Z===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(Z===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(Z===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(Z===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(Z===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(Z===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}}]),Ae}(),Qe=ht,Xe=function Ae(ge,z,Z,oe,me){Object(ue.a)(this,Ae),this.dts=ge,this.pts=z,this.duration=Z,this.originalDts=oe,this.isSyncPoint=me,this.fileposition=null},Ke=function(){function Ae(){Object(ue.a)(this,Ae),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(Q.a)(Ae,[{key:"appendSyncPoint",value:function(z){z.isSyncPoint=!0,this.syncPoints.push(z)}}]),Ae}(),Fe=function(){function Ae(){Object(ue.a)(this,Ae),this._list=[]}return Object(Q.a)(Ae,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(z){var Z=this._list;if(z.length===0)return;Z.length>0&&z[0].originalDts<Z[Z.length-1].originalDts&&this.clear(),Array.prototype.push.apply(Z,z)}},{key:"getLastSyncPointBeforeDts",value:function(z){if(this._list.length==0)return null;var Z=this._list,oe=0,me=Z.length-1,Re=0,Je=0,at=me;for(z<Z[0].dts&&(oe=0,Je=at+1);Je<=at;)if(Re=Je+Math.floor((at-Je)/2),Re===me||z>=Z[Re].dts&&z<Z[Re+1].dts){oe=Re;break}else Z[Re].dts<z?Je=Re+1:at=Re-1;return this._list[oe]}}]),Ae}(),Ue=function(){function Ae(ge){Object(ue.a)(this,Ae),this._type=ge,this._list=[],this._lastAppendLocation=-1}return Object(Q.a)(Ae,[{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(z){var Z=this._list;if(Z.length===0)return-2;var oe=Z.length-1,me=0,Re=0,Je=oe,at=0;if(z<Z[0].originalBeginDts)return at=-1,at;for(;Re<=Je;)if(me=Re+Math.floor((Je-Re)/2),me===oe||z>Z[me].lastSample.originalDts&&z<Z[me+1].originalBeginDts){at=me;break}else Z[me].originalBeginDts<z?Re=me+1:Je=me-1;return at}},{key:"_searchNearestSegmentAfter",value:function(z){return this._searchNearestSegmentBefore(z)+1}},{key:"append",value:function(z){var Z=this._list,oe=z,me=this._lastAppendLocation,Re=0;me!==-1&&me<Z.length&&oe.originalBeginDts>=Z[me].lastSample.originalDts&&(me===Z.length-1||me<Z.length-1&&oe.originalBeginDts<Z[me+1].originalBeginDts)?Re=me+1:Z.length>0&&(Re=this._searchNearestSegmentBefore(oe.originalBeginDts)+1),this._lastAppendLocation=Re,this._list.splice(Re,0,oe)}},{key:"getLastSegmentBefore",value:function(z){var Z=this._searchNearestSegmentBefore(z);return Z>=0?this._list[Z]:null}},{key:"getLastSampleBefore",value:function(z){var Z=this.getLastSegmentBefore(z);return Z!=null?Z.lastSample:null}},{key:"getLastSyncPointBefore",value:function(z){for(var Z=this._searchNearestSegmentBefore(z),oe=this._list[Z].syncPoints;oe.length===0&&Z>0;)Z--,oe=this._list[Z].syncPoints;return oe.length>0?oe[oe.length-1]:null}}]),Ae}(),_e=function(){function Ae(ge){Object(ue.a)(this,Ae),this.TAG="MP4Remuxer",this._config=ge,this._isLive=ge.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 Ue("audio"),this._videoSegmentInfoList=new Ue("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(g.chrome&&(g.version.major<50||g.version.major===50&&g.version.build<2661)),this._fillSilentAfterSeek=g.msedge||g.msie,this._mp3UseMpegAudio=!g.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(Q.a)(Ae,[{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(z){return z.onDataAvailable=this.remux.bind(this),z.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(z){this._onInitSegment=z}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(z){this._onMediaSegment=z}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(z){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(z,Z){if(!this._onMediaSegment)throw new l("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(z,Z),this._remuxVideo(Z),this._remuxAudio(z)}},{key:"_onTrackMetadataReceived",value:function(z,Z){var oe=null,me="mp4",Re=Z.codec;if(z==="audio")this._audioMeta=Z,Z.codec==="mp3"&&this._mp3UseMpegAudio?(me="mpeg",Re="",oe=new Uint8Array):oe=Ze.generateInitSegment(Z);else if(z==="video")this._videoMeta=Z,oe=Ze.generateInitSegment(Z);else return;if(!this._onInitSegment)throw new l("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(z,{type:z,data:oe.buffer,codec:Re,container:"".concat(z,"/").concat(me),mediaDuration:Z.duration})}},{key:"_calculateDtsBase",value:function(z,Z){if(this._dtsBaseInited)return;z.samples&&z.samples.length&&(this._audioDtsBase=z.samples[0].dts),Z.samples&&Z.samples.length&&(this._videoDtsBase=Z.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var z=this._videoStashedLastSample,Z=this._audioStashedLastSample,oe={type:"video",id:1,sequenceNumber:0,samples:[],length:0};z!=null&&(oe.samples.push(z),oe.length=z.length);var me={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};Z!=null&&(me.samples.push(Z),me.length=Z.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(oe,!0),this._remuxAudio(me,!0)}},{key:"_remuxAudio",value:function(z,Z){if(this._audioMeta==null)return;var oe=z,me=oe.samples,Re=void 0,Je=-1,at=-1,kt=-1,jt=this._audioMeta.refSampleDuration,ot=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,wt=this._dtsBaseInited&&this._audioNextDts===void 0,Kt=!1;if(!me||me.length===0)return;if(me.length===1&&!Z)return;var Et=0,Qt=null,Vt=0;ot?(Et=0,Vt=oe.length):(Et=8,Vt=8+oe.length);var ie=null;if(me.length>1&&(ie=me.pop(),Vt-=ie.length),this._audioStashedLastSample!=null){var N=this._audioStashedLastSample;this._audioStashedLastSample=null,me.unshift(N),Vt+=N.length}ie!=null&&(this._audioStashedLastSample=ie);var B=me[0].dts-this._dtsBase;if(this._audioNextDts)Re=B-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())Re=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(Kt=!0));else{var ae=this._audioSegmentInfoList.getLastSampleBefore(B);if(ae!=null){var fe=B-(ae.originalDts+ae.duration);fe<=3&&(fe=0);var se=ae.dts+ae.duration+fe;Re=B-se}else Re=0}if(Kt){var $e=B-Re,St=this._videoSegmentInfoList.getLastSegmentBefore(B);if(St!=null&&St.beginDts<$e){var Pt=Qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(Pt){var $t=St.beginDts,Ot=$e-St.beginDts;w.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat($t,", duration: ").concat(Ot)),me.unshift({unit:Pt,dts:$t,pts:$t}),Vt+=Pt.byteLength}}else Kt=!1}for(var zt=[],an=0;an<me.length;an++){var jn=me[an],Dr=jn.unit,Cr=jn.dts-this._dtsBase,Nn=Cr-Re;Je===-1&&(Je=Nn);var hr=0;if(an!==me.length-1){var mi=me[an+1].dts-this._dtsBase-Re;hr=mi-Nn}else if(ie!=null){var Or=ie.dts-this._dtsBase-Re;hr=Or-Nn}else zt.length>=1?hr=zt[zt.length-1].duration:hr=Math.floor(jt);var yr=!1,pr=null;if(hr>jt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!g.safari){yr=!0;var Yr=Math.abs(hr-jt),Mr=Math.ceil(Yr/jt),Zr=Nn+jt;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(Nn+hr," ms, expected: ").concat(Nn+Math.round(jt)," ms, ")+"delta: ".concat(Math.round(Yr)," ms, generate: ").concat(Mr," frames"));var wr=Qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);wr==null&&(w.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),wr=Dr),pr=[];for(var vi=0;vi<Mr;vi++){var li=Math.round(Zr);if(pr.length>0){var Kr=pr[pr.length-1];Kr.duration=li-Kr.dts}var zr={dts:li,pts:li,cts:0,unit:wr,size:wr.byteLength,duration:0,originalDts:Cr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};pr.push(zr),Vt+=zr.size,Zr+=jt}var xi=pr[pr.length-1];xi.duration=Nn+hr-xi.dts,hr=Math.round(jt)}zt.push({dts:Nn,pts:Nn,cts:0,unit:jn.unit,size:jn.unit.byteLength,duration:hr,originalDts:Cr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),yr&&zt.push.apply(zt,pr)}ot?Qt=new Uint8Array(Vt):(Qt=new Uint8Array(Vt),Qt[0]=Vt>>>24&255,Qt[1]=Vt>>>16&255,Qt[2]=Vt>>>8&255,Qt[3]=Vt&255,Qt.set(Ze.types.mdat,4));for(var gi=0;gi<zt.length;gi++){var Si=zt[gi].unit;Qt.set(Si,Et),Et+=Si.byteLength}var Fn=zt[zt.length-1];at=Fn.dts+Fn.duration,this._audioNextDts=at;var Sn=new Ke;Sn.beginDts=Je,Sn.endDts=at,Sn.beginPts=Je,Sn.endPts=at,Sn.originalBeginDts=zt[0].originalDts,Sn.originalEndDts=Fn.originalDts+Fn.duration,Sn.firstSample=new Xe(zt[0].dts,zt[0].pts,zt[0].duration,zt[0].originalDts,!1),Sn.lastSample=new Xe(Fn.dts,Fn.pts,Fn.duration,Fn.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(Sn),oe.samples=zt,oe.sequenceNumber++;var _r=null;ot?_r=new Uint8Array:_r=Ze.moof(oe,Je),oe.samples=[],oe.length=0;var zn={type:"audio",data:this._mergeBoxes(_r,Qt).buffer,sampleCount:zt.length,info:Sn};ot&&wt&&(zn.timestampOffset=Je),this._onMediaSegment("audio",zn)}},{key:"_remuxVideo",value:function(z,Z){if(this._videoMeta==null)return;var oe=z,me=oe.samples,Re=void 0,Je=-1,at=-1,kt=-1,jt=-1;if(!me||me.length===0)return;if(me.length===1&&!Z)return;var ot=8,wt=null,Kt=8+z.length,Et=null;if(me.length>1&&(Et=me.pop(),Kt-=Et.length),this._videoStashedLastSample!=null){var Qt=this._videoStashedLastSample;this._videoStashedLastSample=null,me.unshift(Qt),Kt+=Qt.length}Et!=null&&(this._videoStashedLastSample=Et);var Vt=me[0].dts-this._dtsBase;if(this._videoNextDts)Re=Vt-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())Re=0;else{var ie=this._videoSegmentInfoList.getLastSampleBefore(Vt);if(ie!=null){var N=Vt-(ie.originalDts+ie.duration);N<=3&&(N=0);var B=ie.dts+ie.duration+N;Re=Vt-B}else Re=0}for(var ae=new Ke,fe=[],se=0;se<me.length;se++){var $e=me[se],St=$e.dts-this._dtsBase,Pt=$e.isKeyframe,$t=St-Re,Ot=$e.cts,zt=$t+Ot;Je===-1&&(Je=$t,kt=zt);var an=0;if(se!==me.length-1){var jn=me[se+1].dts-this._dtsBase-Re;an=jn-$t}else if(Et!=null){var Dr=Et.dts-this._dtsBase-Re;an=Dr-$t}else fe.length>=1?an=fe[fe.length-1].duration:an=Math.floor(this._videoMeta.refSampleDuration);if(Pt){var Cr=new Xe($t,zt,an,$e.dts,!0);Cr.fileposition=$e.fileposition,ae.appendSyncPoint(Cr)}fe.push({dts:$t,pts:zt,cts:Ot,units:$e.units,size:$e.length,isKeyframe:Pt,duration:an,originalDts:St,flags:{isLeading:0,dependsOn:Pt?2:1,isDependedOn:Pt?1:0,hasRedundancy:0,isNonSync:Pt?0:1}})}wt=new Uint8Array(Kt),wt[0]=Kt>>>24&255,wt[1]=Kt>>>16&255,wt[2]=Kt>>>8&255,wt[3]=Kt&255,wt.set(Ze.types.mdat,4);for(var Nn=0;Nn<fe.length;Nn++)for(var hr=fe[Nn].units;hr.length;){var mi=hr.shift(),Or=mi.data;wt.set(Or,ot),ot+=Or.byteLength}var yr=fe[fe.length-1];if(at=yr.dts+yr.duration,jt=yr.pts+yr.duration,this._videoNextDts=at,ae.beginDts=Je,ae.endDts=at,ae.beginPts=kt,ae.endPts=jt,ae.originalBeginDts=fe[0].originalDts,ae.originalEndDts=yr.originalDts+yr.duration,ae.firstSample=new Xe(fe[0].dts,fe[0].pts,fe[0].duration,fe[0].originalDts,fe[0].isKeyframe),ae.lastSample=new Xe(yr.dts,yr.pts,yr.duration,yr.originalDts,yr.isKeyframe),this._isLive||this._videoSegmentInfoList.append(ae),oe.samples=fe,oe.sequenceNumber++,this._forceFirstIDR){var pr=fe[0].flags;pr.dependsOn=2,pr.isNonSync=0}var Yr=Ze.moof(oe,Je);oe.samples=[],oe.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Yr,wt).buffer,sampleCount:fe.length,info:ae})}},{key:"_mergeBoxes",value:function(z,Z){var oe=new Uint8Array(z.byteLength+Z.byteLength);return oe.set(z,0),oe.set(Z,z.byteLength),oe}}]),Ae}(),Ce=_e,Ne={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"},De=Ne,rt=function(){function Ae(ge,z){Object(ue.a)(this,Ae),this.TAG="TransmuxingController",this._emitter=new x.a,this._config=z,ge.segments||(ge.segments=[{duration:ge.duration,filesize:ge.filesize,url:ge.url}]),typeof ge.cors!="boolean"&&(ge.cors=!0),typeof ge.withCredentials!="boolean"&&(ge.withCredentials=!1),this._mediaDataSource=ge,this._currentSegmentIndex=0;var Z=0;this._mediaDataSource.segments.forEach(function(oe){oe.timestampBase=Z,Z+=oe.duration,oe.cors=ge.cors,oe.withCredentials=ge.withCredentials,z.referrerPolicy&&(oe.referrerPolicy=z.referrerPolicy)}),!isNaN(Z)&&this._mediaDataSource.duration!==Z&&(this._mediaDataSource.duration=Z),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return Object(Q.a)(Ae,[{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(z,Z){this._emitter.addListener(z,Z)}},{key:"off",value:function(z,Z){this._emitter.removeListener(z,Z)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(z,Z){this._currentSegmentIndex=z;var oe=this._mediaDataSource.segments[z],me=this._ioctl=new $(oe,this._config,z);me.onError=this._onIOException.bind(this),me.onSeeked=this._onIOSeeked.bind(this),me.onComplete=this._onIOComplete.bind(this),me.onRedirect=this._onIORedirect.bind(this),me.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),Z?this._demuxer.bindDataSource(this._ioctl):me.onDataArrival=this._onInitChunkArrival.bind(this),me.open(Z)}},{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(z){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;var Z=this._searchSegmentIndexContains(z);if(Z===this._currentSegmentIndex){var oe=this._mediaInfo.segments[Z];if(oe==null)this._pendingSeekTime=z;else{var me=oe.getNearestKeyframe(z);this._remuxer.seek(me.milliseconds),this._ioctl.seek(me.fileposition),this._pendingResolveSeekPoint=me.milliseconds}}else{var Re=this._mediaInfo.segments[Z];if(Re==null)this._pendingSeekTime=z,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(Z);else{var Je=Re.getNearestKeyframe(z);this._internalAbort(),this._remuxer.seek(z),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[Z].timestampBase,this._loadSegment(Z,Je.fileposition),this._pendingResolveSeekPoint=Je.milliseconds,this._reportSegmentMediaInfo(Z)}}this._enableStatisticsReporter()}},{key:"_searchSegmentIndexContains",value:function(z){for(var Z=this._mediaDataSource.segments,oe=Z.length-1,me=0;me<Z.length;me++)if(z<Z[me].timestampBase){oe=me-1;break}return oe}},{key:"_onInitChunkArrival",value:function(z,Z){var oe=this,me=null,Re=0;if(Z>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,Re=this._demuxer.parseChunks(z,Z);else if((me=He.probe(z)).match){this._demuxer=new He(me,this._config),this._remuxer||(this._remuxer=new Ce(this._config));var Je=this._mediaDataSource;Je.duration!=null&&!isNaN(Je.duration)&&(this._demuxer.overridedDuration=Je.duration),typeof Je.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Je.hasAudio),typeof Je.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Je.hasVideo),this._demuxer.timestampBase=Je.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),Re=this._demuxer.parseChunks(z,Z)}else me=null,w.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){oe._internalAbort()}),this._emitter.emit(De.DEMUX_ERROR,Y.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),Re=0;return Re}},{key:"_onMediaInfo",value:function(z){var Z=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},z),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,je.prototype));var oe=Object.assign({},z);Object.setPrototypeOf(oe,je.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=oe,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var me=Z._pendingSeekTime;Z._pendingSeekTime=null,Z.seek(me)})}},{key:"_onMetaDataArrived",value:function(z){this._emitter.emit(De.METADATA_ARRIVED,z)}},{key:"_onScriptDataArrived",value:function(z){this._emitter.emit(De.SCRIPTDATA_ARRIVED,z)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(z){var Z=z,oe=Z+1;oe<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(oe)):(this._remuxer.flushStashedSamples(),this._emitter.emit(De.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(z){var Z=this._ioctl.extraData;this._mediaDataSource.segments[Z].redirectedURL=z}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(De.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(z,Z){w.e(this.TAG,"IOException: type = ".concat(z,", code = ").concat(Z.code,", msg = ").concat(Z.msg)),this._emitter.emit(De.IO_ERROR,z,Z),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(z,Z){w.e(this.TAG,"DemuxException: type = ".concat(z,", info = ").concat(Z)),this._emitter.emit(De.DEMUX_ERROR,z,Z)}},{key:"_onRemuxerInitSegmentArrival",value:function(z,Z){this._emitter.emit(De.INIT_SEGMENT,z,Z)}},{key:"_onRemuxerMediaSegmentArrival",value:function(z,Z){if(this._pendingSeekTime!=null)return;if(this._emitter.emit(De.MEDIA_SEGMENT,z,Z),this._pendingResolveSeekPoint!=null&&z==="video"){var oe=Z.info.syncPoints,me=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,g.safari&&oe.length>0&&oe[0].originalDts===me&&(me=oe[0].pts),this._emitter.emit(De.RECOMMEND_SEEKPOINT,me)}}},{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(z){var Z=this._mediaInfo.segments[z],oe=Object.assign({},Z);oe.duration=this._mediaInfo.duration,oe.segmentCount=this._mediaInfo.segmentCount,delete oe.segments,delete oe.keyframesIndex,this._emitter.emit(De.MEDIA_INFO,oe)}},{key:"_reportStatisticsInfo",value:function(){var z={};z.url=this._ioctl.currentURL,z.hasRedirect=this._ioctl.hasRedirect,z.hasRedirect&&(z.redirectedURL=this._ioctl.currentRedirectedURL),z.speed=this._ioctl.currentSpeed,z.loaderType=this._ioctl.loaderType,z.currentSegmentIndex=this._currentSegmentIndex,z.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(De.STATISTICS_INFO,z)}}]),Ae}(),tt=rt,xt=function(ge){var z="TransmuxingWorker",Z=null,oe=Vt.bind(this);S.install(),ge.addEventListener("message",function(ie){switch(ie.data.cmd){case"init":Z=new tt(ie.data.param[0],ie.data.param[1]),Z.on(De.IO_ERROR,Kt.bind(this)),Z.on(De.DEMUX_ERROR,Et.bind(this)),Z.on(De.INIT_SEGMENT,me.bind(this)),Z.on(De.MEDIA_SEGMENT,Re.bind(this)),Z.on(De.LOADING_COMPLETE,Je.bind(this)),Z.on(De.RECOVERED_EARLY_EOF,at.bind(this)),Z.on(De.MEDIA_INFO,kt.bind(this)),Z.on(De.METADATA_ARRIVED,jt.bind(this)),Z.on(De.SCRIPTDATA_ARRIVED,ot.bind(this)),Z.on(De.STATISTICS_INFO,wt.bind(this)),Z.on(De.RECOMMEND_SEEKPOINT,Qt.bind(this));break;case"destroy":Z&&(Z.destroy(),Z=null),ge.postMessage({msg:"destroyed"});break;case"start":Z.start();break;case"stop":Z.stop();break;case"seek":Z.seek(ie.data.param);break;case"pause":Z.pause();break;case"resume":Z.resume();break;case"logging_config":{var N=ie.data.param;xe.applyConfig(N),N.enableCallback===!0?xe.addLogListener(oe):xe.removeLogListener(oe);break}}});function me(ie,N){var B={msg:De.INIT_SEGMENT,data:{type:ie,data:N}};ge.postMessage(B,[N.data])}function Re(ie,N){var B={msg:De.MEDIA_SEGMENT,data:{type:ie,data:N}};ge.postMessage(B,[N.data])}function Je(){var ie={msg:De.LOADING_COMPLETE};ge.postMessage(ie)}function at(){var ie={msg:De.RECOVERED_EARLY_EOF};ge.postMessage(ie)}function kt(ie){var N={msg:De.MEDIA_INFO,data:ie};ge.postMessage(N)}function jt(ie){var N={msg:De.METADATA_ARRIVED,data:ie};ge.postMessage(N)}function ot(ie){var N={msg:De.SCRIPTDATA_ARRIVED,data:ie};ge.postMessage(N)}function wt(ie){var N={msg:De.STATISTICS_INFO,data:ie};ge.postMessage(N)}function Kt(ie,N){ge.postMessage({msg:De.IO_ERROR,data:{type:ie,info:N}})}function Et(ie,N){ge.postMessage({msg:De.DEMUX_ERROR,data:{type:ie,info:N}})}function Qt(ie){ge.postMessage({msg:De.RECOMMEND_SEEKPOINT,data:ie})}function Vt(ie,N){ge.postMessage({msg:"logcat_callback",data:{type:ie,logcat:N}})}},Mt=xt,Bt=function(){function Ae(ge,z){if(Object(ue.a)(this,Ae),this.TAG="Transmuxer",this._emitter=new x.a,z.enableWorker&&typeof Worker!="undefined")try{var Z=F("0r65");this._worker=Z(Mt),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[ge,z]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},xe.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:xe.getConfig()})}catch(me){w.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new tt(ge,z)}else this._controller=new tt(ge,z);if(this._controller){var oe=this._controller;oe.on(De.IO_ERROR,this._onIOError.bind(this)),oe.on(De.DEMUX_ERROR,this._onDemuxError.bind(this)),oe.on(De.INIT_SEGMENT,this._onInitSegment.bind(this)),oe.on(De.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),oe.on(De.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),oe.on(De.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),oe.on(De.MEDIA_INFO,this._onMediaInfo.bind(this)),oe.on(De.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),oe.on(De.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),oe.on(De.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),oe.on(De.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(Q.a)(Ae,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),xe.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(z,Z){this._emitter.addListener(z,Z)}},{key:"off",value:function(z,Z){this._emitter.removeListener(z,Z)}},{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(z){this._worker?this._worker.postMessage({cmd:"seek",param:z}):this._controller.seek(z)}},{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(z,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(De.INIT_SEGMENT,z,Z)})}},{key:"_onMediaSegment",value:function(z,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(De.MEDIA_SEGMENT,z,Z)})}},{key:"_onLoadingComplete",value:function(){var z=this;Promise.resolve().then(function(){z._emitter.emit(De.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var z=this;Promise.resolve().then(function(){z._emitter.emit(De.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(z){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(De.MEDIA_INFO,z)})}},{key:"_onMetaDataArrived",value:function(z){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(De.METADATA_ARRIVED,z)})}},{key:"_onScriptDataArrived",value:function(z){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(De.SCRIPTDATA_ARRIVED,z)})}},{key:"_onStatisticsInfo",value:function(z){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(De.STATISTICS_INFO,z)})}},{key:"_onIOError",value:function(z,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(De.IO_ERROR,z,Z)})}},{key:"_onDemuxError",value:function(z,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(De.DEMUX_ERROR,z,Z)})}},{key:"_onRecommendSeekpoint",value:function(z){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(De.RECOMMEND_SEEKPOINT,z)})}},{key:"_onLoggingConfigChanged",value:function(z){this._worker&&this._worker.postMessage({cmd:"logging_config",param:z})}},{key:"_onWorkerMessage",value:function(z){var Z=z.data,oe=Z.data;if(Z.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(Z.msg){case De.INIT_SEGMENT:case De.MEDIA_SEGMENT:this._emitter.emit(Z.msg,oe.type,oe.data);break;case De.LOADING_COMPLETE:case De.RECOVERED_EARLY_EOF:this._emitter.emit(Z.msg);break;case De.MEDIA_INFO:Object.setPrototypeOf(oe,je.prototype),this._emitter.emit(Z.msg,oe);break;case De.METADATA_ARRIVED:case De.SCRIPTDATA_ARRIVED:case De.STATISTICS_INFO:this._emitter.emit(Z.msg,oe);break;case De.IO_ERROR:case De.DEMUX_ERROR:this._emitter.emit(Z.msg,oe.type,oe.info);break;case De.RECOMMEND_SEEKPOINT:this._emitter.emit(Z.msg,oe);break;case"logcat_callback":w.emitter.emit("log",oe.type,oe.logcat);break;default:break}}}]),Ae}(),It=Bt,Dt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},lt=Dt,pt=function(){function Ae(ge){Object(ue.a)(this,Ae),this.TAG="MSEController",this._config=ge,this._emitter=new x.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 Fe}return Object(Q.a)(Ae,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(z,Z){this._emitter.addListener(z,Z)}},{key:"off",value:function(z,Z){this._emitter.removeListener(z,Z)}},{key:"attachMediaElement",value:function(z){if(this._mediaSource)throw new l("MediaSource has been attached to an HTMLMediaElement!");var Z=this._mediaSource=new window.MediaSource;Z.addEventListener("sourceopen",this.e.onSourceOpen),Z.addEventListener("sourceended",this.e.onSourceEnded),Z.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=z,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),z.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var z=this._mediaSource;for(var Z in this._sourceBuffers){var oe=this._pendingSegments[Z];oe.splice(0,oe.length),this._pendingSegments[Z]=null,this._pendingRemoveRanges[Z]=null,this._lastInitSegments[Z]=null;var me=this._sourceBuffers[Z];if(me){if(z.readyState!=="closed"){try{z.removeSourceBuffer(me)}catch(Re){w.e(this.TAG,Re.message)}me.removeEventListener("error",this.e.onSourceBufferError),me.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[Z]=null,this._sourceBuffers[Z]=null}}if(z.readyState==="open")try{z.endOfStream()}catch(Re){w.e(this.TAG,Re.message)}z.removeEventListener("sourceopen",this.e.onSourceOpen),z.removeEventListener("sourceended",this.e.onSourceEnded),z.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(z,Z){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(z),this._pendingSegments[z.type].push(z);return}var oe=z,me="".concat(oe.container);oe.codec&&oe.codec.length>0&&(me+=";codecs=".concat(oe.codec));var Re=!1;if(w.v(this.TAG,"Received Initialization Segment, mimeType: "+me),this._lastInitSegments[oe.type]=oe,me!==this._mimeTypes[oe.type]){if(this._mimeTypes[oe.type])w.v(this.TAG,"Notice: ".concat(oe.type," mimeType changed, origin: ").concat(this._mimeTypes[oe.type],", target: ").concat(me));else{Re=!0;try{var Je=this._sourceBuffers[oe.type]=this._mediaSource.addSourceBuffer(me);Je.addEventListener("error",this.e.onSourceBufferError),Je.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(at){w.e(this.TAG,at.message),this._emitter.emit(lt.ERROR,{code:at.code,msg:at.message});return}}this._mimeTypes[oe.type]=me}Z||this._pendingSegments[oe.type].push(oe),Re||this._sourceBuffers[oe.type]&&!this._sourceBuffers[oe.type].updating&&this._doAppendSegments(),g.safari&&oe.container==="audio/mpeg"&&oe.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=oe.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(z){var Z=z;this._pendingSegments[Z.type].push(Z),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var oe=this._sourceBuffers[Z.type];oe&&!oe.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(z){for(var Z in this._sourceBuffers){if(!this._sourceBuffers[Z])continue;var oe=this._sourceBuffers[Z];if(this._mediaSource.readyState==="open")try{oe.abort()}catch(jt){w.e(this.TAG,jt.message)}this._idrList.clear();var me=this._pendingSegments[Z];if(me.splice(0,me.length),this._mediaSource.readyState==="closed")continue;for(var Re=0;Re<oe.buffered.length;Re++){var Je=oe.buffered.start(Re),at=oe.buffered.end(Re);this._pendingRemoveRanges[Z].push({start:Je,end:at})}if(oe.updating||this._doRemoveRanges(),g.safari){var kt=this._lastInitSegments[Z];kt&&(this._pendingSegments[Z].push(kt),oe.updating||this._doAppendSegments())}}}},{key:"endOfStream",value:function(){var z=this._mediaSource,Z=this._sourceBuffers;if(!z||z.readyState!=="open"){z&&z.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}Z.video&&Z.video.updating||Z.audio&&Z.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,z.endOfStream())}},{key:"getNearestKeyframe",value:function(z){return this._idrList.getLastSyncPointBeforeDts(z)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var z=this._mediaElement.currentTime;for(var Z in this._sourceBuffers){var oe=this._sourceBuffers[Z];if(oe){var me=oe.buffered;if(me.length>=1&&z-me.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var z=this._mediaElement.currentTime;for(var Z in this._sourceBuffers){var oe=this._sourceBuffers[Z];if(oe){for(var me=oe.buffered,Re=!1,Je=0;Je<me.length;Je++){var at=me.start(Je),kt=me.end(Je);if(at<=z&&z<kt+3){if(z-at>=this._config.autoCleanupMaxBackwardDuration){Re=!0;var jt=z-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[Z].push({start:at,end:jt})}}else kt<z&&(Re=!0,this._pendingRemoveRanges[Z].push({start:at,end:kt}))}Re&&!oe.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var z=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")return;if(z.video&&z.video.updating||z.audio&&z.audio.updating)return;var Z=this._mediaSource.duration,oe=this._pendingMediaDuration;oe>0&&(isNaN(Z)||oe>Z)&&(w.v(this.TAG,"Update MediaSource duration from ".concat(Z," to ").concat(oe)),this._mediaSource.duration=oe),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var z in this._pendingRemoveRanges){if(!this._sourceBuffers[z]||this._sourceBuffers[z].updating)continue;for(var Z=this._sourceBuffers[z],oe=this._pendingRemoveRanges[z];oe.length&&!Z.updating;){var me=oe.shift();Z.remove(me.start,me.end)}}}},{key:"_doAppendSegments",value:function(){var z=this._pendingSegments;for(var Z in z){if(!this._sourceBuffers[Z]||this._sourceBuffers[Z].updating)continue;if(z[Z].length>0){var oe=z[Z].shift();if(oe.timestampOffset){var me=this._sourceBuffers[Z].timestampOffset,Re=oe.timestampOffset/1e3,Je=Math.abs(me-Re);Je>.1&&(w.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(me," to ").concat(Re)),this._sourceBuffers[Z].timestampOffset=Re),delete oe.timestampOffset}if(!oe.data||oe.data.byteLength===0)continue;try{this._sourceBuffers[Z].appendBuffer(oe.data),this._isBufferFull=!1,Z==="video"&&oe.hasOwnProperty("info")&&this._idrList.appendArray(oe.info.syncPoints)}catch(at){this._pendingSegments[Z].unshift(oe),at.code===22?(this._isBufferFull||this._emitter.emit(lt.BUFFER_FULL),this._isBufferFull=!0):(w.e(this.TAG,at.message),this._emitter.emit(lt.ERROR,{code:at.code,msg:at.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 z=this._pendingSourceBufferInit;z.length;){var Z=z.shift();this.appendInitSegment(Z,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(lt.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 z=this._pendingSegments;return z.video.length>0||z.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var z=this._pendingRemoveRanges;return z.video.length>0||z.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(lt.UPDATE_END)}},{key:"_onSourceBufferError",value:function(z){w.e(this.TAG,"SourceBuffer Error: ".concat(z))}}]),Ae}(),ut=pt,Pe={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Ve={NETWORK_EXCEPTION:t.EXCEPTION,NETWORK_STATUS_CODE_INVALID:t.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:t.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:t.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:Y.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:Y.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:Y.CODEC_UNSUPPORTED},yt=function(){function Ae(ge,z){if(Object(ue.a)(this,Ae),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new x.a,this._config=he(),typeof z=="object"&&Object.assign(this._config,z),ge.type.toLowerCase()!=="flv")throw new s("FlvPlayer requires an flv MediaDataSource input!");ge.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=ge,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 Z=g.chrome&&(g.version.major<50||g.version.major===50&&g.version.build<2661);this._alwaysSeekKeyframe=!!(Z||g.msedge||g.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(Q.a)(Ae,[{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(z,Z){var oe=this;z===Me.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(Me.MEDIA_INFO,oe.mediaInfo)}):z===Me.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(Me.STATISTICS_INFO,oe.statisticsInfo)})),this._emitter.addListener(z,Z)}},{key:"off",value:function(z,Z){this._emitter.removeListener(z,Z)}},{key:"attachMediaElement",value:function(z){var Z=this;if(this._mediaElement=z,z.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),z.addEventListener("seeking",this.e.onvSeeking),z.addEventListener("canplay",this.e.onvCanPlay),z.addEventListener("stalled",this.e.onvStalled),z.addEventListener("progress",this.e.onvProgress),this._msectl=new ut(this._config),this._msectl.on(lt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(lt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(lt.SOURCE_OPEN,function(){Z._mseSourceOpened=!0,Z._hasPendingLoad&&(Z._hasPendingLoad=!1,Z.load())}),this._msectl.on(lt.ERROR,function(oe){Z._emitter.emit(Me.ERROR,Pe.MEDIA_ERROR,Ve.MEDIA_MSE_ERROR,oe)}),this._msectl.attachMediaElement(z),this._pendingSeekTime!=null)try{z.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(oe){}}},{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 z=this;if(!this._mediaElement)throw new l("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new l("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 It(this._mediaDataSource,this._config),this._transmuxer.on(De.INIT_SEGMENT,function(Z,oe){z._msectl.appendInitSegment(oe)}),this._transmuxer.on(De.MEDIA_SEGMENT,function(Z,oe){if(z._msectl.appendMediaSegment(oe),z._config.lazyLoad&&!z._config.isLive){var me=z._mediaElement.currentTime;oe.info.endDts>=(me+z._config.lazyLoadMaxDuration)*1e3&&(z._progressChecker==null&&(w.v(z.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),z._suspendTransmuxer()))}}),this._transmuxer.on(De.LOADING_COMPLETE,function(){z._msectl.endOfStream(),z._emitter.emit(Me.LOADING_COMPLETE)}),this._transmuxer.on(De.RECOVERED_EARLY_EOF,function(){z._emitter.emit(Me.RECOVERED_EARLY_EOF)}),this._transmuxer.on(De.IO_ERROR,function(Z,oe){z._emitter.emit(Me.ERROR,Pe.NETWORK_ERROR,Z,oe)}),this._transmuxer.on(De.DEMUX_ERROR,function(Z,oe){z._emitter.emit(Me.ERROR,Pe.MEDIA_ERROR,Z,{code:-1,msg:oe})}),this._transmuxer.on(De.MEDIA_INFO,function(Z){z._mediaInfo=Z,z._emitter.emit(Me.MEDIA_INFO,Object.assign({},Z))}),this._transmuxer.on(De.METADATA_ARRIVED,function(Z){z._emitter.emit(Me.METADATA_ARRIVED,Z)}),this._transmuxer.on(De.SCRIPTDATA_ARRIVED,function(Z){z._emitter.emit(Me.SCRIPTDATA_ARRIVED,Z)}),this._transmuxer.on(De.STATISTICS_INFO,function(Z){z._statisticsInfo=z._fillStatisticsInfo(Z),z._emitter.emit(Me.STATISTICS_INFO,Object.assign({},z._statisticsInfo))}),this._transmuxer.on(De.RECOMMEND_SEEKPOINT,function(Z){z._mediaElement&&!z._config.accurateSeek&&(z._requestSetTime=!0,z._mediaElement.currentTime=Z/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(z){this._mediaElement.volume=z}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(z){this._mediaElement.muted=z}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(z){this._mediaElement?this._internalSeek(z):this._pendingSeekTime=z}},{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(z){if(z.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return z;var Z=!0,oe=0,me=0;if(this._mediaElement.getVideoPlaybackQuality){var Re=this._mediaElement.getVideoPlaybackQuality();oe=Re.totalVideoFrames,me=Re.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(oe=this._mediaElement.webkitDecodedFrameCount,me=this._mediaElement.webkitDroppedFrameCount):Z=!1;return Z&&(z.decodedFrames=oe,z.droppedFrames=me),z}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var z=this._mediaElement.buffered,Z=this._mediaElement.currentTime,oe=0,me=0,Re=0;Re<z.length;Re++){var Je=z.start(Re),at=z.end(Re);if(Je<=Z&&Z<at){oe=Je,me=at;break}}me>=Z+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 z=this._mediaElement.currentTime,Z=this._mediaElement.buffered,oe=!1,me=0;me<Z.length;me++){var Re=Z.start(me),Je=Z.end(me);if(z>=Re&&z<Je){z>=Je-this._config.lazyLoadRecoverDuration&&(oe=!0);break}}oe&&(window.clearInterval(this._progressChecker),this._progressChecker=null,oe&&(w.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(z){for(var Z=this._mediaElement.buffered,oe=0;oe<Z.length;oe++){var me=Z.start(oe),Re=Z.end(oe);if(z>=me&&z<Re)return!0}return!1}},{key:"_internalSeek",value:function(z){var Z=this._isTimepointBuffered(z),oe=!1,me=0;if(z<1&&this._mediaElement.buffered.length>0){var Re=this._mediaElement.buffered.start(0);(Re<1&&z<Re||g.safari)&&(oe=!0,me=g.safari?.1:Re)}if(oe)this._requestSetTime=!0,this._mediaElement.currentTime=me;else if(Z){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=z;else{var Je=this._msectl.getNearestKeyframe(Math.floor(z*1e3));this._requestSetTime=!0,Je!=null?this._mediaElement.currentTime=Je.dts/1e3:this._mediaElement.currentTime=z}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(z),this._transmuxer.seek(Math.floor(z*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=z)}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var z=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(z)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(z),this._transmuxer.seek(Math.floor(z*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=z))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(z){var Z=this._mediaElement;if(z||!this._receivedCanPlay||Z.readyState<2){var oe=Z.buffered;oe.length>0&&Z.currentTime<oe.start(0)&&(w.w(this.TAG,"Playback seems stuck at ".concat(Z.currentTime,", seek to ").concat(oe.start(0))),this._requestSetTime=!0,this._mediaElement.currentTime=oe.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}},{key:"_onvLoadedMetadata",value:function(z){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(z){var Z=this._mediaElement.currentTime,oe=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(Z<1&&oe.length>0){var me=oe.start(0);if(me<1&&Z<me||g.safari){this._requestSetTime=!0,this._mediaElement.currentTime=g.safari?.1:me;return}}if(this._isTimepointBuffered(Z)){if(this._alwaysSeekKeyframe){var Re=this._msectl.getNearestKeyframe(Math.floor(Z*1e3));Re!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=Re.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:Z,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_onvCanPlay",value:function(z){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(z){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(z){this._checkAndResumeStuckPlayback()}}]),Ae}(),st=yt,Nt=function(){function Ae(ge,z){if(Object(ue.a)(this,Ae),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new x.a,this._config=he(),typeof z=="object"&&Object.assign(this._config,z),ge.type.toLowerCase()==="flv")throw new s("NativePlayer does't support flv MediaDataSource input!");if(ge.hasOwnProperty("segments"))throw new s("NativePlayer(".concat(ge.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=ge,this._mediaElement=null}return Object(Q.a)(Ae,[{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(z,Z){var oe=this;z===Me.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){oe._emitter.emit(Me.MEDIA_INFO,oe.mediaInfo)}):z===Me.STATISTICS_INFO&&(this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){oe._emitter.emit(Me.STATISTICS_INFO,oe.statisticsInfo)})),this._emitter.addListener(z,Z)}},{key:"off",value:function(z,Z){this._emitter.removeListener(z,Z)}},{key:"attachMediaElement",value:function(z){if(this._mediaElement=z,z.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{z.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(Z){}}},{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 l("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(z){this._mediaElement.volume=z}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(z){this._mediaElement.muted=z}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(z){this._mediaElement?this._mediaElement.currentTime=z:this._pendingSeekTime=z}},{key:"mediaInfo",get:function(){var z=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",Z={mimeType:z+this._mediaDataSource.type};return this._mediaElement&&(Z.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(Z.width=this._mediaElement.videoWidth,Z.height=this._mediaElement.videoHeight)),Z}},{key:"statisticsInfo",get:function(){var z={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return z;var Z=!0,oe=0,me=0;if(this._mediaElement.getVideoPlaybackQuality){var Re=this._mediaElement.getVideoPlaybackQuality();oe=Re.totalVideoFrames,me=Re.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(oe=this._mediaElement.webkitDecodedFrameCount,me=this._mediaElement.webkitDroppedFrameCount):Z=!1;return Z&&(z.decodedFrames=oe,z.droppedFrames=me),z}},{key:"_onvLoadedMetadata",value:function(z){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(Me.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(Me.STATISTICS_INFO,this.statisticsInfo)}}]),Ae}(),Ut=Nt;S.install();function it(Ae,ge){var z=Ae;if(z==null||typeof z!="object")throw new s("MediaDataSource must be an javascript object!");if(!z.hasOwnProperty("type"))throw new s("MediaDataSource must has type field to indicate video file type!");switch(z.type){case"flv":return new st(z,ge);default:return new Ut(z,ge)}}function mt(){return Te.supportMSEH264Playback()}function bt(){return Te.getFeatureList()}var At={};At.createPlayer=it,At.isSupported=mt,At.getFeatureList=bt,At.BaseLoader=n,At.LoaderStatus=r,At.LoaderErrors=t,At.Events=Me,At.ErrorTypes=Pe,At.ErrorDetails=Ve,At.FlvPlayer=st,At.NativePlayer=Ut,At.LoggingControl=xe,Object.defineProperty(At,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var Xt=Le.a=At},GgEA:function(nt,Le,F){},Gytx:function(nt,Le){nt.exports=function(ue,Q,j,S){var D=j?j.call(S,ue,Q):void 0;if(D!==void 0)return!!D;if(ue===Q)return!0;if(typeof ue!="object"||!ue||typeof Q!="object"||!Q)return!1;var x=Object.keys(ue),T=Object.keys(Q);if(x.length!==T.length)return!1;for(var w=Object.prototype.hasOwnProperty.bind(Q),f=0;f<x.length;f++){var p=x[f];if(!w(p))return!1;var u=ue[p],o=Q[p];if(D=j?j.call(S,u,o,p):void 0,D===!1||D===void 0&&u!==o)return!1}return!0}},HmJG:function(nt,Le,F){},Hw79:function(nt,Le,F){nt.exports={pagination:"pagination___2VQzP",info:"info___1saw2"}},I8Z2:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return S}),F.d(Le,"b",function(){return i}),F.d(Le,"c",function(){return s});var ue=F("q1tI"),Q=function(){var h=function(r,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,c){n.__proto__=c}||function(n,c){for(var m in c)c.hasOwnProperty(m)&&(n[m]=c[m])},h(r,t)};return function(r,t){h(r,t);function n(){this.constructor=r}r.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),j=ue.createContext(null),S=function(h){Q(r,h);function r(){return h!==null&&h.apply(this,arguments)||this}return r.prototype.render=function(){return ue.createElement(j.Provider,{value:this.props.store},this.props.children)},r}(ue.Component),D=F("Gytx"),x=F.n(D),T=F("2mql"),w=F.n(T),f=function(){var h=function(r,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,c){n.__proto__=c}||function(n,c){for(var m in c)c.hasOwnProperty(m)&&(n[m]=c[m])},h(r,t)};return function(r,t){h(r,t);function n(){this.constructor=r}r.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),p=function(){return p=Object.assign||function(h){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(h[c]=r[c])}return h},p.apply(this,arguments)};function u(h){return h.displayName||h.name||"Component"}var o=function(){return{}};function i(h,r){r===void 0&&(r={});var t=!!h,n=h||o;return function(m){var v=function(E){f(g,E);function g(y,C){var d=E.call(this,y,C)||this;return d.unsubscribe=null,d.handleChange=function(){if(!d.unsubscribe)return;var _=n(d.store.getState(),d.props);d.setState({subscribed:_})},d.store=d.context,d.state={subscribed:n(d.store.getState(),y),store:d.store,props:y},d}return g.getDerivedStateFromProps=function(y,C){return h&&h.length===2&&y!==C.props?{subscribed:n(C.store.getState(),y),props:y}:{props:y}},g.prototype.componentDidMount=function(){this.trySubscribe()},g.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},g.prototype.shouldComponentUpdate=function(y,C){return!x()(this.props,y)||!x()(this.state.subscribed,C.subscribed)},g.prototype.trySubscribe=function(){t&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},g.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},g.prototype.render=function(){var y=p(p(p({},this.props),this.state.subscribed),{store:this.store});return ue.createElement(m,p({},y,{ref:this.props.miniStoreForwardedRef}))},g.displayName="Connect("+u(m)+")",g.contextType=j,g}(ue.Component);if(r.forwardRef){var b=ue.forwardRef(function(E,g){return ue.createElement(v,p({},E,{miniStoreForwardedRef:g}))});return w()(b,m)}return w()(v,m)}}var l=function(){return l=Object.assign||function(h){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(h[c]=r[c])}return h},l.apply(this,arguments)};function s(h){var r=h,t=[];function n(v){r=l(l({},r),v);for(var b=0;b<t.length;b++)t[b]()}function c(){return r}function m(v){return t.push(v),function(){var E=t.indexOf(v);t.splice(E,1)}}return{setState:n,getState:c,subscribe:m}}},IBYe:function(nt,Le,F){"use strict";function ue(Q){return null}Le.a=ue},IxHN:function(nt,Le,F){"use strict";var ue=F("q1tI"),Q=F.n(ue),j=F("07cG"),S=F.n(j);Le.a=function(D){var x=D.message,T=D.className,w=D.children,f=D.style,p=f===void 0?{}:f;return Q.a.createElement("div",{className:"".concat(S.a.idsRingWrapper," ").concat(T)},Q.a.createElement("div",{className:S.a.ldsRing},Q.a.createElement("div",null),Q.a.createElement("div",null),Q.a.createElement("div",null),Q.a.createElement("div",null)),x?Q.a.createElement("p",{style:p},x):null,w)}},J66h:function(nt,Le,F){(function(ue){var Q,j;(function(S,D){nt.exports=D(S)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof ue!="undefined"?ue:this,function(S){"use strict";S=S||{};var D=S.Base64,x="2.6.4",T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=function(P){for(var I={},W=0,K=P.length;W<K;W++)I[P.charAt(W)]=W;return I}(T),f=String.fromCharCode,p=function(P){if(P.length<2){var I=P.charCodeAt(0);return I<128?P:I<2048?f(192|I>>>6)+f(128|I&63):f(224|I>>>12&15)+f(128|I>>>6&63)+f(128|I&63)}else{var I=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return f(240|I>>>18&7)+f(128|I>>>12&63)+f(128|I>>>6&63)+f(128|I&63)}},u=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,o=function(P){return P.replace(u,p)},i=function(P){var I=[0,2,1][P.length%3],W=P.charCodeAt(0)<<16|(P.length>1?P.charCodeAt(1):0)<<8|(P.length>2?P.charCodeAt(2):0),K=[T.charAt(W>>>18),T.charAt(W>>>12&63),I>=2?"=":T.charAt(W>>>6&63),I>=1?"=":T.charAt(W&63)];return K.join("")},l=S.btoa&&typeof S.btoa=="function"?function(P){return S.btoa(P)}:function(P){if(P.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return P.replace(/[\s\S]{1,3}/g,i)},s=function(P){return l(o(String(P)))},h=function(P){return P.replace(/[+\/]/g,function(I){return I=="+"?"-":"_"}).replace(/=/g,"")},r=function(P,I){return I?h(s(P)):s(P)},t=function(P){return r(P,!0)},n;S.Uint8Array&&(n=function(P,I){for(var W="",K=0,te=P.length;K<te;K+=3){var H=P[K],G=P[K+1],V=P[K+2],re=H<<16|G<<8|V;W+=T.charAt(re>>>18)+T.charAt(re>>>12&63)+(typeof G!="undefined"?T.charAt(re>>>6&63):"=")+(typeof V!="undefined"?T.charAt(re&63):"=")}return I?h(W):W});var c=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,m=function(P){switch(P.length){case 4:var I=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),W=I-65536;return f((W>>>10)+55296)+f((W&1023)+56320);case 3:return f((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return f((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},v=function(P){return P.replace(c,m)},b=function(P){var I=P.length,W=I%4,K=(I>0?w[P.charAt(0)]<<18:0)|(I>1?w[P.charAt(1)]<<12:0)|(I>2?w[P.charAt(2)]<<6:0)|(I>3?w[P.charAt(3)]:0),te=[f(K>>>16),f(K>>>8&255),f(K&255)];return te.length-=[0,0,2,1][W],te.join("")},E=S.atob&&typeof S.atob=="function"?function(P){return S.atob(P)}:function(P){return P.replace(/\S{1,4}/g,b)},g=function(P){return E(String(P).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(P){return v(E(P))},C=function(P){return String(P).replace(/[-_]/g,function(I){return I=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(P){return y(C(P))},_;S.Uint8Array&&(_=function(P){return Uint8Array.from(g(C(P)),function(I){return I.charCodeAt(0)})});var O=function(){var P=S.Base64;return S.Base64=D,P};if(S.Base64={VERSION:x,atob:g,btoa:l,fromBase64:d,toBase64:r,utob:o,encode:r,encodeURI:t,btou:v,decode:d,noConflict:O,fromUint8Array:n,toUint8Array:_},typeof Object.defineProperty=="function"){var A=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}};S.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",A(function(){return d(this)})),Object.defineProperty(String.prototype,"toBase64",A(function(P){return r(this,P)})),Object.defineProperty(String.prototype,"toBase64URI",A(function(){return r(this,!0)}))}}return S.Meteor&&(Base64=S.Base64),nt.exports?nt.exports.Base64=S.Base64:!(Q=[],j=function(){return S.Base64}.apply(Le,Q),j!==void 0&&(nt.exports=j)),{Base64:S.Base64}})}).call(this,F("IyRk"))},JOrW:function(nt,Le,F){nt.exports=F.p+"static/gf.09d89ab3.svg"},JYp7:function(nt,Le,F){"use strict";F.d(Le,"c",function(){return Q}),F.d(Le,"d",function(){return j}),F.d(Le,"f",function(){return D}),F.d(Le,"a",function(){return x}),F.d(Le,"b",function(){return T}),F.d(Le,"e",function(){return w});var ue=function(){var f=function(p,u){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var l in i)i.hasOwnProperty(l)&&(o[l]=i[l])},f(p,u)};return function(p,u){f(p,u);function o(){this.constructor=p}p.prototype=u===null?Object.create(u):(o.prototype=u.prototype,new o)}}(),Q={done:!0,value:void 0},j;(function(f){var p={next:function(){return Q}};function u(){return p}f.empty=u;function o(v){var b=!1;return{next:function(){return b?Q:(b=!0,{done:!1,value:v})}}}f.single=o;function i(v,b,E){return b===void 0&&(b=0),E===void 0&&(E=v.length),{next:function(){return b>=E?Q:{done:!1,value:v[b++]}}}}f.fromArray=i;function l(v){return{next:function(){var b=v.next();return b.done?Q:{done:!1,value:b.value}}}}f.fromNativeIterator=l;function s(v){return v?Array.isArray(v)?f.fromArray(v):v:f.empty()}f.from=s;function h(v,b){return{next:function(){var E=v.next();return E.done?Q:{done:!1,value:b(E.value)}}}}f.map=h;function r(v,b){return{next:function(){for(;;){var E=v.next();if(E.done)return Q;if(b(E.value))return{done:!1,value:E.value}}}}}f.filter=r;function t(v,b){for(var E=v.next();!E.done;E=v.next())b(E.value)}f.forEach=t;function n(v,b){b===void 0&&(b=Number.POSITIVE_INFINITY);var E=[];if(b===0)return E;for(var g=0,y=v.next();!y.done&&!(E.push(y.value),++g>=b);y=v.next());return E}f.collect=n;function c(){for(var v=[],b=0;b<arguments.length;b++)v[b]=arguments[b];var E=0;return{next:function(){if(E>=v.length)return Q;var g=v[E],y=g.next();return y.done?(E++,this.next()):y}}}f.concat=c;function m(v){return new S(v)}f.chain=m})(j||(j={}));var S=function(){function f(p){this.it=p}return f.prototype.next=function(){return this.it.next()},f}();function D(f){return Array.isArray(f)?j.fromArray(f):f||j.empty()}var x=function(){function f(p,u,o,i){u===void 0&&(u=0),o===void 0&&(o=p.length),i===void 0&&(i=u-1),this.items=p,this.start=u,this.end=o,this.index=i}return f.prototype.first=function(){return this.index=this.start,this.current()},f.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},f.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},f}(),T=function(f){ue(p,f);function p(u,o,i,l){return o===void 0&&(o=0),i===void 0&&(i=u.length),l===void 0&&(l=o-1),f.call(this,u,o,i,l)||this}return p.prototype.current=function(){return f.prototype.current.call(this)},p.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},p.prototype.first=function(){return this.index=this.start,this.current()},p.prototype.last=function(){return this.index=this.end-1,this.current()},p.prototype.parent=function(){return null},p}(x),w=function(){function f(p,u){this.iterator=p,this.fn=u}return f.prototype.next=function(){return this.fn(this.iterator.next())},f}()},LdHM:function(nt,Le,F){"use strict";F.d(Le,"b",function(){return c}),F.d(Le,"a",function(){return v});var ue=F("1OyB"),Q=F("vuIU"),j=F("Ji7U"),S=F("LK+K"),D=F("q1tI"),x=F("rePB"),T=F("Ff2n"),w=F("ODXe"),f=F("4IlW"),p=F("bX4T"),u=F("YrtM"),o=F("TSYQ"),i=F.n(o),l=F("+nKL"),s=F("8OUc"),h=function(V,re){var $=V.prefixCls,ne=V.id,he=V.flattenOptions,pe=V.childrenAsData,Te=V.values,we=V.searchValue,Me=V.multiple,Ee=V.defaultActiveFirstOption,xe=V.height,Ge=V.itemHeight,je=V.notFoundContent,We=V.open,ze=V.menuItemSelectedIcon,de=V.virtual,le=V.onSelect,Oe=V.onToggleOpen,Ie=V.onActiveValue,qe=V.onScroll,ee=V.onMouseEnter,k="".concat($,"-item"),U=Object(u.a)(function(){return he},[We,he],function(Xe,Ke){return Ke[0]&&Xe[1]!==Ke[1]}),q=D.useRef(null),Y=function(Ke){Ke.preventDefault()},J=function(Ke){q.current&&q.current.scrollTo({index:Ke})},be=function(Ke){for(var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ue=U.length,_e=0;_e<Ue;_e+=1){var Ce=(Ke+_e*Fe+Ue)%Ue,Ne=U[Ce],De=Ne.group,rt=Ne.data;if(!De&&!rt.disabled)return Ce}return-1},ke=D.useState(function(){return be(0)}),ct=Object(w.a)(ke,2),He=ct[0],Be=ct[1],Ze=function(Ke){Be(Ke);var Fe=U[Ke];if(!Fe){Ie(null,-1);return}Ie(Fe.data.value,Ke)};D.useEffect(function(){Ze(Ee!==!1?be(0):-1)},[U.length,we]),D.useEffect(function(){var Xe=setTimeout(function(){if(!Me&&We&&Te.size===1){var Ke=Array.from(Te)[0],Fe=U.findIndex(function(Ue){var _e=Ue.data;return _e.value===Ke});Ze(Fe),J(Fe)}});return function(){return clearTimeout(Xe)}},[We]);var ht=function(Ke){Ke!==void 0&&le(Ke,{selected:!Te.has(Ke)}),Me||Oe(!1)};if(D.useImperativeHandle(re,function(){return{onKeyDown:function(Ke){var Fe=Ke.which;switch(Fe){case f.a.UP:case f.a.DOWN:{var Ue=0;if(Fe===f.a.UP?Ue=-1:Fe===f.a.DOWN&&(Ue=1),Ue!==0){var _e=be(He+Ue,Ue);J(_e),Ze(_e)}break}case f.a.ENTER:{var Ce=U[He];Ce&&!Ce.data.disabled?ht(Ce.data.value):ht(void 0),We&&Ke.preventDefault();break}case f.a.ESC:Oe(!1)}},onKeyUp:function(){},scrollTo:function(Ke){J(Ke)}}}),U.length===0)return D.createElement("div",{role:"listbox",id:"".concat(ne,"_list"),className:"".concat(k,"-empty"),onMouseDown:Y},je);function Qe(Xe){var Ke=U[Xe];if(!Ke)return null;var Fe=Ke.data||{},Ue=Fe.value,_e=Fe.label,Ce=Fe.children,Ne=Object(p.a)(Fe,!0),De=pe?Ce:_e;return Ke?D.createElement("div",Object.assign({"aria-label":typeof De=="string"?De:null},Ne,{key:Xe,role:"option",id:"".concat(ne,"_list_").concat(Xe),"aria-selected":Te.has(Ue)}),Ue):null}return D.createElement(D.Fragment,null,D.createElement("div",{role:"listbox",id:"".concat(ne,"_list"),style:{height:0,width:0,overflow:"hidden"}},Qe(He-1),Qe(He),Qe(He+1)),D.createElement(l.a,{itemKey:"key",ref:q,data:U,height:xe,itemHeight:Ge,fullHeight:!1,onMouseDown:Y,onScroll:qe,virtual:de,onMouseEnter:ee},function(Xe,Ke){var Fe,Ue=Xe.group,_e=Xe.groupOption,Ce=Xe.data,Ne=Ce.label,De=Ce.key;if(Ue)return D.createElement("div",{className:i()(k,"".concat(k,"-group"))},Ne!==void 0?Ne:De);var rt=Ce.disabled,tt=Ce.value,xt=Ce.title,Mt=Ce.children,Bt=Ce.style,It=Ce.className,Dt=Object(T.a)(Ce,["disabled","value","title","children","style","className"]),lt=Te.has(tt),pt="".concat(k,"-option"),ut=i()(k,pt,It,(Fe={},Object(x.a)(Fe,"".concat(pt,"-grouped"),_e),Object(x.a)(Fe,"".concat(pt,"-active"),He===Ke&&!rt),Object(x.a)(Fe,"".concat(pt,"-disabled"),rt),Object(x.a)(Fe,"".concat(pt,"-selected"),lt),Fe)),Pe=pe?Mt:Ne,Ve=!ze||typeof ze=="function"||lt;return D.createElement("div",Object.assign({},Dt,{"aria-selected":lt,className:ut,title:xt,onMouseMove:function(){if(He===Ke||rt)return;Ze(Ke)},onClick:function(){rt||ht(tt)},style:Bt}),D.createElement("div",{className:"".concat(pt,"-content")},Pe||tt),D.isValidElement(ze)||lt,Ve&&D.createElement(s.a,{className:"".concat(k,"-option-state"),customizeIcon:ze,customizeIconProps:{isSelected:lt}},lt?"\u2713":null))}))},r=D.forwardRef(h);r.displayName="OptionList";var t=r,n=function(){return null};n.isSelectOption=!0;var c=n,m=function(){return null};m.isSelectOptGroup=!0;var v=m,b=F("VTBJ"),E=F("Zm9Q");function g(G){var V=G.key,re=G.props,$=re.children,ne=re.value,he=Object(T.a)(re,["children","value"]);return Object(b.a)({key:V,value:ne!==void 0?ne:V,children:$},he)}function y(G){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(E.a)(G).map(function(re,$){if(!D.isValidElement(re)||!re.type)return null;var ne=re.type.isSelectOptGroup,he=re.key,pe=re.props,Te=pe.children,we=Object(T.a)(pe,["children"]);return V||!ne?g(re):Object(b.a)(Object(b.a)({key:"__RC_SELECT_GRP__".concat(he===null?$:he,"__"),label:he},we),{},{options:y(Te)})}).filter(function(re){return re})}var C=F("2Qr1"),d=F("qNPg"),_=F("U8pU"),O=F("Kwbf"),A=F("WKfj");function P(G){var V=G.mode,re=G.options,$=G.children,ne=G.backfill,he=G.allowClear,pe=G.placeholder,Te=G.getInputElement,we=G.showSearch,Me=G.onSearch,Ee=G.defaultOpen,xe=G.autoFocus,Ge=G.labelInValue,je=G.value,We=G.inputValue,ze=G.optionLabelProp,de=V==="multiple"||V==="tags",le=we!==void 0?we:de||V==="combobox",Oe=re||y($);if(Object(O.a)(V!=="tags"||Oe.every(function(k){return!k.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var Ie=Oe.some(function(k){return k.options?k.options.some(function(U){return typeof("value"in U?U.value:U.key)=="number"}):typeof("value"in k?k.value:k.key)=="number"});Object(O.a)(!Ie,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(O.a)(V!=="combobox"||!ze,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(O.a)(V==="combobox"||!ne,"`backfill` only works with `combobox` mode."),Object(O.a)(V==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(O.b)(V!=="combobox"||!Te||!he||!pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Me&&!le&&V!=="combobox"&&V!=="tags"&&Object(O.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(O.b)(!Ee||xe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),je!=null){var qe=Object(A.d)(je);Object(O.a)(!Ge||qe.every(function(k){return Object(_.a)(k)==="object"&&("key"in k||"value"in k)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(O.a)(!de||Array.isArray(je),"`value` should be array when `mode` is `multiple` or `tags`")}if($){var ee=null;Object(E.a)($).some(function(k){if(!D.isValidElement(k)||!k.type)return!1;var U=k.type;if(U.isSelectOption)return!1;if(U.isSelectOptGroup){var q=Object(E.a)(k.props.children).every(function(Y){return!D.isValidElement(Y)||!k.type||Y.type.isSelectOption?!0:(ee=Y.type,!1)});return!q}return ee=U,!0}),ee&&Object(O.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ee.displayName||ee.name||ee,"`.")),Object(O.a)(We===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=P,W=Object(d.a)({prefixCls:"rc-select",components:{optionList:t},convertChildrenToData:y,flattenOptions:C.d,getLabeledValue:C.e,filterOptions:C.b,isValueDisabled:C.g,findValueOption:C.c,warningProps:I,fillOptionsWithMissingValue:C.a}),K=function(G){Object(j.a)(re,G);var V=Object(S.a)(re);function re(){var $;return Object(ue.a)(this,re),$=V.apply(this,arguments),$.selectRef=D.createRef(),$.focus=function(){$.selectRef.current.focus()},$.blur=function(){$.selectRef.current.blur()},$}return Object(Q.a)(re,[{key:"render",value:function(){return D.createElement(W,Object.assign({ref:this.selectRef},this.props))}}]),re}(D.Component);K.Option=c,K.OptGroup=v;var te=K,H=Le.c=te},M8RZ:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return f});var ue=F("fWQN"),Q=F("mtLc"),j=F("yKVA"),S=F("879j"),D=F("q1tI"),x=F.n(D),T=F("i8i4"),w=F.n(T),f=function(p){Object(j.a)(o,p);var u=Object(S.a)(o);function o(i){var l;Object(ue.a)(this,o),l=u.call(this,i);var s=window.document;return l.node=s.createElement("div"),s.body.appendChild(l.node),l}return Object(Q.a)(o,[{key:"render",value:function(){var l=this.props.children;return Object(T.createPortal)(l,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),o}(x.a.Component)},MFOe:function(nt,Le,F){(function(ue){var Q=x(),j=T(),S=w(),D=typeof window!="undefined"?window:ue;nt.exports={assign:Q,create:j,trim:S,bind:f,slice:p,each:u,map:o,pluck:i,isList:l,isFunction:s,isObject:h,Global:D};function x(){return Object.assign?Object.assign:function(t,n,c,m){for(var v=1;v<arguments.length;v++)u(Object(arguments[v]),function(b,E){t[E]=b});return t}}function T(){if(Object.create)return function(n,c,m,v){var b=p(arguments,1);return Q.apply(this,[Object.create(n)].concat(b))};{function r(){}return function(n,c,m,v){var b=p(arguments,1);return r.prototype=n,Q.apply(this,[new r].concat(b))}}}function w(){return String.prototype.trim?function(t){return String.prototype.trim.call(t)}:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function f(r,t){return function(){return t.apply(r,Array.prototype.slice.call(arguments,0))}}function p(r,t){return Array.prototype.slice.call(r,t||0)}function u(r,t){i(r,function(n,c){return t(n,c),!1})}function o(r,t){var n=l(r)?[]:{};return i(r,function(c,m){return n[m]=t(c,m),!1}),n}function i(r,t){if(l(r)){for(var n=0;n<r.length;n++)if(t(r[n],n))return r[n]}else for(var c in r)if(r.hasOwnProperty(c)&&t(r[c],c))return r[c]}function l(r){return r!=null&&typeof r!="function"&&typeof r.length=="number"}function s(r){return r&&{}.toString.call(r)==="[object Function]"}function h(r){return r&&{}.toString.call(r)==="[object Object]"}}).call(this,F("IyRk"))},MI8n:function(nt,Le,F){"use strict";F.d(Le,"b",function(){return x}),F.d(Le,"a",function(){return f}),F.d(Le,"e",function(){return p}),F.d(Le,"d",function(){return u}),F.d(Le,"c",function(){return o}),F.d(Le,"f",function(){return i});var ue=F("/cxE"),Q=F("C/vA"),j=F("pmY6"),S=F("24hK"),D=function(){var l=function(s,h){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n])},l(s,h)};return function(s,h){l(s,h);function r(){this.constructor=s}s.prototype=h===null?Object.create(h):(r.prototype=h.prototype,new r)}}(),x;(function(l){l.None=function(){return j.a.None};function s(I){return function(W,K,te){K===void 0&&(K=null);var H=!1,G;return G=I(function(V){return H?void 0:(G?G.dispose():H=!0,W.call(K,V))},null,te),H&&G.dispose(),G}}l.once=s;function h(I,W){return v(function(K,te,H){return te===void 0&&(te=null),I(function(G){return K.call(te,W(G))},null,H)})}l.map=h;function r(I,W){return v(function(K,te,H){return te===void 0&&(te=null),I(function(G){W(G),K.call(te,G)},null,H)})}l.forEach=r;function t(I,W){return v(function(K,te,H){return te===void 0&&(te=null),I(function(G){return W(G)&&K.call(te,G)},null,H)})}l.filter=t;function n(I){return I}l.signal=n;function c(){for(var I=[],W=0;W<arguments.length;W++)I[W]=arguments[W];return function(K,te,H){return te===void 0&&(te=null),j.e.apply(void 0,I.map(function(G){return G(function(V){return K.call(te,V)},null,H)}))}}l.any=c;function m(I,W,K){var te=K;return h(I,function(H){return te=W(te,H),te})}l.reduce=m;function v(I){var W,K=new f({onFirstListenerAdd:function(){W=I(K.fire,K)},onLastListenerRemove:function(){W.dispose()}});return K.event}l.snapshot=v;function b(I,W,K,te,H){K===void 0&&(K=100),te===void 0&&(te=!1);var G,V=void 0,re=void 0,$=0,ne=new f({leakWarningThreshold:H,onFirstListenerAdd:function(){G=I(function(he){$++,V=W(V,he),te&&!re&&(ne.fire(V),V=void 0),clearTimeout(re),re=setTimeout(function(){var pe=V;V=void 0,re=void 0,(!te||$>1)&&ne.fire(pe),$=0},K)})},onLastListenerRemove:function(){G.dispose()}});return ne.event}l.debounce=b;function E(I){var W=new Date().getTime();return h(s(I),function(K){return new Date().getTime()-W})}l.stopwatch=E;function g(I){var W=!0,K;return t(I,function(te){var H=W||te!==K;return W=!1,K=te,H})}l.latch=g;function y(I,W,K){W===void 0&&(W=!1),K===void 0&&(K=[]);var te=K.slice(),H=I(function(re){te?te.push(re):V.fire(re)}),G=function(){te&&te.forEach(function(re){return V.fire(re)}),te=null},V=new f({onFirstListenerAdd:function(){H||(H=I(function(re){return V.fire(re)}))},onFirstListenerDidAdd:function(){te&&(W?setTimeout(G):G())},onLastListenerRemove:function(){H&&H.dispose(),H=null}});return V.event}l.buffer=y;var C=function(){function I(W){this.event=W}return I.prototype.map=function(W){return new I(h(this.event,W))},I.prototype.forEach=function(W){return new I(r(this.event,W))},I.prototype.filter=function(W){return new I(t(this.event,W))},I.prototype.reduce=function(W,K){return new I(m(this.event,W,K))},I.prototype.latch=function(){return new I(g(this.event))},I.prototype.debounce=function(W,K,te,H){return K===void 0&&(K=100),te===void 0&&(te=!1),new I(b(this.event,W,K,te,H))},I.prototype.on=function(W,K,te){return this.event(W,K,te)},I.prototype.once=function(W,K,te){return s(this.event)(W,K,te)},I}();function d(I){return new C(I)}l.chain=d;function _(I,W,K){K===void 0&&(K=function(re){return re});var te=function(){for(var re=[],$=0;$<arguments.length;$++)re[$]=arguments[$];return V.fire(K.apply(void 0,re))},H=function(){return I.on(W,te)},G=function(){return I.removeListener(W,te)},V=new f({onFirstListenerAdd:H,onLastListenerRemove:G});return V.event}l.fromNodeEventEmitter=_;function O(I,W,K){K===void 0&&(K=function(re){return re});var te=function(){for(var re=[],$=0;$<arguments.length;$++)re[$]=arguments[$];return V.fire(K.apply(void 0,re))},H=function(){return I.addEventListener(W,te)},G=function(){return I.removeEventListener(W,te)},V=new f({onFirstListenerAdd:H,onLastListenerRemove:G});return V.event}l.fromDOMEventEmitter=O;function A(I){var W=new f,K=!1;return I.then(void 0,function(){return null}).then(function(){K?W.fire(void 0):setTimeout(function(){return W.fire(void 0)},0)}),K=!0,W.event}l.fromPromise=A;function P(I){return new Promise(function(W){return s(I)(W)})}l.toPromise=P})(x||(x={}));var T=-1,w=function(){function l(s,h){h===void 0&&(h=Math.random().toString(18).slice(2,5)),this.customThreshold=s,this.name=h,this._warnCountdown=0}return l.prototype.dispose=function(){this._stacks&&this._stacks.clear()},l.prototype.check=function(s){var h=this,r=T;if(typeof this.customThreshold=="number"&&(r=this.customThreshold),r<=0||s<r)return;this._stacks||(this._stacks=new Map);var t=new Error().stack.split(`
|
|
|
`).slice(3).join(`
|
|
|
`),n=this._stacks.get(t)||0;if(this._stacks.set(t,n+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;var c,m=0;this._stacks.forEach(function(v,b){(!c||m<v)&&(c=b,m=v)}),console.warn("["+this.name+"] potential listener LEAK detected, having "+s+" listeners already. MOST frequent listener ("+m+"):"),console.warn(c)}return function(){var v=h._stacks.get(t)||0;h._stacks.set(t,v-1)}},l}(),f=function(){function l(s){this._disposed=!1,this._options=s,this._leakageMon=T>0?new w(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(l.prototype,"event",{get:function(){var s=this;return this._event||(this._event=function(h,r,t){s._listeners||(s._listeners=new S.a);var n=s._listeners.isEmpty();n&&s._options&&s._options.onFirstListenerAdd&&s._options.onFirstListenerAdd(s);var c=s._listeners.push(r?[h,r]:h);n&&s._options&&s._options.onFirstListenerDidAdd&&s._options.onFirstListenerDidAdd(s),s._options&&s._options.onListenerDidAdd&&s._options.onListenerDidAdd(s,h,r);var m;s._leakageMon&&(m=s._leakageMon.check(s._listeners.size));var v;return v={dispose:function(){if(m&&m(),v.dispose=l._noop,!s._disposed&&(c(),s._options&&s._options.onLastListenerRemove)){var b=s._listeners&&!s._listeners.isEmpty();b||s._options.onLastListenerRemove(s)}}},t instanceof j.b?t.add(v):Array.isArray(t)&&t.push(v),v}),this._event},enumerable:!0,configurable:!0}),l.prototype.fire=function(s){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new S.a);for(var h=this._listeners.iterator(),r=h.next();!r.done;r=h.next())this._deliveryQueue.push([r.value,s]);for(;this._deliveryQueue.size>0;){var t=this._deliveryQueue.shift(),n=t[0],c=t[1];try{typeof n=="function"?n.call(void 0,c):n[0].call(n[1],c)}catch(m){Object(ue.e)(m)}}}},l.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},l._noop=function(){},l}(),p=function(l){D(s,l);function s(h){var r=l.call(this,h)||this;return r._isPaused=0,r._eventQueue=new S.a,r._mergeFn=h&&h.merge,r}return s.prototype.pause=function(){this._isPaused++},s.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var h=this._eventQueue.toArray();this._eventQueue.clear(),l.prototype.fire.call(this,this._mergeFn(h))}else for(;!this._isPaused&&this._eventQueue.size!==0;)l.prototype.fire.call(this,this._eventQueue.shift())},s.prototype.fire=function(h){this._listeners&&(this._isPaused!==0?this._eventQueue.push(h):l.prototype.fire.call(this,h))},s}(f),u=function(){function l(){var s=this;this.hasListeners=!1,this.events=[],this.emitter=new f({onFirstListenerAdd:function(){return s.onFirstListenerAdd()},onLastListenerRemove:function(){return s.onLastListenerRemove()}})}return Object.defineProperty(l.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),l.prototype.add=function(s){var h=this,r={event:s,listener:null};this.events.push(r),this.hasListeners&&this.hook(r);var t=function(){h.hasListeners&&h.unhook(r);var n=h.events.indexOf(r);h.events.splice(n,1)};return Object(j.h)(Object(Q.a)(t))},l.prototype.onFirstListenerAdd=function(){var s=this;this.hasListeners=!0,this.events.forEach(function(h){return s.hook(h)})},l.prototype.onLastListenerRemove=function(){var s=this;this.hasListeners=!1,this.events.forEach(function(h){return s.unhook(h)})},l.prototype.hook=function(s){var h=this;s.listener=s.event(function(r){return h.emitter.fire(r)})},l.prototype.unhook=function(s){s.listener&&s.listener.dispose(),s.listener=null},l.prototype.dispose=function(){this.emitter.dispose()},l}(),o=function(){function l(){this.buffers=[]}return l.prototype.wrapEvent=function(s){var h=this;return function(r,t,n){return s(function(c){var m=h.buffers[h.buffers.length-1];m?m.push(function(){return r.call(t,c)}):r.call(t,c)},void 0,n)}},l.prototype.bufferEvents=function(s){var h=[];this.buffers.push(h);var r=s();return this.buffers.pop(),h.forEach(function(t){return t()}),r},l}(),i=function(){function l(){var s=this;this.listening=!1,this.inputEvent=x.None,this.inputEventListener=j.a.None,this.emitter=new f({onFirstListenerDidAdd:function(){s.listening=!0,s.inputEventListener=s.inputEvent(s.emitter.fire,s.emitter)},onLastListenerRemove:function(){s.listening=!1,s.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(l.prototype,"input",{set:function(s){this.inputEvent=s,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=s(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),l.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},l}()},MVJL:function(nt,Le,F){nt.exports={flex_box_center:"flex_box_center___2gBaY",flex_space_between:"flex_space_between___2uD--",flex_box_vertical_center:"flex_box_vertical_center___3Bq-4",flex_box_center_end:"flex_box_center_end___2MOXm",flex_box_column:"flex_box_column___1Sq4x",discussItem:"discussItem___Mk503",wrap:"wrap___VPGVq",list:"list___2zNHf",btns:"btns___1hoB3",secondLevelDiscuss:"secondLevelDiscuss___9Ixoa",line:"line___20Ukm",thirdlyLevelDiscuss:"thirdlyLevelDiscuss___3ZS-s"}},N0LK:function(nt,Le,F){"use strict";F.d(Le,"x",function(){return ue}),F.d(Le,"F",function(){return Q}),F.d(Le,"r",function(){return S}),F.d(Le,"o",function(){return D}),F.d(Le,"p",function(){return x}),F.d(Le,"Q",function(){return T}),F.d(Le,"K",function(){return f}),F.d(Le,"k",function(){return p}),F.d(Le,"N",function(){return u}),F.d(Le,"m",function(){return o}),F.d(Le,"l",function(){return i}),F.d(Le,"I",function(){return l}),F.d(Le,"H",function(){return s}),F.d(Le,"q",function(){return h}),F.d(Le,"t",function(){return r}),F.d(Le,"D",function(){return t}),F.d(Le,"e",function(){return n}),F.d(Le,"f",function(){return c}),F.d(Le,"B",function(){return m}),F.d(Le,"C",function(){return v}),F.d(Le,"n",function(){return E}),F.d(Le,"O",function(){return y}),F.d(Le,"c",function(){return C}),F.d(Le,"d",function(){return d}),F.d(Le,"z",function(){return _}),F.d(Le,"A",function(){return O}),F.d(Le,"u",function(){return A}),F.d(Le,"E",function(){return I}),F.d(Le,"G",function(){return W}),F.d(Le,"i",function(){return te}),F.d(Le,"g",function(){return G}),F.d(Le,"v",function(){return re}),F.d(Le,"h",function(){return $}),F.d(Le,"y",function(){return ne}),F.d(Le,"w",function(){return he}),F.d(Le,"a",function(){return pe}),F.d(Le,"P",function(){return Te}),F.d(Le,"L",function(){return we}),F.d(Le,"J",function(){return Me}),F.d(Le,"j",function(){return Ee}),F.d(Le,"M",function(){return xe}),F.d(Le,"s",function(){return Ge}),F.d(Le,"b",function(){return je});function ue(de){return!de||typeof de!="string"?!0:de.trim().length===0}function Q(de,le,Oe){Oe===void 0&&(Oe="0");for(var Ie=""+de,qe=[Ie],ee=Ie.length;ee<le;ee++)qe.push(Oe);return qe.reverse().join("")}var j=/{(\d+)}/g;function S(de){for(var le=[],Oe=1;Oe<arguments.length;Oe++)le[Oe-1]=arguments[Oe];return le.length===0?de:de.replace(j,function(Ie,qe){var ee=parseInt(qe,10);return isNaN(ee)||ee<0||ee>=le.length?Ie:le[ee]})}function D(de){return de.replace(/[<>&]/g,function(le){switch(le){case"<":return"<";case">":return">";case"&":return"&";default:return le}})}function x(de){return de.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function T(de,le){le===void 0&&(le=" ");var Oe=w(de,le);return f(Oe,le)}function w(de,le){if(!de||!le)return de;var Oe=le.length;if(Oe===0||de.length===0)return de;for(var Ie=0;de.indexOf(le,Ie)===Ie;)Ie=Ie+Oe;return de.substring(Ie)}function f(de,le){if(!de||!le)return de;var Oe=le.length,Ie=de.length;if(Oe===0||Ie===0)return de;for(var qe=Ie,ee=-1;!(ee=de.lastIndexOf(le,qe-1),ee===-1||ee+Oe!==qe);){if(ee===0)return"";qe=ee}return de.substring(0,qe)}function p(de){return de.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function u(de,le){if(de.length<le.length)return!1;if(de===le)return!0;for(var Oe=0;Oe<le.length;Oe++)if(de[Oe]!==le[Oe])return!1;return!0}function o(de,le){var Oe=de.length-le.length;return Oe>0?de.indexOf(le,Oe)===Oe:Oe===0?de===le:!1}function i(de,le,Oe){if(Oe===void 0&&(Oe={}),!de)throw new Error("Cannot create regex from empty string");le||(de=x(de)),Oe.wholeWord&&(/\B/.test(de.charAt(0))||(de="\\b"+de),/\B/.test(de.charAt(de.length-1))||(de=de+"\\b"));var Ie="";return Oe.global&&(Ie+="g"),Oe.matchCase||(Ie+="i"),Oe.multiline&&(Ie+="m"),Oe.unicode&&(Ie+="u"),new RegExp(de,Ie)}function l(de){if(de.source==="^"||de.source==="^$"||de.source==="$"||de.source==="^\\s*$")return!1;var le=de.exec("");return!!(le&&de.lastIndex===0)}function s(de){return(de.global?"g":"")+(de.ignoreCase?"i":"")+(de.multiline?"m":"")+(de.unicode?"u":"")}function h(de){for(var le=0,Oe=de.length;le<Oe;le++){var Ie=de.charCodeAt(le);if(Ie!==32&&Ie!==9)return le}return-1}function r(de,le,Oe){le===void 0&&(le=0),Oe===void 0&&(Oe=de.length);for(var Ie=le;Ie<Oe;Ie++){var qe=de.charCodeAt(Ie);if(qe!==32&&qe!==9)return de.substring(le,Ie)}return de.substring(le,Oe)}function t(de,le){le===void 0&&(le=de.length-1);for(var Oe=le;Oe>=0;Oe--){var Ie=de.charCodeAt(Oe);if(Ie!==32&&Ie!==9)return Oe}return-1}function n(de,le){return de<le?-1:de>le?1:0}function c(de,le){for(var Oe=Math.min(de.length,le.length),Ie=0;Ie<Oe;Ie++){var qe=de.charCodeAt(Ie),ee=le.charCodeAt(Ie);if(qe===ee)continue;v(qe)&&(qe+=32),v(ee)&&(ee+=32);var k=qe-ee;if(k===0)continue;return m(qe)&&m(ee)?k:n(de.toLowerCase(),le.toLowerCase())}return de.length<le.length?-1:de.length>le.length?1:0}function m(de){return de>=97&&de<=122}function v(de){return de>=65&&de<=90}function b(de){return m(de)||v(de)}function E(de,le){return de.length===le.length&&g(de,le)}function g(de,le,Oe){Oe===void 0&&(Oe=de.length);for(var Ie=0;Ie<Oe;Ie++){var qe=de.charCodeAt(Ie),ee=le.charCodeAt(Ie);if(qe===ee)continue;if(b(qe)&&b(ee)){var k=Math.abs(qe-ee);if(k!==0&&k!==32)return!1}else if(String.fromCharCode(qe).toLowerCase()!==String.fromCharCode(ee).toLowerCase())return!1}return!0}function y(de,le){var Oe=le.length;return le.length>de.length?!1:g(de,le,Oe)}function C(de,le){var Oe,Ie=Math.min(de.length,le.length);for(Oe=0;Oe<Ie;Oe++)if(de.charCodeAt(Oe)!==le.charCodeAt(Oe))return Oe;return Ie}function d(de,le){var Oe,Ie=Math.min(de.length,le.length),qe=de.length-1,ee=le.length-1;for(Oe=0;Oe<Ie;Oe++)if(de.charCodeAt(qe-Oe)!==le.charCodeAt(ee-Oe))return Oe;return Ie}function _(de){return 55296<=de&&de<=56319}function O(de){return 56320<=de&&de<=57343}function A(de,le,Oe){var Ie=de.charCodeAt(Oe);if(_(Ie)&&Oe+1<le){var qe=de.charCodeAt(Oe+1);if(O(qe))return(Ie-55296<<10)+(qe-56320)+65536}return Ie}function P(de,le){var Oe=de.charCodeAt(le-1);if(O(Oe)&&le>1){var Ie=de.charCodeAt(le-2);if(_(Ie))return(Ie-55296<<10)+(Oe-56320)+65536}return Oe}function I(de,le){var Oe=We.getInstance(),Ie=le,qe=de.length,ee=A(de,qe,le);le+=ee>=65536?2:1;for(var k=Oe.getGraphemeBreakType(ee);le<qe;){var U=A(de,qe,le),q=Oe.getGraphemeBreakType(U);if(je(k,q))break;le+=U>=65536?2:1,k=q}return le-Ie}function W(de,le){var Oe=We.getInstance(),Ie=le,qe=P(de,le);le-=qe>=65536?2:1;for(var ee=Oe.getGraphemeBreakType(qe);le>0;){var k=P(de,le),U=Oe.getGraphemeBreakType(k);if(je(U,ee))break;le-=k>=65536?2:1,ee=U}return Ie-le}var K=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function te(de){return K.test(de)}var H=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function G(de){return H.test(de)}var V=/^[\t\n\r\x20-\x7E]*$/;function re(de){return V.test(de)}function $(de){for(var le=0,Oe=de.length;le<Oe;le++)if(ne(de.charCodeAt(le)))return!0;return!1}function ne(de){return de=+de,de>=11904&&de<=55215||de>=63744&&de<=64255||de>=65281&&de<=65374}function he(de){return de>=127462&&de<=127487||de>=9728&&de<=10175||de>=127744&&de<=128591||de>=128640&&de<=128764||de>=128992&&de<=129003||de>=129280&&de<=129535||de>=129648&&de<=129651||de>=129656&&de<=129666||de>=129680&&de<=129685}var pe=String.fromCharCode(65279);function Te(de){return!!(de&&de.length>0&&de.charCodeAt(0)===65279)}function we(de){return btoa(encodeURIComponent(de))}function Me(de,le){for(var Oe="",Ie=0;Ie<le;Ie++)Oe+=de;return Oe}function Ee(de,le){return le===void 0&&(le=!1),de?(le&&(de=de.replace(/\\./g,"")),de.toLowerCase()!==de):!1}function xe(de){var le=90-65+1;return de=de%(2*le),de<le?String.fromCharCode(97+de):String.fromCharCode(65+de-le)}function Ge(de){var le=We.getInstance();return le.getGraphemeBreakType(de)}function je(de,le){return de===0?le!==5&&le!==7:de===2&&le===3?!1:de===4||de===2||de===3||(le===4||le===2||le===3)?!0:de===8&&(le===8||le===9||le===11||le===12)||((de===11||de===9)&&(le===9||le===10)||((de===12||de===10)&&le===10||(le===5||le===13||(le===7||(de===1||de===13&&le===14)))))?!1:!(de===6&&le===6)}var We=function(){function de(){this._data=ze()}return de.getInstance=function(){return de._INSTANCE||(de._INSTANCE=new de),de._INSTANCE},de.prototype.getGraphemeBreakType=function(le){if(le<32)return le===10?3:le===13?2:4;if(le<127)return 0;for(var Oe=this._data,Ie=Oe.length/3,qe=1;qe<=Ie;)if(le<Oe[3*qe])qe=2*qe;else if(le>Oe[3*qe+1])qe=2*qe+1;else return Oe[3*qe+2];return 0},de._INSTANCE=null,de}();function ze(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}},NvD2:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return x});var ue=F("Kwbf");function Q(T,w){var f=new Set;return T.forEach(function(p){w.has(p)||f.add(p)}),f}function j(T){var w=T||{},f=w.disabled,p=w.disableCheckbox,u=w.checkable;return!!(f||p)||u===!1}function S(T,w,f,p){for(var u=new Set(T),o=new Set,i=0;i<=f;i+=1){var l=w.get(i)||new Set;l.forEach(function(t){var n=t.key,c=t.node,m=t.children,v=m===void 0?[]:m;u.has(n)&&!p(c)&&v.filter(function(b){return!p(b.node)}).forEach(function(b){u.add(b.key)})})}for(var s=new Set,h=f;h>=0;h-=1){var r=w.get(h)||new Set;r.forEach(function(t){var n=t.parent,c=t.node;if(p(c)||!t.parent||s.has(t.parent.key))return;if(p(t.parent.node)){s.add(n.key);return}var m=!0,v=!1;(n.children||[]).filter(function(b){return!p(b.node)}).forEach(function(b){var E=b.key,g=u.has(E);m&&!g&&(m=!1),!v&&(g||o.has(E))&&(v=!0)}),m&&u.add(n.key),v&&o.add(n.key),s.add(n.key)})}return{checkedKeys:Array.from(u),halfCheckedKeys:Array.from(Q(o,u))}}function D(T,w,f,p,u){for(var o=new Set(T),i=new Set(w),l=0;l<=p;l+=1){var s=f.get(l)||new Set;s.forEach(function(n){var c=n.key,m=n.node,v=n.children,b=v===void 0?[]:v;!o.has(c)&&!i.has(c)&&!u(m)&&b.filter(function(E){return!u(E.node)}).forEach(function(E){o.delete(E.key)})})}i=new Set;for(var h=new Set,r=p;r>=0;r-=1){var t=f.get(r)||new Set;t.forEach(function(n){var c=n.parent,m=n.node;if(u(m)||!n.parent||h.has(n.parent.key))return;if(u(n.parent.node)){h.add(c.key);return}var v=!0,b=!1;(c.children||[]).filter(function(E){return!u(E.node)}).forEach(function(E){var g=E.key,y=o.has(g);v&&!y&&(v=!1),!b&&(y||i.has(g))&&(b=!0)}),v||o.delete(c.key),b&&i.add(c.key),h.add(c.key)})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(Q(i,o))}}function x(T,w,f,p){var u=[],o;p?o=p:o=j;var i=new Set(T.filter(function(r){var t=!!f[r];return t||u.push(r),t})),l=new Map,s=0;Object.keys(f).forEach(function(r){var t=f[r],n=t.level,c=l.get(n);c||(c=new Set,l.set(n,c)),c.add(t),s=Math.max(s,n)}),Object(ue.a)(!u.length,"Tree missing follow keys: ".concat(u.slice(0,100).map(function(r){return"'".concat(r,"'")}).join(", ")));var h;return w===!0?h=S(i,l,s,o):h=D(i,w.halfCheckedKeys,l,s,o),h}},OLES:function(nt,Le,F){"use strict";var ue=F("U8pU"),Q=F("VTBJ"),j=F("Ff2n"),S=F("q1tI"),D=F("uciX"),x=F("7ixt"),T=function(i){var l=i.overlay,s=i.prefixCls,h=i.id,r=i.overlayInnerStyle;return S.createElement("div",{className:"".concat(s,"-inner"),id:h,role:"tooltip",style:r},typeof l=="function"?l():l)},w=T,f=function(i,l){var s=i.overlayClassName,h=i.trigger,r=h===void 0?["hover"]:h,t=i.mouseEnterDelay,n=t===void 0?0:t,c=i.mouseLeaveDelay,m=c===void 0?.1:c,v=i.overlayStyle,b=i.prefixCls,E=b===void 0?"rc-tooltip":b,g=i.children,y=i.onVisibleChange,C=i.afterVisibleChange,d=i.transitionName,_=i.animation,O=i.placement,A=O===void 0?"right":O,P=i.align,I=P===void 0?{}:P,W=i.destroyTooltipOnHide,K=W===void 0?!1:W,te=i.defaultVisible,H=i.getTooltipContainer,G=i.overlayInnerStyle,V=Object(j.a)(i,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),re=Object(S.useRef)(null);Object(S.useImperativeHandle)(l,function(){return re.current});var $=Object(Q.a)({},V);"visible"in i&&($.popupVisible=i.visible);var ne=function(){var Me=i.arrowContent,Ee=Me===void 0?null:Me,xe=i.overlay,Ge=i.id;return[S.createElement("div",{className:"".concat(E,"-arrow"),key:"arrow"},Ee),S.createElement(w,{key:"content",prefixCls:E,id:Ge,overlay:xe,overlayInnerStyle:G})]},he=!1,pe=!1;if(typeof K=="boolean")he=K;else if(K&&Object(ue.a)(K)==="object"){var Te=K.keepParent;he=Te===!0,pe=Te===!1}return S.createElement(D.a,Object.assign({popupClassName:s,prefixCls:E,popup:ne,action:r,builtinPlacements:x.a,popupPlacement:A,ref:re,popupAlign:I,getPopupContainer:H,onPopupVisibleChange:y,afterPopupVisibleChange:C,popupTransitionName:d,popupAnimation:_,defaultPopupVisible:te,destroyPopupOnHide:he,autoDestroy:pe,mouseLeaveDelay:m,popupStyle:v,mouseEnterDelay:n},$),g)},p=Object(S.forwardRef)(f),u=Le.a=p},OZM5:function(nt,Le,F){"use strict";F.d(Le,"b",function(){return p}),F.d(Le,"a",function(){return u}),F.d(Le,"k",function(){return o}),F.d(Le,"h",function(){return i}),F.d(Le,"i",function(){return l}),F.d(Le,"g",function(){return s}),F.d(Le,"c",function(){return h}),F.d(Le,"d",function(){return r}),F.d(Le,"j",function(){return c}),F.d(Le,"e",function(){return m}),F.d(Le,"f",function(){return v});var ue=F("KQm4"),Q=F("U8pU"),j=F("Ff2n"),S=F("q1tI"),D=F.n(S),x=F("Kwbf"),T=F("WaYH"),w=.25,f=2;function p(b,E){var g=b.slice(),y=g.indexOf(E);return y>=0&&g.splice(y,1),g}function u(b,E){var g=b.slice();return g.indexOf(E)===-1&&g.push(E),g}function o(b){return b.split("-")}function i(b,E){return"".concat(b,"-").concat(E)}function l(b){return b&&b.type&&b.type.isTreeNode}function s(b,E){var g=[b],y=E[b];function C(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];d.forEach(function(_){var O=_.key,A=_.children;g.push(O),C(A)})}return C(y.children),g}function h(b,E){var g=b.clientY,y=E.selectHandle.getBoundingClientRect(),C=y.top,d=y.bottom,_=y.height,O=Math.max(_*w,f);return g<=C+O?-1:g>=d-O?1:0}function r(b,E){if(!b)return;var g=E.multiple;return g?b.slice():b.length?[b[0]]:b}var t=function(E){return E};function n(b,E){if(!b)return[];var g=E||{},y=g.processProps,C=y===void 0?t:y,d=Array.isArray(b)?b:[b];return d.map(function(_){var O=_.children,A=Object(j.a)(_,["children"]),P=n(O,E);return D.a.createElement(T.a,Object.assign({},C(A)),P)})}function c(b){if(!b)return null;var E;if(Array.isArray(b))E={checkedKeys:b,halfCheckedKeys:void 0};else if(Object(Q.a)(b)==="object")E={checkedKeys:b.checked||void 0,halfCheckedKeys:b.halfChecked||void 0};else return Object(x.a)(!1,"`checkedKeys` is not an array or an object"),null;return E}function m(b,E){var g=new Set;function y(C){if(g.has(C))return;var d=E[C];if(!d)return;g.add(C);var _=d.parent,O=d.node;if(O.disabled)return;_&&y(_.key)}return(b||[]).forEach(function(C){y(C)}),Object(ue.a)(g)}function v(b){var E={};return Object.keys(b).forEach(function(g){(g.startsWith("data-")||g.startsWith("aria-"))&&(E[g]=b[g])}),E}},"OkW/":function(nt,Le,F){},Ot1p:function(nt,Le,F){"use strict";var ue=F("2qtc"),Q=F("kLXV"),j=F("rAM+"),S=F("miYZ"),D=F("tsqr"),x=F("9og8"),T=F("tJVT"),w=F("jrin"),f=F("WmNS"),p=F.n(f),u=F("q1tI"),o=F.n(u),i=F("VrN/"),l=F.n(i),s=F("bdgK"),h=F("p77/"),r=F("Bd2K"),t=F("ELLl"),n=F("19Vz"),c=F("lZu9"),m=F("+NIl"),v=F("kSUc"),b=F("9Bee"),E=function(tt){var xt=tt.value,Mt=xt===void 0?"":xt,Bt=tt.className,It=tt.showTextOnly,Dt=tt.showLines,lt=tt.style,pt=lt===void 0?{}:lt,ut=Object(u.useMemo)(function(){return""},[Mt]);return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{dangerouslySetInnerHTML:{__html:ut}}))},g=F("0Owb"),y=F("dejd"),C=F("C+DQ"),d=F("1vsH"),_=F("m3rI"),O=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function A(tt){var xt=tt.onActionCallback,Mt=tt.title,Bt=tt.icon,It=tt.actionName,Dt=tt.className,lt=Dt===void 0?"":Dt,pt=tt.children;function ut(){xt(It)}return o.a.createElement("a",{title:Mt,className:lt,onClick:ut},o.a.createElement("i",{className:"md-iconfont ".concat(Bt)}),pt)}var P=function(tt){var xt=tt.watch,Mt=tt.showNullButton,Bt=tt.onActionCallback,It=tt.fullScreen,Dt=tt.insertTemp,lt=tt.hidetoolBar,pt=tt.uuid,ut=tt.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(d.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(d.D)("_educoder_session"),"&key=").concat(pt,"&api=").concat(encodeURIComponent(_.a.PROXY_SERVER)));var Pe=[].concat(O,[{title:"".concat(xt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(xt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return o.a.createElement("ul",{className:"markdown-toolbar-container"},!lt&&Pe.map(function(Ve,yt){return o.a.createElement("li",{key:yt},Ve.actionName?o.a.createElement(A,Object(g.a)({},Ve,{onActionCallback:Bt})):o.a.createElement("span",{className:"v-line"}))}),Mt?o.a.createElement("li",null,o.a.createElement(A,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Bt},o.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Dt&&o.a.createElement("li",null,o.a.createElement(A,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Dt),onActionCallback:Bt},o.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),o.a.createElement("li",{className:"btn-full-screen"},o.a.createElement(A,{icon:"".concat(It?"icon-shrink":"icon-enlarge"),title:It?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Bt})))},I=F("M8RZ"),W=F("+L6B"),K=F("2/Rp"),te=F("y8nQ"),H=F("Vl3Y"),G=F("5NDa"),V=F("5rEg"),re={labelCol:{span:4},wrapperCol:{span:20}},$=function(tt){var xt=tt.callback,Mt=tt.onCancel;function Bt(It){xt(It)}return o.a.createElement(H.a,Object(g.a)({},re,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Bt}),o.a.createElement(H.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},o.a.createElement(V.a,null)),o.a.createElement(H.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},o.a.createElement(V.a,null)),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(K.a,{type:"ghost",onClick:Mt},"\u53D6\u6D88")))},ne=F("7ahc"),he=F("k1fw"),pe=F("HmJG"),Te=F("BjJ7"),we=H.a.useForm,Me={width:280,marginRight:10},Ee={labelCol:{span:5},wrapperCol:{span:19}},xe=function(tt){var xt=tt.callback,Mt=tt.onCancel,Bt=we(),It=Object(T.a)(Bt,1),Dt=It[0],lt=Object(u.useRef)();function pt(Ve){xt(Object(he.a)(Object(he.a)({},Ve),{},{name:lt.current}))}function ut(Ve,yt){Dt.setFieldsValue({src:"/api/attachments/".concat(Ve.id,"?type=").concat(Ve.content_type),type:yt.type})}function Pe(Ve){var yt=Ve.target.files[0];lt.current=yt.name,je(yt,ut)}return o.a.createElement(H.a,Object(g.a)({form:Dt},Ee,{className:"upload-image-panel",onFinish:pt}),o.a.createElement(H.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},o.a.createElement("div",{className:"flex-container"},o.a.createElement(H.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},o.a.createElement(V.a,{style:Me})),o.a.createElement(Ge,{onFileChange:Pe}))),o.a.createElement(H.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},o.a.createElement(V.a,{style:{width:264}})),o.a.createElement(H.a.Item,{style:{textAlign:"right"}},o.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(K.a,{type:"ghost",onClick:Mt},"\u53D6\u6D88")))};function Ge(tt){var xt=tt.onFileChange;return o.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",o.a.createElement("input",{type:"file",onChange:xt}))}function je(tt,xt){if(!tt)throw new String("\u6CA1\u6709\u6587\u4EF6");var Mt=new FormData;Mt.append("editormd-image-file",tt),Mt.append("file_param_name","editormd-image-file"),Mt.append("byxhr","true");var Bt=new window.XMLHttpRequest;Bt.withCredentials=!0,Bt.addEventListener("load",function(It){xt(JSON.parse(It.target.responseText),tt)},!1),Bt.addEventListener("error",function(It){console.error(It)},!1),Bt.open("POST","".concat(Te.a,"/api/attachments.json")),Bt.send(Mt)}var We=F("giR+"),ze=F("fyUT"),de=F("7Kak"),le=F("9yH6"),Oe=le.a.Group,Ie={margin:"0 8px"},qe=function(tt){var xt=tt.callback,Mt=tt.onCancel;function Bt(It){xt(It)}return o.a.createElement(H.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Bt},o.a.createElement("div",{className:"flex-container"},o.a.createElement("span",{style:Ie},"\u5355\u5143\u683C\u6570\uFF1A"),o.a.createElement("span",{style:Ie},"\u884C\u6570"),o.a.createElement(H.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},o.a.createElement(ze.a,null)),o.a.createElement("span",{style:Ie},"\u5217\u6570"),o.a.createElement(H.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},o.a.createElement(ze.a,null))),o.a.createElement("div",{className:"flex-container",style:{marginTop:12}},o.a.createElement("span",{style:Ie},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),o.a.createElement(H.a.Item,{name:"align"},o.a.createElement(Oe,null,o.a.createElement(le.a,{value:"default"},o.a.createElement("i",{className:"fa fa-align-justify"})),o.a.createElement(le.a,{value:"left"},o.a.createElement("i",{className:"fa fa-align-left"})),o.a.createElement(le.a,{value:"center"},o.a.createElement("i",{className:"fa fa-align-center"})),o.a.createElement(le.a,{value:"right"},o.a.createElement("i",{className:"fa fa-align-right"}))))),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(K.a,{type:"ghost",onClick:Mt},"\u53D6\u6D88")))},ee=F("ErOA"),k=F("7Cbv"),U="link",q="upload-image",Y="code-block",J="add-table",be="------------",ke={default:be,left:":".concat(be),center:":".concat(be,":"),right:"".concat(be,":")},ct=F("9VGf"),He,Be;function Ze(){}var ht=0,Qe=1e4,Xe="\u2581",Ke=`
|
|
|
**\u6A21\u677F\u6807\u9898**
|
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Fe(tt){return/^\d+$/.test(tt)?"".concat(tt,"px"):tt}var Ue=navigator.platform.toUpperCase().indexOf("MAC")>=0,_e=Ue?"Cmd":"Ctrl",Ce=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],Ne=(He={},Object(w.a)(He,_e+"-B","bold"),Object(w.a)(He,_e+"-I","italic"),He),De=(Be={},Object(w.a)(Be,U,"\u6DFB\u52A0\u94FE\u63A5"),Object(w.a)(Be,Y,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(w.a)(Be,q,"\u6DFB\u52A0\u6587\u4EF6"),Object(w.a)(Be,J,"\u6DFB\u52A0\u8868\u683C"),Be),rt=Le.a=function(tt){var xt=tt.defaultValue,Mt=xt===void 0?"":xt,Bt=tt.onChange,It=tt.width,Dt=It===void 0?"100%":It,lt=tt.height,pt=lt===void 0?400:lt,ut=tt.miniToolbar,Pe=ut===void 0?!1:ut,Ve=tt.isFocus,yt=Ve===void 0?!1:Ve,st=tt.watch,Nt=tt.insertTemp,Ut=tt.mode,it=Ut===void 0?"markdown":Ut,mt=tt.id,bt=mt===void 0?"markdown-editor-id":mt,At=tt.showResizeBar,Xt=At===void 0?!1:At,Ae=tt.noStorage,ge=Ae===void 0?!1:Ae,z=tt.showNullButton,Z=z===void 0?!1:z,oe=tt.hidetoolBar,me=oe===void 0?!1:oe,Re=tt.fullScreen,Je=Re===void 0?!1:Re,at=tt.onBlur,kt=tt.onCMBeforeChange,jt=tt.onFullScreen,ot=tt.className,wt=ot===void 0?"":ot,Kt=tt.disablePaste,Et=Kt===void 0?!1:Kt,Qt=tt.placeholder,Vt=Qt===void 0?"":Qt,ie=tt.values,N=ie===void 0?"":ie,B=Object(u.useState)(null),ae=Object(T.a)(B,2),fe=ae[0],se=ae[1],$e=Object(u.useState)(Mt),St=Object(T.a)($e,2),Pt=St[0],$t=St[1],Ot=Object(u.useState)(st),zt=Object(T.a)(Ot,2),an=zt[0],jn=zt[1],Dr=Object(u.useState)(Je),Cr=Object(T.a)(Dr,2),Nn=Cr[0],hr=Cr[1],mi=Object(u.useState)(""),Or=Object(T.a)(mi,2),yr=Or[0],pr=Or[1],Yr=Object(u.useState)(0),Mr=Object(T.a)(Yr,2),Zr=Mr[0],wr=Mr[1],vi=Object(u.useState)(pt),li=Object(T.a)(vi,2),Kr=li[0],zr=li[1],xi=Object(u.useState)(!1),gi=Object(T.a)(xi,2),Si=gi[0],Fn=gi[1],Sn=Object(u.useRef)(Object(k.a)()),_r=Object(u.useRef)(!1),zn=Object(u.useRef)(),Lr=Object(u.useRef)(),rr=Object(u.useRef)(),Ri=Object(u.useRef)(),Pr=Object(u.useRef)(),ni=function(){var un=Object(x.a)(p.a.mark(function Cn(){var pn,Un;return p.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return mr.next=2,Object(ee.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Sn.current}});case 2:Un=mr.sent,Un!=null&&(pn=Un.attachments)!==null&&pn!==void 0&&pn.length&&(console.log("cm:",fe,Lr),Un.attachments.map(function(Zn){Zn.content_type.indexOf("image")>-1?fe.replaceSelection(".concat(Zn.content_type,")")):Zn.content_type.indexOf("video")>-1?fe.replaceSelection('<video width="100%" controls src="'.concat(_.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Zn.content_type.indexOf("pdf")>-1?fe.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(Zn.id,"?type=").concat(Zn.content_type,'&disposition=inline" target="_blank">').concat(Zn.name,"</a>")):fe.replaceSelection("[".concat(Zn.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(Zn.id,"?type=").concat(Zn.content_type,")"))}));case 4:case"end":return mr.stop()}},Cn)}));return function(){return un.apply(this,arguments)}}();Object(u.useEffect)(function(){$t(N),fe==null||fe.setValue(N)},[N]),Object(u.useEffect)(function(){jt==null||jt(Nn)},[Nn]),Object(u.useEffect)(function(){if(Lr.current){var un=l.a.fromTextArea(Lr.current,{mode:it,lineNumbers:!Pe,lineWrapping:!0,value:Mt,autoCloseTags:!0,autoCloseBrackets:!0});yt&&un.focus();function Cn(pn,Un){if(Et){Un.preventDefault();return}var ur=Un.clipboardData;if(ur){var mr=ur.types.toString(),Zn=ur.items;if(mr==="Files"||ur.types.indexOf("Files")>-1){if(Un.preventDefault(),it=="stex")return;try{var hn,Fr=Zn[1];((hn=Zn[0])===null||hn===void 0?void 0:hn.kind)==="file"&&(Fr=Zn[0]);var Bn=Fr.getAsFile(),Bi=Bn.name.split(".").pop();je(Bn,function(cr){if(cr.id){var Br,bi,ft;(Bn==null||((Br=Bn.type)===null||Br===void 0)?void 0:Br.indexOf("image"))>-1?un.replaceSelection(".concat(cr.content_type,")")):(Bn==null||((bi=Bn.type)===null||bi===void 0)?void 0:bi.indexOf("video"))>-1?un.replaceSelection('<video width="100%" controls src="'.concat(_.a.API_SERVER,"/api/attachments/").concat(cr.id,'"></video>')):(Bn==null||((ft=Bn.type)===null||ft===void 0)?void 0:ft.indexOf("pdf"))>-1?un.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(Bn.type,'&disposition=inline" target="_blank">').concat(Bn.name,"</a>")):Ce.includes(Bi)?un.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(cr.id,'?type=office&disposition=inline" target="_blank">').concat(Bn.name,"</a>")):un.replaceSelection("[".concat(Bn.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(cr.content_type,")"))}else(cr==null?void 0:cr.status)===401&&(document.location.href="/user/login")})}catch(cr){D.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return un.on("paste",Cn),un.on("dragleave",function(pn,Un){rr.current.classList.remove("mouse-hover-md")}),un.on("dragover",function(pn,Un){rr.current.classList.add("mouse-hover-md")}),un.on("drop",function(pn,Un){rr.current.classList.add("mouse-hover-md");var ur;if(ur=Un.dataTransfer.files,ur.length>0){Un.preventDefault(),Un.stopPropagation();for(var mr=function(Fr){var Bn=ur[Fr],Bi=Bn.name.split(".").pop();je(Bn,function(cr){if(cr.id){var Br,bi,ft;(Bn==null||((Br=Bn.type)===null||Br===void 0)?void 0:Br.indexOf("image"))>-1?un.replaceSelection(".concat(cr.content_type,")")):(Bn==null||((bi=Bn.type)===null||bi===void 0)?void 0:bi.indexOf("video"))>-1?un.replaceSelection('<video width="100%" controls src="'.concat(_.a.API_SERVER,"/api/attachments/").concat(cr.id,'"></video>')):(Bn==null||((ft=Bn.type)===null||ft===void 0)?void 0:ft.indexOf("pdf"))>-1?un.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(Bn.type,'&disposition=inline" target="_blank">').concat(Bn.name,"</a>")):Ce.includes(Bi)?un.replaceSelection('<a href="'.concat(_.a.API_SERVER,"/api/attachments/").concat(cr.id,'?type=office&disposition=inline" target="_blank">').concat(Bn.name,"</a>")):un.replaceSelection("[".concat(Bn.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(cr.content_type,")"))}else(cr==null?void 0:cr.status)===401&&(document.location.href="/user/login")})},Zn=0;Zn<ur.length;Zn++)mr(Zn)}}),se(un),function(){un.off("paste",Cn)}}},[]);var ji=Object(u.useCallback)(function(){if(rr.current)try{}catch(un){console.log(un,"---- to set md editor body height")}},[Kr,rr,Nn]);Object(u.useEffect)(function(){function un(){var pn=new s.default(function(Un){var ur=Object(j.a)(Un),mr;try{for(ur.s();!(mr=ur.n()).done;){var Zn=mr.value;(Zn.target.offsetHeight>0||Zn.target.offsetWidth>0)&&(ji(),fe.setSize("100%","100%"),fe.refresh())}}catch(hn){ur.e(hn)}finally{ur.f()}});return pn.observe(Lr.current.parentElement),pn}if(fe){var Cn=un();return function(){Cn.unobserve(Lr.current.parentElement)}}},[fe,ji]),Object(u.useEffect)(function(){if(fe){for(var un=[],Cn=function(){var Zn=Un[pn];ur=Object(T.a)(Zn,2);var hn=ur[0],Fr=ur[1],Bn=Object(w.a)({},hn,function(){ui(Fr)});un.push(Bn),fe.addKeyMap(Bn)},pn=0,Un=Object.entries(Ne);pn<Un.length;pn++){var ur;Cn()}return zn.current=setInterval(function(){_r.current&&ni()},4e3),function(){clearInterval(zn.current);var mr=Object(j.a)(un),Zn;try{for(mr.s();!(Zn=mr.n()).done;){var hn=Zn.value;fe.removeKeyMap(hn)}}catch(Fr){mr.e(Fr)}finally{mr.f()}}}},[fe]),Object(u.useEffect)(function(){Je!==Nn&&hr(Je)},[Je]),Object(ct.a)(function(){if(!ge&&Zr>0){var un=new Date().getTime(),Cn=window.sessionStorage.getItem(bt);un>=Zr+Qe&&(!Cn||Cn!==Pt)&&(window.sessionStorage.setItem(bt,Pt),Fn(!0))}},Qe),Object(u.useEffect)(function(){jn(st)},[fe,st]),Object(u.useEffect)(function(){fe&&(yt&&fe.focus())},[fe,yt]),Object(u.useEffect)(function(){if(an&&fe){var un=fe.getScrollerElement();function Cn(pn){var Un=pn.target;if(Pr.current){var ur=Un.scrollTop/Un.scrollHeight;Pr.current.scrollTop=Pr.current.scrollHeight*ur}}return un.addEventListener("scroll",Cn),function(){un.removeEventListener("scroll",Cn)}}},[fe,an]),Object(u.useEffect)(function(){if(fe&&kt){function un(Cn,pn){kt(Cn,pn)}return fe.on("beforeChange",un),function(){fe.off("beforeChange",un)}}},[fe,kt]),Object(u.useEffect)(function(){if(fe&&at){function un(){at(fe.getValue())}return fe.on("blur",un),function(){fe.off("blur",un)}}},[fe,at]),Object(u.useEffect)(function(){if(fe){function un(Cn){var pn=Cn.getValue();$t(pn),wr(new Date().getTime()),Cn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Bt&&Bt(pn)}return fe.on("change",un),function(){fe.off("change",un)}}},[fe,Bt]),Object(u.useEffect)(function(){fe&&(Mt==null?(fe.setValue(""),$t("")):Mt!==fe.getValue()&&(fe.setValue(Mt),$t(Mt),fe.setCursor(fe.lineCount(),0)))},[fe,Mt]);var ui=Object(u.useCallback)(function(un){var Cn=fe.getCursor(),pn=fe.getSelection(),Un=pn.split(`
|
|
|
`);switch(un){case"bold":return fe.replaceSelection("**"+pn+"**"),pn===""&&fe.setCursor(Cn.line,Cn.ch+2),fe.focus();case"italic":return fe.replaceSelection("*"+pn+"*"),pn===""&&fe.setCursor(Cn.line,Cn.ch+1),fe.focus();case"code":return fe.replaceSelection("`"+pn+"`"),pn===""&&fe.setCursor(Cn.line,Cn.ch+1),fe.focus();case"inline-latex":return fe.replaceSelection("`$$"+pn+"$$`"),pn===""&&fe.setCursor(Cn.line,Cn.ch+3),fe.focus();case"latex":return fe.replaceSelection("```latex\n"+pn+"\n```"),fe.setCursor(Cn.line+1,pn.length+1),fe.focus();case"line-break":return fe.replaceSelection(`<br/>
|
|
|
`),fe.focus();case"list-ul":return pn===""?fe.replaceSelection("- "+pn):fe.replaceSelection(Un.map(function(ur){return ur===""?"":"- ".concat(ur)}).join(`
|
|
|
`)),fe.focus();case"list-ol":return pn===""?fe.replaceSelection("1. "+pn):fe.replaceSelection(Un.map(function(ur,mr){return ur===""?"":"".concat(mr+1,". ").concat(ur)}).join(`
|
|
|
`)),fe.focus();case"add-null-ch":return pn===""&&fe.setCursor(Cn.line,Cn.ch+1),fe.replaceSelection(Xe),fe.focus();case"inster-template-1":return pn===""&&fe.setCursor(Cn.line,Cn.ch),fe.replaceSelection(Ke),fe.focus();case"eraser":return fe.setValue(""),fe.focus();case"trigger-watch":return jn(!an),fe.focus();case"trigger-full-screen":return hr(!Nn),fe.focus();case U:pr(U);return;case Y:pr(Y);return;case q:pr(q);return;case J:pr(J);return;default:throw new Error}},[fe,an,Nn]),Di=Object(u.useCallback)(function(un){pr("");switch(yr){case U:var Cn=un.title,pn=un.link;return fe.replaceSelection("[".concat(Cn,"](").concat(pn,")")),fe.focus();case Y:var Un=un.language,ur=un.content;return fe.replaceSelection(["```"+Un,ur,"```"].join(`
|
|
|
`)),fe.focus();case q:var mr=un.src,Zn=un.alt,hn=un.name;return mr.indexOf("type=image")>-1?fe.replaceSelection(".concat(mr,' "').concat(Zn||"",'" )')):mr.indexOf("type=application/pdf")>-1?fe.replaceSelection('<a href="'.concat(mr,'&disposition=inline" target="_blank">').concat(hn,"</a>")):fe.replaceSelection('<a href="'.concat(mr,'" target="_blank">').concat(hn,"</a>")),fe.focus();case J:for(var Fr=un.row,Bn=un.col,Bi=un.align,cr=`
|
|
|
`,Br=0;Br<Fr;Br++){for(var bi=[],ft=[],gt=0;gt<Bn;gt++)Br===1&&ft.push(ke[Bi]),bi.push(" ");Br===1&&(cr+="| ".concat(ft.join(" | "),` |
|
|
|
`)),cr+="| ".concat(bi.join(Bn===1?"":" | "),` |
|
|
|
`)}return fe.replaceSelection(cr+`
|
|
|
`),fe.focus();default:throw new Error}},[fe,yr]),ta=Object(u.useMemo)(function(){switch(yr){case U:return o.a.createElement($,{callback:Di,onCancel:ci});case Y:return o.a.createElement(ne.b,{callback:Di,onCancel:ci});case q:return o.a.createElement(xe,{callback:Di,onCancel:ci});case J:return o.a.createElement(qe,{callback:Di,onCancel:ci});default:return null}},[yr]);function ci(){pr("")}Object(u.useEffect)(function(){if(Ri.current){var un=Ri.current,Cn=!1,pn=0;function Un(Zn){Cn=!0,pn=Zn.pageY}function ur(){Cn=!1}function mr(Zn){if(Cn){var hn=Zn.pageY-pn;hn<0&&(hn=0),hn>300&&(hn=300);var Fr=pt+hn+"px";zr(Fr)}}return un.addEventListener("mousedown",Un),document.addEventListener("mousemove",mr),document.addEventListener("mouseup",ur),function(){un.removeEventListener("mousedown",Un),document.removeEventListener("mousemove",mr),document.removeEventListener("mouseup",ur)}}},[fe,Ri]),Object(u.useEffect)(function(){zr(pt)},[pt]);var Fi=Fe(Dt),Ci=Fe(Kr),zi={width:Fi,height:Ci},qi=Object(u.useMemo)(function(){if(Zr){var un=new Date(Zr),Cn=un.getHours(),pn=un.getMinutes(),Un=un.getSeconds();return Cn=Cn<10?"0"+Cn:Cn,pn=pn<10?"0"+pn:pn,Un=Un<10?"0"+Un:Un,"".concat(Cn,":").concat(pn,":").concat(Un)}return 0},[Zr]);function yi(){window.sessionStorage.removeItem(bt),Fn(!1),wr(0)}function aa(){Fn(!1),wr(0),fe.setValue(window.sessionStorage.getItem(bt))}function ma(un,Cn){var pn=fe.getValue();pn=pn.replace(un,Cn),$t(pn),fe==null||fe.setValue(pn)}return o.a.createElement(u.Fragment,null,o.a.createElement("div",{className:"markdown-editor-wrapper",ref:rr},o.a.createElement("div",{className:"markdown-editor-container ".concat(wt," ").concat(an?"on-preview":""," ").concat(Pe?"mini":""," ").concat(Nn?"full-screen":""),style:zi},o.a.createElement(P,{insertTemp:Nt,watch:an,fullScreen:Nn,showNullButton:Z,onActionCallback:ui,hidetoolBar:me,uuid:Sn.current,setOpenPhones:function(){_r.current=!0}}),o.a.createElement("div",{className:"markdown-editor-body"},o.a.createElement("div",{className:"codemirror-container"},o.a.createElement("textarea",{ref:Lr,placeholder:Vt})),an?o.a.createElement("div",{ref:Pr,className:"preview-container"},it==="stex"&&o.a.createElement(E,{value:Pt}),it!=="stex"&&o.a.createElement(b.a,{edit:!0,value:Pt,replaces:ma})):null))),Xt?o.a.createElement("a",{ref:Ri,className:"editor-resize"}):null,o.a.createElement(I.a,null,De[yr]?o.a.createElement(Q.a,{centered:!0,title:De[yr],visible:!0,onCancel:ci,footer:null},ta):null))}},P5Jw:function(nt,Le,F){"use strict";var ue=F("rHrb"),Q=ue.CopyToClipboard;Q.CopyToClipboard=Q,nt.exports=Q},PD8m:function(nt,Le){nt.exports={name:"memoryStorage",read:ue,write:Q,each:j,remove:S,clearAll:D};var F={};function ue(x){return F[x]}function Q(x,T){F[x]=T}function j(x){for(var T in F)F.hasOwnProperty(T)&&x(F[T],T)}function S(x){delete F[x]}function D(x){F={}}},QDVR:function(nt,Le,F){"use strict";F.d(Le,"e",function(){return Q}),F.d(Le,"d",function(){return j}),F.d(Le,"c",function(){return T}),F.d(Le,"b",function(){return w}),F.d(Le,"a",function(){return p});var ue=function(){var u=function(o,i){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,s){l.__proto__=s}||function(l,s){for(var h in s)s.hasOwnProperty(h)&&(l[h]=s[h])},u(o,i)};return function(o,i){u(o,i);function l(){this.constructor=o}o.prototype=i===null?Object.create(i):(l.prototype=i.prototype,new l)}}();function Q(u){var o=[];return u.forEach(function(i){return o.push(i)}),o}function j(u){var o=[];return u.forEach(function(i,l){return o.push(l)}),o}var S=function(){function u(){this._value="",this._pos=0}return u.prototype.reset=function(o){return this._value=o,this._pos=0,this},u.prototype.next=function(){return this._pos+=1,this},u.prototype.hasNext=function(){return this._pos<this._value.length-1},u.prototype.cmp=function(o){var i=o.charCodeAt(0),l=this._value.charCodeAt(this._pos);return i-l},u.prototype.value=function(){return this._value[this._pos]},u}(),D=function(){function u(o){o===void 0&&(o=!0),this._splitOnBackslash=o}return u.prototype.reset=function(o){return this._value=o.replace(/\\$|\/$/,""),this._from=0,this._to=0,this.next()},u.prototype.hasNext=function(){return this._to<this._value.length},u.prototype.next=function(){this._from=this._to;for(var o=!0;this._to<this._value.length;this._to++){var i=this._value.charCodeAt(this._to);if(i===47||this._splitOnBackslash&&i===92)if(o)this._from++;else break;else o=!1}return this},u.prototype.cmp=function(o){for(var i=0,l=o.length,s=this._from;i<l&&s<this._to;){var h=o.charCodeAt(i)-this._value.charCodeAt(s);if(h!==0)return h;i+=1,s+=1}return l===this._to-this._from?0:i<l?-1:1},u.prototype.value=function(){return this._value.substring(this._from,this._to)},u}(),x=function(){function u(){}return u}(),T=function(){function u(o){this._iter=o}return u.forPaths=function(){return new u(new D)},u.forStrings=function(){return new u(new S)},u.prototype.clear=function(){this._root=void 0},u.prototype.set=function(o,i){var l=this._iter.reset(o),s;for(this._root||(this._root=new x,this._root.segment=l.value()),s=this._root;;){var h=l.cmp(s.segment);if(h>0)s.left||(s.left=new x,s.left.segment=l.value()),s=s.left;else if(h<0)s.right||(s.right=new x,s.right.segment=l.value()),s=s.right;else if(l.hasNext())l.next(),s.mid||(s.mid=new x,s.mid.segment=l.value()),s=s.mid;else break}var r=s.value;return s.value=i,s.key=o,r},u.prototype.get=function(o){for(var i=this._iter.reset(o),l=this._root;l;){var s=i.cmp(l.segment);if(s>0)l=l.left;else if(s<0)l=l.right;else if(i.hasNext())i.next(),l=l.mid;else break}return l?l.value:void 0},u.prototype.findSubstr=function(o){for(var i=this._iter.reset(o),l=this._root,s=void 0;l;){var h=i.cmp(l.segment);if(h>0)l=l.left;else if(h<0)l=l.right;else if(i.hasNext())i.next(),s=l.value||s,l=l.mid;else break}return l&&l.value||s},u.prototype.forEach=function(o){this._forEach(this._root,o)},u.prototype._forEach=function(o,i){o&&(this._forEach(o.left,i),o.value&&i(o.value,o.key),this._forEach(o.mid,i),this._forEach(o.right,i))},u}(),w=function(){function u(){this.map=new Map,this.ignoreCase=!1}return u.prototype.set=function(o,i){this.map.set(this.toKey(o),i)},u.prototype.get=function(o){return this.map.get(this.toKey(o))},u.prototype.toKey=function(o){var i=o.toString();return this.ignoreCase&&(i=i.toLowerCase()),i},u}(),f=function(){function u(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return u.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(u.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),u.prototype.get=function(o,i){i===void 0&&(i=0);var l=this._map.get(o);return l?(i!==0&&this.touch(l,i),l.value):void 0},u.prototype.set=function(o,i,l){l===void 0&&(l=0);var s=this._map.get(o);if(s)s.value=i,l!==0&&this.touch(s,l);else{s={key:o,value:i,next:void 0,previous:void 0};switch(l){case 0:this.addItemLast(s);break;case 1:this.addItemFirst(s);break;case 2:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(o,s),this._size++}},u.prototype.delete=function(o){return!!this.remove(o)},u.prototype.remove=function(o){var i=this._map.get(o);return i?(this._map.delete(o),this.removeItem(i),this._size--,i.value):void 0},u.prototype.forEach=function(o,i){for(var l=this._head;l;)i?o.bind(i)(l.value,l.key,this):o(l.value,l.key,this),l=l.next},u.prototype.trimOld=function(o){if(o>=this.size)return;if(o===0){this.clear();return}for(var i=this._head,l=this.size;i&&l>o;)this._map.delete(i.key),i=i.next,l--;this._head=i,this._size=l,i&&(i.previous=void 0)},u.prototype.addItemFirst=function(o){if(!this._head&&!this._tail)this._tail=o;else if(this._head)o.next=this._head,this._head.previous=o;else throw new Error("Invalid list");this._head=o},u.prototype.addItemLast=function(o){if(!this._head&&!this._tail)this._head=o;else if(this._tail)o.previous=this._tail,this._tail.next=o;else throw new Error("Invalid list");this._tail=o},u.prototype.removeItem=function(o){if(o===this._head&&o===this._tail)this._head=void 0,this._tail=void 0;else if(o===this._head){if(!o.next)throw new Error("Invalid list");o.next.previous=void 0,this._head=o.next}else if(o===this._tail){if(!o.previous)throw new Error("Invalid list");o.previous.next=void 0,this._tail=o.previous}else{var i=o.next,l=o.previous;if(!i||!l)throw new Error("Invalid list");i.previous=l,l.next=i}o.next=void 0,o.previous=void 0},u.prototype.touch=function(o,i){if(!this._head||!this._tail)throw new Error("Invalid list");if(i!==1&&i!==2)return;if(i===1){if(o===this._head)return;var l=o.next,s=o.previous;o===this._tail?(s.next=void 0,this._tail=s):(l.previous=s,s.next=l),o.previous=void 0,o.next=this._head,this._head.previous=o,this._head=o}else if(i===2){if(o===this._tail)return;var l=o.next,s=o.previous;o===this._head?(l.previous=void 0,this._head=l):(l.previous=s,s.next=l),o.next=void 0,o.previous=this._tail,this._tail.next=o,this._tail=o}},u.prototype.toJSON=function(){var o=[];return this.forEach(function(i,l){o.push([l,i])}),o},u}(),p=function(u){ue(o,u);function o(i,l){l===void 0&&(l=1);var s=u.call(this)||this;return s._limit=i,s._ratio=Math.min(Math.max(0,l),1),s}return o.prototype.get=function(i){return u.prototype.get.call(this,i,2)},o.prototype.peek=function(i){return u.prototype.get.call(this,i,0)},o.prototype.set=function(i,l){u.prototype.set.call(this,i,l,2),this.checkTrim()},o.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},o}(f)},RELg:function(nt,Le,F){var ue=F("MFOe"),Q=ue.Global;nt.exports={name:"oldIE-userDataStorage",write:T,read:w,each:f,remove:p,clearAll:u};var j="storejs",S=Q.document,D=l(),x=(Q.navigator?Q.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function T(s,h){if(x)return;var r=i(s);D(function(t){t.setAttribute(r,h),t.save(j)})}function w(s){if(x)return;var h=i(s),r=null;return D(function(t){r=t.getAttribute(h)}),r}function f(s){D(function(h){for(var r=h.XMLDocument.documentElement.attributes,t=r.length-1;t>=0;t--){var n=r[t];s(h.getAttribute(n.name),n.name)}})}function p(s){var h=i(s);D(function(r){r.removeAttribute(h),r.save(j)})}function u(){D(function(s){var h=s.XMLDocument.documentElement.attributes;s.load(j);for(var r=h.length-1;r>=0;r--)s.removeAttribute(h[r].name);s.save(j)})}var o=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function i(s){return s.replace(/^\d/,"___$&").replace(o,"___")}function l(){if(!S||!S.documentElement||!S.documentElement.addBehavior)return null;var s="script",h,r,t;try{r=new ActiveXObject("htmlfile"),r.open(),r.write("<"+s+">document.w=window</"+s+'><iframe src="/favicon.ico"></iframe>'),r.close(),h=r.w.frames[0].document,t=h.createElement("div")}catch(n){t=S.createElement("div"),h=S.body}return function(n){var c=[].slice.call(arguments,0);c.unshift(t),h.appendChild(t),t.addBehavior("#default#userData"),t.load(j),n.apply(this,c),h.removeChild(t);return}}},RpDr:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return b}),F.d(Le,"c",function(){return y});var ue=F("+L6B"),Q=F("2/Rp"),j=F("tJVT"),S=F("k1fw"),D=F("jrin"),x=F("5NDa"),T=F("5rEg"),w=F("q1tI"),f=F.n(w),p=F("8Skl"),u=F("y3Kf"),o=F("bdLU"),i=F("J66h"),l=F.n(i),s=F("++UQ"),h=F.n(s),r=F("IxHN"),t=F("9Bee"),n=F("1vsH"),c,m=T.a.TextArea,v={visible:!1,tabIndex:"0"},b=(c={},Object(D.a)(c,o.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(D.a)(c,o.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(D.a)(c,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(D.a)(c,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(D.a)(c,4,"\u7F16\u8BD1\u5931\u8D25"),Object(D.a)(c,5,"\u6267\u884C\u5931\u8D25"),c),E;(function(d){d[d.SET_VISIBLE=0]="SET_VISIBLE",d[d.SET_TABINDEX=1]="SET_TABINDEX"})(E||(E={}));function g(d,_){switch(_.type){case E.SET_VISIBLE:return Object(S.a)(Object(S.a)({},d),{},{visible:_.payload});case E.SET_TABINDEX:return Object(S.a)(Object(S.a)({},d),{},{tabIndex:_.payload});default:throw new Error}}function y(d){var _=d.status,O=d.error_msg,A=d.output,P=d.input,I=d.expected_output,W=d.is_file,K=d.input_file_url,te=d.output_file_url,H=d.expected_output_file_url,G=null,V={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(_){case o.a.NOMATCH:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!W&&f.a.createElement(t.a,{value:P,style:V}),W&&f.a.createElement("div",{style:V},f.a.createElement("a",{onClick:function(){return Object(n.w)(K,P)}},P)),f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!W&&f.a.createElement(t.a,{value:A&&i.Base64.decode(A)||"",style:V}),W&&f.a.createElement("div",{style:V},f.a.createElement("a",{onClick:function(){return Object(n.w)(te,A)}},A)),f.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!W&&f.a.createElement(t.a,{value:I&&i.Base64.decode(I)||"",style:V}),W&&f.a.createElement("div",{style:V},f.a.createElement("a",{onClick:function(){return Object(n.w)(H,I)}},I)));break;case o.a.EXECUTEFAILURE:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!W&&f.a.createElement(t.a,{value:P,style:V}),W&&f.a.createElement("div",{style:V},f.a.createElement("a",{onClick:function(){return Object(n.w)(K,P)}},P)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},i.Base64.decode(O)));break;case o.a.COMPILEFAILURE:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!W&&f.a.createElement(t.a,{value:P,style:V}),W&&f.a.createElement("div",{style:V},f.a.createElement("a",{onClick:function(){return Object(n.w)(K,P)}},P)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},i.Base64.decode(O)));break;case o.a.PODFAILURE:G=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case o.a.TIMEOUT:G=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",G," ")}function C(d){var _=d.status,O=d.error_msg,A=d.execute_time,P=d.output,I=d.input,W=d.expected_output,K=d.is_file,te=d.input_file_url,H=d.output_file_url,G=d.expected_output_file_url,V=null;switch(_){case o.a.OK:V=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",A),f.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),f.a.createElement("pre",null,i.Base64.decode(P)));break;case o.a.NOMATCH:V=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u8F93\u5165\uFF1A",f.a.createElement("pre",null,I)),f.a.createElement("p",null,"\u8F93\u51FA\uFF1A",P&&i.Base64.decode(P)),f.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",W&&i.Base64.decode(W)));break;case o.a.EXECUTEFAILURE:V=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",f.a.createElement("pre",null,I)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},i.Base64.decode(O)));break;case o.a.COMPILEFAILURE:V=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",f.a.createElement("pre",null,I)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},i.Base64.decode(O)));break;case o.a.PODFAILURE:V=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case o.a.TIMEOUT:V=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",V," ")}Le.b=function(d){var _=d.id,O=d.input,A=d.debuging,P=d.submitting,I=d.executingMessage,W=d.debugResult,K=d.onChangeInput,te=d.onDebugCode,H=d.onSubmitCode,G=Object(w.useReducer)(g,v),V=Object(j.a)(G,2),re=V[0],$=V[1],ne=re.visible,he=re.tabIndex;Object(w.useEffect)(function(){$({type:E.SET_VISIBLE,payload:!1})},[_]);function pe(Ee){var xe=Ee.target.id;$({type:E.SET_TABINDEX,payload:xe})}function Te(){$({type:E.SET_VISIBLE,payload:!ne})}var we=Object(w.useMemo)(function(){if(W){var Ee=W.status;return f.a.createElement(f.a.Fragment,null,C(W))}return null},[W]);function Me(){$({type:E.SET_VISIBLE,payload:!0}),$({type:E.SET_TABINDEX,payload:"1"}),te()}return f.a.createElement("div",{className:"test-case-panel"},f.a.createElement("div",{className:"test-case-panel-body ".concat(ne?"active":"")},f.a.createElement("ul",{className:"s-navs"},f.a.createElement("li",null,f.a.createElement("a",{className:he==="0"?"active":"",id:"0",onClick:pe},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),f.a.createElement("li",null,f.a.createElement("a",{className:he==="1"?"active":"",id:"1",onClick:pe},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),f.a.createElement("div",{className:"tab-panel-body ".concat(he==="0"?"":"hide")},f.a.createElement(m,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:O,onChange:K})),f.a.createElement("div",{className:"tab-panel-body ".concat(he==="1"?"":"hide")},A?f.a.createElement(r.a,{message:I}):W?f.a.createElement("section",{style:{height:200}}," ",we," "):f.a.createElement("p",{className:"tip"},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))),f.a.createElement("a",{className:"btn-collapse ".concat(ne?"up":""),onClick:Te},ne?f.a.createElement(p.a,null):f.a.createElement(u.a,null)),f.a.createElement("footer",{className:"footer"},f.a.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),f.a.createElement("div",{className:"flex-container"},f.a.createElement(Q.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),f.a.createElement(Q.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),f.a.createElement(Q.a,{className:"btn-green",type:"ghost",loading:A,onClick:Me},"\u8C03\u8BD5\u4EE3\u7801"),f.a.createElement(Q.a,{type:"primary",loading:P,disabled:P,onClick:function(){$({type:E.SET_VISIBLE,payload:!1}),H()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(nt,Le,F){nt.exports=F.p+"static/time.a3dc82f3.svg"},"SA+Z":function(nt,Le,F){var ue=F("wTVA"),Q=F("EbDI"),j=F("ZhPi"),S=F("wkBT");function D(x){return ue(x)||Q(x)||j(x)||S()}nt.exports=D,nt.exports.__esModule=!0,nt.exports.default=nt.exports},SJMd:function(nt,Le){/**
|
|
|
* @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 F,ue,Q,j=!1,S,D;window.PR_SHOULD_USE_CONTINUATION=!0;var x,T;(function(){var w=window,f=["break,continue,do,else,for,if,return,while"],p=[f,"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"],u=[p,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],o=[u,"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"],i=[u,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],l=[u,"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"],s="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",h=[u,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],r="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",t=[f,"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"],n=[f,"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"],c=[f,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],m=[o,l,i,h,r,t,n,c],v=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,b="str",E="kwd",g="com",y="typ",C="lit",d="pun",_="pln",O="tag",A="dec",P="src",I="atn",W="atv",K="nocode",te="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function H(le){for(var Oe=0,Ie=!1,qe=!1,ee=0,k=le.length;ee<k;++ee){var U=le[ee];if(U.ignoreCase)qe=!0;else if(/[a-z]/i.test(U.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ie=!0,qe=!1;break}}var q={b:8,t:9,n:10,v:11,f:12,r:13};function Y(He){var Be=He.charCodeAt(0);if(Be!==92)return Be;var Ze=He.charAt(1);return Be=q[Ze],Be||("0"<=Ze&&Ze<="7"?parseInt(He.substring(1),8):Ze==="u"||Ze==="x"?parseInt(He.substring(2),16):He.charCodeAt(1))}function J(He){if(He<32)return(He<16?"\\x0":"\\x")+He.toString(16);var Be=String.fromCharCode(He);return Be==="\\"||Be==="-"||Be==="]"||Be==="^"?"\\"+Be:Be}function be(He){var Be=He.substring(1,He.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")),Ze=[],ht=Be[0]==="^",Qe=["["];ht&&Qe.push("^");for(var Xe=ht?1:0,Ke=Be.length;Xe<Ke;++Xe){var Fe=Be[Xe];if(/\\[bdsw]/i.test(Fe))Qe.push(Fe);else{var Ue=Y(Fe),_e;Xe+2<Ke&&Be[Xe+1]==="-"?(_e=Y(Be[Xe+2]),Xe+=2):_e=Ue,Ze.push([Ue,_e]),_e<65||Ue>122||(_e<65||Ue>90||Ze.push([Math.max(65,Ue)|32,Math.min(_e,90)|32]),_e<97||Ue>122||Ze.push([Math.max(97,Ue)&~32,Math.min(_e,122)&~32]))}}Ze.sort(function(rt,tt){return rt[0]-tt[0]||tt[1]-rt[1]});for(var Ce=[],Ne=[],Xe=0;Xe<Ze.length;++Xe){var De=Ze[Xe];De[0]<=Ne[1]+1?Ne[1]=Math.max(Ne[1],De[1]):Ce.push(Ne=De)}for(var Xe=0;Xe<Ce.length;++Xe){var De=Ce[Xe];Qe.push(J(De[0])),De[1]>De[0]&&(De[1]+1>De[0]&&Qe.push("-"),Qe.push(J(De[1])))}return Qe.push("]"),Qe.join("")}function ke(He){for(var Be=He.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")),Ze=Be.length,ht=[],Qe=0,Xe=0;Qe<Ze;++Qe){var Ke=Be[Qe];if(Ke==="(")++Xe;else if(Ke.charAt(0)==="\\"){var Fe=+Ke.substring(1);Fe&&(Fe<=Xe?ht[Fe]=-1:Be[Qe]=J(Fe))}}for(var Qe=1;Qe<ht.length;++Qe)ht[Qe]===-1&&(ht[Qe]=++Oe);for(var Qe=0,Xe=0;Qe<Ze;++Qe){var Ke=Be[Qe];if(Ke==="(")++Xe,ht[Xe]||(Be[Qe]="(?:");else if(Ke.charAt(0)==="\\"){var Fe=+Ke.substring(1);Fe&&Fe<=Xe&&(Be[Qe]="\\"+ht[Fe])}}for(var Qe=0;Qe<Ze;++Qe)Be[Qe]==="^"&&Be[Qe+1]!=="^"&&(Be[Qe]="");if(He.ignoreCase&&Ie)for(var Qe=0;Qe<Ze;++Qe){var Ke=Be[Qe],Ue=Ke.charAt(0);Ke.length>=2&&Ue==="["?Be[Qe]=be(Ke):Ue!=="\\"&&(Be[Qe]=Ke.replace(/[a-zA-Z]/g,function(Ne){var De=Ne.charCodeAt(0);return"["+String.fromCharCode(De&~32,De|32)+"]"}))}return Be.join("")}for(var ct=[],ee=0,k=le.length;ee<k;++ee){var U=le[ee];if(U.global||U.multiline)throw new Error(""+U);ct.push("(?:"+ke(U)+")")}return new RegExp(ct.join("|"),qe?"gi":"g")}function G(le,Oe){var Ie=/(?:^|\s)nocode(?:\s|$)/,qe=[],ee=0,k=[],U=0;function q(Y){var J=Y.nodeType;if(J==1){if(Ie.test(Y.className))return;for(var be=Y.firstChild;be;be=be.nextSibling)q(be);var ke=Y.nodeName.toLowerCase();(ke==="br"||ke==="li")&&(qe[U]=`
|
|
|
`,k[U<<1]=ee++,k[U++<<1|1]=Y)}else if(J==3||J==4){var ct=Y.nodeValue;ct.length&&(Oe?ct=ct.replace(/\r\n?/g,`
|
|
|
`):ct=ct.replace(/[ \t\r\n]+/g," "),qe[U]=ct,k[U<<1]=ee,ee+=ct.length,k[U++<<1|1]=Y)}}return q(le),{sourceCode:qe.join("").replace(/\n$/,""),spans:k}}function V(le,Oe,Ie,qe,ee){if(!Ie)return;var k={sourceNode:le,pre:1,langExtension:null,numberLines:null,sourceCode:Ie,spans:null,basePos:Oe,decorations:null};qe(k),ee.push.apply(ee,k.decorations)}var re=/\S/;function $(le){for(var Oe=void 0,Ie=le.firstChild;Ie;Ie=Ie.nextSibling){var qe=Ie.nodeType;Oe=qe===1?Oe?le:Ie:qe===3&&re.test(Ie.nodeValue)?le:Oe}return Oe===le?void 0:Oe}function ne(le,Oe){var Ie={},qe;(function(){for(var U=le.concat(Oe),q=[],Y={},J=0,be=U.length;J<be;++J){var ke=U[J],ct=ke[3];if(ct)for(var He=ct.length;--He>=0;)Ie[ct.charAt(He)]=ke;var Be=ke[1],Ze=""+Be;Y.hasOwnProperty(Ze)||(q.push(Be),Y[Ze]=null)}q.push(/[\0-\uffff]/),qe=H(q)})();var ee=Oe.length,k=function(U){for(var q=U.sourceCode,Y=U.basePos,J=U.sourceNode,be=[Y,_],ke=0,ct=q.match(qe)||[],He={},Be=0,Ze=ct.length;Be<Ze;++Be){var ht=ct[Be],Qe=He[ht],Xe=void 0,Ke;if(typeof Qe=="string")Ke=!1;else{var Fe=Ie[ht.charAt(0)];if(Fe)Xe=ht.match(Fe[1]),Qe=Fe[0];else{for(var Ue=0;Ue<ee;++Ue)if(Fe=Oe[Ue],Xe=ht.match(Fe[1]),Xe){Qe=Fe[0];break}Xe||(Qe=_)}Ke=Qe.length>=5&&Qe.substring(0,5)==="lang-",Ke&&!(Xe&&typeof Xe[1]=="string")&&(Ke=!1,Qe=P),Ke||(He[ht]=Qe)}var _e=ke;if(ke+=ht.length,!Ke)be.push(Y+_e,Qe);else{var Ce=Xe[1],Ne=ht.indexOf(Ce),De=Ne+Ce.length;Xe[2]&&(De=ht.length-Xe[2].length,Ne=De-Ce.length);var rt=Qe.substring(5);V(J,Y+_e,ht.substring(0,Ne),k,be),V(J,Y+_e+Ne,Ce,xe(rt,Ce),be),V(J,Y+_e+De,ht.substring(De),k,be)}}U.decorations=be};return k}function he(le){var Oe=[],Ie=[];le.tripleQuotedStrings?Oe.push([b,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):le.multiLineStrings?Oe.push([b,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Oe.push([b,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),le.verbatimStrings&&Ie.push([b,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var qe=le.hashComments;qe&&(le.cStyleComments?(qe>1?Oe.push([g,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Oe.push([g,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ie.push([b,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Oe.push([g,/^#[^\r\n]*/,null,"#"])),le.cStyleComments&&(Ie.push([g,/^\/\/[^\r\n]*/,null]),Ie.push([g,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ee=le.regexLiterals;if(ee){var k=ee>1?"":`
|
|
|
\r`,U=k?".":"[\\S\\s]",q="/(?=[^/*"+k+"])(?:[^/\\x5B\\x5C"+k+"]|\\x5C"+U+"|\\x5B(?:[^\\x5C\\x5D"+k+"]|\\x5C"+U+")*(?:\\x5D|$))+/";Ie.push(["lang-regex",RegExp("^"+te+"("+q+")")])}var Y=le.types;Y&&Ie.push([y,Y]);var J=(""+le.keywords).replace(/^ | $/g,"");J.length&&Ie.push([E,new RegExp("^(?:"+J.replace(/[\s,]+/g,"|")+")\\b"),null]),Oe.push([_,/^\s+/,null,` \r
|
|
|
\xA0`]);var be="^.[^\\s\\w.$@'\"`/\\\\]*";return le.regexLiterals&&(be+="(?!s*/)"),Ie.push([C,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[_,/^[a-z_$][a-z_$@0-9]*/i,null],[C,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[_,/^\\[\s\S]?/,null],[d,new RegExp(be),null]),ne(Oe,Ie)}var pe=he({keywords:m,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(le,Oe,Ie){for(var qe=/(?:^|\s)nocode(?:\s|$)/,ee=/\r\n?|\n/,k=le.ownerDocument,U=k.createElement("li");le.firstChild;)U.appendChild(le.firstChild);var q=[U];function Y(Be){var Ze=Be.nodeType;if(Ze==1&&!qe.test(Be.className))if(Be.nodeName==="br")J(Be),Be.parentNode&&Be.parentNode.removeChild(Be);else for(var ht=Be.firstChild;ht;ht=ht.nextSibling)Y(ht);else if((Ze==3||Ze==4)&&Ie){var Qe=Be.nodeValue,Xe=Qe.match(ee);if(Xe){var Ke=Qe.substring(0,Xe.index);Be.nodeValue=Ke;var Fe=Qe.substring(Xe.index+Xe[0].length);if(Fe){var Ue=Be.parentNode;Ue.insertBefore(k.createTextNode(Fe),Be.nextSibling)}J(Be),Ke||Be.parentNode.removeChild(Be)}}}function J(Be){for(;!Be.nextSibling;)if(Be=Be.parentNode,!Be)return;function Ze(Xe,Ke){var Fe=Ke?Xe.cloneNode(!1):Xe,Ue=Xe.parentNode;if(Ue){var _e=Ze(Ue,1),Ce=Xe.nextSibling;_e.appendChild(Fe);for(var Ne=Ce;Ne;Ne=Ce)Ce=Ne.nextSibling,_e.appendChild(Ne)}return Fe}for(var ht=Ze(Be.nextSibling,0),Qe;(Qe=ht.parentNode)&&Qe.nodeType===1;)ht=Qe;q.push(ht)}for(var be=0;be<q.length;++be)Y(q[be]);Oe===(Oe|0)&&q[0].setAttribute("value",Oe);var ke=k.createElement("ol");ke.className="linenums";for(var ct=Math.max(0,Oe-1|0)||0,be=0,He=q.length;be<He;++be)U=q[be],U.className="L"+(be+ct)%10,U.firstChild||U.appendChild(k.createTextNode("\xA0")),ke.appendChild(U);le.appendChild(ke)}function we(le){var Oe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Oe=Oe&&+Oe[1]<=8;var Ie=/\n/g,qe=le.sourceCode,ee=qe.length,k=0,U=le.spans,q=U.length,Y=0,J=le.decorations,be=J.length,ke=0;J[be]=ee;var ct,He;for(He=ct=0;He<be;)J[He]!==J[He+2]?(J[ct++]=J[He++],J[ct++]=J[He++]):He+=2;for(be=ct,He=ct=0;He<be;){for(var Be=J[He],Ze=J[He+1],ht=He+2;ht+2<=be&&J[ht+1]===Ze;)ht+=2;J[ct++]=Be,J[ct++]=Ze,He=ht}be=J.length=ct;var Qe=le.sourceNode,Xe="";Qe&&(Xe=Qe.style.display,Qe.style.display="none");try{for(var Ke=null;Y<q;){var Fe=U[Y],Ue=U[Y+2]||ee,_e=J[ke+2]||ee,ht=Math.min(Ue,_e),Ce=U[Y+1],Ne;if(Ce.nodeType!==1&&(Ne=qe.substring(k,ht))){Oe&&(Ne=Ne.replace(Ie,"\r")),Ce.nodeValue=Ne;var De=Ce.ownerDocument,rt=De.createElement("span");rt.className=J[ke+1];var tt=Ce.parentNode;tt.replaceChild(rt,Ce),rt.appendChild(Ce),k<Ue&&(U[Y+1]=Ce=De.createTextNode(qe.substring(ht,Ue)),tt.insertBefore(Ce,rt.nextSibling))}k=ht,k>=Ue&&(Y+=2),k>=_e&&(ke+=2)}}finally{Qe&&(Qe.style.display=Xe)}}var Me={};function Ee(le,Oe){for(var Ie=Oe.length;--Ie>=0;){var qe=Oe[Ie];Me.hasOwnProperty(qe)?w.console&&console.warn("cannot override language handler %s",qe):Me[qe]=le}}function xe(le,Oe){return le&&Me.hasOwnProperty(le)||(le=/^\s*</.test(Oe)?"default-markup":"default-code"),Me[le]}Ee(pe,["default-code"]),Ee(ne([],[[_,/^[^<?]+/],[A,/^<!\w[^>]*(?:>|$)/],[g,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[d,/^(?:<[%?]|[%?]>)/],["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"]),Ee(ne([[_,/^[\s]+/,null,` \r
|
|
|
`],[W,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[O,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[I,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[d,/^[=<>\/]+/],["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"]),Ee(ne([],[[W,/^[\s\S]+/]]),["uq.val"]),Ee(he({keywords:o,hashComments:!0,cStyleComments:!0,types:v}),["c","cc","cpp","cxx","cyc","m"]),Ee(he({keywords:"null,true,false"}),["json"]),Ee(he({keywords:l,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),Ee(he({keywords:i,cStyleComments:!0}),["java"]),Ee(he({keywords:c,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Ee(he({keywords:t,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Ee(he({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Ee(he({keywords:n,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Ee(he({keywords:h,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Ee(he({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Ee(ne([],[[b,/^[\s\S]+/]]),["regex"]);function Ge(le){var Oe=le.langExtension;try{var Ie=G(le.sourceNode,le.pre),qe=Ie.sourceCode;le.sourceCode=qe,le.spans=Ie.spans,le.basePos=0,xe(Oe,qe)(le),we(le)}catch(ee){w.console&&console.log(ee&&ee.stack||ee)}}function je(le,Oe,Ie){var qe=Ie||!1,ee=Oe||null,k=document.createElement("div");k.innerHTML="<pre>"+le+"</pre>",k=k.firstChild,qe&&Te(k,qe,!0);var U={langExtension:ee,numberLines:qe,sourceNode:k,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ge(U),k.innerHTML}function We(le,Oe){var Ie=Oe||document.body,qe=Ie.ownerDocument||document;function ee(Fe){return Ie.getElementsByTagName(Fe)}for(var k=[ee("pre"),ee("code"),ee("xmp")],U=[],q=0;q<k.length;++q)for(var Y=0,J=k[q].length;Y<J;++Y)U.push(k[q][Y]);k=null;var be=Date;be.now||(be={now:function(){return+new Date}});var ke=0,ct=/\blang(?:uage)?-([\w.]+)(?!\S)/,He=/\bprettyprint\b/,Be=/\bprettyprinted\b/,Ze=/pre|xmp/i,ht=/^code$/i,Qe=/^(?:pre|code|xmp)$/i,Xe={};function Ke(){for(var Fe=w.PR_SHOULD_USE_CONTINUATION?be.now()+250:Infinity;ke<U.length&&be.now()<Fe;ke++){for(var Ue=U[ke],_e=Xe,Ce=Ue;Ce=Ce.previousSibling;){var Ne=Ce.nodeType,De=(Ne===7||Ne===8)&&Ce.nodeValue;if(De?!/^\??prettify\b/.test(De):Ne!==3||/\S/.test(Ce.nodeValue))break;if(De){_e={},De.replace(/\b(\w+)=([\w:.%+-]+)/g,function(yt,st,Nt){_e[st]=Nt});break}}var rt=Ue.className;if((_e!==Xe||He.test(rt))&&!Be.test(rt)){for(var tt=!1,xt=Ue.parentNode;xt;xt=xt.parentNode){var Mt=xt.tagName;if(Qe.test(Mt)&&xt.className&&He.test(xt.className)){tt=!0;break}}if(!tt){Ue.className+=" prettyprinted";var Bt=_e.lang;if(!Bt){Bt=rt.match(ct);var It;!Bt&&(It=$(Ue))&&ht.test(It.tagName)&&(Bt=It.className.match(ct)),Bt&&(Bt=Bt[1])}var Dt;if(Ze.test(Ue.tagName))Dt=1;else{var lt=Ue.currentStyle,pt=qe.defaultView,ut=lt?lt.whiteSpace:pt&&pt.getComputedStyle?pt.getComputedStyle(Ue,null).getPropertyValue("white-space"):0;Dt=ut&&ut.substring(0,3)==="pre"}var Pe=_e.linenums;(Pe=Pe==="true"||+Pe)||(Pe=rt.match(/\blinenums\b(?::(\d+))?/),Pe=Pe?Pe[1]&&Pe[1].length?+Pe[1]:!0:!1),Pe&&Te(Ue,Pe,Dt);var Ve={langExtension:Bt,sourceNode:Ue,numberLines:Pe,pre:Dt,sourceCode:null,basePos:null,spans:null,decorations:null};Ge(Ve)}}}ke<U.length?w.setTimeout(Ke,250):typeof le=="function"&&le()}Ke()}var ze=w.PR={createSimpleLexer:ne,registerLangHandler:Ee,sourceDecorator:he,PR_ATTRIB_NAME:I,PR_ATTRIB_VALUE:W,PR_COMMENT:g,PR_DECLARATION:A,PR_KEYWORD:E,PR_LITERAL:C,PR_NOCODE:K,PR_PLAIN:_,PR_PUNCTUATION:d,PR_SOURCE:P,PR_STRING:b,PR_TAG:O,PR_TYPE:y,prettyPrintOne:j?w.prettyPrintOne=je:x=je,prettyPrint:T=j?w.prettyPrint=We:T=We},de=w.define;typeof de=="function"&&de.amd&&de("google-code-prettify",[],function(){return ze})})()},T8No:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return S}),F.d(Le,"b",function(){return i}),F.d(Le,"d",function(){return l}),F.d(Le,"c",function(){return s}),F.d(Le,"e",function(){return h});var ue=F("N0LK"),Q=F("Cg/j"),j=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,m){c.__proto__=m}||function(c,m){for(var v in m)m.hasOwnProperty(v)&&(c[v]=m[v])},r(t,n)};return function(t,n){r(t,n);function c(){this.constructor=t}t.prototype=n===null?Object.create(n):(c.prototype=n.prototype,new c)}}(),S=function(){function r(){}return r.has=function(t){return x.create(t)},r.equals=function(t,n){return T.create(t,n)},r.regex=function(t,n){return p.create(t,n)},r.not=function(t){return f.create(t)},r.and=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return o.create(t)},r.or=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return i.create(t)},r.deserialize=function(t,n){return n===void 0&&(n=!1),t?this._deserializeOrExpression(t,n):void 0},r._deserializeOrExpression=function(t,n){var c=this,m=t.split("||");return i.create(m.map(function(v){return c._deserializeAndExpression(v,n)}))},r._deserializeAndExpression=function(t,n){var c=this,m=t.split("&&");return o.create(m.map(function(v){return c._deserializeOne(v,n)}))},r._deserializeOne=function(t,n){if(t=t.trim(),t.indexOf("!=")>=0){var c=t.split("!=");return w.create(c[0].trim(),this._deserializeValue(c[1],n))}if(t.indexOf("==")>=0){var c=t.split("==");return T.create(c[0].trim(),this._deserializeValue(c[1],n))}if(t.indexOf("=~")>=0){var c=t.split("=~");return p.create(c[0].trim(),this._deserializeRegexValue(c[1],n))}return/^\!\s*/.test(t)?f.create(t.substr(1).trim()):x.create(t)},r._deserializeValue=function(t,n){if(t=t.trim(),t==="true")return!0;if(t==="false")return!1;var c=/^'([^']*)'$/.exec(t);return c?c[1].trim():t},r._deserializeRegexValue=function(t,n){if(Object(ue.x)(t)){if(n)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var c=t.indexOf("/"),m=t.lastIndexOf("/");if(c===m||c<0){if(n)throw new Error("bad regexp-value '"+t+"', missing /-enclosure");return console.warn("bad regexp-value '"+t+"', missing /-enclosure"),null}var v=t.slice(c+1,m),b=t[m+1]==="i"?"i":"";try{return new RegExp(v,b)}catch(E){if(n)throw new Error("bad regexp-value '"+t+"', parse error: "+E);return console.warn("bad regexp-value '"+t+"', parse error: "+E),null}},r}();function D(r,t){var n=r.getType(),c=t.getType();if(n!==c)return n-c;switch(n){case 1:return r.cmp(t);case 2:return r.cmp(t);case 3:return r.cmp(t);case 4:return r.cmp(t);case 6:return r.cmp(t);case 7:return r.cmp(t);case 5:return r.cmp(t);default:throw new Error("Unknown ContextKeyExpr!")}}var x=function(){function r(t){this.key=t}return r.create=function(t){return new r(t)},r.prototype.getType=function(){return 1},r.prototype.cmp=function(t){return this.key<t.key?-1:this.key>t.key?1:0},r.prototype.equals=function(t){return t instanceof r?this.key===t.key:!1},r.prototype.evaluate=function(t){return!!t.getValue(this.key)},r.prototype.keys=function(){return[this.key]},r.prototype.negate=function(){return f.create(this.key)},r}(),T=function(){function r(t,n){this.key=t,this.value=n}return r.create=function(t,n){return typeof n=="boolean"?n?x.create(t):f.create(t):new r(t,n)},r.prototype.getType=function(){return 3},r.prototype.cmp=function(t){return this.key<t.key?-1:this.key>t.key?1:this.value<t.value?-1:this.value>t.value?1:0},r.prototype.equals=function(t){return t instanceof r?this.key===t.key&&this.value===t.value:!1},r.prototype.evaluate=function(t){return t.getValue(this.key)==this.value},r.prototype.keys=function(){return[this.key]},r.prototype.negate=function(){return w.create(this.key,this.value)},r}(),w=function(){function r(t,n){this.key=t,this.value=n}return r.create=function(t,n){return typeof n=="boolean"?n?f.create(t):x.create(t):new r(t,n)},r.prototype.getType=function(){return 4},r.prototype.cmp=function(t){return this.key<t.key?-1:this.key>t.key?1:this.value<t.value?-1:this.value>t.value?1:0},r.prototype.equals=function(t){return t instanceof r?this.key===t.key&&this.value===t.value:!1},r.prototype.evaluate=function(t){return t.getValue(this.key)!=this.value},r.prototype.keys=function(){return[this.key]},r.prototype.negate=function(){return T.create(this.key,this.value)},r}(),f=function(){function r(t){this.key=t}return r.create=function(t){return new r(t)},r.prototype.getType=function(){return 2},r.prototype.cmp=function(t){return this.key<t.key?-1:this.key>t.key?1:0},r.prototype.equals=function(t){return t instanceof r?this.key===t.key:!1},r.prototype.evaluate=function(t){return!t.getValue(this.key)},r.prototype.keys=function(){return[this.key]},r.prototype.negate=function(){return x.create(this.key)},r}(),p=function(){function r(t,n){this.key=t,this.regexp=n}return r.create=function(t,n){return new r(t,n)},r.prototype.getType=function(){return 6},r.prototype.cmp=function(t){if(this.key<t.key)return-1;if(this.key>t.key)return 1;var n=this.regexp?this.regexp.source:"",c=t.regexp?t.regexp.source:"";return n<c?-1:n>c?1:0},r.prototype.equals=function(t){if(t instanceof r){var n=this.regexp?this.regexp.source:"",c=t.regexp?t.regexp.source:"";return this.key===t.key&&n===c}return!1},r.prototype.evaluate=function(t){var n=t.getValue(this.key);return this.regexp?this.regexp.test(n):!1},r.prototype.keys=function(){return[this.key]},r.prototype.negate=function(){return u.create(this)},r}(),u=function(){function r(t){this._actual=t}return r.create=function(t){return new r(t)},r.prototype.getType=function(){return 7},r.prototype.cmp=function(t){return this._actual.cmp(t._actual)},r.prototype.equals=function(t){return t instanceof r?this._actual.equals(t._actual):!1},r.prototype.evaluate=function(t){return!this._actual.evaluate(t)},r.prototype.keys=function(){return this._actual.keys()},r.prototype.negate=function(){return this._actual},r}(),o=function(){function r(t){this.expr=t}return r.create=function(t){var n=r._normalizeArr(t);return n.length===0?void 0:n.length===1?n[0]:new r(n)},r.prototype.getType=function(){return 5},r.prototype.cmp=function(t){if(this.expr.length<t.expr.length)return-1;if(this.expr.length>t.expr.length)return 1;for(var n=0,c=this.expr.length;n<c;n++){var m=D(this.expr[n],t.expr[n]);if(m!==0)return m}return 0},r.prototype.equals=function(t){if(t instanceof r){if(this.expr.length!==t.expr.length)return!1;for(var n=0,c=this.expr.length;n<c;n++)if(!this.expr[n].equals(t.expr[n]))return!1;return!0}return!1},r.prototype.evaluate=function(t){for(var n=0,c=this.expr.length;n<c;n++)if(!this.expr[n].evaluate(t))return!1;return!0},r._normalizeArr=function(t){var n=[];if(t){for(var c=0,m=t.length;c<m;c++){var v=t[c];if(!v)continue;if(v instanceof r){n=n.concat(v.expr);continue}if(v instanceof i)throw new Error('It is not allowed to have an or expression here due to lack of parens! For example "a && (b||c)" is not supported, use "(a&&b) || (a&&c)" instead.');n.push(v)}n.sort(D)}return n},r.prototype.keys=function(){for(var t=[],n=0,c=this.expr;n<c.length;n++){var m=c[n];t.push.apply(t,m.keys())}return t},r.prototype.negate=function(){for(var t=[],n=0,c=this.expr;n<c.length;n++){var m=c[n];t.push(m.negate())}return i.create(t)},r}(),i=function(){function r(t){this.expr=t}return r.create=function(t){var n=r._normalizeArr(t);return n.length===0?void 0:n.length===1?n[0]:new r(n)},r.prototype.getType=function(){return 8},r.prototype.equals=function(t){if(t instanceof r){if(this.expr.length!==t.expr.length)return!1;for(var n=0,c=this.expr.length;n<c;n++)if(!this.expr[n].equals(t.expr[n]))return!1;return!0}return!1},r.prototype.evaluate=function(t){for(var n=0,c=this.expr.length;n<c;n++)if(this.expr[n].evaluate(t))return!0;return!1},r._normalizeArr=function(t){var n=[];if(t){for(var c=0,m=t.length;c<m;c++){var v=t[c];if(!v)continue;if(v instanceof r){n=n.concat(v.expr);continue}n.push(v)}n.sort(D)}return n},r.prototype.keys=function(){for(var t=[],n=0,c=this.expr;n<c.length;n++){var m=c[n];t.push.apply(t,m.keys())}return t},r.prototype.negate=function(){for(var t=[],n=0,c=this.expr;n<c.length;n++){var m=c[n];t.push(m.negate())}for(var v=function(P){return P instanceof r?P.expr:[P]};t.length>1;){for(var b=t.shift(),E=t.shift(),g=[],y=0,C=v(b);y<C.length;y++)for(var d=C[y],_=0,O=v(E);_<O.length;_++){var A=O[_];g.push(S.and(d,A))}t.unshift(S.or.apply(S,g))}return t[0]},r}(),l=function(r){j(t,r);function t(n,c){var m=r.call(this,n)||this;return m._defaultValue=c,m}return t.prototype.bindTo=function(n){return n.createKey(this.key,this._defaultValue)},t.prototype.getValue=function(n){return n.getContextKeyValue(this.key)},t.prototype.toNegated=function(){return S.not(this.key)},t}(x),s=Object(Q.c)("contextKeyService"),h="setContext"},TcMa:function(nt,Le,F){nt.exports={desc:"desc___qlRMF",info:"info___JEaKq","commit-info":"commit-info___3-4e0"}},VEzc:function(nt,Le,F){nt.exports={flex_box_center:"flex_box_center___z2AYj",flex_space_between:"flex_space_between___2PZH7",flex_box_vertical_center:"flex_box_vertical_center___3Vw8I",flex_box_center_end:"flex_box_center_end___1dJQf",flex_box_column:"flex_box_column___kstqC",wrap:"wrap___wWYG3",head:"head___1xABk",title:"title___yYb50",content:"content___fzoVv",list:"list___2q90P",footer:"footer___3zT-e"}},"VrN/":function(nt,Le,F){(function(ue,Q){nt.exports=Q()})(this,function(){"use strict";var ue=navigator.userAgent,Q=navigator.platform,j=/gecko\/\d/i.test(ue),S=/MSIE \d/.test(ue),D=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ue),x=/Edge\/(\d+)/.exec(ue),T=S||D||x,w=T&&(S?document.documentMode||6:+(x||D)[1]),f=!x&&/WebKit\//.test(ue),p=f&&/Qt\/\d+\.\d+/.test(ue),u=!x&&/Chrome\//.test(ue),o=/Opera\//.test(ue),i=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ue),s=/PhantomJS/.test(ue),h=!x&&/AppleWebKit/.test(ue)&&/Mobile\/\w+/.test(ue),r=/Android/.test(ue),t=h||r||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ue),n=h||/Mac/.test(Q),c=/\bCrOS\b/.test(ue),m=/win/i.test(Q),v=o&&ue.match(/Version\/(\d*\.\d*)/);v&&(v=Number(v[1])),v&&v>=15&&(o=!1,f=!0);var b=n&&(p||o&&(v==null||v<12.11)),E=j||T&&w>=9;function g(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var y=function(e,a){var R=e.className,L=g(a).exec(R);if(L){var M=R.slice(L.index+L[0].length);e.className=R.slice(0,L.index)+(M?L[1]+M:"")}};function C(e){for(var a=e.childNodes.length;a>0;--a)e.removeChild(e.firstChild);return e}function d(e,a){return C(e).appendChild(a)}function _(e,a,R,L){var M=document.createElement(e);if(R&&(M.className=R),L&&(M.style.cssText=L),typeof a=="string")M.appendChild(document.createTextNode(a));else if(a)for(var X=0;X<a.length;++X)M.appendChild(a[X]);return M}function O(e,a,R,L){var M=_(e,a,R,L);return M.setAttribute("role","presentation"),M}var A;document.createRange?A=function(e,a,R,L){var M=document.createRange();return M.setEnd(L||e,R),M.setStart(e,a),M}:A=function(e,a,R){var L=document.body.createTextRange();try{L.moveToElementText(e.parentNode)}catch(M){return L}return L.collapse(!0),L.moveEnd("character",R),L.moveStart("character",a),L};function P(e,a){if(a.nodeType==3&&(a=a.parentNode),e.contains)return e.contains(a);do if(a.nodeType==11&&(a=a.host),a==e)return!0;while(a=a.parentNode)}function I(){var e;try{e=document.activeElement}catch(a){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function W(e,a){var R=e.className;g(a).test(R)||(e.className+=(R?" ":"")+a)}function K(e,a){for(var R=e.split(" "),L=0;L<R.length;L++)R[L]&&!g(R[L]).test(a)&&(a+=" "+R[L]);return a}var te=function(e){e.select()};h?te=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:T&&(te=function(e){try{e.select()}catch(a){}});function H(e){var a=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,a)}}function G(e,a,R){a||(a={});for(var L in e)e.hasOwnProperty(L)&&(R!==!1||!a.hasOwnProperty(L))&&(a[L]=e[L]);return a}function V(e,a,R,L,M){a==null&&(a=e.search(/[^\s\u00a0]/),a==-1&&(a=e.length));for(var X=L||0,ce=M||0;;){var ve=e.indexOf(" ",X);if(ve<0||ve>=a)return ce+(a-X);ce+=ve-X,ce+=R-ce%R,X=ve+1}}var re=function(){this.id=null,this.f=null,this.time=0,this.handler=H(this.onTimeout,this)};re.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},re.prototype.set=function(e,a){this.f=a;var R=+new Date+e;(!this.id||R<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=R)};function $(e,a){for(var R=0;R<e.length;++R)if(e[R]==a)return R;return-1}var ne=50,he={toString:function(){return"CodeMirror.Pass"}},pe={scroll:!1},Te={origin:"*mouse"},we={origin:"+move"};function Me(e,a,R){for(var L=0,M=0;;){var X=e.indexOf(" ",L);X==-1&&(X=e.length);var ce=X-L;if(X==e.length||M+ce>=a)return L+Math.min(ce,a-M);if(M+=X-L,M+=R-M%R,L=X+1,M>=a)return L}}var Ee=[""];function xe(e){for(;Ee.length<=e;)Ee.push(Ge(Ee)+" ");return Ee[e]}function Ge(e){return e[e.length-1]}function je(e,a){for(var R=[],L=0;L<e.length;L++)R[L]=a(e[L],L);return R}function We(e,a,R){for(var L=0,M=R(a);L<e.length&&R(e[L])<=M;)L++;e.splice(L,0,a)}function ze(){}function de(e,a){var R;return Object.create?R=Object.create(e):(ze.prototype=e,R=new ze),a&&G(a,R),R}var le=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Oe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||le.test(e))}function Ie(e,a){return a?a.source.indexOf("\\w")>-1&&Oe(e)?!0:a.test(e):Oe(e)}function qe(e){for(var a in e)if(e.hasOwnProperty(a)&&e[a])return!1;return!0}var ee=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function k(e){return e.charCodeAt(0)>=768&&ee.test(e)}function U(e,a,R){for(;(R<0?a>0:a<e.length)&&k(e.charAt(a));)a+=R;return a}function q(e,a,R){for(var L=a>R?-1:1;;){if(a==R)return a;var M=(a+R)/2,X=L<0?Math.ceil(M):Math.floor(M);if(X==a)return e(X)?a:R;e(X)?R=X:a=X+L}}function Y(e,a,R,L){if(!e)return L(a,R,"ltr",0);for(var M=!1,X=0;X<e.length;++X){var ce=e[X];(ce.from<R&&ce.to>a||a==R&&ce.to==a)&&(L(Math.max(ce.from,a),Math.min(ce.to,R),ce.level==1?"rtl":"ltr",X),M=!0)}M||L(a,R,"ltr")}var J=null;function be(e,a,R){var L;J=null;for(var M=0;M<e.length;++M){var X=e[M];if(X.from<a&&X.to>a)return M;X.to==a&&(X.from!=X.to&&R=="before"?L=M:J=M),X.from==a&&(X.from!=X.to&&R!="before"?L=M:J=M)}return L!=null?L:J}var ke=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",a="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function R(Se){return Se<=247?e.charAt(Se):1424<=Se&&Se<=1524?"R":1536<=Se&&Se<=1785?a.charAt(Se-1536):1774<=Se&&Se<=2220?"r":8192<=Se&&Se<=8203?"w":Se==8204?"b":"L"}var L=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,M=/[stwN]/,X=/[LRr]/,ce=/[Lb1n]/,ve=/[1n]/;function ye(Se,Ye,et){this.level=Se,this.from=Ye,this.to=et}return function(Se,Ye){var et=Ye=="ltr"?"L":"R";if(Se.length==0||Ye=="ltr"&&!L.test(Se))return!1;for(var vt=Se.length,dt=[],Lt=0;Lt<vt;++Lt)dt.push(R(Se.charCodeAt(Lt)));for(var Ft=0,Gt=et;Ft<vt;++Ft){var en=dt[Ft];en=="m"?dt[Ft]=Gt:Gt=en}for(var on=0,tn=et;on<vt;++on){var ln=dt[on];ln=="1"&&tn=="r"?dt[on]="n":X.test(ln)&&(tn=ln,ln=="r"&&(dt[on]="R"))}for(var On=1,En=dt[0];On<vt-1;++On){var qn=dt[On];qn=="+"&&En=="1"&&dt[On+1]=="1"?dt[On]="1":qn==","&&En==dt[On+1]&&(En=="1"||En=="n")&&(dt[On]=En),En=qn}for(var Rr=0;Rr<vt;++Rr){var oi=dt[Rr];if(oi==",")dt[Rr]="N";else if(oi=="%"){var jr=void 0;for(jr=Rr+1;jr<vt&&dt[jr]=="%";++jr);for(var ki=Rr&&dt[Rr-1]=="!"||jr<vt&&dt[jr]=="1"?"1":"N",Ai=Rr;Ai<jr;++Ai)dt[Ai]=ki;Rr=jr-1}}for(var Qr=0,Oi=et;Qr<vt;++Qr){var hi=dt[Qr];Oi=="L"&&hi=="1"?dt[Qr]="L":X.test(hi)&&(Oi=hi)}for(var ti=0;ti<vt;++ti)if(M.test(dt[ti])){var qr=void 0;for(qr=ti+1;qr<vt&&M.test(dt[qr]);++qr);for(var Hr=(ti?dt[ti-1]:et)=="L",Li=(qr<vt?dt[qr]:et)=="L",ka=Hr==Li?Hr?"L":"R":et,pa=ti;pa<qr;++pa)dt[pa]=ka;ti=qr-1}for(var pi=[],ea,si=0;si<vt;)if(ce.test(dt[si])){var Fo=si;for(++si;si<vt&&ce.test(dt[si]);++si);pi.push(new ye(0,Fo,si))}else{var ia=si,_a=pi.length,xa=Ye=="rtl"?1:0;for(++si;si<vt&&dt[si]!="L";++si);for(var _i=ia;_i<si;)if(ve.test(dt[_i])){ia<_i&&(pi.splice(_a,0,new ye(1,ia,_i)),_a+=xa);var Ma=_i;for(++_i;_i<si&&ve.test(dt[_i]);++_i);pi.splice(_a,0,new ye(2,Ma,_i)),_a+=xa,ia=_i}else++_i;ia<si&&pi.splice(_a,0,new ye(1,ia,si))}return Ye=="ltr"&&(pi[0].level==1&&(ea=Se.match(/^\s+/))&&(pi[0].from=ea[0].length,pi.unshift(new ye(0,0,ea[0].length))),Ge(pi).level==1&&(ea=Se.match(/\s+$/))&&(Ge(pi).to-=ea[0].length,pi.push(new ye(0,vt-ea[0].length,vt)))),Ye=="rtl"?pi.reverse():pi}}();function ct(e,a){var R=e.order;return R==null&&(R=e.order=ke(e.text,a)),R}var He=[],Be=function(e,a,R){if(e.addEventListener)e.addEventListener(a,R,!1);else if(e.attachEvent)e.attachEvent("on"+a,R);else{var L=e._handlers||(e._handlers={});L[a]=(L[a]||He).concat(R)}};function Ze(e,a){return e._handlers&&e._handlers[a]||He}function ht(e,a,R){if(e.removeEventListener)e.removeEventListener(a,R,!1);else if(e.detachEvent)e.detachEvent("on"+a,R);else{var L=e._handlers,M=L&&L[a];if(M){var X=$(M,R);X>-1&&(L[a]=M.slice(0,X).concat(M.slice(X+1)))}}}function Qe(e,a){var R=Ze(e,a);if(!R.length)return;for(var L=Array.prototype.slice.call(arguments,2),M=0;M<R.length;++M)R[M].apply(null,L)}function Xe(e,a,R){return typeof a=="string"&&(a={type:a,preventDefault:function(){this.defaultPrevented=!0}}),Qe(e,R||a.type,e,a),Ne(a)||a.codemirrorIgnore}function Ke(e){var a=e._handlers&&e._handlers.cursorActivity;if(!a)return;for(var R=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),L=0;L<a.length;++L)$(R,a[L])==-1&&R.push(a[L])}function Fe(e,a){return Ze(e,a).length>0}function Ue(e){e.prototype.on=function(a,R){Be(this,a,R)},e.prototype.off=function(a,R){ht(this,a,R)}}function _e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ne(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function De(e){_e(e),Ce(e)}function rt(e){return e.target||e.srcElement}function tt(e){var a=e.which;return a==null&&(e.button&1?a=1:e.button&2?a=3:e.button&4&&(a=2)),n&&e.ctrlKey&&a==1&&(a=3),a}var xt=function(){if(T&&w<9)return!1;var e=_("div");return"draggable"in e||"dragDrop"in e}(),Mt;function Bt(e){if(Mt==null){var a=_("span","\u200B");d(e,_("span",[a,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Mt=a.offsetWidth<=1&&a.offsetHeight>2&&!(T&&w<8))}var R=Mt?_("span","\u200B"):_("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return R.setAttribute("cm-text",""),R}var It;function Dt(e){if(It!=null)return It;var a=d(e,document.createTextNode("A\u062EA")),R=A(a,0,1).getBoundingClientRect(),L=A(a,1,2).getBoundingClientRect();return C(e),!R||R.left==R.right?!1:It=L.right-R.right<3}var lt=`
|
|
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var a=0,R=[],L=e.length;a<=L;){var M=e.indexOf(`
|
|
|
`,a);M==-1&&(M=e.length);var X=e.slice(a,e.charAt(M-1)=="\r"?M-1:M),ce=X.indexOf("\r");ce!=-1?(R.push(X.slice(0,ce)),a+=ce+1):(R.push(X),a=M+1)}return R}:function(e){return e.split(/\r\n?|\n/)},pt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(a){return!1}}:function(e){var a;try{a=e.ownerDocument.selection.createRange()}catch(R){}return!a||a.parentElement()!=e?!1:a.compareEndPoints("StartToEnd",a)!=0},ut=function(){var e=_("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Pe=null;function Ve(e){if(Pe!=null)return Pe;var a=d(e,_("span","x")),R=a.getBoundingClientRect(),L=A(a,0,1).getBoundingClientRect();return Pe=Math.abs(R.left-L.left)>1}var yt={},st={};function Nt(e,a){arguments.length>2&&(a.dependencies=Array.prototype.slice.call(arguments,2)),yt[e]=a}function Ut(e,a){st[e]=a}function it(e){if(typeof e=="string"&&st.hasOwnProperty(e))e=st[e];else if(e&&typeof e.name=="string"&&st.hasOwnProperty(e.name)){var a=st[e.name];typeof a=="string"&&(a={name:a}),e=de(a,e),e.name=a.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return it("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return it("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function mt(e,a){a=it(a);var R=yt[a.name];if(!R)return mt(e,"text/plain");var L=R(e,a);if(bt.hasOwnProperty(a.name)){var M=bt[a.name];for(var X in M){if(!M.hasOwnProperty(X))continue;L.hasOwnProperty(X)&&(L["_"+X]=L[X]),L[X]=M[X]}}if(L.name=a.name,a.helperType&&(L.helperType=a.helperType),a.modeProps)for(var ce in a.modeProps)L[ce]=a.modeProps[ce];return L}var bt={};function At(e,a){var R=bt.hasOwnProperty(e)?bt[e]:bt[e]={};G(a,R)}function Xt(e,a){if(a===!0)return a;if(e.copyState)return e.copyState(a);var R={};for(var L in a){var M=a[L];M instanceof Array&&(M=M.concat([])),R[L]=M}return R}function Ae(e,a){for(var R;e.innerMode&&!(R=e.innerMode(a),!R||R.mode==e);)a=R.state,e=R.mode;return R||{mode:e,state:a}}function ge(e,a,R){return e.startState?e.startState(a,R):!0}var z=function(e,a,R){this.pos=this.start=0,this.string=e,this.tabSize=a||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=R};z.prototype.eol=function(){return this.pos>=this.string.length},z.prototype.sol=function(){return this.pos==this.lineStart},z.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},z.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},z.prototype.eat=function(e){var a=this.string.charAt(this.pos),R;if(typeof e=="string"?R=a==e:R=a&&(e.test?e.test(a):e(a)),R)return++this.pos,a},z.prototype.eatWhile=function(e){for(var a=this.pos;this.eat(e););return this.pos>a},z.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},z.prototype.skipToEnd=function(){this.pos=this.string.length},z.prototype.skipTo=function(e){var a=this.string.indexOf(e,this.pos);if(a>-1)return this.pos=a,!0},z.prototype.backUp=function(e){this.pos-=e},z.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=V(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},z.prototype.indentation=function(){return V(this.string,null,this.tabSize)-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},z.prototype.match=function(e,a,R){if(typeof e=="string"){var L=function(ce){return R?ce.toLowerCase():ce},M=this.string.substr(this.pos,e.length);if(L(M)==L(e))return a!==!1&&(this.pos+=e.length),!0}else{var X=this.string.slice(this.pos).match(e);return X&&X.index>0?null:(X&&a!==!1&&(this.pos+=X[0].length),X)}},z.prototype.current=function(){return this.string.slice(this.start,this.pos)},z.prototype.hideFirstChars=function(e,a){this.lineStart+=e;try{return a()}finally{this.lineStart-=e}},z.prototype.lookAhead=function(e){var a=this.lineOracle;return a&&a.lookAhead(e)},z.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Z(e,a){if(a-=e.first,a<0||a>=e.size)throw new Error("There is no line "+(a+e.first)+" in the document.");for(var R=e;!R.lines;)for(var L=0;;++L){var M=R.children[L],X=M.chunkSize();if(a<X){R=M;break}a-=X}return R.lines[a]}function oe(e,a,R){var L=[],M=a.line;return e.iter(a.line,R.line+1,function(X){var ce=X.text;M==R.line&&(ce=ce.slice(0,R.ch)),M==a.line&&(ce=ce.slice(a.ch)),L.push(ce),++M}),L}function me(e,a,R){var L=[];return e.iter(a,R,function(M){L.push(M.text)}),L}function Re(e,a){var R=a-e.height;if(R)for(var L=e;L;L=L.parent)L.height+=R}function Je(e){if(e.parent==null)return null;for(var a=e.parent,R=$(a.lines,e),L=a.parent;L;a=L,L=L.parent)for(var M=0;!(L.children[M]==a);++M)R+=L.children[M].chunkSize();return R+a.first}function at(e,a){var R=e.first;e:do{for(var L=0;L<e.children.length;++L){var M=e.children[L],X=M.height;if(a<X){e=M;continue e}a-=X,R+=M.chunkSize()}return R}while(!e.lines);for(var ce=0;ce<e.lines.length;++ce){var ve=e.lines[ce],ye=ve.height;if(a<ye)break;a-=ye}return R+ce}function kt(e,a){return a>=e.first&&a<e.first+e.size}function jt(e,a){return String(e.lineNumberFormatter(a+e.firstLineNumber))}function ot(e,a,R){if(R===void 0&&(R=null),!(this instanceof ot))return new ot(e,a,R);this.line=e,this.ch=a,this.sticky=R}function wt(e,a){return e.line-a.line||e.ch-a.ch}function Kt(e,a){return e.sticky==a.sticky&&wt(e,a)==0}function Et(e){return ot(e.line,e.ch)}function Qt(e,a){return wt(e,a)<0?a:e}function Vt(e,a){return wt(e,a)<0?e:a}function ie(e,a){return Math.max(e.first,Math.min(a,e.first+e.size-1))}function N(e,a){if(a.line<e.first)return ot(e.first,0);var R=e.first+e.size-1;return a.line>R?ot(R,Z(e,R).text.length):B(a,Z(e,a.line).text.length)}function B(e,a){var R=e.ch;return R==null||R>a?ot(e.line,a):R<0?ot(e.line,0):e}function ae(e,a){for(var R=[],L=0;L<a.length;L++)R[L]=N(e,a[L]);return R}var fe=function(e,a){this.state=e,this.lookAhead=a},se=function(e,a,R,L){this.state=a,this.doc=e,this.line=R,this.maxLookAhead=L||0,this.baseTokens=null,this.baseTokenPos=1};se.prototype.lookAhead=function(e){var a=this.doc.getLine(this.line+e);return a!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),a},se.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var a=this.baseTokens[this.baseTokenPos+1];return{type:a&&a.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},se.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},se.fromSaved=function(e,a,R){return a instanceof fe?new se(e,Xt(e.mode,a.state),R,a.lookAhead):new se(e,Xt(e.mode,a),R)},se.prototype.save=function(e){var a=e!==!1?Xt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new fe(a,this.maxLookAhead):a};function $e(e,a,R,L){var M=[e.state.modeGen],X={};Cr(e,a.text,e.doc.mode,R,function(Se,Ye){return M.push(Se,Ye)},X,L);for(var ce=R.state,ve=function(Se){R.baseTokens=M;var Ye=e.state.overlays[Se],et=1,vt=0;R.state=!0,Cr(e,a.text,Ye.mode,R,function(dt,Lt){for(var Ft=et;vt<dt;){var Gt=M[et];Gt>dt&&M.splice(et,1,dt,M[et+1],Gt),et+=2,vt=Math.min(dt,Gt)}if(!Lt)return;if(Ye.opaque)M.splice(Ft,et-Ft,dt,"overlay "+Lt),et=Ft+2;else for(;Ft<et;Ft+=2){var en=M[Ft+1];M[Ft+1]=(en?en+" ":"")+"overlay "+Lt}},X),R.state=ce,R.baseTokens=null,R.baseTokenPos=1},ye=0;ye<e.state.overlays.length;++ye)ve(ye);return{styles:M,classes:X.bgClass||X.textClass?X:null}}function St(e,a,R){if(!a.styles||a.styles[0]!=e.state.modeGen){var L=Pt(e,Je(a)),M=a.text.length>e.options.maxHighlightLength&&Xt(e.doc.mode,L.state),X=$e(e,a,L);M&&(L.state=M),a.stateAfter=L.save(!M),a.styles=X.styles,X.classes?a.styleClasses=X.classes:a.styleClasses&&(a.styleClasses=null),R===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return a.styles}function Pt(e,a,R){var L=e.doc,M=e.display;if(!L.mode.startState)return new se(L,!0,a);var X=Nn(e,a,R),ce=X>L.first&&Z(L,X-1).stateAfter,ve=ce?se.fromSaved(L,ce,X):new se(L,ge(L.mode),X);return L.iter(X,a,function(ye){$t(e,ye.text,ve);var Se=ve.line;ye.stateAfter=Se==a-1||Se%5==0||Se>=M.viewFrom&&Se<M.viewTo?ve.save():null,ve.nextLine()}),R&&(L.modeFrontier=ve.line),ve}function $t(e,a,R,L){var M=e.doc.mode,X=new z(a,e.options.tabSize,R);for(X.start=X.pos=L||0,a==""&&Ot(M,R.state);!X.eol();)zt(M,X,R.state),X.start=X.pos}function Ot(e,a){if(e.blankLine)return e.blankLine(a);if(!e.innerMode)return;var R=Ae(e,a);if(R.mode.blankLine)return R.mode.blankLine(R.state)}function zt(e,a,R,L){for(var M=0;M<10;M++){L&&(L[0]=Ae(e,R).mode);var X=e.token(a,R);if(a.pos>a.start)return X}throw new Error("Mode "+e.name+" failed to advance stream.")}var an=function(e,a,R){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=a||null,this.state=R};function jn(e,a,R,L){var M=e.doc,X=M.mode,ce;a=N(M,a);var ve=Z(M,a.line),ye=Pt(e,a.line,R),Se=new z(ve.text,e.options.tabSize,ye),Ye;for(L&&(Ye=[]);(L||Se.pos<a.ch)&&!Se.eol();)Se.start=Se.pos,ce=zt(X,Se,ye.state),L&&Ye.push(new an(Se,ce,Xt(M.mode,ye.state)));return L?Ye:new an(Se,ce,ye.state)}function Dr(e,a){if(e)for(;;){var R=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!R)break;e=e.slice(0,R.index)+e.slice(R.index+R[0].length);var L=R[1]?"bgClass":"textClass";a[L]==null?a[L]=R[2]:new RegExp("(?:^|\\s)"+R[2]+"(?:$|\\s)").test(a[L])||(a[L]+=" "+R[2])}return e}function Cr(e,a,R,L,M,X,ce){var ve=R.flattenSpans;ve==null&&(ve=e.options.flattenSpans);var ye=0,Se=null,Ye=new z(a,e.options.tabSize,L),et,vt=e.options.addModeClass&&[null];for(a==""&&Dr(Ot(R,L.state),X);!Ye.eol();){if(Ye.pos>e.options.maxHighlightLength?(ve=!1,ce&&$t(e,a,L,Ye.pos),Ye.pos=a.length,et=null):et=Dr(zt(R,Ye,L.state,vt),X),vt){var dt=vt[0].name;dt&&(et="m-"+(et?dt+" "+et:dt))}if(!ve||Se!=et){for(;ye<Ye.start;)ye=Math.min(Ye.start,ye+5e3),M(ye,Se);Se=et}Ye.start=Ye.pos}for(;ye<Ye.pos;){var Lt=Math.min(Ye.pos,ye+5e3);M(Lt,Se),ye=Lt}}function Nn(e,a,R){for(var L,M,X=e.doc,ce=R?-1:a-(e.doc.mode.innerMode?1e3:100),ve=a;ve>ce;--ve){if(ve<=X.first)return X.first;var ye=Z(X,ve-1),Se=ye.stateAfter;if(Se&&(!R||ve+(Se instanceof fe?Se.lookAhead:0)<=X.modeFrontier))return ve;var Ye=V(ye.text,null,e.options.tabSize);(M==null||L>Ye)&&(M=ve-1,L=Ye)}return M}function hr(e,a){if(e.modeFrontier=Math.min(e.modeFrontier,a),e.highlightFrontier<a-10)return;for(var R=e.first,L=a-1;L>R;L--){var M=Z(e,L).stateAfter;if(M&&(!(M instanceof fe)||L+M.lookAhead<a)){R=L+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,R)}var mi=!1,Or=!1;function yr(){mi=!0}function pr(){Or=!0}function Yr(e,a,R){this.marker=e,this.from=a,this.to=R}function Mr(e,a){if(e)for(var R=0;R<e.length;++R){var L=e[R];if(L.marker==a)return L}}function Zr(e,a){for(var R,L=0;L<e.length;++L)e[L]!=a&&(R||(R=[])).push(e[L]);return R}function wr(e,a){e.markedSpans=e.markedSpans?e.markedSpans.concat([a]):[a],a.marker.attachLine(e)}function vi(e,a,R){var L;if(e)for(var M=0;M<e.length;++M){var X=e[M],ce=X.marker,ve=X.from==null||(ce.inclusiveLeft?X.from<=a:X.from<a);if(ve||X.from==a&&ce.type=="bookmark"&&(!R||!X.marker.insertLeft)){var ye=X.to==null||(ce.inclusiveRight?X.to>=a:X.to>a);(L||(L=[])).push(new Yr(ce,X.from,ye?null:X.to))}}return L}function li(e,a,R){var L;if(e)for(var M=0;M<e.length;++M){var X=e[M],ce=X.marker,ve=X.to==null||(ce.inclusiveRight?X.to>=a:X.to>a);if(ve||X.from==a&&ce.type=="bookmark"&&(!R||X.marker.insertLeft)){var ye=X.from==null||(ce.inclusiveLeft?X.from<=a:X.from<a);(L||(L=[])).push(new Yr(ce,ye?null:X.from-a,X.to==null?null:X.to-a))}}return L}function Kr(e,a){if(a.full)return null;var R=kt(e,a.from.line)&&Z(e,a.from.line).markedSpans,L=kt(e,a.to.line)&&Z(e,a.to.line).markedSpans;if(!R&&!L)return null;var M=a.from.ch,X=a.to.ch,ce=wt(a.from,a.to)==0,ve=vi(R,M,ce),ye=li(L,X,ce),Se=a.text.length==1,Ye=Ge(a.text).length+(Se?M:0);if(ve)for(var et=0;et<ve.length;++et){var vt=ve[et];if(vt.to==null){var dt=Mr(ye,vt.marker);dt?Se&&(vt.to=dt.to==null?null:dt.to+Ye):vt.to=M}}if(ye)for(var Lt=0;Lt<ye.length;++Lt){var Ft=ye[Lt];if(Ft.to!=null&&(Ft.to+=Ye),Ft.from==null){var Gt=Mr(ve,Ft.marker);Gt||(Ft.from=Ye,Se&&(ve||(ve=[])).push(Ft))}else Ft.from+=Ye,Se&&(ve||(ve=[])).push(Ft)}ve&&(ve=zr(ve)),ye&&ye!=ve&&(ye=zr(ye));var en=[ve];if(!Se){var on=a.text.length-2,tn;if(on>0&&ve)for(var ln=0;ln<ve.length;++ln)ve[ln].to==null&&(tn||(tn=[])).push(new Yr(ve[ln].marker,null,null));for(var On=0;On<on;++On)en.push(tn);en.push(ye)}return en}function zr(e){for(var a=0;a<e.length;++a){var R=e[a];R.from!=null&&R.from==R.to&&R.marker.clearWhenEmpty!==!1&&e.splice(a--,1)}return e.length?e:null}function xi(e,a,R){var L=null;if(e.iter(a.line,R.line+1,function(dt){if(dt.markedSpans)for(var Lt=0;Lt<dt.markedSpans.length;++Lt){var Ft=dt.markedSpans[Lt].marker;Ft.readOnly&&(!L||$(L,Ft)==-1)&&(L||(L=[])).push(Ft)}}),!L)return null;for(var M=[{from:a,to:R}],X=0;X<L.length;++X)for(var ce=L[X],ve=ce.find(0),ye=0;ye<M.length;++ye){var Se=M[ye];if(wt(Se.to,ve.from)<0||wt(Se.from,ve.to)>0)continue;var Ye=[ye,1],et=wt(Se.from,ve.from),vt=wt(Se.to,ve.to);(et<0||!ce.inclusiveLeft&&!et)&&Ye.push({from:Se.from,to:ve.from}),(vt>0||!ce.inclusiveRight&&!vt)&&Ye.push({from:ve.to,to:Se.to}),M.splice.apply(M,Ye),ye+=Ye.length-3}return M}function gi(e){var a=e.markedSpans;if(!a)return;for(var R=0;R<a.length;++R)a[R].marker.detachLine(e);e.markedSpans=null}function Si(e,a){if(!a)return;for(var R=0;R<a.length;++R)a[R].marker.attachLine(e);e.markedSpans=a}function Fn(e){return e.inclusiveLeft?-1:0}function Sn(e){return e.inclusiveRight?1:0}function _r(e,a){var R=e.lines.length-a.lines.length;if(R!=0)return R;var L=e.find(),M=a.find(),X=wt(L.from,M.from)||Fn(e)-Fn(a);if(X)return-X;var ce=wt(L.to,M.to)||Sn(e)-Sn(a);return ce||a.id-e.id}function zn(e,a){var R=Or&&e.markedSpans,L;if(R)for(var M=void 0,X=0;X<R.length;++X)M=R[X],M.marker.collapsed&&(a?M.from:M.to)==null&&(!L||_r(L,M.marker)<0)&&(L=M.marker);return L}function Lr(e){return zn(e,!0)}function rr(e){return zn(e,!1)}function Ri(e,a){var R=Or&&e.markedSpans,L;if(R)for(var M=0;M<R.length;++M){var X=R[M];X.marker.collapsed&&(X.from==null||X.from<a)&&(X.to==null||X.to>a)&&(!L||_r(L,X.marker)<0)&&(L=X.marker)}return L}function Pr(e,a,R,L,M){var X=Z(e,a),ce=Or&&X.markedSpans;if(ce)for(var ve=0;ve<ce.length;++ve){var ye=ce[ve];if(!ye.marker.collapsed)continue;var Se=ye.marker.find(0),Ye=wt(Se.from,R)||Fn(ye.marker)-Fn(M),et=wt(Se.to,L)||Sn(ye.marker)-Sn(M);if(Ye>=0&&et<=0||Ye<=0&&et>=0)continue;if(Ye<=0&&(ye.marker.inclusiveRight&&M.inclusiveLeft?wt(Se.to,R)>=0:wt(Se.to,R)>0)||Ye>=0&&(ye.marker.inclusiveRight&&M.inclusiveLeft?wt(Se.from,L)<=0:wt(Se.from,L)<0))return!0}}function ni(e){for(var a;a=Lr(e);)e=a.find(-1,!0).line;return e}function ji(e){for(var a;a=rr(e);)e=a.find(1,!0).line;return e}function ui(e){for(var a,R;a=rr(e);)e=a.find(1,!0).line,(R||(R=[])).push(e);return R}function Di(e,a){var R=Z(e,a),L=ni(R);return R==L?a:Je(L)}function ta(e,a){if(a>e.lastLine())return a;var R=Z(e,a),L;if(!ci(e,R))return a;for(;L=rr(R);)R=L.find(1,!0).line;return Je(R)+1}function ci(e,a){var R=Or&&a.markedSpans;if(R)for(var L=void 0,M=0;M<R.length;++M){if(L=R[M],!L.marker.collapsed)continue;if(L.from==null)return!0;if(L.marker.widgetNode)continue;if(L.from==0&&L.marker.inclusiveLeft&&Fi(e,a,L))return!0}}function Fi(e,a,R){if(R.to==null){var L=R.marker.find(1,!0);return Fi(e,L.line,Mr(L.line.markedSpans,R.marker))}if(R.marker.inclusiveRight&&R.to==a.text.length)return!0;for(var M=void 0,X=0;X<a.markedSpans.length;++X)if(M=a.markedSpans[X],M.marker.collapsed&&!M.marker.widgetNode&&M.from==R.to&&(M.to==null||M.to!=R.from)&&(M.marker.inclusiveLeft||R.marker.inclusiveRight)&&Fi(e,a,M))return!0}function Ci(e){e=ni(e);for(var a=0,R=e.parent,L=0;L<R.lines.length;++L){var M=R.lines[L];if(M==e)break;a+=M.height}for(var X=R.parent;X;R=X,X=R.parent)for(var ce=0;ce<X.children.length;++ce){var ve=X.children[ce];if(ve==R)break;a+=ve.height}return a}function zi(e){if(e.height==0)return 0;for(var a=e.text.length,R,L=e;R=Lr(L);){var M=R.find(0,!0);L=M.from.line,a+=M.from.ch-M.to.ch}for(L=e;R=rr(L);){var X=R.find(0,!0);a-=L.text.length-X.from.ch,L=X.to.line,a+=L.text.length-X.to.ch}return a}function qi(e){var a=e.display,R=e.doc;a.maxLine=Z(R,R.first),a.maxLineLength=zi(a.maxLine),a.maxLineChanged=!0,R.iter(function(L){var M=zi(L);M>a.maxLineLength&&(a.maxLineLength=M,a.maxLine=L)})}var yi=function(e,a,R){this.text=e,Si(this,a),this.height=R?R(this):1};yi.prototype.lineNo=function(){return Je(this)},Ue(yi);function aa(e,a,R,L){e.text=a,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),gi(e),Si(e,R);var M=L?L(e):1;M!=e.height&&Re(e,M)}function ma(e){e.parent=null,gi(e)}var un={},Cn={};function pn(e,a){if(!e||/^\s*$/.test(e))return null;var R=a.addModeClass?Cn:un;return R[e]||(R[e]=e.replace(/\S+/g,"cm-$&"))}function Un(e,a){var R=O("span",null,null,f?"padding-right: .1px":null),L={pre:O("pre",[R],"CodeMirror-line"),content:R,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};a.measure={};for(var M=0;M<=(a.rest?a.rest.length:0);M++){var X=M?a.rest[M-1]:a.line,ce=void 0;L.pos=0,L.addToken=mr,Dt(e.display.measure)&&(ce=ct(X,e.doc.direction))&&(L.addToken=hn(L.addToken,ce)),L.map=[];var ve=a!=e.display.externalMeasured&&Je(X);Bn(X,L,St(e,X,ve)),X.styleClasses&&(X.styleClasses.bgClass&&(L.bgClass=K(X.styleClasses.bgClass,L.bgClass||"")),X.styleClasses.textClass&&(L.textClass=K(X.styleClasses.textClass,L.textClass||""))),L.map.length==0&&L.map.push(0,0,L.content.appendChild(Bt(e.display.measure))),M==0?(a.measure.map=L.map,a.measure.cache={}):((a.measure.maps||(a.measure.maps=[])).push(L.map),(a.measure.caches||(a.measure.caches=[])).push({}))}if(f){var ye=L.content.lastChild;(/\bcm-tab\b/.test(ye.className)||ye.querySelector&&ye.querySelector(".cm-tab"))&&(L.content.className="cm-tab-wrap-hack")}return Qe(e,"renderLine",e,a.line,L.pre),L.pre.className&&(L.textClass=K(L.pre.className,L.textClass||"")),L}function ur(e){var a=_("span","\u2022","cm-invalidchar");return a.title="\\u"+e.charCodeAt(0).toString(16),a.setAttribute("aria-label",a.title),a}function mr(e,a,R,L,M,X,ce){if(!a)return;var ve=e.splitSpaces?Zn(a,e.trailingSpace):a,ye=e.cm.state.specialChars,Se=!1,Ye;if(!ye.test(a))e.col+=a.length,Ye=document.createTextNode(ve),e.map.push(e.pos,e.pos+a.length,Ye),T&&w<9&&(Se=!0),e.pos+=a.length;else{Ye=document.createDocumentFragment();for(var et=0;;){ye.lastIndex=et;var vt=ye.exec(a),dt=vt?vt.index-et:a.length-et;if(dt){var Lt=document.createTextNode(ve.slice(et,et+dt));T&&w<9?Ye.appendChild(_("span",[Lt])):Ye.appendChild(Lt),e.map.push(e.pos,e.pos+dt,Lt),e.col+=dt,e.pos+=dt}if(!vt)break;et+=dt+1;var Ft=void 0;if(vt[0]==" "){var Gt=e.cm.options.tabSize,en=Gt-e.col%Gt;Ft=Ye.appendChild(_("span",xe(en),"cm-tab")),Ft.setAttribute("role","presentation"),Ft.setAttribute("cm-text"," "),e.col+=en}else vt[0]=="\r"||vt[0]==`
|
|
|
`?(Ft=Ye.appendChild(_("span",vt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ft.setAttribute("cm-text",vt[0]),e.col+=1):(Ft=e.cm.options.specialCharPlaceholder(vt[0]),Ft.setAttribute("cm-text",vt[0]),T&&w<9?Ye.appendChild(_("span",[Ft])):Ye.appendChild(Ft),e.col+=1);e.map.push(e.pos,e.pos+1,Ft),e.pos++}}if(e.trailingSpace=ve.charCodeAt(a.length-1)==32,R||L||M||Se||X||ce){var on=R||"";L&&(on+=L),M&&(on+=M);var tn=_("span",[Ye],on,X);if(ce)for(var ln in ce)ce.hasOwnProperty(ln)&&ln!="style"&&ln!="class"&&tn.setAttribute(ln,ce[ln]);return e.content.appendChild(tn)}e.content.appendChild(Ye)}function Zn(e,a){if(e.length>1&&!/ /.test(e))return e;for(var R=a,L="",M=0;M<e.length;M++){var X=e.charAt(M);X==" "&&R&&(M==e.length-1||e.charCodeAt(M+1)==32)&&(X="\xA0"),L+=X,R=X==" "}return L}function hn(e,a){return function(R,L,M,X,ce,ve,ye){M=M?M+" cm-force-border":"cm-force-border";for(var Se=R.pos,Ye=Se+L.length;;){for(var et=void 0,vt=0;vt<a.length&&!(et=a[vt],et.to>Se&&et.from<=Se);vt++);if(et.to>=Ye)return e(R,L,M,X,ce,ve,ye);e(R,L.slice(0,et.to-Se),M,X,null,ve,ye),X=null,L=L.slice(et.to-Se),Se=et.to}}}function Fr(e,a,R,L){var M=!L&&R.widgetNode;M&&e.map.push(e.pos,e.pos+a,M),!L&&e.cm.display.input.needsContentAttribute&&(M||(M=e.content.appendChild(document.createElement("span"))),M.setAttribute("cm-marker",R.id)),M&&(e.cm.display.input.setUneditable(M),e.content.appendChild(M)),e.pos+=a,e.trailingSpace=!1}function Bn(e,a,R){var L=e.markedSpans,M=e.text,X=0;if(!L){for(var ce=1;ce<R.length;ce+=2)a.addToken(a,M.slice(X,X=R[ce]),pn(R[ce+1],a.cm.options));return}for(var ve=M.length,ye=0,Se=1,Ye="",et,vt,dt=0,Lt,Ft,Gt,en,on;;){if(dt==ye){Lt=Ft=Gt=vt="",on=null,en=null,dt=Infinity;for(var tn=[],ln=void 0,On=0;On<L.length;++On){var En=L[On],qn=En.marker;if(qn.type=="bookmark"&&En.from==ye&&qn.widgetNode)tn.push(qn);else if(En.from<=ye&&(En.to==null||En.to>ye||qn.collapsed&&En.to==ye&&En.from==ye)){if(En.to!=null&&En.to!=ye&&dt>En.to&&(dt=En.to,Ft=""),qn.className&&(Lt+=" "+qn.className),qn.css&&(vt=(vt?vt+";":"")+qn.css),qn.startStyle&&En.from==ye&&(Gt+=" "+qn.startStyle),qn.endStyle&&En.to==dt&&(ln||(ln=[])).push(qn.endStyle,En.to),qn.title&&((on||(on={})).title=qn.title),qn.attributes)for(var Rr in qn.attributes)(on||(on={}))[Rr]=qn.attributes[Rr];qn.collapsed&&(!en||_r(en.marker,qn)<0)&&(en=En)}else En.from>ye&&dt>En.from&&(dt=En.from)}if(ln)for(var oi=0;oi<ln.length;oi+=2)ln[oi+1]==dt&&(Ft+=" "+ln[oi]);if(!en||en.from==ye)for(var jr=0;jr<tn.length;++jr)Fr(a,0,tn[jr]);if(en&&(en.from||0)==ye){if(Fr(a,(en.to==null?ve+1:en.to)-ye,en.marker,en.from==null),en.to==null)return;en.to==ye&&(en=!1)}}if(ye>=ve)break;for(var ki=Math.min(ve,dt);;){if(Ye){var Ai=ye+Ye.length;if(!en){var Qr=Ai>ki?Ye.slice(0,ki-ye):Ye;a.addToken(a,Qr,et?et+Lt:Lt,Gt,ye+Qr.length==dt?Ft:"",vt,on)}if(Ai>=ki){Ye=Ye.slice(ki-ye),ye=ki;break}ye=Ai,Gt=""}Ye=M.slice(X,X=R[Se++]),et=pn(R[Se++],a.cm.options)}}}function Bi(e,a,R){this.line=a,this.rest=ui(a),this.size=this.rest?Je(Ge(this.rest))-R+1:1,this.node=this.text=null,this.hidden=ci(e,a)}function cr(e,a,R){for(var L=[],M,X=a;X<R;X=M){var ce=new Bi(e.doc,Z(e.doc,X),X);M=X+ce.size,L.push(ce)}return L}var Br=null;function bi(e){Br?Br.ops.push(e):e.ownsGroup=Br={ops:[e],delayedCallbacks:[]}}function ft(e){var a=e.delayedCallbacks,R=0;do{for(;R<a.length;R++)a[R].call(null);for(var L=0;L<e.ops.length;L++){var M=e.ops[L];if(M.cursorActivityHandlers)for(;M.cursorActivityCalled<M.cursorActivityHandlers.length;)M.cursorActivityHandlers[M.cursorActivityCalled++].call(null,M.cm)}}while(R<a.length)}function gt(e,a){var R=e.ownsGroup;if(!R)return;try{ft(R)}finally{Br=null,a(R)}}var Rt=null;function Ht(e,a){var R=Ze(e,a);if(!R.length)return;var L=Array.prototype.slice.call(arguments,2),M;Br?M=Br.delayedCallbacks:Rt?M=Rt:(M=Rt=[],setTimeout(mn,0));for(var X=function(ve){M.push(function(){return R[ve].apply(null,L)})},ce=0;ce<R.length;++ce)X(ce)}function mn(){var e=Rt;Rt=null;for(var a=0;a<e.length;++a)e[a]()}function fn(e,a,R,L){for(var M=0;M<a.changes.length;M++){var X=a.changes[M];X=="text"?Tt(e,a):X=="gutter"?Wt(e,a,R,L):X=="class"?sn(e,a):X=="widget"&&dn(e,a,L)}a.changes=null}function Ct(e){return e.node==e.text&&(e.node=_("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),T&&w<8&&(e.node.style.zIndex=2)),e.node}function _t(e,a){var R=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;if(R&&(R+=" CodeMirror-linebackground"),a.background)R?a.background.className=R:(a.background.parentNode.removeChild(a.background),a.background=null);else if(R){var L=Ct(a);a.background=L.insertBefore(_("div",null,R),L.firstChild),e.display.input.setUneditable(a.background)}}function Zt(e,a){var R=e.display.externalMeasured;return R&&R.line==a.line?(e.display.externalMeasured=null,a.measure=R.measure,R.built):Un(e,a)}function Tt(e,a){var R=a.text.className,L=Zt(e,a);a.text==a.node&&(a.node=L.pre),a.text.parentNode.replaceChild(L.pre,a.text),a.text=L.pre,L.bgClass!=a.bgClass||L.textClass!=a.textClass?(a.bgClass=L.bgClass,a.textClass=L.textClass,sn(e,a)):R&&(a.text.className=R)}function sn(e,a){_t(e,a),a.line.wrapClass?Ct(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");var R=a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass;a.text.className=R||""}function Wt(e,a,R,L){if(a.gutter&&(a.node.removeChild(a.gutter),a.gutter=null),a.gutterBackground&&(a.node.removeChild(a.gutterBackground),a.gutterBackground=null),a.line.gutterClass){var M=Ct(a);a.gutterBackground=_("div",null,"CodeMirror-gutter-background "+a.line.gutterClass,"left: "+(e.options.fixedGutter?L.fixedPos:-L.gutterTotalWidth)+"px; width: "+L.gutterTotalWidth+"px"),e.display.input.setUneditable(a.gutterBackground),M.insertBefore(a.gutterBackground,a.text)}var X=a.line.gutterMarkers;if(e.options.lineNumbers||X){var ce=Ct(a),ve=a.gutter=_("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?L.fixedPos:-L.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ve),ce.insertBefore(ve,a.text),a.line.gutterClass&&(ve.className+=" "+a.line.gutterClass),e.options.lineNumbers&&(!X||!X["CodeMirror-linenumbers"])&&(a.lineNumber=ve.appendChild(_("div",jt(e.options,R),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+L.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),X)for(var ye=0;ye<e.display.gutterSpecs.length;++ye){var Se=e.display.gutterSpecs[ye].className,Ye=X.hasOwnProperty(Se)&&X[Se];Ye&&ve.appendChild(_("div",[Ye],"CodeMirror-gutter-elt","left: "+L.gutterLeft[Se]+"px; width: "+L.gutterWidth[Se]+"px"))}}}function dn(e,a,R){a.alignable&&(a.alignable=null);for(var L=g("CodeMirror-linewidget"),M=a.node.firstChild,X=void 0;M;M=X)X=M.nextSibling,L.test(M.className)&&a.node.removeChild(M);Dn(e,a,R)}function $n(e,a,R,L){var M=Zt(e,a);return a.text=a.node=M.pre,M.bgClass&&(a.bgClass=M.bgClass),M.textClass&&(a.textClass=M.textClass),sn(e,a),Wt(e,a,R,L),Dn(e,a,L),a.node}function Dn(e,a,R){if(_n(e,a.line,a,R,!0),a.rest)for(var L=0;L<a.rest.length;L++)_n(e,a.rest[L],a,R,!1)}function _n(e,a,R,L,M){if(!a.widgets)return;for(var X=Ct(R),ce=0,ve=a.widgets;ce<ve.length;++ce){var ye=ve[ce],Se=_("div",[ye.node],"CodeMirror-linewidget"+(ye.className?" "+ye.className:""));ye.handleMouseEvents||Se.setAttribute("cm-ignore-events","true"),er(ye,Se,R,L),e.display.input.setUneditable(Se),M&&ye.above?X.insertBefore(Se,R.gutter||R.text):X.appendChild(Se),Ht(ye,"redraw")}}function er(e,a,R,L){if(e.noHScroll){(R.alignable||(R.alignable=[])).push(a);var M=L.wrapperWidth;a.style.left=L.fixedPos+"px",e.coverGutter||(M-=L.gutterTotalWidth,a.style.paddingLeft=L.gutterTotalWidth+"px"),a.style.width=M+"px"}e.coverGutter&&(a.style.zIndex=5,a.style.position="relative",e.noHScroll||(a.style.marginLeft=-L.gutterTotalWidth+"px"))}function Rn(e){if(e.height!=null)return e.height;var a=e.doc.cm;if(!a)return 0;if(!P(document.body,e.node)){var R="position: relative;";e.coverGutter&&(R+="margin-left: -"+a.display.gutters.offsetWidth+"px;"),e.noHScroll&&(R+="width: "+a.display.wrapper.clientWidth+"px;"),d(a.display.measure,_("div",[e.node],null,R))}return e.height=e.node.parentNode.offsetHeight}function Pn(e,a){for(var R=rt(a);R!=e.wrapper;R=R.parentNode)if(!R||R.nodeType==1&&R.getAttribute("cm-ignore-events")=="true"||R.parentNode==e.sizer&&R!=e.mover)return!0}function Gn(e){return e.lineSpace.offsetTop}function Tr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ir(e){if(e.cachedPaddingH)return e.cachedPaddingH;var a=d(e.measure,_("pre","x","CodeMirror-line-like")),R=window.getComputedStyle?window.getComputedStyle(a):a.currentStyle,L={left:parseInt(R.paddingLeft),right:parseInt(R.paddingRight)};return!isNaN(L.left)&&!isNaN(L.right)&&(e.cachedPaddingH=L),L}function dr(e){return ne-e.display.nativeBarWidth}function vr(e){return e.display.scroller.clientWidth-dr(e)-e.display.barWidth}function xr(e){return e.display.scroller.clientHeight-dr(e)-e.display.barHeight}function ar(e,a,R){var L=e.options.lineWrapping,M=L&&vr(e);if(!a.measure.heights||L&&a.measure.width!=M){var X=a.measure.heights=[];if(L){a.measure.width=M;for(var ce=a.text.firstChild.getClientRects(),ve=0;ve<ce.length-1;ve++){var ye=ce[ve],Se=ce[ve+1];Math.abs(ye.bottom-Se.bottom)>2&&X.push((ye.bottom+Se.top)/2-R.top)}}X.push(R.bottom-R.top)}}function fr(e,a,R){if(e.line==a)return{map:e.measure.map,cache:e.measure.cache};for(var L=0;L<e.rest.length;L++)if(e.rest[L]==a)return{map:e.measure.maps[L],cache:e.measure.caches[L]};for(var M=0;M<e.rest.length;M++)if(Je(e.rest[M])>R)return{map:e.measure.maps[M],cache:e.measure.caches[M],before:!0}}function Wn(e,a){a=ni(a);var R=Je(a),L=e.display.externalMeasured=new Bi(e.doc,a,R);L.lineN=R;var M=L.built=Un(e,L);return L.text=M.pre,d(e.display.lineMeasure,M.pre),L}function Jt(e,a,R,L){return or(e,tr(e,a),R,L)}function gn(e,a){if(a>=e.display.viewFrom&&a<e.display.viewTo)return e.display.view[ri(e,a)];var R=e.display.externalMeasured;if(R&&a>=R.lineN&&a<R.lineN+R.size)return R}function tr(e,a){var R=Je(a),L=gn(e,R);L&&!L.text?L=null:L&&L.changes&&(fn(e,L,R,An(e)),e.curOp.forceUpdate=!0),L||(L=Wn(e,a));var M=fr(L,a,R);return{line:a,view:L,rect:null,map:M.map,cache:M.cache,before:M.before,hasHeights:!1}}function or(e,a,R,L,M){a.before&&(R=-1);var X=R+(L||""),ce;return a.cache.hasOwnProperty(X)?ce=a.cache[X]:(a.rect||(a.rect=a.view.text.getBoundingClientRect()),a.hasHeights||(ar(e,a.view,a.rect),a.hasHeights=!0),ce=yn(e,a,R,L),ce.bogus||(a.cache[X]=ce)),{left:ce.left,right:ce.right,top:M?ce.rtop:ce.top,bottom:M?ce.rbottom:ce.bottom}}var gr={left:0,right:0,top:0,bottom:0};function Jn(e,a,R){for(var L,M,X,ce,ve,ye,Se=0;Se<e.length;Se+=3)if(ve=e[Se],ye=e[Se+1],a<ve?(M=0,X=1,ce="left"):a<ye?(M=a-ve,X=M+1):(Se==e.length-3||a==ye&&e[Se+3]>a)&&(X=ye-ve,M=X-1,a>=ye&&(ce="right")),M!=null){if(L=e[Se+2],ve==ye&&R==(L.insertLeft?"left":"right")&&(ce=R),R=="left"&&M==0)for(;Se&&e[Se-2]==e[Se-3]&&e[Se-1].insertLeft;)L=e[(Se-=3)+2],ce="left";if(R=="right"&&M==ye-ve)for(;Se<e.length-3&&e[Se+3]==e[Se+4]&&!e[Se+5].insertLeft;)L=e[(Se+=3)+2],ce="right";break}return{node:L,start:M,end:X,collapse:ce,coverStart:ve,coverEnd:ye}}function Qn(e,a){var R=gr;if(a=="left")for(var L=0;L<e.length&&!((R=e[L]).left!=R.right);L++);else for(var M=e.length-1;M>=0&&!((R=e[M]).left!=R.right);M--);return R}function yn(e,a,R,L){var M=Jn(a.map,R,L),X=M.node,ce=M.start,ve=M.end,ye=M.collapse,Se;if(X.nodeType==3){for(var Ye=0;Ye<4;Ye++){for(;ce&&k(a.line.text.charAt(M.coverStart+ce));)--ce;for(;M.coverStart+ve<M.coverEnd&&k(a.line.text.charAt(M.coverStart+ve));)++ve;if(T&&w<9&&ce==0&&ve==M.coverEnd-M.coverStart?Se=X.parentNode.getBoundingClientRect():Se=Qn(A(X,ce,ve).getClientRects(),L),Se.left||Se.right||ce==0)break;ve=ce,ce=ce-1,ye="right"}T&&w<11&&(Se=Ln(e.display.measure,Se))}else{ce>0&&(ye=L="right");var et;e.options.lineWrapping&&(et=X.getClientRects()).length>1?Se=et[L=="right"?et.length-1:0]:Se=X.getBoundingClientRect()}if(T&&w<9&&!ce&&(!Se||!Se.left&&!Se.right)){var vt=X.parentNode.getClientRects()[0];vt?Se={left:vt.left,right:vt.left+Xn(e.display),top:vt.top,bottom:vt.bottom}:Se=gr}for(var dt=Se.top-a.rect.top,Lt=Se.bottom-a.rect.top,Ft=(dt+Lt)/2,Gt=a.view.measure.heights,en=0;en<Gt.length-1&&!(Ft<Gt[en]);en++);var on=en?Gt[en-1]:0,tn=Gt[en],ln={left:(ye=="right"?Se.right:Se.left)-a.rect.left,right:(ye=="left"?Se.left:Se.right)-a.rect.left,top:on,bottom:tn};return!Se.left&&!Se.right&&(ln.bogus=!0),e.options.singleCursorHeightPerLine||(ln.rtop=dt,ln.rbottom=Lt),ln}function Ln(e,a){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ve(e))return a;var R=screen.logicalXDPI/screen.deviceXDPI,L=screen.logicalYDPI/screen.deviceYDPI;return{left:a.left*R,right:a.right*R,top:a.top*L,bottom:a.bottom*L}}function Yt(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var a=0;a<e.rest.length;a++)e.measure.caches[a]={}}function qt(e){e.display.externalMeasure=null,C(e.display.lineMeasure);for(var a=0;a<e.display.view.length;a++)Yt(e.display.view[a])}function nn(e){qt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function xn(){return u&&r?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function cn(){return u&&r?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Hn(e){var a=0;if(e.widgets)for(var R=0;R<e.widgets.length;++R)e.widgets[R].above&&(a+=Rn(e.widgets[R]));return a}function bn(e,a,R,L,M){if(!M){var X=Hn(a);R.top+=X,R.bottom+=X}if(L=="line")return R;L||(L="local");var ce=Ci(a);if(L=="local"?ce+=Gn(e.display):ce-=e.display.viewOffset,L=="page"||L=="window"){var ve=e.display.lineSpace.getBoundingClientRect();ce+=ve.top+(L=="window"?0:cn());var ye=ve.left+(L=="window"?0:xn());R.left+=ye,R.right+=ye}return R.top+=ce,R.bottom+=ce,R}function Mn(e,a,R){if(R=="div")return a;var L=a.left,M=a.top;if(R=="page")L-=xn(),M-=cn();else if(R=="local"||!R){var X=e.display.sizer.getBoundingClientRect();L+=X.left,M+=X.top}var ce=e.display.lineSpace.getBoundingClientRect();return{left:L-ce.left,top:M-ce.top}}function Tn(e,a,R,L,M){return L||(L=Z(e.doc,a.line)),bn(e,L,Jt(e,L,a.ch,M),R)}function Vn(e,a,R,L,M,X){L=L||Z(e.doc,a.line),M||(M=tr(e,L));function ce(Lt,Ft){var Gt=or(e,M,Lt,Ft?"right":"left",X);return Ft?Gt.left=Gt.right:Gt.right=Gt.left,bn(e,L,Gt,R)}var ve=ct(L,e.doc.direction),ye=a.ch,Se=a.sticky;if(ye>=L.text.length?(ye=L.text.length,Se="before"):ye<=0&&(ye=0,Se="after"),!ve)return ce(Se=="before"?ye-1:ye,Se=="before");function Ye(Lt,Ft,Gt){var en=ve[Ft],on=en.level==1;return ce(Gt?Lt-1:Lt,on!=Gt)}var et=be(ve,ye,Se),vt=J,dt=Ye(ye,et,Se=="before");return vt!=null&&(dt.other=Ye(ye,vt,Se!="before")),dt}function sr(e,a){var R=0;a=N(e.doc,a),e.options.lineWrapping||(R=Xn(e.display)*a.ch);var L=Z(e.doc,a.line),M=Ci(L)+Gn(e.display);return{left:R,right:R,top:M,bottom:M+L.height}}function br(e,a,R,L,M){var X=ot(e,a,R);return X.xRel=M,L&&(X.outside=L),X}function kr(e,a,R){var L=e.doc;if(R+=e.display.viewOffset,R<0)return br(L.first,0,null,-1,-1);var M=at(L,R),X=L.first+L.size-1;if(M>X)return br(L.first+L.size-1,Z(L,X).text.length,null,1,1);a<0&&(a=0);for(var ce=Z(L,M);;){var ve=Wi(e,ce,M,a,R),ye=Ri(ce,ve.ch+(ve.xRel>0||ve.outside>0?1:0));if(!ye)return ve;var Se=ye.find(1);if(Se.line==M)return Se;ce=Z(L,M=Se.line)}}function ei(e,a,R,L){L-=Hn(a);var M=a.text.length,X=q(function(ce){return or(e,R,ce-1).bottom<=L},M,0);return M=q(function(ce){return or(e,R,ce).top>L},X,M),{begin:X,end:M}}function Mi(e,a,R,L){R||(R=tr(e,a));var M=bn(e,a,or(e,R,L),"line").top;return ei(e,a,R,M)}function $r(e,a,R,L){return e.bottom<=R?!1:e.top>R?!0:(L?e.left:e.right)>a}function Wi(e,a,R,L,M){M-=Ci(a);var X=tr(e,a),ce=Hn(a),ve=0,ye=a.text.length,Se=!0,Ye=ct(a,e.doc.direction);if(Ye){var et=(e.options.lineWrapping?Gi:na)(e,a,R,X,Ye,L,M);Se=et.level!=1,ve=Se?et.from:et.to-1,ye=Se?et.to:et.from-1}var vt=null,dt=null,Lt=q(function(On){var En=or(e,X,On);return En.top+=ce,En.bottom+=ce,$r(En,L,M,!1)?(En.top<=M&&En.left<=L&&(vt=On,dt=En),!0):!1},ve,ye),Ft,Gt,en=!1;if(dt){var on=L-dt.left<dt.right-L,tn=on==Se;Lt=vt+(tn?0:1),Gt=tn?"after":"before",Ft=on?dt.left:dt.right}else{!Se&&(Lt==ye||Lt==ve)&&Lt++,Gt=Lt==0?"after":Lt==a.text.length?"before":or(e,X,Lt-(Se?1:0)).bottom+ce<=M==Se?"after":"before";var ln=Vn(e,ot(R,Lt,Gt),"line",a,X);Ft=ln.left,en=M<ln.top?-1:M>=ln.bottom?1:0}return Lt=U(a.text,Lt,1),br(R,Lt,Gt,en,L-Ft)}function na(e,a,R,L,M,X,ce){var ve=q(function(et){var vt=M[et],dt=vt.level!=1;return $r(Vn(e,ot(R,dt?vt.to:vt.from,dt?"before":"after"),"line",a,L),X,ce,!0)},0,M.length-1),ye=M[ve];if(ve>0){var Se=ye.level!=1,Ye=Vn(e,ot(R,Se?ye.from:ye.to,Se?"after":"before"),"line",a,L);$r(Ye,X,ce,!0)&&Ye.top>ce&&(ye=M[ve-1])}return ye}function Gi(e,a,R,L,M,X,ce){var ve=ei(e,a,L,ce),ye=ve.begin,Se=ve.end;/\s/.test(a.text.charAt(Se-1))&&Se--;for(var Ye=null,et=null,vt=0;vt<M.length;vt++){var dt=M[vt];if(dt.from>=Se||dt.to<=ye)continue;var Lt=dt.level!=1,Ft=or(e,L,Lt?Math.min(Se,dt.to)-1:Math.max(ye,dt.from)).right,Gt=Ft<X?X-Ft+1e9:Ft-X;(!Ye||et>Gt)&&(Ye=dt,et=Gt)}return Ye||(Ye=M[M.length-1]),Ye.from<ye&&(Ye={from:ye,to:Ye.to,level:Ye.level}),Ye.to>Se&&(Ye={from:Ye.from,to:Se,level:Ye.level}),Ye}var di;function Vi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(di==null){di=_("pre",null,"CodeMirror-line-like");for(var a=0;a<49;++a)di.appendChild(document.createTextNode("x")),di.appendChild(_("br"));di.appendChild(document.createTextNode("x"))}d(e.measure,di);var R=di.offsetHeight/50;return R>3&&(e.cachedTextHeight=R),C(e.measure),R||1}function Xn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var a=_("span","xxxxxxxxxx"),R=_("pre",[a],"CodeMirror-line-like");d(e.measure,R);var L=a.getBoundingClientRect(),M=(L.right-L.left)/10;return M>2&&(e.cachedCharWidth=M),M||10}function An(e){for(var a=e.display,R={},L={},M=a.gutters.clientLeft,X=a.gutters.firstChild,ce=0;X;X=X.nextSibling,++ce){var ve=e.display.gutterSpecs[ce].className;R[ve]=X.offsetLeft+X.clientLeft+M,L[ve]=X.clientWidth}return{fixedPos:nr(a),gutterTotalWidth:a.gutters.offsetWidth,gutterLeft:R,gutterWidth:L,wrapperWidth:a.wrapper.clientWidth}}function nr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function lr(e){var a=Vi(e.display),R=e.options.lineWrapping,L=R&&Math.max(5,e.display.scroller.clientWidth/Xn(e.display)-3);return function(M){if(ci(e.doc,M))return 0;var X=0;if(M.widgets)for(var ce=0;ce<M.widgets.length;ce++)M.widgets[ce].height&&(X+=M.widgets[ce].height);return R?X+(Math.ceil(M.text.length/L)||1)*a:X+a}}function Wr(e){var a=e.doc,R=lr(e);a.iter(function(L){var M=R(L);M!=L.height&&Re(L,M)})}function In(e,a,R,L){var M=e.display;if(!R&&rt(a).getAttribute("cm-not-content")=="true")return null;var X,ce,ve=M.lineSpace.getBoundingClientRect();try{X=a.clientX-ve.left,ce=a.clientY-ve.top}catch(et){return null}var ye=kr(e,X,ce),Se;if(L&&ye.xRel>0&&(Se=Z(e.doc,ye.line).text).length==ye.ch){var Ye=V(Se,Se.length,e.options.tabSize)-Se.length;ye=ot(ye.line,Math.max(0,Math.round((X-ir(e.display).left)/Xn(e.display))-Ye))}return ye}function ri(e,a){if(a>=e.display.viewTo)return null;if(a-=e.display.viewFrom,a<0)return null;for(var R=e.display.view,L=0;L<R.length;L++)if(a-=R[L].size,a<0)return L}function Ur(e,a,R,L){a==null&&(a=e.doc.first),R==null&&(R=e.doc.first+e.doc.size),L||(L=0);var M=e.display;if(L&&R<M.viewTo&&(M.updateLineNumbers==null||M.updateLineNumbers>a)&&(M.updateLineNumbers=a),e.curOp.viewChanged=!0,a>=M.viewTo)Or&&Di(e.doc,a)<M.viewTo&&wi(e);else if(R<=M.viewFrom)Or&&ta(e.doc,R+L)>M.viewFrom?wi(e):(M.viewFrom+=L,M.viewTo+=L);else if(a<=M.viewFrom&&R>=M.viewTo)wi(e);else if(a<=M.viewFrom){var X=Ii(e,R,R+L,1);X?(M.view=M.view.slice(X.index),M.viewFrom=X.lineN,M.viewTo+=L):wi(e)}else if(R>=M.viewTo){var ce=Ii(e,a,a,-1);ce?(M.view=M.view.slice(0,ce.index),M.viewTo=ce.lineN):wi(e)}else{var ve=Ii(e,a,a,-1),ye=Ii(e,R,R+L,1);ve&&ye?(M.view=M.view.slice(0,ve.index).concat(cr(e,ve.lineN,ye.lineN)).concat(M.view.slice(ye.index)),M.viewTo+=L):wi(e)}var Se=M.externalMeasured;Se&&(R<Se.lineN?Se.lineN+=L:a<Se.lineN+Se.size&&(M.externalMeasured=null))}function Jr(e,a,R){e.curOp.viewChanged=!0;var L=e.display,M=e.display.externalMeasured;if(M&&a>=M.lineN&&a<M.lineN+M.size&&(L.externalMeasured=null),a<L.viewFrom||a>=L.viewTo)return;var X=L.view[ri(e,a)];if(X.node==null)return;var ce=X.changes||(X.changes=[]);$(ce,R)==-1&&ce.push(R)}function wi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ii(e,a,R,L){var M=ri(e,a),X,ce=e.display.view;if(!Or||R==e.doc.first+e.doc.size)return{index:M,lineN:R};for(var ve=e.display.viewFrom,ye=0;ye<M;ye++)ve+=ce[ye].size;if(ve!=a){if(L>0){if(M==ce.length-1)return null;X=ve+ce[M].size-a,M++}else X=ve-a;a+=X,R+=X}for(;Di(e.doc,R)!=R;){if(M==(L<0?0:ce.length-1))return null;R+=L*ce[M-(L<0?1:0)].size,M+=L}return{index:M,lineN:R}}function Xi(e,a,R){var L=e.display,M=L.view;M.length==0||a>=L.viewTo||R<=L.viewFrom?(L.view=cr(e,a,R),L.viewFrom=a):(L.viewFrom>a?L.view=cr(e,a,L.viewFrom).concat(L.view):L.viewFrom<a&&(L.view=L.view.slice(ri(e,a))),L.viewFrom=a,L.viewTo<R?L.view=L.view.concat(cr(e,L.viewTo,R)):L.viewTo>R&&(L.view=L.view.slice(0,ri(e,R)))),L.viewTo=R}function Kn(e){for(var a=e.display.view,R=0,L=0;L<a.length;L++){var M=a[L];!M.hidden&&(!M.node||M.changes)&&++R}return R}function wn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Yn(e,a){a===void 0&&(a=!0);for(var R=e.doc,L={},M=L.cursors=document.createDocumentFragment(),X=L.selection=document.createDocumentFragment(),ce=0;ce<R.sel.ranges.length;ce++){if(!a&&ce==R.sel.primIndex)continue;var ve=R.sel.ranges[ce];if(ve.from().line>=e.display.viewTo||ve.to().line<e.display.viewFrom)continue;var ye=ve.empty();(ye||e.options.showCursorWhenSelecting)&&rn(e,ve.head,M),ye||Ar(e,ve,X)}return L}function rn(e,a,R){var L=Vn(e,a,"div",null,null,!e.options.singleCursorHeightPerLine),M=R.appendChild(_("div","\xA0","CodeMirror-cursor"));if(M.style.left=L.left+"px",M.style.top=L.top+"px",M.style.height=Math.max(0,L.bottom-L.top)*e.options.cursorHeight+"px",L.other){var X=R.appendChild(_("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));X.style.display="",X.style.left=L.other.left+"px",X.style.top=L.other.top+"px",X.style.height=(L.other.bottom-L.other.top)*.85+"px"}}function kn(e,a){return e.top-a.top||e.left-a.left}function Ar(e,a,R){var L=e.display,M=e.doc,X=document.createDocumentFragment(),ce=ir(e.display),ve=ce.left,ye=Math.max(L.sizerWidth,vr(e)-L.sizer.offsetLeft)-ce.right,Se=M.direction=="ltr";function Ye(tn,ln,On,En){ln<0&&(ln=0),ln=Math.round(ln),En=Math.round(En),X.appendChild(_("div",null,"CodeMirror-selected","position: absolute; left: "+tn+`px;
|
|
|
top: `+ln+"px; width: "+(On==null?ye-tn:On)+`px;
|
|
|
height: `+(En-ln)+"px"))}function et(tn,ln,On){var En=Z(M,tn),qn=En.text.length,Rr,oi;function jr(Qr,Oi){return Tn(e,ot(tn,Qr),"div",En,Oi)}function ki(Qr,Oi,hi){var ti=Mi(e,En,null,Qr),qr=Oi=="ltr"==(hi=="after")?"left":"right",Hr=hi=="after"?ti.begin:ti.end-(/\s/.test(En.text.charAt(ti.end-1))?2:1);return jr(Hr,qr)[qr]}var Ai=ct(En,M.direction);return Y(Ai,ln||0,On==null?qn:On,function(Qr,Oi,hi,ti){var qr=hi=="ltr",Hr=jr(Qr,qr?"left":"right"),Li=jr(Oi-1,qr?"right":"left"),ka=ln==null&&Qr==0,pa=On==null&&Oi==qn,pi=ti==0,ea=!Ai||ti==Ai.length-1;if(Li.top-Hr.top<=3){var si=(Se?ka:pa)&&pi,Fo=(Se?pa:ka)&&ea,ia=si?ve:(qr?Hr:Li).left,_a=Fo?ye:(qr?Li:Hr).right;Ye(ia,Hr.top,_a-ia,Hr.bottom)}else{var xa,_i,Ma,Bo;qr?(xa=Se&&ka&&pi?ve:Hr.left,_i=Se?ye:ki(Qr,hi,"before"),Ma=Se?ve:ki(Oi,hi,"after"),Bo=Se&&pa&&ea?ye:Li.right):(xa=Se?ki(Qr,hi,"before"):ve,_i=!Se&&ka&&pi?ye:Hr.right,Ma=!Se&&pa&&ea?ve:Li.left,Bo=Se?ki(Oi,hi,"after"):ye),Ye(xa,Hr.top,_i-xa,Hr.bottom),Hr.bottom<Li.top&&Ye(ve,Hr.bottom,null,Li.top),Ye(Ma,Li.top,Bo-Ma,Li.bottom)}(!Rr||kn(Hr,Rr)<0)&&(Rr=Hr),kn(Li,Rr)<0&&(Rr=Li),(!oi||kn(Hr,oi)<0)&&(oi=Hr),kn(Li,oi)<0&&(oi=Li)}),{start:Rr,end:oi}}var vt=a.from(),dt=a.to();if(vt.line==dt.line)et(vt.line,vt.ch,dt.ch);else{var Lt=Z(M,vt.line),Ft=Z(M,dt.line),Gt=ni(Lt)==ni(Ft),en=et(vt.line,vt.ch,Gt?Lt.text.length+1:null).end,on=et(dt.line,Gt?0:null,dt.ch).start;Gt&&(en.top<on.top-2?(Ye(en.right,en.top,null,en.bottom),Ye(ve,on.top,on.left,on.bottom)):Ye(en.right,en.top,on.left-en.right,en.bottom)),en.bottom<on.top&&Ye(ve,en.bottom,null,on.top)}R.appendChild(X)}function Gr(e){if(!e.state.focused)return;var a=e.display;clearInterval(a.blinker);var R=!0;a.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?a.blinker=setInterval(function(){e.hasFocus()||Hi(e),a.cursorDiv.style.visibility=(R=!R)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(a.cursorDiv.style.visibility="hidden")}function Vr(e){e.state.focused||(e.display.input.focus(),vn(e))}function va(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Hi(e))},100)}function vn(e,a){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Qe(e,"focus",e,a),e.state.focused=!0,W(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),f&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Gr(e)}function Hi(e,a){if(e.state.delayingBlurEvent)return;e.state.focused&&(Qe(e,"blur",e,a),e.state.focused=!1,y(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function oa(e){for(var a=e.display,R=a.lineDiv.offsetTop,L=0;L<a.view.length;L++){var M=a.view[L],X=e.options.lineWrapping,ce=void 0,ve=0;if(M.hidden)continue;if(T&&w<8){var ye=M.node.offsetTop+M.node.offsetHeight;ce=ye-R,R=ye}else{var Se=M.node.getBoundingClientRect();ce=Se.bottom-Se.top,!X&&M.text.firstChild&&(ve=M.text.firstChild.getBoundingClientRect().right-Se.left-1)}var Ye=M.line.height-ce;if((Ye>.005||Ye<-.005)&&(Re(M.line,ce),Yi(M.line),M.rest))for(var et=0;et<M.rest.length;et++)Yi(M.rest[et]);if(ve>e.display.sizerWidth){var vt=Math.ceil(ve/Xn(e.display));vt>e.display.maxLineLength&&(e.display.maxLineLength=vt,e.display.maxLine=M.line,e.display.maxLineChanged=!0)}}}function Yi(e){if(e.widgets)for(var a=0;a<e.widgets.length;++a){var R=e.widgets[a],L=R.node.parentNode;L&&(R.height=L.offsetHeight)}}function Ki(e,a,R){var L=R&&R.top!=null?Math.max(0,R.top):e.scroller.scrollTop;L=Math.floor(L-Gn(e));var M=R&&R.bottom!=null?R.bottom:L+e.wrapper.clientHeight,X=at(a,L),ce=at(a,M);if(R&&R.ensure){var ve=R.ensure.from.line,ye=R.ensure.to.line;ve<X?(X=ve,ce=at(a,Ci(Z(a,ve))+e.wrapper.clientHeight)):Math.min(ye,a.lastLine())>=ce&&(X=at(a,Ci(Z(a,ye))-e.wrapper.clientHeight),ce=ye)}return{from:X,to:Math.max(ce,X+1)}}function $i(e,a){if(Xe(e,"scrollCursorIntoView"))return;var R=e.display,L=R.sizer.getBoundingClientRect(),M=null;if(a.top+L.top<0?M=!0:a.bottom+L.top>(window.innerHeight||document.documentElement.clientHeight)&&(M=!1),M!=null&&!s){var X=_("div","\u200B",null,`position: absolute;
|
|
|
top: `+(a.top-R.viewOffset-Gn(e.display))+`px;
|
|
|
height: `+(a.bottom-a.top+dr(e)+R.barHeight)+`px;
|
|
|
left: `+a.left+"px; width: "+Math.max(2,a.right-a.left)+"px;");e.display.lineSpace.appendChild(X),X.scrollIntoView(M),e.display.lineSpace.removeChild(X)}}function sa(e,a,R,L){L==null&&(L=0);var M;!e.options.lineWrapping&&a==R&&(a=a.ch?ot(a.line,a.sticky=="before"?a.ch-1:a.ch,"after"):a,R=a.sticky=="before"?ot(a.line,a.ch+1,"before"):a);for(var X=0;X<5;X++){var ce=!1,ve=Vn(e,a),ye=!R||R==a?ve:Vn(e,R);M={left:Math.min(ve.left,ye.left),top:Math.min(ve.top,ye.top)-L,right:Math.max(ve.left,ye.left),bottom:Math.max(ve.bottom,ye.bottom)+L};var Se=Zi(e,M),Ye=e.doc.scrollTop,et=e.doc.scrollLeft;if(Se.scrollTop!=null&&(Ua(e,Se.scrollTop),Math.abs(e.doc.scrollTop-Ye)>1&&(ce=!0)),Se.scrollLeft!=null&&(ga(e,Se.scrollLeft),Math.abs(e.doc.scrollLeft-et)>1&&(ce=!0)),!ce)break}return M}function la(e,a){var R=Zi(e,a);R.scrollTop!=null&&Ua(e,R.scrollTop),R.scrollLeft!=null&&ga(e,R.scrollLeft)}function Zi(e,a){var R=e.display,L=Vi(e.display);a.top<0&&(a.top=0);var M=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:R.scroller.scrollTop,X=xr(e),ce={};a.bottom-a.top>X&&(a.bottom=a.top+X);var ve=e.doc.height+Tr(R),ye=a.top<L,Se=a.bottom>ve-L;if(a.top<M)ce.scrollTop=ye?0:a.top;else if(a.bottom>M+X){var Ye=Math.min(a.top,(Se?ve:a.bottom)-X);Ye!=M&&(ce.scrollTop=Ye)}var et=e.options.fixedGutter?0:R.gutters.offsetWidth,vt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:R.scroller.scrollLeft-et,dt=vr(e)-R.gutters.offsetWidth,Lt=a.right-a.left>dt;return Lt&&(a.right=a.left+dt),a.left<10?ce.scrollLeft=0:a.left<vt?ce.scrollLeft=Math.max(0,a.left+et-(Lt?0:10)):a.right>dt+vt-3&&(ce.scrollLeft=a.right+(Lt?0:10)-dt),ce}function Ia(e,a){if(a==null)return;no(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+a}function Ir(e){no(e);var a=e.getCursor();e.curOp.scrollToPos={from:a,to:a,margin:e.options.cursorScrollMargin}}function Na(e,a,R){(a!=null||R!=null)&&no(e),a!=null&&(e.curOp.scrollLeft=a),R!=null&&(e.curOp.scrollTop=R)}function Qs(e,a){no(e),e.curOp.scrollToPos=a}function no(e){var a=e.curOp.scrollToPos;if(a){e.curOp.scrollToPos=null;var R=sr(e,a.from),L=sr(e,a.to);Wo(e,R,L,a.margin)}}function Wo(e,a,R,L){var M=Zi(e,{left:Math.min(a.left,R.left),top:Math.min(a.top,R.top)-L,right:Math.max(a.right,R.right),bottom:Math.max(a.bottom,R.bottom)+L});Na(e,M.scrollLeft,M.scrollTop)}function Ua(e,a){if(Math.abs(e.doc.scrollTop-a)<2)return;j||Eo(e,{top:a}),Ho(e,a,!0),j&&Eo(e),Ba(e,100)}function Ho(e,a,R){if(a=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,a)),e.display.scroller.scrollTop==a&&!R)return;e.doc.scrollTop=a,e.display.scrollbars.setScrollTop(a),e.display.scroller.scrollTop!=a&&(e.display.scroller.scrollTop=a)}function ga(e,a,R,L){if(a=Math.max(0,Math.min(a,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(R?a==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-a)<2)&&!L)return;e.doc.scrollLeft=a,Xo(e),e.display.scroller.scrollLeft!=a&&(e.display.scroller.scrollLeft=a),e.display.scrollbars.setScrollLeft(a)}function ja(e){var a=e.display,R=a.gutters.offsetWidth,L=Math.round(e.doc.height+Tr(e.display));return{clientHeight:a.scroller.clientHeight,viewHeight:a.wrapper.clientHeight,scrollWidth:a.scroller.scrollWidth,clientWidth:a.scroller.clientWidth,viewWidth:a.wrapper.clientWidth,barLeft:e.options.fixedGutter?R:0,docHeight:L,scrollHeight:L+dr(e)+a.barHeight,nativeBarWidth:a.nativeBarWidth,gutterWidth:R}}var ya=function(e,a,R){this.cm=R;var L=this.vert=_("div",[_("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),M=this.horiz=_("div",[_("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");L.tabIndex=M.tabIndex=-1,e(L),e(M),Be(L,"scroll",function(){L.clientHeight&&a(L.scrollTop,"vertical")}),Be(M,"scroll",function(){M.clientWidth&&a(M.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,T&&w<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ya.prototype.update=function(e){var a=e.scrollWidth>e.clientWidth+1,R=e.scrollHeight>e.clientHeight+1,L=e.nativeBarWidth;if(R){this.vert.style.display="block",this.vert.style.bottom=a?L+"px":"0";var M=e.viewHeight-(a?L:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+M)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(a){this.horiz.style.display="block",this.horiz.style.right=R?L+"px":"0",this.horiz.style.left=e.barLeft+"px";var X=e.viewWidth-e.barLeft-(R?L:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+X)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(L==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:R?L:0,bottom:a?L:0}},ya.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ya.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ya.prototype.zeroWidthHack=function(){var e=n&&!l?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new re,this.disableVert=new re},ya.prototype.enableZeroWidthBar=function(e,a,R){e.style.pointerEvents="auto";function L(){var M=e.getBoundingClientRect(),X=R=="vert"?document.elementFromPoint(M.right-1,(M.top+M.bottom)/2):document.elementFromPoint((M.right+M.left)/2,M.bottom-1);X!=e?e.style.pointerEvents="none":a.set(1e3,L)}a.set(1e3,L)},ya.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Fa=function(){};Fa.prototype.update=function(){return{bottom:0,right:0}},Fa.prototype.setScrollLeft=function(){},Fa.prototype.setScrollTop=function(){},Fa.prototype.clear=function(){};function Sa(e,a){a||(a=ja(e));var R=e.display.barWidth,L=e.display.barHeight;Ko(e,a);for(var M=0;M<4&&R!=e.display.barWidth||L!=e.display.barHeight;M++)R!=e.display.barWidth&&e.options.lineWrapping&&oa(e),Ko(e,ja(e)),R=e.display.barWidth,L=e.display.barHeight}function Ko(e,a){var R=e.display,L=R.scrollbars.update(a);R.sizer.style.paddingRight=(R.barWidth=L.right)+"px",R.sizer.style.paddingBottom=(R.barHeight=L.bottom)+"px",R.heightForcer.style.borderBottom=L.bottom+"px solid transparent",L.right&&L.bottom?(R.scrollbarFiller.style.display="block",R.scrollbarFiller.style.height=L.bottom+"px",R.scrollbarFiller.style.width=L.right+"px"):R.scrollbarFiller.style.display="",L.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(R.gutterFiller.style.display="block",R.gutterFiller.style.height=L.bottom+"px",R.gutterFiller.style.width=a.gutterWidth+"px"):R.gutterFiller.style.display=""}var zo={native:ya,null:Fa};function Go(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&y(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new zo[e.options.scrollbarStyle](function(a){e.display.wrapper.insertBefore(a,e.display.scrollbarFiller),Be(a,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),a.setAttribute("cm-not-content","true")},function(a,R){R=="horizontal"?ga(e,a):Ua(e,a)},e),e.display.scrollbars.addClass&&W(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function ba(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zs},bi(e.curOp)}function Ea(e){var a=e.curOp;a&>(a,function(R){for(var L=0;L<R.ops.length;L++)R.ops[L].cm.curOp=null;el(R)})}function el(e){for(var a=e.ops,R=0;R<a.length;R++)tl(a[R]);for(var L=0;L<a.length;L++)nl(a[L]);for(var M=0;M<a.length;M++)rl(a[M]);for(var X=0;X<a.length;X++)il(a[X]);for(var ce=0;ce<a.length;ce++)al(a[ce])}function tl(e){var a=e.cm,R=a.display;sl(a),e.updateMaxLine&&qi(a),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<R.viewFrom||e.scrollToPos.to.line>=R.viewTo)||R.maxLineChanged&&a.options.lineWrapping,e.update=e.mustUpdate&&new ro(a,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function nl(e){e.updatedDisplay=e.mustUpdate&&bo(e.cm,e.update)}function rl(e){var a=e.cm,R=a.display;e.updatedDisplay&&oa(a),e.barMeasure=ja(a),R.maxLineChanged&&!a.options.lineWrapping&&(e.adjustWidthTo=Jt(a,R.maxLine,R.maxLine.text.length).left+3,a.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(R.scroller.clientWidth,R.sizer.offsetLeft+e.adjustWidthTo+dr(a)+a.display.barWidth),e.maxScrollLeft=Math.max(0,R.sizer.offsetLeft+e.adjustWidthTo-vr(a))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=R.input.prepareSelection())}function il(e){var a=e.cm;e.adjustWidthTo!=null&&(a.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<a.doc.scrollLeft&&ga(a,Math.min(a.display.scroller.scrollLeft,e.maxScrollLeft),!0),a.display.maxLineChanged=!1);var R=e.focus&&e.focus==I();e.preparedSelection&&a.display.input.showSelection(e.preparedSelection,R),(e.updatedDisplay||e.startHeight!=a.doc.height)&&Sa(a,e.barMeasure),e.updatedDisplay&&xo(a,e.barMeasure),e.selectionChanged&&Gr(a),a.state.focused&&e.updateInput&&a.display.input.reset(e.typing),R&&Vr(e.cm)}function al(e){var a=e.cm,R=a.display,L=a.doc;if(e.updatedDisplay&&Vo(a,e.update),R.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(R.wheelStartX=R.wheelStartY=null),e.scrollTop!=null&&Ho(a,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ga(a,e.scrollLeft,!0,!0),e.scrollToPos){var M=sa(a,N(L,e.scrollToPos.from),N(L,e.scrollToPos.to),e.scrollToPos.margin);$i(a,M)}var X=e.maybeHiddenMarkers,ce=e.maybeUnhiddenMarkers;if(X)for(var ve=0;ve<X.length;++ve)X[ve].lines.length||Qe(X[ve],"hide");if(ce)for(var ye=0;ye<ce.length;++ye)ce[ye].lines.length&&Qe(ce[ye],"unhide");R.wrapper.offsetHeight&&(L.scrollTop=a.display.scroller.scrollTop),e.changeObjs&&Qe(a,"changes",a,e.changeObjs),e.update&&e.update.finish()}function Pi(e,a){if(e.curOp)return a();ba(e);try{return a()}finally{Ea(e)}}function ii(e,a){return function(){if(e.curOp)return a.apply(e,arguments);ba(e);try{return a.apply(e,arguments)}finally{Ea(e)}}}function Ei(e){return function(){if(this.curOp)return e.apply(this,arguments);ba(this);try{return e.apply(this,arguments)}finally{Ea(this)}}}function ai(e){return function(){var a=this.cm;if(!a||a.curOp)return e.apply(this,arguments);ba(a);try{return e.apply(this,arguments)}finally{Ea(a)}}}function Ba(e,a){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(a,H(ol,e))}function ol(e){var a=e.doc;if(a.highlightFrontier>=e.display.viewTo)return;var R=+new Date+e.options.workTime,L=Pt(e,a.highlightFrontier),M=[];a.iter(L.line,Math.min(a.first+a.size,e.display.viewTo+500),function(X){if(L.line>=e.display.viewFrom){var ce=X.styles,ve=X.text.length>e.options.maxHighlightLength?Xt(a.mode,L.state):null,ye=$e(e,X,L,!0);ve&&(L.state=ve),X.styles=ye.styles;var Se=X.styleClasses,Ye=ye.classes;Ye?X.styleClasses=Ye:Se&&(X.styleClasses=null);for(var et=!ce||ce.length!=X.styles.length||Se!=Ye&&(!Se||!Ye||Se.bgClass!=Ye.bgClass||Se.textClass!=Ye.textClass),vt=0;!et&&vt<ce.length;++vt)et=ce[vt]!=X.styles[vt];et&&M.push(L.line),X.stateAfter=L.save(),L.nextLine()}else X.text.length<=e.options.maxHighlightLength&&$t(e,X.text,L),X.stateAfter=L.line%5==0?L.save():null,L.nextLine();if(+new Date>R)return Ba(e,e.options.workDelay),!0}),a.highlightFrontier=L.line,a.modeFrontier=Math.max(a.modeFrontier,L.line),M.length&&Pi(e,function(){for(var X=0;X<M.length;X++)Jr(e,M[X],"text")})}var ro=function(e,a,R){var L=e.display;this.viewport=a,this.visible=Ki(L,e.doc,a),this.editorIsHidden=!L.wrapper.offsetWidth,this.wrapperHeight=L.wrapper.clientHeight,this.wrapperWidth=L.wrapper.clientWidth,this.oldDisplayWidth=vr(e),this.force=R,this.dims=An(e),this.events=[]};ro.prototype.signal=function(e,a){Fe(e,a)&&this.events.push(arguments)},ro.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Qe.apply(null,this.events[e])};function sl(e){var a=e.display;!a.scrollbarsClipped&&a.scroller.offsetWidth&&(a.nativeBarWidth=a.scroller.offsetWidth-a.scroller.clientWidth,a.heightForcer.style.height=dr(e)+"px",a.sizer.style.marginBottom=-a.nativeBarWidth+"px",a.sizer.style.borderRightWidth=dr(e)+"px",a.scrollbarsClipped=!0)}function ll(e){if(e.hasFocus())return null;var a=I();if(!a||!P(e.display.lineDiv,a))return null;var R={activeElt:a};if(window.getSelection){var L=window.getSelection();L.anchorNode&&L.extend&&P(e.display.lineDiv,L.anchorNode)&&(R.anchorNode=L.anchorNode,R.anchorOffset=L.anchorOffset,R.focusNode=L.focusNode,R.focusOffset=L.focusOffset)}return R}function ul(e){if(!e||!e.activeElt||e.activeElt==I())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&P(document.body,e.anchorNode)&&P(document.body,e.focusNode)){var a=window.getSelection(),R=document.createRange();R.setEnd(e.anchorNode,e.anchorOffset),R.collapse(!1),a.removeAllRanges(),a.addRange(R),a.extend(e.focusNode,e.focusOffset)}}function bo(e,a){var R=e.display,L=e.doc;if(a.editorIsHidden)return wi(e),!1;if(!a.force&&a.visible.from>=R.viewFrom&&a.visible.to<=R.viewTo&&(R.updateLineNumbers==null||R.updateLineNumbers>=R.viewTo)&&R.renderedView==R.view&&Kn(e)==0)return!1;Yo(e)&&(wi(e),a.dims=An(e));var M=L.first+L.size,X=Math.max(a.visible.from-e.options.viewportMargin,L.first),ce=Math.min(M,a.visible.to+e.options.viewportMargin);R.viewFrom<X&&X-R.viewFrom<20&&(X=Math.max(L.first,R.viewFrom)),R.viewTo>ce&&R.viewTo-ce<20&&(ce=Math.min(M,R.viewTo)),Or&&(X=Di(e.doc,X),ce=ta(e.doc,ce));var ve=X!=R.viewFrom||ce!=R.viewTo||R.lastWrapHeight!=a.wrapperHeight||R.lastWrapWidth!=a.wrapperWidth;Xi(e,X,ce),R.viewOffset=Ci(Z(e.doc,R.viewFrom)),e.display.mover.style.top=R.viewOffset+"px";var ye=Kn(e);if(!ve&&ye==0&&!a.force&&R.renderedView==R.view&&(R.updateLineNumbers==null||R.updateLineNumbers>=R.viewTo))return!1;var Se=ll(e);return ye>4&&(R.lineDiv.style.display="none"),cl(e,R.updateLineNumbers,a.dims),ye>4&&(R.lineDiv.style.display=""),R.renderedView=R.view,ul(Se),C(R.cursorDiv),C(R.selectionDiv),R.gutters.style.height=R.sizer.style.minHeight=0,ve&&(R.lastWrapHeight=a.wrapperHeight,R.lastWrapWidth=a.wrapperWidth,Ba(e,400)),R.updateLineNumbers=null,!0}function Vo(e,a){for(var R=a.viewport,L=!0;;L=!1){if(!L||!e.options.lineWrapping||a.oldDisplayWidth==vr(e)){if(R&&R.top!=null&&(R={top:Math.min(e.doc.height+Tr(e.display)-xr(e),R.top)}),a.visible=Ki(e.display,e.doc,R),a.visible.from>=e.display.viewFrom&&a.visible.to<=e.display.viewTo)break}else L&&(a.visible=Ki(e.display,e.doc,R));if(!bo(e,a))break;oa(e);var M=ja(e);wn(e),Sa(e,M),xo(e,M),a.force=!1}a.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(a.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Eo(e,a){var R=new ro(e,a);if(bo(e,R)){oa(e),Vo(e,R);var L=ja(e);wn(e),Sa(e,L),xo(e,L),R.finish()}}function cl(e,a,R){var L=e.display,M=e.options.lineNumbers,X=L.lineDiv,ce=X.firstChild;function ve(Lt){var Ft=Lt.nextSibling;return f&&n&&e.display.currentWheelTarget==Lt?Lt.style.display="none":Lt.parentNode.removeChild(Lt),Ft}for(var ye=L.view,Se=L.viewFrom,Ye=0;Ye<ye.length;Ye++){var et=ye[Ye];if(!et.hidden)if(!et.node||et.node.parentNode!=X){var vt=$n(e,et,Se,R);X.insertBefore(vt,ce)}else{for(;ce!=et.node;)ce=ve(ce);var dt=M&&a!=null&&a<=Se&&et.lineNumber;et.changes&&($(et.changes,"gutter")>-1&&(dt=!1),fn(e,et,Se,R)),dt&&(C(et.lineNumber),et.lineNumber.appendChild(document.createTextNode(jt(e.options,Se)))),ce=et.node.nextSibling}Se+=et.size}for(;ce;)ce=ve(ce)}function _o(e){var a=e.gutters.offsetWidth;e.sizer.style.marginLeft=a+"px"}function xo(e,a){e.display.sizer.style.minHeight=a.docHeight+"px",e.display.heightForcer.style.top=a.docHeight+"px",e.display.gutters.style.height=a.docHeight+e.display.barHeight+dr(e)+"px"}function Xo(e){var a=e.display,R=a.view;if(!a.alignWidgets&&(!a.gutters.firstChild||!e.options.fixedGutter))return;for(var L=nr(a)-a.scroller.scrollLeft+e.doc.scrollLeft,M=a.gutters.offsetWidth,X=L+"px",ce=0;ce<R.length;ce++)if(!R[ce].hidden){e.options.fixedGutter&&(R[ce].gutter&&(R[ce].gutter.style.left=X),R[ce].gutterBackground&&(R[ce].gutterBackground.style.left=X));var ve=R[ce].alignable;if(ve)for(var ye=0;ye<ve.length;ye++)ve[ye].style.left=X}e.options.fixedGutter&&(a.gutters.style.left=L+M+"px")}function Yo(e){if(!e.options.lineNumbers)return!1;var a=e.doc,R=jt(e.options,a.first+a.size-1),L=e.display;if(R.length!=L.lineNumChars){var M=L.measure.appendChild(_("div",[_("div",R)],"CodeMirror-linenumber CodeMirror-gutter-elt")),X=M.firstChild.offsetWidth,ce=M.offsetWidth-X;return L.lineGutter.style.width="",L.lineNumInnerWidth=Math.max(X,L.lineGutter.offsetWidth-ce)+1,L.lineNumWidth=L.lineNumInnerWidth+ce,L.lineNumChars=L.lineNumInnerWidth?R.length:-1,L.lineGutter.style.width=L.lineNumWidth+"px",_o(e.display),!0}return!1}function So(e,a){for(var R=[],L=!1,M=0;M<e.length;M++){var X=e[M],ce=null;if(typeof X!="string"&&(ce=X.style,X=X.className),X=="CodeMirror-linenumbers")if(a)L=!0;else continue;R.push({className:X,style:ce})}return a&&!L&&R.push({className:"CodeMirror-linenumbers",style:null}),R}function $o(e){var a=e.gutters,R=e.gutterSpecs;C(a),e.lineGutter=null;for(var L=0;L<R.length;++L){var M=R[L],X=M.className,ce=M.style,ve=a.appendChild(_("div",null,"CodeMirror-gutter "+X));ce&&(ve.style.cssText=ce),X=="CodeMirror-linenumbers"&&(e.lineGutter=ve,ve.style.width=(e.lineNumWidth||1)+"px")}a.style.display=R.length?"":"none",_o(e)}function Wa(e){$o(e.display),Ur(e),Xo(e)}function dl(e,a,R,L){var M=this;this.input=R,M.scrollbarFiller=_("div",null,"CodeMirror-scrollbar-filler"),M.scrollbarFiller.setAttribute("cm-not-content","true"),M.gutterFiller=_("div",null,"CodeMirror-gutter-filler"),M.gutterFiller.setAttribute("cm-not-content","true"),M.lineDiv=O("div",null,"CodeMirror-code"),M.selectionDiv=_("div",null,null,"position: relative; z-index: 1"),M.cursorDiv=_("div",null,"CodeMirror-cursors"),M.measure=_("div",null,"CodeMirror-measure"),M.lineMeasure=_("div",null,"CodeMirror-measure"),M.lineSpace=O("div",[M.measure,M.lineMeasure,M.selectionDiv,M.cursorDiv,M.lineDiv],null,"position: relative; outline: none");var X=O("div",[M.lineSpace],"CodeMirror-lines");M.mover=_("div",[X],null,"position: relative"),M.sizer=_("div",[M.mover],"CodeMirror-sizer"),M.sizerWidth=null,M.heightForcer=_("div",null,null,"position: absolute; height: "+ne+"px; width: 1px;"),M.gutters=_("div",null,"CodeMirror-gutters"),M.lineGutter=null,M.scroller=_("div",[M.sizer,M.heightForcer,M.gutters],"CodeMirror-scroll"),M.scroller.setAttribute("tabIndex","-1"),M.wrapper=_("div",[M.scrollbarFiller,M.gutterFiller,M.scroller],"CodeMirror"),T&&w<8&&(M.gutters.style.zIndex=-1,M.scroller.style.paddingRight=0),!f&&!(j&&t)&&(M.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(M.wrapper):e(M.wrapper)),M.viewFrom=M.viewTo=a.first,M.reportedViewFrom=M.reportedViewTo=a.first,M.view=[],M.renderedView=null,M.externalMeasured=null,M.viewOffset=0,M.lastWrapHeight=M.lastWrapWidth=0,M.updateLineNumbers=null,M.nativeBarWidth=M.barHeight=M.barWidth=0,M.scrollbarsClipped=!1,M.lineNumWidth=M.lineNumInnerWidth=M.lineNumChars=null,M.alignWidgets=!1,M.cachedCharWidth=M.cachedTextHeight=M.cachedPaddingH=null,M.maxLine=null,M.maxLineLength=0,M.maxLineChanged=!1,M.wheelDX=M.wheelDY=M.wheelStartX=M.wheelStartY=null,M.shift=!1,M.selForContextMenu=null,M.activeTouch=null,M.gutterSpecs=So(L.gutters,L.lineNumbers),$o(M),R.init(M)}var io=0,Ni=null;T?Ni=-.53:j?Ni=15:u?Ni=-.7:i&&(Ni=-1/3);function Jo(e){var a=e.wheelDeltaX,R=e.wheelDeltaY;return a==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(a=e.detail),R==null&&e.detail&&e.axis==e.VERTICAL_AXIS?R=e.detail:R==null&&(R=e.wheelDelta),{x:a,y:R}}function hl(e){var a=Jo(e);return a.x*=Ni,a.y*=Ni,a}function Qo(e,a){var R=Jo(a),L=R.x,M=R.y,X=e.display,ce=X.scroller,ve=ce.scrollWidth>ce.clientWidth,ye=ce.scrollHeight>ce.clientHeight;if(!(L&&ve||M&&ye))return;if(M&&n&&f){e:for(var Se=a.target,Ye=X.view;Se!=ce;Se=Se.parentNode)for(var et=0;et<Ye.length;et++)if(Ye[et].node==Se){e.display.currentWheelTarget=Se;break e}}if(L&&!j&&!o&&Ni!=null){M&&ye&&Ua(e,Math.max(0,ce.scrollTop+M*Ni)),ga(e,Math.max(0,ce.scrollLeft+L*Ni)),(!M||M&&ye)&&_e(a),X.wheelStartX=null;return}if(M&&Ni!=null){var vt=M*Ni,dt=e.doc.scrollTop,Lt=dt+X.wrapper.clientHeight;vt<0?dt=Math.max(0,dt+vt-50):Lt=Math.min(e.doc.height,Lt+vt+50),Eo(e,{top:dt,bottom:Lt})}io<20&&(X.wheelStartX==null?(X.wheelStartX=ce.scrollLeft,X.wheelStartY=ce.scrollTop,X.wheelDX=L,X.wheelDY=M,setTimeout(function(){if(X.wheelStartX==null)return;var Ft=ce.scrollLeft-X.wheelStartX,Gt=ce.scrollTop-X.wheelStartY,en=Gt&&X.wheelDY&&Gt/X.wheelDY||Ft&&X.wheelDX&&Ft/X.wheelDX;if(X.wheelStartX=X.wheelStartY=null,!en)return;Ni=(Ni*io+en)/(io+1),++io},200)):(X.wheelDX+=L,X.wheelDY+=M))}var Ui=function(e,a){this.ranges=e,this.primIndex=a};Ui.prototype.primary=function(){return this.ranges[this.primIndex]},Ui.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var a=0;a<this.ranges.length;a++){var R=this.ranges[a],L=e.ranges[a];if(!Kt(R.anchor,L.anchor)||!Kt(R.head,L.head))return!1}return!0},Ui.prototype.deepCopy=function(){for(var e=[],a=0;a<this.ranges.length;a++)e[a]=new Er(Et(this.ranges[a].anchor),Et(this.ranges[a].head));return new Ui(e,this.primIndex)},Ui.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ui.prototype.contains=function(e,a){a||(a=e);for(var R=0;R<this.ranges.length;R++){var L=this.ranges[R];if(wt(a,L.from())>=0&&wt(e,L.to())<=0)return R}return-1};var Er=function(e,a){this.anchor=e,this.head=a};Er.prototype.from=function(){return Vt(this.anchor,this.head)},Er.prototype.to=function(){return Qt(this.anchor,this.head)},Er.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ji(e,a,R){var L=e&&e.options.selectionsMayTouch,M=a[R];a.sort(function(vt,dt){return wt(vt.from(),dt.from())}),R=$(a,M);for(var X=1;X<a.length;X++){var ce=a[X],ve=a[X-1],ye=wt(ve.to(),ce.from());if(L&&!ce.empty()?ye>0:ye>=0){var Se=Vt(ve.from(),ce.from()),Ye=Qt(ve.to(),ce.to()),et=ve.empty()?ce.from()==ce.head:ve.from()==ve.head;X<=R&&--R,a.splice(--X,2,new Er(et?Ye:Se,et?Se:Ye))}}return new Ui(a,R)}function ua(e,a){return new Ui([new Er(e,a||e)],0)}function ca(e){return e.text?ot(e.from.line+e.text.length-1,Ge(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function qo(e,a){if(wt(e,a.from)<0)return e;if(wt(e,a.to)<=0)return ca(a);var R=e.line+a.text.length-(a.to.line-a.from.line)-1,L=e.ch;return e.line==a.to.line&&(L+=ca(a).ch-a.to.ch),ot(R,L)}function Co(e,a){for(var R=[],L=0;L<e.sel.ranges.length;L++){var M=e.sel.ranges[L];R.push(new Er(qo(M.anchor,a),qo(M.head,a)))}return Ji(e.cm,R,e.sel.primIndex)}function Zo(e,a,R){return e.line==a.line?ot(R.line,e.ch-a.ch+R.ch):ot(R.line+(e.line-a.line),e.ch)}function fl(e,a,R){for(var L=[],M=ot(e.first,0),X=M,ce=0;ce<a.length;ce++){var ve=a[ce],ye=Zo(ve.from,M,X),Se=Zo(ca(ve),M,X);if(M=ve.to,X=Se,R=="around"){var Ye=e.sel.ranges[ce],et=wt(Ye.head,Ye.anchor)<0;L[ce]=new Er(et?Se:ye,et?ye:Se)}else L[ce]=new Er(ye,ye)}return new Ui(L,e.sel.primIndex)}function wo(e){e.doc.mode=mt(e.options,e.doc.modeOption),Ha(e)}function Ha(e){e.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ba(e,100),e.state.modeGen++,e.curOp&&Ur(e)}function es(e,a){return a.from.ch==0&&a.to.ch==0&&Ge(a.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function To(e,a,R,L){function M(on){return R?R[on]:null}function X(on,tn,ln){aa(on,tn,ln,L),Ht(on,"change",on,a)}function ce(on,tn){for(var ln=[],On=on;On<tn;++On)ln.push(new yi(Se[On],M(On),L));return ln}var ve=a.from,ye=a.to,Se=a.text,Ye=Z(e,ve.line),et=Z(e,ye.line),vt=Ge(Se),dt=M(Se.length-1),Lt=ye.line-ve.line;if(a.full)e.insert(0,ce(0,Se.length)),e.remove(Se.length,e.size-Se.length);else if(es(e,a)){var Ft=ce(0,Se.length-1);X(et,et.text,dt),Lt&&e.remove(ve.line,Lt),Ft.length&&e.insert(ve.line,Ft)}else if(Ye==et)if(Se.length==1)X(Ye,Ye.text.slice(0,ve.ch)+vt+Ye.text.slice(ye.ch),dt);else{var Gt=ce(1,Se.length-1);Gt.push(new yi(vt+Ye.text.slice(ye.ch),dt,L)),X(Ye,Ye.text.slice(0,ve.ch)+Se[0],M(0)),e.insert(ve.line+1,Gt)}else if(Se.length==1)X(Ye,Ye.text.slice(0,ve.ch)+Se[0]+et.text.slice(ye.ch),M(0)),e.remove(ve.line+1,Lt);else{X(Ye,Ye.text.slice(0,ve.ch)+Se[0],M(0)),X(et,vt+et.text.slice(ye.ch),dt);var en=ce(1,Se.length-1);Lt>1&&e.remove(ve.line+1,Lt-1),e.insert(ve.line+1,en)}Ht(e,"change",e,a)}function da(e,a,R){function L(M,X,ce){if(M.linked)for(var ve=0;ve<M.linked.length;++ve){var ye=M.linked[ve];if(ye.doc==X)continue;var Se=ce&&ye.sharedHist;if(R&&!Se)continue;a(ye.doc,Se),L(ye.doc,M,Se)}}L(e,null,!0)}function ts(e,a){if(a.cm)throw new Error("This document is already in use.");e.doc=a,a.cm=e,Wr(e),wo(e),ns(e),e.options.lineWrapping||qi(e),e.options.mode=a.modeOption,Ur(e)}function ns(e){(e.doc.direction=="rtl"?W:y)(e.display.lineDiv,"CodeMirror-rtl")}function pl(e){Pi(e,function(){ns(e),Ur(e)})}function ao(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ao(e,a){var R={from:Et(a.from),to:ca(a),text:oe(e,a.from,a.to)};return as(e,R,a.from.line,a.to.line+1),da(e,function(L){return as(L,R,a.from.line,a.to.line+1)},!0),R}function rs(e){for(;e.length;){var a=Ge(e);if(a.ranges)e.pop();else break}}function ml(e,a){if(a)return rs(e.done),Ge(e.done);if(e.done.length&&!Ge(e.done).ranges)return Ge(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ge(e.done)}function is(e,a,R,L){var M=e.history;M.undone.length=0;var X=+new Date,ce,ve;if((M.lastOp==L||M.lastOrigin==a.origin&&a.origin&&(a.origin.charAt(0)=="+"&&M.lastModTime>X-(e.cm?e.cm.options.historyEventDelay:500)||a.origin.charAt(0)=="*"))&&(ce=ml(M,M.lastOp==L)))ve=Ge(ce.changes),wt(a.from,a.to)==0&&wt(a.from,ve.to)==0?ve.to=ca(a):ce.changes.push(Ao(e,a));else{var ye=Ge(M.done);for((!ye||!ye.ranges)&&oo(e.sel,M.done),ce={changes:[Ao(e,a)],generation:M.generation},M.done.push(ce);M.done.length>M.undoDepth;)M.done.shift(),M.done[0].ranges||M.done.shift()}M.done.push(R),M.generation=++M.maxGeneration,M.lastModTime=M.lastSelTime=X,M.lastOp=M.lastSelOp=L,M.lastOrigin=M.lastSelOrigin=a.origin,ve||Qe(e,"historyAdded")}function vl(e,a,R,L){var M=a.charAt(0);return M=="*"||M=="+"&&R.ranges.length==L.ranges.length&&R.somethingSelected()==L.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,a,R,L){var M=e.history,X=L&&L.origin;R==M.lastSelOp||X&&M.lastSelOrigin==X&&(M.lastModTime==M.lastSelTime&&M.lastOrigin==X||vl(e,X,Ge(M.done),a))?M.done[M.done.length-1]=a:oo(a,M.done),M.lastSelTime=+new Date,M.lastSelOrigin=X,M.lastSelOp=R,L&&L.clearRedo!==!1&&rs(M.undone)}function oo(e,a){var R=Ge(a);R&&R.ranges&&R.equals(e)||a.push(e)}function as(e,a,R,L){var M=a["spans_"+e.id],X=0;e.iter(Math.max(e.first,R),Math.min(e.first+e.size,L),function(ce){ce.markedSpans&&((M||(M=a["spans_"+e.id]={}))[X]=ce.markedSpans),++X})}function yl(e){if(!e)return null;for(var a,R=0;R<e.length;++R)e[R].marker.explicitlyCleared?a||(a=e.slice(0,R)):a&&a.push(e[R]);return a?a.length?a:null:e}function bl(e,a){var R=a["spans_"+e.id];if(!R)return null;for(var L=[],M=0;M<a.text.length;++M)L.push(yl(R[M]));return L}function os(e,a){var R=bl(e,a),L=Kr(e,a);if(!R)return L;if(!L)return R;for(var M=0;M<R.length;++M){var X=R[M],ce=L[M];if(X&&ce){e:for(var ve=0;ve<ce.length;++ve){for(var ye=ce[ve],Se=0;Se<X.length;++Se)if(X[Se].marker==ye.marker)continue e;X.push(ye)}}else ce&&(R[M]=ce)}return R}function Ca(e,a,R){for(var L=[],M=0;M<e.length;++M){var X=e[M];if(X.ranges){L.push(R?Ui.prototype.deepCopy.call(X):X);continue}var ce=X.changes,ve=[];L.push({changes:ve});for(var ye=0;ye<ce.length;++ye){var Se=ce[ye],Ye=void 0;if(ve.push({from:Se.from,to:Se.to,text:Se.text}),a)for(var et in Se)(Ye=et.match(/^spans_(\d+)$/))&&($(a,Number(Ye[1]))>-1&&(Ge(ve)[et]=Se[et],delete Se[et]))}}return L}function Oo(e,a,R,L){if(L){var M=e.anchor;if(R){var X=wt(a,M)<0;X!=wt(R,M)<0?(M=a,a=R):X!=wt(a,R)<0&&(a=R)}return new Er(M,a)}else return new Er(R||a,a)}function so(e,a,R,L,M){M==null&&(M=e.cm&&(e.cm.display.shift||e.extend)),fi(e,new Ui([Oo(e.sel.primary(),a,R,M)],0),L)}function ss(e,a,R){for(var L=[],M=e.cm&&(e.cm.display.shift||e.extend),X=0;X<e.sel.ranges.length;X++)L[X]=Oo(e.sel.ranges[X],a[X],null,M);var ce=Ji(e.cm,L,e.sel.primIndex);fi(e,ce,R)}function Lo(e,a,R,L){var M=e.sel.ranges.slice(0);M[a]=R,fi(e,Ji(e.cm,M,e.sel.primIndex),L)}function ls(e,a,R,L){fi(e,ua(a,R),L)}function El(e,a,R){var L={ranges:a.ranges,update:function(M){this.ranges=[];for(var X=0;X<M.length;X++)this.ranges[X]=new Er(N(e,M[X].anchor),N(e,M[X].head))},origin:R&&R.origin};return Qe(e,"beforeSelectionChange",e,L),e.cm&&Qe(e.cm,"beforeSelectionChange",e.cm,L),L.ranges!=a.ranges?Ji(e.cm,L.ranges,L.ranges.length-1):a}function us(e,a,R){var L=e.history.done,M=Ge(L);M&&M.ranges?(L[L.length-1]=a,lo(e,a,R)):fi(e,a,R)}function fi(e,a,R){lo(e,a,R),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,R)}function lo(e,a,R){(Fe(e,"beforeSelectionChange")||e.cm&&Fe(e.cm,"beforeSelectionChange"))&&(a=El(e,a,R));var L=R&&R.bias||(wt(a.primary().head,e.sel.primary().head)<0?-1:1);cs(e,hs(e,a,L,!0)),!(R&&R.scroll===!1)&&e.cm&&Ir(e.cm)}function cs(e,a){if(a.equals(e.sel))return;e.sel=a,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ke(e.cm)),Ht(e,"cursorActivity",e)}function ds(e){cs(e,hs(e,e.sel,null,!1))}function hs(e,a,R,L){for(var M,X=0;X<a.ranges.length;X++){var ce=a.ranges[X],ve=a.ranges.length==e.sel.ranges.length&&e.sel.ranges[X],ye=uo(e,ce.anchor,ve&&ve.anchor,R,L),Se=uo(e,ce.head,ve&&ve.head,R,L);(M||ye!=ce.anchor||Se!=ce.head)&&(M||(M=a.ranges.slice(0,X)),M[X]=new Er(ye,Se))}return M?Ji(e.cm,M,a.primIndex):a}function wa(e,a,R,L,M){var X=Z(e,a.line);if(X.markedSpans)for(var ce=0;ce<X.markedSpans.length;++ce){var ve=X.markedSpans[ce],ye=ve.marker,Se="selectLeft"in ye?!ye.selectLeft:ye.inclusiveLeft,Ye="selectRight"in ye?!ye.selectRight:ye.inclusiveRight;if((ve.from==null||(Se?ve.from<=a.ch:ve.from<a.ch))&&(ve.to==null||(Ye?ve.to>=a.ch:ve.to>a.ch))){if(M&&(Qe(ye,"beforeCursorEnter"),ye.explicitlyCleared))if(X.markedSpans){--ce;continue}else break;if(!ye.atomic)continue;if(R){var et=ye.find(L<0?1:-1),vt=void 0;if((L<0?Ye:Se)&&(et=fs(e,et,-L,et&&et.line==a.line?X:null)),et&&et.line==a.line&&(vt=wt(et,R))&&(L<0?vt<0:vt>0))return wa(e,et,a,L,M)}var dt=ye.find(L<0?-1:1);return(L<0?Se:Ye)&&(dt=fs(e,dt,L,dt.line==a.line?X:null)),dt?wa(e,dt,a,L,M):null}}return a}function uo(e,a,R,L,M){var X=L||1,ce=wa(e,a,R,X,M)||!M&&wa(e,a,R,X,!0)||wa(e,a,R,-X,M)||!M&&wa(e,a,R,-X,!0);return ce||(e.cantEdit=!0,ot(e.first,0))}function fs(e,a,R,L){return R<0&&a.ch==0?a.line>e.first?N(e,ot(a.line-1)):null:R>0&&a.ch==(L||Z(e,a.line)).text.length?a.line<e.first+e.size-1?ot(a.line+1,0):null:new ot(a.line,a.ch+R)}function ps(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),pe)}function ms(e,a,R){var L={canceled:!1,from:a.from,to:a.to,text:a.text,origin:a.origin,cancel:function(){return L.canceled=!0}};return R&&(L.update=function(M,X,ce,ve){M&&(L.from=N(e,M)),X&&(L.to=N(e,X)),ce&&(L.text=ce),ve!==void 0&&(L.origin=ve)}),Qe(e,"beforeChange",e,L),e.cm&&Qe(e.cm,"beforeChange",e.cm,L),L.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:L.from,to:L.to,text:L.text,origin:L.origin}}function Ta(e,a,R){if(e.cm){if(!e.cm.curOp)return ii(e.cm,Ta)(e,a,R);if(e.cm.state.suppressEdits)return}if((Fe(e,"beforeChange")||e.cm&&Fe(e.cm,"beforeChange"))&&(a=ms(e,a,!0),!a))return;var L=mi&&!R&&xi(e,a.from,a.to);if(L)for(var M=L.length-1;M>=0;--M)vs(e,{from:L[M].from,to:L[M].to,text:M?[""]:a.text,origin:a.origin});else vs(e,a)}function vs(e,a){if(a.text.length==1&&a.text[0]==""&&wt(a.from,a.to)==0)return;var R=Co(e,a);is(e,a,R,e.cm?e.cm.curOp.id:NaN),Ka(e,a,R,Kr(e,a));var L=[];da(e,function(M,X){!X&&$(L,M.history)==-1&&(Es(M.history,a),L.push(M.history)),Ka(M,a,null,Kr(M,a))})}function co(e,a,R){var L=e.cm&&e.cm.state.suppressEdits;if(L&&!R)return;for(var M=e.history,X,ce=e.sel,ve=a=="undo"?M.done:M.undone,ye=a=="undo"?M.undone:M.done,Se=0;Se<ve.length&&!(X=ve[Se],R?X.ranges&&!X.equals(e.sel):!X.ranges);Se++);if(Se==ve.length)return;for(M.lastOrigin=M.lastSelOrigin=null;;)if(X=ve.pop(),X.ranges){if(oo(X,ye),R&&!X.equals(e.sel)){fi(e,X,{clearRedo:!1});return}ce=X}else if(L){ve.push(X);return}else break;var Ye=[];oo(ce,ye),ye.push({changes:Ye,generation:M.generation}),M.generation=X.generation||++M.maxGeneration;for(var et=Fe(e,"beforeChange")||e.cm&&Fe(e.cm,"beforeChange"),vt=function(Ft){var Gt=X.changes[Ft];if(Gt.origin=a,et&&!ms(e,Gt,!1))return ve.length=0,{};Ye.push(Ao(e,Gt));var en=Ft?Co(e,Gt):Ge(ve);Ka(e,Gt,en,os(e,Gt)),!Ft&&e.cm&&e.cm.scrollIntoView({from:Gt.from,to:ca(Gt)});var on=[];da(e,function(tn,ln){!ln&&$(on,tn.history)==-1&&(Es(tn.history,Gt),on.push(tn.history)),Ka(tn,Gt,null,os(tn,Gt))})},dt=X.changes.length-1;dt>=0;--dt){var Lt=vt(dt);if(Lt)return Lt.v}}function gs(e,a){if(a==0)return;if(e.first+=a,e.sel=new Ui(je(e.sel.ranges,function(M){return new Er(ot(M.anchor.line+a,M.anchor.ch),ot(M.head.line+a,M.head.ch))}),e.sel.primIndex),e.cm){Ur(e.cm,e.first,e.first-a,a);for(var R=e.cm.display,L=R.viewFrom;L<R.viewTo;L++)Jr(e.cm,L,"gutter")}}function Ka(e,a,R,L){if(e.cm&&!e.cm.curOp)return ii(e.cm,Ka)(e,a,R,L);if(a.to.line<e.first){gs(e,a.text.length-1-(a.to.line-a.from.line));return}if(a.from.line>e.lastLine())return;if(a.from.line<e.first){var M=a.text.length-1-(e.first-a.from.line);gs(e,M),a={from:ot(e.first,0),to:ot(a.to.line+M,a.to.ch),text:[Ge(a.text)],origin:a.origin}}var X=e.lastLine();a.to.line>X&&(a={from:a.from,to:ot(X,Z(e,X).text.length),text:[a.text[0]],origin:a.origin}),a.removed=oe(e,a.from,a.to),R||(R=Co(e,a)),e.cm?_l(e.cm,a,L):To(e,a,L),lo(e,R,pe),e.cantEdit&&uo(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,a,R){var L=e.doc,M=e.display,X=a.from,ce=a.to,ve=!1,ye=X.line;e.options.lineWrapping||(ye=Je(ni(Z(L,X.line))),L.iter(ye,ce.line+1,function(dt){if(dt==M.maxLine)return ve=!0,!0})),L.sel.contains(a.from,a.to)>-1&&Ke(e),To(L,a,R,lr(e)),e.options.lineWrapping||(L.iter(ye,X.line+a.text.length,function(dt){var Lt=zi(dt);Lt>M.maxLineLength&&(M.maxLine=dt,M.maxLineLength=Lt,M.maxLineChanged=!0,ve=!1)}),ve&&(e.curOp.updateMaxLine=!0)),hr(L,X.line),Ba(e,400);var Se=a.text.length-(ce.line-X.line)-1;a.full?Ur(e):X.line==ce.line&&a.text.length==1&&!es(e.doc,a)?Jr(e,X.line,"text"):Ur(e,X.line,ce.line+1,Se);var Ye=Fe(e,"changes"),et=Fe(e,"change");if(et||Ye){var vt={from:X,to:ce,text:a.text,removed:a.removed,origin:a.origin};et&&Ht(e,"change",e,vt),Ye&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(vt)}e.display.selForContextMenu=null}function Aa(e,a,R,L,M){var X;L||(L=R),wt(L,R)<0&&(X=[L,R],R=X[0],L=X[1]),typeof a=="string"&&(a=e.splitLines(a)),Ta(e,{from:R,to:L,text:a,origin:M})}function ys(e,a,R,L){R<e.line?e.line+=L:a<e.line&&(e.line=a,e.ch=0)}function bs(e,a,R,L){for(var M=0;M<e.length;++M){var X=e[M],ce=!0;if(X.ranges){X.copied||(X=e[M]=X.deepCopy(),X.copied=!0);for(var ve=0;ve<X.ranges.length;ve++)ys(X.ranges[ve].anchor,a,R,L),ys(X.ranges[ve].head,a,R,L);continue}for(var ye=0;ye<X.changes.length;++ye){var Se=X.changes[ye];if(R<Se.from.line)Se.from=ot(Se.from.line+L,Se.from.ch),Se.to=ot(Se.to.line+L,Se.to.ch);else if(a<=Se.to.line){ce=!1;break}}ce||(e.splice(0,M+1),M=0)}}function Es(e,a){var R=a.from.line,L=a.to.line,M=a.text.length-(L-R)-1;bs(e.done,R,L,M),bs(e.undone,R,L,M)}function za(e,a,R,L){var M=a,X=a;return typeof a=="number"?X=Z(e,ie(e,a)):M=Je(a),M==null?null:(L(X,M)&&e.cm&&Jr(e.cm,M,R),X)}function Ga(e){this.lines=e,this.parent=null;for(var a=0,R=0;R<e.length;++R)e[R].parent=this,a+=e[R].height;this.height=a}Ga.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,a){for(var R=e,L=e+a;R<L;++R){var M=this.lines[R];this.height-=M.height,ma(M),Ht(M,"delete")}this.lines.splice(e,a)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,a,R){this.height+=R,this.lines=this.lines.slice(0,e).concat(a).concat(this.lines.slice(e));for(var L=0;L<a.length;++L)a[L].parent=this},iterN:function(e,a,R){for(var L=e+a;e<L;++e)if(R(this.lines[e]))return!0}};function Va(e){this.children=e;for(var a=0,R=0,L=0;L<e.length;++L){var M=e[L];a+=M.chunkSize(),R+=M.height,M.parent=this}this.size=a,this.height=R,this.parent=null}Va.prototype={chunkSize:function(){return this.size},removeInner:function(e,a){this.size-=a;for(var R=0;R<this.children.length;++R){var L=this.children[R],M=L.chunkSize();if(e<M){var X=Math.min(a,M-e),ce=L.height;if(L.removeInner(e,X),this.height-=ce-L.height,M==X&&(this.children.splice(R--,1),L.parent=null),(a-=X)==0)break;e=0}else e-=M}if(this.size-a<25&&(this.children.length>1||!(this.children[0]instanceof Ga))){var ve=[];this.collapse(ve),this.children=[new Ga(ve)],this.children[0].parent=this}},collapse:function(e){for(var a=0;a<this.children.length;++a)this.children[a].collapse(e)},insertInner:function(e,a,R){this.size+=a.length,this.height+=R;for(var L=0;L<this.children.length;++L){var M=this.children[L],X=M.chunkSize();if(e<=X){if(M.insertInner(e,a,R),M.lines&&M.lines.length>50){for(var ce=M.lines.length%25+25,ve=ce;ve<M.lines.length;){var ye=new Ga(M.lines.slice(ve,ve+=25));M.height-=ye.height,this.children.splice(++L,0,ye),ye.parent=this}M.lines=M.lines.slice(0,ce),this.maybeSpill()}break}e-=X}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var a=e.children.splice(e.children.length-5,5),R=new Va(a);if(e.parent){e.size-=R.size,e.height-=R.height;var M=$(e.parent.children,e);e.parent.children.splice(M+1,0,R)}else{var L=new Va(e.children);L.parent=e,e.children=[L,R],e=L}R.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,a,R){for(var L=0;L<this.children.length;++L){var M=this.children[L],X=M.chunkSize();if(e<X){var ce=Math.min(a,X-e);if(M.iterN(e,ce,R))return!0;if((a-=ce)==0)break;e=0}else e-=X}}};var Xa=function(e,a,R){if(R)for(var L in R)R.hasOwnProperty(L)&&(this[L]=R[L]);this.doc=e,this.node=a};Xa.prototype.clear=function(){var e=this.doc.cm,a=this.line.widgets,R=this.line,L=Je(R);if(L==null||!a)return;for(var M=0;M<a.length;++M)a[M]==this&&a.splice(M--,1);a.length||(R.widgets=null);var X=Rn(this);Re(R,Math.max(0,R.height-X)),e&&(Pi(e,function(){_s(e,R,-X),Jr(e,L,"widget")}),Ht(e,"lineWidgetCleared",e,this,L))},Xa.prototype.changed=function(){var e=this,a=this.height,R=this.doc.cm,L=this.line;this.height=null;var M=Rn(this)-a;if(!M)return;ci(this.doc,L)||Re(L,L.height+M),R&&Pi(R,function(){R.curOp.forceUpdate=!0,_s(R,L,M),Ht(R,"lineWidgetChanged",R,e,Je(L))})},Ue(Xa);function _s(e,a,R){Ci(a)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ia(e,R)}function xl(e,a,R,L){var M=new Xa(e,R,L),X=e.cm;return X&&M.noHScroll&&(X.display.alignWidgets=!0),za(e,a,"widget",function(ce){var ve=ce.widgets||(ce.widgets=[]);if(M.insertAt==null?ve.push(M):ve.splice(Math.min(ve.length-1,Math.max(0,M.insertAt)),0,M),M.line=ce,X&&!ci(e,ce)){var ye=Ci(ce)<e.scrollTop;Re(ce,ce.height+Rn(M)),ye&&Ia(X,M.height),X.curOp.forceUpdate=!0}return!0}),X&&Ht(X,"lineWidgetAdded",X,M,typeof a=="number"?a:Je(a)),M}var xs=0,ha=function(e,a){this.lines=[],this.type=a,this.doc=e,this.id=++xs};ha.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,a=e&&!e.curOp;if(a&&ba(e),Fe(this,"clear")){var R=this.find();R&&Ht(this,"clear",R.from,R.to)}for(var L=null,M=null,X=0;X<this.lines.length;++X){var ce=this.lines[X],ve=Mr(ce.markedSpans,this);e&&!this.collapsed?Jr(e,Je(ce),"text"):e&&(ve.to!=null&&(M=Je(ce)),ve.from!=null&&(L=Je(ce))),ce.markedSpans=Zr(ce.markedSpans,ve),ve.from==null&&this.collapsed&&!ci(this.doc,ce)&&e&&Re(ce,Vi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ye=0;ye<this.lines.length;++ye){var Se=ni(this.lines[ye]),Ye=zi(Se);Ye>e.display.maxLineLength&&(e.display.maxLine=Se,e.display.maxLineLength=Ye,e.display.maxLineChanged=!0)}L!=null&&e&&this.collapsed&&Ur(e,L,M+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ds(e.doc)),e&&Ht(e,"markerCleared",e,this,L,M),a&&Ea(e),this.parent&&this.parent.clear()},ha.prototype.find=function(e,a){e==null&&this.type=="bookmark"&&(e=1);for(var R,L,M=0;M<this.lines.length;++M){var X=this.lines[M],ce=Mr(X.markedSpans,this);if(ce.from!=null&&(R=ot(a?X:Je(X),ce.from),e==-1))return R;if(ce.to!=null&&(L=ot(a?X:Je(X),ce.to),e==1))return L}return R&&{from:R,to:L}},ha.prototype.changed=function(){var e=this,a=this.find(-1,!0),R=this,L=this.doc.cm;if(!a||!L)return;Pi(L,function(){var M=a.line,X=Je(a.line),ce=gn(L,X);if(ce&&(Yt(ce),L.curOp.selectionChanged=L.curOp.forceUpdate=!0),L.curOp.updateMaxLine=!0,!ci(R.doc,M)&&R.height!=null){var ve=R.height;R.height=null;var ye=Rn(R)-ve;ye&&Re(M,M.height+ye)}Ht(L,"markerChanged",L,e)})},ha.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var a=this.doc.cm.curOp;(!a.maybeHiddenMarkers||$(a.maybeHiddenMarkers,this)==-1)&&(a.maybeUnhiddenMarkers||(a.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ha.prototype.detachLine=function(e){if(this.lines.splice($(this.lines,e),1),!this.lines.length&&this.doc.cm){var a=this.doc.cm.curOp;(a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this)}},Ue(ha);function Oa(e,a,R,L,M){if(L&&L.shared)return Sl(e,a,R,L,M);if(e.cm&&!e.cm.curOp)return ii(e.cm,Oa)(e,a,R,L,M);var X=new ha(e,M),ce=wt(a,R);if(L&&G(L,X,!1),ce>0||ce==0&&X.clearWhenEmpty!==!1)return X;if(X.replacedWith&&(X.collapsed=!0,X.widgetNode=O("span",[X.replacedWith],"CodeMirror-widget"),L.handleMouseEvents||X.widgetNode.setAttribute("cm-ignore-events","true"),L.insertLeft&&(X.widgetNode.insertLeft=!0)),X.collapsed){if(Pr(e,a.line,a,R,X)||a.line!=R.line&&Pr(e,R.line,a,R,X))throw new Error("Inserting collapsed marker partially overlapping an existing one");pr()}X.addToHistory&&is(e,{from:a,to:R,origin:"markText"},e.sel,NaN);var ve=a.line,ye=e.cm,Se;if(e.iter(ve,R.line+1,function(et){ye&&X.collapsed&&!ye.options.lineWrapping&&ni(et)==ye.display.maxLine&&(Se=!0),X.collapsed&&ve!=a.line&&Re(et,0),wr(et,new Yr(X,ve==a.line?a.ch:null,ve==R.line?R.ch:null)),++ve}),X.collapsed&&e.iter(a.line,R.line+1,function(et){ci(e,et)&&Re(et,0)}),X.clearOnEnter&&Be(X,"beforeCursorEnter",function(){return X.clear()}),X.readOnly&&(yr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),X.collapsed&&(X.id=++xs,X.atomic=!0),ye){if(Se&&(ye.curOp.updateMaxLine=!0),X.collapsed)Ur(ye,a.line,R.line+1);else if(X.className||X.startStyle||X.endStyle||X.css||X.attributes||X.title)for(var Ye=a.line;Ye<=R.line;Ye++)Jr(ye,Ye,"text");X.atomic&&ds(ye.doc),Ht(ye,"markerAdded",ye,X)}return X}var Ya=function(e,a){this.markers=e,this.primary=a;for(var R=0;R<e.length;++R)e[R].parent=this};Ya.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ht(this,"clear")},Ya.prototype.find=function(e,a){return this.primary.find(e,a)},Ue(Ya);function Sl(e,a,R,L,M){L=G(L),L.shared=!1;var X=[Oa(e,a,R,L,M)],ce=X[0],ve=L.widgetNode;return da(e,function(ye){ve&&(L.widgetNode=ve.cloneNode(!0)),X.push(Oa(ye,N(ye,a),N(ye,R),L,M));for(var Se=0;Se<ye.linked.length;++Se)if(ye.linked[Se].isParent)return;ce=Ge(X)}),new Ya(X,ce)}function Ss(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),function(a){return a.parent})}function Cl(e,a){for(var R=0;R<a.length;R++){var L=a[R],M=L.find(),X=e.clipPos(M.from),ce=e.clipPos(M.to);if(wt(X,ce)){var ve=Oa(e,X,ce,L.primary,L.primary.type);L.markers.push(ve),ve.parent=L}}}function wl(e){for(var a=function(L){var M=e[L],X=[M.primary.doc];da(M.primary.doc,function(ye){return X.push(ye)});for(var ce=0;ce<M.markers.length;ce++){var ve=M.markers[ce];$(X,ve.doc)==-1&&(ve.parent=null,M.markers.splice(ce--,1))}},R=0;R<e.length;R++)a(R)}var Tl=0,Ti=function(e,a,R,L,M){if(!(this instanceof Ti))return new Ti(e,a,R,L,M);R==null&&(R=0),Va.call(this,[new Ga([new yi("",null)])]),this.first=R,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=R;var X=ot(R,0);this.sel=ua(X),this.history=new ao(null),this.id=++Tl,this.modeOption=a,this.lineSep=L,this.direction=M=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),To(this,{from:X,to:X,text:e}),fi(this,ua(X),pe)};Ti.prototype=de(Va.prototype,{constructor:Ti,iter:function(e,a,R){R?this.iterN(e-this.first,a-e,R):this.iterN(this.first,this.first+this.size,e)},insert:function(e,a){for(var R=0,L=0;L<a.length;++L)R+=a[L].height;this.insertInner(e-this.first,a,R)},remove:function(e,a){this.removeInner(e-this.first,a)},getValue:function(e){var a=me(this,this.first,this.first+this.size);return e===!1?a:a.join(e||this.lineSeparator())},setValue:ai(function(e){var a=ot(this.first,0),R=this.first+this.size-1;Ta(this,{from:a,to:ot(R,Z(this,R).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Na(this.cm,0,0),fi(this,ua(a),pe)}),replaceRange:function(e,a,R,L){a=N(this,a),R=R?N(this,R):a,Aa(this,e,a,R,L)},getRange:function(e,a,R){var L=oe(this,N(this,e),N(this,a));return R===!1?L:L.join(R||this.lineSeparator())},getLine:function(e){var a=this.getLineHandle(e);return a&&a.text},getLineHandle:function(e){if(kt(this,e))return Z(this,e)},getLineNumber:function(e){return Je(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Z(this,e)),ni(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return N(this,e)},getCursor:function(e){var a=this.sel.primary(),R;return e==null||e=="head"?R=a.head:e=="anchor"?R=a.anchor:e=="end"||e=="to"||e===!1?R=a.to():R=a.from(),R},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ai(function(e,a,R){ls(this,N(this,typeof e=="number"?ot(e,a||0):e),null,R)}),setSelection:ai(function(e,a,R){ls(this,N(this,e),N(this,a||e),R)}),extendSelection:ai(function(e,a,R){so(this,N(this,e),a&&N(this,a),R)}),extendSelections:ai(function(e,a){ss(this,ae(this,e),a)}),extendSelectionsBy:ai(function(e,a){var R=je(this.sel.ranges,e);ss(this,ae(this,R),a)}),setSelections:ai(function(e,a,R){if(!e.length)return;for(var L=[],M=0;M<e.length;M++)L[M]=new Er(N(this,e[M].anchor),N(this,e[M].head));a==null&&(a=Math.min(e.length-1,this.sel.primIndex)),fi(this,Ji(this.cm,L,a),R)}),addSelection:ai(function(e,a,R){var L=this.sel.ranges.slice(0);L.push(new Er(N(this,e),N(this,a||e))),fi(this,Ji(this.cm,L,L.length-1),R)}),getSelection:function(e){for(var a=this.sel.ranges,R,L=0;L<a.length;L++){var M=oe(this,a[L].from(),a[L].to());R=R?R.concat(M):M}return e===!1?R:R.join(e||this.lineSeparator())},getSelections:function(e){for(var a=[],R=this.sel.ranges,L=0;L<R.length;L++){var M=oe(this,R[L].from(),R[L].to());e!==!1&&(M=M.join(e||this.lineSeparator())),a[L]=M}return a},replaceSelection:function(e,a,R){for(var L=[],M=0;M<this.sel.ranges.length;M++)L[M]=e;this.replaceSelections(L,a,R||"+input")},replaceSelections:ai(function(e,a,R){for(var L=[],M=this.sel,X=0;X<M.ranges.length;X++){var ce=M.ranges[X];L[X]={from:ce.from(),to:ce.to(),text:this.splitLines(e[X]),origin:R}}for(var ve=a&&a!="end"&&fl(this,L,a),ye=L.length-1;ye>=0;ye--)Ta(this,L[ye]);ve?us(this,ve):this.cm&&Ir(this.cm)}),undo:ai(function(){co(this,"undo")}),redo:ai(function(){co(this,"redo")}),undoSelection:ai(function(){co(this,"undo",!0)}),redoSelection:ai(function(){co(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,a=0,R=0,L=0;L<e.done.length;L++)e.done[L].ranges||++a;for(var M=0;M<e.undone.length;M++)e.undone[M].ranges||++R;return{undo:a,redo:R}},clearHistory:function(){var e=this;this.history=new ao(this.history.maxGeneration),da(this,function(a){return a.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ca(this.history.done),undone:Ca(this.history.undone)}},setHistory:function(e){var a=this.history=new ao(this.history.maxGeneration);a.done=Ca(e.done.slice(0),null,!0),a.undone=Ca(e.undone.slice(0),null,!0)},setGutterMarker:ai(function(e,a,R){return za(this,e,"gutter",function(L){var M=L.gutterMarkers||(L.gutterMarkers={});return M[a]=R,!R&&qe(M)&&(L.gutterMarkers=null),!0})}),clearGutter:ai(function(e){var a=this;this.iter(function(R){R.gutterMarkers&&R.gutterMarkers[e]&&za(a,R,"gutter",function(){return R.gutterMarkers[e]=null,qe(R.gutterMarkers)&&(R.gutterMarkers=null),!0})})}),lineInfo:function(e){var a;if(typeof e=="number"){if(!kt(this,e))return null;if(a=e,e=Z(this,e),!e)return null}else if(a=Je(e),a==null)return null;return{line:a,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ai(function(e,a,R){return za(this,e,a=="gutter"?"gutter":"class",function(L){var M=a=="text"?"textClass":a=="background"?"bgClass":a=="gutter"?"gutterClass":"wrapClass";if(!L[M])L[M]=R;else{if(g(R).test(L[M]))return!1;L[M]+=" "+R}return!0})}),removeLineClass:ai(function(e,a,R){return za(this,e,a=="gutter"?"gutter":"class",function(L){var M=a=="text"?"textClass":a=="background"?"bgClass":a=="gutter"?"gutterClass":"wrapClass",X=L[M];if(X)if(R==null)L[M]=null;else{var ce=X.match(g(R));if(!ce)return!1;var ve=ce.index+ce[0].length;L[M]=X.slice(0,ce.index)+(!ce.index||ve==X.length?"":" ")+X.slice(ve)||null}else return!1;return!0})}),addLineWidget:ai(function(e,a,R){return xl(this,e,a,R)}),removeLineWidget:function(e){e.clear()},markText:function(e,a,R){return Oa(this,N(this,e),N(this,a),R,R&&R.type||"range")},setBookmark:function(e,a){var R={replacedWith:a&&(a.nodeType==null?a.widget:a),insertLeft:a&&a.insertLeft,clearWhenEmpty:!1,shared:a&&a.shared,handleMouseEvents:a&&a.handleMouseEvents};return e=N(this,e),Oa(this,e,e,R,"bookmark")},findMarksAt:function(e){e=N(this,e);var a=[],R=Z(this,e.line).markedSpans;if(R)for(var L=0;L<R.length;++L){var M=R[L];(M.from==null||M.from<=e.ch)&&(M.to==null||M.to>=e.ch)&&a.push(M.marker.parent||M.marker)}return a},findMarks:function(e,a,R){e=N(this,e),a=N(this,a);var L=[],M=e.line;return this.iter(e.line,a.line+1,function(X){var ce=X.markedSpans;if(ce)for(var ve=0;ve<ce.length;ve++){var ye=ce[ve];!(ye.to!=null&&M==e.line&&e.ch>=ye.to||ye.from==null&&M!=e.line||ye.from!=null&&M==a.line&&ye.from>=a.ch)&&(!R||R(ye.marker))&&L.push(ye.marker.parent||ye.marker)}++M}),L},getAllMarks:function(){var e=[];return this.iter(function(a){var R=a.markedSpans;if(R)for(var L=0;L<R.length;++L)R[L].from!=null&&e.push(R[L].marker)}),e},posFromIndex:function(e){var a,R=this.first,L=this.lineSeparator().length;return this.iter(function(M){var X=M.text.length+L;if(X>e)return a=e,!0;e-=X,++R}),N(this,ot(R,a))},indexFromPos:function(e){e=N(this,e);var a=e.ch;if(e.line<this.first||e.ch<0)return 0;var R=this.lineSeparator().length;return this.iter(this.first,e.line,function(L){a+=L.text.length+R}),a},copy:function(e){var a=new Ti(me(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return a.scrollTop=this.scrollTop,a.scrollLeft=this.scrollLeft,a.sel=this.sel,a.extend=!1,e&&(a.history.undoDepth=this.history.undoDepth,a.setHistory(this.getHistory())),a},linkedDoc:function(e){e||(e={});var a=this.first,R=this.first+this.size;e.from!=null&&e.from>a&&(a=e.from),e.to!=null&&e.to<R&&(R=e.to);var L=new Ti(me(this,a,R),e.mode||this.modeOption,a,this.lineSep,this.direction);return e.sharedHist&&(L.history=this.history),(this.linked||(this.linked=[])).push({doc:L,sharedHist:e.sharedHist}),L.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cl(L,Ss(this)),L},unlinkDoc:function(e){if(e instanceof Nr&&(e=e.doc),this.linked)for(var a=0;a<this.linked.length;++a){var R=this.linked[a];if(R.doc!=e)continue;this.linked.splice(a,1),e.unlinkDoc(this),wl(Ss(this));break}if(e.history==this.history){var L=[e.id];da(e,function(M){return L.push(M.id)},!0),e.history=new ao(null),e.history.done=Ca(this.history.done,L),e.history.undone=Ca(this.history.undone,L)}},iterLinkedDocs:function(e){da(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):lt(e)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:ai(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(a){return a.order=null}),this.cm&&pl(this.cm)})}),Ti.prototype.eachLine=Ti.prototype.iter;var Cs=0;function Al(e){var a=this;if(ws(a),Xe(a,e)||Pn(a.display,e))return;_e(e),T&&(Cs=+new Date);var R=In(a,e,!0),L=e.dataTransfer.files;if(!R||a.isReadOnly())return;if(L&&L.length&&window.FileReader&&window.File)for(var M=L.length,X=Array(M),ce=0,ve=function(){++ce==M&&ii(a,function(){R=N(a.doc,R);var dt={from:R,to:R,text:a.doc.splitLines(X.filter(function(Lt){return Lt!=null}).join(a.doc.lineSeparator())),origin:"paste"};Ta(a.doc,dt),us(a.doc,ua(N(a.doc,R),N(a.doc,ca(dt))))})()},ye=function(dt,Lt){if(a.options.allowDropFileTypes&&$(a.options.allowDropFileTypes,dt.type)==-1){ve();return}var Ft=new FileReader;Ft.onerror=function(){return ve()},Ft.onload=function(){var Gt=Ft.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Gt)){ve();return}X[Lt]=Gt,ve()},Ft.readAsText(dt)},Se=0;Se<L.length;Se++)ye(L[Se],Se);else{if(a.state.draggingText&&a.doc.sel.contains(R)>-1){a.state.draggingText(e),setTimeout(function(){return a.display.input.focus()},20);return}try{var Ye=e.dataTransfer.getData("Text");if(Ye){var et;if(a.state.draggingText&&!a.state.draggingText.copy&&(et=a.listSelections()),lo(a.doc,ua(R,R)),et)for(var vt=0;vt<et.length;++vt)Aa(a.doc,"",et[vt].anchor,et[vt].head,"drag");a.replaceSelection(Ye,"around","paste"),a.display.input.focus()}}catch(dt){}}}function Ol(e,a){if(T&&(!e.state.draggingText||+new Date-Cs<100)){De(a);return}if(Xe(e,a)||Pn(e.display,a))return;if(a.dataTransfer.setData("Text",e.getSelection()),a.dataTransfer.effectAllowed="copyMove",a.dataTransfer.setDragImage&&!i){var R=_("img",null,null,"position: fixed; left: 0; top: 0;");R.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",o&&(R.width=R.height=1,e.display.wrapper.appendChild(R),R._top=R.offsetTop),a.dataTransfer.setDragImage(R,0,0),o&&R.parentNode.removeChild(R)}}function Ll(e,a){var R=In(e,a);if(!R)return;var L=document.createDocumentFragment();rn(e,R,L),e.display.dragCursor||(e.display.dragCursor=_("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),d(e.display.dragCursor,L)}function ws(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ts(e){if(!document.getElementsByClassName)return;for(var a=document.getElementsByClassName("CodeMirror"),R=[],L=0;L<a.length;L++){var M=a[L].CodeMirror;M&&R.push(M)}R.length&&R[0].operation(function(){for(var X=0;X<R.length;X++)e(R[X])})}var As=!1;function Rl(){if(As)return;Dl(),As=!0}function Dl(){var e;Be(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ts(Pl)},100))}),Be(window,"blur",function(){return Ts(Hi)})}function Pl(e){var a=e.display;a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.scrollbarsClipped=!1,e.setSize()}for(var fa={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},$a=0;$a<10;$a++)fa[$a+48]=fa[$a+96]=String($a);for(var ho=65;ho<=90;ho++)fa[ho]=String.fromCharCode(ho);for(var Ja=1;Ja<=12;Ja++)fa[Ja+111]=fa[Ja+63235]="F"+Ja;var ra={};ra.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ra.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ra.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},ra.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ra.default=n?ra.macDefault:ra.pcDefault;function kl(e){var a=e.split(/-(?!$)/);e=a[a.length-1];for(var R,L,M,X,ce=0;ce<a.length-1;ce++){var ve=a[ce];if(/^(cmd|meta|m)$/i.test(ve))X=!0;else if(/^a(lt)?$/i.test(ve))R=!0;else if(/^(c|ctrl|control)$/i.test(ve))L=!0;else if(/^s(hift)?$/i.test(ve))M=!0;else throw new Error("Unrecognized modifier name: "+ve)}return R&&(e="Alt-"+e),L&&(e="Ctrl-"+e),X&&(e="Cmd-"+e),M&&(e="Shift-"+e),e}function Ml(e){var a={};for(var R in e)if(e.hasOwnProperty(R)){var L=e[R];if(/^(name|fallthrough|(de|at)tach)$/.test(R))continue;if(L=="..."){delete e[R];continue}for(var M=je(R.split(" "),kl),X=0;X<M.length;X++){var ce=void 0,ve=void 0;X==M.length-1?(ve=M.join(" "),ce=L):(ve=M.slice(0,X+1).join(" "),ce="...");var ye=a[ve];if(!ye)a[ve]=ce;else if(ye!=ce)throw new Error("Inconsistent bindings for "+ve)}delete e[R]}for(var Se in a)e[Se]=a[Se];return e}function La(e,a,R,L){a=fo(a);var M=a.call?a.call(e,L):a[e];if(M===!1)return"nothing";if(M==="...")return"multi";if(M!=null&&R(M))return"handled";if(a.fallthrough){if(Object.prototype.toString.call(a.fallthrough)!="[object Array]")return La(e,a.fallthrough,R,L);for(var X=0;X<a.fallthrough.length;X++){var ce=La(e,a.fallthrough[X],R,L);if(ce)return ce}}}function Os(e){var a=typeof e=="string"?e:fa[e.keyCode];return a=="Ctrl"||a=="Alt"||a=="Shift"||a=="Mod"}function Ls(e,a,R){var L=e;return a.altKey&&L!="Alt"&&(e="Alt-"+e),(b?a.metaKey:a.ctrlKey)&&L!="Ctrl"&&(e="Ctrl-"+e),(b?a.ctrlKey:a.metaKey)&&L!="Mod"&&(e="Cmd-"+e),!R&&a.shiftKey&&L!="Shift"&&(e="Shift-"+e),e}function Rs(e,a){if(o&&e.keyCode==34&&e.char)return!1;var R=fa[e.keyCode];return R==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(R=e.code),Ls(R,e,a))}function fo(e){return typeof e=="string"?ra[e]:e}function Ra(e,a){for(var R=e.doc.sel.ranges,L=[],M=0;M<R.length;M++){for(var X=a(R[M]);L.length&&wt(X.from,Ge(L).to)<=0;){var ce=L.pop();if(wt(ce.from,X.from)<0){X.from=ce.from;break}}L.push(X)}Pi(e,function(){for(var ve=L.length-1;ve>=0;ve--)Aa(e.doc,"",L[ve].from,L[ve].to,"+delete");Ir(e)})}function Ro(e,a,R){var L=U(e.text,a+R,R);return L<0||L>e.text.length?null:L}function Do(e,a,R){var L=Ro(e,a.ch,R);return L==null?null:new ot(a.line,L,R<0?"after":"before")}function Po(e,a,R,L,M){if(e){a.doc.direction=="rtl"&&(M=-M);var X=ct(R,a.doc.direction);if(X){var ce=M<0?Ge(X):X[0],ve=M<0==(ce.level==1),ye=ve?"after":"before",Se;if(ce.level>0||a.doc.direction=="rtl"){var Ye=tr(a,R);Se=M<0?R.text.length-1:0;var et=or(a,Ye,Se).top;Se=q(function(vt){return or(a,Ye,vt).top==et},M<0==(ce.level==1)?ce.from:ce.to-1,Se),ye=="before"&&(Se=Ro(R,Se,1))}else Se=M<0?ce.to:ce.from;return new ot(L,Se,ye)}}return new ot(L,M<0?R.text.length:0,M<0?"before":"after")}function Il(e,a,R,L){var M=ct(a,e.doc.direction);if(!M)return Do(a,R,L);R.ch>=a.text.length?(R.ch=a.text.length,R.sticky="before"):R.ch<=0&&(R.ch=0,R.sticky="after");var X=be(M,R.ch,R.sticky),ce=M[X];if(e.doc.direction=="ltr"&&ce.level%2==0&&(L>0?ce.to>R.ch:ce.from<R.ch))return Do(a,R,L);var ve=function(en,on){return Ro(a,en instanceof ot?en.ch:en,on)},ye,Se=function(en){return e.options.lineWrapping?(ye=ye||tr(e,a),Mi(e,a,ye,en)):{begin:0,end:a.text.length}},Ye=Se(R.sticky=="before"?ve(R,-1):R.ch);if(e.doc.direction=="rtl"||ce.level==1){var et=ce.level==1==L<0,vt=ve(R,et?1:-1);if(vt!=null&&(et?vt<=ce.to&&vt<=Ye.end:vt>=ce.from&&vt>=Ye.begin)){var dt=et?"before":"after";return new ot(R.line,vt,dt)}}var Lt=function(en,on,tn){for(var ln=function(Rr,oi){return oi?new ot(R.line,ve(Rr,1),"before"):new ot(R.line,Rr,"after")};en>=0&&en<M.length;en+=on){var On=M[en],En=on>0==(On.level!=1),qn=En?tn.begin:ve(tn.end,-1);if(On.from<=qn&&qn<On.to)return ln(qn,En);if(qn=En?On.from:ve(On.to,-1),tn.begin<=qn&&qn<tn.end)return ln(qn,En)}},Ft=Lt(X+L,L,Ye);if(Ft)return Ft;var Gt=L>0?Ye.end:ve(Ye.begin,-1);return Gt!=null&&!(L>0&&Gt==a.text.length)&&(Ft=Lt(L>0?0:M.length-1,L,Se(Gt)),Ft)?Ft:null}var Qa={selectAll:ps,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),pe)},killLine:function(e){return Ra(e,function(a){if(a.empty()){var R=Z(e.doc,a.head.line).text.length;return a.head.ch==R&&a.head.line<e.lastLine()?{from:a.head,to:ot(a.head.line+1,0)}:{from:a.head,to:ot(a.head.line,R)}}else return{from:a.from(),to:a.to()}})},deleteLine:function(e){return Ra(e,function(a){return{from:ot(a.from().line,0),to:N(e.doc,ot(a.to().line+1,0))}})},delLineLeft:function(e){return Ra(e,function(a){return{from:ot(a.from().line,0),to:a.from()}})},delWrappedLineLeft:function(e){return Ra(e,function(a){var R=e.charCoords(a.head,"div").top+5,L=e.coordsChar({left:0,top:R},"div");return{from:L,to:a.from()}})},delWrappedLineRight:function(e){return Ra(e,function(a){var R=e.charCoords(a.head,"div").top+5,L=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:R},"div");return{from:a.from(),to:L}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(a){return Ds(e,a.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(a){return Ps(e,a.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(a){return Nl(e,a.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(a){var R=e.cursorCoords(a.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:R},"div")},we)},goLineLeft:function(e){return e.extendSelectionsBy(function(a){var R=e.cursorCoords(a.head,"div").top+5;return e.coordsChar({left:0,top:R},"div")},we)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(a){var R=e.cursorCoords(a.head,"div").top+5,L=e.coordsChar({left:0,top:R},"div");return L.ch<e.getLine(L.line).search(/\S/)?Ps(e,a.head):L},we)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var a=[],R=e.listSelections(),L=e.options.tabSize,M=0;M<R.length;M++){var X=R[M].from(),ce=V(e.getLine(X.line),X.ch,L);a.push(xe(L-ce%L))}e.replaceSelections(a)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Pi(e,function(){for(var a=e.listSelections(),R=[],L=0;L<a.length;L++){if(!a[L].empty())continue;var M=a[L].head,X=Z(e.doc,M.line).text;if(X){if(M.ch==X.length&&(M=new ot(M.line,M.ch-1)),M.ch>0)M=new ot(M.line,M.ch+1),e.replaceRange(X.charAt(M.ch-1)+X.charAt(M.ch-2),ot(M.line,M.ch-2),M,"+transpose");else if(M.line>e.doc.first){var ce=Z(e.doc,M.line-1).text;ce&&(M=new ot(M.line,1),e.replaceRange(X.charAt(0)+e.doc.lineSeparator()+ce.charAt(ce.length-1),ot(M.line-1,ce.length-1),M,"+transpose"))}}R.push(new Er(M,M))}e.setSelections(R)})},newlineAndIndent:function(e){return Pi(e,function(){for(var a=e.listSelections(),R=a.length-1;R>=0;R--)e.replaceRange(e.doc.lineSeparator(),a[R].anchor,a[R].head,"+input");a=e.listSelections();for(var L=0;L<a.length;L++)e.indentLine(a[L].from().line,null,!0);Ir(e)})},openLine:function(e){return e.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ds(e,a){var R=Z(e.doc,a),L=ni(R);return L!=R&&(a=Je(L)),Po(!0,e,L,a,1)}function Nl(e,a){var R=Z(e.doc,a),L=ji(R);return L!=R&&(a=Je(L)),Po(!0,e,R,a,-1)}function Ps(e,a){var R=Ds(e,a.line),L=Z(e.doc,R.line),M=ct(L,e.doc.direction);if(!M||M[0].level==0){var X=Math.max(R.ch,L.text.search(/\S/)),ce=a.line==R.line&&a.ch<=X&&a.ch;return ot(R.line,ce?0:X,R.sticky)}return R}function po(e,a,R){if(typeof a=="string"&&(a=Qa[a],!a))return!1;e.display.input.ensurePolled();var L=e.display.shift,M=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),R&&(e.display.shift=!1),M=a(e)!=he}finally{e.display.shift=L,e.state.suppressEdits=!1}return M}function Ul(e,a,R){for(var L=0;L<e.state.keyMaps.length;L++){var M=La(a,e.state.keyMaps[L],R,e);if(M)return M}return e.options.extraKeys&&La(a,e.options.extraKeys,R,e)||La(a,e.options.keyMap,R,e)}var jl=new re;function qa(e,a,R,L){var M=e.state.keySeq;if(M){if(Os(a))return"handled";if(/\'$/.test(a)?e.state.keySeq=null:jl.set(50,function(){e.state.keySeq==M&&(e.state.keySeq=null,e.display.input.reset())}),ks(e,M+" "+a,R,L))return!0}return ks(e,a,R,L)}function ks(e,a,R,L){var M=Ul(e,a,L);return M=="multi"&&(e.state.keySeq=a),M=="handled"&&Ht(e,"keyHandled",e,a,R),(M=="handled"||M=="multi")&&(_e(R),Gr(e)),!!M}function Ms(e,a){var R=Rs(a,!0);return R?a.shiftKey&&!e.state.keySeq?qa(e,"Shift-"+R,a,function(L){return po(e,L,!0)})||qa(e,R,a,function(L){if(typeof L=="string"?/^go[A-Z]/.test(L):L.motion)return po(e,L)}):qa(e,R,a,function(L){return po(e,L)}):!1}function Fl(e,a,R){return qa(e,"'"+R+"'",a,function(L){return po(e,L,!0)})}var ko=null;function Is(e){var a=this;if(e.target&&e.target!=a.display.input.getField())return;if(a.curOp.focus=I(),Xe(a,e))return;T&&w<11&&e.keyCode==27&&(e.returnValue=!1);var R=e.keyCode;a.display.shift=R==16||e.shiftKey;var L=Ms(a,e);o&&(ko=L?R:null,!L&&R==88&&!ut&&(n?e.metaKey:e.ctrlKey)&&a.replaceSelection("",null,"cut")),j&&!n&&!L&&R==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),R==18&&!/\bCodeMirror-crosshair\b/.test(a.display.lineDiv.className)&&Bl(a)}function Bl(e){var a=e.display.lineDiv;W(a,"CodeMirror-crosshair");function R(L){(L.keyCode==18||!L.altKey)&&(y(a,"CodeMirror-crosshair"),ht(document,"keyup",R),ht(document,"mouseover",R))}Be(document,"keyup",R),Be(document,"mouseover",R)}function Ns(e){e.keyCode==16&&(this.doc.sel.shift=!1),Xe(this,e)}function Us(e){var a=this;if(e.target&&e.target!=a.display.input.getField())return;if(Pn(a.display,e)||Xe(a,e)||e.ctrlKey&&!e.altKey||n&&e.metaKey)return;var R=e.keyCode,L=e.charCode;if(o&&R==ko){ko=null,_e(e);return}if(o&&(!e.which||e.which<10)&&Ms(a,e))return;var M=String.fromCharCode(L==null?R:L);if(M=="\b")return;if(Fl(a,e,M))return;a.display.input.onKeyPress(e)}var Wl=400,Mo=function(e,a,R){this.time=e,this.pos=a,this.button=R};Mo.prototype.compare=function(e,a,R){return this.time+Wl>e&&wt(a,this.pos)==0&&R==this.button};var Za,eo;function Hl(e,a){var R=+new Date;return eo&&eo.compare(R,e,a)?(Za=eo=null,"triple"):Za&&Za.compare(R,e,a)?(eo=new Mo(R,e,a),Za=null,"double"):(Za=new Mo(R,e,a),eo=null,"single")}function js(e){var a=this,R=a.display;if(Xe(a,e)||R.activeTouch&&R.input.supportsTouch())return;if(R.input.ensurePolled(),R.shift=e.shiftKey,Pn(R,e)){f||(R.scroller.draggable=!1,setTimeout(function(){return R.scroller.draggable=!0},100));return}if(Io(a,e))return;var L=In(a,e),M=tt(e),X=L?Hl(L,M):"single";if(window.focus(),M==1&&a.state.selectingText&&a.state.selectingText(e),L&&Kl(a,M,L,X,e))return;M==1?L?Gl(a,L,X,e):rt(e)==R.scroller&&_e(e):M==2?(L&&so(a.doc,L),setTimeout(function(){return R.input.focus()},20)):M==3&&(E?a.display.input.onContextMenu(e):va(a))}function Kl(e,a,R,L,M){var X="Click";return L=="double"?X="Double"+X:L=="triple"&&(X="Triple"+X),X=(a==1?"Left":a==2?"Middle":"Right")+X,qa(e,Ls(X,M),M,function(ce){if(typeof ce=="string"&&(ce=Qa[ce]),!ce)return!1;var ve=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ve=ce(e,R)!=he}finally{e.state.suppressEdits=!1}return ve})}function zl(e,a,R){var L=e.getOption("configureMouse"),M=L?L(e,a,R):{};if(M.unit==null){var X=c?R.shiftKey&&R.metaKey:R.altKey;M.unit=X?"rectangle":a=="single"?"char":a=="double"?"word":"line"}return(M.extend==null||e.doc.extend)&&(M.extend=e.doc.extend||R.shiftKey),M.addNew==null&&(M.addNew=n?R.metaKey:R.ctrlKey),M.moveOnDrag==null&&(M.moveOnDrag=!(n?R.altKey:R.ctrlKey)),M}function Gl(e,a,R,L){T?setTimeout(H(Vr,e),0):e.curOp.focus=I();var M=zl(e,R,L),X=e.doc.sel,ce;e.options.dragDrop&&xt&&!e.isReadOnly()&&R=="single"&&(ce=X.contains(a))>-1&&(wt((ce=X.ranges[ce]).from(),a)<0||a.xRel>0)&&(wt(ce.to(),a)>0||a.xRel<0)?Vl(e,L,a,M):Xl(e,L,a,M)}function Vl(e,a,R,L){var M=e.display,X=!1,ce=ii(e,function(Se){f&&(M.scroller.draggable=!1),e.state.draggingText=!1,ht(M.wrapper.ownerDocument,"mouseup",ce),ht(M.wrapper.ownerDocument,"mousemove",ve),ht(M.scroller,"dragstart",ye),ht(M.scroller,"drop",ce),X||(_e(Se),L.addNew||so(e.doc,R,null,null,L.extend),f&&!i||T&&w==9?setTimeout(function(){M.wrapper.ownerDocument.body.focus({preventScroll:!0}),M.input.focus()},20):M.input.focus())}),ve=function(Se){X=X||Math.abs(a.clientX-Se.clientX)+Math.abs(a.clientY-Se.clientY)>=10},ye=function(){return X=!0};f&&(M.scroller.draggable=!0),e.state.draggingText=ce,ce.copy=!L.moveOnDrag,M.scroller.dragDrop&&M.scroller.dragDrop(),Be(M.wrapper.ownerDocument,"mouseup",ce),Be(M.wrapper.ownerDocument,"mousemove",ve),Be(M.scroller,"dragstart",ye),Be(M.scroller,"drop",ce),va(e),setTimeout(function(){return M.input.focus()},20)}function Fs(e,a,R){if(R=="char")return new Er(a,a);if(R=="word")return e.findWordAt(a);if(R=="line")return new Er(ot(a.line,0),N(e.doc,ot(a.line+1,0)));var L=R(e,a);return new Er(L.from,L.to)}function Xl(e,a,R,L){var M=e.display,X=e.doc;_e(a);var ce,ve,ye=X.sel,Se=ye.ranges;if(L.addNew&&!L.extend?(ve=X.sel.contains(R),ve>-1?ce=Se[ve]:ce=new Er(R,R)):(ce=X.sel.primary(),ve=X.sel.primIndex),L.unit=="rectangle")L.addNew||(ce=new Er(R,R)),R=In(e,a,!0,!0),ve=-1;else{var Ye=Fs(e,R,L.unit);L.extend?ce=Oo(ce,Ye.anchor,Ye.head,L.extend):ce=Ye}L.addNew?ve==-1?(ve=Se.length,fi(X,Ji(e,Se.concat([ce]),ve),{scroll:!1,origin:"*mouse"})):Se.length>1&&Se[ve].empty()&&L.unit=="char"&&!L.extend?(fi(X,Ji(e,Se.slice(0,ve).concat(Se.slice(ve+1)),0),{scroll:!1,origin:"*mouse"}),ye=X.sel):Lo(X,ve,ce,Te):(ve=0,fi(X,new Ui([ce],0),Te),ye=X.sel);var et=R;function vt(tn){if(wt(et,tn)==0)return;if(et=tn,L.unit=="rectangle"){for(var ln=[],On=e.options.tabSize,En=V(Z(X,R.line).text,R.ch,On),qn=V(Z(X,tn.line).text,tn.ch,On),Rr=Math.min(En,qn),oi=Math.max(En,qn),jr=Math.min(R.line,tn.line),ki=Math.min(e.lastLine(),Math.max(R.line,tn.line));jr<=ki;jr++){var Ai=Z(X,jr).text,Qr=Me(Ai,Rr,On);Rr==oi?ln.push(new Er(ot(jr,Qr),ot(jr,Qr))):Ai.length>Qr&&ln.push(new Er(ot(jr,Qr),ot(jr,Me(Ai,oi,On))))}ln.length||ln.push(new Er(R,R)),fi(X,Ji(e,ye.ranges.slice(0,ve).concat(ln),ve),{origin:"*mouse",scroll:!1}),e.scrollIntoView(tn)}else{var Oi=ce,hi=Fs(e,tn,L.unit),ti=Oi.anchor,qr;wt(hi.anchor,ti)>0?(qr=hi.head,ti=Vt(Oi.from(),hi.anchor)):(qr=hi.anchor,ti=Qt(Oi.to(),hi.head));var Hr=ye.ranges.slice(0);Hr[ve]=Yl(e,new Er(N(X,ti),qr)),fi(X,Ji(e,Hr,ve),Te)}}var dt=M.wrapper.getBoundingClientRect(),Lt=0;function Ft(tn){var ln=++Lt,On=In(e,tn,!0,L.unit=="rectangle");if(!On)return;if(wt(On,et)!=0){e.curOp.focus=I(),vt(On);var En=Ki(M,X);(On.line>=En.to||On.line<En.from)&&setTimeout(ii(e,function(){Lt==ln&&Ft(tn)}),150)}else{var qn=tn.clientY<dt.top?-20:tn.clientY>dt.bottom?20:0;qn&&setTimeout(ii(e,function(){if(Lt!=ln)return;M.scroller.scrollTop+=qn,Ft(tn)}),50)}}function Gt(tn){e.state.selectingText=!1,Lt=Infinity,tn&&(_e(tn),M.input.focus()),ht(M.wrapper.ownerDocument,"mousemove",en),ht(M.wrapper.ownerDocument,"mouseup",on),X.history.lastSelOrigin=null}var en=ii(e,function(tn){tn.buttons===0||!tt(tn)?Gt(tn):Ft(tn)}),on=ii(e,Gt);e.state.selectingText=on,Be(M.wrapper.ownerDocument,"mousemove",en),Be(M.wrapper.ownerDocument,"mouseup",on)}function Yl(e,a){var R=a.anchor,L=a.head,M=Z(e.doc,R.line);if(wt(R,L)==0&&R.sticky==L.sticky)return a;var X=ct(M);if(!X)return a;var ce=be(X,R.ch,R.sticky),ve=X[ce];if(ve.from!=R.ch&&ve.to!=R.ch)return a;var ye=ce+(ve.from==R.ch==(ve.level!=1)?0:1);if(ye==0||ye==X.length)return a;var Se;if(L.line!=R.line)Se=(L.line-R.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ye=be(X,L.ch,L.sticky),et=Ye-ce||(L.ch-R.ch)*(ve.level==1?-1:1);Ye==ye-1||Ye==ye?Se=et<0:Se=et>0}var vt=X[ye+(Se?-1:0)],dt=Se==(vt.level==1),Lt=dt?vt.from:vt.to,Ft=dt?"after":"before";return R.ch==Lt&&R.sticky==Ft?a:new Er(new ot(R.line,Lt,Ft),L)}function Bs(e,a,R,L){var M,X;if(a.touches)M=a.touches[0].clientX,X=a.touches[0].clientY;else try{M=a.clientX,X=a.clientY}catch(vt){return!1}if(M>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;L&&_e(a);var ce=e.display,ve=ce.lineDiv.getBoundingClientRect();if(X>ve.bottom||!Fe(e,R))return Ne(a);X-=ve.top-ce.viewOffset;for(var ye=0;ye<e.display.gutterSpecs.length;++ye){var Se=ce.gutters.childNodes[ye];if(Se&&Se.getBoundingClientRect().right>=M){var Ye=at(e.doc,X),et=e.display.gutterSpecs[ye];return Qe(e,R,e,Ye,et.className,a),Ne(a)}}}function Io(e,a){return Bs(e,a,"gutterClick",!0)}function Ws(e,a){if(Pn(e.display,a)||$l(e,a))return;if(Xe(e,a,"contextmenu"))return;E||e.display.input.onContextMenu(a)}function $l(e,a){return Fe(e,"gutterContextMenu")?Bs(e,a,"gutterContextMenu",!1):!1}function Hs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),nn(e)}var Da={toString:function(){return"CodeMirror.Init"}},Ks={},mo={};function Jl(e){var a=e.optionHandlers;function R(L,M,X,ce){e.defaults[L]=M,X&&(a[L]=ce?function(ve,ye,Se){Se!=Da&&X(ve,ye,Se)}:X)}e.defineOption=R,e.Init=Da,R("value","",function(L,M){return L.setValue(M)},!0),R("mode",null,function(L,M){L.doc.modeOption=M,wo(L)},!0),R("indentUnit",2,wo,!0),R("indentWithTabs",!1),R("smartIndent",!0),R("tabSize",4,function(L){Ha(L),nn(L),Ur(L)},!0),R("lineSeparator",null,function(L,M){if(L.doc.lineSep=M,!M)return;var X=[],ce=L.doc.first;L.doc.iter(function(ye){for(var Se=0;;){var Ye=ye.text.indexOf(M,Se);if(Ye==-1)break;Se=Ye+M.length,X.push(ot(ce,Ye))}ce++});for(var ve=X.length-1;ve>=0;ve--)Aa(L.doc,M,X[ve],ot(X[ve].line,X[ve].ch+M.length))}),R("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(L,M,X){L.state.specialChars=new RegExp(M.source+(M.test(" ")?"":"| "),"g"),X!=Da&&L.refresh()}),R("specialCharPlaceholder",ur,function(L){return L.refresh()},!0),R("electricChars",!0),R("inputStyle",t?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),R("spellcheck",!1,function(L,M){return L.getInputField().spellcheck=M},!0),R("autocorrect",!1,function(L,M){return L.getInputField().autocorrect=M},!0),R("autocapitalize",!1,function(L,M){return L.getInputField().autocapitalize=M},!0),R("rtlMoveVisually",!m),R("wholeLineUpdateBefore",!0),R("theme","default",function(L){Hs(L),Wa(L)},!0),R("keyMap","default",function(L,M,X){var ce=fo(M),ve=X!=Da&&fo(X);ve&&ve.detach&&ve.detach(L,ce),ce.attach&&ce.attach(L,ve||null)}),R("extraKeys",null),R("configureMouse",null),R("lineWrapping",!1,ql,!0),R("gutters",[],function(L,M){L.display.gutterSpecs=So(M,L.options.lineNumbers),Wa(L)},!0),R("fixedGutter",!0,function(L,M){L.display.gutters.style.left=M?nr(L.display)+"px":"0",L.refresh()},!0),R("coverGutterNextToScrollbar",!1,function(L){return Sa(L)},!0),R("scrollbarStyle","native",function(L){Go(L),Sa(L),L.display.scrollbars.setScrollTop(L.doc.scrollTop),L.display.scrollbars.setScrollLeft(L.doc.scrollLeft)},!0),R("lineNumbers",!1,function(L,M){L.display.gutterSpecs=So(L.options.gutters,M),Wa(L)},!0),R("firstLineNumber",1,Wa,!0),R("lineNumberFormatter",function(L){return L},Wa,!0),R("showCursorWhenSelecting",!1,wn,!0),R("resetSelectionOnContextMenu",!0),R("lineWiseCopyCut",!0),R("pasteLinesPerSelection",!0),R("selectionsMayTouch",!1),R("readOnly",!1,function(L,M){M=="nocursor"&&(Hi(L),L.display.input.blur()),L.display.input.readOnlyChanged(M)}),R("screenReaderLabel",null,function(L,M){M=M===""?null:M,L.display.input.screenReaderLabelChanged(M)}),R("disableInput",!1,function(L,M){M||L.display.input.reset()},!0),R("dragDrop",!0,Ql),R("allowDropFileTypes",null),R("cursorBlinkRate",530),R("cursorScrollMargin",0),R("cursorHeight",1,wn,!0),R("singleCursorHeightPerLine",!0,wn,!0),R("workTime",100),R("workDelay",100),R("flattenSpans",!0,Ha,!0),R("addModeClass",!1,Ha,!0),R("pollInterval",100),R("undoDepth",200,function(L,M){return L.doc.history.undoDepth=M}),R("historyEventDelay",1250),R("viewportMargin",10,function(L){return L.refresh()},!0),R("maxHighlightLength",1e4,Ha,!0),R("moveInputWithCursor",!0,function(L,M){M||L.display.input.resetPosition()}),R("tabindex",null,function(L,M){return L.display.input.getField().tabIndex=M||""}),R("autofocus",null),R("direction","ltr",function(L,M){return L.doc.setDirection(M)},!0),R("phrases",null)}function Ql(e,a,R){var L=R&&R!=Da;if(!a!=!L){var M=e.display.dragFunctions,X=a?Be:ht;X(e.display.scroller,"dragstart",M.start),X(e.display.scroller,"dragenter",M.enter),X(e.display.scroller,"dragover",M.over),X(e.display.scroller,"dragleave",M.leave),X(e.display.scroller,"drop",M.drop)}}function ql(e){e.options.lineWrapping?(W(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(y(e.display.wrapper,"CodeMirror-wrap"),qi(e)),Wr(e),Ur(e),nn(e),setTimeout(function(){return Sa(e)},100)}function Nr(e,a){var R=this;if(!(this instanceof Nr))return new Nr(e,a);this.options=a=a?G(a):{},G(Ks,a,!1);var L=a.value;typeof L=="string"?L=new Ti(L,a.mode,null,a.lineSeparator,a.direction):a.mode&&(L.modeOption=a.mode),this.doc=L;var M=new Nr.inputStyles[a.inputStyle](this),X=this.display=new dl(e,L,M,a);X.wrapper.CodeMirror=this,Hs(this),a.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Go(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new re,keySeq:null,specialChars:null},a.autofocus&&!t&&X.input.focus(),T&&w<11&&setTimeout(function(){return R.display.input.reset(!0)},20),Zl(this),Rl(),ba(this),this.curOp.forceUpdate=!0,ts(this,L),a.autofocus&&!t||this.hasFocus()?setTimeout(function(){R.hasFocus()&&!R.state.focused&&vn(R)},20):Hi(this);for(var ce in mo)mo.hasOwnProperty(ce)&&mo[ce](this,a[ce],Da);Yo(this),a.finishInit&&a.finishInit(this);for(var ve=0;ve<No.length;++ve)No[ve](this);Ea(this),f&&a.lineWrapping&&getComputedStyle(X.lineDiv).textRendering=="optimizelegibility"&&(X.lineDiv.style.textRendering="auto")}Nr.defaults=Ks,Nr.optionHandlers=mo;function Zl(e){var a=e.display;Be(a.scroller,"mousedown",ii(e,js)),T&&w<11?Be(a.scroller,"dblclick",ii(e,function(ye){if(Xe(e,ye))return;var Se=In(e,ye);if(!Se||Io(e,ye)||Pn(e.display,ye))return;_e(ye);var Ye=e.findWordAt(Se);so(e.doc,Ye.anchor,Ye.head)})):Be(a.scroller,"dblclick",function(ye){return Xe(e,ye)||_e(ye)}),Be(a.scroller,"contextmenu",function(ye){return Ws(e,ye)}),Be(a.input.getField(),"contextmenu",function(ye){a.scroller.contains(ye.target)||Ws(e,ye)});var R,L={end:0};function M(){a.activeTouch&&(R=setTimeout(function(){return a.activeTouch=null},1e3),L=a.activeTouch,L.end=+new Date)}function X(ye){if(ye.touches.length!=1)return!1;var Se=ye.touches[0];return Se.radiusX<=1&&Se.radiusY<=1}function ce(ye,Se){if(Se.left==null)return!0;var Ye=Se.left-ye.left,et=Se.top-ye.top;return Ye*Ye+et*et>20*20}Be(a.scroller,"touchstart",function(ye){if(!Xe(e,ye)&&!X(ye)&&!Io(e,ye)){a.input.ensurePolled(),clearTimeout(R);var Se=+new Date;a.activeTouch={start:Se,moved:!1,prev:Se-L.end<=300?L:null},ye.touches.length==1&&(a.activeTouch.left=ye.touches[0].pageX,a.activeTouch.top=ye.touches[0].pageY)}}),Be(a.scroller,"touchmove",function(){a.activeTouch&&(a.activeTouch.moved=!0)}),Be(a.scroller,"touchend",function(ye){var Se=a.activeTouch;if(Se&&!Pn(a,ye)&&Se.left!=null&&!Se.moved&&new Date-Se.start<300){var Ye=e.coordsChar(a.activeTouch,"page"),et;!Se.prev||ce(Se,Se.prev)?et=new Er(Ye,Ye):!Se.prev.prev||ce(Se,Se.prev.prev)?et=e.findWordAt(Ye):et=new Er(ot(Ye.line,0),N(e.doc,ot(Ye.line+1,0))),e.setSelection(et.anchor,et.head),e.focus(),_e(ye)}M()}),Be(a.scroller,"touchcancel",M),Be(a.scroller,"scroll",function(){a.scroller.clientHeight&&(Ua(e,a.scroller.scrollTop),ga(e,a.scroller.scrollLeft,!0),Qe(e,"scroll",e))}),Be(a.scroller,"mousewheel",function(ye){return Qo(e,ye)}),Be(a.scroller,"DOMMouseScroll",function(ye){return Qo(e,ye)}),Be(a.wrapper,"scroll",function(){return a.wrapper.scrollTop=a.wrapper.scrollLeft=0}),a.dragFunctions={enter:function(ye){Xe(e,ye)||De(ye)},over:function(ye){Xe(e,ye)||(Ll(e,ye),De(ye))},start:function(ye){return Ol(e,ye)},drop:ii(e,Al),leave:function(ye){Xe(e,ye)||ws(e)}};var ve=a.input.getField();Be(ve,"keyup",function(ye){return Ns.call(e,ye)}),Be(ve,"keydown",ii(e,Is)),Be(ve,"keypress",ii(e,Us)),Be(ve,"focus",function(ye){return vn(e,ye)}),Be(ve,"blur",function(ye){return Hi(e,ye)})}var No=[];Nr.defineInitHook=function(e){return No.push(e)};function to(e,a,R,L){var M=e.doc,X;R==null&&(R="add"),R=="smart"&&(M.mode.indent?X=Pt(e,a).state:R="prev");var ce=e.options.tabSize,ve=Z(M,a),ye=V(ve.text,null,ce);ve.stateAfter&&(ve.stateAfter=null);var Se=ve.text.match(/^\s*/)[0],Ye;if(!L&&!/\S/.test(ve.text))Ye=0,R="not";else if(R=="smart"&&(Ye=M.mode.indent(X,ve.text.slice(Se.length),ve.text),Ye==he||Ye>150)){if(!L)return;R="prev"}R=="prev"?a>M.first?Ye=V(Z(M,a-1).text,null,ce):Ye=0:R=="add"?Ye=ye+e.options.indentUnit:R=="subtract"?Ye=ye-e.options.indentUnit:typeof R=="number"&&(Ye=ye+R),Ye=Math.max(0,Ye);var et="",vt=0;if(e.options.indentWithTabs)for(var dt=Math.floor(Ye/ce);dt;--dt)vt+=ce,et+=" ";if(vt<Ye&&(et+=xe(Ye-vt)),et!=Se)return Aa(M,et,ot(a,0),ot(a,Se.length),"+input"),ve.stateAfter=null,!0;for(var Lt=0;Lt<M.sel.ranges.length;Lt++){var Ft=M.sel.ranges[Lt];if(Ft.head.line==a&&Ft.head.ch<Se.length){var Gt=ot(a,Se.length);Lo(M,Lt,new Er(Gt,Gt));break}}}var Qi=null;function vo(e){Qi=e}function Uo(e,a,R,L,M){var X=e.doc;e.display.shift=!1,L||(L=X.sel);var ce=+new Date-200,ve=M=="paste"||e.state.pasteIncoming>ce,ye=lt(a),Se=null;if(ve&&L.ranges.length>1)if(Qi&&Qi.text.join(`
|
|
|
`)==a){if(L.ranges.length%Qi.text.length==0){Se=[];for(var Ye=0;Ye<Qi.text.length;Ye++)Se.push(X.splitLines(Qi.text[Ye]))}}else ye.length==L.ranges.length&&e.options.pasteLinesPerSelection&&(Se=je(ye,function(en){return[en]}));for(var et=e.curOp.updateInput,vt=L.ranges.length-1;vt>=0;vt--){var dt=L.ranges[vt],Lt=dt.from(),Ft=dt.to();dt.empty()&&(R&&R>0?Lt=ot(Lt.line,Lt.ch-R):e.state.overwrite&&!ve?Ft=ot(Ft.line,Math.min(Z(X,Ft.line).text.length,Ft.ch+Ge(ye).length)):ve&&Qi&&Qi.lineWise&&Qi.text.join(`
|
|
|
`)==ye.join(`
|
|
|
`)&&(Lt=Ft=ot(Lt.line,0)));var Gt={from:Lt,to:Ft,text:Se?Se[vt%Se.length]:ye,origin:M||(ve?"paste":e.state.cutIncoming>ce?"cut":"+input")};Ta(e.doc,Gt),Ht(e,"inputRead",e,Gt)}a&&!ve&&Gs(e,a),Ir(e),e.curOp.updateInput<2&&(e.curOp.updateInput=et),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function zs(e,a){var R=e.clipboardData&&e.clipboardData.getData("Text");if(R)return e.preventDefault(),!a.isReadOnly()&&!a.options.disableInput&&Pi(a,function(){return Uo(a,R,0,null,"paste")}),!0}function Gs(e,a){if(!e.options.electricChars||!e.options.smartIndent)return;for(var R=e.doc.sel,L=R.ranges.length-1;L>=0;L--){var M=R.ranges[L];if(M.head.ch>100||L&&R.ranges[L-1].head.line==M.head.line)continue;var X=e.getModeAt(M.head),ce=!1;if(X.electricChars){for(var ve=0;ve<X.electricChars.length;ve++)if(a.indexOf(X.electricChars.charAt(ve))>-1){ce=to(e,M.head.line,"smart");break}}else X.electricInput&&(X.electricInput.test(Z(e.doc,M.head.line).text.slice(0,M.head.ch))&&(ce=to(e,M.head.line,"smart")));ce&&Ht(e,"electricInput",e,M.head.line)}}function Vs(e){for(var a=[],R=[],L=0;L<e.doc.sel.ranges.length;L++){var M=e.doc.sel.ranges[L].head.line,X={anchor:ot(M,0),head:ot(M+1,0)};R.push(X),a.push(e.getRange(X.anchor,X.head))}return{text:a,ranges:R}}function Xs(e,a,R,L){e.setAttribute("autocorrect",R?"":"off"),e.setAttribute("autocapitalize",L?"":"off"),e.setAttribute("spellcheck",!!a)}function Ys(){var e=_("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),a=_("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return f?e.style.width="1000px":e.setAttribute("wrap","off"),h&&(e.style.border="1px solid black"),Xs(e),a}function eu(e){var a=e.optionHandlers,R=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(L,M){var X=this.options,ce=X[L];if(X[L]==M&&L!="mode")return;X[L]=M,a.hasOwnProperty(L)&&ii(this,a[L])(this,M,ce),Qe(this,"optionChange",this,L)},getOption:function(L){return this.options[L]},getDoc:function(){return this.doc},addKeyMap:function(L,M){this.state.keyMaps[M?"push":"unshift"](fo(L))},removeKeyMap:function(L){for(var M=this.state.keyMaps,X=0;X<M.length;++X)if(M[X]==L||M[X].name==L)return M.splice(X,1),!0},addOverlay:Ei(function(L,M){var X=L.token?L:e.getMode(this.options,L);if(X.startState)throw new Error("Overlays may not be stateful.");We(this.state.overlays,{mode:X,modeSpec:L,opaque:M&&M.opaque,priority:M&&M.priority||0},function(ce){return ce.priority}),this.state.modeGen++,Ur(this)}),removeOverlay:Ei(function(L){for(var M=this.state.overlays,X=0;X<M.length;++X){var ce=M[X].modeSpec;if(ce==L||typeof L=="string"&&ce.name==L){M.splice(X,1),this.state.modeGen++,Ur(this);return}}}),indentLine:Ei(function(L,M,X){typeof M!="string"&&typeof M!="number"&&(M==null?M=this.options.smartIndent?"smart":"prev":M=M?"add":"subtract"),kt(this.doc,L)&&to(this,L,M,X)}),indentSelection:Ei(function(L){for(var M=this.doc.sel.ranges,X=-1,ce=0;ce<M.length;ce++){var ve=M[ce];if(ve.empty())ve.head.line>X&&(to(this,ve.head.line,L,!0),X=ve.head.line,ce==this.doc.sel.primIndex&&Ir(this));else{var ye=ve.from(),Se=ve.to(),Ye=Math.max(X,ye.line);X=Math.min(this.lastLine(),Se.line-(Se.ch?0:1))+1;for(var et=Ye;et<X;++et)to(this,et,L);var vt=this.doc.sel.ranges;ye.ch==0&&M.length==vt.length&&vt[ce].from().ch>0&&Lo(this.doc,ce,new Er(ye,vt[ce].to()),pe)}}}),getTokenAt:function(L,M){return jn(this,L,M)},getLineTokens:function(L,M){return jn(this,ot(L),M,!0)},getTokenTypeAt:function(L){L=N(this.doc,L);var M=St(this,Z(this.doc,L.line)),X=0,ce=(M.length-1)/2,ve=L.ch,ye;if(ve==0)ye=M[2];else for(;;){var Se=X+ce>>1;if((Se?M[Se*2-1]:0)>=ve)ce=Se;else if(M[Se*2+1]<ve)X=Se+1;else{ye=M[Se*2+2];break}}var Ye=ye?ye.indexOf("overlay "):-1;return Ye<0?ye:Ye==0?null:ye.slice(0,Ye-1)},getModeAt:function(L){var M=this.doc.mode;return M.innerMode?e.innerMode(M,this.getTokenAt(L).state).mode:M},getHelper:function(L,M){return this.getHelpers(L,M)[0]},getHelpers:function(L,M){var X=[];if(!R.hasOwnProperty(M))return X;var ce=R[M],ve=this.getModeAt(L);if(typeof ve[M]=="string")ce[ve[M]]&&X.push(ce[ve[M]]);else if(ve[M])for(var ye=0;ye<ve[M].length;ye++){var Se=ce[ve[M][ye]];Se&&X.push(Se)}else ve.helperType&&ce[ve.helperType]?X.push(ce[ve.helperType]):ce[ve.name]&&X.push(ce[ve.name]);for(var Ye=0;Ye<ce._global.length;Ye++){var et=ce._global[Ye];et.pred(ve,this)&&$(X,et.val)==-1&&X.push(et.val)}return X},getStateAfter:function(L,M){var X=this.doc;return L=ie(X,L==null?X.first+X.size-1:L),Pt(this,L+1,M).state},cursorCoords:function(L,M){var X,ce=this.doc.sel.primary();return L==null?X=ce.head:typeof L=="object"?X=N(this.doc,L):X=L?ce.from():ce.to(),Vn(this,X,M||"page")},charCoords:function(L,M){return Tn(this,N(this.doc,L),M||"page")},coordsChar:function(L,M){return L=Mn(this,L,M||"page"),kr(this,L.left,L.top)},lineAtHeight:function(L,M){return L=Mn(this,{top:L,left:0},M||"page").top,at(this.doc,L+this.display.viewOffset)},heightAtLine:function(L,M,X){var ce=!1,ve;if(typeof L=="number"){var ye=this.doc.first+this.doc.size-1;L<this.doc.first?L=this.doc.first:L>ye&&(L=ye,ce=!0),ve=Z(this.doc,L)}else ve=L;return bn(this,ve,{top:0,left:0},M||"page",X||ce).top+(ce?this.doc.height-Ci(ve):0)},defaultTextHeight:function(){return Vi(this.display)},defaultCharWidth:function(){return Xn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(L,M,X,ce,ve){var ye=this.display;L=Vn(this,N(this.doc,L));var Se=L.bottom,Ye=L.left;if(M.style.position="absolute",M.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(M),ye.sizer.appendChild(M),ce=="over")Se=L.top;else if(ce=="above"||ce=="near"){var et=Math.max(ye.wrapper.clientHeight,this.doc.height),vt=Math.max(ye.sizer.clientWidth,ye.lineSpace.clientWidth);(ce=="above"||L.bottom+M.offsetHeight>et)&&L.top>M.offsetHeight?Se=L.top-M.offsetHeight:L.bottom+M.offsetHeight<=et&&(Se=L.bottom),Ye+M.offsetWidth>vt&&(Ye=vt-M.offsetWidth)}M.style.top=Se+"px",M.style.left=M.style.right="",ve=="right"?(Ye=ye.sizer.clientWidth-M.offsetWidth,M.style.right="0px"):(ve=="left"?Ye=0:ve=="middle"&&(Ye=(ye.sizer.clientWidth-M.offsetWidth)/2),M.style.left=Ye+"px"),X&&la(this,{left:Ye,top:Se,right:Ye+M.offsetWidth,bottom:Se+M.offsetHeight})},triggerOnKeyDown:Ei(Is),triggerOnKeyPress:Ei(Us),triggerOnKeyUp:Ns,triggerOnMouseDown:Ei(js),execCommand:function(L){if(Qa.hasOwnProperty(L))return Qa[L].call(null,this)},triggerElectric:Ei(function(L){Gs(this,L)}),findPosH:function(L,M,X,ce){var ve=1;M<0&&(ve=-1,M=-M);for(var ye=N(this.doc,L),Se=0;Se<M&&!(ye=jo(this.doc,ye,ve,X,ce),ye.hitSide);++Se);return ye},moveH:Ei(function(L,M){var X=this;this.extendSelectionsBy(function(ce){return X.display.shift||X.doc.extend||ce.empty()?jo(X.doc,ce.head,L,M,X.options.rtlMoveVisually):L<0?ce.from():ce.to()},we)}),deleteH:Ei(function(L,M){var X=this.doc.sel,ce=this.doc;X.somethingSelected()?ce.replaceSelection("",null,"+delete"):Ra(this,function(ve){var ye=jo(ce,ve.head,L,M,!1);return L<0?{from:ye,to:ve.head}:{from:ve.head,to:ye}})}),findPosV:function(L,M,X,ce){var ve=1,ye=ce;M<0&&(ve=-1,M=-M);for(var Se=N(this.doc,L),Ye=0;Ye<M;++Ye){var et=Vn(this,Se,"div");if(ye==null?ye=et.left:et.left=ye,Se=$s(this,et,ve,X),Se.hitSide)break}return Se},moveV:Ei(function(L,M){var X=this,ce=this.doc,ve=[],ye=!this.display.shift&&!ce.extend&&ce.sel.somethingSelected();if(ce.extendSelectionsBy(function(Ye){if(ye)return L<0?Ye.from():Ye.to();var et=Vn(X,Ye.head,"div");Ye.goalColumn!=null&&(et.left=Ye.goalColumn),ve.push(et.left);var vt=$s(X,et,L,M);return M=="page"&&Ye==ce.sel.primary()&&Ia(X,Tn(X,vt,"div").top-et.top),vt},we),ve.length)for(var Se=0;Se<ce.sel.ranges.length;Se++)ce.sel.ranges[Se].goalColumn=ve[Se]}),findWordAt:function(L){var M=this.doc,X=Z(M,L.line).text,ce=L.ch,ve=L.ch;if(X){var ye=this.getHelper(L,"wordChars");(L.sticky=="before"||ve==X.length)&&ce?--ce:++ve;for(var Se=X.charAt(ce),Ye=Ie(Se,ye)?function(et){return Ie(et,ye)}:/\s/.test(Se)?function(et){return/\s/.test(et)}:function(et){return!/\s/.test(et)&&!Ie(et)};ce>0&&Ye(X.charAt(ce-1));)--ce;for(;ve<X.length&&Ye(X.charAt(ve));)++ve}return new Er(ot(L.line,ce),ot(L.line,ve))},toggleOverwrite:function(L){if(L!=null&&L==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?W(this.display.cursorDiv,"CodeMirror-overwrite"):y(this.display.cursorDiv,"CodeMirror-overwrite"),Qe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==I()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ei(function(L,M){Na(this,L,M)}),getScrollInfo:function(){var L=this.display.scroller;return{left:L.scrollLeft,top:L.scrollTop,height:L.scrollHeight-dr(this)-this.display.barHeight,width:L.scrollWidth-dr(this)-this.display.barWidth,clientHeight:xr(this),clientWidth:vr(this)}},scrollIntoView:Ei(function(L,M){L==null?(L={from:this.doc.sel.primary().head,to:null},M==null&&(M=this.options.cursorScrollMargin)):typeof L=="number"?L={from:ot(L,0),to:null}:L.from==null&&(L={from:L,to:null}),L.to||(L.to=L.from),L.margin=M||0,L.from.line!=null?Qs(this,L):Wo(this,L.from,L.to,L.margin)}),setSize:Ei(function(L,M){var X=this,ce=function(ye){return typeof ye=="number"||/^\d+$/.test(String(ye))?ye+"px":ye};L!=null&&(this.display.wrapper.style.width=ce(L)),M!=null&&(this.display.wrapper.style.height=ce(M)),this.options.lineWrapping&&qt(this);var ve=this.display.viewFrom;this.doc.iter(ve,this.display.viewTo,function(ye){if(ye.widgets){for(var Se=0;Se<ye.widgets.length;Se++)if(ye.widgets[Se].noHScroll){Jr(X,ve,"widget");break}}++ve}),this.curOp.forceUpdate=!0,Qe(this,"refresh",this)}),operation:function(L){return Pi(this,L)},startOperation:function(){return ba(this)},endOperation:function(){return Ea(this)},refresh:Ei(function(){var L=this.display.cachedTextHeight;Ur(this),this.curOp.forceUpdate=!0,nn(this),Na(this,this.doc.scrollLeft,this.doc.scrollTop),_o(this.display),(L==null||Math.abs(L-Vi(this.display))>.5||this.options.lineWrapping)&&Wr(this),Qe(this,"refresh",this)}),swapDoc:Ei(function(L){var M=this.doc;return M.cm=null,this.state.selectingText&&this.state.selectingText(),ts(this,L),nn(this),this.display.input.reset(),Na(this,L.scrollLeft,L.scrollTop),this.curOp.forceScroll=!0,Ht(this,"swapDoc",this,M),M}),phrase:function(L){var M=this.options.phrases;return M&&Object.prototype.hasOwnProperty.call(M,L)?M[L]:L},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ue(e),e.registerHelper=function(L,M,X){R.hasOwnProperty(L)||(R[L]=e[L]={_global:[]}),R[L][M]=X},e.registerGlobalHelper=function(L,M,X,ce){e.registerHelper(L,M,ce),R[L]._global.push({pred:X,val:ce})}}function jo(e,a,R,L,M){var X=a,ce=R,ve=Z(e,a.line),ye=M&&e.direction=="rtl"?-R:R;function Se(){var on=a.line+ye;return on<e.first||on>=e.first+e.size?!1:(a=new ot(on,a.ch,a.sticky),ve=Z(e,on))}function Ye(on){var tn;if(L=="codepoint"){var ln=ve.text.charCodeAt(a.ch+(L>0?0:-1));isNaN(ln)?tn=null:tn=new ot(a.line,Math.max(0,Math.min(ve.text.length,a.ch+R*(ln>=55296&&ln<56320?2:1))),-R)}else M?tn=Il(e.cm,ve,a,R):tn=Do(ve,a,R);if(tn==null)if(!on&&Se())a=Po(M,e.cm,ve,a.line,ye);else return!1;else a=tn;return!0}if(L=="char"||L=="codepoint")Ye();else if(L=="column")Ye(!0);else if(L=="word"||L=="group")for(var et=null,vt=L=="group",dt=e.cm&&e.cm.getHelper(a,"wordChars"),Lt=!0;!(R<0&&!Ye(!Lt));Lt=!1){var Ft=ve.text.charAt(a.ch)||`
|
|
|
`,Gt=Ie(Ft,dt)?"w":vt&&Ft==`
|
|
|
`?"n":!vt||/\s/.test(Ft)?null:"p";if(vt&&!Lt&&!Gt&&(Gt="s"),et&&et!=Gt){R<0&&(R=1,Ye(),a.sticky="after");break}if(Gt&&(et=Gt),R>0&&!Ye(!Lt))break}var en=uo(e,a,X,ce,!0);return Kt(X,en)&&(en.hitSide=!0),en}function $s(e,a,R,L){var M=e.doc,X=a.left,ce;if(L=="page"){var ve=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ye=Math.max(ve-.5*Vi(e.display),3);ce=(R>0?a.bottom:a.top)+R*ye}else L=="line"&&(ce=R>0?a.bottom+3:a.top-3);for(var Se;!(Se=kr(e,X,ce),!Se.outside);){if(R<0?ce<=0:ce>=M.height){Se.hitSide=!0;break}ce+=R*5}return Se}var Sr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new re,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Sr.prototype.init=function(e){var a=this,R=this,L=R.cm,M=R.div=e.lineDiv;Xs(M,L.options.spellcheck,L.options.autocorrect,L.options.autocapitalize);function X(ve){for(var ye=ve.target;ye;ye=ye.parentNode){if(ye==M)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ye.className))break}return!1}Be(M,"paste",function(ve){if(!X(ve)||Xe(L,ve)||zs(ve,L))return;w<=11&&setTimeout(ii(L,function(){return a.updateFromDOM()}),20)}),Be(M,"compositionstart",function(ve){a.composing={data:ve.data,done:!1}}),Be(M,"compositionupdate",function(ve){a.composing||(a.composing={data:ve.data,done:!1})}),Be(M,"compositionend",function(ve){a.composing&&(ve.data!=a.composing.data&&a.readFromDOMSoon(),a.composing.done=!0)}),Be(M,"touchstart",function(){return R.forceCompositionEnd()}),Be(M,"input",function(){a.composing||a.readFromDOMSoon()});function ce(ve){if(!X(ve)||Xe(L,ve))return;if(L.somethingSelected())vo({lineWise:!1,text:L.getSelections()}),ve.type=="cut"&&L.replaceSelection("",null,"cut");else if(L.options.lineWiseCopyCut){var ye=Vs(L);vo({lineWise:!0,text:ye.text}),ve.type=="cut"&&L.operation(function(){L.setSelections(ye.ranges,0,pe),L.replaceSelection("",null,"cut")})}else return;if(ve.clipboardData){ve.clipboardData.clearData();var Se=Qi.text.join(`
|
|
|
`);if(ve.clipboardData.setData("Text",Se),ve.clipboardData.getData("Text")==Se){ve.preventDefault();return}}var Ye=Ys(),et=Ye.firstChild;L.display.lineSpace.insertBefore(Ye,L.display.lineSpace.firstChild),et.value=Qi.text.join(`
|
|
|
`);var vt=document.activeElement;te(et),setTimeout(function(){L.display.lineSpace.removeChild(Ye),vt.focus(),vt==M&&R.showPrimarySelection()},50)}Be(M,"copy",ce),Be(M,"cut",ce)},Sr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Sr.prototype.prepareSelection=function(){var e=Yn(this.cm,!1);return e.focus=document.activeElement==this.div,e},Sr.prototype.showSelection=function(e,a){if(!e||!this.cm.display.view.length)return;(e.focus||a)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Sr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Sr.prototype.showPrimarySelection=function(){var e=this.getSelection(),a=this.cm,R=a.doc.sel.primary(),L=R.from(),M=R.to();if(a.display.viewTo==a.display.viewFrom||L.line>=a.display.viewTo||M.line<a.display.viewFrom){e.removeAllRanges();return}var X=go(a,e.anchorNode,e.anchorOffset),ce=go(a,e.focusNode,e.focusOffset);if(X&&!X.bad&&ce&&!ce.bad&&wt(Vt(X,ce),L)==0&&wt(Qt(X,ce),M)==0)return;var ve=a.display.view,ye=L.line>=a.display.viewFrom&&Js(a,L)||{node:ve[0].measure.map[2],offset:0},Se=M.line<a.display.viewTo&&Js(a,M);if(!Se){var Ye=ve[ve.length-1].measure,et=Ye.maps?Ye.maps[Ye.maps.length-1]:Ye.map;Se={node:et[et.length-1],offset:et[et.length-2]-et[et.length-3]}}if(!ye||!Se){e.removeAllRanges();return}var vt=e.rangeCount&&e.getRangeAt(0),dt;try{dt=A(ye.node,ye.offset,Se.offset,Se.node)}catch(Lt){}dt&&(!j&&a.state.focused?(e.collapse(ye.node,ye.offset),dt.collapsed||(e.removeAllRanges(),e.addRange(dt))):(e.removeAllRanges(),e.addRange(dt)),vt&&e.anchorNode==null?e.addRange(vt):j&&this.startGracePeriod()),this.rememberSelection()},Sr.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Sr.prototype.showMultipleSelections=function(e){d(this.cm.display.cursorDiv,e.cursors),d(this.cm.display.selectionDiv,e.selection)},Sr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Sr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var a=e.getRangeAt(0).commonAncestorContainer;return P(this.div,a)},Sr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Sr.prototype.blur=function(){this.div.blur()},Sr.prototype.getField=function(){return this.div},Sr.prototype.supportsTouch=function(){return!0},Sr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Pi(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function a(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,a))}this.polling.set(this.cm.options.pollInterval,a)},Sr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Sr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),a=this.cm;if(r&&u&&this.cm.display.gutterSpecs.length&&tu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var R=go(a,e.anchorNode,e.anchorOffset),L=go(a,e.focusNode,e.focusOffset);R&&L&&Pi(a,function(){fi(a.doc,ua(R,L),pe),(R.bad||L.bad)&&(a.curOp.selectionChanged=!0)})},Sr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,a=e.display,R=e.doc.sel.primary(),L=R.from(),M=R.to();if(L.ch==0&&L.line>e.firstLine()&&(L=ot(L.line-1,Z(e.doc,L.line-1).length)),M.ch==Z(e.doc,M.line).text.length&&M.line<e.lastLine()&&(M=ot(M.line+1,0)),L.line<a.viewFrom||M.line>a.viewTo-1)return!1;var X,ce,ve;L.line==a.viewFrom||(X=ri(e,L.line))==0?(ce=Je(a.view[0].line),ve=a.view[0].node):(ce=Je(a.view[X].line),ve=a.view[X-1].node.nextSibling);var ye=ri(e,M.line),Se,Ye;if(ye==a.view.length-1?(Se=a.viewTo-1,Ye=a.lineDiv.lastChild):(Se=Je(a.view[ye+1].line)-1,Ye=a.view[ye+1].node.previousSibling),!ve)return!1;for(var et=e.doc.splitLines(nu(e,ve,Ye,ce,Se)),vt=oe(e.doc,ot(ce,0),ot(Se,Z(e.doc,Se).text.length));et.length>1&&vt.length>1;)if(Ge(et)==Ge(vt))et.pop(),vt.pop(),Se--;else if(et[0]==vt[0])et.shift(),vt.shift(),ce++;else break;for(var dt=0,Lt=0,Ft=et[0],Gt=vt[0],en=Math.min(Ft.length,Gt.length);dt<en&&Ft.charCodeAt(dt)==Gt.charCodeAt(dt);)++dt;for(var on=Ge(et),tn=Ge(vt),ln=Math.min(on.length-(et.length==1?dt:0),tn.length-(vt.length==1?dt:0));Lt<ln&&on.charCodeAt(on.length-Lt-1)==tn.charCodeAt(tn.length-Lt-1);)++Lt;if(et.length==1&&vt.length==1&&ce==L.line)for(;dt&&dt>L.ch&&on.charCodeAt(on.length-Lt-1)==tn.charCodeAt(tn.length-Lt-1);)dt--,Lt++;et[et.length-1]=on.slice(0,on.length-Lt).replace(/^\u200b+/,""),et[0]=et[0].slice(dt).replace(/\u200b+$/,"");var On=ot(ce,dt),En=ot(Se,vt.length?Ge(vt).length-Lt:0);if(et.length>1||et[0]||wt(On,En))return Aa(e.doc,et,On,En,"+input"),!0},Sr.prototype.ensurePolled=function(){this.forceCompositionEnd()},Sr.prototype.reset=function(){this.forceCompositionEnd()},Sr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Sr.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Sr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Pi(this.cm,function(){return Ur(e.cm)})},Sr.prototype.setUneditable=function(e){e.contentEditable="false"},Sr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ii(this.cm,Uo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Sr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Sr.prototype.onContextMenu=function(){},Sr.prototype.resetPosition=function(){},Sr.prototype.needsContentAttribute=!0;function Js(e,a){var R=gn(e,a.line);if(!R||R.hidden)return null;var L=Z(e.doc,a.line),M=fr(R,L,a.line),X=ct(L,e.doc.direction),ce="left";if(X){var ve=be(X,a.ch);ce=ve%2?"right":"left"}var ye=Jn(M.map,a.ch,ce);return ye.offset=ye.collapse=="right"?ye.end:ye.start,ye}function tu(e){for(var a=e;a;a=a.parentNode)if(/CodeMirror-gutter-wrapper/.test(a.className))return!0;return!1}function Pa(e,a){return a&&(e.bad=!0),e}function nu(e,a,R,L,M){var X="",ce=!1,ve=e.doc.lineSeparator(),ye=!1;function Se(dt){return function(Lt){return Lt.id==dt}}function Ye(){ce&&(X+=ve,ye&&(X+=ve),ce=ye=!1)}function et(dt){dt&&(Ye(),X+=dt)}function vt(dt){if(dt.nodeType==1){var Lt=dt.getAttribute("cm-text");if(Lt){et(Lt);return}var Ft=dt.getAttribute("cm-marker"),Gt;if(Ft){var en=e.findMarks(ot(L,0),ot(M+1,0),Se(+Ft));en.length&&(Gt=en[0].find(0))&&et(oe(e.doc,Gt.from,Gt.to).join(ve));return}if(dt.getAttribute("contenteditable")=="false")return;var on=/^(pre|div|p|li|table|br)$/i.test(dt.nodeName);if(!/^br$/i.test(dt.nodeName)&&dt.textContent.length==0)return;on&&Ye();for(var tn=0;tn<dt.childNodes.length;tn++)vt(dt.childNodes[tn]);/^(pre|p)$/i.test(dt.nodeName)&&(ye=!0),on&&(ce=!0)}else dt.nodeType==3&&et(dt.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(vt(a),a==R);)a=a.nextSibling,ye=!1;return X}function go(e,a,R){var L;if(a==e.display.lineDiv){if(L=e.display.lineDiv.childNodes[R],!L)return Pa(e.clipPos(ot(e.display.viewTo-1)),!0);a=null,R=0}else for(L=a;;L=L.parentNode){if(!L||L==e.display.lineDiv)return null;if(L.parentNode&&L.parentNode==e.display.lineDiv)break}for(var M=0;M<e.display.view.length;M++){var X=e.display.view[M];if(X.node==L)return ru(X,a,R)}}function ru(e,a,R){var L=e.text.firstChild,M=!1;if(!a||!P(L,a))return Pa(ot(Je(e.line),0),!0);if(a==L&&(M=!0,a=L.childNodes[R],R=0,!a)){var X=e.rest?Ge(e.rest):e.line;return Pa(ot(Je(X),X.text.length),M)}var ce=a.nodeType==3?a:null,ve=a;for(!ce&&a.childNodes.length==1&&a.firstChild.nodeType==3&&(ce=a.firstChild,R&&(R=ce.nodeValue.length));ve.parentNode!=L;)ve=ve.parentNode;var ye=e.measure,Se=ye.maps;function Ye(Gt,en,on){for(var tn=-1;tn<(Se?Se.length:0);tn++)for(var ln=tn<0?ye.map:Se[tn],On=0;On<ln.length;On+=3){var En=ln[On+2];if(En==Gt||En==en){var qn=Je(tn<0?e.line:e.rest[tn]),Rr=ln[On]+on;return(on<0||En!=Gt)&&(Rr=ln[On+(on?1:0)]),ot(qn,Rr)}}}var et=Ye(ce,ve,R);if(et)return Pa(et,M);for(var vt=ve.nextSibling,dt=ce?ce.nodeValue.length-R:0;vt;vt=vt.nextSibling){if(et=Ye(vt,vt.firstChild,0),et)return Pa(ot(et.line,et.ch-dt),M);dt+=vt.textContent.length}for(var Lt=ve.previousSibling,Ft=R;Lt;Lt=Lt.previousSibling){if(et=Ye(Lt,Lt.firstChild,-1),et)return Pa(ot(et.line,et.ch+Ft),M);Ft+=Lt.textContent.length}}var Xr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new re,this.hasSelection=!1,this.composing=null};Xr.prototype.init=function(e){var a=this,R=this,L=this.cm;this.createField(e);var M=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),h&&(M.style.width="0px"),Be(M,"input",function(){T&&w>=9&&a.hasSelection&&(a.hasSelection=null),R.poll()}),Be(M,"paste",function(ce){if(Xe(L,ce)||zs(ce,L))return;L.state.pasteIncoming=+new Date,R.fastPoll()});function X(ce){if(Xe(L,ce))return;if(L.somethingSelected())vo({lineWise:!1,text:L.getSelections()});else if(L.options.lineWiseCopyCut){var ve=Vs(L);vo({lineWise:!0,text:ve.text}),ce.type=="cut"?L.setSelections(ve.ranges,null,pe):(R.prevInput="",M.value=ve.text.join(`
|
|
|
`),te(M))}else return;ce.type=="cut"&&(L.state.cutIncoming=+new Date)}Be(M,"cut",X),Be(M,"copy",X),Be(e.scroller,"paste",function(ce){if(Pn(e,ce)||Xe(L,ce))return;if(!M.dispatchEvent){L.state.pasteIncoming=+new Date,R.focus();return}var ve=new Event("paste");ve.clipboardData=ce.clipboardData,M.dispatchEvent(ve)}),Be(e.lineSpace,"selectstart",function(ce){Pn(e,ce)||_e(ce)}),Be(M,"compositionstart",function(){var ce=L.getCursor("from");R.composing&&R.composing.range.clear(),R.composing={start:ce,range:L.markText(ce,L.getCursor("to"),{className:"CodeMirror-composing"})}}),Be(M,"compositionend",function(){R.composing&&(R.poll(),R.composing.range.clear(),R.composing=null)})},Xr.prototype.createField=function(e){this.wrapper=Ys(),this.textarea=this.wrapper.firstChild},Xr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Xr.prototype.prepareSelection=function(){var e=this.cm,a=e.display,R=e.doc,L=Yn(e);if(e.options.moveInputWithCursor){var M=Vn(e,R.sel.primary().head,"div"),X=a.wrapper.getBoundingClientRect(),ce=a.lineDiv.getBoundingClientRect();L.teTop=Math.max(0,Math.min(a.wrapper.clientHeight-10,M.top+ce.top-X.top)),L.teLeft=Math.max(0,Math.min(a.wrapper.clientWidth-10,M.left+ce.left-X.left))}return L},Xr.prototype.showSelection=function(e){var a=this.cm,R=a.display;d(R.cursorDiv,e.cursors),d(R.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Xr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var a=this.cm;if(a.somethingSelected()){this.prevInput="";var R=a.getSelection();this.textarea.value=R,a.state.focused&&te(this.textarea),T&&w>=9&&(this.hasSelection=R)}else e||(this.prevInput=this.textarea.value="",T&&w>=9&&(this.hasSelection=null))},Xr.prototype.getField=function(){return this.textarea},Xr.prototype.supportsTouch=function(){return!1},Xr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!t||I()!=this.textarea))try{this.textarea.focus()}catch(e){}},Xr.prototype.blur=function(){this.textarea.blur()},Xr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Xr.prototype.receivedFocus=function(){this.slowPoll()},Xr.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Xr.prototype.fastPoll=function(){var e=!1,a=this;a.pollingFast=!0;function R(){var L=a.poll();!L&&!e?(e=!0,a.polling.set(60,R)):(a.pollingFast=!1,a.slowPoll())}a.polling.set(20,R)},Xr.prototype.poll=function(){var e=this,a=this.cm,R=this.textarea,L=this.prevInput;if(this.contextMenuPending||!a.state.focused||pt(R)&&!L&&!this.composing||a.isReadOnly()||a.options.disableInput||a.state.keySeq)return!1;var M=R.value;if(M==L&&!a.somethingSelected())return!1;if(T&&w>=9&&this.hasSelection===M||n&&/[\uf700-\uf7ff]/.test(M))return a.display.input.reset(),!1;if(a.doc.sel==a.display.selForContextMenu){var X=M.charCodeAt(0);if(X==8203&&!L&&(L="\u200B"),X==8666)return this.reset(),this.cm.execCommand("undo")}for(var ce=0,ve=Math.min(L.length,M.length);ce<ve&&L.charCodeAt(ce)==M.charCodeAt(ce);)++ce;return Pi(a,function(){Uo(a,M.slice(ce),L.length-ce,null,e.composing?"*compose":null),M.length>1e3||M.indexOf(`
|
|
|
`)>-1?R.value=e.prevInput="":e.prevInput=M,e.composing&&(e.composing.range.clear(),e.composing.range=a.markText(e.composing.start,a.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Xr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Xr.prototype.onKeyPress=function(){T&&w>=9&&(this.hasSelection=null),this.fastPoll()},Xr.prototype.onContextMenu=function(e){var a=this,R=a.cm,L=R.display,M=a.textarea;a.contextMenuPending&&a.contextMenuPending();var X=In(R,e),ce=L.scroller.scrollTop;if(!X||o)return;var ve=R.options.resetSelectionOnContextMenu;ve&&R.doc.sel.contains(X)==-1&&ii(R,fi)(R.doc,ua(X),pe);var ye=M.style.cssText,Se=a.wrapper.style.cssText,Ye=a.wrapper.offsetParent.getBoundingClientRect();a.wrapper.style.cssText="position: static",M.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
top: `+(e.clientY-Ye.top-5)+"px; left: "+(e.clientX-Ye.left-5)+`px;
|
|
|
z-index: 1000; background: `+(T?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var et;f&&(et=window.scrollY),L.input.focus(),f&&window.scrollTo(null,et),L.input.reset(),R.somethingSelected()||(M.value=a.prevInput=" "),a.contextMenuPending=dt,L.selForContextMenu=R.doc.sel,clearTimeout(L.detectingSelectAll);function vt(){if(M.selectionStart!=null){var Ft=R.somethingSelected(),Gt="\u200B"+(Ft?M.value:"");M.value="\u21DA",M.value=Gt,a.prevInput=Ft?"":"\u200B",M.selectionStart=1,M.selectionEnd=Gt.length,L.selForContextMenu=R.doc.sel}}function dt(){if(a.contextMenuPending!=dt)return;if(a.contextMenuPending=!1,a.wrapper.style.cssText=Se,M.style.cssText=ye,T&&w<9&&L.scrollbars.setScrollTop(L.scroller.scrollTop=ce),M.selectionStart!=null){(!T||T&&w<9)&&vt();var Ft=0,Gt=function(){L.selForContextMenu==R.doc.sel&&M.selectionStart==0&&M.selectionEnd>0&&a.prevInput=="\u200B"?ii(R,ps)(R):Ft++<10?L.detectingSelectAll=setTimeout(Gt,500):(L.selForContextMenu=null,L.input.reset())};L.detectingSelectAll=setTimeout(Gt,200)}}if(T&&w>=9&&vt(),E){De(e);var Lt=function(){ht(window,"mouseup",Lt),setTimeout(dt,20)};Be(window,"mouseup",Lt)}else setTimeout(dt,50)},Xr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Xr.prototype.setUneditable=function(){},Xr.prototype.needsContentAttribute=!1;function iu(e,a){if(a=a?G(a):{},a.value=e.value,!a.tabindex&&e.tabIndex&&(a.tabindex=e.tabIndex),!a.placeholder&&e.placeholder&&(a.placeholder=e.placeholder),a.autofocus==null){var R=I();a.autofocus=R==e||e.getAttribute("autofocus")!=null&&R==document.body}function L(){e.value=ve.getValue()}var M;if(e.form&&(Be(e.form,"submit",L),!a.leaveSubmitMethodAlone)){var X=e.form;M=X.submit;try{var ce=X.submit=function(){L(),X.submit=M,X.submit(),X.submit=ce}}catch(ye){}}a.finishInit=function(ye){ye.save=L,ye.getTextArea=function(){return e},ye.toTextArea=function(){ye.toTextArea=isNaN,L(),e.parentNode.removeChild(ye.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",L),!a.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=M))}},e.style.display="none";var ve=Nr(function(ye){return e.parentNode.insertBefore(ye,e.nextSibling)},a);return ve}function au(e){e.off=ht,e.on=Be,e.wheelEventPixels=hl,e.Doc=Ti,e.splitLines=lt,e.countColumn=V,e.findColumn=Me,e.isWordChar=Oe,e.Pass=he,e.signal=Qe,e.Line=yi,e.changeEnd=ca,e.scrollbarModel=zo,e.Pos=ot,e.cmpPos=wt,e.modes=yt,e.mimeModes=st,e.resolveMode=it,e.getMode=mt,e.modeExtensions=bt,e.extendMode=At,e.copyState=Xt,e.startState=ge,e.innerMode=Ae,e.commands=Qa,e.keyMap=ra,e.keyName=Rs,e.isModifierKey=Os,e.lookupKey=La,e.normalizeKeyMap=Ml,e.StringStream=z,e.SharedTextMarker=Ya,e.TextMarker=ha,e.LineWidget=Xa,e.e_preventDefault=_e,e.e_stopPropagation=Ce,e.e_stop=De,e.addClass=W,e.contains=P,e.rmClass=y,e.keyNames=fa}Jl(Nr),eu(Nr);var ou="iter insert remove copy getEditor constructor".split(" ");for(var yo in Ti.prototype)Ti.prototype.hasOwnProperty(yo)&&$(ou,yo)<0&&(Nr.prototype[yo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ti.prototype[yo]));return Ue(Ti),Nr.inputStyles={textarea:Xr,contenteditable:Sr},Nr.defineMode=function(e){!Nr.defaults.mode&&e!="null"&&(Nr.defaults.mode=e),Nt.apply(this,arguments)},Nr.defineMIME=Ut,Nr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Nr.defineMIME("text/plain","null"),Nr.defineExtension=function(e,a){Nr.prototype[e]=a},Nr.defineDocExtension=function(e,a){Ti.prototype[e]=a},Nr.fromTextArea=iu,au(Nr),Nr.version="5.58.2",Nr})},W7jJ:function(nt,Le,F){"use strict";F.r(Le);var ue=F("0Owb"),Q=F("PpiC"),j=F("OaEy"),S=F("2fM7"),D=F("T2oS"),x=F("W9HT"),T=F("miYZ"),w=F("tsqr"),f=F("2qtc"),p=F("kLXV"),u=F("9og8"),o=F("tJVT"),i=F("k1fw"),l=F("aHsQ"),s=F("sGsY"),h=F("WmNS"),r=F.n(h),t=F("q1tI"),n=F.n(t),c=F("Fvcw"),m=F("GIiI"),v=F("Ty5D"),b=F("9kvl"),E=F("55Ip"),g=F("7qur"),y=F("cDPC"),C=F("m3rI"),d=F("RCxd"),_=F("EHPI"),O=F("J66h"),A=F("uMZB"),P=F.n(A),I=F("sNtx"),W=F("RpDr"),K=F("+L6B"),te=F("2/Rp"),H=F("y8nQ"),G=F("Vl3Y"),V=F("5NDa"),re=F("5rEg"),$=re.a.TextArea,ne=5e3,he=function(ft){var gt=ft.callback,Rt=ft.onCancel,Ht=ft.notes;function mn(fn){gt(fn)}return n.a.createElement(G.a,{className:"note-form-panel",onFinish:mn,initialValues:{notes:Ht}},n.a.createElement(G.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:ne,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(ne)}]},n.a.createElement($,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),n.a.createElement(G.a.Item,{style:{textAlign:"right"}},n.a.createElement(te.a,{type:"ghost",onClick:Rt,style:{marginRight:10}}," \u53D6\u6D88 "),n.a.createElement(te.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},pe=F("ZsLC"),Te=F.n(pe),we=F("DjyN"),Me=F("NUBc"),Ee=F("g9YV"),xe=F("wCAj"),Ge=F("Hw79"),je=F.n(Ge),We=F("ye1Q"),ze=F("lfch"),de=F("bdLU"),le=F("1vsH"),Oe=F("wd/R"),Ie=F.n(Oe),qe=xe.a.Column,ee=function(ft){var gt=ft.submitResult,Rt=ft.submitting,Ht=ft.submitRecords,mn=ft.page,fn=ft.onPageChange,Ct=ft.topicId,_t=gt||{},Zt=_t.status,Tt=_t.id,sn=_t.input,Wt=_t.output,dn=_t.expected_output,$n=_t.is_file,Dn=_t.input_file_url,_n=_t.output_file_url,er=_t.expected_output_file_url,Rn=_t.error_msg,Pn=Ht||{},Gn=Pn.records,Tr=Pn.records_count,ir=Object(v.i)();function dr(){$n?navigator.clipboard.writeText(O.Base64.decode(Rn)).then(function(){w.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(O.Base64.decode(Wt)).then(function(){w.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return n.a.createElement(x.a,{spinning:Rt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:n.a.createElement(We.a,{style:{fontSize:24},spin:!0})},Tt?n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:je.a.info},n.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",n.a.createElement("span",{className:Zt===de.a.OK?"c-green":"c-red"},W.a[Zt])),n.a.createElement("li",{className:je.a.error},n.a.createElement("a",{onClick:dr},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",n.a.createElement(ze.a,null)," ")),n.a.createElement("li",null,n.a.createElement(E.a,{to:"/problems/".concat(Ct,"/record-detail/").concat(Tt,"?backId=").concat(ir==null?void 0:ir.save_identifier)},"\u663E\u793A\u8BE6\u60C5 > "))),Zt!==de.a.OK?n.a.createElement(n.a.Fragment,null,n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),n.a.createElement("pre",null,!$n&&sn,$n&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(le.w)(Dn,sn)}},sn)),n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,(Zt===4||Zt===5)&&O.Base64.decode(Rn),Zt!=4&&Zt!=5&&($n?n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(le.w)(_n,Wt)}},Wt):O.Base64.decode(Wt))),n.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,!$n&&O.Base64.decode(dn),$n&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(le.w)(er,dn)}},dn))):null):null,(Gn==null?void 0:Gn.length)>0?n.a.createElement(xe.a,{dataSource:Gn,rowKey:"id",pagination:!1},n.a.createElement(qe,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(xr,ar){return n.a.createElement("span",null," ",Ie()(xr).format("YYYY-MM-DD HH:mm:ss"))}}),n.a.createElement(qe,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(xr,ar){var fr;return n.a.createElement(E.a,{className:xr===0?"c-green":"c-red",to:"/problems/".concat(Ct,"/record-detail/").concat(ar.id,"?backId=").concat(ir==null?void 0:ir.save_identifier)},(fr=W.a[xr])===null||fr===void 0?void 0:fr.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),n.a.createElement(qe,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),n.a.createElement(qe,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),n.a.createElement(qe,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,Tr>15?n.a.createElement(Me.a,{className:je.a.pagination,current:mn,pageSize:15,total:Tr,onChange:fn}):null)},k=F("BdwD"),U=F("DYRE"),q=F("zeV3"),Y=F("+BJd"),J=F("mr32"),be=F("TcMa"),ke=F.n(be),ct=F("9Bee"),He={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},Be=function(ft){var gt=ft.hack,Rt=ft.onTriggerPraise,Ht=ft.toDiscuss,mn=gt.language,fn=gt.difficulty,Ct=gt.time_limit,_t=gt.username,Zt=gt.user_path,Tt=gt.user_praise,sn=gt.comments_count,Wt=gt.praises_count,dn=gt.description,$n=gt.pass_count,Dn=gt.submit_count,_n=Object(v.h)();console.log(gt.language,"language");var er=He[fn];return n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:ke.a.info},n.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",n.a.createElement(J.a,{color:er.color},er.name)),n.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",n.a.createElement("b",null,Ct,"\u79D2"))),n.a.createElement(ct.a,{value:dn,className:ke.a.desc}),n.a.createElement("ul",{className:ke.a["commit-info"]},n.a.createElement("li",null,n.a.createElement(q.a,{size:4},n.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",n.a.createElement("b",null,$n))),n.a.createElement("li",null,n.a.createElement(q.a,{size:4},n.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",n.a.createElement("b",null,Dn))," "),n.a.createElement("li",{style:{flex:"1 0 0"}}),n.a.createElement("li",null,n.a.createElement(q.a,{size:4},n.a.createElement("i",{className:"iconfont icon-huifu1",onClick:Ht})," ",n.a.createElement("b",null,sn))," ")))},Ze=F("dhSg"),ht=F("ps8w"),Qe=F.n(ht),Xe=F("oBTY"),Ke=F("M8RZ"),Fe=F("OkW/"),Ue=F("ErOA");function _e(ft){return Object(Ue.c)("comments.json",ft)}function Ce(ft){return Object(Ue.f)("/discusses/".concat(ft,"/plus.json"),{container_type:"Discuss",type:1})}function Ne(ft){return Object(Ue.f)("comments/reply.json",ft)}function De(ft){return Object(Ue.f)("comments.json",ft)}function rt(ft){return Object(Ue.f)("comments/".concat(ft==null?void 0:ft.id,"/hidden.json"),ft)}function tt(ft){return Object(Ue.b)("comments/".concat(ft==null?void 0:ft.id,".json"))}var xt=F("GgEA"),Mt=F("AMnG"),Bt=F("xKgJ");function It(ft){var gt=ft.author;return n.a.createElement("a",{href:"/users/".concat(gt.login),target:"_blank"},n.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(C.a.IMG_SERVER,"/images/").concat(gt.image_url),width:"50"}))}function Dt(ft){var gt=ft.data,Rt=ft.index,Ht=ft.parentDiscussIndex,mn=ft.user,fn=ft.onSetActionType,Ct=gt.author,_t=gt.can_delete,Zt=gt.content,Tt=gt.id,sn=gt.time;function Wt(){fn({id:Tt,index:Rt,type:"delete-discuss",parentDiscussIndex:Ht,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var dn=mn.admin||_t||Ct.user_id===mn.user_id;return n.a.createElement("div",{className:"discuss-item-container second-discuss "},n.a.createElement(It,{author:Ct}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(Ct.login),target:"_blank"},Ct.name),n.a.createElement("span",{className:"grey"},sn),n.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},dn?n.a.createElement("a",{onClick:Wt,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),n.a.createElement(ct.a,{className:"discuss-content",value:Zt})))}var lt=function(ft){var gt=ft.user,Rt=ft.data,Ht=ft.index,mn=ft.onPlusDiscuss,fn=ft.onSetActionType,Ct=ft.activeDiscussIndex,_t=ft.onReplyDiscuss,Zt=ft.onSetActiveDiscussIndex,Tt=Rt.content,sn=Rt.children,Wt=Rt.hidden,dn=Rt.id,$n=Rt.praise_count,Dn=Rt.time,_n=Rt.user_praise,er=Rt.can_delete,Rn=Rt.author;console.log(er&&(!sn||sn.length==0),"children22");function Pn(){Zt(dn)}function Gn(){mn(dn,!_n,Ht)}function Tr(){fn({id:dn,index:Ht,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function ir(){fn({id:dn,index:Ht,params:{hidden:Wt?"0":"1"},type:"hidden-discuss",message:Wt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var dr=gt.admin||gt.user_id===Rn.user_id;return n.a.createElement("div",{className:"discuss-item-container",key:dn},n.a.createElement(It,{author:Rn}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(Rn.login),target:"_blank"}," ",Rn.name," "),n.a.createElement("span",{className:"grey"},Dn)),n.a.createElement(ct.a,{className:"discuss-content",value:Tt}),sn&&sn.length>0?n.a.createElement("div",{className:"reply-discuss-container"},sn.map(function(vr,xr){return n.a.createElement(Dt,{key:vr.id,data:vr,index:xr,user:gt,onSetActionType:fn,parentDiscussIndex:Ht})})):null,n.a.createElement("div",{className:"btn-group"},Object(Bt.v)()?n.a.createElement("a",{onClick:ir,title:Wt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},n.a.createElement("i",{className:Wt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,er&&(!sn||sn.length==0)?n.a.createElement("a",{onClick:Tr,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null,n.a.createElement("a",{onClick:Pn,title:"\u56DE\u590D"}," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," "),n.a.createElement("a",{onClick:Gn,className:_n?"c-orange":""},n.a.createElement("i",{className:_n?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),n.a.createElement("span",null,$n||""))),n.a.createElement(Mt.a,{id:dn,activeDiscussIndex:Ct,onReplyDiscuss:_t})))},pt=F("kaH+"),ut=F("Wx9E"),Pe=F("Ot1p"),Ve=function(ft){var gt=ft.user_praise,Rt=ft.praise_count,Ht=ft.praisePlus,mn=ft.onCreateDiscuss,fn=ft.discuss_count,Ct=Object(t.useState)(!1),_t=Object(o.a)(Ct,2),Zt=_t[0],Tt=_t[1],sn=Object(t.useState)(""),Wt=Object(o.a)(sn,2),dn=Wt[0],$n=Wt[1];function Dn(Gn){$n(Gn)}function _n(){Tt(!0)}function er(){Tt(!1)}function Rn(){return Pn.apply(this,arguments)}function Pn(){return Pn=Object(u.a)(r.a.mark(function Gn(){return r.a.wrap(function(ir){for(;;)switch(ir.prev=ir.next){case 0:mn(dn),$n(""),Tt(!1);case 3:case"end":return ir.stop()}},Gn)})),Pn.apply(this,arguments)}return n.a.createElement("div",{className:"dis-input-editor-container ".concat(Zt?"active":""," ")},n.a.createElement("div",{className:Zt?"text-area hide":"text-area"},n.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:_n}),n.a.createElement("a",{style:{alignItems:"center"}}," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",fn," "),n.a.createElement("a",{className:"c-light-black",onClick:Ht,style:{alignItems:"center"},title:gt?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},n.a.createElement("i",{className:"mr3 ".concat(gt?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Rt?n.a.createElement("span",null,Rt):"")),Zt?n.a.createElement("div",{className:"input-mask",onClick:er}):null,n.a.createElement("div",{className:Zt?"md-container":"md-container hide"},n.a.createElement(Pe.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:dn,height:240,onChange:Dn}),n.a.createElement("div",{className:"tip-container",onClick:er},n.a.createElement("a",{className:"btn-send",onClick:Rn}," \u53D1\u9001 "))))},yt={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},st;(function(ft){ft[ft.GET_DISCUSSES=0]="GET_DISCUSSES",ft[ft.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",ft[ft.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",ft[ft.PLUS_DISCUSS=3]="PLUS_DISCUSS",ft[ft.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",ft[ft.SET_PAGE=5]="SET_PAGE",ft[ft.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(st||(st={}));function Nt(ft,gt){switch(gt.type){case st.SHOW_DISCUSSES_LOADING:return Object(i.a)(Object(i.a)({},ft),{},{loading:!0});case st.GET_DISCUSSES:return Object(i.a)(Object(i.a)({},ft),gt.payload);case st.TOP_OR_DOWN_DISCUSS:return Object(i.a)(Object(i.a)({},ft),gt.payload);case st.SET_ACTION_TYPE:return Object(i.a)(Object(i.a)({},ft),gt.payload);case st.PLUS_DISCUSS:return Object(i.a)(Object(i.a)({},ft),gt.payload);case st.SET_PAGE:return Object(i.a)(Object(i.a)({},ft),{},{page:gt.payload});case st.ACTIVE_DISCUSS_INDEX:return Object(i.a)(Object(i.a)({},ft),gt.payload);default:throw new Error}}var Ut=function(ft){var gt=ft.user,Rt=ft.identifier,Ht=ft.hack,mn=ft.onTriggerPraise,fn=ft.setDiscussTotal,Ct=Object(t.useReducer)(Nt,yt),_t=Object(o.a)(Ct,2),Zt=_t[0],Tt=_t[1],sn=Zt.loading,Wt=Zt.page,dn=Zt.data,$n=Zt.count,Dn=Zt.actionType,_n=Zt.activeDiscussIndex,er=Object(t.useCallback)(Object(u.a)(r.a.mark(function gn(){var tr,or,gr;return r.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Tt({type:st.SHOW_DISCUSSES_LOADING}),Qn.next=3,_e({container_type:"Practice",container_identifier:Rt,limit:10,page:Wt});case 3:tr=Qn.sent,or=tr.comments,gr=tr.disscuss_count,Tt({type:st.GET_DISCUSSES,payload:{data:or,count:gr,loading:!1}}),fn(gr);case 7:case"end":return Qn.stop()}},gn)})),[Wt,Rt]);Object(t.useEffect)(function(){er()},[Rt,Wt]);function Rn(gn){Tt({type:st.SET_PAGE,page:gn})}function Pn(gn){Tt({type:st.SET_ACTION_TYPE,payload:{actionType:gn}})}function Gn(gn){_n===gn?Tt({type:st.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):Tt({type:st.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:gn}})}function Tr(gn,tr,or){return ir.apply(this,arguments)}function ir(){return ir=Object(u.a)(r.a.mark(function gn(tr,or,gr){var Jn;return r.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:return yn.prev=0,yn.next=3,Ce(tr);case 3:Jn=yn.sent,dn[gr].user_praise=or,dn[gr].praise_count=Jn.praise_count,Tt({type:st.PLUS_DISCUSS,payload:{data:Object(Xe.a)(dn)}}),yn.next=12;break;case 9:yn.prev=9,yn.t0=yn.catch(0),console.log(yn.t0);case 12:case"end":return yn.stop()}},gn,null,[[0,9]])})),ir.apply(this,arguments)}function dr(){return vr.apply(this,arguments)}function vr(){return vr=Object(u.a)(r.a.mark(function gn(){var tr,or,gr,Jn,Qn;return r.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:if(tr=Dn.id,or=Dn.params,gr=Dn.type,Jn=Dn.index,Qn=Dn.parentDiscussIndex,!(gr==="hidden-discuss")){Ln.next=7;break}return console.log(or,"params"),Ln.next=5,rt(Object(i.a)({id:tr,container_type:"Practice",container_identifier:Rt},or));case 5:Qn?dn[Qn].children[Jn].hidden=or.hidden==1:dn[Jn].hidden=or.hidden==1,Tt({type:st.SET_ACTION_TYPE,payload:{actionType:null,data:Object(Xe.a)(dn)}});case 7:if(!(gr==="delete-discuss")){Ln.next=13;break}return Ln.next=10,tt({id:tr,container_type:"Practice",container_identifier:Rt});case 10:return Tt({type:st.SET_ACTION_TYPE,payload:{actionType:null}}),Ln.next=13,er();case 13:case"end":return Ln.stop()}},gn)})),vr.apply(this,arguments)}function xr(){Tt({type:st.SET_ACTION_TYPE,payload:{actionType:null}})}function ar(gn,tr){return fr.apply(this,arguments)}function fr(){return fr=Object(u.a)(r.a.mark(function gn(tr,or){return r.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return Jn.prev=0,Jn.next=3,Ne({container_type:"Practice",container_identifier:Rt,comments:{content:or,parent_id:tr}});case 3:er(),Jn.next=9;break;case 6:Jn.prev=6,Jn.t0=Jn.catch(0),console.log(Jn.t0);case 9:case"end":return Jn.stop()}},gn,null,[[0,6]])})),fr.apply(this,arguments)}function Wn(gn){return Jt.apply(this,arguments)}function Jt(){return Jt=Object(u.a)(r.a.mark(function gn(tr){return r.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:return Tt({type:st.SHOW_DISCUSSES_LOADING}),gr.next=3,De({comments:{content:tr},container_type:"Practice",container_identifier:Rt});case 3:er();case 4:case"end":return gr.stop()}},gn)})),Jt.apply(this,arguments)}return n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"discuss-panel"},dn.length===0?n.a.createElement(k.a,null):dn.map(function(gn,tr){return n.a.createElement(lt,{onReplyDiscuss:ar,onPlusDiscuss:Tr,onSetActiveDiscussIndex:Gn,onSetActionType:Pn,data:gn,index:tr,user:gt,activeDiscussIndex:_n})}),$n>10?n.a.createElement("div",{className:"pagination-container"},n.a.createElement(Me.a,{showQuickJumper:!0,onChange:Rn,current:Wt,total:$n})):null),n.a.createElement(Ve,{user_praise:Ht.user_praise,praise_count:Ht.praises_count,praisePlus:mn,discuss_count:Ht.comments_count,onCreateDiscuss:Wn}),n.a.createElement(Ke.a,null,n.a.createElement(p.a,{centered:!0,title:"\u63D0\u793A",visible:!!Dn,onOk:dr,onCancel:xr},n.a.createElement("p",null,Dn?Dn.message:"")),n.a.createElement(pt.a,null)))},it=F("1FX+"),mt=F.n(it),bt=F("pYxM"),At=F.n(bt),Xt=F("sB/4"),Ae=F.n(Xt),ge=F("Wtmd"),z=F.n(ge),Z=F("CNDd"),oe=F.n(Z),me=F("nCk5"),Re=F.n(me),Je=F("kovY"),at=F.n(Je),kt=function(gt){var Rt=gt.style,Ht=Rt===void 0?{}:Rt,mn=gt.onClick,fn=gt.onAssist,Ct=gt.onHide,_t=gt.data,Zt=gt.active,Tt=gt.showLine;return n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:Zt===(_t==null?void 0:_t.id)?"".concat(At.a.list," ").concat(At.a.active):At.a.list,style:Ht,onClick:function(){return mn(_t)}},(_t==null?void 0:_t.video)&&n.a.createElement("div",{className:At.a.left},n.a.createElement("img",{src:_t==null?void 0:_t.video_cover}),n.a.createElement("div",null,n.a.createElement("img",{src:Ae.a}),n.a.createElement("span",null,_t==null?void 0:_t.video_duration)),n.a.createElement("div",{className:At.a.mask})),n.a.createElement("div",{className:At.a.right},n.a.createElement("div",{className:At.a.name},n.a.createElement("img",{src:C.a.IMG_SERVER+"/images/"+(_t==null?void 0:_t.image_url),width:30,height:30}),n.a.createElement("div",{title:_t==null?void 0:_t.name,className:At.a.title},_t==null?void 0:_t.name),(_t==null?void 0:_t.is_authority)&&n.a.createElement("div",{className:At.a.b},"\u5B98\u65B9"),(_t==null?void 0:_t.is_excellent)&&n.a.createElement("div",{className:At.a.a},"\u7CBE\u9009")),n.a.createElement("div",{className:At.a.des},n.a.createElement(ct.a,{showLines:2,showTextOnly:!0,value:(_t==null?void 0:_t.content)||"\u6682\u65E0\u5185\u5BB9"})),n.a.createElement("div",{className:At.a.tag},n.a.createElement("span",{className:"current",onClick:function(Wt){Wt.stopPropagation(),fn(_t)}},n.a.createElement("img",{src:_t!=null&&_t.user_liker?oe.a:z.a}),n.a.createElement("span",{style:{color:_t!=null&&_t.user_liker?"#0152d9":"#656f87"}},_t==null?void 0:_t.praises_count)),n.a.createElement("span",null,n.a.createElement("img",{src:Re.a}),n.a.createElement("span",null,_t==null?void 0:_t.discusses_count)),n.a.createElement("span",null,n.a.createElement("img",{src:at.a}),n.a.createElement("span",null,_t==null?void 0:_t.viewed_count)),Object(Bt.v)()&&n.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(Wt){Wt.stopPropagation(),Ct(_t)}},_t!=null&&_t.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),Tt&&n.a.createElement("div",{className:At.a.line}))},jt=kt,ot=F("5Dmo"),wt=F("3S7+"),Kt=F("Z8dc"),Et=F.n(Kt),Qt=F("Aky1"),Vt=F("7+5b"),ie=F.n(Vt),N=F("twBr"),B=F.n(N),ae=F("oE5q"),fe=F.n(ae),se=function(gt,Rt){var Ht,mn,fn,Ct=Rt.payload.uploadInfo,_t=Ct===void 0?{}:Ct;switch(Rt.type){case"addVideo":return{videoList:[].concat(Object(Xe.a)(gt.videoList),[{name:_t.file.name,size:_t.file.size,type:_t.file.type,fileHash:_t.fileHash,state:_t.state,video_id:_t.videoId,attachment_id:"",article_id:-1,loaded:0,title:""}])};case"removeVideo":return{videoList:gt.videoList.filter(function(Zt){return Zt.name!==Rt.payload.name})};case"replaceVideo":return{videoList:Rt.payload};case"removeAll":return[];case"updateProgress":return{videoList:gt.videoList.map(function(Zt){return Zt.name===Rt.payload.uploadInfo.file.name?Object(i.a)(Object(i.a)({},Zt),{loaded:Rt.payload.progressPercent,video_id:_t.videoId,fileHash:_t.fileHash}):Zt})};case"updateTitle":return{videoList:(Ht=gt.videoList)===null||Ht===void 0?void 0:Ht.map(function(Zt){return Zt.name===Rt.payload.item.name?Object(i.a)(Object(i.a)({},Zt),{title:Rt.payload.title}):Zt})};case"updateImg":return{videoList:(mn=gt.videoList)===null||mn===void 0?void 0:mn.map(function(Zt){return Zt.name===Rt.payload.item.name?Object(i.a)(Object(i.a)({},Zt),{attachment_id:Rt.payload.attachment_id}):Zt})};case"updateImg":return{videoList:(fn=gt.videoList)===null||fn===void 0?void 0:fn.map(function(Zt){return Zt.name===Rt.payload.item.name?Object(i.a)(Object(i.a)({},Zt),{attachment_id:Rt.payload.attachment_id}):Zt})};default:return[]}},$e=function(gt){var Rt,Ht,mn=gt.onClose,fn=gt.onOk,Ct=gt.identifier,_t=gt.active,Zt=G.a.useForm(),Tt=Object(o.a)(Zt,1),sn=Tt[0],Wt=Object(t.useState)({}),dn=Object(o.a)(Wt,2),$n=dn[0],Dn=dn[1],_n=Object(t.useState)(!1),er=Object(o.a)(_n,2),Rn=er[0],Pn=er[1],Gn=Object(t.useState)(!1),Tr=Object(o.a)(Gn,2),ir=Tr[0],dr=Tr[1],vr=Object(t.useReducer)(se,{videoList:[]}),xr=Object(o.a)(vr,2),ar=xr[0],fr=xr[1],Wn=Object(Bt.x)(),Jt=Object(v.i)(),gn=Object(t.useRef)();Object(t.useEffect)(function(){_t&&tr()},[_t]);var tr=function(){var bn=Object(u.a)(r.a.mark(function Mn(){var Tn,Vn,sr,br,kr,ei,Mi,$r,Wi,na,Gi,di;return r.a.wrap(function(Xn){for(;;)switch(Xn.prev=Xn.next){case 0:return Xn.next=2,Object(g.k)(Ct,{active:_t});case 2:Tn=Xn.sent,(Tn==null?void 0:Tn.status)===0&&(ei={name:Tn==null||((Vn=Tn.data)===null||Vn===void 0)?void 0:Vn.name,content:Tn==null||((sr=Tn.data)===null||sr===void 0)?void 0:sr.content},sn.setFieldsValue(ei),Dn(ei),Tn!=null&&(br=Tn.data)!==null&&br!==void 0&&(kr=br.videos)!==null&&kr!==void 0&&kr[0]&&fr({type:"replaceVideo",payload:[{video_id:Tn==null||((Mi=Tn.data)===null||Mi===void 0||(($r=Mi.videos)===null||$r===void 0||((Wi=$r[0])===null||Wi===void 0)))?void 0:Wi.video_id,name:Tn==null||((na=Tn.data)===null||na===void 0||((Gi=na.videos)===null||Gi===void 0||((di=Gi[0])===null||di===void 0)))?void 0:di.title,loaded:100}]}));case 4:case"end":return Xn.stop()}},Mn)}));return function(){return bn.apply(this,arguments)}}(),or=function(Mn,Tn){Dn(Object(i.a)({},Tn))},gr=function(){var bn=Object(u.a)(r.a.mark(function Mn(Tn){var Vn,sr,br,kr,ei;return r.a.wrap(function($r){for(;;)switch($r.prev=$r.next){case 0:if(sr={videos:ar.videoList,articles:Tn},dr(!0),!_t){$r.next=9;break}return sr.active=_t,$r.next=6,Object(g.j)(Ct,sr);case 6:br=$r.sent,$r.next=12;break;case 9:return $r.next=11,Object(g.a)(Ct,sr);case 11:br=$r.sent;case 12:((Vn=br)===null||Vn===void 0?void 0:Vn.status)===0&&(console.log(_t||((kr=br)===null||kr===void 0?void 0:kr.id),44),fn(_t||((ei=br)===null||ei===void 0?void 0:ei.id))),dr(!1);case 14:case"end":return $r.stop()}},Mn)}));return function(Tn){return bn.apply(this,arguments)}}(),Jn=function(){var Mn=document.getElementById("fileUpload");Mn.value=""},Qn=function(Mn){var Tn='{"Vod":{}}';if(Pn(!0),gn.current){gn.current.addFile(Mn,null,null,null,Tn);return}Object(Qt.a)(Wn==null?void 0:Wn.login,"",{create:!gn,addFileSuccess:function(sr){fr({type:"addVideo",payload:{uploadInfo:sr}})},onUploadProgress:function(sr,br,kr){var ei=Math.ceil(kr*100);fr({type:"updateProgress",payload:{uploadInfo:sr,progressPercent:ei}}),Jn()},onUploadFailed:function(sr){w.b.info("\u89C6\u9891\u4E91\u670D\u52A1\u51FA\u73B0\u5F02\u5E38\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u3002")},onUploadEnd:function(sr){Pn(!1)},onUploadSucceed:function(sr){Pn(!1)},onUploadError:function(sr){Pn(!1)},gotUploader:function(sr){sr.addFile(Mn,null,null,null,Tn),gn.current=sr}})},yn=function(Mn){var Tn,Vn=1024,sr=Mn.target.files[0];if(!sr){Jn();return}var br=sr.name.toLowerCase();if(br&&br.indexOf(".avi")==-1&&br.indexOf(".flv")==-1&&br.indexOf(".f4v")==-1&&br.indexOf(".m4v")==-1&&br.indexOf(".mov")==-1&&br.indexOf(".mp4")==-1&&br.indexOf(".rmvb")==-1&&br.indexOf(".swf")==-1&&br.indexOf(".webm")==-1&&br.indexOf(".wmv")==-1){w.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),Jn();return}if(sr.size>Vn*1024*1024){w.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(Vn,"M")),Jn();return}if((Tn=ar.videoList)!==null&&Tn!==void 0&&Tn.find(function(kr){return kr.name===sr.name})){w.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),Jn();return}Qn(sr)},Ln=function(Mn,Tn){p.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",Tn?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){Jn(),fr({type:"removeVideo",payload:{name:Mn}})}})},Yt=function(){return n.a.createElement("label",{htmlFor:"fileUpload",className:Et.a.main},n.a.createElement("img",{src:ie.a,alt:""}),n.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891"))},qt=function(Mn){return n.a.createElement("div",{className:Et.a.mainLoading},n.a.createElement("div",{className:Et.a.proWarp},n.a.createElement("div",{className:Et.a.pro},n.a.createElement("div",{style:{width:Mn}})),n.a.createElement("span",null,Mn||0,"%")),n.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),n.a.createElement("div",{className:Et.a.tip},n.a.createElement(wt.a,{getPopupContainer:function(Vn){return Vn.parentNode},title:n.a.createElement("div",null,n.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",n.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),n.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),n.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},n.a.createElement("img",{src:fe.a,alt:""}))))},nn=function(Mn){return n.a.createElement("div",{className:Et.a.mainSucceed},n.a.createElement("img",{src:B.a,alt:""}),n.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),n.a.createElement("div",{className:Et.a.tip},n.a.createElement(wt.a,{getPopupContainer:function(Vn){return Vn.parentNode},title:n.a.createElement("div",null,n.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",n.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),n.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),n.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},n.a.createElement("img",{src:fe.a,alt:""}))),n.a.createElement("div",{className:Et.a.del,onClick:function(){return Ln(Mn.name,Mn.loaded==100)}},n.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},xn=function(){var Mn;return n.a.createElement(n.a.Fragment,null,(Mn=ar.videoList)===null||Mn===void 0?void 0:Mn.map(function(Tn,Vn){return n.a.createElement(n.a.Fragment,{key:Vn},Tn.loaded==100?nn(Tn):qt(Tn.loaded))}))},cn=function(){p.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:mn})},Hn=(Rt=ar.videoList)===null||Rt===void 0?void 0:Rt.length;return n.a.createElement("div",{className:Et.a.listForm},n.a.createElement("header",null,_t?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),n.a.createElement("section",{className:Et.a.scroll,id:"sss"},n.a.createElement("div",{className:Et.a.formWrap}," ",n.a.createElement(G.a,{form:sn,scrollToFirstError:!0,layout:"vertical",onValuesChange:or,onFinish:gr},n.a.createElement(G.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"},{max:60,message:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},n.a.createElement(re.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Ht=$n.name)===null||Ht===void 0?void 0:Ht.length)||0,"/60")})),n.a.createElement(G.a.Item,{name:"content",label:"\u5185\u5BB9:"},n.a.createElement(Pe.a,{defaultValue:$n.content||"",watch:!0})))),n.a.createElement("div",{className:Et.a.upload},Hn?xn():Yt(),n.a.createElement("input",{type:"file",id:"fileUpload",style:{display:"none"},onChange:yn,accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"}))),n.a.createElement("div",{className:Et.a.btns},n.a.createElement(te.a,{onClick:cn,type:"primary",ghost:!0},"\u5173\u95ED"),n.a.createElement(te.a,{loading:ir,disabled:Rn,onClick:function(){return sn.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},St=$e,Pt=F("cWXX"),$t=F("/ezw"),Ot=F("CaVn"),zt=F.n(Ot),an=F("s8/Y"),jn=F.n(an),Dr=F("JOrW"),Cr=F.n(Dr),Nn=F("gqXR"),hr=F.n(Nn),mi=F("14J3"),Or=F("BMrR"),yr=F("jCWc"),pr=F("kPKH"),Yr=F("wW8i"),Mr=F.n(Yr),Zr=F("MVJL"),wr=F.n(Zr),vi=function(gt){var Rt=gt.id,Ht=gt.cb,mn=Object(t.useState)(""),fn=Object(o.a)(mn,2),Ct=fn[0],_t=fn[1];return n.a.createElement("aside",{className:"mt10"},n.a.createElement(Pe.a,{defaultValue:Ct,id:"writeForumsReviewId",onChange:function(Tt){_t(Tt)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),n.a.createElement(Or.a,null,n.a.createElement(pr.a,{flex:"1"}),n.a.createElement(pr.a,null,n.a.createElement(te.a,{type:"primary",size:"large",onClick:Object(u.a)(r.a.mark(function Zt(){return r.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:Ct===""?w.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):Ht(Rt,Ct);case 1:case"end":return sn.stop()}},Zt)}))},"\u53D1\u9001"))))},li=function(gt){var Rt,Ht=gt.data;return n.a.createElement("div",{className:wr.a.thirdlyLevelDiscuss},n.a.createElement("span",{className:"c-grey-333"},n.a.createElement("span",{className:"font 14 c-light-primary"},Ht==null||((Rt=Ht.author)===null||Rt===void 0)?void 0:Rt.name),"@",n.a.createElement("span",{className:"font 14 c-light-primary"},Ht==null?void 0:Ht.parent_name),":"),n.a.createElement(ct.a,{value:Ht==null?void 0:Ht.content}))},Kr=function(gt){var Rt,Ht,mn,fn,Ct=gt.data,_t=gt.onReplyDiscuss,Zt=gt.thirdlyReply,Tt=gt.setThirdlyReply,sn=Object(Bt.x)();return console.log(sn,"user"),n.a.createElement("div",{className:wr.a.list},n.a.createElement("img",{src:C.a.IMG_SERVER+"/images/"+(Ct==null||((Rt=Ct.author)===null||Rt===void 0)?void 0:Rt.image_url)}),n.a.createElement("div",{className:wr.a.wrap},n.a.createElement("div",{className:"font14",style:{marginBottom:6}},n.a.createElement("span",{className:"c-grey-333"},Ct==null||((Ht=Ct.author)===null||Ht===void 0)?void 0:Ht.name),(sn==null?void 0:sn.login)!==(Ct==null||((mn=Ct.author)===null||mn===void 0)?void 0:mn.login)&&n.a.createElement("span",{onClick:function(){return Tt(Ct==null?void 0:Ct.id)},className:"c-grey-999 current",style:{float:"right"}},n.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),n.a.createElement("span",null,"\u56DE\u590D"))),n.a.createElement(ct.a,{value:Ct==null?void 0:Ct.content}),Ct==null||((fn=Ct.children)===null||fn===void 0)?void 0:fn.map(function(Wt){return n.a.createElement(li,{key:Wt.id,data:Wt})}),Zt===(Ct==null?void 0:Ct.id)&&n.a.createElement("div",null,n.a.createElement(vi,{id:Ct==null?void 0:Ct.id,cb:_t}),n.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return Tt(null)},className:"c-light-primary current"},n.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"\u6536\u8D77\u56DE\u590D")),n.a.createElement("div",{className:wr.a.line})))},zr=function(gt){var Rt,Ht,mn,fn,Ct=gt.data,_t=gt.onReplyDiscuss,Zt=gt.secondReply,Tt=gt.setSecondReply,sn=gt.thirdlyReply,Wt=gt.setThirdlyReply,dn=gt.onPlusDiscuss,$n=Object(t.useState)(!1),Dn=Object(o.a)($n,2),_n=Dn[0],er=Dn[1];return console.log(Ct,"data"),n.a.createElement("div",{className:wr.a.discussItem},n.a.createElement("div",{className:wr.a.list},n.a.createElement("img",{src:C.a.IMG_SERVER+"/images/"+(Ct==null||((Rt=Ct.author)===null||Rt===void 0)?void 0:Rt.image_url)}),n.a.createElement("div",{className:wr.a.wrap},n.a.createElement("div",{className:"font14",style:{marginBottom:6}},n.a.createElement("span",{className:"c-grey-333 mr30"},Ct==null||((Ht=Ct.author)===null||Ht===void 0)?void 0:Ht.name),n.a.createElement("span",{className:"c-grey-999"},Ct==null?void 0:Ct.time)),n.a.createElement(ct.a,{value:Ct==null?void 0:Ct.content}),n.a.createElement("div",{className:wr.a.btns},n.a.createElement("div",{onClick:function(){return dn(Ct==null?void 0:Ct.id)},className:Ct!=null&&Ct.user_praise?"c-light-primary":"c-grey-999"},n.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),n.a.createElement("span",null,Ct==null?void 0:Ct.praise_count)),n.a.createElement("div",{onClick:function(){var Pn;if((Ct==null||((Pn=Ct.children)===null||Pn===void 0)?void 0:Pn.length)===0)return;Tt(null),er(!_n)},style:{color:_n?"#0152d9":"#999999"}},n.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),n.a.createElement("span",null,_n?"\u6536\u8D77\u8BC4\u8BBA":Ct==null||((mn=Ct.children)===null||mn===void 0)?void 0:mn.length)),n.a.createElement("div",{onClick:function(){er(!1),Tt(Zt===(Ct==null?void 0:Ct.id)?null:Ct==null?void 0:Ct.id)},style:{color:Zt===(Ct==null?void 0:Ct.id)?"#0152d9":"#999999"}},n.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),n.a.createElement("span",null,Zt===(Ct==null?void 0:Ct.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),Zt===(Ct==null?void 0:Ct.id)&&n.a.createElement(vi,{id:Ct==null?void 0:Ct.id,cb:function(Pn,Gn){_t(Pn,Gn),er(!0)}}),_n&&n.a.createElement("div",{className:wr.a.secondLevelDiscuss},Ct==null||((fn=Ct.children)===null||fn===void 0)?void 0:fn.map(function(Rn){return n.a.createElement(Kr,{thirdlyReply:sn,setThirdlyReply:Wt,key:Rn.id,data:Rn,onReplyDiscuss:_t})})))))},xi=zr,gi=function(gt){var Rt=gt.identifier,Ht=gt.active,mn=gt.onOk,fn=Object(t.useState)(""),Ct=Object(o.a)(fn,2),_t=Ct[0],Zt=Ct[1],Tt=Object(t.useState)(1),sn=Object(o.a)(Tt,2),Wt=sn[0],dn=sn[1],$n=Object(t.useState)([]),Dn=Object(o.a)($n,2),_n=Dn[0],er=Dn[1],Rn=Object(t.useState)(0),Pn=Object(o.a)(Rn,2),Gn=Pn[0],Tr=Pn[1],ir=Object(t.useState)(null),dr=Object(o.a)(ir,2),vr=dr[0],xr=dr[1],ar=Object(t.useState)(null),fr=Object(o.a)(ar,2),Wn=fr[0],Jt=fr[1];Object(t.useEffect)(function(){gn(1),dn(1)},[Ht]);var gn=function(){var Qn=Object(u.a)(r.a.mark(function yn(Ln){var Yt;return r.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,_e({container_type:"QuestionSolutionArticle",container_identifier:Ht,limit:5,page:Ln});case 2:Yt=nn.sent,Yt!=null&&Yt.comments&&(er((Yt==null?void 0:Yt.comments)||[]),dn(Ln),Tr(Yt==null?void 0:Yt.disscuss_count));case 4:case"end":return nn.stop()}},yn)}));return function(Ln){return Qn.apply(this,arguments)}}(),tr=function(){var Qn=Object(u.a)(r.a.mark(function yn(){var Ln;return r.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:if(!(_t==="")){qt.next=3;break}return w.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),qt.abrupt("return");case 3:return qt.next=5,De({comments:{content:_t},container_type:"QuestionSolutionArticle",container_identifier:Ht});case 5:Ln=qt.sent,Ln!=null&&Ln.discuss&&(Zt(""),gn(Wt),mn());case 7:case"end":return qt.stop()}},yn)}));return function(){return Qn.apply(this,arguments)}}(),or=function(){var Qn=Object(u.a)(r.a.mark(function yn(Ln,Yt,qt){var nn;return r.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return cn.next=2,Ne({container_type:"QuestionSolutionArticle",container_identifier:Ht,comments:{content:Yt,parent_id:Ln}});case 2:nn=cn.sent,xr(null),Jt(null),gn(Wt);case 6:case"end":return cn.stop()}},yn)}));return function(Ln,Yt,qt){return Qn.apply(this,arguments)}}(),gr=function(){var Qn=Object(u.a)(r.a.mark(function yn(Ln){var Yt;return r.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,Ce(Ln);case 2:Yt=nn.sent,gn(Wt);case 4:case"end":return nn.stop()}},yn)}));return function(Ln){return Qn.apply(this,arguments)}}(),Jn=function(yn){dn(yn),gn(yn)};return n.a.createElement("div",{className:Mr.a.discuss},n.a.createElement("aside",{className:Mr.a.reply,style:{borderWidth:Gn?1:0}},n.a.createElement(Pe.a,{defaultValue:_t,id:"writeForumsReviewId",onChange:function(yn){Zt(yn)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),n.a.createElement(Or.a,null,n.a.createElement(pr.a,{flex:"1"}),n.a.createElement(pr.a,null,n.a.createElement(te.a,{type:"primary",size:"large",onClick:function(){return tr()}},"\u53D1\u9001")))),_n==null?void 0:_n.map(function(Qn){return n.a.createElement(xi,{secondReply:vr,setSecondReply:xr,thirdlyReply:Wn,setThirdlyReply:Jt,key:Qn.id,data:Qn,onReplyDiscuss:or,onPlusDiscuss:gr})}),n.a.createElement(Me.a,{className:Mr.a.pagination,showTotal:function(yn){return n.a.createElement("span",{style:{color:"#656F87"}},"\u5171",n.a.createElement("span",{className:"c-light-primary"},yn),"\u6761\u6570\u636E")},current:Wt,onChange:Jn,total:Gn,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},Si=gi,Fn=F("hgre"),Sn=function(gt){var Rt,Ht,mn,fn,Ct,_t,Zt,Tt,sn,Wt,dn=gt.active,$n=gt.identifier,Dn=gt.onAssist,_n=gt.onEdit,er=gt.onArticlesSkip,Rn=gt.onClose,Pn=gt.onOk,Gn=gt.onDelete,Tr=gt.detailsIndex,ir=gt.btnShowStatus,dr=Object(t.useState)(!0),vr=Object(o.a)(dr,2),xr=vr[0],ar=vr[1],fr=Object(t.useState)({}),Wn=Object(o.a)(fr,2),Jt=Wn[0],gn=Wn[1];Object(t.useEffect)(function(){dn&&tr()},[dn,Tr]);var tr=function(){var yn=Object(u.a)(r.a.mark(function Ln(){var Yt,qt,nn=arguments;return r.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return Yt=nn.length>0&&nn[0]!==void 0?nn[0]:!0,Yt&&ar(!0),cn.next=4,Object(g.d)($n,{active:dn});case 4:qt=cn.sent,(qt==null?void 0:qt.status)===0&&gn((qt==null?void 0:qt.data)||{}),ar(!1);case 7:case"end":return cn.stop()}},Ln)}));return function(){return yn.apply(this,arguments)}}(),or=function(){var yn=Object(u.a)(r.a.mark(function Ln(Yt){var qt;return r.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return xn.next=2,Object(g.g)($n,Object(i.a)({active:dn},Yt));case 2:qt=xn.sent,(qt==null?void 0:qt.status)===0&&(tr(!1),Pn());case 4:case"end":return xn.stop()}},Ln)}));return function(Yt){return yn.apply(this,arguments)}}(),gr=function(){var yn=Object(u.a)(r.a.mark(function Ln(Yt){var qt;return r.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return xn.next=2,Object(g.c)($n,{active:Yt==null?void 0:Yt.id});case 2:qt=xn.sent,qt.status===0&&(tr(!1),Pn());case 4:case"end":return xn.stop()}},Ln)}));return function(Yt){return yn.apply(this,arguments)}}(),Jn=function(Ln){p.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:null,className:"custom-modal-divider",content:"\u786E\u8BA4\u8981\u5220\u9664\u8BE5\u9898\u89E3\u5417?",onOk:function(){return Gn(Ln)}})},Qn=function(){tr(!1),Pn()};return n.a.createElement("div",{className:zt.a.listDetails},n.a.createElement($t.a,{className:"pt20 pl20 pr20",loading:xr,active:!0,paragraph:{rows:5}},n.a.createElement("div",{className:zt.a.head},n.a.createElement("div",{className:zt.a.name},n.a.createElement("div",{title:Jt==null?void 0:Jt.name,className:zt.a.title},Jt==null?void 0:Jt.name),(Jt==null?void 0:Jt.is_authority)&&n.a.createElement("div",{className:zt.a.b},"\u5B98\u65B9"),(Jt==null?void 0:Jt.is_excellent)&&n.a.createElement("div",{className:zt.a.a},"\u7CBE\u9009")),n.a.createElement("div",{className:zt.a.tag},n.a.createElement("img",{src:C.a.IMG_SERVER+"/images/"+(Jt==null?void 0:Jt.image_url)}),n.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},Jt==null?void 0:Jt.username),n.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",Ie()(Jt==null?void 0:Jt.created_at).format("YYYY-MM-DD")),n.a.createElement("span",null,n.a.createElement("img",{src:z.a}),n.a.createElement("span",null,Jt==null?void 0:Jt.praises_count)),n.a.createElement("span",null,n.a.createElement("img",{src:Re.a}),n.a.createElement("span",null,Jt==null?void 0:Jt.discusses_count)),n.a.createElement("span",null,n.a.createElement("img",{src:at.a}),n.a.createElement("span",null,Jt==null?void 0:Jt.viewed_count)),n.a.createElement("div",{className:zt.a.btn},(Object(Bt.v)()||(Jt==null?void 0:Jt.is_self))&&n.a.createElement(n.a.Fragment,null,n.a.createElement(te.a,{onClick:function(){return Jn(Jt)},type:"primary",ghost:!0},"\u5220\u9664"),n.a.createElement(te.a,{onClick:function(){return _n(Jt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(Bt.v)()&&n.a.createElement(te.a,{onClick:function(){return or({is_authority:!(Jt!=null&&Jt.is_authority)})},type:"primary"},n.a.createElement("img",{src:Cr.a}),Jt!=null&&Jt.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(Bt.v)()&&n.a.createElement(te.a,{onClick:function(){return or({is_excellent:!(Jt!=null&&Jt.is_excellent)})},type:"primary"},n.a.createElement("img",{src:jn.a}),Jt!=null&&Jt.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),n.a.createElement("div",{className:zt.a.scroll},(Jt==null||((Rt=Jt.videos)===null||Rt===void 0||((Ht=Rt[0])===null||Ht===void 0))?void 0:Ht.id)&&n.a.createElement("div",{className:zt.a.video},n.a.createElement(x.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(Jt!=null&&(mn=Jt.videos)!==null&&mn!==void 0&&(fn=mn[0])!==null&&fn!==void 0&&fn.transcoded)},n.a.createElement(Fn.a,{poster:Jt==null||((Ct=Jt.videos)===null||Ct===void 0||((_t=Ct[0])===null||_t===void 0))?void 0:_t.cover_url,src:(Jt==null||((Zt=Jt.videos)===null||Zt===void 0||((Tt=Zt[0])===null||Tt===void 0))?void 0:Tt.play_url)||"",videoId:Jt==null||((sn=Jt.videos)===null||sn===void 0||((Wt=sn[0])===null||Wt===void 0))?void 0:Wt.id,logWatchHistory:function(){}}))),n.a.createElement(ct.a,{className:zt.a.html,value:(Jt==null?void 0:Jt.content)||""}),n.a.createElement("div",{onClick:function(){return gr(Jt)},className:zt.a.g},n.a.createElement("img",{className:"mr10",src:(Jt!=null&&Jt.user_liker,hr.a)}),n.a.createElement("span",null,Jt==null?void 0:Jt.praises_count)),n.a.createElement(Si,{onOk:Qn,active:dn,identifier:$n})),n.a.createElement("div",{className:zt.a.btns},n.a.createElement(te.a,{onClick:function(){return Rn()},type:"primary",ghost:!0},"\u5173\u95ED"),ir[0]&&n.a.createElement(te.a,{onClick:function(Ln){return er(Ln,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),ir[1]&&n.a.createElement(te.a,{onClick:function(Ln){return er(Ln,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},_r=Sn,zn=F("3tLw"),Lr=F.n(zn),rr=F("ek7X"),Ri=F("0NbB"),Pr=function(gt){var Rt=gt.identifier,Ht=gt.tabStatus,mn=gt.setFilterListTotal,fn=gt.setListStatus,Ct={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},_t=Object(t.useState)(Object(i.a)({},Ct)),Zt=Object(o.a)(_t,2),Tt=Zt[0],sn=Zt[1],Wt=Object(t.useState)(!1),dn=Object(o.a)(Wt,2),$n=dn[0],Dn=dn[1],_n=Object(t.useState)(0),er=Object(o.a)(_n,2),Rn=er[0],Pn=er[1],Gn=Object(t.useState)(1),Tr=Object(o.a)(Gn,2),ir=Tr[0],dr=Tr[1],vr=Object(t.useState)(null),xr=Object(o.a)(vr,2),ar=xr[0],fr=xr[1],Wn=Object(t.useState)([]),Jt=Object(o.a)(Wn,2),gn=Jt[0],tr=Jt[1],or=Object(t.useState)([!0,!0]),gr=Object(o.a)(or,2),Jn=gr[0],Qn=gr[1],yn=Object(t.useState)(0),Ln=Object(o.a)(yn,2),Yt=Ln[0],qt=Ln[1],nn=Object(t.useRef)(null);Object(t.useEffect)(function(){kr()},[Ht]),Object(t.useEffect)(function(){xn()},[ar]),Object(t.useEffect)(function(){Hn(Object(i.a)({},Ct)),kr()},[Rt]),Object(t.useEffect)(function(){return window.addEventListener("resize",cn),fn(Yt),function(){window.removeEventListener("resize",cn)}},[Yt]);var xn=function(){var Xn=Object(u.a)(r.a.mark(function An(){var nr,lr;return r.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:if(ar){In.next=3;break}return Qn([!0,!0]),In.abrupt("return");case 3:nr=[!0,!0],lr=gn==null?void 0:gn.findIndex(function(ri){return ri.id===ar}),lr===0&&Tt.page===1&&(nr[0]=!1),(Tt.page-1)*Tt.limit+(lr+1)===Tt.total&&(nr[1]=!1),Qn(nr);case 8:case"end":return In.stop()}},An)}));return function(){return Xn.apply(this,arguments)}}(),cn=function(){if(Yt){var An,nr=window.innerWidth-((An=nn.current)===null||An===void 0?void 0:An.clientWidth);Pn(nr)}},Hn=function(){var Xn=Object(u.a)(r.a.mark(function An(nr){var lr,Wr,In,ri;return r.a.wrap(function(Jr){for(;;)switch(Jr.prev=Jr.next){case 0:return Dn(!0),Jr.next=3,Object(g.f)(Rt,nr);case 3:return lr=Jr.sent,(lr==null?void 0:lr.status)===0&&(tr((lr==null||((Wr=lr.data)===null||Wr===void 0)?void 0:Wr.articles)||[]),sn(Object(i.a)(Object(i.a)({},nr),{},{total:lr==null||((In=lr.data)===null||In===void 0)?void 0:In.articles_count})),mn(lr==null||((ri=lr.data)===null||ri===void 0)?void 0:ri.articles_count)),Dn(!1),Jr.abrupt("return",lr);case 7:case"end":return Jr.stop()}},An)}));return function(nr){return Xn.apply(this,arguments)}}(),bn=function(){(Tt==null?void 0:Tt.sort_direction)===null?Tt.sort_direction="asc":(Tt==null?void 0:Tt.sort_direction)==="asc"?Tt.sort_direction="desc":(Tt==null?void 0:Tt.sort_direction)==="desc"&&(Tt.sort_direction=null),Tt.page=1,kr(),sn(Object(i.a)({},Tt)),Hn(Tt)},Mn=function(){Tt.page=1,Tt.search=Tt==null?void 0:Tt.save_search,kr(),sn(Object(i.a)({},Tt)),Hn(Tt)},Tn=function(){var An,nr=document.getElementsByClassName("btn-resize");nr[0].style.visibility="hidden";var lr=window.innerWidth-((An=nn.current)===null||An===void 0?void 0:An.clientWidth);Pn(lr)},Vn=function(){Tn(),qt(1)},sr=function(An){Tn(),fr(An==null?void 0:An.id),qt(3)},br=function(An){Tn(),fr(An==null?void 0:An.id),qt(2)},kr=function(){var An=document.getElementsByClassName("btn-resize");An[0].style.visibility="visible",Pn(0),qt(0),fr(null)},ei=function(An){qt(3),fr(An),Tt.page=1,sn(Object(i.a)({},Tt)),Hn(Tt)},Mi=function(An){qt(3),fr(An),sn(Object(i.a)({},Tt)),Hn(Tt)},$r=function(An){sn(Object(i.a)({},Tt)),Hn(Tt)},Wi=function(){var Xn=Object(u.a)(r.a.mark(function An(nr){var lr;return r.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(g.c)(Rt,{active:nr==null?void 0:nr.id});case 2:lr=In.sent,lr.status===0&&(Hn(Tt),dr(ir+1));case 4:case"end":return In.stop()}},An)}));return function(nr){return Xn.apply(this,arguments)}}(),na=function(){var Xn=Object(u.a)(r.a.mark(function An(nr){var lr;return r.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(g.e)(Rt,{active:nr==null?void 0:nr.id});case 2:lr=In.sent,lr.status===0&&(Hn(Tt),dr(ir+1));case 4:case"end":return In.stop()}},An)}));return function(nr){return Xn.apply(this,arguments)}}(),Gi=function(){var Xn=Object(u.a)(r.a.mark(function An(nr){var lr;return r.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(g.i)(Rt,{active:nr==null?void 0:nr.id});case 2:lr=In.sent,lr.status===0&&(kr(),Hn(Tt));case 4:case"end":return In.stop()}},An)}));return function(nr){return Xn.apply(this,arguments)}}(),di=function(An){Tt.page=An,sn(Object(i.a)({},Tt)),Hn(Tt)},Vi=function(){var Xn=Object(u.a)(r.a.mark(function An(nr,lr){var Wr,In,ri,Ur,Jr,wi,Ii,Xi,Kn,wn,Yn;return r.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:if(Wr=gn==null?void 0:gn.findIndex(function(Ar){return Ar.id===ar}),console.log(Wr,lr,22),!(lr==="prev")){kn.next=21;break}if(!(Wr===void 0)){kn.next=6;break}return w.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 6:if(!(Wr===0)){kn.next=19;break}if(!(Tt.page===1)){kn.next=10;break}return w.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 10:if(!(Tt.page!==1)){kn.next=17;break}return Tt.page=Tt.page-1,sn(Object(i.a)({},Tt)),kn.next=15,Hn(Tt);case 15:In=kn.sent,(In==null?void 0:In.status)===0&&(wi=In==null||((ri=In.data)===null||ri===void 0)?void 0:ri.articles[(In==null||((Ur=In.data)===null||Ur===void 0||((Jr=Ur.articles)===null||Jr===void 0))?void 0:Jr.length)-1],fr(wi==null?void 0:wi.id),console.log(nr.target,555));case 17:kn.next=21;break;case 19:Ii=gn[Wr-1],fr(Ii==null?void 0:Ii.id);case 21:if(!(lr==="next")){kn.next=39;break}if(!(Wr===void 0)){kn.next=25;break}return w.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 25:if(!((Tt.page-1)*Tt.limit+(Wr+1)===Tt.total)){kn.next=28;break}return w.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 28:if(!(Wr+1===Tt.limit)){kn.next=37;break}return Tt.page=Tt.page+1,sn(Object(i.a)({},Tt)),kn.next=33,Hn(Tt);case 33:Xi=kn.sent,(Xi==null?void 0:Xi.status)===0&&(wn=Xi==null||((Kn=Xi.data)===null||Kn===void 0)?void 0:Kn.articles[0],fr(wn==null?void 0:wn.id)),kn.next=39;break;case 37:Yn=gn[Wr+1],fr(Yn==null?void 0:Yn.id);case 39:case"end":return kn.stop()}},An)}));return function(nr,lr){return Xn.apply(this,arguments)}}();return n.a.createElement("div",{className:mt.a.wrap,ref:nn},n.a.createElement("div",{className:mt.a.head},n.a.createElement("div",{className:mt.a.sort,onClick:bn},n.a.createElement("span",null,"\u6700\u65B0"),n.a.createElement("aside",null,n.a.createElement(rr.a,{style:{color:(Tt==null?void 0:Tt.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),n.a.createElement(Ri.a,{style:{color:(Tt==null?void 0:Tt.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),n.a.createElement(re.a.Search,{value:Tt.save_search,className:mt.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(An){Tt.save_search=An.target.value,sn(Object(i.a)({},Tt))},onSearch:Mn}),n.a.createElement("div",{onClick:Vn,className:mt.a.btn},n.a.createElement("img",{src:Lr.a}),"\u5199\u9898\u89E3")),n.a.createElement("div",{className:mt.a.listWarp},n.a.createElement(x.a,{spinning:$n,className:"mt20"},gn==null?void 0:gn.map(function(Xn,An){var nr=!0;return An+1===gn.length&&An!==0&&(nr=!1),n.a.createElement(jt,{active:ar,key:Xn.id,data:Xn,showLine:nr,onClick:sr,onAssist:Wi,onHide:na})}),(gn==null?void 0:gn.length)===0&&n.a.createElement(k.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),n.a.createElement(Me.a,{className:mt.a.pagination,showTotal:function(An){return n.a.createElement("span",{style:{color:"#656F87"}},"\u5171",n.a.createElement("span",{className:"c-light-primary"},An),"\u6761\u6570\u636E")},total:Tt.total,showSizeChanger:!1,current:Tt==null?void 0:Tt.page,onChange:di,hideOnSinglePage:!0,showQuickJumper:!0}),Yt>0&&n.a.createElement("div",{className:mt.a.fixedRight,style:{width:Rn}},Yt===1&&n.a.createElement(St,{identifier:Rt,onClose:kr,onOk:ei}),Yt===2&&n.a.createElement(St,{active:ar,identifier:Rt,onClose:kr,onOk:Mi}),Yt===3&&n.a.createElement(_r,{btnShowStatus:Jn,onArticlesSkip:Vi,detailsIndex:ir,active:ar,identifier:Rt,onClose:kr,onOk:$r,onEdit:br,onAssist:Wi,onDelete:Gi})))},ni=Pr,ji=F("VEzc"),ui=F.n(ji),Di=function(gt){var Rt,Ht=gt.visible,mn=gt.onVisible,fn=gt.value,Ct=gt.onChange,_t=gt.setIndex,Zt={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},Tt=Object(t.useState)(Zt),sn=Object(o.a)(Tt,2),Wt=sn[0],dn=sn[1],$n=Object(t.useState)([]),Dn=Object(o.a)($n,2),_n=Dn[0],er=Dn[1],Rn=Object(t.useState)([]),Pn=Object(o.a)(Rn,2),Gn=Pn[0],Tr=Pn[1],ir=Object(t.useState)(!1),dr=Object(o.a)(ir,2),vr=dr[0],xr=dr[1],ar=Object(t.useRef)([]),fr=Object(t.useRef)(null),Wn=Object(v.i)();Object(t.useEffect)(function(){return Wn!=null&&Wn.id&&(fr.current=setInterval(function(){Jt(30)},3e4)),function(){clearInterval(fr.current)}},[]);var Jt=function(){var Yt=Object(u.a)(r.a.mark(function qt(nn){var xn;return r.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:return Hn.next=2,Object(g.r)(Wn==null?void 0:Wn.id,{practice_time:nn});case 2:xn=Hn.sent;case 3:case"end":return Hn.stop()}},qt)}));return function(nn){return Yt.apply(this,arguments)}}();Object(t.useEffect)(function(){Qn(Wt),gr()},[]),Object(t.useEffect)(function(){return window.addEventListener("click",tr),function(){window.removeEventListener("click",tr)}},[Wn==null?void 0:Wn.save_identifier,Ht]),Object(t.useEffect)(function(){var Yt=ar.current.findIndex(function(Hn){return Hn.identifier===(Wn==null?void 0:Wn.save_identifier)}),qt=ar.current[Yt-1],nn=ar.current[Yt+1],xn=document.getElementById("oj-prev"),cn=document.getElementById("oj-next");qt?xn.style.display="block":xn.style.display="none",nn?cn.style.display="block":cn.style.display="none"},[Wn==null?void 0:Wn.save_identifier,ar.current]);var gn=function(qt,nn){if(qt.id===nn)return qt;for(var xn=0,cn=qt;cn=cn.parentNode;xn++){if(cn.id===nn)return cn;if(cn==document.documentElement)return!1}},tr=function(){var Yt=Object(u.a)(r.a.mark(function qt(nn){var xn,cn,Hn;return r.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:if(!gn(nn.target,"oj-drawer")&&Ht&&mn(!1),xn=ar.current.findIndex(function(Tn){return Tn.identifier===(Wn==null?void 0:Wn.save_identifier)}),cn=ar.current[xn-1],Hn=ar.current[xn+1],!(nn.target.id==="oj-prev")){Mn.next=14;break}if(!(!cn||xn===-1)){Mn.next=8;break}return w.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),Mn.abrupt("return");case 8:return nn.target.style.pointerEvents="none",nn.target.style.cursor="not-allowed",Mn.next=12,yn(cn==null?void 0:cn.identifier);case 12:_t("0"),setTimeout(function(){nn.target.style.pointerEvents="auto",nn.target.style.cursor="pointer"},400);case 14:if(!(nn.target.id==="oj-next"||nn.target.id==="oj-modal-next")){Mn.next=24;break}if(!(!Hn||xn===-1)){Mn.next=18;break}return w.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),Mn.abrupt("return");case 18:return nn.target.style.pointerEvents="none",nn.target.style.cursor="not-allowed",Mn.next=22,yn(Hn==null?void 0:Hn.identifier);case 22:_t("0"),setTimeout(function(){nn.target.style.pointerEvents="auto",nn.target.style.cursor="pointer"},400);case 24:case"end":return Mn.stop()}},qt)}));return function(nn){return Yt.apply(this,arguments)}}();Object(t.useEffect)(function(){Ct(Wn==null?void 0:Wn.save_identifier);var Yt=Gn.findIndex(function(qt){return qt.some(function(nn){return nn.identifier===(Wn==null?void 0:Wn.save_identifier)})});Yt===-1?dn(Object(i.a)(Object(i.a)({},Wt),{},{page:1})):dn(Object(i.a)(Object(i.a)({},Wt),{},{page:Yt+1}))},[Wn==null?void 0:Wn.save_identifier,Gn]);var or=function(qt){Wt.page=1,Wt.tag_discipline_id=qt,dn(Object(i.a)({},Wt)),Qn(Wt)},gr=function(){var Yt=Object(u.a)(r.a.mark(function qt(){var nn;return r.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return cn.next=2,Object(Ue.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:nn=cn.sent,er(nn.tag_disciplines||[]);case 4:case"end":return cn.stop()}},qt)}));return function(){return Yt.apply(this,arguments)}}(),Jn=function(qt){Wt.page=1,Wt.difficulty=typeof qt=="number"?qt:null,dn(Object(i.a)({},Wt)),Qn(Wt)},Qn=function(){var Yt=Object(u.a)(r.a.mark(function qt(nn){var xn,cn,Hn,bn,Mn,Tn;return r.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:return xr(!0),sr.next=3,Object(g.p)(nn);case 3:if(xn=sr.sent,xn!=null&&xn.practices_list){for(Hn=xn==null||((cn=xn.practices_list)===null||cn===void 0)?void 0:cn.length,bn=[],Mn=0;Mn<Hn;Mn+=Wt==null?void 0:Wt.per_page)bn.push(xn==null||((Tn=xn.practices_list)===null||Tn===void 0)?void 0:Tn.slice(Mn,Mn+(Wt==null?void 0:Wt.per_page)));dn(Object(i.a)(Object(i.a)({},Wt),{},{total:xn==null?void 0:xn.practices_count})),ar.current=(xn==null?void 0:xn.practices_list)||[],Tr(bn)}xr(!1);case 6:case"end":return sr.stop()}},qt)}));return function(nn){return Yt.apply(this,arguments)}}(),yn=function(){var Yt=Object(u.a)(r.a.mark(function qt(nn,xn){var cn;return r.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(Ue.a)("/api/practices/".concat(nn,"/start"),{method:"get"});case 2:cn=bn.sent,(cn==null?void 0:cn.status)===0&&b.d.push("/problems/".concat(cn==null?void 0:cn.identifier,"/oj/").concat(nn));case 4:case"end":return bn.stop()}},qt)}));return function(nn,xn){return Yt.apply(this,arguments)}}(),Ln=function(qt){Wt.page=qt,dn(Object(i.a)({},Wt))};return n.a.createElement("div",{className:ui.a.wrap,id:"oj-drawer",style:{left:Ht?0:-700}},n.a.createElement("div",{className:ui.a.head},n.a.createElement("div",{className:ui.a.title},"\u9898\u76EE\u5217\u8868"),n.a.createElement(re.a.Search,{value:Wt==null?void 0:Wt.save_search,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22",style:{width:178,marginLeft:"auto",marginRight:10},onChange:function(qt){Wt.save_search=qt.target.value,dn(Object(i.a)({},Wt))},onSearch:function(){Wt.page=1,Wt.search=Wt.save_search,dn(Object(i.a)({},Wt)),Qn(Wt)}}),n.a.createElement(S.a,{value:Wt==null?void 0:Wt.tag_discipline_id,style:{width:210},mode:"multiple",placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,showArrow:!0,getPopupContainer:function(qt){return qt.parentNode},maxTagTextLength:2,maxTagCount:2,onChange:or},_n.map(function(Yt){return n.a.createElement(S.a.Option,{key:Yt.id,value:Yt.id},Yt.name)})),n.a.createElement(S.a,{style:{width:70,marginLeft:10},allowClear:!0,placeholder:"\u96BE\u5EA6",getPopupContainer:function(qt){return qt.parentNode},value:Wt==null?void 0:Wt.difficulty,onChange:Jn},n.a.createElement(S.a.Option,{value:1},"\u7B80\u5355"),n.a.createElement(S.a.Option,{value:2},"\u9002\u4E2D"),n.a.createElement(S.a.Option,{value:3},"\u56F0\u96BE"))),n.a.createElement("div",{className:ui.a.content},n.a.createElement(x.a,{spinning:vr},Gn==null||((Rt=Gn[Wt.page-1])===null||Rt===void 0)?void 0:Rt.map(function(Yt){return n.a.createElement("div",{key:Yt.identifier,className:ui.a.list,onClick:function(nn){return yn(Yt.identifier,nn)}},n.a.createElement("i",{style:{visibility:fn===Yt.identifier?"visible":"hidden"},className:"iconfont icon-wancheng1 c-green-29b"}),n.a.createElement("span",{style:{fontWeight:fn===Yt.identifier?"bold":400,color:fn===Yt.identifier?"#ffffff":"#bac4cd"},title:Yt==null?void 0:Yt.name},Yt.name),(Yt==null?void 0:Yt.difficulty)===1&&n.a.createElement("b",{style:{color:"#2FA34F"}},"\u7B80\u5355"),(Yt==null?void 0:Yt.difficulty)===2&&n.a.createElement("b",{style:{color:"#0152d9"}},"\u9002\u4E2D"),(Yt==null?void 0:Yt.difficulty)===3&&n.a.createElement("b",{style:{color:"#FA6400"}},"\u56F0\u96BE"))}))),n.a.createElement("div",{className:ui.a.footer},n.a.createElement(Me.a,{showTotal:function(qt){return n.a.createElement("span",{style:{color:"#656F87"}},"\u5171",n.a.createElement("span",{className:"c-light-primary"},qt),"\u6761\u6570\u636E")},total:Wt.total,pageSize:Wt==null?void 0:Wt.per_page,current:Wt==null?void 0:Wt.page,showSizeChanger:!1,onChange:Ln,showQuickJumper:!0,hideOnSinglePage:!0})))},ta=Di,ci=function(ft){var gt,Rt=ft.hack,Ht=ft.onTriggerPraise,mn=ft.topicId,fn=ft.page,Ct=ft.onPageChange,_t=ft.user,Zt=ft.submitRecords,Tt=ft.submitting,sn=ft.submitResult,Wt=Object(v.h)(),dn=Object(t.useState)((Wt==null||((gt=Wt.query)===null||gt===void 0)?void 0:gt.tab)||"0"),$n=Object(o.a)(dn,2),Dn=$n[0],_n=$n[1],er=Object(t.useState)(0),Rn=Object(o.a)(er,2),Pn=Rn[0],Gn=Rn[1],Tr=Object(t.useState)(0),ir=Object(o.a)(Tr,2),dr=ir[0],vr=ir[1],xr=Object(t.useState)(0),ar=Object(o.a)(xr,2),fr=ar[0],Wn=ar[1],Jt=Object(t.useState)(),gn=Object(o.a)(Jt,2),tr=gn[0],or=gn[1],gr=Object(t.useState)(!1),Jn=Object(o.a)(gr,2),Qn=Jn[0],yn=Jn[1];function Ln(qt){var nn=qt.target.id;if(Dn==="3"&&nn!==Dn&&(dr===1||dr===2)){p.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:function(){_n(nn)}});return}_n(nn)}Object(t.useEffect)(function(){var qt=Ze.a.subscribe("to-commit-info",function(){_n("1")});return qt},[]);function Yt(){_n("2")}return n.a.createElement("div",{className:Te.a["left-panel"]},n.a.createElement("ul",{className:"".concat(Te.a["s-navs"]," ").concat(Te.a["bg-white"]," ").concat(Te.a.b1)},n.a.createElement("li",{className:"mr40 current"},n.a.createElement("img",{onClick:function(){return yn(!0)},src:Qe.a})),n.a.createElement("li",{className:Te.a["oj-mr"]},n.a.createElement("a",{className:Dn==="0"?Te.a.active:"",id:"0",onClick:Ln},"\u4EFB\u52A1\u63CF\u8FF0")),n.a.createElement("li",{className:Te.a["oj-mr"]},n.a.createElement("a",{className:Dn==="3"?Te.a.active:"",id:"3",onClick:Ln},"\u9898\u89E3",fr?"(".concat(fr,")"):"")),n.a.createElement("li",{className:Te.a["oj-mr"]},n.a.createElement("a",{className:Dn==="2"?Te.a.active:"",id:"2",onClick:Ln},"\u8BC4\u8BBA",Pn?"(".concat(Pn,")"):"")),n.a.createElement("li",null,n.a.createElement("a",{className:Dn==="1"?Te.a.active:"",id:"1",onClick:Ln},"\u63D0\u4EA4\u8BB0\u5F55"))),n.a.createElement("div",{className:"".concat(Te.a["tab-panel-body"]," ").concat(Dn==="0"?"":"hide"),style:{padding:"0 0 0 16px"}},n.a.createElement(Be,{hack:Rt,onTriggerPraise:Ht,toDiscuss:Yt})),n.a.createElement("div",{className:"".concat(Te.a["tab-panel-body"]," ").concat(Dn==="1"?"":"hide")},Zt!=null&&Zt.records_count?n.a.createElement(ee,{page:fn,onPageChange:Ct,topicId:mn,submitting:Tt,submitRecords:Zt,submitResult:sn}):n.a.createElement(k.a,null)),n.a.createElement("div",{className:"".concat(Te.a["tab-panel-body"]," ").concat(Dn==="2"?"":"hide"),style:{padding:0}},n.a.createElement(Ut,{setDiscussTotal:Gn,user:_t,identifier:Rt.identifier,hack:Rt,onTriggerPraise:Ht})),n.a.createElement("div",{className:"".concat(Te.a["tab-panel-body"]," ").concat(Dn==="3"?"":"hide"),style:{padding:0}},n.a.createElement(ni,{setListStatus:vr,setFilterListTotal:Wn,tabStatus:Dn,identifier:Rt.identifier})),n.a.createElement(ta,{visible:Qn,setIndex:_n,onVisible:function(nn){return yn(nn)},value:tr,onChange:function(nn){return or(nn)}}))},Fi=function(gt){return String(gt).length===1?"0".concat(gt):gt},Ci=function(gt){var Rt=gt.className,Ht=Rt===void 0?"":Rt,mn=gt.onChange,fn=Object(t.useState)(0),Ct=Object(o.a)(fn,2),_t=Ct[0],Zt=Ct[1];Object(t.useEffect)(function(){var dn=setTimeout(function(){Zt(_t+1e3)},1e3);return mn(_t+1e3),function(){clearInterval(dn)}},[_t]);var Tt=parseInt(_t/(60*6e4))||"00",sn=parseInt(_t%(60*6e4)/6e4)||"00",Wt=parseInt(_t%6e4/1e3)||"00";return n.a.createElement("div",{className:Ht},Fi(Tt),":",Fi(sn),":",Fi(Wt))},zi=Ci,qi=F("oFv4"),yi=F.n(qi),aa=F("S/kP"),ma=F.n(aa),un=F("t/PP"),Cn=F.n(un),pn=F("LvDl"),Un=F.n(pn),ur=F("P5Jw"),mr=s.a.Countdown,Zn={Java:"java",C:"c",Python:"py","C++":"c"},hn;(function(ft){ft[ft.SET_LOADING=0]="SET_LOADING",ft[ft.GET_DATA=1]="GET_DATA",ft[ft.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",ft[ft.SET_DATA=3]="SET_DATA",ft[ft.SET_DEBUGING=4]="SET_DEBUGING",ft[ft.SET_SUBMITING=5]="SET_SUBMITING",ft[ft.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",ft[ft.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",ft[ft.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",ft[ft.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",ft[ft.SET_PAGE=10]="SET_PAGE",ft[ft.GET_LANGUAGE=11]="GET_LANGUAGE",ft[ft.GET_DRAWER=12]="GET_DRAWER"})(hn||(hn={}));function Fr(){return new Date().getTime()}var Bn={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:"",languageValue:"",languageList:[],drawerData:[]};function Bi(ft,gt){switch(gt.type){case hn.GET_DATA:return Object(i.a)(Object(i.a)({},ft),gt.payload);case hn.SET_DATA:return Object(i.a)(Object(i.a)({},ft),{},{data:gt.payload});case hn.SET_LOADING:return Object(i.a)(Object(i.a)({},ft),{},{loading:gt.payload});case hn.GET_LANGUAGE:return Object(i.a)(Object(i.a)({},ft),{},{languageList:gt.payload});case hn.GET_DRAWER:return Object(i.a)(Object(i.a)({},ft),{},{drawerData:gt.payload});case hn.SET_SHOW_NOTE:return Object(i.a)(Object(i.a)({},ft),{},{showNote:gt.payload});case hn.SET_DEBUGING:return Object(i.a)(Object(i.a)({},ft),{},{debuging:gt.payload});case hn.SET_SUBMITING:return Object(i.a)(Object(i.a)({},ft),{},{submitting:gt.payload});case hn.GET_SUBMIT_RECORDS:return Object(i.a)(Object(i.a)({},ft),{},{submitRecords:gt.payload});case hn.SET_PAGE:return Object(i.a)(Object(i.a)({},ft),{},{submitRecordPage:gt.payload});case hn.SET_EXECUTE_MESSAGE:return Object(i.a)(Object(i.a)({},ft),{},{executingMessage:gt.payload});case hn.SET_EXECUTE_RESULT:return Object(i.a)(Object(i.a)({},ft),gt.payload);case hn.SET_SUBMIT_RESULT:return Object(i.a)(Object(i.a)({},ft),gt.payload);default:throw new Error}}var cr=Le.default=function(ft){var gt,Rt,Ht=ft.children,mn=Object(t.useReducer)(Bi,Bn),fn=Object(o.a)(mn,2),Ct=fn[0],_t=fn[1],Zt=Object(v.i)(),Tt=Zt.id,sn=Object(v.g)(),Wt=Object(v.h)(),dn=Ct.languageValue,$n=Ct.languageList,Dn=Ct.loading,_n=Ct.data,er=Ct.debugResult,Rn=Ct.submitResult,Pn=Ct.submitRecords,Gn=Ct.submitRecordPage,Tr=Ct.showNote,ir=Ct.debuging,dr=Ct.submitting,vr=Ct.executingMessage,xr=Object(t.useState)("#FFF"),ar=Object(o.a)(xr,2),fr=ar[0],Wn=ar[1],Jt=Object(t.useState)(null),gn=Object(o.a)(Jt,2),tr=gn[0],or=gn[1],gr=Object(t.useState)({}),Jn=Object(o.a)(gr,2),Qn=Jn[0],yn=Jn[1],Ln=Object(t.useState)(!1),Yt=Object(o.a)(Ln,2),qt=Yt[0],nn=Yt[1],xn=Object(t.useRef)(null),cn=Object(t.useRef)(null),Hn=_n==null?void 0:_n.user,bn=_n==null?void 0:_n.hack;Object(t.useEffect)(function(){return Object(b.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),Object(b.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){Object(b.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),Object(b.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}},[]),Object(t.useEffect)(function(){setTimeout(function(){document.title="\u5728\u7EBF\u5237\u9898"},400)}),Object(t.useEffect)(function(){if(qt){var Kn,wn=document.getElementById("oj-next"),Yn=document.getElementById("oj-modal-next");(wn==null||((Kn=wn.style)===null||Kn===void 0)?void 0:Kn.display)==="none"?Yn.style.display="none":Yn.style.display="block"}},[qt]),Object(t.useEffect)(function(){function Kn(){return wn.apply(this,arguments)}function wn(){return wn=Object(u.a)(r.a.mark(function Yn(){var rn,kn,Ar,Gr,Vr;return r.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return vn.next=2,Object(g.m)(Tt);case 2:rn=vn.sent,rn.status===401?document.location.href="/user/login":(rn.hack=rn.practice,rn.hack.code=O.Base64.decode(rn==null||((kn=rn.hack)===null||kn===void 0)?void 0:kn.code),Vr="".concat(Hn==null?void 0:Hn.login,"-language"),localStorage.getItem(Vr)&&(rn.hack.language=localStorage.getItem(Vr)),cn.current=Un.a.cloneDeep(rn),cn.current.language=rn==null||((Ar=rn.hack)===null||Ar===void 0)?void 0:Ar.language,_t({type:hn.GET_DATA,payload:{loading:!1,data:rn}}),_t({type:hn.SET_SUBMIT_RESULT,payload:{languageValue:rn==null||((Gr=rn.hack)===null||Gr===void 0)?void 0:Gr.language}}));case 4:case"end":return vn.stop()}},Yn)})),wn.apply(this,arguments)}Tt&&Kn()},[Tt]),Object(t.useEffect)(function(){_t({type:hn.SET_SUBMIT_RESULT,payload:{debugResult:void 0}}),sr(),nn(!1)},[Tt]),Object(t.useEffect)(function(){clearTimeout(xn.current)},[Tt]),Object(t.useEffect)(function(){Tn()},[Tt,Gn]);var Mn=function(){window.parent.postMessage("backExercise","*")};function Tn(){return Vn.apply(this,arguments)}function Vn(){return Vn=Object(u.a)(r.a.mark(function Kn(){var wn;return r.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.prev=0,rn.next=3,Object(g.o)(Tt,{limit:15,page:Gn});case 3:wn=rn.sent,_t({type:hn.GET_SUBMIT_RECORDS,payload:wn}),rn.next=10;break;case 7:rn.prev=7,rn.t0=rn.catch(0),console.log(rn.t0);case 10:case"end":return rn.stop()}},Kn,null,[[0,7]])})),Vn.apply(this,arguments)}function sr(){return br.apply(this,arguments)}function br(){return br=Object(u.a)(r.a.mark(function Kn(){var wn;return r.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.prev=0,rn.next=3,Object(g.w)(Tt);case 3:wn=rn.sent,_t({type:hn.GET_LANGUAGE,payload:wn==null?void 0:wn.data}),rn.next=10;break;case 7:rn.prev=7,rn.t0=rn.catch(0),console.log(rn.t0);case 10:case"end":return rn.stop()}},Kn,null,[[0,7]])})),br.apply(this,arguments)}function kr(Kn){_t({type:hn.SET_PAGE,payload:Kn})}function ei(Kn){return Mi.apply(this,arguments)}function Mi(){return Mi=Object(u.a)(r.a.mark(function Kn(wn){var Yn,rn,kn,Ar,Gr,Vr;return r.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return Gr=((Yn=window)===null||Yn===void 0||((rn=Yn.location)===null||rn===void 0||((kn=rn.pathname)===null||kn===void 0||((Ar=kn.split("/"))===null||Ar===void 0)))?void 0:Ar[2])||Tt,vn.next=3,Object(g.v)(Gr,wn||{code:O.Base64.encode(bn.code),language:dn});case 3:return Vr=vn.sent,vn.abrupt("return",Vr);case 5:case"end":return vn.stop()}},Kn)})),Mi.apply(this,arguments)}function $r(){return Wi.apply(this,arguments)}function Wi(){return Wi=Object(u.a)(r.a.mark(function Kn(){var wn,Yn,rn,kn,Ar,Gr,Vr;return r.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:if(!dr){vn.next=2;break}return vn.abrupt("return");case 2:return _t({type:hn.SET_SUBMITING,payload:!0}),vn.prev=3,Ze.a.publish("to-commit-info"),vn.next=7,ei();case 7:if(wn=vn.sent,!(wn.status===0)){vn.next=21;break}return Vr=function(){return Vr=Object(u.a)(r.a.mark(function oa(){var Yi,Ki,$i,sa,la,Zi;return r.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:return Ir.next=2,Object(g.l)(Tt,"submit");case 2:if(Yi=Ir.sent,Ki=Yi.status,$i=Yi.data,sa=Fr(),la=sa-Ar>(kn+3)*1e3,Ki!==0&&!la&&setTimeout(Gr,1e3),!la){Ir.next=12;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),_t({type:hn.SET_SUBMITING,payload:!1}),Ir.abrupt("return");case 12:if(!(Ki===0)){Ir.next=19;break}return $i.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Ir.next=16,Object(g.o)(Tt,{limit:15,page:Gn});case 16:Zi=Ir.sent,_t({type:hn.SET_SUBMIT_RESULT,payload:Object(i.a)(Object(i.a)({},Ct),{},{submitResult:$i,submitting:!1,submitRecords:Zi})}),($i==null?void 0:$i.status)===0&&nn(!0);case 19:case"end":return Ir.stop()}},oa)})),Vr.apply(this,arguments)},Gr=function(){return Vr.apply(this,arguments)},Yn={},vn.next=14,Object(g.s)(Tt,Yn);case 14:if(rn=vn.sent,!(rn.status===-1)){vn.next=18;break}return window.parent.location.href="/classrooms/".concat(Wt.query.coursesId,"/exercise/").concat(Wt.query.exercisesId,"/detail"),vn.abrupt("return");case 18:kn=bn.time_limit,Ar=Fr(),Gr();case 21:vn.next=26;break;case 23:vn.prev=23,vn.t0=vn.catch(3),_t({type:hn.SET_SUBMITING,payload:!1});case 26:case"end":return vn.stop()}},Kn,null,[[3,23]])})),Wi.apply(this,arguments)}function na(){return Gi.apply(this,arguments)}function Gi(){return Gi=Object(u.a)(r.a.mark(function Kn(){var wn,Yn,rn,kn,Ar,Gr,Vr;return r.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return Ct.debuging=!0,_t({type:hn.SET_DEBUGING,payload:!0}),vn.prev=2,vn.next=5,ei();case 5:if(wn=vn.sent,!(wn.status===0)){vn.next=21;break}return Vr=function(){return Vr=Object(u.a)(r.a.mark(function oa(){var Yi,Ki,$i,sa,la,Zi;return r.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:return Ir.next=2,Object(g.l)(Tt,"debug");case 2:if(Yi=Ir.sent,Ki=Yi.status,$i=Yi.message,sa=Yi.data,la=Fr(),Zi=la-Ar>(Yn+3)*1e3,Ki!==0&&!Zi&&(_t({type:hn.SET_EXECUTE_MESSAGE,payload:$i}),setTimeout(Gr,1e3)),!Zi){Ir.next=13;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),_t({type:hn.SET_DEBUGING,payload:!1}),Ir.abrupt("return");case 13:Ki===0&&(_t({type:hn.SET_DEBUGING,payload:!1}),sa.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),_t({type:hn.SET_EXECUTE_RESULT,payload:Object(i.a)(Object(i.a)({},Ct),{},{debugResult:sa,debuging:!1})}));case 14:case"end":return Ir.stop()}},oa)})),Vr.apply(this,arguments)},Gr=function(){return Vr.apply(this,arguments)},Yn=bn.time_limit,rn={input:encodeURIComponent(_n.test_case.input)},vn.next=13,Object(g.h)(Tt,rn);case 13:if(kn=vn.sent,!(kn.status===-1)){vn.next=17;break}return window.parent.location.href="/classrooms/".concat(Wt.query.coursesId,"/exercise/").concat(Wt.query.exercisesId,"/detail"),vn.abrupt("return");case 17:Ar=Fr(),Gr(),vn.next=22;break;case 21:_t({type:hn.SET_DEBUGING,payload:!1});case 22:vn.next=27;break;case 24:vn.prev=24,vn.t0=vn.catch(2),console.log(vn.t0);case 27:return vn.prev=27,vn.finish(27);case 29:case"end":return vn.stop()}},Kn,null,[[2,24,27,29]])})),Gi.apply(this,arguments)}function di(Kn){var wn;clearTimeout(xn.current),xn.current=setTimeout(function(){var Yn;ei({code:O.Base64.encode(Kn),language:cn==null||((Yn=cn.current)===null||Yn===void 0)?void 0:Yn.language})},2e3),_t({type:hn.SET_DATA,payload:Object(i.a)(Object(i.a)({},cn==null?void 0:cn.current),{},{hack:Object(i.a)(Object(i.a)({},cn==null||((wn=cn.current)===null||wn===void 0)?void 0:wn.hack),{},{code:Kn})})})}function Vi(Kn){var wn=Kn.target.value;_t({type:hn.SET_DATA,payload:Object(i.a)(Object(i.a)({},_n),{},{test_case:{input:wn}})})}var Xn=function(){var Kn=Object(u.a)(r.a.mark(function wn(Yn){var rn,kn,Ar,Gr,Vr;return r.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return _t({type:hn.SET_LOADING,payload:!0}),vn.next=3,ei();case 3:if(rn=vn.sent,!(rn.status===0)){vn.next=14;break}return _t({type:hn.SET_SUBMIT_RESULT,payload:{languageValue:Yn}}),cn.current.language=Yn,kn="".concat(Hn==null?void 0:Hn.login,"-language"),localStorage.setItem(kn,Yn),vn.next=11,Object(g.w)(Tt);case 11:Ar=vn.sent,Ar.status===0&&(Vr=Ar==null||((Gr=Ar.data)===null||Gr===void 0)?void 0:Gr.find(function(Hi){return Hi.language===Yn}),di(O.Base64.decode(Vr.code))),setTimeout(function(){_t({type:hn.SET_LOADING,payload:!1})},300);case 14:case"end":return vn.stop()}},wn)}));return function(Yn){return Kn.apply(this,arguments)}}();function An(){return nr.apply(this,arguments)}function nr(){return nr=Object(u.a)(r.a.mark(function Kn(){var wn;return r.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.prev=0,rn.next=3,Object(g.q)(Tt,{language:dn});case 3:wn=rn.sent,wn.status===401?sn.replace("/login",{from:Wt.pathname}):(di(O.Base64.decode(wn.code)),sr()),rn.next=10;break;case 7:rn.prev=7,rn.t0=rn.catch(0),console.log(rn.t0);case 10:case"end":return rn.stop()}},Kn,null,[[0,7]])})),nr.apply(this,arguments)}function lr(){p.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",n.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(u.a)(r.a.mark(function wn(){var Yn;return r.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(g.t)(Tt,{language:dn});case 2:Yn=kn.sent,Yn.status===401?sn.replace("/login",{from:Wt.pathname}):di(O.Base64.decode(Yn.code));case 4:case"end":return kn.stop()}},wn)}))()}})}function Wr(){_t({type:hn.SET_SHOW_NOTE,payload:!0})}function In(){_t({type:hn.SET_SHOW_NOTE,payload:!1})}function ri(Kn){return Ur.apply(this,arguments)}function Ur(){return Ur=Object(u.a)(r.a.mark(function Kn(wn){return r.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.next=2,Object(g.b)(Tt,wn);case 2:_t({type:hn.GET_DATA,payload:{showNote:!1,data:Object(i.a)(Object(i.a)({},_n),{},{hack:Object(i.a)(Object(i.a)({},bn),{},{notes:wn.notes})})}});case 3:case"end":return rn.stop()}},Kn)})),Ur.apply(this,arguments)}var Jr={input:_n==null||((gt=_n.test_case)===null||gt===void 0)?void 0:gt.input,language:bn==null?void 0:bn.language,code:bn==null?void 0:bn.code,title:"main."+Zn[bn==null?void 0:bn.language],modify_code:bn==null?void 0:bn.modify_code,notes:bn==null?void 0:bn.notes,debugResult:er,debuging:ir,submitting:dr,executingMessage:vr,id:Tt,languageValue:dn,languageList:$n,onChangeLanguage:Xn,onCancelNote:In,onAddNote:ri,showNote:Tr,onShowNote:Wr,onSubmitCode:$r,onChangeCode:di,onChangeInput:Vi,onDebugCode:na,onResetCode:An,onSyncCode:lr,onUpdateCode:ei};function wi(){return Ii.apply(this,arguments)}function Ii(){return Ii=Object(u.a)(r.a.mark(function Kn(){var wn,Yn,rn;return r.a.wrap(function(Ar){for(;;)switch(Ar.prev=Ar.next){case 0:return Ar.next=2,Object(g.u)(bn.id,{container_type:"Hack",type:1});case 2:wn=Ar.sent,Yn=wn.praise_count,rn=Object(i.a)(Object(i.a)({},_n),{},{hack:Object(i.a)(Object(i.a)({},bn),{},{praises_count:Yn,user_praise:!bn.user_praise})}),_t({type:hn.SET_DATA,payload:rn});case 6:case"end":return Ar.stop()}},Kn)})),Ii.apply(this,arguments)}var Xi={topicId:Tt,submitResult:Rn,submitRecords:Pn,submitting:dr,page:Gn,onPageChange:kr,hack:bn,user:_n==null?void 0:_n.user,onTriggerPraise:wi};return console.log(_n,cn==null?void 0:cn.current,"data--------"),n.a.createElement(n.a.Fragment,null,n.a.createElement(x.a,{className:"oj-custom-large-spin",size:"large",spinning:Dn},_n?n.a.createElement("div",{className:"oj-custom-warp"},n.a.createElement("header",{className:P.a.header,style:{minWidth:1200}},n.a.createElement("div",null,n.a.createElement("img",{src:"".concat(C.a.IMG_SERVER,"/images/").concat(Hn.image_url),alt:"user",width:30}),n.a.createElement("span",null,Hn.name)),n.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},n.a.createElement("div",null,bn.name),n.a.createElement(zi,{onChange:function(wn){},className:"font12 c-grey-999"})),n.a.createElement(ur.CopyToClipboard,{text:"".concat((Rt=window.location)===null||Rt===void 0?void 0:Rt.origin,"/problems/").concat(bn.identifier,"/share"),onCopy:function(){return w.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},n.a.createElement("span",{className:P.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",n.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),bn.edit_privilege?n.a.createElement(E.a,{className:P.a.btn_back,to:"/problems/".concat(bn.identifier,"/ojedit"),style:{marginRight:10}}," ",n.a.createElement(c.a,null)," \u7F16\u8F91"):null,n.a.createElement(E.a,{className:P.a.btn_back,to:"/problems"}," ",n.a.createElement(m.a,null),"\u9000\u51FA")),n.a.createElement(y.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:n.a.createElement(ci,Xi),rightChild:n.a.createElement(bi,Jr)})):null),n.a.createElement(p.a,{centered:!0,closable:!1,width:680,footer:null,visible:qt,className:"oj-modal"},n.a.createElement("section",{className:"oj-modal-content"},n.a.createElement("div",{className:"oj-modal-head"},n.a.createElement("img",{src:yi.a,alt:""}),n.a.createElement("i",{onClick:function(){return nn(!1)},className:"iconfont icon-guanbi1"})),n.a.createElement("aside",null,n.a.createElement("img",{className:"mr30",src:Cn.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",n.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Rn==null?void 0:Rn.execute_time,"s"),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Rn==null?void 0:Rn.time_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("aside",{className:"mb50"},n.a.createElement("img",{src:ma.a,className:"mr30"}),n.a.createElement("span",{className:"oj-modal-tt"},n.a.createElement("span",null,n.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),n.a.createElement("span",{className:"c-light-primary"},Rn==null?void 0:Rn.execute_memory,"kb")),n.a.createElement("span",null,n.a.createElement("span",null))),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Rn==null?void 0:Rn.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function Br(ft){var gt=ft.languageValue,Rt=ft.languageList,Ht=ft.onChangeLanguage,mn=ft.title,fn=ft.modify_code,Ct=ft.onSyncCode,_t=ft.onShowCodeSetting,Zt=ft.onResetCode,Tt=Object(v.h)(),sn=function(){p.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:n.a.createElement(d.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Zt})};return n.a.createElement("div",{className:"action-bar"},n.a.createElement(S.a,{className:"oj-select",value:gt,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:Ht},Rt==null?void 0:Rt.map(function(Wt){return n.a.createElement(S.a.Option,{key:Wt.language,value:Wt.language},Wt.language)})),n.a.createElement("span",null),n.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:sn},n.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),n.a.createElement("a",{onClick:_t},n.a.createElement("i",{className:"iconfont icon-shezhi"})))}function bi(ft){var gt=ft.id,Rt=ft.input,Ht=ft.showNote,mn=ft.onShowNote,fn=ft.notes,Ct=ft.onCancelNote,_t=ft.onAddNote,Zt=ft.debugResult,Tt=ft.language,sn=ft.debuging,Wt=ft.submitting,dn=ft.executingMessage,$n=ft.code,Dn=ft.onSubmitCode,_n=ft.onDebugCode,er=ft.onChangeCode,Rn=ft.onChangeInput,Pn=ft.onUpdateCode,Gn=Object(Q.a)(ft,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function Tr(dr){return n.a.createElement(Br,Object(ue.a)({},Gn,{onShowCodeSetting:dr}))}var ir={id:gt,input:Rt,debugResult:Zt,debuging:sn,submitting:Wt,executingMessage:dn,onDebugCode:_n,onChangeCode:er,onSubmitCode:Dn,onChangeInput:Rn};return n.a.createElement("div",{className:"right-panel"},n.a.createElement(_.a,{language:Tt,value:$n,onChange:er,ActionBarRender:Tr}),n.a.createElement("div",{className:"note-form-area ".concat(Ht?"active":"")},n.a.createElement(he,{onCancel:Ct,notes:fn,callback:_t})),n.a.createElement(W.b,ir))}},WaYH:function(nt,Le,F){"use strict";var ue=F("rePB"),Q=F("Ff2n"),j=F("VTBJ"),S=F("1OyB"),D=F("vuIU"),x=F("JX7q"),T=F("Ji7U"),w=F("LK+K"),f=F("q1tI"),p=F("TSYQ"),u=F.n(p),o=F("sboe"),i=F("OZM5"),l=function(E){var g=E.prefixCls,y=E.level,C=E.isStart,d=E.isEnd;if(!y)return null;for(var _="".concat(g,"-indent-unit"),O=[],A=0;A<y;A+=1){var P;O.push(f.createElement("span",{key:A,className:u()(_,(P={},Object(ue.a)(P,"".concat(_,"-start"),C[A+1]),Object(ue.a)(P,"".concat(_,"-end"),d[A+1]),Object(ue.a)(P,"".concat(_,"-end-first-level"),!A&&d[0]),P))}))}return f.createElement("span",{"aria-hidden":"true",className:"".concat(g,"-indent")},O)},s=l,h=F("815F"),r="open",t="close",n="---",c=function(b){Object(T.a)(g,b);var E=Object(w.a)(g);function g(){var y;return Object(S.a)(this,g),y=E.apply(this,arguments),y.state={dragNodeHighlight:!1},y.onSelectorClick=function(C){var d=y.props.context.onNodeClick;d(C,Object(h.b)(y.props)),y.isSelectable()?y.onSelect(C):y.onCheck(C)},y.onSelectorDoubleClick=function(C){var d=y.props.context.onNodeDoubleClick;d(C,Object(h.b)(y.props))},y.onSelect=function(C){if(y.isDisabled())return;var d=y.props.context.onNodeSelect;C.preventDefault(),d(C,Object(h.b)(y.props))},y.onCheck=function(C){if(y.isDisabled())return;var d=y.props,_=d.disableCheckbox,O=d.checked,A=y.props.context.onNodeCheck;if(!y.isCheckable()||_)return;C.preventDefault();var P=!O;A(C,Object(h.b)(y.props),P)},y.onMouseEnter=function(C){var d=y.props.context.onNodeMouseEnter;d(C,Object(h.b)(y.props))},y.onMouseLeave=function(C){var d=y.props.context.onNodeMouseLeave;d(C,Object(h.b)(y.props))},y.onContextMenu=function(C){var d=y.props.context.onNodeContextMenu;d(C,Object(h.b)(y.props))},y.onDragStart=function(C){var d=y.props.context.onNodeDragStart;C.stopPropagation(),y.setState({dragNodeHighlight:!0}),d(C,Object(x.a)(y));try{C.dataTransfer.setData("text/plain","")}catch(_){}},y.onDragEnter=function(C){var d=y.props.context.onNodeDragEnter;C.preventDefault(),C.stopPropagation(),d(C,Object(x.a)(y))},y.onDragOver=function(C){var d=y.props.context.onNodeDragOver;C.preventDefault(),C.stopPropagation(),d(C,Object(x.a)(y))},y.onDragLeave=function(C){var d=y.props.context.onNodeDragLeave;C.stopPropagation(),d(C,Object(x.a)(y))},y.onDragEnd=function(C){var d=y.props.context.onNodeDragEnd;C.stopPropagation(),y.setState({dragNodeHighlight:!1}),d(C,Object(x.a)(y))},y.onDrop=function(C){var d=y.props.context.onNodeDrop;C.preventDefault(),C.stopPropagation(),y.setState({dragNodeHighlight:!1}),d(C,Object(x.a)(y))},y.onExpand=function(C){var d=y.props.context.onNodeExpand;d(C,Object(h.b)(y.props))},y.setSelectHandle=function(C){y.selectHandle=C},y.getNodeState=function(){var C=y.props.expanded;return y.isLeaf()?null:C?r:t},y.hasChildren=function(){var C=y.props.eventKey,d=y.props.context.keyEntities,_=d[C]||{},O=_.children;return!!(O||[]).length},y.isLeaf=function(){var C=y.props,d=C.isLeaf,_=C.loaded,O=y.props.context.loadData,A=y.hasChildren();return d===!1?!1:d||!O&&!A||O&&_&&!A},y.isDisabled=function(){var C=y.props.disabled,d=y.props.context.disabled;return!!(d||C)},y.isCheckable=function(){var C=y.props.checkable,d=y.props.context.checkable;return!d||C===!1?!1:d},y.syncLoadData=function(C){var d=C.expanded,_=C.loading,O=C.loaded,A=y.props.context,P=A.loadData,I=A.onNodeLoad;if(_)return;P&&d&&!y.isLeaf()&&(!y.hasChildren()&&!O&&I(Object(h.b)(y.props)))},y.renderSwitcher=function(){var C=y.props,d=C.expanded,_=C.switcherIcon,O=y.props.context,A=O.prefixCls,P=O.switcherIcon,I=_||P;if(y.isLeaf())return f.createElement("span",{className:u()("".concat(A,"-switcher"),"".concat(A,"-switcher-noop"))},typeof I=="function"?I(Object(j.a)(Object(j.a)({},y.props),{},{isLeaf:!0})):I);var W=u()("".concat(A,"-switcher"),"".concat(A,"-switcher_").concat(d?r:t));return f.createElement("span",{onClick:y.onExpand,className:W},typeof I=="function"?I(Object(j.a)(Object(j.a)({},y.props),{},{isLeaf:!1})):I)},y.renderCheckbox=function(){var C=y.props,d=C.checked,_=C.halfChecked,O=C.disableCheckbox,A=y.props.context.prefixCls,P=y.isDisabled(),I=y.isCheckable();if(!I)return null;var W=typeof I!="boolean"?I:null;return f.createElement("span",{className:u()("".concat(A,"-checkbox"),d&&"".concat(A,"-checkbox-checked"),!d&&_&&"".concat(A,"-checkbox-indeterminate"),(P||O)&&"".concat(A,"-checkbox-disabled")),onClick:y.onCheck},W)},y.renderIcon=function(){var C=y.props.loading,d=y.props.context.prefixCls;return f.createElement("span",{className:u()("".concat(d,"-iconEle"),"".concat(d,"-icon__").concat(y.getNodeState()||"docu"),C&&"".concat(d,"-icon_loading"))})},y.renderSelector=function(){var C=y.state.dragNodeHighlight,d=y.props,_=d.title,O=d.selected,A=d.icon,P=d.loading,I=d.data,W=y.props.context,K=W.prefixCls,te=W.showIcon,H=W.icon,G=W.draggable,V=W.loadData,re=W.titleRender,$=y.isDisabled(),ne="".concat(K,"-node-content-wrapper"),he;if(te){var pe=A||H;he=pe?f.createElement("span",{className:u()("".concat(K,"-iconEle"),"".concat(K,"-icon__customize"))},typeof pe=="function"?pe(y.props):pe):y.renderIcon()}else V&&P&&(he=y.renderIcon());var Te;typeof _=="function"?Te=_(I):re?Te=re(I):Te=_;var we=f.createElement("span",{className:"".concat(K,"-title")},Te);return f.createElement("span",{ref:y.setSelectHandle,title:typeof _=="string"?_:"",className:u()("".concat(ne),"".concat(ne,"-").concat(y.getNodeState()||"normal"),!$&&(O||C)&&"".concat(K,"-node-selected"),!$&&G&&"draggable"),draggable:!$&&G||void 0,"aria-grabbed":!$&&G||void 0,onMouseEnter:y.onMouseEnter,onMouseLeave:y.onMouseLeave,onContextMenu:y.onContextMenu,onClick:y.onSelectorClick,onDoubleClick:y.onSelectorDoubleClick,onDragStart:G?y.onDragStart:void 0},he,we)},y}return Object(D.a)(g,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var C=this.props.selectable,d=this.props.context.selectable;return typeof C=="boolean"?C:d}},{key:"render",value:function(){var C,d=this.props,_=d.eventKey,O=d.className,A=d.style,P=d.dragOver,I=d.dragOverGapTop,W=d.dragOverGapBottom,K=d.isLeaf,te=d.isStart,H=d.isEnd,G=d.expanded,V=d.selected,re=d.checked,$=d.halfChecked,ne=d.loading,he=d.domRef,pe=d.active,Te=d.onMouseMove,we=Object(Q.a)(d,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Me=this.props.context,Ee=Me.prefixCls,xe=Me.filterTreeNode,Ge=Me.draggable,je=Me.keyEntities,We=this.isDisabled(),ze=Object(i.f)(we),de=je[_]||{},le=de.level,Oe=H[H.length-1];return f.createElement("div",Object.assign({ref:he,className:u()(O,"".concat(Ee,"-treenode"),(C={},Object(ue.a)(C,"".concat(Ee,"-treenode-disabled"),We),Object(ue.a)(C,"".concat(Ee,"-treenode-switcher-").concat(G?"open":"close"),!K),Object(ue.a)(C,"".concat(Ee,"-treenode-checkbox-checked"),re),Object(ue.a)(C,"".concat(Ee,"-treenode-checkbox-indeterminate"),$),Object(ue.a)(C,"".concat(Ee,"-treenode-selected"),V),Object(ue.a)(C,"".concat(Ee,"-treenode-loading"),ne),Object(ue.a)(C,"".concat(Ee,"-treenode-active"),pe),Object(ue.a)(C,"".concat(Ee,"-treenode-leaf-last"),Oe),Object(ue.a)(C,"drag-over",!We&&P),Object(ue.a)(C,"drag-over-gap-top",!We&&I),Object(ue.a)(C,"drag-over-gap-bottom",!We&&W),Object(ue.a)(C,"filter-node",xe&&xe(Object(h.b)(this.props))),C)),style:A,onDragEnter:Ge?this.onDragEnter:void 0,onDragOver:Ge?this.onDragOver:void 0,onDragLeave:Ge?this.onDragLeave:void 0,onDrop:Ge?this.onDrop:void 0,onDragEnd:Ge?this.onDragEnd:void 0,onMouseMove:Te},ze),f.createElement(s,{prefixCls:Ee,level:le,isStart:te,isEnd:H}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),g}(f.Component),m=function(E){return f.createElement(o.a.Consumer,null,function(g){return f.createElement(c,Object.assign({},E,{context:g}))})};m.displayName="TreeNode",m.defaultProps={title:n},m.isTreeNode=1;var v=Le.a=m},Wtmd:function(nt,Le,F){nt.exports=F.p+"static/c.03ba6fd6.svg"},Wx9E:function(nt,Le,F){},XFxt:function(nt,Le,F){nt.exports={"image-preview-container":"image-preview-container___1L8o9","image-preview":"image-preview___3YjNO","button-group":"button-group___3y9R5","preview-wrp-group":"preview-wrp-group___19bWd"}},XIdC:function(nt,Le,F){"use strict";var ue=F("rePB"),Q=F("ODXe"),j=F("Ff2n"),S=F("q1tI"),D=F.n(S),x=F("TSYQ"),T=F.n(x),w=F("6cGi"),f=F("4IlW"),p=S.forwardRef(function(u,o){var i,l=u.prefixCls,s=l===void 0?"rc-switch":l,h=u.className,r=u.checked,t=u.defaultChecked,n=u.disabled,c=u.loadingIcon,m=u.checkedChildren,v=u.unCheckedChildren,b=u.onClick,E=u.onChange,g=u.onKeyDown,y=Object(j.a)(u,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),C=Object(w.a)(!1,{value:r,defaultValue:t}),d=Object(Q.a)(C,2),_=d[0],O=d[1];function A(K,te){var H=_;return n||(H=K,O(H),E==null||E(H,te)),H}function P(K){K.which===f.a.LEFT?A(!1,K):K.which===f.a.RIGHT&&A(!0,K),g==null||g(K)}function I(K){var te=A(!_,K);b==null||b(te,K)}var W=T()(s,h,(i={},Object(ue.a)(i,"".concat(s,"-checked"),_),Object(ue.a)(i,"".concat(s,"-disabled"),n),i));return S.createElement("button",Object.assign({},y,{type:"button",role:"switch","aria-checked":_,disabled:n,className:W,ref:o,onKeyDown:P,onClick:I}),c,S.createElement("span",{className:"".concat(s,"-inner")},_?m:v))});p.displayName="Switch",Le.a=p},Y1PL:function(nt,Le,F){"use strict";F.r(Le),F.d(Le,"ResizableTextArea",function(){return $});var ue=F("wx14"),Q=F("1OyB"),j=F("vuIU"),S=F("Ji7U"),D=F("LK+K"),x=F("q1tI"),T=F("VTBJ"),w=F("rePB"),f=F("Zm9Q"),p=F("Kwbf"),u=F("c+Xe"),o=F("m+aA"),i=F("bdgK"),l=new Map;function s(pe){pe.forEach(function(Te){var we,Me=Te.target;(we=l.get(Me))===null||we===void 0||we.forEach(function(Ee){return Ee(Me)})})}var h=new i.default(s),r=null,t=null;function n(pe,Te){l.has(pe)||(l.set(pe,new Set),h.observe(pe)),l.get(pe).add(Te)}function c(pe,Te){l.has(pe)&&(l.get(pe).delete(Te),l.get(pe).size||(h.unobserve(pe),l.delete(pe)))}var m=function(pe){Object(S.a)(we,pe);var Te=Object(D.a)(we);function we(){return Object(Q.a)(this,we),Te.apply(this,arguments)}return Object(j.a)(we,[{key:"render",value:function(){return this.props.children}}]),we}(x.Component),v=x.createContext(null);function b(pe){var Te=pe.children,we=pe.onBatchResize,Me=x.useRef(0),Ee=x.useRef([]),xe=x.useContext(v),Ge=x.useCallback(function(je,We,ze){Me.current+=1;var de=Me.current;Ee.current.push({size:je,element:We,data:ze}),Promise.resolve().then(function(){de===Me.current&&(we==null||we(Ee.current),Ee.current=[])}),xe==null||xe(je,We,ze)},[we,xe]);return x.createElement(v.Provider,{value:Ge},Te)}function E(pe){var Te=pe.children,we=pe.disabled,Me=x.useRef(null),Ee=x.useRef(null),xe=x.useContext(v),Ge=x.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),je=x.isValidElement(Te)&&Object(u.c)(Te),We=je?Te.ref:null,ze=x.useMemo(function(){return Object(u.a)(We,Me)},[We,Me]),de=x.useRef(pe);de.current=pe;var le=x.useCallback(function(Oe){var Ie=de.current,qe=Ie.onResize,ee=Ie.data,k=Oe.getBoundingClientRect(),U=k.width,q=k.height,Y=Oe.offsetWidth,J=Oe.offsetHeight,be=Math.floor(U),ke=Math.floor(q);if(Ge.current.width!==be||Ge.current.height!==ke||Ge.current.offsetWidth!==Y||Ge.current.offsetHeight!==J){var ct={width:be,height:ke,offsetWidth:Y,offsetHeight:J};Ge.current=ct;var He=Y===Math.round(U)?U:Y,Be=J===Math.round(q)?q:J,Ze=Object(T.a)(Object(T.a)({},ct),{},{offsetWidth:He,offsetHeight:Be});xe==null||xe(Ze,Oe,ee),qe&&Promise.resolve().then(function(){qe(Ze,Oe)})}},[]);return x.useEffect(function(){var Oe=Object(o.a)(Me.current)||Object(o.a)(Ee.current);return Oe&&!we&&n(Oe,le),function(){return c(Oe,le)}},[Me.current,we]),x.createElement(m,{ref:Ee},je?x.cloneElement(Te,{ref:ze}):Te)}var g="rc-observer-key";function y(pe){var Te=pe.children,we=Object(f.a)(Te);return we.map(function(Me,Ee){var xe=(Me==null?void 0:Me.key)||"".concat(g,"-").concat(Ee);return x.createElement(E,Object(ue.a)({},pe,{key:xe}),Me)})}y.Collection=b;var C=y,d=F("bT9E"),_=F("TSYQ"),O=F.n(_),A=`
|
|
|
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
|
|
|
`,P=["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"],I={},W;function K(pe){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=pe.getAttribute("id")||pe.getAttribute("data-reactid")||pe.getAttribute("name");if(Te&&I[we])return I[we];var Me=window.getComputedStyle(pe),Ee=Me.getPropertyValue("box-sizing")||Me.getPropertyValue("-moz-box-sizing")||Me.getPropertyValue("-webkit-box-sizing"),xe=parseFloat(Me.getPropertyValue("padding-bottom"))+parseFloat(Me.getPropertyValue("padding-top")),Ge=parseFloat(Me.getPropertyValue("border-bottom-width"))+parseFloat(Me.getPropertyValue("border-top-width")),je=P.map(function(ze){return"".concat(ze,":").concat(Me.getPropertyValue(ze))}).join(";"),We={sizingStyle:je,paddingSize:xe,borderSize:Ge,boxSizing:Ee};return Te&&we&&(I[we]=We),We}function te(pe){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;W||(W=document.createElement("textarea"),W.setAttribute("tab-index","-1"),W.setAttribute("aria-hidden","true"),document.body.appendChild(W)),pe.getAttribute("wrap")?W.setAttribute("wrap",pe.getAttribute("wrap")):W.removeAttribute("wrap");var Ee=K(pe,Te),xe=Ee.paddingSize,Ge=Ee.borderSize,je=Ee.boxSizing,We=Ee.sizingStyle;W.setAttribute("style","".concat(We,";").concat(A)),W.value=pe.value||pe.placeholder||"";var ze=Number.MIN_SAFE_INTEGER,de=Number.MAX_SAFE_INTEGER,le=W.scrollHeight,Oe;if(je==="border-box"?le+=Ge:je==="content-box"&&(le-=xe),we!==null||Me!==null){W.value=" ";var Ie=W.scrollHeight-xe;we!==null&&(ze=Ie*we,je==="border-box"&&(ze=ze+xe+Ge),le=Math.max(ze,le)),Me!==null&&(de=Ie*Me,je==="border-box"&&(de=de+xe+Ge),Oe=le>de?"":"hidden",le=Math.min(de,le))}return{height:le,minHeight:ze,maxHeight:de,overflowY:Oe,resize:"none"}}var H=F("Gytx"),G=F.n(H),V;(function(pe){pe[pe.NONE=0]="NONE",pe[pe.RESIZING=1]="RESIZING",pe[pe.RESIZED=2]="RESIZED"})(V||(V={}));var re=function(pe){Object(S.a)(we,pe);var Te=Object(D.a)(we);function we(Me){var Ee;return Object(Q.a)(this,we),Ee=Te.call(this,Me),Ee.nextFrameActionId=void 0,Ee.resizeFrameId=void 0,Ee.textArea=void 0,Ee.saveTextArea=function(xe){Ee.textArea=xe},Ee.handleResize=function(xe){var Ge=Ee.state.resizeStatus,je=Ee.props,We=je.autoSize,ze=je.onResize;if(Ge!==V.NONE)return;typeof ze=="function"&&ze(xe),We&&Ee.resizeOnNextFrame()},Ee.resizeOnNextFrame=function(){cancelAnimationFrame(Ee.nextFrameActionId),Ee.nextFrameActionId=requestAnimationFrame(Ee.resizeTextarea)},Ee.resizeTextarea=function(){var xe=Ee.props.autoSize;if(!xe||!Ee.textArea)return;var Ge=xe.minRows,je=xe.maxRows,We=te(Ee.textArea,!1,Ge,je);Ee.setState({textareaStyles:We,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(Ee.resizeFrameId),Ee.resizeFrameId=requestAnimationFrame(function(){Ee.setState({resizeStatus:V.RESIZED},function(){Ee.resizeFrameId=requestAnimationFrame(function(){Ee.setState({resizeStatus:V.NONE}),Ee.fixFirefoxAutoScroll()})})})})},Ee.renderTextArea=function(){var xe=Ee.props,Ge=xe.prefixCls,je=Ge===void 0?"rc-textarea":Ge,We=xe.autoSize,ze=xe.onResize,de=xe.className,le=xe.disabled,Oe=Ee.state,Ie=Oe.textareaStyles,qe=Oe.resizeStatus,ee=Object(d.a)(Ee.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),k=O()(je,de,Object(w.a)({},"".concat(je,"-disabled"),le));"value"in ee&&(ee.value=ee.value||"");var U=Object(T.a)(Object(T.a)(Object(T.a)({},Ee.props.style),Ie),qe===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return x.createElement(C,{onResize:Ee.handleResize,disabled:!(We||ze)},x.createElement("textarea",Object(ue.a)({},ee,{className:k,style:U,ref:Ee.saveTextArea})))},Ee.state={textareaStyles:{},resizeStatus:V.NONE},Ee}return Object(j.a)(we,[{key:"componentDidUpdate",value:function(Ee){(Ee.value!==this.props.value||!G()(Ee.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 Ee=this.textArea.selectionStart,xe=this.textArea.selectionEnd;this.textArea.setSelectionRange(Ee,xe)}}catch(Ge){}}},{key:"render",value:function(){return this.renderTextArea()}}]),we}(x.Component),$=re,ne=function(pe){Object(S.a)(we,pe);var Te=Object(D.a)(we);function we(Me){var Ee;Object(Q.a)(this,we),Ee=Te.call(this,Me),Ee.resizableTextArea=void 0,Ee.focus=function(){Ee.resizableTextArea.textArea.focus()},Ee.saveTextArea=function(Ge){Ee.resizableTextArea=Ge},Ee.handleChange=function(Ge){var je=Ee.props.onChange;Ee.setValue(Ge.target.value,function(){Ee.resizableTextArea.resizeTextarea()}),je&&je(Ge)},Ee.handleKeyDown=function(Ge){var je=Ee.props,We=je.onPressEnter,ze=je.onKeyDown;Ge.keyCode===13&&We&&We(Ge),ze&&ze(Ge)};var xe=typeof Me.value=="undefined"||Me.value===null?Me.defaultValue:Me.value;return Ee.state={value:xe},Ee}return Object(j.a)(we,[{key:"setValue",value:function(Ee,xe){"value"in this.props||this.setState({value:Ee},xe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return x.createElement($,Object(ue.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Ee){return"value"in Ee?{value:Ee.value}:null}}]),we}(x.Component),he=Le.default=ne},Z8dc:function(nt,Le,F){nt.exports={flex_box_center:"flex_box_center___3U5jH",flex_space_between:"flex_space_between___10tgP",flex_box_vertical_center:"flex_box_vertical_center___1e5pu",flex_box_center_end:"flex_box_center_end___WDBuM",flex_box_column:"flex_box_column___3TSEG",listForm:"listForm___264Pu",scroll:"scroll___CK9uS",formWrap:"formWrap___2n6e2",btns:"btns___2wuct",main:"main___1WFqr",mainLoading:"mainLoading___1kJWi",tip:"tip___10JaH",proWarp:"proWarp___TMP84",pro:"pro___1CLLm",mainSucceed:"mainSucceed___3NYgf",del:"del___34rdE"}},ZD9Y:function(nt,Le,F){"use strict";var ue=F("BoS7"),Q=F("Sdc0"),j=F("OaEy"),S=F("2fM7"),D=F("q1tI"),x=F.n(D),T=F("lOMy"),w=F.n(T),f=S.a.Option;Le.a=function(p){var u=p.onFontSizeChange,o=p.cmFontSize,i=p.cmCodeMode,l=p.onCodeModeChange,s=p.onTabToSpace,h=p.className,r=h===void 0?"":h,t=p.tabToSpace,n=p.children;return x.a.createElement("div",{className:"tpi-code-setting ".concat(r)},x.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),x.a.createElement("section",null,x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),x.a.createElement(S.a,{bordered:!1,size:"small",value:i,onChange:l},x.a.createElement(f,{value:"vs"},"\u767D\u8272\u80CC\u666F"),x.a.createElement(f,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),x.a.createElement(S.a,{bordered:!1,size:"small",value:o,onChange:u},x.a.createElement(f,{value:12},"12px"),x.a.createElement(f,{value:14},"14px"),x.a.createElement(f,{value:16},"16px"),x.a.createElement(f,{value:18},"18px"),x.a.createElement(f,{value:20},"20px"),x.a.createElement(f,{value:22},"22px"))),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"Tab\u8F6C\u6362"),x.a.createElement(Q.a,{checked:t,onChange:s}))),x.a.createElement("h3",null,"\u5FEB\u6377\u952E"),x.a.createElement("section",null,x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),x.a.createElement("span",null,"Ctrl + S")),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),x.a.createElement("span",null,"F1 / Alt + F1")),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),x.a.createElement("span",null,"Ctrl + ]/[")),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),x.a.createElement("span",null,"Ctrl + Shift + \\")),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),x.a.createElement("span",null,"Home")),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),x.a.createElement("span",null,"End"))),n)}},ZW9T:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return C});var ue=F("k1fw"),Q=F("oBTY"),j=F("9og8"),S=F("miYZ"),D=F("tsqr"),x=F("rAM+"),T=F("tJVT"),w=F("PpiC"),f=F("WmNS"),p=F.n(f),u=F("q1tI"),o=F.n(u),i=F("bdgK");function l(d,_,O,A,P){var I=_.getWordUntilPosition(O),W={startLineNumber:O.lineNumber,endLineNumber:O.lineNumber,startColumn:I.startColumn,endColumn:I.endColumn},K=A.map(function(te){return{label:te,kind:d.languages.CompletionItemKind.Keyword,insertText:te,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:W}});return P.map(function(te){K.push(Object(ue.a)(Object(ue.a)({},te),{},{range:W}))}),K}var s=function(d){var _={label:"ifelse",kind:d.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
|
`),insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet},O=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];d.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(W,K){var te=l(d,W,K,O,[_]);return{suggestions:te}}});var A=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];d.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(W,K){var te=[{label:"print",kind:d.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
|
`),insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet}],H=l(d,W,K,A,te);return{suggestions:H}}});var P=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];d.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(W,K){var te=[_,{label:"main",kind:d.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
|
`),insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:d.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
|
`),insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet}],H=l(d,W,K,P,te);return{suggestions:H}}})},h="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",r=F("fjLI"),t=F("LvDl"),n=F("+ua5");function c(d){return/^\d+$/.test(d)?"".concat(d,"px"):d}function m(){}var v=!1,b={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale"};function E(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],_=d;if(Array.isArray(d)){for(var O=0;O<d.length;O++){var A=b[d[O]];if(A)return A}return _[0]}return b[_]||_}var g=null,y=Le.b=function(d){var _=d.width,O=_===void 0?"100%":_,A=d.height,P=A===void 0?"100%":A,I=d.value,W=d.language,K=W===void 0?"javascript":W,te=d.style,H=te===void 0?{}:te,G=d.options,V=G===void 0?{}:G,re=d.overrideServices,$=re===void 0?{}:re,ne=d.theme,he=ne===void 0?"vs-dark":ne,pe=d.onEditBlur,Te=d.onSave,we=d.autoHeight,Me=we===void 0?!1:we,Ee=d.forbidCopy,xe=Ee===void 0?!1:Ee,Ge=d.onChange,je=Ge===void 0?m:Ge,We=d.editorDidMount,ze=We===void 0?m:We,de=d.onFocus,le=de===void 0?m:de,Oe=d.onBreakPoint,Ie=Oe===void 0?m:Oe,qe=d.breakPointValue,ee=qe===void 0?[]:qe,k=d.filename,U=k===void 0?"educoder.txt":k,q=d.errorLine,Y=d.errorContent,J=Y===void 0?"":Y,be=d.highlightLine,ke=d.openBreakPoint,ct=ke===void 0?!1:ke,He=Object(w.a)(d,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint"]),Be=Object(u.useRef)(),Ze=Object(u.useRef)({}),ht=Object(u.useRef)(),Qe=Object(u.useRef)(),Xe=Object(u.useRef)([]),Ke=Object(u.useRef)(!1),Fe=Object(u.useRef)(),Ue=Object(u.useState)(!1),_e=Object(T.a)(Ue,2),Ce=_e[0],Ne=_e[1];function De(){var mt;return Be.current&&(mt=new i.default(function(bt){var At=Object(x.a)(bt),Xt;try{for(At.s();!(Xt=At.n()).done;){var Ae=Xt.value;(Ae.target.offsetHeight>0||Ae.target.offsetWidth>0)&&Ze.current.instance.layout()}}catch(ge){At.e(ge)}finally{At.f()}}),mt.observe(Be.current)),mt}function rt(){D.b.warn({content:decodeURIComponent(h),key:"monaco-editor-tip"})}var tt=function(){var bt=Ze.current.instance;if(I!=null&&bt&&Ce){var At=bt.getModel();At&&I!==At.getValue()&&(v=!0,At.setValue(I),bt.layout(),v=!1)}};Object(u.useEffect)(function(){try{var mt,bt=Ze.current.instance;Qe.current&&clearTimeout(Qe.current),Qe.current=setTimeout(function(){tt()},500),bt==null||((mt=bt.updateOptions)===null||mt===void 0)||mt.call(bt,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(I.split(/\r\n|\r|\n/g).length))+3,5)})}catch(At){debugger}},[I,Ce,Ze.current]),Object(u.useEffect)(function(){try{if(q&&Ze.current&&Ze.current.instance){var mt=Ze.current.instance;mt.changeViewZones(function(At){var Xt=document.createElement("div");Xt.style.padding="10px 20px",Xt.style.width="calc(100% - 20px)",Xt.className="my-error-line-wrp",Xt.innerHTML=J,At.addZone({afterLineNumber:q||11,heightInLines:3,domNode:Xt})});var bt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};mt.addOverlayWidget(bt),mt.revealPositionInCenter({lineNumber:20,column:1})}}catch(At){debugger}},[q,Ze.current,Ce]),Object(u.useEffect)(function(){var mt;if((mt=Ze.current)!==null&&mt!==void 0&&mt.instance&&Ce&&ct){var bt=Ze.current.instance,At=bt.getModel();if(!At)return;var Xt=function(){var wt=[],Kt=[],Et=At.getAllDecorations(),Qt=Object(x.a)(Et),Vt;try{for(Qt.s();!(Vt=Qt.n()).done;){var ie=Vt.value;if(ie.options.className==="highlighted-line"){var N;wt.push(ie==null||((N=ie.range)===null||N===void 0)?void 0:N.startLineNumber),Kt.push(ie==null?void 0:ie.id)}}}catch(ae){Qt.e(ae)}finally{Qt.f()}At.deltaDecorations(Kt,[]);var B=At.getLineCount();!!be&&be<=B&&(bt.deltaDecorations([],[{range:new g.Range(be,1,be,At.getLineMaxColumn(be)),options:{isWholeLine:!0,className:"highlighted-line"}}]),bt.revealLineInCenter(be))};Xt();var Ae=function(){var wt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Kt=[],Et=[],Qt=At.getAllDecorations(),Vt=Object(x.a)(Qt),ie;try{for(Vt.s();!(ie=Vt.n()).done;){var N=ie.value;if(N.options.linesDecorationsClassName==="breakpoints"){var B;Kt.push(N==null||((B=N.range)===null||B===void 0)?void 0:B.startLineNumber),Et.push(N==null?void 0:N.id)}}}catch(ae){Vt.e(ae)}finally{Vt.f()}if(wt)return{lines:Kt,ids:Et};Ie(Kt)},ge=function(){var ot=Object(j.a)(p.a.mark(function wt(Kt){var Et;return p.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return Et={range:new g.Range(Kt,1,Kt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},Vt.next=3,At.deltaDecorations([],[Et]);case 3:Ae();case 4:case"end":return Vt.stop()}},wt)}));return function(Kt){return ot.apply(this,arguments)}}(),z=function(){var ot=Object(j.a)(p.a.mark(function wt(Kt){var Et,Qt,Vt,ie,N;return p.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:Et=[],Qt=bt.getLineDecorations(Kt),Vt=Object(x.a)(Qt);try{for(Vt.s();!(ie=Vt.n()).done;)N=ie.value,N.options.linesDecorationsClassName==="breakpoints"&&Et.push(N.id)}catch(fe){Vt.e(fe)}finally{Vt.f()}return ae.next=6,At.deltaDecorations(Et,[]);case 6:Ae();case 7:case"end":return ae.stop()}},wt)}));return function(Kt){return ot.apply(this,arguments)}}(),Z=function(wt){var Kt=bt.getLineDecorations(wt),Et=Object(x.a)(Kt),Qt;try{for(Et.s();!(Qt=Et.n()).done;){var Vt=Qt.value;if(Vt.options.linesDecorationsClassName==="breakpoints")return!0}}catch(ie){Et.e(ie)}finally{Et.f()}return!1};if(!Object(t.isEqual)(ee,Ae(!0).lines)){At.deltaDecorations(Ae(!0).ids,[]);var oe=ee.map(function(ot){return{range:new g.Range(ot,1,ot,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}});At.deltaDecorations([],oe)}var me=bt.onDidChangeModelContent(function(ot){var wt=bt.getPosition();if(wt){var Kt=wt.lineNumber;At.getLineContent(Kt).trim()===""?z(Kt):Z(Kt)&&(z(Kt),ge(Kt))}}),Re=bt.onMouseDown(function(ot){var wt,Kt,Et;if(ot.target.detail&&(wt=ot.target)!==null&&wt!==void 0&&(Kt=wt.element)!==null&&Kt!==void 0&&(Et=Kt.className)!==null&&Et!==void 0&&Et.includes("line-numbers")){var Qt=ot.target.position.lineNumber;if(At.getLineContent(Qt).trim()==="")return;Z(Qt)?z(Qt):ge(Qt)}}),Je=function(wt){var Kt={range:new g.Range(wt,1,wt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Xe.current=bt.deltaDecorations(Xe.current,[Kt])},at=function(){Xe.current=bt.deltaDecorations(Xe.current,[])},kt=bt.onMouseMove(function(ot){var wt,Kt,Et;if(at(),ot.target.detail&&(wt=ot.target)!==null&&wt!==void 0&&(Kt=wt.element)!==null&&Kt!==void 0&&(Et=Kt.className)!==null&&Et!==void 0&&Et.includes("line-numbers")){var Qt=ot.target.position.lineNumber;if(At.getLineContent(Qt).trim()==="")return;Je(Qt)}}),jt=bt.onMouseLeave(function(){at()});return function(){me.dispose(),Re.dispose(),kt.dispose(),jt.dispose()}}},[Ze.current,Ce,ee,be,ct]);function xt(){var mt=Ze.current.instance;if(mt){var bt=mt.getSelection(),At=Ze.current.pastePos||{},Xt=new g.Range(At.startLineNumber||bt.endLineNumber,At.startColumn||bt.endColumn,At.endLineNumber||bt.endLineNumber,At.endColumn||bt.endColumn);setTimeout(function(){mt.executeEdits("",[{range:Xt,text:""}])},300)}}function Mt(mt){(window.navigator.platform.match("Mac")?mt.metaKey:mt.ctrlKey)&&mt.keyCode==83&&(mt.preventDefault(),Te())}var Bt=function(){if(Me&&Ze.current.instance){var bt=Ze.current.instance.getContentHeight();Ut(bt<P?P:bt)}else Ut(P)};function It(mt){var bt=document.createEvent("MouseEvents");bt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),mt.dispatchEvent(bt)}var Dt=function(bt){var At=bt.keyCode,Xt=bt.ctrlKey,Ae=bt.metaKey,ge=bt.target,z=bt.type;return(z==="paste"||(At===67||At===86)&&(Ae||Xt))&&ge.nodeName==="TEXTAREA"&&(rt(),bt.preventDefault()),!1};function lt(mt,bt){var At=window.URL||window.webkitURL||window,Xt=new Blob([bt]),Ae=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ae.href=At.createObjectURL(Xt),Ae.download=mt,It(Ae)}Object(u.useEffect)(function(){Bt()},[Bt]),Object(u.useEffect)(function(){Be.current&&!Ce&&F.e(27).then(F.t.bind(null,"M/lh",7)).then(function(mt){try{g=mt,Ze.current.instance=g.editor.create(Be.current,{value:I,language:E(K),theme:he,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},$);var bt=Ze.current.instance,At=r.c._menuItems,Xt=Object(Q.a)(At).find(function(ge){return ge[0]._debugName=="EditorContext"});if(ze(bt,g),setTimeout(function(){Bt(),Ze.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){lt(U||"educoder.txt",bt.getValue())}}),bt.getDomNode().addEventListener("input",function(){ht.current.autoFormat&&bt.getAction("editor.action.formatDocument").run()})},500),Ze.current.subscription=bt.onDidChangeModelContent(function(ge){debugger;Ke.current?clearTimeout(Fe.current):(Bt(),je(bt.getValue(),ge)),Fe.current=setTimeout(function(){Ke.current=!1},500)}),window.Monaco||s(g,E(K)),xe&&(Be.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Dt),window.removeEventListener("paste",Dt),window.addEventListener("keydown",Dt),window.addEventListener("paste",Dt)),window.Monaco=g,pe&&bt.onDidBlurEditorWidget(function(){pe(bt.getValue())}),le&&bt.onDidFocusEditorText(function(){le(bt.getValue())}),xe)try{window.addEventListener("paste",xt)}catch(ge){}var Ae=De();return Ne(!0),function(){var ge=Ze.current.instance;ge.dispose();var z=ge.getModel();z&&z.dispose(),Ze.current.subscription&&Ze.current.subscription.dispose(),xe&&window.removeEventListener("paste",xt),Ae.unobserve(Be.current)}}catch(ge){debugger}})},[]),Object(u.useEffect)(function(){var mt=Ze.current.instance;if(mt&&Ce)return document.addEventListener("keydown",Mt,!1),function(){document.removeEventListener("keydown",Mt)}},[Te,Ce]),Object(u.useEffect)(function(){var mt=Ze.current.instance;if(mt&&Ce){var bt=E(K);g.editor.setModelLanguage(mt.getModel(),bt)}},[K,Ce]),Object(u.useEffect)(function(){var mt=Ze.current.instance;mt&&Ce&&g.editor.setTheme(he)},[he,Ce]),Object(u.useEffect)(function(){var mt=Ze.current.instance;ht.current=V,mt&&Ce&&(mt.updateOptions(Object(ue.a)({},V)),setTimeout(function(){mt.getModel().updateOptions(Object(ue.a)({},V))},200))},[JSON.stringify(V),Ce]),Object(u.useEffect)(function(){var mt=Ze.current.instance;mt&&Ce&&mt.layout()},[O,P,Ce]);var pt=Object(u.useState)(c(O)),ut=Object(T.a)(pt,2),Pe=ut[0],Ve=ut[1],yt=Object(u.useState)(c(P)),st=Object(T.a)(yt,2),Nt=st[0],Ut=st[1],it=Object(ue.a)(Object(ue.a)({},H),{},{width:Pe,height:Nt});return o.a.createElement("div",{className:"my-monaco-editor",ref:Be,style:it})};function C(d){var _=d.width,O=_===void 0?"100%":_,A=d.height,P=A===void 0?"100%":A,I=d.original,W=d.modified,K=d.language,te=d.options,H=te===void 0?{}:te,G=Object(u.useRef)(),V=Object(u.useState)(null),re=Object(T.a)(V,2),$=re[0],ne=re[1];function he(Me){var Ee;return G.current&&(Ee=new i.default(function(xe){var Ge=Object(x.a)(xe),je;try{for(Ge.s();!(je=Ge.n()).done;){var We=je.value;(We.target.offsetHeight>0||We.target.offsetWidth>0)&&Me.layout()}}catch(ze){Ge.e(ze)}finally{Ge.f()}}),Ee.observe(G.current)),Ee}Object(u.useEffect)(function(){return G.current&&F.e(27).then(F.t.bind(null,"M/lh",7)).then(function(Me){g=Me;var Ee=g.editor.createDiffEditor(G.current,Object(ue.a)(Object(ue.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},H),{},{wordWrap:!0}));ne(Ee);var xe=he(Ee);return function(){Ee.dispose();var Ge=Ee.getModel();Ge&&Ge.dispose(),xe.unobserve(G.current)}}),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}},[]),Object(u.useEffect)(function(){$&&$.setModel({original:g.editor.createModel(I,K),modified:g.editor.createModel(W,K)})},[I,W,K,$]);var pe=c(O),Te=c(P),we={width:pe,height:Te};return o.a.createElement("div",{className:"my-diff-editor",ref:G,style:we})}},ZpRC:function(nt,Le,F){"use strict";function ue(u){return typeof u=="object"&&u!=null&&u.nodeType===1}function Q(u,o){return(!o||u!=="hidden")&&u!=="visible"&&u!=="clip"}function j(u,o){if(u.clientHeight<u.scrollHeight||u.clientWidth<u.scrollWidth){var i=getComputedStyle(u,null);return Q(i.overflowY,o)||Q(i.overflowX,o)||function(l){var s=function(h){if(!h.ownerDocument||!h.ownerDocument.defaultView)return null;try{return h.ownerDocument.defaultView.frameElement}catch(r){return null}}(l);return!!s&&(s.clientHeight<l.scrollHeight||s.clientWidth<l.scrollWidth)}(u)}return!1}function S(u,o,i,l,s,h,r,t){return h<u&&r>o||h>u&&r<o?0:h<=u&&t<=i||r>=o&&t>=i?h-u-l:r>o&&t<i||h<u&&t>i?r-o+s:0}var D=function(u,o){var i=window,l=o.scrollMode,s=o.block,h=o.inline,r=o.boundary,t=o.skipOverflowHiddenElements,n=typeof r=="function"?r:function(Ie){return Ie!==r};if(!ue(u))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,m=[],v=u;ue(v)&&n(v);){if((v=v.parentElement)===c){m.push(v);break}v!=null&&v===document.body&&j(v)&&!j(document.documentElement)||v!=null&&j(v,t)&&m.push(v)}for(var b=i.visualViewport?i.visualViewport.width:innerWidth,E=i.visualViewport?i.visualViewport.height:innerHeight,g=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,C=u.getBoundingClientRect(),d=C.height,_=C.width,O=C.top,A=C.right,P=C.bottom,I=C.left,W=s==="start"||s==="nearest"?O:s==="end"?P:O+d/2,K=h==="center"?I+_/2:h==="end"?A:I,te=[],H=0;H<m.length;H++){var G=m[H],V=G.getBoundingClientRect(),re=V.height,$=V.width,ne=V.top,he=V.right,pe=V.bottom,Te=V.left;if(l==="if-needed"&&O>=0&&I>=0&&P<=E&&A<=b&&O>=ne&&P<=pe&&I>=Te&&A<=he)return te;var we=getComputedStyle(G),Me=parseInt(we.borderLeftWidth,10),Ee=parseInt(we.borderTopWidth,10),xe=parseInt(we.borderRightWidth,10),Ge=parseInt(we.borderBottomWidth,10),je=0,We=0,ze="offsetWidth"in G?G.offsetWidth-G.clientWidth-Me-xe:0,de="offsetHeight"in G?G.offsetHeight-G.clientHeight-Ee-Ge:0;if(c===G)je=s==="start"?W:s==="end"?W-E:s==="nearest"?S(y,y+E,E,Ee,Ge,y+W,y+W+d,d):W-E/2,We=h==="start"?K:h==="center"?K-b/2:h==="end"?K-b:S(g,g+b,b,Me,xe,g+K,g+K+_,_),je=Math.max(0,je+y),We=Math.max(0,We+g);else{je=s==="start"?W-ne-Ee:s==="end"?W-pe+Ge+de:s==="nearest"?S(ne,pe,re,Ee,Ge+de,W,W+d,d):W-(ne+re/2)+de/2,We=h==="start"?K-Te-Me:h==="center"?K-(Te+$/2)+ze/2:h==="end"?K-he+xe+ze:S(Te,he,$,Me,xe+ze,K,K+_,_);var le=G.scrollLeft,Oe=G.scrollTop;W+=Oe-(je=Math.max(0,Math.min(Oe+je,G.scrollHeight-re+de))),K+=le-(We=Math.max(0,Math.min(le+We,G.scrollWidth-$+ze)))}te.push({el:G,top:je,left:We})}return te};function x(u){return u===Object(u)&&Object.keys(u).length!==0}function T(u,o){o===void 0&&(o="auto");var i="scrollBehavior"in document.body.style;u.forEach(function(l){var s=l.el,h=l.top,r=l.left;s.scroll&&i?s.scroll({top:h,left:r,behavior:o}):(s.scrollTop=h,s.scrollLeft=r)})}function w(u){return u===!1?{block:"end",inline:"nearest"}:x(u)?u:{block:"start",inline:"nearest"}}function f(u,o){var i=!u.ownerDocument.documentElement.contains(u);if(x(o)&&typeof o.behavior=="function")return o.behavior(i?[]:D(u,o));if(i)return;var l=w(o);return T(D(u,l),l.behavior)}var p=Le.a=f},ZsLC:function(nt,Le,F){nt.exports={"left-panel":"left-panel___FTwwW","tab-panel-body":"tab-panel-body___2YSOx",b1:"b1___3qx3o","oj-mr":"oj-mr___1GA9N","oj-width-input":"oj-width-input___3GkyP","s-navs":"s-navs___1fGGf","bg-white":"bg-white___1ZAy0",active:"active___39N6D"}},bCnd:function(nt,Le,F){"use strict";F.d(Le,"b",function(){return S}),F.d(Le,"a",function(){return D});var ue=F("je13"),Q=F.n(ue),j=!1;function S(x,T){var w=Q.a.get("__ec");w||(w={}),w[x]=T,Q.a.set("__ec",w)}function D(x,T){var w=Q.a.get("__ec");return w?w[x]===void 0?T:w[x]:T}},bT9E:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return Q});var ue=F("VTBJ");function Q(j,S){var D=Object(ue.a)({},j);return Array.isArray(S)&&S.forEach(function(x){delete D[x]}),D}},bdLU:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return ue});var ue;(function(Q){Q[Q.NOMATCH=-1]="NOMATCH",Q[Q.OK=0]="OK",Q[Q.TIMEOUT=2]="TIMEOUT",Q[Q.PODFAILURE=3]="PODFAILURE",Q[Q.COMPILEFAILURE=4]="COMPILEFAILURE",Q[Q.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(ue||(ue={}))},biw7:function(nt,Le,F){"use strict";var ue=F("q1tI"),Q=F.n(ue),j=ue.createContext(null);Le.a=j},c5Ni:function(nt,Le,F){},cDPC:function(nt,Le,F){"use strict";var ue=F("tJVT"),Q=F("q1tI"),j=F.n(Q),S=F("i3hx"),D=F.n(S);Le.a=function(x){var T=x.defaultX,w=T===void 0?"40%":T,f=x.leftChild,p=x.rightChild,u=x.className,o=x.hideResize,i=o===void 0?!1:o,l=Object(Q.useState)(w),s=Object(ue.a)(l,2),h=s[0],r=s[1],t=Object(Q.useRef)();function n(){t.current=!0}Object(Q.useEffect)(function(){function v(E){t.current&&r(E.pageX)}function b(){t.current=!1}return window.addEventListener("mousemove",v),window.addEventListener("mouseup",b),function(){window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",b)}},[]);var c=typeof h=="number"&&h!==.01?"".concat(h,"px"):w,m="calc(100% - ".concat(i?"0px":"4px"," - ").concat(c,")");return j.a.createElement("div",{className:"split-panel-container ".concat(u)},j.a.createElement("section",{style:{width:c,display:h===.01?"none":""}},f),j.a.createElement("section",{className:"resize-x-bar",onMouseDown:n},j.a.createElement("a",{className:"btn-resize"},j.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},j.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),j.a.createElement("section",{style:{width:m}},p))}},dejd:function(nt,Le,F){},dmUQ:function(nt,Le,F){"use strict";var ue=F("Ff2n"),Q=F("rePB"),j=F("1OyB"),S=F("vuIU"),D=F("Ji7U"),x=F("md7G"),T=F("foSv"),w=F("q1tI"),f=F.n(w),p=F("TSYQ"),u=F.n(p),o=F("4IlW");function i(d,_){var O=Object.keys(d);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(d);_&&(A=A.filter(function(P){return Object.getOwnPropertyDescriptor(d,P).enumerable})),O.push.apply(O,A)}return O}function l(d){for(var _=1;_<arguments.length;_++){var O=arguments[_]!=null?arguments[_]:{};_%2?i(Object(O),!0).forEach(function(A){Object(Q.a)(d,A,O[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(O)):i(Object(O)).forEach(function(A){Object.defineProperty(d,A,Object.getOwnPropertyDescriptor(O,A))})}return d}function s(d){var _=h();return function(){var A=Object(T.a)(d),P;if(_){var I=Object(T.a)(this).constructor;P=Reflect.construct(A,arguments,I)}else P=A.apply(this,arguments);return Object(x.a)(this,P)}}function h(){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(d){return!1}}function r(){}function t(d){d.preventDefault()}var n=function(_){return _.replace(/[^\w.-]+/g,"")},c=200,m=600,v=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,b=function(_){return _!=null},E=function(_,O){return O===_||typeof O=="number"&&typeof _=="number"&&isNaN(O)&&isNaN(_)},g=function(d){Object(D.a)(O,d);var _=s(O);function O(A){var P;Object(j.a)(this,O),P=_.call(this,A),P.onKeyDown=function(K){var te=P.props,H=te.onKeyDown,G=te.onPressEnter;if(K.keyCode===o.a.UP){var V=P.getRatio(K);P.up(K,V,null),P.stop()}else if(K.keyCode===o.a.DOWN){var re=P.getRatio(K);P.down(K,re,null),P.stop()}else K.keyCode===o.a.ENTER&&G&&G(K);if(P.recordCursorPosition(),P.lastKeyCode=K.keyCode,H){for(var $=arguments.length,ne=new Array($>1?$-1:0),he=1;he<$;he++)ne[he-1]=arguments[he];H.apply(void 0,[K].concat(ne))}},P.onKeyUp=function(K){var te=P.props.onKeyUp;if(P.stop(),P.recordCursorPosition(),te){for(var H=arguments.length,G=new Array(H>1?H-1:0),V=1;V<H;V++)G[V-1]=arguments[V];te.apply(void 0,[K].concat(G))}},P.onChange=function(K){var te=P.props.onChange;P.state.focused&&(P.inputting=!0),P.rawInput=P.props.parser(P.getValueFromEvent(K)),P.setState({inputValue:P.rawInput}),te(P.toNumber(P.rawInput))},P.onMouseUp=function(){var K=P.props.onMouseUp;P.recordCursorPosition(),K&&K.apply(void 0,arguments)},P.onFocus=function(){var K;P.setState({focused:!0}),(K=P.props).onFocus.apply(K,arguments)},P.onBlur=function(){var K=P.props.onBlur;P.inputting=!1,P.setState({focused:!1});var te=P.getCurrentValidValue(P.state.inputValue),H=P.setValue(te,r);if(K){var G=P.input.value,V=P.getInputDisplayValue({focus:!1,value:H});P.input.value=V&&Number(V),K.apply(void 0,arguments),P.input.value=G}},P.getRatio=function(K){var te=1;return K.metaKey||K.ctrlKey?te=.1:K.shiftKey&&(te=10),te},P.getFullNum=function(K){return isNaN(K)?K:/e/i.test(String(K))?Number(K).toFixed(18).replace(/\.?0+$/,""):K},P.getPrecision=function(K){if(b(P.props.precision))return P.props.precision;var te=String(K);if(te.indexOf("e-")>=0)return parseInt(te.slice(te.indexOf("e-")+2),10);var H=0;return te.indexOf(".")>=0&&(H=te.length-te.indexOf(".")-1),H},P.getInputDisplayValue=function(K){var te=K||P.state,H=te.focused,G=te.inputValue,V=te.value,re;H?re=G:re=P.toPrecisionAsStep(V),re==null&&(re="");var $=P.formatWrapper(re);return b(P.props.decimalSeparator)&&($=$.toString().replace(".",P.props.decimalSeparator)),$},P.recordCursorPosition=function(){try{P.cursorStart=P.input.selectionStart,P.cursorEnd=P.input.selectionEnd,P.currentValue=P.input.value,P.cursorBefore=P.input.value.substring(0,P.cursorStart),P.cursorAfter=P.input.value.substring(P.cursorEnd)}catch(K){}},P.restoreByAfter=function(K){if(K===void 0)return!1;var te=P.input.value,H=te.lastIndexOf(K);if(H===-1)return!1;var G=P.cursorBefore.length;return P.lastKeyCode===o.a.DELETE&&P.cursorBefore.charAt(G-1)===K[0]?(P.fixCaret(G,G),!0):H+K.length===te.length?(P.fixCaret(H,H),!0):!1},P.partRestoreByAfter=function(K){return K===void 0?!1:Array.prototype.some.call(K,function(te,H){var G=K.substring(H);return P.restoreByAfter(G)})},P.isNotCompleteNumber=function(K){return isNaN(K)||K===""||K===null||K&&K.toString().indexOf(".")===K.toString().length-1},P.stop=function(){P.autoStepTimer&&clearTimeout(P.autoStepTimer)},P.down=function(K,te,H){P.pressingUpOrDown=!0,P.step("down",K,te,H)},P.up=function(K,te,H){P.pressingUpOrDown=!0,P.step("up",K,te,H)},P.saveInput=function(K){P.input=K};var I=A.value;I===void 0&&(I=A.defaultValue),P.state={focused:A.autoFocus};var W=P.getValidValue(P.toNumber(I));return P.state=l(l({},P.state),{},{inputValue:P.toPrecisionAsStep(W),value:W}),P}return Object(S.a)(O,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(P){var I=this.props,W=I.value,K=I.onChange,te=I.max,H=I.min,G=this.state.focused;if(P){if(!E(P.value,W)||!E(P.max,te)||!E(P.min,H)){var V=G?W:this.getValidValue(W),re;this.pressingUpOrDown?re=V:this.inputting?re=this.rawInput:re=this.toPrecisionAsStep(V),this.setState({value:V,inputValue:re})}var $="value"in this.props?W:this.state.value;"max"in this.props&&P.max!==te&&typeof $=="number"&&$>te&&K&&K(te),"min"in this.props&&P.min!==H&&typeof $=="number"&&$<H&&K&&K(H)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ne=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===o.a.BACKSPACE?ne=this.cursorStart-1:this.lastKeyCode===o.a.DELETE&&(ne=this.cursorStart):ne=this.input.value.length,this.fixCaret(ne,ne)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case o.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case o.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(he){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(P){var I=P;return I===""?I="":this.isNotCompleteNumber(parseFloat(I))?I=this.state.value:I=this.getValidValue(I),this.toNumber(I)}},{key:"getValueFromEvent",value:function(P){var I=P.target.value.trim().replace(/。/g,".");return b(this.props.decimalSeparator)&&(I=I.replace(this.props.decimalSeparator,".")),I}},{key:"getValidValue",value:function(P){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,K=parseFloat(P);return isNaN(K)?P:(K<I&&(K=I),K>W&&(K=W),K)}},{key:"setValue",value:function(P,I){var W=this.props.precision,K=this.isNotCompleteNumber(parseFloat(P))?null:parseFloat(P),te=this.state.value,H=te===void 0?null:te,G=this.state.inputValue,V=G===void 0?null:G,re=typeof K=="number"?K.toFixed(W):"".concat(K),$=K!==H||re!=="".concat(V);return"value"in this.props?(V=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:V},I)):this.setState({value:K,inputValue:this.toPrecisionAsStep(P)},I),$&&this.props.onChange(K),K}},{key:"getMaxPrecision",value:function(P){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.props,K=W.precision,te=W.step;if(b(K))return K;var H=this.getPrecision(I),G=this.getPrecision(te),V=this.getPrecision(P);return P?Math.max(V,H+G):H+G}},{key:"getPrecisionFactor",value:function(P){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.getMaxPrecision(P,I);return Math.pow(10,W)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(P){return this.props.formatter?this.props.formatter(P):P}},{key:"toPrecisionAsStep",value:function(P){if(this.isNotCompleteNumber(P)||P==="")return P;var I=Math.abs(this.getMaxPrecision(P));return isNaN(I)?P.toString():Number(P).toFixed(I)}},{key:"toNumber",value:function(P){var I=this.props.precision,W=this.state.focused,K=P&&P.length>16&&W;return this.isNotCompleteNumber(P)||K?P:b(I)?Math.round(P*Math.pow(10,I))/Math.pow(10,I):Number(P)}},{key:"upStep",value:function(P,I){var W=this.props.step,K=this.getPrecisionFactor(P,I),te=Math.abs(this.getMaxPrecision(P,I)),H=((K*P+K*W*I)/K).toFixed(te);return this.toNumber(H)}},{key:"downStep",value:function(P,I){var W=this.props.step,K=this.getPrecisionFactor(P,I),te=Math.abs(this.getMaxPrecision(P,I)),H=((K*P-K*W*I)/K).toFixed(te);return this.toNumber(H)}},{key:"step",value:function(P,I){var W=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,te=arguments.length>3?arguments[3]:void 0;this.stop(),I&&(I.persist(),I.preventDefault());var H=this.props;if(H.disabled)return;var G=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(G))return;var V=this["".concat(P,"Step")](G,K),re=V>H.max||V<H.min;if(V>H.max?V=H.max:V<H.min&&(V=H.min),this.setValue(V,null),this.setState({focused:!0},function(){W.pressingUpOrDown=!1}),re)return;this.autoStepTimer=setTimeout(function(){W[P](I,K,!0)},te?c:m)}},{key:"fixCaret",value:function(P,I){if(P===void 0||I===void 0||!this.input||!this.input.value)return;try{var W=this.input.selectionStart,K=this.input.selectionEnd;(P!==W||I!==K)&&this.input.setSelectionRange(P,I)}catch(te){}}},{key:"render",value:function(){var P,I=this.props,W=I.prefixCls,K=I.disabled,te=I.readOnly,H=I.useTouch,G=I.autoComplete,V=I.upHandler,re=I.downHandler,$=I.className,ne=I.max,he=I.min,pe=I.style,Te=I.title,we=I.onMouseEnter,Me=I.onMouseLeave,Ee=I.onMouseOver,xe=I.onMouseOut,Ge=I.required,je=I.onClick,We=I.tabIndex,ze=I.type,de=I.placeholder,le=I.id,Oe=I.inputMode,Ie=I.pattern,qe=I.step,ee=I.maxLength,k=I.autoFocus,U=I.name,q=I.onPaste,Y=I.onInput,J=Object(ue.a)(I,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),be=this.state,ke=be.value,ct=be.focused,He=u()(W,(P={},Object(Q.a)(P,$,!!$),Object(Q.a)(P,"".concat(W,"-disabled"),K),Object(Q.a)(P,"".concat(W,"-focused"),ct),P)),Be={};Object.keys(J).forEach(function(De){(De.substr(0,5)==="data-"||De.substr(0,5)==="aria-"||De==="role")&&(Be[De]=J[De])});var Ze=!te&&!K,ht=this.getInputDisplayValue(null),Qe=(ke||ke===0)&&(isNaN(ke)||Number(ke)>=ne),Xe=(ke||ke===0)&&(isNaN(ke)||Number(ke)<=he),Ke=Qe||K||te,Fe=Xe||K||te,Ue=u()("".concat(W,"-handler"),"".concat(W,"-handler-up"),Object(Q.a)({},"".concat(W,"-handler-up-disabled"),Ke)),_e=u()("".concat(W,"-handler"),"".concat(W,"-handler-down"),Object(Q.a)({},"".concat(W,"-handler-down-disabled"),Fe)),Ce=H?{onTouchStart:Ke?r:this.up,onTouchEnd:this.stop}:{onMouseDown:Ke?r:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Ne=H?{onTouchStart:Fe?r:this.down,onTouchEnd:this.stop}:{onMouseDown:Fe?r:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return f.a.createElement("div",{className:He,style:pe,title:Te,onMouseEnter:we,onMouseLeave:Me,onMouseOver:Ee,onMouseOut:xe,onFocus:function(){return null},onBlur:function(){return null}},f.a.createElement("div",{className:"".concat(W,"-handler-wrap")},f.a.createElement("span",Object.assign({unselectable:"on"},Ce,{role:"button","aria-label":"Increase Value","aria-disabled":Ke,className:Ue}),V||f.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-up-inner"),onClick:t})),f.a.createElement("span",Object.assign({unselectable:"on"},Ne,{role:"button","aria-label":"Decrease Value","aria-disabled":Fe,className:_e}),re||f.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-down-inner"),onClick:t}))),f.a.createElement("div",{className:"".concat(W,"-input-wrap")},f.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":he,"aria-valuemax":ne,"aria-valuenow":ke,required:Ge,type:ze,placeholder:de,onPaste:q,onClick:je,onMouseUp:this.onMouseUp,className:"".concat(W,"-input"),tabIndex:We,autoComplete:G,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ze?this.onKeyDown:r,onKeyUp:Ze?this.onKeyUp:r,autoFocus:k,maxLength:ee,readOnly:te,disabled:K,max:ne,min:he,step:qe,name:U,title:Te,id:le,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ht),pattern:Ie,inputMode:Oe,onInput:Y},Be))))}}]),O}(f.a.Component);g.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:v,min:-v,step:1,style:{},onChange:r,onKeyDown:r,onPressEnter:r,onFocus:r,onBlur:r,parser:n,required:!1,autoComplete:"off"};var y=g,C=Le.a=y},fcSX:function(nt,Le,F){"use strict";var ue=F("Ff2n"),Q=F("1OyB"),j=F("vuIU"),S=F("Ji7U"),D=F("md7G"),x=F("foSv"),T=F("1W/9"),w=F("q1tI"),f=F("rePB"),p=F("JX7q"),u=F("TSYQ"),o=F.n(u),i=F("qx4F"),l=F("4IlW");function s(K){return Array.isArray(K)?K:[K]}var h={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},r=Object.keys(h).filter(function(K){if(typeof document=="undefined")return!1;var te=document.getElementsByTagName("html")[0];return K in(te?te.style:{})})[0],t=h[r];function n(K,te,H,G){K.addEventListener?K.addEventListener(te,H,G):K.attachEvent&&K.attachEvent("on".concat(te),H)}function c(K,te,H,G){K.removeEventListener?K.removeEventListener(te,H,G):K.attachEvent&&K.detachEvent("on".concat(te),H)}function m(K,te){var H=typeof K=="function"?K(te):K;return Array.isArray(H)?H.length===2?H:[H[0],H[1]]:[H]}var v=function(te){return!isNaN(parseFloat(te))&&isFinite(te)},b=!(typeof window!="undefined"&&window.document&&window.document.createElement),E=function K(te,H,G,V){if(!H||H===document||H instanceof Document)return!1;if(H===te.parentNode)return!0;var re=Math.max(Math.abs(G),Math.abs(V))===Math.abs(V),$=Math.max(Math.abs(G),Math.abs(V))===Math.abs(G),ne=H.scrollHeight-H.clientHeight,he=H.scrollWidth-H.clientWidth,pe=document.defaultView.getComputedStyle(H),Te=pe.overflowY==="auto"||pe.overflowY==="scroll",we=pe.overflowX==="auto"||pe.overflowX==="scroll",Me=ne&&Te,Ee=he&&we;return re&&(!Me||Me&&(H.scrollTop>=ne&&V<0||H.scrollTop<=0&&V>0))||$&&(!Ee||Ee&&(H.scrollLeft>=he&&G<0||H.scrollLeft<=0&&G>0))?K(te,H.parentNode,G,V):!1};function g(K){var te=y();return function(){var G=Object(x.a)(K),V;if(te){var re=Object(x.a)(this).constructor;V=Reflect.construct(G,arguments,re)}else V=G.apply(this,arguments);return Object(D.a)(this,V)}}function y(){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(K){return!1}}var C={},d=function(K){Object(S.a)(H,K);var te=g(H);function H(G){var V;return Object(Q.a)(this,H),V=te.call(this,G),V.domFocus=function(){V.dom&&V.dom.focus()},V.removeStartHandler=function(re){if(re.touches.length>1)return;V.startPos={x:re.touches[0].clientX,y:re.touches[0].clientY}},V.removeMoveHandler=function(re){if(re.changedTouches.length>1)return;var $=re.currentTarget,ne=re.changedTouches[0].clientX-V.startPos.x,he=re.changedTouches[0].clientY-V.startPos.y;($===V.maskDom||$===V.handlerDom||$===V.contentDom&&E($,re.target,ne,he))&&re.cancelable&&re.preventDefault()},V.transitionEnd=function(re){var $=re.target;c($,t,V.transitionEnd),$.style.transition=""},V.onKeyDown=function(re){if(re.keyCode===l.a.ESC){var $=V.props.onClose;re.stopPropagation(),$&&$(re)}},V.onWrapperTransitionEnd=function(re){var $=V.props,ne=$.open,he=$.afterVisibleChange;re.target===V.contentWrapper&&re.propertyName.match(/transform$/)&&(V.dom.style.transition="",!ne&&V.getCurrentDrawerSome()&&(document.body.style.overflowX="",V.maskDom&&(V.maskDom.style.left="",V.maskDom.style.width="")),he&&he(!!ne))},V.openLevelTransition=function(){var re=V.props,$=re.open,ne=re.width,he=re.height,pe=V.getHorizontalBoolAndPlacementName(),Te=pe.isHorizontal,we=pe.placementName,Me=V.contentDom?V.contentDom.getBoundingClientRect()[Te?"width":"height"]:0,Ee=(Te?ne:he)||Me;V.setLevelAndScrolling($,we,Ee)},V.setLevelTransform=function(re,$,ne,he){var pe=V.props,Te=pe.placement,we=pe.levelMove,Me=pe.duration,Ee=pe.ease,xe=pe.showMask;V.levelDom.forEach(function(Ge){Ge.style.transition="transform ".concat(Me," ").concat(Ee),n(Ge,t,V.transitionEnd);var je=re?ne:0;if(we){var We=m(we,{target:Ge,open:re});je=re?We[0]:We[1]||0}var ze=typeof je=="number"?"".concat(je,"px"):je,de=Te==="left"||Te==="top"?ze:"-".concat(ze);de=xe&&Te==="right"&&he?"calc(".concat(de," + ").concat(he,"px)"):de,Ge.style.transform=je?"".concat($,"(").concat(de,")"):""})},V.setLevelAndScrolling=function(re,$,ne){var he=V.props.onChange;if(!b){var pe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(i.a)(!0):0;V.setLevelTransform(re,$,ne,pe),V.toggleScrollingToDrawerAndBody(pe)}he&&he(re)},V.toggleScrollingToDrawerAndBody=function(re){var $=V.props,ne=$.getOpenCount,he=$.getContainer,pe=$.showMask,Te=$.open,we=he&&he(),Me=ne&&ne();if(we&&we.parentNode===document.body&&pe){var Ee=["touchstart"],xe=[document.body,V.maskDom,V.handlerDom,V.contentDom];Te&&document.body.style.overflow!=="hidden"?(re&&V.addScrollingEffect(re),Me===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",xe.forEach(function(Ge,je){if(!Ge)return;n(Ge,Ee[je]||"touchmove",je?V.removeMoveHandler:V.removeStartHandler,V.passive)})):V.getCurrentDrawerSome()&&(Me||(document.body.style.overflow=""),document.body.style.touchAction="",re&&V.remScrollingEffect(re),xe.forEach(function(Ge,je){if(!Ge)return;c(Ge,Ee[je]||"touchmove",je?V.removeMoveHandler:V.removeStartHandler,V.passive)}))}},V.addScrollingEffect=function(re){var $=V.props,ne=$.placement,he=$.duration,pe=$.ease,Te=$.getOpenCount,we=$.switchScrollingEffect,Me=Te&&Te();Me===1&&we();var Ee="width ".concat(he," ").concat(pe),xe="transform ".concat(he," ").concat(pe);V.dom.style.transition="none";switch(ne){case"right":V.dom.style.transform="translateX(-".concat(re,"px)");break;case"top":case"bottom":V.dom.style.width="calc(100% - ".concat(re,"px)"),V.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(V.timeout),V.timeout=setTimeout(function(){V.dom&&(V.dom.style.transition="".concat(xe,",").concat(Ee),V.dom.style.width="",V.dom.style.transform="")})},V.remScrollingEffect=function(re){var $=V.props,ne=$.placement,he=$.duration,pe=$.ease,Te=$.getOpenCount,we=$.switchScrollingEffect,Me=Te&&Te();Me||we(!0),r&&(document.body.style.overflowX="hidden"),V.dom.style.transition="none";var Ee,xe="width ".concat(he," ").concat(pe),Ge="transform ".concat(he," ").concat(pe);switch(ne){case"left":{V.dom.style.width="100%",xe="width 0s ".concat(pe," ").concat(he);break}case"right":{V.dom.style.transform="translateX(".concat(re,"px)"),V.dom.style.width="100%",xe="width 0s ".concat(pe," ").concat(he),V.maskDom&&(V.maskDom.style.left="-".concat(re,"px"),V.maskDom.style.width="calc(100% + ".concat(re,"px)"));break}case"top":case"bottom":{V.dom.style.width="calc(100% + ".concat(re,"px)"),V.dom.style.height="100%",V.dom.style.transform="translateZ(0)",Ee="height 0s ".concat(pe," ").concat(he);break}default:break}clearTimeout(V.timeout),V.timeout=setTimeout(function(){V.dom&&(V.dom.style.transition="".concat(Ge,",").concat(Ee?"".concat(Ee,","):"").concat(xe),V.dom.style.transform="",V.dom.style.width="",V.dom.style.height="")})},V.getCurrentDrawerSome=function(){return!Object.keys(C).some(function(re){return C[re]})},V.getLevelDom=function(re){var $=re.level,ne=re.getContainer;if(b)return;var he=ne&&ne(),pe=he?he.parentNode:null;if(V.levelDom=[],$==="all"){var Te=pe?Array.prototype.slice.call(pe.children):[];Te.forEach(function(we){we.nodeName!=="SCRIPT"&&we.nodeName!=="STYLE"&&we.nodeName!=="LINK"&&we!==he&&V.levelDom.push(we)})}else $&&s($).forEach(function(we){document.querySelectorAll(we).forEach(function(Me){V.levelDom.push(Me)})})},V.getHorizontalBoolAndPlacementName=function(){var re=V.props.placement,$=re==="left"||re==="right",ne="translate".concat($?"X":"Y");return{isHorizontal:$,placementName:ne}},V.state={_self:Object(p.a)(V)},V}return Object(j.a)(H,[{key:"componentDidMount",value:function(){var V=this;if(!b){var re=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return re=!0,null}}))}catch(Te){}this.passive=re?{passive:!1}:!1}var $=this.props,ne=$.open,he=$.getContainer,pe=he&&he();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ne&&(pe&&pe.parentNode===document.body&&(C[this.drawerId]=ne),this.openLevelTransition(),this.forceUpdate(function(){V.domFocus()}))}},{key:"componentDidUpdate",value:function(V){var re=this.props,$=re.open,ne=re.getContainer,he=ne&&ne();$!==V.open&&($&&this.domFocus(),he&&he.parentNode===document.body&&(C[this.drawerId]=!!$),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var V=this.props,re=V.getOpenCount,$=V.open,ne=V.switchScrollingEffect,he=typeof re=="function"&&re();delete C[this.drawerId],$&&(this.setLevelTransform(!1),document.body.style.touchAction=""),he||(document.body.style.overflow="",ne(!0))}},{key:"render",value:function(){var V,re=this,$=this.props,ne=$.className,he=$.children,pe=$.style,Te=$.width,we=$.height,Me=$.defaultOpen,Ee=$.open,xe=$.prefixCls,Ge=$.placement,je=$.level,We=$.levelMove,ze=$.ease,de=$.duration,le=$.getContainer,Oe=$.handler,Ie=$.onChange,qe=$.afterVisibleChange,ee=$.showMask,k=$.maskClosable,U=$.maskStyle,q=$.onClose,Y=$.onHandleClick,J=$.keyboard,be=$.getOpenCount,ke=$.switchScrollingEffect,ct=Object(ue.a)($,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),He=this.dom?Ee:!1,Be=o()(xe,(V={},Object(f.a)(V,"".concat(xe,"-").concat(Ge),!0),Object(f.a)(V,"".concat(xe,"-open"),He),Object(f.a)(V,ne||"",!!ne),Object(f.a)(V,"no-mask",!ee),V)),Ze=this.getHorizontalBoolAndPlacementName(),ht=Ze.placementName,Qe=Ge==="left"||Ge==="top"?"-100%":"100%",Xe=He?"":"".concat(ht,"(").concat(Qe,")"),Ke=Oe&&w.cloneElement(Oe,{onClick:function(Ue){Oe.props.onClick&&Oe.props.onClick(),Y&&Y(Ue)},ref:function(Ue){re.handlerDom=Ue}});return w.createElement("div",Object.assign({},ct,{tabIndex:-1,className:Be,style:pe,ref:function(Ue){re.dom=Ue},onKeyDown:He&&J?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),ee&&w.createElement("div",{className:"".concat(xe,"-mask"),onClick:k?q:void 0,style:U,ref:function(Ue){re.maskDom=Ue}}),w.createElement("div",{className:"".concat(xe,"-content-wrapper"),style:{transform:Xe,msTransform:Xe,width:v(Te)?"".concat(Te,"px"):Te,height:v(we)?"".concat(we,"px"):we},ref:function(Ue){re.contentWrapper=Ue}},w.createElement("div",{className:"".concat(xe,"-content"),ref:function(Ue){re.contentDom=Ue},onTouchStart:He&&ee?this.removeStartHandler:void 0,onTouchMove:He&&ee?this.removeMoveHandler:void 0},he),Ke))}}],[{key:"getDerivedStateFromProps",value:function(V,re){var $=re.prevProps,ne=re._self,he={prevProps:V};if($!==void 0){var pe=V.placement,Te=V.level;pe!==$.placement&&(ne.contentDom=null),Te!==$.level&&ne.getLevelDom(V)}return he}}]),H}(w.Component);d.defaultProps={switchScrollingEffect:function(){}};var _=d;function O(K){var te=A();return function(){var G=Object(x.a)(K),V;if(te){var re=Object(x.a)(this).constructor;V=Reflect.construct(G,arguments,re)}else V=G.apply(this,arguments);return Object(D.a)(this,V)}}function A(){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(K){return!1}}var P=function(K){Object(S.a)(H,K);var te=O(H);function H(G){var V;Object(Q.a)(this,H),V=te.call(this,G),V.onHandleClick=function($){var ne=V.props,he=ne.onHandleClick,pe=ne.open;if(he&&he($),typeof pe=="undefined"){var Te=V.state.open;V.setState({open:!Te})}},V.onClose=function($){var ne=V.props,he=ne.onClose,pe=ne.open;he&&he($),typeof pe=="undefined"&&V.setState({open:!1})};var re=typeof G.open!="undefined"?G.open:!!G.defaultOpen;return V.state={open:re},"onMaskClick"in G&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),V}return Object(j.a)(H,[{key:"render",value:function(){var V=this,re=this.props,$=re.defaultOpen,ne=re.getContainer,he=re.wrapperClassName,pe=re.forceRender,Te=re.handler,we=Object(ue.a)(re,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Me=this.state.open;if(!ne)return w.createElement("div",{className:he,ref:function(Ge){V.dom=Ge}},w.createElement(_,Object.assign({},we,{open:Me,handler:Te,getContainer:function(){return V.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var Ee=!!Te||pe;return w.createElement(T.a,{visible:Me,forceRender:Ee,getContainer:ne,wrapperClassName:he},function(xe){var Ge=xe.visible,je=xe.afterClose,We=Object(ue.a)(xe,["visible","afterClose"]);return w.createElement(_,Object.assign({},we,We,{open:Ge!==void 0?Ge:Me,afterVisibleChange:je!==void 0?je:we.afterVisibleChange,handler:Te,onClose:V.onClose,onHandleClick:V.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(V,re){var $=re.prevProps,ne={prevProps:V};return typeof $!="undefined"&&V.open!==$.open&&(ne.open=V.open),ne}}]),H}(w.Component);P.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:w.createElement("div",{className:"drawer-handle"},w.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var I=P,W=Le.a=I},fcyK:function(nt,Le,F){},fjLI:function(nt,Le,F){"use strict";F.d(Le,"e",function(){return p}),F.d(Le,"a",function(){return u}),F.d(Le,"c",function(){return o}),F.d(Le,"d",function(){return l}),F.d(Le,"b",function(){return s});var ue=F("8HAY"),Q=F("Cg/j"),j=F("T8No"),S=F("nnTU"),D=F("MI8n"),x=function(){var h=function(r,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,c){n.__proto__=c}||function(n,c){for(var m in c)c.hasOwnProperty(m)&&(n[m]=c[m])},h(r,t)};return function(r,t){h(r,t);function n(){this.constructor=r}r.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),T=function(h,r,t,n){var c=arguments.length,m=c<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,t):n,v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(h,r,t,n);else for(var b=h.length-1;b>=0;b--)(v=h[b])&&(m=(c<3?v(m):c>3?v(r,t,m):v(r,t))||m);return c>3&&m&&Object.defineProperty(r,t,m),m},w=function(h,r){return function(t,n){r(t,n,h)}},f=function(){for(var h=0,r=0,t=arguments.length;r<t;r++)h+=arguments[r].length;for(var n=Array(h),c=0,r=0;r<t;r++)for(var m=arguments[r],v=0,b=m.length;v<b;v++,c++)n[c]=m[v];return n};function p(h){return h.command!==void 0}var u=Object(Q.c)("menuService"),o=new(function(){function h(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new D.a,this.onDidChangeMenu=this._onDidChangeMenu.event}return h.prototype.addCommand=function(r){var t=this;return this._commands.set(r.id,r),this._onDidChangeMenu.fire(0),{dispose:function(){t._commands.delete(r.id)&&t._onDidChangeMenu.fire(0)}}},h.prototype.getCommand=function(r){return this._commands.get(r)},h.prototype.getCommands=function(){var r=new Map;return this._commands.forEach(function(t,n){return r.set(n,t)}),r},h.prototype.appendMenuItem=function(r,t){var n=this,c=this._menuItems.get(r);return c?c.push(t):(c=[t],this._menuItems.set(r,c)),this._onDidChangeMenu.fire(r),{dispose:function(){var m=c.indexOf(t);m>=0&&(c.splice(m,1),n._onDidChangeMenu.fire(r))}}},h.prototype.getMenuItems=function(r){var t=(this._menuItems.get(r)||[]).slice(0);return r===0&&this._appendImplicitItems(t),t},h.prototype._appendImplicitItems=function(r){for(var t=new Set,n=r.filter(function(g){return p(g)}),c=0,m=n;c<m.length;c++){var v=m[c],b=v.command,E=v.alt;t.add(b.id),E&&t.add(E.id)}this._commands.forEach(function(g,y){t.has(y)||r.push({command:g})})},h}()),i=function(h){x(r,h);function r(t,n,c){var m=h.call(this,t,n)||this;return m._commandService=c,m}return r.prototype.run=function(){for(var t,n=[],c=0;c<arguments.length;c++)n[c]=arguments[c];return(t=this._commandService).executeCommand.apply(t,f([this.id],n))},r=T([w(2,S.b)],r),r}(ue.a),l=function(h){x(r,h);function r(t){var n=this;return typeof t.title=="string"?n=h.call(this,"",t.title,"submenu")||this:n=h.call(this,"",t.title.value,"submenu")||this,n.item=t,n}return r}(ue.a),s=function(h){x(r,h);function r(t,n,c,m,v){var b=this;return typeof t.title=="string"?b=h.call(this,t.id,t.title,v)||this:b=h.call(this,t.id,t.title.value,v)||this,b._cssClass=void 0,b._enabled=!t.precondition||m.contextMatchesRules(t.precondition),b._checked=Boolean(t.toggled&&m.contextMatchesRules(t.toggled)),b._options=c||{},b.item=t,b.alt=n?new r(n,void 0,b._options,m,v):void 0,b}return r.prototype.dispose=function(){this.alt&&this.alt.dispose(),h.prototype.dispose.call(this)},r.prototype.run=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var c=[];return this._options.arg&&(c=f(c,[this._options.arg])),this._options.shouldForwardArgs&&(c=f(c,t)),h.prototype.run.apply(this,c)},r=T([w(3,j.c),w(4,S.b)],r),r}(i)},fyJ8:function(nt,Le,F){"use strict";var ue=F("rePB"),Q=F("VTBJ"),j=F("Ff2n"),S=F("U8pU"),D=F("q1tI"),x=F.n(D),T=F("TSYQ"),w=F.n(T),f=F("c+Xe"),p=F("sR1s");function u(h){return h&&Object(S.a)(h)==="object"&&!Array.isArray(h)&&!D.isValidElement(h)}function o(h){return typeof h=="string"?!0:Object(f.c)(h)}function i(h,r){var t,n=h.prefixCls,c=h.className,m=h.record,v=h.index,b=h.dataIndex,E=h.render,g=h.children,y=h.component,C=y===void 0?"td":y,d=h.colSpan,_=h.rowSpan,O=h.fixLeft,A=h.fixRight,P=h.firstFixLeft,I=h.lastFixLeft,W=h.firstFixRight,K=h.lastFixRight,te=h.appendNode,H=h.additionalProps,G=H===void 0?{}:H,V=h.ellipsis,re=h.align,$=h.rowType,ne=h.isSticky,he="".concat(n,"-cell"),pe,Te;if(g)Te=g;else{var we=Object(p.b)(m,b);if(Te=we,E){var Me=E(we,m,v);u(Me)?(Te=Me.children,pe=Me.props):Te=Me}}Object(S.a)(Te)==="object"&&!Array.isArray(Te)&&!D.isValidElement(Te)&&(Te=null),V&&(I||W)&&(Te=D.createElement("span",{className:"".concat(he,"-content")},Te));var Ee=pe||{},xe=Ee.colSpan,Ge=Ee.rowSpan,je=Ee.style,We=Ee.className,ze=Object(j.a)(Ee,["colSpan","rowSpan","style","className"]),de=xe!==void 0?xe:d,le=Ge!==void 0?Ge:_;if(de===0||le===0)return null;var Oe={},Ie=typeof O=="number",qe=typeof A=="number";Ie&&(Oe.position="sticky",Oe.left=O),qe&&(Oe.position="sticky",Oe.right=A);var ee={};re&&(ee.textAlign=re);var k,U=V===!0?{showTitle:!0}:V;U&&(U.showTitle||$==="header")&&(typeof Te=="string"||typeof Te=="number"?k=Te.toString():D.isValidElement(Te)&&typeof Te.props.children=="string"&&(k=Te.props.children));var q=Object(Q.a)(Object(Q.a)(Object(Q.a)({title:k},ze),G),{},{colSpan:de&&de!==1?de:null,rowSpan:le&&le!==1?le:null,className:w()(he,c,(t={},Object(ue.a)(t,"".concat(he,"-fix-left"),Ie),Object(ue.a)(t,"".concat(he,"-fix-left-first"),P),Object(ue.a)(t,"".concat(he,"-fix-left-last"),I),Object(ue.a)(t,"".concat(he,"-fix-right"),qe),Object(ue.a)(t,"".concat(he,"-fix-right-first"),W),Object(ue.a)(t,"".concat(he,"-fix-right-last"),K),Object(ue.a)(t,"".concat(he,"-ellipsis"),V),Object(ue.a)(t,"".concat(he,"-with-append"),te),Object(ue.a)(t,"".concat(he,"-fix-sticky"),(Ie||qe)&&ne),t),G.className,We),style:Object(Q.a)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},G.style),ee),Oe),je),ref:o(C)?r:null});return D.createElement(C,Object.assign({},q),te,Te)}var l=D.forwardRef(i);l.displayName="Cell";var s=D.memo(l,function(h,r){return r.shouldCellUpdate?!r.shouldCellUpdate(r.record,h.record):!1});Le.a=s},gRFJ:function(nt,Le,F){nt.exports=[F("rdUC"),F("ynwM"),F("RELg"),F("DlR+"),F("CrYA"),F("PD8m")]},gaXo:function(module,exports){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(nt){return nt<10?"0"+nt:nt}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(nt){return rx_escapable.lastIndex=0,rx_escapable.test(nt)?'"'+nt.replace(rx_escapable,function(Le){var F=meta[Le];return typeof F=="string"?F:"\\u"+("0000"+Le.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+nt+'"'}function str(nt,Le){var F,ue,Q,j,S=gap,D,x=Le[nt];x&&typeof x=="object"&&typeof x.toJSON=="function"&&(x=x.toJSON(nt)),typeof rep=="function"&&(x=rep.call(Le,nt,x));switch(typeof x){case"string":return quote(x);case"number":return isFinite(x)?String(x):"null";case"boolean":case"null":return String(x);case"object":if(!x)return"null";if(gap+=indent,D=[],Object.prototype.toString.apply(x)==="[object Array]"){for(j=x.length,F=0;F<j;F+=1)D[F]=str(F,x)||"null";return Q=D.length===0?"[]":gap?`[
|
|
|
`+gap+D.join(`,
|
|
|
`+gap)+`
|
|
|
`+S+"]":"["+D.join(",")+"]",gap=S,Q}if(rep&&typeof rep=="object")for(j=rep.length,F=0;F<j;F+=1)typeof rep[F]=="string"&&(ue=rep[F],Q=str(ue,x),Q&&D.push(quote(ue)+(gap?": ":":")+Q));else for(ue in x)Object.prototype.hasOwnProperty.call(x,ue)&&(Q=str(ue,x),Q&&D.push(quote(ue)+(gap?": ":":")+Q));return Q=D.length===0?"{}":gap?`{
|
|
|
`+gap+D.join(`,
|
|
|
`+gap)+`
|
|
|
`+S+"}":"{"+D.join(",")+"}",gap=S,Q}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(nt,Le,F){var ue;if(gap="",indent="",typeof F=="number")for(ue=0;ue<F;ue+=1)indent+=" ";else typeof F=="string"&&(indent=F);if(rep=Le,Le&&typeof Le!="function"&&(typeof Le!="object"||typeof Le.length!="number"))throw new Error("JSON.stringify");return str("",{"":nt})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(nt,Le){var F,ue,Q=nt[Le];if(Q&&typeof Q=="object")for(F in Q)Object.prototype.hasOwnProperty.call(Q,F)&&(ue=walk(Q,F),ue!==void 0?Q[F]=ue:delete Q[F]);return reviver.call(nt,Le,Q)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(nt){return"\\u"+("0000"+nt.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},gqXR:function(nt,Le,F){nt.exports=F.p+"static/g.a5bcde87.svg"},hW8S:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return S}),F.d(Le,"c",function(){return D}),F.d(Le,"b",function(){return x});var ue=F("VTBJ"),Q=F("Ff2n"),j=F("Kwbf"),S="RC_TABLE_INTERNAL_COL_DEFINE";function D(T){var w=T.expandable,f=Object(Q.a)(T,["expandable"]);return"expandable"in T?Object(ue.a)(Object(ue.a)({},f),w):f}function x(T){return Object.keys(T).reduce(function(w,f){return(f.substr(0,5)==="data-"||f.substr(0,5)==="aria-")&&(w[f]=T[f]),w},{})}},hgre:function(nt,Le,F){"use strict";var ue=F("miYZ"),Q=F("tsqr"),j=F("9og8"),S=F("WmNS"),D=F.n(S),x=F("q1tI"),T=F.n(x),w=F("GUcZ"),f=F("ulZh"),p=F.n(f),u=F("xKgJ"),o=F("bntm"),i=F("4xil"),l=F.n(i);function s(n){if(isNaN(n))return{minutes:"00",seconds:"00"};var c=new Date(n*1e3).toISOString().substr(11,8);return{minutes:c.substr(3,2),seconds:c.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function h(n,c){return n-c}function r(n){n.sort(h);for(var c=0,m=0;m<n.length-1;m++){var v=Math.abs(n[m+1]-n[m]);v<21&&(c+=v)}return c}var t=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;Le.a=Object(x.forwardRef)(function(n,c){var m,v=n.src,b=n.toLog,E=n.videoId,g=n.logWatchHistory,y=n.courseId,C=y===void 0?null:y,d=n.startTime,_=n.handlePause,O=_===void 0?function(){}:_,A=n.handlePlay,P=A===void 0?function(){}:A,I=n.handlePlayEnded,W=I===void 0?function(){}:I,K=n.videoSpeed,te=K===void 0?1:K,H=v==null||((m=v.split("."))===null||m===void 0)?void 0:m.pop(),G=H==="flv",V=Object(x.useRef)(),re=Object(x.useRef)(),$=Object(x.useRef)(),ne=Object(x.useRef)(),he=Object(x.useRef)(),pe=Object(x.useRef)(),Te=Object(x.useRef)(),we=Object(x.useRef)(),Me=Object(x.useRef)(),Ee=Object(x.useRef)(),xe=Object(x.useRef)(),Ge=Object(x.useRef)(),je=Object(x.useRef)(),We=Object(x.useRef)(),ze=navigator.userAgent.toLowerCase().match(t),de=ze?ze[0]:"pc",le=Object(x.useRef)(!1),Oe=Object(u.x)(),Ie=0,qe=0,ee=0,k=null,U=!1,q=20,Y=1,J=!1,be=!1,ke=[];Object(x.useImperativeHandle)(c,function(){return{getLastUpdatedTime:function(){return V.current.currentTime},getDuration:function(){return V.current.duration}}});var ct=Object(x.useCallback)(function(Qe){var Xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ke={point:V.current.currentTime};k?(Ke.log_id=k,Ke.watch_duration=r(ke),Ke.total_duration=qe):(C?(Ke.video_id=parseInt(E,10),Ke.course_id=C):Ke.video_id=E,Ke.duration=Ie,Ke.device=de),Xe&&(Ke.ed="1");function Fe(){return Ue.apply(this,arguments)}function Ue(){return Ue=Object(j.a)(D.a.mark(function _e(){var Ce;return D.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return J=!0,De.next=3,g(Ke);case 3:Ce=De.sent,k=Ce,J=!1,Qe&&Qe();case 7:case"end":return De.stop()}},_e)})),Ue.apply(this,arguments)}Fe()},[E,C]);Object(x.useEffect)(function(){Q.b.destroy();var Qe=null;return w.a.isSupported&&G&&v&&(v==null?void 0:v.indexOf(".m3u8"))<0?(Qe=w.a.createPlayer({type:"flv",volume:.8,cors:!0,url:v,muted:!1}),V.current&&(Qe.attachMediaElement(V.current),Qe.load())):V.current.setAttribute("src",v),Be(),function(){Qe&&(Qe.unload(),Qe.pause(),Qe.destroy(),Qe=null)}},[V,G,v]);function He(){V.current.paused?(ne.current.style.display="none",he.current.style.display="block"):(ne.current.style.display="block",he.current.style.display="none")}function Be(){xe.current.style.display="none",je.current.style.display="none",Ge.current.style.display="none",V.current.muted||V.current.volume===0?xe.current.style.display="block":V.current.volume>0&&V.current.volume<=.5?je.current.style.display="block":Ge.current.style.display="block"}Object(x.useEffect)(function(){var Qe=document.getElementById("play"),Xe=document.querySelectorAll(".playback-icons use");function Ke(){P(),d&&!le.current&&(V.current.currentTime=d),le.current=!0,ke.push(V.current.currentTime),U||(U=!0,b&&ct())}function Fe(){return Ue.apply(this,arguments)}function Ue(){return Ue=Object(j.a)(D.a.mark(function lt(){return D.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:He(),ke.push(V.current.currentTime),b&&ct(function(){k=null,ee=0,U=!1,J=!1,be=!1,ke=[],qe=0,Y=1},!0);case 3:case"end":return ut.stop()}},lt)})),Ue.apply(this,arguments)}function _e(){pe.current.value=Math.floor(V.current.currentTime),Te.current.value=Math.floor(V.current.currentTime)}function Ce(){var lt=s(Math.round(V.current.currentTime));Me.current.innerText="".concat(lt.minutes,":").concat(lt.seconds),Me.current.setAttribute("datetime","".concat(lt.minutes,"m ").concat(lt.seconds,"s"))}function Ne(){var lt=Math.round(V.current.duration);pe.current.setAttribute("max",lt),Te.current.setAttribute("max",lt);var pt=s(lt);we.current.innerText="".concat(pt.minutes,":").concat(pt.seconds),we.current.setAttribute("datetime","".concat(pt.minutes,"m ").concat(pt.seconds,"s"))}function De(){var lt=Math.round(V.current.duration);pe.current.setAttribute("max",lt),Te.current.setAttribute("max",lt);var pt=s(lt);we.current.innerText="".concat(pt.minutes,":").concat(pt.seconds),we.current.setAttribute("datetime","".concat(pt.minutes,"m ").concat(pt.seconds,"s")),_e(),Ce();var ut=re.current.getBoundingClientRect(),Pe=ut.width,Ve=ut.height,yt=ut.x,st=ut.y;if(yt<0||st<0||!Pe)return;if(!be){var Nt=V.current.currentTime,Ut=Nt-ee;Math.abs(Ut)<10?(qe+=Math.abs(Ut),ee=Nt,J||qe-Y*q>=0&&(Y++,ke.push(ee),b&&ct())):(ee=Nt,b&&ct())}}function rt(){be=!0}function tt(){V.current.playing&&ke.push(V.current.currentTime,ee),ee=V.current.currentTime,be=!1}function xt(){Ie=V.current.duration,Ie<=20&&(q=Ie/3),V.current.addEventListener("play",Ke)}function Mt(lt){lt.preventDefault(),Object(o.a)()?(V.current.style.width="100%",V.current.style.height="100%"):V.current.style.cssText=""}function Bt(){O()}function It(lt){var pt=lt.target.dataset.seek?lt.target.dataset.seek:lt.target.value;V.current.currentTime=pt,Te.current.value=pt,pe.current.value=pt}function Dt(lt){var pt=Math.round(lt.offsetX/lt.target.clientWidth*parseInt(lt.target.getAttribute("max"),10));pe.current.setAttribute("data-seek",pt);var ut=s(pt);Ee.current.textContent="".concat(ut.minutes,":").concat(ut.seconds);var Pe=V.current.getBoundingClientRect();Ee.current.style.left="".concat(lt.pageX-Pe.left,"px")}return $.current.addEventListener(Object(o.c)(),Mt),V.current.addEventListener("canplay",xt),V.current.addEventListener("ended",Fe),V.current.addEventListener("seeking",rt),V.current.addEventListener("seeked",tt),V.current.addEventListener("loadedmetadata",Ne),pe.current.addEventListener("mousemove",Dt),pe.current.addEventListener("input",It),V.current.addEventListener("timeupdate",De),V.current.addEventListener("pause",Bt),V.current.addEventListener("volumechange",Be),function(){V.current.removeEventListener("canplay",xt),V.current.removeEventListener("play",Ke),V.current.removeEventListener("ended",Fe),V.current.removeEventListener("seeking",rt),V.current.removeEventListener("seeked",tt),pe.current.removeEventListener("mousemove",Dt),pe.current.removeEventListener("input",It),V.current.removeEventListener("timeupdate",De),V.current.removeEventListener("pause",Bt),V.current.removeEventListener("loadedmetadata",Ne),V.current.removeEventListener("volumechange",Be),V.current.playing&&(ke.push(ee,V.current.currentTime),b&&ct())}},[V,v]),Object(x.useEffect)(function(){if(V.current.onended=function(){W(V)},V.current.oncontextmenu=function(){return!1},(v==null?void 0:v.indexOf(".m3u8"))>-1){if(V.current.canPlayType("application/vnd.apple.mpegurl"))V.current.src=v;else if(p.a.isSupported()){var Qe=new p.a;Qe.loadSource(v),Qe.attachMedia(V.current)}}},[v]),Object(x.useEffect)(function(){V.current.playbackRate=te},[te]);var Ze=function(){V.current.paused||V.current.ended?V.current.play():V.current.pause(),He()};function ht(){V.current.muted=!V.current.muted,V.current.muted?(We.current.setAttribute("data-volume",volume.value),We.current.value=0):We.current.value=We.current.dataset.volume}return T.a.createElement("div",{style:{position:"relative"},ref:$},T.a.createElement("div",{ref:re,className:"".concat(l.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(l.a.animate__loop)},Oe?Oe.login:" "),T.a.createElement("div",{className:l.a.container},T.a.createElement("div",{className:l.a["video-container"],id:"video-container"},T.a.createElement("div",{className:l.a["playback-animation"],id:"playback-animation"},T.a.createElement("svg",{className:l.a["playback-icons"]},T.a.createElement("use",{className:"hidden",href:"#play-icon"}),T.a.createElement("use",{href:"#pause"}))),T.a.createElement("video",{className:l.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:V,autoPlay:!1}),T.a.createElement("div",{className:"".concat(l.a["video-controls"]," "),id:"video-controls"},T.a.createElement("div",{className:l.a["bottom-controls"]},T.a.createElement("div",{className:l.a["left-controls"]},T.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:Ze},T.a.createElement("svg",{className:l.a["playback-icons"]},T.a.createElement("use",{ref:he,href:"#play-icon"}),T.a.createElement("use",{ref:ne,style:{display:"none"},href:"#pause"}))),T.a.createElement("div",{className:l.a.time},T.a.createElement("time",{id:"time-elapsed",ref:Me},"00:00"),T.a.createElement("span",null," / "),T.a.createElement("time",{id:"duration",ref:we},"00:00"))),T.a.createElement("div",{className:l.a["right-controls"]},T.a.createElement("div",{className:l.a["volume-controls"]},T.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:l.a["volume-button"],id:"volume-button",onClick:ht},T.a.createElement("svg",null,T.a.createElement("use",{ref:xe,href:"#volume-mute"}),T.a.createElement("use",{ref:je,href:"#volume-low"}),T.a.createElement("use",{ref:Ge,href:"#volume-high"}))),T.a.createElement("input",{className:l.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:We,style:{display:"none"},onClick:Be})),T.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:l.a["fullscreen-button"],onClick:function(){Object(o.a)()?Object(o.b)():Object(o.d)($.current)}},T.a.createElement("svg",null,T.a.createElement("use",{href:"#fullscreen"}),T.a.createElement("use",{href:"#fullscreen-exit",className:"hidden"}))))),T.a.createElement("div",{className:l.a["video-progress"]},T.a.createElement("progress",{ref:Te,value:"0",min:"0"}),T.a.createElement("input",{className:l.a.seek,ref:pe,value:"0",min:"0",type:"range",step:"1"}),T.a.createElement("div",{className:l.a["seek-tooltip"],ref:Ee,id:"seek-tooltip"},"00:00"))))),T.a.createElement("svg",{style:{display:"none"}},T.a.createElement("defs",null,T.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},T.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),T.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},T.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),T.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},T.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"})),T.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},T.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"})),T.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},T.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"})),T.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},T.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"})),T.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},T.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"})),T.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},T.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"})))))})},i3hx:function(nt,Le,F){},je13:function(nt,Le,F){var ue=F("5nXd"),Q=F("gRFJ"),j=[F("uQRt")];nt.exports=ue.createStore(Q,j)},kSUc:function(nt,Le,F){},"kaH+":function(nt,Le,F){"use strict";var ue=F("+L6B"),Q=F("2/Rp"),j=F("tJVT"),S=F("q1tI"),D=F.n(S),x=F("XFxt"),T=F.n(x),w=F("dhSg"),f=F("rLCj"),p=F("dF/Y"),u=F("4i/N");Le.a=function(){var o=Object(S.useState)(""),i=Object(j.a)(o,2),l=i[0],s=i[1],h=Object(S.useState)(0),r=Object(j.a)(h,2),t=r[0],n=r[1],c=Object(S.useRef)("");Object(S.useEffect)(function(){var E=w.a.subscribe("preview-image",function(g){s(g),document.body.style.overflow="hidden"});return E},[]),Object(S.useEffect)(function(){return document.addEventListener("keydown",m),function(){document.removeEventListener("keydown",m)}},[]),Object(S.useEffect)(function(){c.current=l},[l]);function m(E){E.keyCode==27&&c.current&&v()}function v(){document.body.style.overflow="auto",s("")}function b(){n(t+90)}return D.a.createElement(S.Fragment,null,l?D.a.createElement("div",{className:T.a["image-preview-container"]},D.a.createElement("div",{className:T.a["button-group"]},D.a.createElement(Q.a,{onClick:b},"\u65CB\u8F6C",D.a.createElement(f.a,null)),D.a.createElement(Q.a,{href:l},"\u4E0B\u8F7D",D.a.createElement(p.a,null)),D.a.createElement(Q.a,{onClick:v},"\u5173\u95ED",D.a.createElement(u.a,null))),D.a.createElement("div",{className:T.a["preview-wrp-group"]},D.a.createElement("img",{className:T.a["image-preview"],src:l,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(t,"deg)")}}))):null)}},kovY:function(nt,Le,F){nt.exports=F.p+"static/e.eabfa286.svg"},lOMy:function(nt,Le,F){},lZu9:function(nt,Le,F){(function(ue){ue(F("VrN/"),F("1eCo"),F("8EBN"))})(function(ue){"use strict";ue.defineMode("markdown",function(Q,j){var S=ue.getMode(Q,"text/html"),D=S.name=="null";function x(H){if(ue.findModeByName){var G=ue.findModeByName(H);G&&(H=G.mime||G.mimes[0])}var V=ue.getMode(Q,H);return V.name=="null"?null:V}j.highlightFormatting===void 0&&(j.highlightFormatting=!1),j.maxBlockquoteDepth===void 0&&(j.maxBlockquoteDepth=0),j.taskLists===void 0&&(j.taskLists=!1),j.strikethrough===void 0&&(j.strikethrough=!1),j.emoji===void 0&&(j.emoji=!1),j.fencedCodeBlockHighlighting===void 0&&(j.fencedCodeBlockHighlighting=!0),j.fencedCodeBlockDefaultMode===void 0&&(j.fencedCodeBlockDefaultMode="text/plain"),j.xml===void 0&&(j.xml=!0),j.tokenTypeOverrides===void 0&&(j.tokenTypeOverrides={});var T={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var w in T)T.hasOwnProperty(w)&&j.tokenTypeOverrides[w]&&(T[w]=j.tokenTypeOverrides[w]);var f=/^([*\-_])(?:\s*\1){2,}\s*$/,p=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,o=j.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,i=/^ {0,3}(?:\={1,}|-{2,})\s*$/,l=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,h=/^\s*\[[^\]]+?\]:.*$/,r=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,t=" ";function n(H,G,V){return G.f=G.inline=V,V(H,G)}function c(H,G,V){return G.f=G.block=V,V(H,G)}function m(H){return!H||!/\S/.test(H.string)}function v(H){if(H.linkTitle=!1,H.linkHref=!1,H.linkText=!1,H.em=!1,H.strong=!1,H.strikethrough=!1,H.quote=0,H.indentedCode=!1,H.f==E){var G=D;if(!G){var V=ue.innerMode(S,H.htmlState);G=V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText}G&&(H.f=d,H.block=b,H.htmlState=null)}return H.trailingSpace=0,H.trailingSpaceNewLine=!1,H.prevLine=H.thisLine,H.thisLine={stream:null},null}function b(H,G){var V=H.column()===G.indentation,re=m(G.prevLine.stream),$=G.indentedCode,ne=G.prevLine.hr,he=G.list!==!1,pe=(G.listStack[G.listStack.length-1]||0)+3;G.indentedCode=!1;var Te=G.indentation;if(G.indentationDiff===null&&(G.indentationDiff=G.indentation,he)){for(G.list=null;Te<G.listStack[G.listStack.length-1];)G.listStack.pop(),G.listStack.length?G.indentation=G.listStack[G.listStack.length-1]:G.list=!1;G.list!==!1&&(G.indentationDiff=Te-G.listStack[G.listStack.length-1])}var we=!re&&!ne&&!G.prevLine.header&&(!he||!$)&&!G.prevLine.fencedCodeEnd,Me=(G.list===!1||ne||re)&&G.indentation<=pe&&H.match(f),Ee=null;if(G.indentationDiff>=4&&($||G.prevLine.fencedCodeEnd||G.prevLine.header||re))return H.skipToEnd(),G.indentedCode=!0,T.code;if(H.eatSpace())return null;if(V&&G.indentation<=pe&&(Ee=H.match(o))&&Ee[1].length<=6)return G.quote=0,G.header=Ee[1].length,G.thisLine.header=!0,j.highlightFormatting&&(G.formatting="header"),G.f=G.inline,y(G);if(G.indentation<=pe&&H.eat(">"))return G.quote=V?1:G.quote+1,j.highlightFormatting&&(G.formatting="quote"),H.eatSpace(),y(G);if(!Me&&!G.setext&&V&&G.indentation<=pe&&(Ee=H.match(p))){var xe=Ee[1]?"ol":"ul";return G.indentation=Te+H.current().length,G.list=!0,G.quote=0,G.listStack.push(G.indentation),G.em=!1,G.strong=!1,G.code=!1,G.strikethrough=!1,j.taskLists&&H.match(u,!1)&&(G.taskList=!0),G.f=G.inline,j.highlightFormatting&&(G.formatting=["list","list-"+xe]),y(G)}else{if(V&&G.indentation<=pe&&(Ee=H.match(s,!0)))return G.quote=0,G.fencedEndRE=new RegExp(Ee[1]+"+ *$"),G.localMode=j.fencedCodeBlockHighlighting&&x(Ee[2]||j.fencedCodeBlockDefaultMode),G.localMode&&(G.localState=ue.startState(G.localMode)),G.f=G.block=g,j.highlightFormatting&&(G.formatting="code-block"),G.code=-1,y(G);if(G.setext||(!we||!he)&&!G.quote&&G.list===!1&&!G.code&&!Me&&!h.test(H.string)&&(Ee=H.lookAhead(1))&&(Ee=Ee.match(i)))return G.setext?(G.header=G.setext,G.setext=0,H.skipToEnd(),j.highlightFormatting&&(G.formatting="header")):(G.header=Ee[0].charAt(0)=="="?1:2,G.setext=G.header),G.thisLine.header=!0,G.f=G.inline,y(G);if(Me)return H.skipToEnd(),G.hr=!0,G.thisLine.hr=!0,T.hr;if(H.peek()==="[")return n(H,G,I)}return n(H,G,G.inline)}function E(H,G){var V=S.token(H,G.htmlState);if(!D){var re=ue.innerMode(S,G.htmlState);(re.mode.name=="xml"&&re.state.tagStart===null&&!re.state.context&&re.state.tokenize.isInText||G.md_inside&&H.current().indexOf(">")>-1)&&(G.f=d,G.block=b,G.htmlState=null)}return V}function g(H,G){var V=G.listStack[G.listStack.length-1]||0,re=G.indentation<V,$=V+3;if(G.fencedEndRE&&G.indentation<=$&&(re||H.match(G.fencedEndRE))){j.highlightFormatting&&(G.formatting="code-block");var ne;return re||(ne=y(G)),G.localMode=G.localState=null,G.block=b,G.f=d,G.fencedEndRE=null,G.code=0,G.thisLine.fencedCodeEnd=!0,re?c(H,G,G.block):ne}else return G.localMode?G.localMode.token(H,G.localState):(H.skipToEnd(),T.code)}function y(H){var G=[];if(H.formatting){G.push(T.formatting),typeof H.formatting=="string"&&(H.formatting=[H.formatting]);for(var V=0;V<H.formatting.length;V++)G.push(T.formatting+"-"+H.formatting[V]),H.formatting[V]==="header"&&G.push(T.formatting+"-"+H.formatting[V]+"-"+H.header),H.formatting[V]==="quote"&&(!j.maxBlockquoteDepth||j.maxBlockquoteDepth>=H.quote?G.push(T.formatting+"-"+H.formatting[V]+"-"+H.quote):G.push("error"))}if(H.taskOpen)return G.push("meta"),G.length?G.join(" "):null;if(H.taskClosed)return G.push("property"),G.length?G.join(" "):null;if(H.linkHref?G.push(T.linkHref,"url"):(H.strong&&G.push(T.strong),H.em&&G.push(T.em),H.strikethrough&&G.push(T.strikethrough),H.emoji&&G.push(T.emoji),H.linkText&&G.push(T.linkText),H.code&&G.push(T.code),H.image&&G.push(T.image),H.imageAltText&&G.push(T.imageAltText,"link"),H.imageMarker&&G.push(T.imageMarker)),H.header&&G.push(T.header,T.header+"-"+H.header),H.quote&&(G.push(T.quote),!j.maxBlockquoteDepth||j.maxBlockquoteDepth>=H.quote?G.push(T.quote+"-"+H.quote):G.push(T.quote+"-"+j.maxBlockquoteDepth)),H.list!==!1){var re=(H.listStack.length-1)%3;re?re===1?G.push(T.list2):G.push(T.list3):G.push(T.list1)}return H.trailingSpaceNewLine?G.push("trailing-space-new-line"):H.trailingSpace&&G.push("trailing-space-"+(H.trailingSpace%2?"a":"b")),G.length?G.join(" "):null}function C(H,G){return H.match(l,!0)?y(G):void 0}function d(H,G){var V=G.text(H,G);if(typeof V!="undefined")return V;if(G.list)return G.list=null,y(G);if(G.taskList){var re=H.match(u,!0)[1]===" ";return re?G.taskOpen=!0:G.taskClosed=!0,j.highlightFormatting&&(G.formatting="task"),G.taskList=!1,y(G)}if(G.taskOpen=!1,G.taskClosed=!1,G.header&&H.match(/^#+$/,!0))return j.highlightFormatting&&(G.formatting="header"),y(G);var $=H.next();if(G.linkTitle){G.linkTitle=!1;var ne=$;$==="("&&(ne=")"),ne=(ne+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var he="^\\s*(?:[^"+ne+"\\\\]+|\\\\\\\\|\\\\.)"+ne;if(H.match(new RegExp(he),!0))return T.linkHref}if($==="`"){var pe=G.formatting;j.highlightFormatting&&(G.formatting="code"),H.eatWhile("`");var Te=H.current().length;if(G.code==0&&(!G.quote||Te==1))return G.code=Te,y(G);if(Te==G.code){var we=y(G);return G.code=0,we}else return G.formatting=pe,y(G)}else if(G.code)return y(G);if($==="\\"&&(H.next(),j.highlightFormatting)){var Me=y(G),Ee=T.formatting+"-escape";return Me?Me+" "+Ee:Ee}if($==="!"&&H.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return G.imageMarker=!0,G.image=!0,j.highlightFormatting&&(G.formatting="image"),y(G);if($==="["&&G.imageMarker&&H.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return G.imageMarker=!1,G.imageAltText=!0,j.highlightFormatting&&(G.formatting="image"),y(G);if($==="]"&&G.imageAltText){j.highlightFormatting&&(G.formatting="image");var Me=y(G);return G.imageAltText=!1,G.image=!1,G.inline=G.f=O,Me}if($==="["&&!G.image)return G.linkText&&H.match(/^.*?\]/)||(G.linkText=!0,j.highlightFormatting&&(G.formatting="link")),y(G);if($==="]"&&G.linkText){j.highlightFormatting&&(G.formatting="link");var Me=y(G);return G.linkText=!1,G.inline=G.f=H.match(/\(.*?\)| ?\[.*?\]/,!1)?O:d,Me}if($==="<"&&H.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){G.f=G.inline=_,j.highlightFormatting&&(G.formatting="link");var Me=y(G);return Me?Me+=" ":Me="",Me+T.linkInline}if($==="<"&&H.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){G.f=G.inline=_,j.highlightFormatting&&(G.formatting="link");var Me=y(G);return Me?Me+=" ":Me="",Me+T.linkEmail}if(j.xml&&$==="<"&&H.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var xe=H.string.indexOf(">",H.pos);if(xe!=-1){var Ge=H.string.substring(H.start,xe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ge)&&(G.md_inside=!0)}return H.backUp(1),G.htmlState=ue.startState(S),c(H,G,E)}if(j.xml&&$==="<"&&H.match(/^\/\w*?>/))return G.md_inside=!1,"tag";if($==="*"||$==="_"){for(var je=1,We=H.pos==1?" ":H.string.charAt(H.pos-2);je<3&&H.eat($);)je++;var ze=H.peek()||" ",de=!/\s/.test(ze)&&(!r.test(ze)||/\s/.test(We)||r.test(We)),le=!/\s/.test(We)&&(!r.test(We)||/\s/.test(ze)||r.test(ze)),Oe=null,Ie=null;if(je%2&&(!G.em&&de&&($==="*"||!le||r.test(We))?Oe=!0:G.em==$&&le&&($==="*"||!de||r.test(ze))&&(Oe=!1)),je>1&&(!G.strong&&de&&($==="*"||!le||r.test(We))?Ie=!0:G.strong==$&&le&&($==="*"||!de||r.test(ze))&&(Ie=!1)),Ie!=null||Oe!=null){j.highlightFormatting&&(G.formatting=Oe==null?"strong":Ie==null?"em":"strong em"),Oe===!0&&(G.em=$),Ie===!0&&(G.strong=$);var we=y(G);return Oe===!1&&(G.em=!1),Ie===!1&&(G.strong=!1),we}}else if($===" "&&(H.eat("*")||H.eat("_"))){if(H.peek()===" ")return y(G);H.backUp(1)}if(j.strikethrough){if($==="~"&&H.eatWhile($)){if(G.strikethrough){j.highlightFormatting&&(G.formatting="strikethrough");var we=y(G);return G.strikethrough=!1,we}else if(H.match(/^[^\s]/,!1))return G.strikethrough=!0,j.highlightFormatting&&(G.formatting="strikethrough"),y(G)}else if($===" "&&H.match(/^~~/,!0)){if(H.peek()===" ")return y(G);H.backUp(2)}}if(j.emoji&&$===":"&&H.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){G.emoji=!0,j.highlightFormatting&&(G.formatting="emoji");var qe=y(G);return G.emoji=!1,qe}return $===" "&&(H.match(/^ +$/,!1)?G.trailingSpace++:G.trailingSpace&&(G.trailingSpaceNewLine=!0)),y(G)}function _(H,G){var V=H.next();if(V===">"){G.f=G.inline=d,j.highlightFormatting&&(G.formatting="link");var re=y(G);return re?re+=" ":re="",re+T.linkInline}return H.match(/^[^>]+/,!0),T.linkInline}function O(H,G){if(H.eatSpace())return null;var V=H.next();return V==="("||V==="["?(G.f=G.inline=P(V==="("?")":"]"),j.highlightFormatting&&(G.formatting="link-string"),G.linkHref=!0,y(G)):"error"}var A={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function P(H){return function(G,V){var re=G.next();if(re===H){V.f=V.inline=d,j.highlightFormatting&&(V.formatting="link-string");var $=y(V);return V.linkHref=!1,$}return G.match(A[H]),V.linkHref=!0,y(V)}}function I(H,G){return H.match(/^([^\]\\]|\\.)*\]:/,!1)?(G.f=W,H.next(),j.highlightFormatting&&(G.formatting="link"),G.linkText=!0,y(G)):n(H,G,d)}function W(H,G){if(H.match(/^\]:/,!0)){G.f=G.inline=K,j.highlightFormatting&&(G.formatting="link");var V=y(G);return G.linkText=!1,V}return H.match(/^([^\]\\]|\\.)+/,!0),T.linkText}function K(H,G){return H.eatSpace()?null:(H.match(/^[^\s]+/,!0),H.peek()===void 0?G.linkTitle=!0:H.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),G.f=G.inline=d,T.linkHref+" url")}var te={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:d,text:C,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(H){return{f:H.f,prevLine:H.prevLine,thisLine:H.thisLine,block:H.block,htmlState:H.htmlState&&ue.copyState(S,H.htmlState),indentation:H.indentation,localMode:H.localMode,localState:H.localMode?ue.copyState(H.localMode,H.localState):null,inline:H.inline,text:H.text,formatting:!1,linkText:H.linkText,linkTitle:H.linkTitle,linkHref:H.linkHref,code:H.code,em:H.em,strong:H.strong,strikethrough:H.strikethrough,emoji:H.emoji,header:H.header,setext:H.setext,hr:H.hr,taskList:H.taskList,list:H.list,listStack:H.listStack.slice(0),quote:H.quote,indentedCode:H.indentedCode,trailingSpace:H.trailingSpace,trailingSpaceNewLine:H.trailingSpaceNewLine,md_inside:H.md_inside,fencedEndRE:H.fencedEndRE}},token:function(H,G){if(G.formatting=!1,H!=G.thisLine.stream){if(G.header=0,G.hr=!1,H.match(/^\s*$/,!0))return v(G),null;if(G.prevLine=G.thisLine,G.thisLine={stream:H},G.taskList=!1,G.trailingSpace=0,G.trailingSpaceNewLine=!1,!G.localState&&(G.f=G.block,G.f!=E)){var V=H.match(/^\s*/,!0)[0].replace(/\t/g,t).length;if(G.indentation=V,G.indentationDiff=null,V>0)return null}}return G.f(H,G)},innerMode:function(H){return H.block==E?{state:H.htmlState,mode:S}:H.localState?{state:H.localState,mode:H.localMode}:{state:H,mode:te}},indent:function(H,G,V){return H.block==E&&S.indent?S.indent(H.htmlState,G,V):H.localState&&H.localMode.indent?H.localMode.indent(H.localState,G,V):ue.Pass},blankLine:v,getType:y,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return te},"xml"),ue.defineMIME("text/markdown","markdown"),ue.defineMIME("text/x-markdown","markdown")})},n6Qo:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return w});var ue=F("q1tI"),Q=F("biw7"),j=F("fyJ8");function S(f){var p=f.className,u=f.index,o=f.children,i=f.colSpan,l=f.rowSpan,s=ue.useContext(Q.a),h=s.prefixCls,r=s.fixedInfoList,t=r[u];return ue.createElement(j.a,Object.assign({className:p,index:u,component:"td",prefixCls:h,record:null,dataIndex:null,render:function(){return{children:o,props:{colSpan:i,rowSpan:l}}}},t))}function D(f){return ue.createElement("tr",Object.assign({},f))}function x(f){var p=f.children,u=ue.useContext(Q.a),o=u.prefixCls;return ue.createElement("tfoot",{className:"".concat(o,"-summary")},p)}var T=Le.b=x,w={Cell:S,Row:D}},nCk5:function(nt,Le,F){nt.exports=F.p+"static/d.53bf6ae3.svg"},nWbc:function(nt,Le,F){},nnTU:function(nt,Le,F){"use strict";F.d(Le,"b",function(){return w}),F.d(Le,"a",function(){return f});var ue=F("pmY6"),Q=F("746U"),j=F("Cg/j"),S=F("MI8n"),D=F("24hK"),x=F("QDVR"),T=function(){for(var p=0,u=0,o=arguments.length;u<o;u++)p+=arguments[u].length;for(var i=Array(p),l=0,u=0;u<o;u++)for(var s=arguments[u],h=0,r=s.length;h<r;h++,l++)i[l]=s[h];return i},w=Object(j.c)("commandService"),f=new(function(){function p(){this._commands=new Map,this._onDidRegisterCommand=new S.a,this.onDidRegisterCommand=this._onDidRegisterCommand.event}return p.prototype.registerCommand=function(u,o){var i=this;if(!u)throw new Error("invalid command");if(typeof u=="string"){if(!o)throw new Error("invalid command");return this.registerCommand({id:u,handler:o})}if(u.description){for(var l=[],s=0,h=u.description.args;s<h.length;s++){var r=h[s];l.push(r.constraint)}var t=u.handler;u.handler=function(b){for(var E=[],g=1;g<arguments.length;g++)E[g-1]=arguments[g];return Object(Q.m)(E,l),t.apply(void 0,T([b],E))}}var n=u.id,c=this._commands.get(n);c||(c=new D.a,this._commands.set(n,c));var m=c.unshift(u),v=Object(ue.h)(function(){m();var b=i._commands.get(n);(b==null?void 0:b.isEmpty())&&i._commands.delete(n)});return this._onDidRegisterCommand.fire(n),v},p.prototype.registerCommandAlias=function(u,o){return f.registerCommand(u,function(i){for(var l,s=[],h=1;h<arguments.length;h++)s[h-1]=arguments[h];return(l=i.get(w)).executeCommand.apply(l,T([o],s))})},p.prototype.getCommand=function(u){var o=this._commands.get(u);return!o||o.isEmpty()?void 0:o.iterator().next().value},p.prototype.getCommands=function(){for(var u=new Map,o=0,i=Object(x.d)(this._commands);o<i.length;o++){var l=i[o],s=this.getCommand(l);s&&u.set(l,s)}return u},p}())},oE5q:function(nt,Le,F){nt.exports=F.p+"static/t.0b94c5c3.svg"},oFv4:function(nt,Le,F){nt.exports=F.p+"static/internal.da228387.png"},osHv:function(nt,Le,F){(function(ue){ue(F("VrN/"))})(function(ue){"use strict";var Q=ue.Pos;function j(r,t){return r.line-t.line||r.ch-t.ch}var S="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",D=S+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",x=new RegExp("<(/?)(["+S+"]["+D+"]*)","g");function T(r,t,n,c){this.line=t,this.ch=n,this.cm=r,this.text=r.getLine(t),this.min=c?Math.max(c.from,r.firstLine()):r.firstLine(),this.max=c?Math.min(c.to-1,r.lastLine()):r.lastLine()}function w(r,t){var n=r.cm.getTokenTypeAt(Q(r.line,t));return n&&/\btag\b/.test(n)}function f(r){return r.line>=r.max?void 0:(r.ch=0,r.text=r.cm.getLine(++r.line),!0)}function p(r){return r.line<=r.min?void 0:(r.text=r.cm.getLine(--r.line),r.ch=r.text.length,!0)}function u(r){for(;;){var t=r.text.indexOf(">",r.ch);if(t==-1){if(f(r))continue;return}if(!w(r,t+1)){r.ch=t+1;continue}var n=r.text.lastIndexOf("/",t),c=n>-1&&!/\S/.test(r.text.slice(n+1,t));return r.ch=t+1,c?"selfClose":"regular"}}function o(r){for(;;){var t=r.ch?r.text.lastIndexOf("<",r.ch-1):-1;if(t==-1){if(p(r))continue;return}if(!w(r,t+1)){r.ch=t;continue}x.lastIndex=t,r.ch=t;var n=x.exec(r.text);if(n&&n.index==t)return n}}function i(r){for(;;){x.lastIndex=r.ch;var t=x.exec(r.text);if(!t){if(f(r))continue;return}if(!w(r,t.index+1)){r.ch=t.index+1;continue}return r.ch=t.index+t[0].length,t}}function l(r){for(;;){var t=r.ch?r.text.lastIndexOf(">",r.ch-1):-1;if(t==-1){if(p(r))continue;return}if(!w(r,t+1)){r.ch=t;continue}var n=r.text.lastIndexOf("/",t),c=n>-1&&!/\S/.test(r.text.slice(n+1,t));return r.ch=t+1,c?"selfClose":"regular"}}function s(r,t){for(var n=[];;){var c=i(r),m,v=r.line,b=r.ch-(c?c[0].length:0);if(!c||!(m=u(r)))return;if(m=="selfClose")continue;if(c[1]){for(var E=n.length-1;E>=0;--E)if(n[E]==c[2]){n.length=E;break}if(E<0&&(!t||t==c[2]))return{tag:c[2],from:Q(v,b),to:Q(r.line,r.ch)}}else n.push(c[2])}}function h(r,t){for(var n=[];;){var c=l(r);if(!c)return;if(c=="selfClose"){o(r);continue}var m=r.line,v=r.ch,b=o(r);if(!b)return;if(b[1])n.push(b[2]);else{for(var E=n.length-1;E>=0;--E)if(n[E]==b[2]){n.length=E;break}if(E<0&&(!t||t==b[2]))return{tag:b[2],from:Q(r.line,r.ch),to:Q(m,v)}}}}ue.registerHelper("fold","xml",function(r,t){for(var n=new T(r,t.line,0);;){var c=i(n);if(!c||n.line!=t.line)return;var m=u(n);if(!m)return;if(!c[1]&&m!="selfClose"){var v=Q(n.line,n.ch),b=s(n,c[2]);return b&&j(b.from,v)>0?{from:v,to:b.from}:null}}}),ue.findMatchingTag=function(r,t,n){var c=new T(r,t.line,t.ch,n);if(c.text.indexOf(">")==-1&&c.text.indexOf("<")==-1)return;var m=u(c),v=m&&Q(c.line,c.ch),b=m&&o(c);if(!m||!b||j(c,t)>0)return;var E={from:Q(c.line,c.ch),to:v,tag:b[2]};return m=="selfClose"?{open:E,close:null,at:"open"}:b[1]?{open:h(c,b[2]),close:E,at:"close"}:(c=new T(r,v.line,v.ch,n),{open:E,close:s(c,b[2]),at:"open"})},ue.findEnclosingTag=function(r,t,n,c){for(var m=new T(r,t.line,t.ch,n);;){var v=h(m,c);if(!v)break;var b=new T(r,t.line,t.ch,n),E=s(b,v.tag);if(E)return{open:v,close:E}}},ue.scanForClosingTag=function(r,t,n,c){var m=new T(r,t.line,t.ch,c?{from:0,to:c}:null);return s(m,n)}})},p5ED:function(nt,Le,F){"use strict";var ue=F("+L6B"),Q=F("2/Rp"),j=F("5Dmo"),S=F("3S7+"),D=F("k1fw"),x=F("9og8"),T=F("tJVT"),w=F("WmNS"),f=F.n(w),p=F("q1tI"),u=F.n(p),o=F("vHTk"),i=F.n(o),l=F("yEEn"),s=F("ZW9T"),h=F("1vsH"),r=F("V0Rq"),t=F("m3rI");Le.a=function(n){var c,m,v,b,E,g,y=n.editOffice,C=y===void 0?"view":y,d=n.name,_=n.data,O=n.theme,A=n.type,P=n.filename,I=n.monacoEditor,W=n.className,K=n.style,te=n.close,H=n.onClose,G=n.hasMask,V=n.disabledDownload,re=n.onImgDimensions,$=n.otherData,ne=Object(p.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),he=Object(T.a)(ne,2),pe=he[0],Te=he[1],we=Object(p.useState)(""),Me=Object(T.a)(we,2),Ee=Me[0],xe=Me[1],Ge=Object(p.useState)(),je=Object(T.a)(Ge,2),We=je[0],ze=je[1],de=window.ENV==="build"?"/react/build":"",le=location.host.startsWith("localhost")?t.a.PROXY_SERVER:t.a.API_SERVER,Oe,Ie=1024*1024,qe=10*Ie,ee=Object(p.useRef)();(c=_)!==null&&c!==void 0&&c.startsWith("/api")&&A!=="txt"&&(_=t.a.API_SERVER+_),A==="office"&&(Oe=Object(h.P)(_).filesize,Oe>qe&&(A="other")),P&&(I.filename=P),Object(p.useEffect)(function(){var Y,J,be=(Y=document.cookie)===null||Y===void 0||((J=Y.replace(/\s/g,""))===null||J===void 0)?void 0:J.split(";");be==null||be.map(function(ke){var ct=ke.split("=");ct[0]==="_educoder_session"&&xe(ct[1])})},[]),Object(p.useEffect)(function(){A==="office"&&k()},[A,_]);var k=function(){var Y=Object(x.a)(f.a.mark(function J(){var be,ke,ct;return f.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return console.log("data:",_),be=_,_.startsWith("http")||(be=location.origin+be),ke=new URL(be).pathname.split("/").pop(),Be.next=6,Object(r.U)({attachment_id:ke});case 6:ct=Be.sent,ze(ct);case 8:case"end":return Be.stop()}},J)}));return function(){return Y.apply(this,arguments)}}(),U=function(){if(_.startsWith("http")||_.startsWith("blob:")){q();return}Object(h.x)(P||"educoder",_,P)},q=function(){Object(h.v)(P||"educoder",decodeURIComponent(_))};return u.a.createElement("div",{style:Object(D.a)({},K||{}),className:"".concat(G&&i.a.bgBlack," ").concat(A?i.a.wrp:"hide")},te&&u.a.createElement("div",{className:i.a.close,ref:ee},!!re&&u.a.createElement(S.a,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:function(){return ee.current}},u.a.createElement("span",{onClick:function(){H(),re()}},u.a.createElement("i",{className:"icon-yulanpizhu"}))),!V&&u.a.createElement(S.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return ee.current}},u.a.createElement("span",{onClick:q},u.a.createElement("i",{className:"icon-quxiaozhiding"}))),u.a.createElement(S.a,{title:"\u5173\u95ED",getPopupContainer:function(){return ee.current}},u.a.createElement("span",{className:"",onClick:H},u.a.createElement("i",{className:"icon-guanbi1"})))),u.a.createElement("div",{className:"".concat(i.a[W]," ").concat(W," ").concat(i.a.monaco," ").concat(A==="txt"?"show":"hide")},A==="txt"&&u.a.createElement(s.b,I)),A==="audio"&&u.a.createElement("audio",{src:"".concat(((m=_)===null||m===void 0?void 0:m.indexOf("http://"))>-1||((v=_)===null||v===void 0?void 0:v.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(_),autoPlay:!0}),A==="video"&&u.a.createElement(u.a.Fragment,null,((b=_)===null||b===void 0?void 0:b.indexOf("http"))>-1?u.a.createElement("video",{controls:!0,src:"".concat(_),autoPlay:!0}):u.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(_),autoPlay:!0})),A==="office"&&We&&u.a.createElement("iframe",{src:"".concat(de,"/office.html?key=").concat(We.key,"&url=").concat(le+We.url,"&callbackUrl=").concat(le+We.callbackUrl,"&fileType=").concat(We.fileType,"&title=").concat(We.title,"&model=").concat(C,"&officeServer=").concat(t.a.OFFICE_SERVER,"&disabledDownload=").concat(!!V)}),(A==="xlsx"||A==="doc"||A==="pptx"||A==="docx")&&u.a.createElement("iframe",{src:"/react/build/office.html?key=".concat($.key,"&url=").concat(t.a.API_SERVER+$.url,"&callbackUrl=").concat(t.a.API_SERVER+$.callbackUrl,"&fileType=").concat($.fileType,"&title=").concat($.title,"&model=").concat($.model)}),A==="html"&&u.a.createElement("iframe",{src:_+"&disposition=inline"}),A==="pdf"&&u.a.createElement("embed",{className:i.a.embed,src:_}),A==="image"&&u.a.createElement("img",{src:"".concat(((E=_)===null||E===void 0?void 0:E.indexOf("http://"))>-1||((g=_)===null||g===void 0?void 0:g.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(_)}),A==="other"&&u.a.createElement("div",null,u.a.createElement(Q.a,{type:"primary",size:"large",onClick:U},u.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),A==="download"&&u.a.createElement(Q.a,{type:"primary",size:"large",onClick:U},u.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(nt,Le,F){},pYxM:function(nt,Le,F){nt.exports={flex_box_center:"flex_box_center___v-DUT",flex_space_between:"flex_space_between___1bRJc",flex_box_vertical_center:"flex_box_vertical_center___k_OZG",flex_box_center_end:"flex_box_center_end___2lt4j",flex_box_column:"flex_box_column___3fVE5",active:"active___-vjVj",line:"line___3pg8N",list:"list___3yqVJ",left:"left___2dr70",mask:"mask___186YH",right:"right___17A6Y",name:"name___v6M7T",title:"title___1BhMz",a:"a___3T4cN",b:"b___1z1Bk",des:"des___29QAn",tag:"tag___FfUI2"}},pmY6:function(nt,Le,F){"use strict";F.d(Le,"g",function(){return D}),F.d(Le,"f",function(){return x}),F.d(Le,"e",function(){return T}),F.d(Le,"h",function(){return w}),F.d(Le,"b",function(){return f}),F.d(Le,"a",function(){return p}),F.d(Le,"d",function(){return u}),F.d(Le,"c",function(){return o});var ue=!1,Q="__is_disposable_tracked__";function j(i){if(!ue)return;if(i&&i!==p.None)try{i[Q]=!0}catch(l){}}function S(i){if(!ue)return i;var l=new Error("Potentially leaked disposable").stack;return setTimeout(function(){i[Q]||console.log(l)},3e3),i}function D(i){return typeof i.dispose=="function"&&i.dispose.length===0}function x(i){return Array.isArray(i)?(i.forEach(function(l){l&&(j(l),l.dispose())}),[]):i?(j(i),i.dispose(),i):void 0}function T(){for(var i=[],l=0;l<arguments.length;l++)i[l]=arguments[l];return i.forEach(j),S({dispose:function(){return x(i)}})}function w(i){var l=S({dispose:function(){j(l),i()}});return l}var f=function(){function i(){this._toDispose=new Set,this._isDisposed=!1}return i.prototype.dispose=function(){if(this._isDisposed)return;j(this),this._isDisposed=!0,this.clear()},i.prototype.clear=function(){this._toDispose.forEach(function(l){return l.dispose()}),this._toDispose.clear()},i.prototype.add=function(l){if(!l)return l;if(l===this)throw new Error("Cannot register a disposable on itself!");return j(l),this._isDisposed?console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(l),l},i}(),p=function(){function i(){this._store=new f,S(this)}return i.prototype.dispose=function(){j(this),this._store.dispose()},i.prototype._register=function(l){if(l===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(l)},i.None=Object.freeze({dispose:function(){}}),i}(),u=function(){function i(){this._isDisposed=!1,S(this)}return Object.defineProperty(i.prototype,"value",{get:function(){return this._isDisposed?void 0:this._value},set:function(l){if(this._isDisposed||l===this._value)return;this._value&&this._value.dispose(),l&&j(l),this._value=l},enumerable:!0,configurable:!0}),i.prototype.clear=function(){this.value=void 0},i.prototype.dispose=function(){this._isDisposed=!0,j(this),this._value&&this._value.dispose(),this._value=void 0},i}(),o=function(){function i(l){this.object=l}return i.prototype.dispose=function(){},i}()},ppsT:function(nt,Le,F){(function(ue){var Q,Q;!function(j){if(!0)window.OSS=j(),nt.exports=j();else var S}(function(){var j;return function(){function S(D,x,T){function w(u,o){if(!x[u]){if(!D[u]){var i=typeof Q=="function"&&Q;if(!o&&i)return Q(u,!0);if(f)return f(u,!0);var l=new Error("Cannot find module '"+u+"'");throw l.code="MODULE_NOT_FOUND",l}var s=x[u]={exports:{}};D[u][0].call(s.exports,function(h){return w(D[u][1][h]||h)},s,s.exports,S,D,x,T)}return x[u].exports}for(var f=typeof Q=="function"&&Q,p=0;p<T.length;p++)w(T[p]);return w}return S}()({1:[function(S,D,x){"use strict";var T=S("./browser/client");T.Buffer=S("buffer").Buffer,T.co=S("co"),T.urllib=S("../shims/xhr"),T.version=S("./browser/version").version,D.exports=T},{"../shims/xhr":244,"./browser/client":2,"./browser/version":5,buffer:38,co:41}],2:[function(S,D,x){(function(T,w){"use strict";function f(re){return re&&re.__esModule?re:{default:re}}function p(re,$){return re[$]||re[$.toLowerCase()]}function u(re,$){var ne=d.parse(re);if(!ne.protocol){var he=$?"https://":"http://";ne=d.parse(he+re)}if(ne.protocol!=="http:"&&ne.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return ne}function o(re,$,ne){var he=ne?"https://":"http://",pe=$?"-internal.aliyuncs.com":".aliyuncs.com";return re.substr(0,"vpc100-oss-cn-".length)==="vpc100-oss-cn-"&&(pe=".aliyuncs.com"),d.parse(he+re+pe)}function i(){return document&&document.location&&document.location.protocol==="https:"}function l(re,$){if(!(this instanceof l))return new l(re,$);re&&re.inited?this.options=re:this.options=l.initOptions(re),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=P,this.agent=this.options.agent||G),this.ctx=$,this.userAgent=this._getUserAgent(),this.options.amendTimeSkewed=0}var s=S("babel-runtime/regenerator"),h=f(s),r=S("babel-runtime/core-js/object/keys"),t=f(r),n=S("debug")("ali-oss"),c=S("./../../shims/crypto/crypto.js"),m=S("path"),v=S("copy-to"),b=S("mime"),E=S("xml2js"),g=S("humanize-ms"),y=S("agentkeepalive"),C=S("merge-descriptors"),d=S("url"),_=S("is-type-of"),O=S("platform"),A=S("utility"),P=S("urllib"),I=S("./version"),W=S("dateformat"),K=S("bowser"),te=S("../common/signUtils"),H=S("../common/utils"),G=new y;D.exports=l,l.initOptions=function(re){if(!re||!re.accessKeyId||!re.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");var $=i(),ne={region:"oss-cn-hangzhou",internal:!1,secure:$,bucket:null,endpoint:null,cname:!1};if((0,t.default)(re).forEach(function(he){re[he]!==void 0&&(ne[he]=re[he])}),ne.accessKeyId=ne.accessKeyId.trim(),ne.accessKeySecret=ne.accessKeySecret.trim(),ne.timeout&&(ne.timeout=g(ne.timeout)),ne.endpoint)ne.endpoint=u(ne.endpoint,ne.secure);else{if(!ne.region)throw new Error("require options.endpoint or options.region");ne.endpoint=o(ne.region,ne.internal,ne.secure)}return ne.inited=!0,ne};var V=l.prototype;C(V,S("./object")),C(V,S("./managed_upload")),C(V,S("../common/multipart")),C(V,S("../common/thunkpool.js")),l.Wrapper=S("./wrapper"),V.signature=function(re){return n("authorization stringToSign: %s",re),te.computeSignature(this.options.accessKeySecret,re)},V.authorization=function(re,$,ne,he){var pe=te.buildCanonicalString(re.toUpperCase(),$,{headers:he,parameters:ne});return te.authorization(this.options.accessKeyId,this.options.accessKeySecret,pe)},V.createRequest=function(re){var $={"x-oss-date":W(+new Date+this.options.amendTimeSkewed,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.options.stsToken&&($["x-oss-security-token"]=this.options.stsToken),v(re.headers).to($),p($,"Content-Type")||(re.mime===b.default_type&&(re.mime=""),re.mime&&re.mime.indexOf("/")>0?$["Content-Type"]=re.mime:$["Content-Type"]=b.getType(re.mime||m.extname(re.object||""))||"application/octet-stream"),re.content&&($["Content-Md5"]=c.createHash("md5").update(new w(re.content,"utf8")).digest("base64"),$["Content-Length"]||($["Content-Length"]=re.content.length));var ne=this._getResource(re);$.authorization=this.authorization(re.method,ne,re.subres,$);var he=this._getReqUrl(re);n("request %s %s, with headers %j, !!stream: %s",re.method,he,$,!!re.stream);var pe=re.timeout||this.options.timeout;return{url:he,params:{agent:this.agent,method:re.method,content:re.content,stream:re.stream,headers:$,timeout:pe,writeStream:re.writeStream,customResponse:re.customResponse,ctx:re.ctx||this.ctx}}},V.request=h.default.mark(function re($){var ne,he,pe,Te;return h.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return ne=this.createRequest($),he=void 0,pe=void 0,we.prev=3,we.next=6,this.urllib.request(ne.url,ne.params);case 6:he=we.sent,n("response %s %s, got %s, headers: %j",$.method,ne.url,he.status,he.headers),we.next=13;break;case 10:we.prev=10,we.t0=we.catch(3),pe=we.t0;case 13:if(Te=void 0,!he||!$.successStatuses||$.successStatuses.indexOf(he.status)!==-1){we.next=26;break}return we.next=17,this.requestError(he);case 17:if(Te=we.sent,Te.code!=="RequestTimeTooSkewed"){we.next=23;break}return this.options.amendTimeSkewed=+new Date(Te.serverTime)-new Date,we.next=22,this.request($);case 22:return we.abrupt("return",we.sent);case 23:Te.params=$,we.next=30;break;case 26:if(!pe){we.next=30;break}return we.next=29,this.requestError(pe);case 29:Te=we.sent;case 30:if(!Te){we.next=32;break}throw Te;case 32:if(!$.xmlResponse){we.next=36;break}return we.next=35,this.parseXML(he.data);case 35:he.data=we.sent;case 36:return we.abrupt("return",he);case 37:case"end":return we.stop()}},re,this,[[3,10]])}),V._getResource=function(re){var $="/";return re.bucket&&($+=re.bucket+"/"),re.object&&($+=re.object),$},V._isIP=function(re){return H._isIP(re)},V._escape=function(re){return A.encodeURIComponent(re).replace(/%2F/g,"/")},V._getReqUrl=function(re){var $={};v(this.options.endpoint).to($);var ne=this._isIP($.hostname),he=this.options.cname;!re.bucket||he||ne||($.host=re.bucket+"."+$.host);var pe="/";re.bucket&&ne&&(pe+=re.bucket+"/"),re.object&&(pe+=this._escape(re.object).replace(/\+/g,"%2B")),$.pathname=pe;var Te={};if(re.query&&C(Te,re.query),re.subres){var we={};_.string(re.subres)?we[re.subres]="":_.array(re.subres)?re.subres.forEach(function(Me){we[Me]=""}):we=re.subres,C(Te,we)}return $.query=Te,d.format($)},V._getUserAgent=function(){var re=T&&T.browser?"js":"nodejs",$="aliyun-sdk-"+re+"/"+I.version,ne=O.description;return!ne&&T&&(ne="Node.js "+T.version.slice(1)+" on "+T.platform+" "+T.arch),this._checkUserAgent($+" "+ne)},V._checkUserAgent=function(re){return re.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")},V.checkBrowserAndVersion=function(re,$){return K.name===re&&K.version.split(".")[0]===$},V.parseXML=function(re){return function($){w.isBuffer(re)&&(re=re.toString()),E.parseString(re,{explicitRoot:!1,explicitArray:!1},$)}},V.requestError=h.default.mark(function re($){var ne,he,pe,Te;return h.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:if(ne=null,$.data&&$.data.length){we.next=5;break}$.status===-1||$.status===-2?(ne=new Error($.message),ne.name=$.name,ne.status=$.status,ne.code=$.name):($.status===404?(ne=new Error("Object not exists"),ne.name="NoSuchKeyError",ne.status=404,ne.code="NoSuchKey"):$.status===412?(ne=new Error("Pre condition failed"),ne.name="PreconditionFailedError",ne.status=412,ne.code="PreconditionFailed"):(ne=new Error("Unknow error, status: "+$.status),ne.name="UnknowError",ne.status=$.status),ne.requestId=$.headers["x-oss-request-id"],ne.host=""),we.next=30;break;case 5:return he=String($.data),n("request response error data: %s",he),pe=void 0,we.prev=8,we.next=11,this.parseXML(he)||{};case 11:pe=we.sent,we.next=21;break;case 14:return we.prev=14,we.t0=we.catch(8),n(he),we.t0.message+=`
|
|
|
raw xml: `+he,we.t0.status=$.status,we.t0.requestId=$.headers["x-oss-request-id"],we.abrupt("return",we.t0);case 21:Te=pe.Message||"unknow request error, status: "+$.status,pe.Condition&&(Te+=" (condition: "+pe.Condition+")"),ne=new Error(Te),ne.name=pe.Code?pe.Code+"Error":"UnknowError",ne.status=$.status,ne.code=pe.Code,ne.requestId=pe.RequestId,ne.hostId=pe.HostId,ne.serverTime=pe.ServerTime;case 30:return n("generate error %j",ne),we.abrupt("return",ne);case 32:case"end":return we.stop()}},re,this,[[8,14]])})}).call(this,S("_process"),S("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(S,D,x){(function(T){"use strict";function w(v){return v&&v.__esModule?v:{default:v}}function f(v,b){if(!(this instanceof f))return new f(v,b);m.call(this,b),this.file=v,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}var p=S("babel-runtime/core-js/array/from"),u=w(p),o=S("babel-runtime/regenerator"),i=w(o),l=S("is-type-of"),s=S("util"),h=S("path"),r=S("mime"),t=S("copy-to"),n=x;n.multipartUpload=i.default.mark(function v(b,E,g){var y,C,d,_,O,A,P,I,W;return i.default.wrap(function(K){for(;;)switch(K.prev=K.next){case 0:if(this.resetCancelFlag(),g=g||{},!g.checkpoint||!g.checkpoint.uploadId){K.next=6;break}return K.next=5,this._resumeMultipart(g.checkpoint,g);case 5:return K.abrupt("return",K.sent);case 6:return y=102400,g.mime||(l.file(E)?g.mime=r.getType(h.extname(E.name)):l.blob(E)?g.mime=E.type:g.mime=r.getType(h.extname(E))),g.headers=g.headers||{},this._convertMetaToHeaders(g.meta,g.headers),K.next=12,this._getFileSize(E);case 12:if(!((C=K.sent)<y)){K.next=25;break}return d=this._createStream(E,0,C),g.contentLength=C,K.next=18,this.putStream(b,d,g);case 18:if(_=K.sent,!g||!g.progress){K.next=22;break}return K.next=22,g.progress(1);case 22:return O={res:_.res,bucket:this.options.bucket,name:b,etag:_.res.headers.etag},(g.headers&&g.headers["x-oss-callback"]||g.callback)&&(O.data=_.data),K.abrupt("return",O);case 25:if(!(g.partSize&&g.partSize<y)){K.next=27;break}throw new Error("partSize must not be smaller than "+y);case 27:return K.next=29,this.initMultipartUpload(b,g);case 29:if(A=K.sent,P=A.uploadId,I=this._getPartSize(C,g.partSize),W={file:E,name:b,fileSize:C,partSize:I,uploadId:P,doneParts:[]},!g||!g.progress){K.next=36;break}return K.next=36,g.progress(0,W,A.res);case 36:return K.next=38,this._resumeMultipart(W,g);case 38:return K.abrupt("return",K.sent);case 39:case"end":return K.stop()}},v,this)}),n._resumeMultipart=i.default.mark(function v(b,E){var g,y,C,d,_,O,A,P,I,W,K,te,H,G,V,re,$,ne,he,pe,Te;return i.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:if(!this.isCancel()){we.next=2;break}throw this._makeCancelEvent();case 2:if(g=b.file,y=b.fileSize,C=b.partSize,d=b.uploadId,_=b.doneParts,O=b.name,A=[],_.length>0&&t(_).to(A),P=this._divideParts(y,C),I=P.length,W=!1,K=i.default.mark(function Me(Ee,xe){var Ge,je,We;return i.default.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:if(Ee.isCancel()){ze.next=21;break}return ze.prev=1,Ge=P[xe-1],je={stream:Ee._createStream(g,Ge.start,Ge.end),size:Ge.end-Ge.start},ze.next=6,Ee._uploadPart(O,d,xe,je);case 6:if(We=ze.sent,Ee.isCancel()||W){ze.next=13;break}if(b.doneParts.push({number:xe,etag:We.res.headers.etag}),A.push({number:xe,etag:We.res.headers.etag}),!E||!E.progress){ze.next=13;break}return ze.next=13,E.progress(_.length/I,b,We.res);case 13:ze.next=21;break;case 15:if(ze.prev=15,ze.t0=ze.catch(1),Ee.isCancel()){ze.next=21;break}throw Ee.cancel(),ze.t0.partNum=xe,ze.t0;case 21:case"end":return ze.stop()}},Me,this,[[1,15]])}),te=(0,u.default)(new Array(I),function(Me,Ee){return Ee+1}),H=A.map(function(Me){return Me.number}),G=te.filter(function(Me){return H.indexOf(Me)<0}),V=5,re=E.parallel||V,!this.checkBrowserAndVersion("Internet Explorer","10")&&re!==1){we.next=26;break}$=0;case 16:if(!($<G.length)){we.next=24;break}if(!this.isCancel()){we.next=19;break}throw this._makeCancelEvent();case 19:return we.next=21,K(this,G[$]);case 21:$++,we.next=16;break;case 24:we.next=40;break;case 26:for(ne=[],he=0;he<G.length;he++)ne.push(K(this,G[he]));return we.next=30,this._thunkPool(ne,re);case 30:if(pe=we.sent,W=!0,!(pe&&pe.length>0)){we.next=37;break}throw this.resetCancelFlag(),Te=pe[0],Te.message="Failed to upload some parts with error: "+Te.toString()+" part_num: "+Te.partNum,Te;case 37:if(!this.isCancel()){we.next=40;break}throw ne=null,this._makeCancelEvent();case 40:return we.next=42,this.completeMultipartUpload(O,d,A,E);case 42:return we.abrupt("return",we.sent);case 43:case"end":return we.stop()}},v,this)}),l.file=function(v){return typeof File!="undefined"&&v instanceof File},l.blob=function(v){return typeof Blob!="undefined"&&v instanceof Blob},n._getFileSize=i.default.mark(function v(b){var E;return i.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(!l.buffer(b)){g.next=4;break}return g.abrupt("return",b.length);case 4:if(!l.blob(b)&&!l.file(b)){g.next=6;break}return g.abrupt("return",b.size);case 6:if(!l.string(b)){g.next=11;break}return g.next=9,this._statFile(b);case 9:return E=g.sent,g.abrupt("return",E.size);case 11:throw new Error("_getFileSize requires Buffer/File/String.");case 12:case"end":return g.stop()}},v,this)});var c=S("stream"),m=c.Readable;s.inherits(f,m),f.prototype.readFileAndPush=function(v){if(this.fileBuffer)for(var b=!0;b&&this.fileBuffer&&this.start<this.fileBuffer.length;){var E=this.start,g=E+v;g=g>this.fileBuffer.length?this.fileBuffer.length:g,this.start=g,b=this.push(this.fileBuffer.slice(E,g))}},f.prototype._read=function(v){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);v=v||16384;var b=this;this.reader.onload=function(E){b.fileBuffer=new T(new Uint8Array(E.target.result)),b.file=null,b.readFileAndPush(v)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(v)},n._createStream=function(v,b,E){if(l.blob(v)||l.file(v))return new f(v.slice(b,E));throw new Error("_createStream requires File/String.")},n._getPartSize=function(v,b){return b?Math.max(Math.ceil(v/1e4),b):1048576},n._divideParts=function(v,b){for(var E=Math.ceil(v/b),g=[],y=0;y<E;y++){var C=b*y,d=Math.min(C+b,v);g.push({start:C,end:d})}return g},n._makeCancelEvent=function(){return{status:0,name:"cancel"}}}).call(this,S("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(S,D,x){"use strict";function T(b){return b&&b.__esModule?b:{default:b}}var w=S("babel-runtime/core-js/object/keys"),f=T(w),p=S("babel-runtime/regenerator"),u=T(p),o=S("debug")("ali-oss:object"),i=S("utility"),l=S("fs"),s=S("is-type-of"),h=S("url"),r=S("copy-to"),t=S("path"),n=S("mime"),c=S("../common/callback"),m=S("../common/signUtils"),v=x;v.append=u.default.mark(function b(E,g,y){var C;return u.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return y=y||{},y.position===void 0&&(y.position="0"),y.subres={append:"",position:y.position},y.method="POST",d.next=6,this.put(E,g,y);case 6:return C=d.sent,C.nextAppendPosition=C.res.headers["x-oss-next-append-position"],d.abrupt("return",C);case 9:case"end":return d.stop()}},b,this)}),v.put=u.default.mark(function b(E,g,y){var C,d,_,O,A,P;return u.default.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(C=void 0,y=y||{},!s.buffer(g)){I.next=6;break}C=g,I.next=18;break;case 6:if(!s.blob(g)&&!s.file(g)){I.next=17;break}return y.mime||(s.file(g)?y.mime=n.getType(t.extname(g.name)):y.mime=g.type),d=this._createStream(g,0,g.size),I.next=11,this._getFileSize(g);case 11:return y.contentLength=I.sent,I.next=14,this.putStream(E,d,y);case 14:return I.abrupt("return",I.sent);case 17:throw new TypeError("Must provide Buffer/Blob for put.");case 18:return y.headers=y.headers||{},this._convertMetaToHeaders(y.meta,y.headers),_=y.method||"PUT",O=this._objectRequestParams(_,E,y),c.encodeCallback(O,y),O.mime=y.mime,O.content=C,O.successStatuses=[200],I.next=28,this.request(O);case 28:return A=I.sent,P={name:E,url:this._objectUrl(E),res:A.res},O.headers&&O.headers["x-oss-callback"]&&(P.data=JSON.parse(A.data.toString())),I.abrupt("return",P);case 32:case"end":return I.stop()}},b,this)}),v.putStream=u.default.mark(function b(E,g,y){var C,d,_,O;return u.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return y=y||{},y.headers=y.headers||{},y.contentLength?y.headers["Content-Length"]=y.contentLength:y.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(y.meta,y.headers),C=y.method||"PUT",d=this._objectRequestParams(C,E,y),c.encodeCallback(d,y),d.mime=y.mime,d.stream=g,d.successStatuses=[200],A.next=12,this.request(d);case 12:return _=A.sent,O={name:E,url:this._objectUrl(E),res:_.res},d.headers&&d.headers["x-oss-callback"]&&(O.data=JSON.parse(_.data.toString())),A.abrupt("return",O);case 16:case"end":return A.stop()}},b,this)}),v.head=u.default.mark(function b(E,g){var y,C,d;return u.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return y=this._objectRequestParams("HEAD",E,g),y.successStatuses=[200,304],_.next=4,this.request(y);case 4:return C=_.sent,d={meta:null,res:C.res,status:C.status},C.status===200&&(0,f.default)(C.headers).forEach(function(O){O.indexOf("x-oss-meta-")===0&&(d.meta||(d.meta={}),d.meta[O.substring(11)]=C.headers[O])}),_.abrupt("return",d);case 8:case"end":return _.stop()}},b,this)}),v.get=u.default.mark(function b(E,g,y){var C,d,_,O;return u.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return C=null,d=!1,s.writableStream(g)?C=g:s.string(g)?(C=l.createWriteStream(g),d=!0):y=g,y=y||{},y.process&&(y.subres=y.subres||{},y.subres["x-oss-process"]=y.process),_=void 0,A.prev=6,O=this._objectRequestParams("GET",E,y),O.writeStream=C,O.successStatuses=[200,206,304],A.next=12,this.request(O);case 12:_=A.sent,d&&C.destroy(),A.next=24;break;case 16:if(A.prev=16,A.t0=A.catch(6),!d){A.next=23;break}return C.destroy(),o("get error: %s, delete the exists file %s",A.t0,g),A.next=23,this._deleteFileSafe(g);case 23:throw A.t0;case 24:return A.abrupt("return",{res:_.res,content:_.data});case 25:case"end":return A.stop()}},b,this,[[6,16]])}),v.getStream=u.default.mark(function b(E,g){var y,C;return u.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return g=g||{},y=this._objectRequestParams("GET",E,g),y.customResponse=!0,y.successStatuses=[200,206,304],d.next=6,this.request(y);case 6:return C=d.sent,d.abrupt("return",{stream:C.res,res:{status:C.status,headers:C.headers}});case 8:case"end":return d.stop()}},b,this)}),v.delete=u.default.mark(function b(E,g){var y,C;return u.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return y=this._objectRequestParams("DELETE",E,g),y.successStatuses=[204],d.next=4,this.request(y);case 4:return C=d.sent,d.abrupt("return",{res:C.res});case 6:case"end":return d.stop()}},b,this)}),v.deleteMulti=u.default.mark(function b(E,g){var y,C,d,_,O,A;return u.default.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:for(g=g||{},y=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<Delete>
|
|
|
`,g.quiet?y+=` <Quiet>true</Quiet>
|
|
|
`:y+=` <Quiet>false</Quiet>
|
|
|
`,C=0;C<E.length;C++)y+=" <Object><Key>"+i.escape(this._objectName(E[C]))+`</Key></Object>
|
|
|
`;return y+="</Delete>",o("delete multi objects: %s",y),g.subres="delete",d=this._objectRequestParams("POST","",g),d.mime="xml",d.content=y,d.xmlResponse=!0,d.successStatuses=[200],P.next=14,this.request(d);case 14:return _=P.sent,O=_.data,A=O&&O.Deleted||null,A&&(Array.isArray(A)||(A=[A]),A=A.map(function(I){return I.Key})),P.abrupt("return",{res:_.res,deleted:A});case 19:case"end":return P.stop()}},b,this)}),v.copy=u.default.mark(function b(E,g,y){var C,d,_;return u.default.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return y=y||{},y.headers=y.headers||{},(0,f.default)(y.headers).forEach(function(A){y.headers["x-oss-copy-source-"+A.toLowerCase()]=y.headers[A]}),y.meta&&(y.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(y.meta,y.headers),g=g[0]!=="/"?"/"+this.options.bucket+"/"+encodeURIComponent(g):"/"+encodeURIComponent(g.slice(1)),y.headers["x-oss-copy-source"]=g,C=this._objectRequestParams("PUT",E,y),C.xmlResponse=!0,C.successStatuses=[200,304],O.next=12,this.request(C);case 12:return d=O.sent,_=d.data,_&&(_={etag:_.ETag,lastModified:_.LastModified}),O.abrupt("return",{data:_,res:d.res});case 16:case"end":return O.stop()}},b,this)}),v.putMeta=u.default.mark(function b(E,g,y){return u.default.wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,this.copy(E,E,{meta:g||{},timeout:y&&y.timeout,ctx:y&&y.ctx});case 2:return C.abrupt("return",C.sent);case 3:case"end":return C.stop()}},b,this)}),v.list=u.default.mark(function b(E,g){var y,C,d,_,O;return u.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return y=this._objectRequestParams("GET","",g),y.query=E,y.xmlResponse=!0,y.successStatuses=[200],A.next=6,this.request(y);case 6:return C=A.sent,d=C.data.Contents,_=this,d&&(Array.isArray(d)||(d=[d]),d=d.map(function(P){return{name:P.Key,url:_._objectUrl(P.Key),lastModified:P.LastModified,etag:P.ETag,type:P.Type,size:Number(P.Size),storageClass:P.StorageClass,owner:{id:P.Owner.ID,displayName:P.Owner.DisplayName}}})),O=C.data.CommonPrefixes||null,O&&(Array.isArray(O)||(O=[O]),O=O.map(function(P){return P.Prefix})),A.abrupt("return",{res:C.res,objects:d,prefixes:O,nextMarker:C.data.NextMarker||null,isTruncated:C.data.IsTruncated==="true"});case 13:case"end":return A.stop()}},b,this)}),v.putACL=u.default.mark(function b(E,g,y){var C,d;return u.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return y=y||{},y.subres="acl",y.headers=y.headers||{},y.headers["x-oss-object-acl"]=g,E=this._objectName(E),C=this._objectRequestParams("PUT",E,y),C.successStatuses=[200],_.next=9,this.request(C);case 9:return d=_.sent,_.abrupt("return",{res:d.res});case 11:case"end":return _.stop()}},b,this)}),v.getACL=u.default.mark(function b(E,g){var y,C;return u.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return g=g||{},g.subres="acl",E=this._objectName(E),y=this._objectRequestParams("GET",E,g),y.successStatuses=[200],y.xmlResponse=!0,d.next=8,this.request(y);case 8:return C=d.sent,d.abrupt("return",{acl:C.data.AccessControlList.Grant,owner:{id:C.data.Owner.ID,displayName:C.data.Owner.DisplayName},res:C.res});case 10:case"end":return d.stop()}},b,this)}),v.restore=u.default.mark(function b(E,g){var y,C;return u.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return g=g||{},g.subres="restore",y=this._objectRequestParams("POST",E,g),y.successStatuses=[202],d.next=6,this.request(y);case 6:return C=d.sent,d.abrupt("return",{res:C.res});case 8:case"end":return d.stop()}},b,this)}),v.signatureUrl=function(b,E){E=E||{},b=this._objectName(b),E.method=E.method||"GET";var g=i.timestamp()+(E.expires||1800),y={bucket:this.options.bucket,object:b},C=this._getResource(y);this.options.stsToken&&(E["security-token"]=this.options.stsToken);var d=m._signatureForURL(this.options.accessKeySecret,E,C,g),_=h.parse(this._getReqUrl(y));return _.query={OSSAccessKeyId:this.options.accessKeyId,Expires:g,Signature:d.Signature},r(d.subResource).to(_.query),_.format()},v.getObjectUrl=function(b,E){return E?E[E.length-1]!=="/"&&(E+="/"):E=this.options.endpoint.format(),E+this._escape(this._objectName(b))},v._objectUrl=function(b){return this._getReqUrl({bucket:this.options.bucket,object:b})},v.generateObjectUrl=function(b,E){if(E)E[E.length-1]!=="/"&&(E+="/");else{E=this.options.endpoint.format();var g=h.parse(E),y=this.options.bucket;g.hostname=y+"."+g.hostname,g.host=y+"."+g.host,E=g.format()}return E+this._escape(this._objectName(b))},v._objectRequestParams=function(b,E,g){if(!this.options.bucket)throw new Error("Please create a bucket first");g=g||{},E=this._objectName(E);var y={object:E,bucket:this.options.bucket,method:b,subres:g&&g.subres,timeout:g&&g.timeout,ctx:g&&g.ctx};return g.headers&&(y.headers={},r(g.headers).to(y.headers)),y},v._objectName=function(b){return b.replace(/^\/+/,"")},v._statFile=function(b){return function(E){l.stat(b,E)}},v._convertMetaToHeaders=function(b,E){b&&(0,f.default)(b).forEach(function(g){E["x-oss-meta-"+g]=b[g]})},v._deleteFileSafe=function(b){return function(E){l.exists(b,function(g){g?l.unlink(b,function(y){y&&o("unlink %j error: %s",b,y),E()}):E()})}}},{"../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(S,D,x){"use strict";x.version="5.3.1"},{}],6:[function(S,D,x){"use strict";function T(t){return t&&t.__esModule?t:{default:t}}function w(t){return t&&typeof t.next=="function"&&typeof t.throw=="function"}function f(t){if(!t)return!1;var n=t.constructor;return!!n&&(n.name==="GeneratorFunction"||n.displayName==="GeneratorFunction"||w(n.prototype)||w(t.prototype))}function p(t,n){var c=new t(n),m=(0,s.default)(c),v=(0,s.default)((0,i.default)(c));m.concat(v).forEach(function(b){f(c[b])?this[b]=h.wrap(c[b]).bind(c):this[b]=c[b]},this)}function u(t){if(!(this instanceof u))return new u(t);p.call(this,r,t)}var o=S("babel-runtime/core-js/object/get-prototype-of"),i=T(o),l=S("babel-runtime/core-js/object/keys"),s=T(l),h=S("co"),r=S("./client");D.exports=u,u.STS=function t(n){if(!(this instanceof t))return new t(n);p.call(this,r.STS,n)}},{"./client":2,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/core-js/object/keys":23,co:41}],7:[function(S,D,x){(function(T){"use strict";function w(i){return i&&i.__esModule?i:{default:i}}var f=S("babel-runtime/core-js/object/keys"),p=w(f),u=S("babel-runtime/core-js/json/stringify"),o=w(u);x.encodeCallback=function(i,l){if(i.headers=i.headers||{},!Object.prototype.hasOwnProperty.call(i.headers,"x-oss-callback")&&l.callback){var s={callbackUrl:encodeURI(l.callback.url),callbackBody:l.callback.body};l.callback.host&&(s.callbackHost=l.callback.host),l.callback.contentType&&(s.callbackBodyType=l.callback.contentType);var h=new T((0,o.default)(s)).toString("base64");if(i.headers["x-oss-callback"]=h,l.callback.customValue){var r={};(0,p.default)(l.callback.customValue).forEach(function(t){r["x:"+t]=l.callback.customValue[t]}),i.headers["x-oss-callback-var"]=new T((0,o.default)(r)).toString("base64")}}}}).call(this,S("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38}],8:[function(S,D,x){"use strict";var T=S("babel-runtime/regenerator"),w=function(o){return o&&o.__esModule?o:{default:o}}(T),f=S("copy-to"),p=S("./callback"),u=x;u.listUploads=w.default.mark(function o(i,l){var s,h,r,t;return w.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=l||{},s={},f(l).to(s),s.subres="uploads",h=this._objectRequestParams("GET","",s),h.query=i,h.xmlResponse=!0,h.successStatuses=[200],n.next=10,this.request(h);case 10:return r=n.sent,t=r.data.Upload||[],Array.isArray(t)||(t=[t]),t=t.map(function(c){return{name:c.Key,uploadId:c.UploadId,initiated:c.Initiated}}),n.abrupt("return",{res:r.res,uploads:t,bucket:r.data.Bucket,nextKeyMarker:r.data.NextKeyMarker,nextUploadIdMarker:r.data.NextUploadIdMarker,isTruncated:r.data.IsTruncated==="true"});case 15:case"end":return n.stop()}},o,this)}),u.listParts=w.default.mark(function o(i,l,s,h){var r,t,n;return w.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return h=h||{},r={},f(h).to(r),r.subres={uploadId:l},t=this._objectRequestParams("GET",i,r),t.query=s,t.xmlResponse=!0,t.successStatuses=[200],c.next=10,this.request(t);case 10:return n=c.sent,c.abrupt("return",{res:n.res,uploadId:n.data.UploadId,bucket:n.data.Bucket,name:n.data.Key,partNumberMarker:n.data.PartNumberMarker,nextPartNumberMarker:n.data.NextPartNumberMarker,maxParts:n.data.MaxParts,isTruncated:n.data.IsTruncated,parts:n.data.Part||[]});case 12:case"end":return c.stop()}},o,this)}),u.abortMultipartUpload=w.default.mark(function o(i,l,s){var h,r,t;return w.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return this.cancel(),s=s||{},h={},f(s).to(h),h.subres={uploadId:l},r=this._objectRequestParams("DELETE",i,h),r.successStatuses=[204],n.next=9,this.request(r);case 9:return t=n.sent,n.abrupt("return",{res:t.res});case 11:case"end":return n.stop()}},o,this)}),u.initMultipartUpload=w.default.mark(function o(i,l){var s,h,r;return w.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return l=l||{},s={},f(l).to(s),s.headers=s.headers||{},this._convertMetaToHeaders(l.meta,s.headers),s.subres="uploads",h=this._objectRequestParams("POST",i,s),h.mime=l.mime,h.xmlResponse=!0,h.successStatuses=[200],t.next=12,this.request(h);case 12:return r=t.sent,t.abrupt("return",{res:r.res,bucket:r.data.Bucket,name:r.data.Key,uploadId:r.data.UploadId});case 14:case"end":return t.stop()}},o,this)}),u.uploadPart=w.default.mark(function o(i,l,s,h,r,t,n){var c;return w.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return c={stream:this._createStream(h,r,t),size:t-r},m.next=3,this._uploadPart(i,l,s,c,n);case 3:return m.abrupt("return",m.sent);case 4:case"end":return m.stop()}},o,this)}),u.completeMultipartUpload=w.default.mark(function o(i,l,s,h){var r,t,n,c,m,v,b,E;return w.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:for(r=s.concat().sort(function(y,C){return y.number-C.number}).filter(function(y,C,d){return!C||y.number!==d[C-1].number}),t=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<CompleteMultipartUpload>
|
|
|
`,n=0;n<r.length;n++)c=r[n],t+=`<Part>
|
|
|
`,t+="<PartNumber>"+c.number+`</PartNumber>
|
|
|
`,t+="<ETag>"+c.etag+`</ETag>
|
|
|
`,t+=`</Part>
|
|
|
`;return t+="</CompleteMultipartUpload>",h=h||{},m={},f(h).to(m),m.subres={uploadId:l},v=this._objectRequestParams("POST",i,m),p.encodeCallback(v,m),v.mime="xml",v.content=t,v.headers&&v.headers["x-oss-callback"]||(v.xmlResponse=!0),v.successStatuses=[200],g.next=16,this.request(v);case 16:return b=g.sent,E={res:b.res,bucket:v.bucket,name:i,etag:b.res.headers.etag},v.headers&&v.headers["x-oss-callback"]&&(E.data=JSON.parse(b.data.toString())),g.abrupt("return",E);case 20:case"end":return g.stop()}},o,this)}),u._uploadPart=w.default.mark(function o(i,l,s,h,r){var t,n,c;return w.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return r=r||{},t={},f(r).to(t),t.headers={"Content-Length":h.size},t.subres={partNumber:s,uploadId:l},n=this._objectRequestParams("PUT",i,t),n.mime=t.mime,n.stream=h.stream,n.successStatuses=[200],m.next=11,this.request(n);case 11:return c=m.sent,h.stream=null,n.stream=null,m.abrupt("return",{name:i,etag:c.res.headers.etag,res:c.res});case 15:case"end":return m.stop()}},o,this)})},{"./callback":7,"babel-runtime/regenerator":33,"copy-to":43}],9:[function(S,D,x){(function(T){"use strict";function w(s){return s&&s.__esModule?s:{default:s}}var f=S("babel-runtime/core-js/json/stringify"),p=w(f),u=S("babel-runtime/core-js/object/keys"),o=w(u),i=S("./../../shims/crypto/crypto.js"),l=S("is-type-of");x.buildCanonicalizedResource=function(s,h){var r=""+s,t="?";if(l.string(h)&&h.trim()!=="")r+=t+h;else if(l.array(h))h.sort(),r+=t+h.join("&");else if(h){var n=function(m,v){return m[0]>v[0]?1:m[0]<v[0]?-1:0},c=function(m){r+=t+m,h[m]&&(r+="="+h[m]),t="&"};(0,o.default)(h).sort(n).forEach(c)}return r},x.buildCanonicalString=function(s,h,r,t){r=r||{};var n=r.headers||{},c=[],m={},v=[s.toUpperCase(),n["Content-Md5"]||"",n["Content-Type"]||n["Content-Type".toLowerCase()],t||n["x-oss-date"]];return(0,o.default)(n).forEach(function(b){var E=b.toLowerCase();E.indexOf("x-oss-")===0&&(m[E]=String(n[b]).trim())}),(0,o.default)(m).sort().forEach(function(b){c.push(b+":"+m[b])}),v=v.concat(c),v.push(this.buildCanonicalizedResource(h,r.parameters)),v.join(`
|
|
|
`)},x.computeSignature=function(s,h){return i.createHmac("sha1",s).update(new T(h,"utf8")).digest("base64")},x.authorization=function(s,h,r){return"OSS "+s+":"+this.computeSignature(h,r)},x._signatureForURL=function(s,h,r,t){var n={},c={};if(h.process&&(c["x-oss-process"]=h.process),h.response&&(0,o.default)(h.response).forEach(function(E){var g="response-"+E.toLowerCase();c[g]=h.response[E]}),(0,o.default)(h).forEach(function(E){var g=E.toLowerCase(),y=h[E];g.indexOf("x-oss-")===0?n[g]=y:g.indexOf("content-md5")===0||g.indexOf("content-type")===0?n[E]=y:g!=="expires"&&g!=="response"&&g!=="process"&&g!=="method"&&(c[g]=y)}),Object.prototype.hasOwnProperty.call(h,"security-token")&&(c["security-token"]=h["security-token"]),Object.prototype.hasOwnProperty.call(h,"callback")){var m={callbackUrl:encodeURI(h.callback.url),callbackBody:h.callback.body};if(h.callback.host&&(m.callbackHost=h.callback.host),h.callback.contentType&&(m.callbackBodyType=h.callback.contentType),c.callback=new T((0,p.default)(m)).toString("base64"),h.callback.customValue){var v={};(0,o.default)(h.callback.customValue).forEach(function(E){v["x:"+E]=h.callback.customValue[E]}),c["callback-var"]=new T((0,p.default)(v)).toString("base64")}}var b=this.buildCanonicalString(h.method,r,{headers:n,parameters:c},t.toString());return{Signature:this.computeSignature(s,b),subResource:c}}}).call(this,S("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(S,D,x){"use strict";var T=S("babel-runtime/regenerator"),w=function(i){return i&&i.__esModule?i:{default:i}}(T),f=S("co"),p=S("co-priority-queue"),u=S("any-promise"),o=x;o._thunkPool=function(i,l){function s(c,m){++t===c.length&&m(n)}function h(c,m){function v(){var d;return w.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:d=void 0;case 1:if(r.isCancel()){_.next=9;break}return _.next=4,g.next();case 4:return d=_.sent,_.next=7,d();case 7:_.next=1;break;case 9:y+=1,y===c&&(g.fns=[],g.buffer=[],m(n));case 11:case"end":return _.stop()}},E,this)}function b(d){console.error(d.stack)}for(var E=w.default.mark(v),g=new p,y=0,C=0;C<c;C++)f(v).catch(b);return function(d,_){return function(O){g.push(w.default.mark(function A(){return w.default.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.prev=0,P.t0=O,P.next=4,d;case 4:P.t1=P.sent,(0,P.t0)(null,P.t1),P.next=11;break;case 8:P.prev=8,P.t2=P.catch(0),O(P.t2);case 11:case"end":return P.stop()}},A,this,[[0,8]])}),_)}}}var r=this,t=0,n=[];return new u(function(c){function m(y){return w.default.wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,E(i[y]);case 2:s(i,c);case 3:case"end":return C.stop()}},b,this)}function v(y){n.push(y),s(i,c)}for(var b=w.default.mark(m),E=new h(l,c),g=0;g<i.length;g++)f(m(g)).catch(v)})},o.cancel=function(){this.options.cancelFlag=!0},o.isCancel=function(){return this.options.cancelFlag},o.resetCancelFlag=function(){this.options.cancelFlag=!1}},{"any-promise":13,"babel-runtime/regenerator":33,co:41,"co-priority-queue":40}],11:[function(S,D,x){"use strict";x._isIP=function(T){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}$/,f=/^\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(T)||f.test(T)}},{}],12:[function(S,D,x){function T(){}D.exports=T,D.exports.HttpsAgent=T},{}],13:[function(S,D,x){D.exports=S("./register")().Promise},{"./register":15}],14:[function(S,D,x){"use strict";var T=null;D.exports=function(w,f){return function(p,u){p=p||null,u=u||{};var o=u.global!==!1;if(T===null&&o&&(T=w["@@any-promise/REGISTRATION"]||null),T!==null&&p!==null&&T.implementation!==p)throw new Error('any-promise already defined as "'+T.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return T===null&&(T=p!==null&&u.Promise!==void 0?{Promise:u.Promise,implementation:p}:f(p),o&&(w["@@any-promise/REGISTRATION"]=T)),T}}},{}],15:[function(S,D,x){"use strict";function T(){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"}}D.exports=S("./loader")(window,T)},{"./loader":14}],16:[function(S,D,x){D.exports={default:S("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":44}],17:[function(S,D,x){D.exports={default:S("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":45}],18:[function(S,D,x){D.exports={default:S("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":46}],19:[function(S,D,x){D.exports={default:S("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":47}],20:[function(S,D,x){D.exports={default:S("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":48}],21:[function(S,D,x){D.exports={default:S("core-js/library/fn/object/get-own-property-names"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-names":49}],22:[function(S,D,x){D.exports={default:S("core-js/library/fn/object/get-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/get-prototype-of":50}],23:[function(S,D,x){D.exports={default:S("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":51}],24:[function(S,D,x){D.exports={default:S("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":52}],25:[function(S,D,x){D.exports={default:S("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":53}],26:[function(S,D,x){D.exports={default:S("core-js/library/fn/string/from-code-point"),__esModule:!0}},{"core-js/library/fn/string/from-code-point":54}],27:[function(S,D,x){D.exports={default:S("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":56}],28:[function(S,D,x){D.exports={default:S("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":55}],29:[function(S,D,x){D.exports={default:S("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":57}],30:[function(S,D,x){"use strict";x.__esModule=!0,x.default=function(T,w){if(!(T instanceof w))throw new TypeError("Cannot call a class as a function")}},{}],31:[function(S,D,x){"use strict";x.__esModule=!0;var T=S("../core-js/object/define-property"),w=function(f){return f&&f.__esModule?f:{default:f}}(T);x.default=function(){function f(p,u){for(var o=0;o<u.length;o++){var i=u[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),(0,w.default)(p,i.key,i)}}return function(p,u,o){return u&&f(p.prototype,u),o&&f(p,o),p}}()},{"../core-js/object/define-property":20}],32:[function(S,D,x){"use strict";function T(i){return i&&i.__esModule?i:{default:i}}x.__esModule=!0;var w=S("../core-js/symbol/iterator"),f=T(w),p=S("../core-js/symbol"),u=T(p),o=typeof u.default=="function"&&typeof f.default=="symbol"?function(i){return typeof i}:function(i){return i&&typeof u.default=="function"&&i.constructor===u.default&&i!==u.default.prototype?"symbol":typeof i};x.default=typeof u.default=="function"&&o(f.default)==="symbol"?function(i){return i===void 0?"undefined":o(i)}:function(i){return i&&typeof u.default=="function"&&i.constructor===u.default&&i!==u.default.prototype?"symbol":i===void 0?"undefined":o(i)}},{"../core-js/symbol":27,"../core-js/symbol/iterator":29}],33:[function(S,D,x){D.exports=S("regenerator-runtime")},{"regenerator-runtime":191}],34:[function(S,D,x){"use strict";function T(c){var m=c.length;if(m%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=c.indexOf("=");return v===-1&&(v=m),[v,v===m?0:4-v%4]}function w(c){var m=T(c),v=m[0],b=m[1];return 3*(v+b)/4-b}function f(c,m,v){return 3*(m+v)/4-v}function p(c){for(var m,v=T(c),b=v[0],E=v[1],g=new h(f(c,b,E)),y=0,C=E>0?b-4:b,d=0;d<C;d+=4)m=s[c.charCodeAt(d)]<<18|s[c.charCodeAt(d+1)]<<12|s[c.charCodeAt(d+2)]<<6|s[c.charCodeAt(d+3)],g[y++]=m>>16&255,g[y++]=m>>8&255,g[y++]=255&m;return E===2&&(m=s[c.charCodeAt(d)]<<2|s[c.charCodeAt(d+1)]>>4,g[y++]=255&m),E===1&&(m=s[c.charCodeAt(d)]<<10|s[c.charCodeAt(d+1)]<<4|s[c.charCodeAt(d+2)]>>2,g[y++]=m>>8&255,g[y++]=255&m),g}function u(c){return l[c>>18&63]+l[c>>12&63]+l[c>>6&63]+l[63&c]}function o(c,m,v){for(var b,E=[],g=m;g<v;g+=3)b=(c[g]<<16&16711680)+(c[g+1]<<8&65280)+(255&c[g+2]),E.push(u(b));return E.join("")}function i(c){for(var m,v=c.length,b=v%3,E=[],g=0,y=v-b;g<y;g+=16383)E.push(o(c,g,g+16383>y?y:g+16383));return b===1?(m=c[v-1],E.push(l[m>>2]+l[m<<4&63]+"==")):b===2&&(m=(c[v-2]<<8)+c[v-1],E.push(l[m>>10]+l[m>>4&63]+l[m<<2&63]+"=")),E.join("")}x.byteLength=w,x.toByteArray=p,x.fromByteArray=i;for(var l=[],s=[],h=typeof Uint8Array!="undefined"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=r.length;t<n;++t)l[t]=r[t],s[r.charCodeAt(t)]=t;s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},{}],35:[function(S,D,x){!function(T,w,f){D!==void 0&&D.exports?D.exports=f():typeof j=="function"&&j.amd?j("bowser",f):T.bowser=f()}(this,0,function(){function T(s){function h(re){var $=s.match(re);return $&&$.length>1&&$[1]||""}function r(re){var $=s.match(re);return $&&$.length>1&&$[2]||""}var t,n=h(/(ipod|iphone|ipad)/i).toLowerCase(),c=/like android/i.test(s),m=!c&&/android/i.test(s),v=/nexus\s*[0-6]\s*/i.test(s),b=!v&&/nexus\s*[0-9]+/i.test(s),E=/CrOS/.test(s),g=/silk/i.test(s),y=/sailfish/i.test(s),C=/tizen/i.test(s),d=/(web|hpw)os/i.test(s),_=/windows phone/i.test(s),O=(/SamsungBrowser/i.test(s),!_&&/windows/i.test(s)),A=!n&&!g&&/macintosh/i.test(s),P=!m&&!y&&!C&&!d&&/linux/i.test(s),I=r(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),W=h(/version\/(\d+(\.\d+)?)/i),K=/tablet/i.test(s)&&!/tablet pc/i.test(s),te=!K&&/[^-]mobi/i.test(s),H=/xbox/i.test(s);/opera/i.test(s)?t={name:"Opera",opera:i,version:W||h(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(s)?t={name:"Opera",opera:i,version:h(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||W}:/SamsungBrowser/i.test(s)?t={name:"Samsung Internet for Android",samsungBrowser:i,version:W||h(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(s)?t={name:"Opera Coast",coast:i,version:W||h(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(s)?t={name:"Yandex Browser",yandexbrowser:i,version:W||h(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(s)?t={name:"UC Browser",ucbrowser:i,version:h(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(s)?t={name:"Maxthon",maxthon:i,version:h(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(s)?t={name:"Epiphany",epiphany:i,version:h(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(s)?t={name:"Puffin",puffin:i,version:h(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(s)?t={name:"Sleipnir",sleipnir:i,version:h(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(s)?t={name:"K-Meleon",kMeleon:i,version:h(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:_?(t={name:"Windows Phone",osname:"Windows Phone",windowsphone:i},I?(t.msedge=i,t.version=I):(t.msie=i,t.version=h(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(s)?t={name:"Internet Explorer",msie:i,version:h(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:E?t={name:"Chrome",osname:"Chrome OS",chromeos:i,chromeBook:i,chrome:i,version:h(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(s)?t={name:"Microsoft Edge",msedge:i,version:I}:/vivaldi/i.test(s)?t={name:"Vivaldi",vivaldi:i,version:h(/vivaldi\/(\d+(\.\d+)?)/i)||W}:y?t={name:"Sailfish",osname:"Sailfish OS",sailfish:i,version:h(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(s)?t={name:"SeaMonkey",seamonkey:i,version:h(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(s)?(t={name:"Firefox",firefox:i,version:h(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(s)&&(t.firefoxos=i,t.osname="Firefox OS")):g?t={name:"Amazon Silk",silk:i,version:h(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(s)?t={name:"PhantomJS",phantom:i,version:h(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(s)?t={name:"SlimerJS",slimer:i,version:h(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(s)||/rim\stablet/i.test(s)?t={name:"BlackBerry",osname:"BlackBerry OS",blackberry:i,version:W||h(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:d?(t={name:"WebOS",osname:"WebOS",webos:i,version:W||h(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(s)&&(t.touchpad=i)):/bada/i.test(s)?t={name:"Bada",osname:"Bada",bada:i,version:h(/dolfin\/(\d+(\.\d+)?)/i)}:C?t={name:"Tizen",osname:"Tizen",tizen:i,version:h(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||W}:/qupzilla/i.test(s)?t={name:"QupZilla",qupzilla:i,version:h(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||W}:/chromium/i.test(s)?t={name:"Chromium",chromium:i,version:h(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||W}:/chrome|crios|crmo/i.test(s)?t={name:"Chrome",chrome:i,version:h(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:m?t={name:"Android",version:W}:/safari|applewebkit/i.test(s)?(t={name:"Safari",safari:i},W&&(t.version=W)):n?(t={name:n=="iphone"?"iPhone":n=="ipad"?"iPad":"iPod"},W&&(t.version=W)):t=/googlebot/i.test(s)?{name:"Googlebot",googlebot:i,version:h(/googlebot\/(\d+(\.\d+))/i)||W}:{name:h(/^(.*)\/(.*) /),version:r(/^(.*)\/(.*) /)},!t.msedge&&/(apple)?webkit/i.test(s)?(/(apple)?webkit\/537\.36/i.test(s)?(t.name=t.name||"Blink",t.blink=i):(t.name=t.name||"Webkit",t.webkit=i),!t.version&&W&&(t.version=W)):!t.opera&&/gecko\//i.test(s)&&(t.name=t.name||"Gecko",t.gecko=i,t.version=t.version||h(/gecko\/(\d+(\.\d+)?)/i)),t.windowsphone||!m&&!t.silk?!t.windowsphone&&n?(t[n]=i,t.ios=i,t.osname="iOS"):A?(t.mac=i,t.osname="macOS"):H?(t.xbox=i,t.osname="Xbox"):O?(t.windows=i,t.osname="Windows"):P&&(t.linux=i,t.osname="Linux"):(t.android=i,t.osname="Android");var G="";t.windows?G=function(re){switch(re){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}}(h(/Windows ((NT|XP)( \d\d?.\d)?)/i)):t.windowsphone?G=h(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):t.mac?(G=h(/Mac OS X (\d+([_\.\s]\d+)*)/i),G=G.replace(/[_\s]/g,".")):n?(G=h(/os (\d+([_\s]\d+)*) like mac os x/i),G=G.replace(/[_\s]/g,".")):m?G=h(/android[ \/-](\d+(\.\d+)*)/i):t.webos?G=h(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):t.blackberry?G=h(/rim\stablet\sos\s(\d+(\.\d+)*)/i):t.bada?G=h(/bada\/(\d+(\.\d+)*)/i):t.tizen&&(G=h(/tizen[\/\s](\d+(\.\d+)*)/i)),G&&(t.osversion=G);var V=!t.windows&&G.split(".")[0];return K||b||n=="ipad"||m&&(V==3||V>=4&&!te)||t.silk?t.tablet=i:(te||n=="iphone"||n=="ipod"||m||v||t.blackberry||t.webos||t.bada)&&(t.mobile=i),t.msedge||t.msie&&t.version>=10||t.yandexbrowser&&t.version>=15||t.vivaldi&&t.version>=1||t.chrome&&t.version>=20||t.samsungBrowser&&t.version>=4||t.firefox&&t.version>=20||t.safari&&t.version>=6||t.opera&&t.version>=10||t.ios&&t.osversion&&t.osversion.split(".")[0]>=6||t.blackberry&&t.version>=10.1||t.chromium&&t.version>=20?t.a=i:t.msie&&t.version<10||t.chrome&&t.version<20||t.firefox&&t.version<20||t.safari&&t.version<6||t.opera&&t.version<10||t.ios&&t.osversion&&t.osversion.split(".")[0]<6||t.chromium&&t.version<20?t.c=i:t.x=i,t}function w(s){return s.split(".").length}function f(s,h){var r,t=[];if(Array.prototype.map)return Array.prototype.map.call(s,h);for(r=0;r<s.length;r++)t.push(h(s[r]));return t}function p(s){for(var h=Math.max(w(s[0]),w(s[1])),r=f(s,function(t){var n=h-w(t);return t+=new Array(n+1).join(".0"),f(t.split("."),function(c){return new Array(20-c.length).join("0")+c}).reverse()});--h>=0;){if(r[0][h]>r[1][h])return 1;if(r[0][h]!==r[1][h])return-1;if(h===0)return 0}}function u(s,h,r){var t=l;typeof h=="string"&&(r=h,h=void 0),h===void 0&&(h=!1),r&&(t=T(r));var n=""+t.version;for(var c in s)if(s.hasOwnProperty(c)&&t[c]){if(typeof s[c]!="string")throw new Error("Browser version in the minVersion map should be a string: "+c+": "+String(s));return p([n,s[c]])<0}return h}function o(s,h,r){return!u(s,h,r)}var i=!0,l=T(typeof navigator!="undefined"&&navigator.userAgent||"");return l.test=function(s){for(var h=0;h<s.length;++h){var r=s[h];if(typeof r=="string"&&r in l)return!0}return!1},l.isUnsupportedBrowser=u,l.compareVersions=p,l.check=o,l._detect=T,l.detect=T,l})},{}],36:[function(S,D,x){},{}],37:[function(S,D,x){function T(l){if(l&&!o(l))throw new Error("Unknown encoding: "+l)}function w(l){return l.toString(this.encoding)}function f(l){this.charReceived=l.length%2,this.charLength=this.charReceived?2:0}function p(l){this.charReceived=l.length%3,this.charLength=this.charReceived?3:0}var u=S("buffer").Buffer,o=u.isEncoding||function(l){switch(l&&l.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}},i=x.StringDecoder=function(l){switch(this.encoding=(l||"utf8").toLowerCase().replace(/[-_]/,""),T(l),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=p;break;default:return void(this.write=w)}this.charBuffer=new u(6),this.charReceived=0,this.charLength=0};i.prototype.write=function(l){for(var s="";this.charLength;){var h=l.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:l.length;if(l.copy(this.charBuffer,this.charReceived,0,h),this.charReceived+=h,this.charReceived<this.charLength)return"";l=l.slice(h,l.length),s=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var t=s.charCodeAt(s.length-1);if(!(t>=55296&&t<=56319)){if(this.charReceived=this.charLength=0,l.length===0)return s;break}this.charLength+=this.surrogateSize,s=""}this.detectIncompleteChar(l);var r=l.length;this.charLength&&(l.copy(this.charBuffer,0,l.length-this.charReceived,r),r-=this.charReceived),s+=l.toString(this.encoding,0,r);var r=s.length-1,t=s.charCodeAt(r);if(t>=55296&&t<=56319){var n=this.surrogateSize;return this.charLength+=n,this.charReceived+=n,this.charBuffer.copy(this.charBuffer,n,0,n),l.copy(this.charBuffer,0,0,n),s.substring(0,r)}return s},i.prototype.detectIncompleteChar=function(l){for(var s=l.length>=3?3:l.length;s>0;s--){var h=l[l.length-s];if(s==1&&h>>5==6){this.charLength=2;break}if(s<=2&&h>>4==14){this.charLength=3;break}if(s<=3&&h>>3==30){this.charLength=4;break}}this.charReceived=s},i.prototype.end=function(l){var s="";if(l&&l.length&&(s=this.write(l)),this.charReceived){var h=this.charReceived,r=this.charBuffer,t=this.encoding;s+=r.slice(0,h).toString(t)}return s}},{buffer:38}],38:[function(S,D,x){(function(T){"use strict";function w(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(k,U){if(w()<U)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(k=new Uint8Array(U),k.__proto__=p.prototype):(k===null&&(k=new p(U)),k.length=U),k}function p(k,U,q){if(!(p.TYPED_ARRAY_SUPPORT||this instanceof p))return new p(k,U,q);if(typeof k=="number"){if(typeof U=="string")throw new Error("If encoding is specified then the first argument must be a string");return l(this,k)}return u(this,k,U,q)}function u(k,U,q,Y){if(typeof U=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&U instanceof ArrayBuffer?r(k,U,q,Y):typeof U=="string"?s(k,U,q):t(k,U)}function o(k){if(typeof k!="number")throw new TypeError('"size" argument must be a number');if(k<0)throw new RangeError('"size" argument must not be negative')}function i(k,U,q,Y){return o(U),U<=0?f(k,U):q!==void 0?typeof Y=="string"?f(k,U).fill(q,Y):f(k,U).fill(q):f(k,U)}function l(k,U){if(o(U),k=f(k,U<0?0:0|n(U)),!p.TYPED_ARRAY_SUPPORT)for(var q=0;q<U;++q)k[q]=0;return k}function s(k,U,q){if(typeof q=="string"&&q!==""||(q="utf8"),!p.isEncoding(q))throw new TypeError('"encoding" must be a valid string encoding');var Y=0|m(U,q);k=f(k,Y);var J=k.write(U,q);return J!==Y&&(k=k.slice(0,J)),k}function h(k,U){var q=U.length<0?0:0|n(U.length);k=f(k,q);for(var Y=0;Y<q;Y+=1)k[Y]=255&U[Y];return k}function r(k,U,q,Y){if(U.byteLength,q<0||U.byteLength<q)throw new RangeError("'offset' is out of bounds");if(U.byteLength<q+(Y||0))throw new RangeError("'length' is out of bounds");return U=q===void 0&&Y===void 0?new Uint8Array(U):Y===void 0?new Uint8Array(U,q):new Uint8Array(U,q,Y),p.TYPED_ARRAY_SUPPORT?(k=U,k.__proto__=p.prototype):k=h(k,U),k}function t(k,U){if(p.isBuffer(U)){var q=0|n(U.length);return k=f(k,q),k.length===0||U.copy(k,0,0,q),k}if(U){if(typeof ArrayBuffer!="undefined"&&U.buffer instanceof ArrayBuffer||"length"in U)return typeof U.length!="number"||de(U.length)?f(k,0):h(k,U);if(U.type==="Buffer"&&Ie(U.data))return h(k,U.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function n(k){if(k>=w())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w().toString(16)+" bytes");return 0|k}function c(k){return+k!=k&&(k=0),p.alloc(+k)}function m(k,U){if(p.isBuffer(k))return k.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(k)||k instanceof ArrayBuffer))return k.byteLength;typeof k!="string"&&(k=""+k);var q=k.length;if(q===0)return 0;for(var Y=!1;;)switch(U){case"ascii":case"latin1":case"binary":return q;case"utf8":case"utf-8":case void 0:return xe(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*q;case"hex":return q>>>1;case"base64":return We(k).length;default:if(Y)return xe(k).length;U=(""+U).toLowerCase(),Y=!0}}function v(k,U,q){var Y=!1;if((U===void 0||U<0)&&(U=0),U>this.length)return"";if((q===void 0||q>this.length)&&(q=this.length),q<=0)return"";if(q>>>=0,U>>>=0,q<=U)return"";for(k||(k="utf8");;)switch(k){case"hex":return H(this,U,q);case"utf8":case"utf-8":return I(this,U,q);case"ascii":return K(this,U,q);case"latin1":case"binary":return te(this,U,q);case"base64":return P(this,U,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,U,q);default:if(Y)throw new TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),Y=!0}}function b(k,U,q){var Y=k[U];k[U]=k[q],k[q]=Y}function E(k,U,q,Y,J){if(k.length===0)return-1;if(typeof q=="string"?(Y=q,q=0):q>2147483647?q=2147483647:q<-2147483648&&(q=-2147483648),q=+q,isNaN(q)&&(q=J?0:k.length-1),q<0&&(q=k.length+q),q>=k.length){if(J)return-1;q=k.length-1}else if(q<0){if(!J)return-1;q=0}if(typeof U=="string"&&(U=p.from(U,Y)),p.isBuffer(U))return U.length===0?-1:g(k,U,q,Y,J);if(typeof U=="number")return U&=255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?J?Uint8Array.prototype.indexOf.call(k,U,q):Uint8Array.prototype.lastIndexOf.call(k,U,q):g(k,[U],q,Y,J);throw new TypeError("val must be string, number or Buffer")}function g(k,U,q,Y,J){function be(Xe,Ke){return ke===1?Xe[Ke]:Xe.readUInt16BE(Ke*ke)}var ke=1,ct=k.length,He=U.length;if(Y!==void 0&&((Y=String(Y).toLowerCase())==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(k.length<2||U.length<2)return-1;ke=2,ct/=2,He/=2,q/=2}var Be;if(J){var Ze=-1;for(Be=q;Be<ct;Be++)if(be(k,Be)===be(U,Ze===-1?0:Be-Ze)){if(Ze===-1&&(Ze=Be),Be-Ze+1===He)return Ze*ke}else Ze!==-1&&(Be-=Be-Ze),Ze=-1}else for(q+He>ct&&(q=ct-He),Be=q;Be>=0;Be--){for(var ht=!0,Qe=0;Qe<He;Qe++)if(be(k,Be+Qe)!==be(U,Qe)){ht=!1;break}if(ht)return Be}return-1}function y(k,U,q,Y){q=Number(q)||0;var J=k.length-q;Y?(Y=Number(Y))>J&&(Y=J):Y=J;var be=U.length;if(be%2!=0)throw new TypeError("Invalid hex string");Y>be/2&&(Y=be/2);for(var ke=0;ke<Y;++ke){var ct=parseInt(U.substr(2*ke,2),16);if(isNaN(ct))return ke;k[q+ke]=ct}return ke}function C(k,U,q,Y){return ze(xe(U,k.length-q),k,q,Y)}function d(k,U,q,Y){return ze(Ge(U),k,q,Y)}function _(k,U,q,Y){return d(k,U,q,Y)}function O(k,U,q,Y){return ze(We(U),k,q,Y)}function A(k,U,q,Y){return ze(je(U,k.length-q),k,q,Y)}function P(k,U,q){return U===0&&q===k.length?le.fromByteArray(k):le.fromByteArray(k.slice(U,q))}function I(k,U,q){q=Math.min(k.length,q);for(var Y=[],J=U;J<q;){var be=k[J],ke=null,ct=be>239?4:be>223?3:be>191?2:1;if(J+ct<=q){var He,Be,Ze,ht;switch(ct){case 1:be<128&&(ke=be);break;case 2:He=k[J+1],(192&He)==128&&(ht=(31&be)<<6|63&He)>127&&(ke=ht);break;case 3:He=k[J+1],Be=k[J+2],(192&He)==128&&(192&Be)==128&&(ht=(15&be)<<12|(63&He)<<6|63&Be)>2047&&(ht<55296||ht>57343)&&(ke=ht);break;case 4:He=k[J+1],Be=k[J+2],Ze=k[J+3],(192&He)==128&&(192&Be)==128&&(192&Ze)==128&&(ht=(15&be)<<18|(63&He)<<12|(63&Be)<<6|63&Ze)>65535&&ht<1114112&&(ke=ht)}}ke===null?(ke=65533,ct=1):ke>65535&&(ke-=65536,Y.push(ke>>>10&1023|55296),ke=56320|1023&ke),Y.push(ke),J+=ct}return W(Y)}function W(k){var U=k.length;if(U<=qe)return String.fromCharCode.apply(String,k);for(var q="",Y=0;Y<U;)q+=String.fromCharCode.apply(String,k.slice(Y,Y+=qe));return q}function K(k,U,q){var Y="";q=Math.min(k.length,q);for(var J=U;J<q;++J)Y+=String.fromCharCode(127&k[J]);return Y}function te(k,U,q){var Y="";q=Math.min(k.length,q);for(var J=U;J<q;++J)Y+=String.fromCharCode(k[J]);return Y}function H(k,U,q){var Y=k.length;(!U||U<0)&&(U=0),(!q||q<0||q>Y)&&(q=Y);for(var J="",be=U;be<q;++be)J+=Ee(k[be]);return J}function G(k,U,q){for(var Y=k.slice(U,q),J="",be=0;be<Y.length;be+=2)J+=String.fromCharCode(Y[be]+256*Y[be+1]);return J}function V(k,U,q){if(k%1!=0||k<0)throw new RangeError("offset is not uint");if(k+U>q)throw new RangeError("Trying to access beyond buffer length")}function re(k,U,q,Y,J,be){if(!p.isBuffer(k))throw new TypeError('"buffer" argument must be a Buffer instance');if(U>J||U<be)throw new RangeError('"value" argument is out of bounds');if(q+Y>k.length)throw new RangeError("Index out of range")}function $(k,U,q,Y){U<0&&(U=65535+U+1);for(var J=0,be=Math.min(k.length-q,2);J<be;++J)k[q+J]=(U&255<<8*(Y?J:1-J))>>>8*(Y?J:1-J)}function ne(k,U,q,Y){U<0&&(U=4294967295+U+1);for(var J=0,be=Math.min(k.length-q,4);J<be;++J)k[q+J]=U>>>8*(Y?J:3-J)&255}function he(k,U,q,Y,J,be){if(q+Y>k.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("Index out of range")}function pe(k,U,q,Y,J){return J||he(k,U,q,4,34028234663852886e22,-34028234663852886e22),Oe.write(k,U,q,Y,23,4),q+4}function Te(k,U,q,Y,J){return J||he(k,U,q,8,17976931348623157e292,-17976931348623157e292),Oe.write(k,U,q,Y,52,8),q+8}function we(k){if(k=Me(k).replace(ee,""),k.length<2)return"";for(;k.length%4!=0;)k+="=";return k}function Me(k){return k.trim?k.trim():k.replace(/^\s+|\s+$/g,"")}function Ee(k){return k<16?"0"+k.toString(16):k.toString(16)}function xe(k,U){U=U||1/0;for(var q,Y=k.length,J=null,be=[],ke=0;ke<Y;++ke){if((q=k.charCodeAt(ke))>55295&&q<57344){if(!J){if(q>56319){(U-=3)>-1&&be.push(239,191,189);continue}if(ke+1===Y){(U-=3)>-1&&be.push(239,191,189);continue}J=q;continue}if(q<56320){(U-=3)>-1&&be.push(239,191,189),J=q;continue}q=65536+(J-55296<<10|q-56320)}else J&&(U-=3)>-1&&be.push(239,191,189);if(J=null,q<128){if((U-=1)<0)break;be.push(q)}else if(q<2048){if((U-=2)<0)break;be.push(q>>6|192,63&q|128)}else if(q<65536){if((U-=3)<0)break;be.push(q>>12|224,q>>6&63|128,63&q|128)}else{if(!(q<1114112))throw new Error("Invalid code point");if((U-=4)<0)break;be.push(q>>18|240,q>>12&63|128,q>>6&63|128,63&q|128)}}return be}function Ge(k){for(var U=[],q=0;q<k.length;++q)U.push(255&k.charCodeAt(q));return U}function je(k,U){for(var q,Y,J,be=[],ke=0;ke<k.length&&!((U-=2)<0);++ke)q=k.charCodeAt(ke),Y=q>>8,J=q%256,be.push(J),be.push(Y);return be}function We(k){return le.toByteArray(we(k))}function ze(k,U,q,Y){for(var J=0;J<Y&&!(J+q>=U.length||J>=k.length);++J)U[J+q]=k[J];return J}function de(k){return k!==k}var le=S("base64-js"),Oe=S("ieee754"),Ie=S("isarray");x.Buffer=p,x.SlowBuffer=c,x.INSPECT_MAX_BYTES=50,p.TYPED_ARRAY_SUPPORT=T.TYPED_ARRAY_SUPPORT!==void 0?T.TYPED_ARRAY_SUPPORT:function(){try{var k=new Uint8Array(1);return k.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},k.foo()===42&&typeof k.subarray=="function"&&k.subarray(1,1).byteLength===0}catch(U){return!1}}(),x.kMaxLength=w(),p.poolSize=8192,p._augment=function(k){return k.__proto__=p.prototype,k},p.from=function(k,U,q){return u(null,k,U,q)},p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&p[Symbol.species]===p&&Object.defineProperty(p,Symbol.species,{value:null,configurable:!0})),p.alloc=function(k,U,q){return i(null,k,U,q)},p.allocUnsafe=function(k){return l(null,k)},p.allocUnsafeSlow=function(k){return l(null,k)},p.isBuffer=function(k){return!(k==null||!k._isBuffer)},p.compare=function(k,U){if(!p.isBuffer(k)||!p.isBuffer(U))throw new TypeError("Arguments must be Buffers");if(k===U)return 0;for(var q=k.length,Y=U.length,J=0,be=Math.min(q,Y);J<be;++J)if(k[J]!==U[J]){q=k[J],Y=U[J];break}return q<Y?-1:Y<q?1:0},p.isEncoding=function(k){switch(String(k).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}},p.concat=function(k,U){if(!Ie(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return p.alloc(0);var q;if(U===void 0)for(U=0,q=0;q<k.length;++q)U+=k[q].length;var Y=p.allocUnsafe(U),J=0;for(q=0;q<k.length;++q){var be=k[q];if(!p.isBuffer(be))throw new TypeError('"list" argument must be an Array of Buffers');be.copy(Y,J),J+=be.length}return Y},p.byteLength=m,p.prototype._isBuffer=!0,p.prototype.swap16=function(){var k=this.length;if(k%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var U=0;U<k;U+=2)b(this,U,U+1);return this},p.prototype.swap32=function(){var k=this.length;if(k%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var U=0;U<k;U+=4)b(this,U,U+3),b(this,U+1,U+2);return this},p.prototype.swap64=function(){var k=this.length;if(k%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var U=0;U<k;U+=8)b(this,U,U+7),b(this,U+1,U+6),b(this,U+2,U+5),b(this,U+3,U+4);return this},p.prototype.toString=function(){var k=0|this.length;return k===0?"":arguments.length===0?I(this,0,k):v.apply(this,arguments)},p.prototype.equals=function(k){if(!p.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k||p.compare(this,k)===0},p.prototype.inspect=function(){var k="",U=x.INSPECT_MAX_BYTES;return this.length>0&&(k=this.toString("hex",0,U).match(/.{2}/g).join(" "),this.length>U&&(k+=" ... ")),"<Buffer "+k+">"},p.prototype.compare=function(k,U,q,Y,J){if(!p.isBuffer(k))throw new TypeError("Argument must be a Buffer");if(U===void 0&&(U=0),q===void 0&&(q=k?k.length:0),Y===void 0&&(Y=0),J===void 0&&(J=this.length),U<0||q>k.length||Y<0||J>this.length)throw new RangeError("out of range index");if(Y>=J&&U>=q)return 0;if(Y>=J)return-1;if(U>=q)return 1;if(U>>>=0,q>>>=0,Y>>>=0,J>>>=0,this===k)return 0;for(var be=J-Y,ke=q-U,ct=Math.min(be,ke),He=this.slice(Y,J),Be=k.slice(U,q),Ze=0;Ze<ct;++Ze)if(He[Ze]!==Be[Ze]){be=He[Ze],ke=Be[Ze];break}return be<ke?-1:ke<be?1:0},p.prototype.includes=function(k,U,q){return this.indexOf(k,U,q)!==-1},p.prototype.indexOf=function(k,U,q){return E(this,k,U,q,!0)},p.prototype.lastIndexOf=function(k,U,q){return E(this,k,U,q,!1)},p.prototype.write=function(k,U,q,Y){if(U===void 0)Y="utf8",q=this.length,U=0;else if(q===void 0&&typeof U=="string")Y=U,q=this.length,U=0;else{if(!isFinite(U))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");U|=0,isFinite(q)?(q|=0,Y===void 0&&(Y="utf8")):(Y=q,q=void 0)}var J=this.length-U;if((q===void 0||q>J)&&(q=J),k.length>0&&(q<0||U<0)||U>this.length)throw new RangeError("Attempt to write outside buffer bounds");Y||(Y="utf8");for(var be=!1;;)switch(Y){case"hex":return y(this,k,U,q);case"utf8":case"utf-8":return C(this,k,U,q);case"ascii":return d(this,k,U,q);case"latin1":case"binary":return _(this,k,U,q);case"base64":return O(this,k,U,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,k,U,q);default:if(be)throw new TypeError("Unknown encoding: "+Y);Y=(""+Y).toLowerCase(),be=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var qe=4096;p.prototype.slice=function(k,U){var q=this.length;k=~~k,U=U===void 0?q:~~U,k<0?(k+=q)<0&&(k=0):k>q&&(k=q),U<0?(U+=q)<0&&(U=0):U>q&&(U=q),U<k&&(U=k);var Y;if(p.TYPED_ARRAY_SUPPORT)Y=this.subarray(k,U),Y.__proto__=p.prototype;else{var J=U-k;Y=new p(J,void 0);for(var be=0;be<J;++be)Y[be]=this[be+k]}return Y},p.prototype.readUIntLE=function(k,U,q){k|=0,U|=0,q||V(k,U,this.length);for(var Y=this[k],J=1,be=0;++be<U&&(J*=256);)Y+=this[k+be]*J;return Y},p.prototype.readUIntBE=function(k,U,q){k|=0,U|=0,q||V(k,U,this.length);for(var Y=this[k+--U],J=1;U>0&&(J*=256);)Y+=this[k+--U]*J;return Y},p.prototype.readUInt8=function(k,U){return U||V(k,1,this.length),this[k]},p.prototype.readUInt16LE=function(k,U){return U||V(k,2,this.length),this[k]|this[k+1]<<8},p.prototype.readUInt16BE=function(k,U){return U||V(k,2,this.length),this[k]<<8|this[k+1]},p.prototype.readUInt32LE=function(k,U){return U||V(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+16777216*this[k+3]},p.prototype.readUInt32BE=function(k,U){return U||V(k,4,this.length),16777216*this[k]+(this[k+1]<<16|this[k+2]<<8|this[k+3])},p.prototype.readIntLE=function(k,U,q){k|=0,U|=0,q||V(k,U,this.length);for(var Y=this[k],J=1,be=0;++be<U&&(J*=256);)Y+=this[k+be]*J;return J*=128,Y>=J&&(Y-=Math.pow(2,8*U)),Y},p.prototype.readIntBE=function(k,U,q){k|=0,U|=0,q||V(k,U,this.length);for(var Y=U,J=1,be=this[k+--Y];Y>0&&(J*=256);)be+=this[k+--Y]*J;return J*=128,be>=J&&(be-=Math.pow(2,8*U)),be},p.prototype.readInt8=function(k,U){return U||V(k,1,this.length),128&this[k]?-1*(255-this[k]+1):this[k]},p.prototype.readInt16LE=function(k,U){U||V(k,2,this.length);var q=this[k]|this[k+1]<<8;return 32768&q?4294901760|q:q},p.prototype.readInt16BE=function(k,U){U||V(k,2,this.length);var q=this[k+1]|this[k]<<8;return 32768&q?4294901760|q:q},p.prototype.readInt32LE=function(k,U){return U||V(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},p.prototype.readInt32BE=function(k,U){return U||V(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},p.prototype.readFloatLE=function(k,U){return U||V(k,4,this.length),Oe.read(this,k,!0,23,4)},p.prototype.readFloatBE=function(k,U){return U||V(k,4,this.length),Oe.read(this,k,!1,23,4)},p.prototype.readDoubleLE=function(k,U){return U||V(k,8,this.length),Oe.read(this,k,!0,52,8)},p.prototype.readDoubleBE=function(k,U){return U||V(k,8,this.length),Oe.read(this,k,!1,52,8)},p.prototype.writeUIntLE=function(k,U,q,Y){(k=+k,U|=0,q|=0,!Y)&&re(this,k,U,q,Math.pow(2,8*q)-1,0);var J=1,be=0;for(this[U]=255&k;++be<q&&(J*=256);)this[U+be]=k/J&255;return U+q},p.prototype.writeUIntBE=function(k,U,q,Y){(k=+k,U|=0,q|=0,!Y)&&re(this,k,U,q,Math.pow(2,8*q)-1,0);var J=q-1,be=1;for(this[U+J]=255&k;--J>=0&&(be*=256);)this[U+J]=k/be&255;return U+q},p.prototype.writeUInt8=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,1,255,0),p.TYPED_ARRAY_SUPPORT||(k=Math.floor(k)),this[U]=255&k,U+1},p.prototype.writeUInt16LE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[U]=255&k,this[U+1]=k>>>8):$(this,k,U,!0),U+2},p.prototype.writeUInt16BE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[U]=k>>>8,this[U+1]=255&k):$(this,k,U,!1),U+2},p.prototype.writeUInt32LE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[U+3]=k>>>24,this[U+2]=k>>>16,this[U+1]=k>>>8,this[U]=255&k):ne(this,k,U,!0),U+4},p.prototype.writeUInt32BE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[U]=k>>>24,this[U+1]=k>>>16,this[U+2]=k>>>8,this[U+3]=255&k):ne(this,k,U,!1),U+4},p.prototype.writeIntLE=function(k,U,q,Y){if(k=+k,U|=0,!Y){var J=Math.pow(2,8*q-1);re(this,k,U,q,J-1,-J)}var be=0,ke=1,ct=0;for(this[U]=255&k;++be<q&&(ke*=256);)k<0&&ct===0&&this[U+be-1]!==0&&(ct=1),this[U+be]=(k/ke>>0)-ct&255;return U+q},p.prototype.writeIntBE=function(k,U,q,Y){if(k=+k,U|=0,!Y){var J=Math.pow(2,8*q-1);re(this,k,U,q,J-1,-J)}var be=q-1,ke=1,ct=0;for(this[U+be]=255&k;--be>=0&&(ke*=256);)k<0&&ct===0&&this[U+be+1]!==0&&(ct=1),this[U+be]=(k/ke>>0)-ct&255;return U+q},p.prototype.writeInt8=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,1,127,-128),p.TYPED_ARRAY_SUPPORT||(k=Math.floor(k)),k<0&&(k=255+k+1),this[U]=255&k,U+1},p.prototype.writeInt16LE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[U]=255&k,this[U+1]=k>>>8):$(this,k,U,!0),U+2},p.prototype.writeInt16BE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[U]=k>>>8,this[U+1]=255&k):$(this,k,U,!1),U+2},p.prototype.writeInt32LE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[U]=255&k,this[U+1]=k>>>8,this[U+2]=k>>>16,this[U+3]=k>>>24):ne(this,k,U,!0),U+4},p.prototype.writeInt32BE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),p.TYPED_ARRAY_SUPPORT?(this[U]=k>>>24,this[U+1]=k>>>16,this[U+2]=k>>>8,this[U+3]=255&k):ne(this,k,U,!1),U+4},p.prototype.writeFloatLE=function(k,U,q){return pe(this,k,U,!0,q)},p.prototype.writeFloatBE=function(k,U,q){return pe(this,k,U,!1,q)},p.prototype.writeDoubleLE=function(k,U,q){return Te(this,k,U,!0,q)},p.prototype.writeDoubleBE=function(k,U,q){return Te(this,k,U,!1,q)},p.prototype.copy=function(k,U,q,Y){if(q||(q=0),Y||Y===0||(Y=this.length),U>=k.length&&(U=k.length),U||(U=0),Y>0&&Y<q&&(Y=q),Y===q)return 0;if(k.length===0||this.length===0)return 0;if(U<0)throw new RangeError("targetStart out of bounds");if(q<0||q>=this.length)throw new RangeError("sourceStart out of bounds");if(Y<0)throw new RangeError("sourceEnd out of bounds");Y>this.length&&(Y=this.length),k.length-U<Y-q&&(Y=k.length-U+q);var J,be=Y-q;if(this===k&&q<U&&U<Y)for(J=be-1;J>=0;--J)k[J+U]=this[J+q];else if(be<1e3||!p.TYPED_ARRAY_SUPPORT)for(J=0;J<be;++J)k[J+U]=this[J+q];else Uint8Array.prototype.set.call(k,this.subarray(q,q+be),U);return be},p.prototype.fill=function(k,U,q,Y){if(typeof k=="string"){if(typeof U=="string"?(Y=U,U=0,q=this.length):typeof q=="string"&&(Y=q,q=this.length),k.length===1){var J=k.charCodeAt(0);J<256&&(k=J)}if(Y!==void 0&&typeof Y!="string")throw new TypeError("encoding must be a string");if(typeof Y=="string"&&!p.isEncoding(Y))throw new TypeError("Unknown encoding: "+Y)}else typeof k=="number"&&(k&=255);if(U<0||this.length<U||this.length<q)throw new RangeError("Out of range index");if(q<=U)return this;U>>>=0,q=q===void 0?this.length:q>>>0,k||(k=0);var be;if(typeof k=="number")for(be=U;be<q;++be)this[be]=k;else{var ke=p.isBuffer(k)?k:xe(new p(k,Y).toString()),ct=ke.length;for(be=0;be<q-U;++be)this[be+U]=ke[be%ct]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(this,typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"base64-js":34,ieee754:161,isarray:166}],39:[function(S,D,x){D.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(S,D,x){"use strict";var T=function(){this.buffer=[],this.fns=[]};T.prototype.push=function(f,p){if(this.fns.length)return this.fns.shift()(null,f);var u={data:f,priority:p},o=w(this.buffer,u,function(i){return i.priority});this.buffer.splice(o,0,u)},T.prototype.next=function(){var f=this;return function(p){if(f.buffer.length)return p(null,f.buffer.pop().data);f.fns.push(p)}};var w=function(f,p,u){p=u(p);for(var o=0,i=f?f.length:o;o<i;){var l=o+i>>>1;u(f[l])<p?o=l+1:i=l}return o};D.exports=T},{}],41:[function(S,D,x){function T(r){var t=this,n=h.call(arguments,1);return new Promise(function(c,m){function v(g){var y;try{y=r.next(g)}catch(C){return m(C)}E(y)}function b(g){var y;try{y=r.throw(g)}catch(C){return m(C)}E(y)}function E(g){if(g.done)return c(g.value);var y=w.call(t,g.value);return y&&o(y)?y.then(v,b):b(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "'+String(g.value)+'"'))}if(typeof r=="function"&&(r=r.apply(t,n)),!r||typeof r.next!="function")return c(r);v()})}function w(r){return r&&(o(r)?r:l(r)||i(r)?T.call(this,r):typeof r=="function"?f.call(this,r):Array.isArray(r)?p.call(this,r):s(r)?u.call(this,r):r)}function f(r){var t=this;return new Promise(function(n,c){r.call(t,function(m,v){if(m)return c(m);arguments.length>2&&(v=h.call(arguments,1)),n(v)})})}function p(r){return Promise.all(r.map(w,this))}function u(r){for(var t=new r.constructor,n=Object.keys(r),c=[],m=0;m<n.length;m++){var v=n[m],b=w.call(this,r[v]);b&&o(b)?function(E,g){t[g]=void 0,c.push(E.then(function(y){t[g]=y}))}(b,v):t[v]=r[v]}return Promise.all(c).then(function(){return t})}function o(r){return typeof r.then=="function"}function i(r){return typeof r.next=="function"&&typeof r.throw=="function"}function l(r){var t=r.constructor;return!!t&&(t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction"||i(t.prototype))}function s(r){return Object==r.constructor}var h=Array.prototype.slice;D.exports=T.default=T.co=T,T.wrap=function(r){function t(){return T.call(this,r.apply(this,arguments))}return t.__generatorFunction__=r,t}},{}],42:[function(S,D,x){D.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(S,D,x){"use strict";function T(p,u){if(!(this instanceof T))return new T(p,u);this.src=p,this._withAccess=u}function w(p,u){return p[u]===void 0&&p.__lookupGetter__(u)===void 0&&p.__lookupSetter__(u)===void 0}var f=Array.prototype.slice;D.exports=T,T.prototype.withAccess=function(p){return this._withAccess=p!==!1,this},T.prototype.pick=function(p){return Array.isArray(p)||(p=f.call(arguments)),p.length&&(this.keys=p),this},T.prototype.to=function(p){if(p=p||{},!this.src)return p;var u=this.keys||Object.keys(this.src);if(!this._withAccess){for(var o=0;o<u.length;o++)i=u[o],p[i]===void 0&&(p[i]=this.src[i]);return p}for(var o=0;o<u.length;o++){var i=u[o];if(w(p,i)){var l=this.src.__lookupGetter__(i),s=this.src.__lookupSetter__(i);l&&p.__defineGetter__(i,l),s&&p.__defineSetter__(i,s),l||s||(p[i]=this.src[i])}}return p},T.prototype.toCover=function(p){for(var u=this.keys||Object.keys(this.src),o=0;o<u.length;o++){var i=u[o];delete p[i];var l=this.src.__lookupGetter__(i),s=this.src.__lookupSetter__(i);l&&p.__defineGetter__(i,l),s&&p.__defineSetter__(i,s),l||s||(p[i]=this.src[i])}},T.prototype.override=T.prototype.toCover,T.prototype.and=function(p){var u={};return this.to(u),this.src=p,this.to(u),this.src=u,this}},{}],44:[function(S,D,x){S("../../modules/es6.string.iterator"),S("../../modules/es6.array.from"),D.exports=S("../../modules/_core").Array.from},{"../../modules/_core":65,"../../modules/es6.array.from":133,"../../modules/es6.string.iterator":145}],45:[function(S,D,x){var T=S("../../modules/_core"),w=T.JSON||(T.JSON={stringify:JSON.stringify});D.exports=function(f){return w.stringify.apply(w,arguments)}},{"../../modules/_core":65}],46:[function(S,D,x){S("../../modules/es6.object.assign"),D.exports=S("../../modules/_core").Object.assign},{"../../modules/_core":65,"../../modules/es6.object.assign":136}],47:[function(S,D,x){S("../../modules/es6.object.create");var T=S("../../modules/_core").Object;D.exports=function(w,f){return T.create(w,f)}},{"../../modules/_core":65,"../../modules/es6.object.create":137}],48:[function(S,D,x){S("../../modules/es6.object.define-property");var T=S("../../modules/_core").Object;D.exports=function(w,f,p){return T.defineProperty(w,f,p)}},{"../../modules/_core":65,"../../modules/es6.object.define-property":138}],49:[function(S,D,x){S("../../modules/es6.object.get-own-property-names");var T=S("../../modules/_core").Object;D.exports=function(w){return T.getOwnPropertyNames(w)}},{"../../modules/_core":65,"../../modules/es6.object.get-own-property-names":139}],50:[function(S,D,x){S("../../modules/es6.object.get-prototype-of"),D.exports=S("../../modules/_core").Object.getPrototypeOf},{"../../modules/_core":65,"../../modules/es6.object.get-prototype-of":140}],51:[function(S,D,x){S("../../modules/es6.object.keys"),D.exports=S("../../modules/_core").Object.keys},{"../../modules/_core":65,"../../modules/es6.object.keys":141}],52:[function(S,D,x){S("../modules/es6.object.to-string"),S("../modules/es6.string.iterator"),S("../modules/web.dom.iterable"),S("../modules/es6.promise"),S("../modules/es7.promise.finally"),S("../modules/es7.promise.try"),D.exports=S("../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(S,D,x){S("../modules/web.immediate"),D.exports=S("../modules/_core").setImmediate},{"../modules/_core":65,"../modules/web.immediate":152}],54:[function(S,D,x){S("../../modules/es6.string.from-code-point"),D.exports=S("../../modules/_core").String.fromCodePoint},{"../../modules/_core":65,"../../modules/es6.string.from-code-point":144}],55:[function(S,D,x){S("../../modules/es6.function.has-instance"),D.exports=S("../../modules/_wks-ext").f("hasInstance")},{"../../modules/_wks-ext":130,"../../modules/es6.function.has-instance":135}],56:[function(S,D,x){S("../../modules/es6.symbol"),S("../../modules/es6.object.to-string"),S("../../modules/es7.symbol.async-iterator"),S("../../modules/es7.symbol.observable"),D.exports=S("../../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(S,D,x){S("../../modules/es6.string.iterator"),S("../../modules/web.dom.iterable"),D.exports=S("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":130,"../../modules/es6.string.iterator":145,"../../modules/web.dom.iterable":151}],58:[function(S,D,x){D.exports=function(T){if(typeof T!="function")throw TypeError(T+" is not a function!");return T}},{}],59:[function(S,D,x){D.exports=function(){}},{}],60:[function(S,D,x){D.exports=function(T,w,f,p){if(!(T instanceof w)||p!==void 0&&p in T)throw TypeError(f+": incorrect invocation!");return T}},{}],61:[function(S,D,x){var T=S("./_is-object");D.exports=function(w){if(!T(w))throw TypeError(w+" is not an object!");return w}},{"./_is-object":85}],62:[function(S,D,x){var T=S("./_to-iobject"),w=S("./_to-length"),f=S("./_to-absolute-index");D.exports=function(p){return function(u,o,i){var l,s=T(u),h=w(s.length),r=f(i,h);if(p&&o!=o){for(;h>r;)if((l=s[r++])!=l)return!0}else for(;h>r;r++)if((p||r in s)&&s[r]===o)return p||r||0;return!p&&-1}}},{"./_to-absolute-index":121,"./_to-iobject":123,"./_to-length":124}],63:[function(S,D,x){var T=S("./_cof"),w=S("./_wks")("toStringTag"),f=T(function(){return arguments}())=="Arguments",p=function(u,o){try{return u[o]}catch(i){}};D.exports=function(u){var o,i,l;return u===void 0?"Undefined":u===null?"Null":typeof(i=p(o=Object(u),w))=="string"?i:f?T(o):(l=T(o))=="Object"&&typeof o.callee=="function"?"Arguments":l}},{"./_cof":64,"./_wks":131}],64:[function(S,D,x){var T={}.toString;D.exports=function(w){return T.call(w).slice(8,-1)}},{}],65:[function(S,D,x){var T=D.exports={version:"2.5.7"};typeof __e=="number"&&(__e=T)},{}],66:[function(S,D,x){"use strict";var T=S("./_object-dp"),w=S("./_property-desc");D.exports=function(f,p,u){p in f?T.f(f,p,w(0,u)):f[p]=u}},{"./_object-dp":98,"./_property-desc":111}],67:[function(S,D,x){var T=S("./_a-function");D.exports=function(w,f,p){if(T(w),f===void 0)return w;switch(p){case 1:return function(u){return w.call(f,u)};case 2:return function(u,o){return w.call(f,u,o)};case 3:return function(u,o,i){return w.call(f,u,o,i)}}return function(){return w.apply(f,arguments)}}},{"./_a-function":58}],68:[function(S,D,x){D.exports=function(T){if(T==null)throw TypeError("Can't call method on "+T);return T}},{}],69:[function(S,D,x){D.exports=!S("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":74}],70:[function(S,D,x){var T=S("./_is-object"),w=S("./_global").document,f=T(w)&&T(w.createElement);D.exports=function(p){return f?w.createElement(p):{}}},{"./_global":76,"./_is-object":85}],71:[function(S,D,x){D.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],72:[function(S,D,x){var T=S("./_object-keys"),w=S("./_object-gops"),f=S("./_object-pie");D.exports=function(p){var u=T(p),o=w.f;if(o)for(var i,l=o(p),s=f.f,h=0;l.length>h;)s.call(p,i=l[h++])&&u.push(i);return u}},{"./_object-gops":103,"./_object-keys":106,"./_object-pie":107}],73:[function(S,D,x){var T=S("./_global"),w=S("./_core"),f=S("./_ctx"),p=S("./_hide"),u=S("./_has"),o=function(i,l,s){var h,r,t,n=i&o.F,c=i&o.G,m=i&o.S,v=i&o.P,b=i&o.B,E=i&o.W,g=c?w:w[l]||(w[l]={}),y=g.prototype,C=c?T:m?T[l]:(T[l]||{}).prototype;c&&(s=l);for(h in s)(r=!n&&C&&C[h]!==void 0)&&u(g,h)||(t=r?C[h]:s[h],g[h]=c&&typeof C[h]!="function"?s[h]:b&&r?f(t,T):E&&C[h]==t?function(d){var _=function(O,A,P){if(this instanceof d){switch(arguments.length){case 0:return new d;case 1:return new d(O);case 2:return new d(O,A)}return new d(O,A,P)}return d.apply(this,arguments)};return _.prototype=d.prototype,_}(t):v&&typeof t=="function"?f(Function.call,t):t,v&&((g.virtual||(g.virtual={}))[h]=t,i&o.R&&y&&!y[h]&&p(y,h,t)))};o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,o.U=64,o.R=128,D.exports=o},{"./_core":65,"./_ctx":67,"./_global":76,"./_has":77,"./_hide":78}],74:[function(S,D,x){D.exports=function(T){try{return!!T()}catch(w){return!0}}},{}],75:[function(S,D,x){var T=S("./_ctx"),w=S("./_iter-call"),f=S("./_is-array-iter"),p=S("./_an-object"),u=S("./_to-length"),o=S("./core.get-iterator-method"),i={},l={},x=D.exports=function(s,h,r,t,n){var c,m,v,b,E=n?function(){return s}:o(s),g=T(r,t,h?2:1),y=0;if(typeof E!="function")throw TypeError(s+" is not iterable!");if(f(E)){for(c=u(s.length);c>y;y++)if((b=h?g(p(m=s[y])[0],m[1]):g(s[y]))===i||b===l)return b}else for(v=E.call(s);!(m=v.next()).done;)if((b=w(v,g,m.value,h))===i||b===l)return b};x.BREAK=i,x.RETURN=l},{"./_an-object":61,"./_ctx":67,"./_is-array-iter":83,"./_iter-call":86,"./_to-length":124,"./core.get-iterator-method":132}],76:[function(S,D,x){var T=D.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=T)},{}],77:[function(S,D,x){var T={}.hasOwnProperty;D.exports=function(w,f){return T.call(w,f)}},{}],78:[function(S,D,x){var T=S("./_object-dp"),w=S("./_property-desc");D.exports=S("./_descriptors")?function(f,p,u){return T.f(f,p,w(1,u))}:function(f,p,u){return f[p]=u,f}},{"./_descriptors":69,"./_object-dp":98,"./_property-desc":111}],79:[function(S,D,x){var T=S("./_global").document;D.exports=T&&T.documentElement},{"./_global":76}],80:[function(S,D,x){D.exports=!S("./_descriptors")&&!S("./_fails")(function(){return Object.defineProperty(S("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":69,"./_dom-create":70,"./_fails":74}],81:[function(S,D,x){D.exports=function(T,w,f){var p=f===void 0;switch(w.length){case 0:return p?T():T.call(f);case 1:return p?T(w[0]):T.call(f,w[0]);case 2:return p?T(w[0],w[1]):T.call(f,w[0],w[1]);case 3:return p?T(w[0],w[1],w[2]):T.call(f,w[0],w[1],w[2]);case 4:return p?T(w[0],w[1],w[2],w[3]):T.call(f,w[0],w[1],w[2],w[3])}return T.apply(f,w)}},{}],82:[function(S,D,x){var T=S("./_cof");D.exports=Object("z").propertyIsEnumerable(0)?Object:function(w){return T(w)=="String"?w.split(""):Object(w)}},{"./_cof":64}],83:[function(S,D,x){var T=S("./_iterators"),w=S("./_wks")("iterator"),f=Array.prototype;D.exports=function(p){return p!==void 0&&(T.Array===p||f[w]===p)}},{"./_iterators":91,"./_wks":131}],84:[function(S,D,x){var T=S("./_cof");D.exports=Array.isArray||function(w){return T(w)=="Array"}},{"./_cof":64}],85:[function(S,D,x){D.exports=function(T){return typeof T=="object"?T!==null:typeof T=="function"}},{}],86:[function(S,D,x){var T=S("./_an-object");D.exports=function(w,f,p,u){try{return u?f(T(p)[0],p[1]):f(p)}catch(i){var o=w.return;throw o!==void 0&&T(o.call(w)),i}}},{"./_an-object":61}],87:[function(S,D,x){"use strict";var T=S("./_object-create"),w=S("./_property-desc"),f=S("./_set-to-string-tag"),p={};S("./_hide")(p,S("./_wks")("iterator"),function(){return this}),D.exports=function(u,o,i){u.prototype=T(p,{next:w(1,i)}),f(u,o+" Iterator")}},{"./_hide":78,"./_object-create":97,"./_property-desc":111,"./_set-to-string-tag":115,"./_wks":131}],88:[function(S,D,x){"use strict";var T=S("./_library"),w=S("./_export"),f=S("./_redefine"),p=S("./_hide"),u=S("./_iterators"),o=S("./_iter-create"),i=S("./_set-to-string-tag"),l=S("./_object-gpo"),s=S("./_wks")("iterator"),h=!([].keys&&"next"in[].keys()),r=function(){return this};D.exports=function(t,n,c,m,v,b,E){o(c,n,m);var g,y,C,d=function(H){if(!h&&H in P)return P[H];switch(H){case"keys":case"values":return function(){return new c(this,H)}}return function(){return new c(this,H)}},_=n+" Iterator",O=v=="values",A=!1,P=t.prototype,I=P[s]||P["@@iterator"]||v&&P[v],W=I||d(v),K=v?O?d("entries"):W:void 0,te=n=="Array"&&P.entries||I;if(te&&(C=l(te.call(new t)))!==Object.prototype&&C.next&&(i(C,_,!0),T||typeof C[s]=="function"||p(C,s,r)),O&&I&&I.name!=="values"&&(A=!0,W=function(){return I.call(this)}),T&&!E||!h&&!A&&P[s]||p(P,s,W),u[n]=W,u[_]=r,v)if(g={values:O?W:d("values"),keys:b?W:d("keys"),entries:K},E)for(y in g)y in P||f(P,y,g[y]);else w(w.P+w.F*(h||A),n,g);return g}},{"./_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(S,D,x){var T=S("./_wks")("iterator"),w=!1;try{var f=[7][T]();f.return=function(){w=!0},Array.from(f,function(){throw 2})}catch(p){}D.exports=function(p,u){if(!u&&!w)return!1;var o=!1;try{var i=[7],l=i[T]();l.next=function(){return{done:o=!0}},i[T]=function(){return l},p(i)}catch(s){}return o}},{"./_wks":131}],90:[function(S,D,x){D.exports=function(T,w){return{value:w,done:!!T}}},{}],91:[function(S,D,x){D.exports={}},{}],92:[function(S,D,x){D.exports=!0},{}],93:[function(S,D,x){var T=S("./_uid")("meta"),w=S("./_is-object"),f=S("./_has"),p=S("./_object-dp").f,u=0,o=Object.isExtensible||function(){return!0},i=!S("./_fails")(function(){return o(Object.preventExtensions({}))}),l=function(n){p(n,T,{value:{i:"O"+ ++u,w:{}}})},s=function(n,c){if(!w(n))return typeof n=="symbol"?n:(typeof n=="string"?"S":"P")+n;if(!f(n,T)){if(!o(n))return"F";if(!c)return"E";l(n)}return n[T].i},h=function(n,c){if(!f(n,T)){if(!o(n))return!0;if(!c)return!1;l(n)}return n[T].w},r=function(n){return i&&t.NEED&&o(n)&&!f(n,T)&&l(n),n},t=D.exports={KEY:T,NEED:!1,fastKey:s,getWeak:h,onFreeze:r}},{"./_fails":74,"./_has":77,"./_is-object":85,"./_object-dp":98,"./_uid":127}],94:[function(S,D,x){var T=S("./_global"),w=S("./_task").set,f=T.MutationObserver||T.WebKitMutationObserver,p=T.process,u=T.Promise,o=S("./_cof")(p)=="process";D.exports=function(){var i,l,s,h=function(){var c,m;for(o&&(c=p.domain)&&c.exit();i;){m=i.fn,i=i.next;try{m()}catch(v){throw i?s():l=void 0,v}}l=void 0,c&&c.enter()};if(o)s=function(){p.nextTick(h)};else if(!f||T.navigator&&T.navigator.standalone)if(u&&u.resolve){var r=u.resolve(void 0);s=function(){r.then(h)}}else s=function(){w.call(T,h)};else{var t=!0,n=document.createTextNode("");new f(h).observe(n,{characterData:!0}),s=function(){n.data=t=!t}}return function(c){var m={fn:c,next:void 0};l&&(l.next=m),i||(i=m,s()),l=m}}},{"./_cof":64,"./_global":76,"./_task":120}],95:[function(S,D,x){"use strict";function T(f){var p,u;this.promise=new f(function(o,i){if(p!==void 0||u!==void 0)throw TypeError("Bad Promise constructor");p=o,u=i}),this.resolve=w(p),this.reject=w(u)}var w=S("./_a-function");D.exports.f=function(f){return new T(f)}},{"./_a-function":58}],96:[function(S,D,x){"use strict";var T=S("./_object-keys"),w=S("./_object-gops"),f=S("./_object-pie"),p=S("./_to-object"),u=S("./_iobject"),o=Object.assign;D.exports=!o||S("./_fails")(function(){var i={},l={},s=Symbol(),h="abcdefghijklmnopqrst";return i[s]=7,h.split("").forEach(function(r){l[r]=r}),o({},i)[s]!=7||Object.keys(o({},l)).join("")!=h})?function(i,l){for(var s=p(i),h=arguments.length,r=1,t=w.f,n=f.f;h>r;)for(var c,m=u(arguments[r++]),v=t?T(m).concat(t(m)):T(m),b=v.length,E=0;b>E;)n.call(m,c=v[E++])&&(s[c]=m[c]);return s}:o},{"./_fails":74,"./_iobject":82,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_to-object":125}],97:[function(S,D,x){var T=S("./_an-object"),w=S("./_object-dps"),f=S("./_enum-bug-keys"),p=S("./_shared-key")("IE_PROTO"),u=function(){},o=function(){var i,l=S("./_dom-create")("iframe"),s=f.length;for(l.style.display="none",S("./_html").appendChild(l),l.src="javascript:",i=l.contentWindow.document,i.open(),i.write("<script>document.F=Object</script>"),i.close(),o=i.F;s--;)delete o.prototype[f[s]];return o()};D.exports=Object.create||function(i,l){var s;return i!==null?(u.prototype=T(i),s=new u,u.prototype=null,s[p]=i):s=o(),l===void 0?s:w(s,l)}},{"./_an-object":61,"./_dom-create":70,"./_enum-bug-keys":71,"./_html":79,"./_object-dps":99,"./_shared-key":116}],98:[function(S,D,x){var T=S("./_an-object"),w=S("./_ie8-dom-define"),f=S("./_to-primitive"),p=Object.defineProperty;x.f=S("./_descriptors")?Object.defineProperty:function(u,o,i){if(T(u),o=f(o,!0),T(i),w)try{return p(u,o,i)}catch(l){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(u[o]=i.value),u}},{"./_an-object":61,"./_descriptors":69,"./_ie8-dom-define":80,"./_to-primitive":126}],99:[function(S,D,x){var T=S("./_object-dp"),w=S("./_an-object"),f=S("./_object-keys");D.exports=S("./_descriptors")?Object.defineProperties:function(p,u){w(p);for(var o,i=f(u),l=i.length,s=0;l>s;)T.f(p,o=i[s++],u[o]);return p}},{"./_an-object":61,"./_descriptors":69,"./_object-dp":98,"./_object-keys":106}],100:[function(S,D,x){var T=S("./_object-pie"),w=S("./_property-desc"),f=S("./_to-iobject"),p=S("./_to-primitive"),u=S("./_has"),o=S("./_ie8-dom-define"),i=Object.getOwnPropertyDescriptor;x.f=S("./_descriptors")?i:function(l,s){if(l=f(l),s=p(s,!0),o)try{return i(l,s)}catch(h){}if(u(l,s))return w(!T.f.call(l,s),l[s])}},{"./_descriptors":69,"./_has":77,"./_ie8-dom-define":80,"./_object-pie":107,"./_property-desc":111,"./_to-iobject":123,"./_to-primitive":126}],101:[function(S,D,x){var T=S("./_to-iobject"),w=S("./_object-gopn").f,f={}.toString,p=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(o){try{return w(o)}catch(i){return p.slice()}};D.exports.f=function(o){return p&&f.call(o)=="[object Window]"?u(o):w(T(o))}},{"./_object-gopn":102,"./_to-iobject":123}],102:[function(S,D,x){var T=S("./_object-keys-internal"),w=S("./_enum-bug-keys").concat("length","prototype");x.f=Object.getOwnPropertyNames||function(f){return T(f,w)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],103:[function(S,D,x){x.f=Object.getOwnPropertySymbols},{}],104:[function(S,D,x){var T=S("./_has"),w=S("./_to-object"),f=S("./_shared-key")("IE_PROTO"),p=Object.prototype;D.exports=Object.getPrototypeOf||function(u){return u=w(u),T(u,f)?u[f]:typeof u.constructor=="function"&&u instanceof u.constructor?u.constructor.prototype:u instanceof Object?p:null}},{"./_has":77,"./_shared-key":116,"./_to-object":125}],105:[function(S,D,x){var T=S("./_has"),w=S("./_to-iobject"),f=S("./_array-includes")(!1),p=S("./_shared-key")("IE_PROTO");D.exports=function(u,o){var i,l=w(u),s=0,h=[];for(i in l)i!=p&&T(l,i)&&h.push(i);for(;o.length>s;)T(l,i=o[s++])&&(~f(h,i)||h.push(i));return h}},{"./_array-includes":62,"./_has":77,"./_shared-key":116,"./_to-iobject":123}],106:[function(S,D,x){var T=S("./_object-keys-internal"),w=S("./_enum-bug-keys");D.exports=Object.keys||function(f){return T(f,w)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],107:[function(S,D,x){x.f={}.propertyIsEnumerable},{}],108:[function(S,D,x){var T=S("./_export"),w=S("./_core"),f=S("./_fails");D.exports=function(p,u){var o=(w.Object||{})[p]||Object[p],i={};i[p]=u(o),T(T.S+T.F*f(function(){o(1)}),"Object",i)}},{"./_core":65,"./_export":73,"./_fails":74}],109:[function(S,D,x){D.exports=function(T){try{return{e:!1,v:T()}}catch(w){return{e:!0,v:w}}}},{}],110:[function(S,D,x){var T=S("./_an-object"),w=S("./_is-object"),f=S("./_new-promise-capability");D.exports=function(p,u){if(T(p),w(u)&&u.constructor===p)return u;var o=f.f(p);return(0,o.resolve)(u),o.promise}},{"./_an-object":61,"./_is-object":85,"./_new-promise-capability":95}],111:[function(S,D,x){D.exports=function(T,w){return{enumerable:!(1&T),configurable:!(2&T),writable:!(4&T),value:w}}},{}],112:[function(S,D,x){var T=S("./_hide");D.exports=function(w,f,p){for(var u in f)p&&w[u]?w[u]=f[u]:T(w,u,f[u]);return w}},{"./_hide":78}],113:[function(S,D,x){D.exports=S("./_hide")},{"./_hide":78}],114:[function(S,D,x){"use strict";var T=S("./_global"),w=S("./_core"),f=S("./_object-dp"),p=S("./_descriptors"),u=S("./_wks")("species");D.exports=function(o){var i=typeof w[o]=="function"?w[o]:T[o];p&&i&&!i[u]&&f.f(i,u,{configurable:!0,get:function(){return this}})}},{"./_core":65,"./_descriptors":69,"./_global":76,"./_object-dp":98,"./_wks":131}],115:[function(S,D,x){var T=S("./_object-dp").f,w=S("./_has"),f=S("./_wks")("toStringTag");D.exports=function(p,u,o){p&&!w(p=o?p:p.prototype,f)&&T(p,f,{configurable:!0,value:u})}},{"./_has":77,"./_object-dp":98,"./_wks":131}],116:[function(S,D,x){var T=S("./_shared")("keys"),w=S("./_uid");D.exports=function(f){return T[f]||(T[f]=w(f))}},{"./_shared":117,"./_uid":127}],117:[function(S,D,x){var T=S("./_core"),w=S("./_global"),f=w["__core-js_shared__"]||(w["__core-js_shared__"]={});(D.exports=function(p,u){return f[p]||(f[p]=u!==void 0?u:{})})("versions",[]).push({version:T.version,mode:S("./_library")?"pure":"global",copyright:"\u6F0F 2018 Denis Pushkarev (zloirock.ru)"})},{"./_core":65,"./_global":76,"./_library":92}],118:[function(S,D,x){var T=S("./_an-object"),w=S("./_a-function"),f=S("./_wks")("species");D.exports=function(p,u){var o,i=T(p).constructor;return i===void 0||(o=T(i)[f])==null?u:w(o)}},{"./_a-function":58,"./_an-object":61,"./_wks":131}],119:[function(S,D,x){var T=S("./_to-integer"),w=S("./_defined");D.exports=function(f){return function(p,u){var o,i,l=String(w(p)),s=T(u),h=l.length;return s<0||s>=h?f?"":void 0:(o=l.charCodeAt(s),o<55296||o>56319||s+1===h||(i=l.charCodeAt(s+1))<56320||i>57343?f?l.charAt(s):o:f?l.slice(s,s+2):i-56320+(o-55296<<10)+65536)}}},{"./_defined":68,"./_to-integer":122}],120:[function(S,D,x){var T,w,f,p=S("./_ctx"),u=S("./_invoke"),o=S("./_html"),i=S("./_dom-create"),l=S("./_global"),s=l.process,h=l.setImmediate,r=l.clearImmediate,t=l.MessageChannel,n=l.Dispatch,c=0,m={},v=function(){var E=+this;if(m.hasOwnProperty(E)){var g=m[E];delete m[E],g()}},b=function(E){v.call(E.data)};h&&r||(h=function(E){for(var g=[],y=1;arguments.length>y;)g.push(arguments[y++]);return m[++c]=function(){u(typeof E=="function"?E:Function(E),g)},T(c),c},r=function(E){delete m[E]},S("./_cof")(s)=="process"?T=function(E){s.nextTick(p(v,E,1))}:n&&n.now?T=function(E){n.now(p(v,E,1))}:t?(w=new t,f=w.port2,w.port1.onmessage=b,T=p(f.postMessage,f,1)):l.addEventListener&&typeof postMessage=="function"&&!l.importScripts?(T=function(E){l.postMessage(E+"","*")},l.addEventListener("message",b,!1)):T="onreadystatechange"in i("script")?function(E){o.appendChild(i("script")).onreadystatechange=function(){o.removeChild(this),v.call(E)}}:function(E){setTimeout(p(v,E,1),0)}),D.exports={set:h,clear:r}},{"./_cof":64,"./_ctx":67,"./_dom-create":70,"./_global":76,"./_html":79,"./_invoke":81}],121:[function(S,D,x){var T=S("./_to-integer"),w=Math.max,f=Math.min;D.exports=function(p,u){return p=T(p),p<0?w(p+u,0):f(p,u)}},{"./_to-integer":122}],122:[function(S,D,x){var T=Math.ceil,w=Math.floor;D.exports=function(f){return isNaN(f=+f)?0:(f>0?w:T)(f)}},{}],123:[function(S,D,x){var T=S("./_iobject"),w=S("./_defined");D.exports=function(f){return T(w(f))}},{"./_defined":68,"./_iobject":82}],124:[function(S,D,x){var T=S("./_to-integer"),w=Math.min;D.exports=function(f){return f>0?w(T(f),9007199254740991):0}},{"./_to-integer":122}],125:[function(S,D,x){var T=S("./_defined");D.exports=function(w){return Object(T(w))}},{"./_defined":68}],126:[function(S,D,x){var T=S("./_is-object");D.exports=function(w,f){if(!T(w))return w;var p,u;if(f&&typeof(p=w.toString)=="function"&&!T(u=p.call(w)))return u;if(typeof(p=w.valueOf)=="function"&&!T(u=p.call(w)))return u;if(!f&&typeof(p=w.toString)=="function"&&!T(u=p.call(w)))return u;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":85}],127:[function(S,D,x){var T=0,w=Math.random();D.exports=function(f){return"Symbol(".concat(f===void 0?"":f,")_",(++T+w).toString(36))}},{}],128:[function(S,D,x){var T=S("./_global"),w=T.navigator;D.exports=w&&w.userAgent||""},{"./_global":76}],129:[function(S,D,x){var T=S("./_global"),w=S("./_core"),f=S("./_library"),p=S("./_wks-ext"),u=S("./_object-dp").f;D.exports=function(o){var i=w.Symbol||(w.Symbol=f?{}:T.Symbol||{});o.charAt(0)=="_"||o in i||u(i,o,{value:p.f(o)})}},{"./_core":65,"./_global":76,"./_library":92,"./_object-dp":98,"./_wks-ext":130}],130:[function(S,D,x){x.f=S("./_wks")},{"./_wks":131}],131:[function(S,D,x){var T=S("./_shared")("wks"),w=S("./_uid"),f=S("./_global").Symbol,p=typeof f=="function";(D.exports=function(u){return T[u]||(T[u]=p&&f[u]||(p?f:w)("Symbol."+u))}).store=T},{"./_global":76,"./_shared":117,"./_uid":127}],132:[function(S,D,x){var T=S("./_classof"),w=S("./_wks")("iterator"),f=S("./_iterators");D.exports=S("./_core").getIteratorMethod=function(p){if(p!=null)return p[w]||p["@@iterator"]||f[T(p)]}},{"./_classof":63,"./_core":65,"./_iterators":91,"./_wks":131}],133:[function(S,D,x){"use strict";var T=S("./_ctx"),w=S("./_export"),f=S("./_to-object"),p=S("./_iter-call"),u=S("./_is-array-iter"),o=S("./_to-length"),i=S("./_create-property"),l=S("./core.get-iterator-method");w(w.S+w.F*!S("./_iter-detect")(function(s){Array.from(s)}),"Array",{from:function(s){var h,r,t,n,c=f(s),m=typeof this=="function"?this:Array,v=arguments.length,b=v>1?arguments[1]:void 0,E=b!==void 0,g=0,y=l(c);if(E&&(b=T(b,v>2?arguments[2]:void 0,2)),y==null||m==Array&&u(y))for(h=o(c.length),r=new m(h);h>g;g++)i(r,g,E?b(c[g],g):c[g]);else for(n=y.call(c),r=new m;!(t=n.next()).done;g++)i(r,g,E?p(n,b,[t.value,g],!0):t.value);return r.length=g,r}})},{"./_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(S,D,x){"use strict";var T=S("./_add-to-unscopables"),w=S("./_iter-step"),f=S("./_iterators"),p=S("./_to-iobject");D.exports=S("./_iter-define")(Array,"Array",function(u,o){this._t=p(u),this._i=0,this._k=o},function(){var u=this._t,o=this._k,i=this._i++;return!u||i>=u.length?(this._t=void 0,w(1)):o=="keys"?w(0,i):o=="values"?w(0,u[i]):w(0,[i,u[i]])},"values"),f.Arguments=f.Array,T("keys"),T("values"),T("entries")},{"./_add-to-unscopables":59,"./_iter-define":88,"./_iter-step":90,"./_iterators":91,"./_to-iobject":123}],135:[function(S,D,x){"use strict";var T=S("./_is-object"),w=S("./_object-gpo"),f=S("./_wks")("hasInstance"),p=Function.prototype;f in p||S("./_object-dp").f(p,f,{value:function(u){if(typeof this!="function"||!T(u))return!1;if(!T(this.prototype))return u instanceof this;for(;u=w(u);)if(this.prototype===u)return!0;return!1}})},{"./_is-object":85,"./_object-dp":98,"./_object-gpo":104,"./_wks":131}],136:[function(S,D,x){var T=S("./_export");T(T.S+T.F,"Object",{assign:S("./_object-assign")})},{"./_export":73,"./_object-assign":96}],137:[function(S,D,x){var T=S("./_export");T(T.S,"Object",{create:S("./_object-create")})},{"./_export":73,"./_object-create":97}],138:[function(S,D,x){var T=S("./_export");T(T.S+T.F*!S("./_descriptors"),"Object",{defineProperty:S("./_object-dp").f})},{"./_descriptors":69,"./_export":73,"./_object-dp":98}],139:[function(S,D,x){S("./_object-sap")("getOwnPropertyNames",function(){return S("./_object-gopn-ext").f})},{"./_object-gopn-ext":101,"./_object-sap":108}],140:[function(S,D,x){var T=S("./_to-object"),w=S("./_object-gpo");S("./_object-sap")("getPrototypeOf",function(){return function(f){return w(T(f))}})},{"./_object-gpo":104,"./_object-sap":108,"./_to-object":125}],141:[function(S,D,x){var T=S("./_to-object"),w=S("./_object-keys");S("./_object-sap")("keys",function(){return function(f){return w(T(f))}})},{"./_object-keys":106,"./_object-sap":108,"./_to-object":125}],142:[function(S,D,x){arguments[4][36][0].apply(x,arguments)},{dup:36}],143:[function(S,D,x){"use strict";var T,w,f,p,u=S("./_library"),o=S("./_global"),i=S("./_ctx"),l=S("./_classof"),s=S("./_export"),h=S("./_is-object"),r=S("./_a-function"),t=S("./_an-instance"),n=S("./_for-of"),c=S("./_species-constructor"),m=S("./_task").set,v=S("./_microtask")(),b=S("./_new-promise-capability"),E=S("./_perform"),g=S("./_user-agent"),y=S("./_promise-resolve"),C=o.TypeError,d=o.process,_=d&&d.versions,O=_&&_.v8||"",A=o.Promise,P=l(d)=="process",I=function(){},W=w=b.f,K=!!function(){try{var he=A.resolve(1),pe=(he.constructor={})[S("./_wks")("species")]=function(Te){Te(I,I)};return(P||typeof PromiseRejectionEvent=="function")&&he.then(I)instanceof pe&&O.indexOf("6.6")!==0&&g.indexOf("Chrome/66")===-1}catch(Te){}}(),te=function(he){var pe;return!(!h(he)||typeof(pe=he.then)!="function")&&pe},H=function(he,pe){if(!he._n){he._n=!0;var Te=he._c;v(function(){for(var we=he._v,Me=he._s==1,Ee=0;Te.length>Ee;)!function(xe){var Ge,je,We,ze=Me?xe.ok:xe.fail,de=xe.resolve,le=xe.reject,Oe=xe.domain;try{ze?(Me||(he._h==2&&re(he),he._h=1),ze===!0?Ge=we:(Oe&&Oe.enter(),Ge=ze(we),Oe&&(Oe.exit(),We=!0)),Ge===xe.promise?le(C("Promise-chain cycle")):(je=te(Ge))?je.call(Ge,de,le):de(Ge)):le(we)}catch(Ie){Oe&&!We&&Oe.exit(),le(Ie)}}(Te[Ee++]);he._c=[],he._n=!1,pe&&!he._h&&G(he)})}},G=function(he){m.call(o,function(){var pe,Te,we,Me=he._v,Ee=V(he);if(Ee&&(pe=E(function(){P?d.emit("unhandledRejection",Me,he):(Te=o.onunhandledrejection)?Te({promise:he,reason:Me}):(we=o.console)&&we.error&&we.error("Unhandled promise rejection",Me)}),he._h=P||V(he)?2:1),he._a=void 0,Ee&&pe.e)throw pe.v})},V=function(he){return he._h!==1&&(he._a||he._c).length===0},re=function(he){m.call(o,function(){var pe;P?d.emit("rejectionHandled",he):(pe=o.onrejectionhandled)&&pe({promise:he,reason:he._v})})},$=function(he){var pe=this;pe._d||(pe._d=!0,pe=pe._w||pe,pe._v=he,pe._s=2,pe._a||(pe._a=pe._c.slice()),H(pe,!0))},ne=function(he){var pe,Te=this;if(!Te._d){Te._d=!0,Te=Te._w||Te;try{if(Te===he)throw C("Promise can't be resolved itself");(pe=te(he))?v(function(){var we={_w:Te,_d:!1};try{pe.call(he,i(ne,we,1),i($,we,1))}catch(Me){$.call(we,Me)}}):(Te._v=he,Te._s=1,H(Te,!1))}catch(we){$.call({_w:Te,_d:!1},we)}}};K||(A=function(he){t(this,A,"Promise","_h"),r(he),T.call(this);try{he(i(ne,this,1),i($,this,1))}catch(pe){$.call(this,pe)}},T=function(he){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},T.prototype=S("./_redefine-all")(A.prototype,{then:function(he,pe){var Te=W(c(this,A));return Te.ok=typeof he!="function"||he,Te.fail=typeof pe=="function"&&pe,Te.domain=P?d.domain:void 0,this._c.push(Te),this._a&&this._a.push(Te),this._s&&H(this,!1),Te.promise},catch:function(he){return this.then(void 0,he)}}),f=function(){var he=new T;this.promise=he,this.resolve=i(ne,he,1),this.reject=i($,he,1)},b.f=W=function(he){return he===A||he===p?new f(he):w(he)}),s(s.G+s.W+s.F*!K,{Promise:A}),S("./_set-to-string-tag")(A,"Promise"),S("./_set-species")("Promise"),p=S("./_core").Promise,s(s.S+s.F*!K,"Promise",{reject:function(he){var pe=W(this);return(0,pe.reject)(he),pe.promise}}),s(s.S+s.F*(u||!K),"Promise",{resolve:function(he){return y(u&&this===p?A:this,he)}}),s(s.S+s.F*!(K&&S("./_iter-detect")(function(he){A.all(he).catch(I)})),"Promise",{all:function(he){var pe=this,Te=W(pe),we=Te.resolve,Me=Te.reject,Ee=E(function(){var xe=[],Ge=0,je=1;n(he,!1,function(We){var ze=Ge++,de=!1;xe.push(void 0),je++,pe.resolve(We).then(function(le){de||(de=!0,xe[ze]=le,--je||we(xe))},Me)}),--je||we(xe)});return Ee.e&&Me(Ee.v),Te.promise},race:function(he){var pe=this,Te=W(pe),we=Te.reject,Me=E(function(){n(he,!1,function(Ee){pe.resolve(Ee).then(Te.resolve,we)})});return Me.e&&we(Me.v),Te.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(S,D,x){var T=S("./_export"),w=S("./_to-absolute-index"),f=String.fromCharCode,p=String.fromCodePoint;T(T.S+T.F*(!!p&&p.length!=1),"String",{fromCodePoint:function(u){for(var o,i=[],l=arguments.length,s=0;l>s;){if(o=+arguments[s++],w(o,1114111)!==o)throw RangeError(o+" is not a valid code point");i.push(o<65536?f(o):f(55296+((o-=65536)>>10),o%1024+56320))}return i.join("")}})},{"./_export":73,"./_to-absolute-index":121}],145:[function(S,D,x){"use strict";var T=S("./_string-at")(!0);S("./_iter-define")(String,"String",function(w){this._t=String(w),this._i=0},function(){var w,f=this._t,p=this._i;return p>=f.length?{value:void 0,done:!0}:(w=T(f,p),this._i+=w.length,{value:w,done:!1})})},{"./_iter-define":88,"./_string-at":119}],146:[function(S,D,x){"use strict";var T=S("./_global"),w=S("./_has"),f=S("./_descriptors"),p=S("./_export"),u=S("./_redefine"),o=S("./_meta").KEY,i=S("./_fails"),l=S("./_shared"),s=S("./_set-to-string-tag"),h=S("./_uid"),r=S("./_wks"),t=S("./_wks-ext"),n=S("./_wks-define"),c=S("./_enum-keys"),m=S("./_is-array"),v=S("./_an-object"),b=S("./_is-object"),E=S("./_to-iobject"),g=S("./_to-primitive"),y=S("./_property-desc"),C=S("./_object-create"),d=S("./_object-gopn-ext"),_=S("./_object-gopd"),O=S("./_object-dp"),A=S("./_object-keys"),P=_.f,I=O.f,W=d.f,K=T.Symbol,te=T.JSON,H=te&&te.stringify,G=r("_hidden"),V=r("toPrimitive"),re={}.propertyIsEnumerable,$=l("symbol-registry"),ne=l("symbols"),he=l("op-symbols"),pe=Object.prototype,Te=typeof K=="function",we=T.QObject,Me=!we||!we.prototype||!we.prototype.findChild,Ee=f&&i(function(){return C(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a!=7})?function(q,Y,J){var be=P(pe,Y);be&&delete pe[Y],I(q,Y,J),be&&q!==pe&&I(pe,Y,be)}:I,xe=function(q){var Y=ne[q]=C(K.prototype);return Y._k=q,Y},Ge=Te&&typeof K.iterator=="symbol"?function(q){return typeof q=="symbol"}:function(q){return q instanceof K},je=function(q,Y,J){return q===pe&&je(he,Y,J),v(q),Y=g(Y,!0),v(J),w(ne,Y)?(J.enumerable?(w(q,G)&&q[G][Y]&&(q[G][Y]=!1),J=C(J,{enumerable:y(0,!1)})):(w(q,G)||I(q,G,y(1,{})),q[G][Y]=!0),Ee(q,Y,J)):I(q,Y,J)},We=function(q,Y){v(q);for(var J,be=c(Y=E(Y)),ke=0,ct=be.length;ct>ke;)je(q,J=be[ke++],Y[J]);return q},ze=function(q,Y){return Y===void 0?C(q):We(C(q),Y)},de=function(q){var Y=re.call(this,q=g(q,!0));return!(this===pe&&w(ne,q)&&!w(he,q))&&(!(Y||!w(this,q)||!w(ne,q)||w(this,G)&&this[G][q])||Y)},le=function(q,Y){if(q=E(q),Y=g(Y,!0),q!==pe||!w(ne,Y)||w(he,Y)){var J=P(q,Y);return!J||!w(ne,Y)||w(q,G)&&q[G][Y]||(J.enumerable=!0),J}},Oe=function(q){for(var Y,J=W(E(q)),be=[],ke=0;J.length>ke;)w(ne,Y=J[ke++])||Y==G||Y==o||be.push(Y);return be},Ie=function(q){for(var Y,J=q===pe,be=W(J?he:E(q)),ke=[],ct=0;be.length>ct;)!w(ne,Y=be[ct++])||J&&!w(pe,Y)||ke.push(ne[Y]);return ke};Te||(K=function(){if(this instanceof K)throw TypeError("Symbol is not a constructor!");var q=h(arguments.length>0?arguments[0]:void 0),Y=function(J){this===pe&&Y.call(he,J),w(this,G)&&w(this[G],q)&&(this[G][q]=!1),Ee(this,q,y(1,J))};return f&&Me&&Ee(pe,q,{configurable:!0,set:Y}),xe(q)},u(K.prototype,"toString",function(){return this._k}),_.f=le,O.f=je,S("./_object-gopn").f=d.f=Oe,S("./_object-pie").f=de,S("./_object-gops").f=Ie,f&&!S("./_library")&&u(pe,"propertyIsEnumerable",de,!0),t.f=function(q){return xe(r(q))}),p(p.G+p.W+p.F*!Te,{Symbol:K});for(var qe="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;qe.length>ee;)r(qe[ee++]);for(var k=A(r.store),U=0;k.length>U;)n(k[U++]);p(p.S+p.F*!Te,"Symbol",{for:function(q){return w($,q+="")?$[q]:$[q]=K(q)},keyFor:function(q){if(!Ge(q))throw TypeError(q+" is not a symbol!");for(var Y in $)if($[Y]===q)return Y},useSetter:function(){Me=!0},useSimple:function(){Me=!1}}),p(p.S+p.F*!Te,"Object",{create:ze,defineProperty:je,defineProperties:We,getOwnPropertyDescriptor:le,getOwnPropertyNames:Oe,getOwnPropertySymbols:Ie}),te&&p(p.S+p.F*(!Te||i(function(){var q=K();return H([q])!="[null]"||H({a:q})!="{}"||H(Object(q))!="{}"})),"JSON",{stringify:function(q){for(var Y,J,be=[q],ke=1;arguments.length>ke;)be.push(arguments[ke++]);if(J=Y=be[1],(b(Y)||q!==void 0)&&!Ge(q))return m(Y)||(Y=function(ct,He){if(typeof J=="function"&&(He=J.call(this,ct,He)),!Ge(He))return He}),be[1]=Y,H.apply(te,be)}}),K.prototype[V]||S("./_hide")(K.prototype,V,K.prototype.valueOf),s(K,"Symbol"),s(Math,"Math",!0),s(T.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(S,D,x){"use strict";var T=S("./_export"),w=S("./_core"),f=S("./_global"),p=S("./_species-constructor"),u=S("./_promise-resolve");T(T.P+T.R,"Promise",{finally:function(o){var i=p(this,w.Promise||f.Promise),l=typeof o=="function";return this.then(l?function(s){return u(i,o()).then(function(){return s})}:o,l?function(s){return u(i,o()).then(function(){throw s})}:o)}})},{"./_core":65,"./_export":73,"./_global":76,"./_promise-resolve":110,"./_species-constructor":118}],148:[function(S,D,x){"use strict";var T=S("./_export"),w=S("./_new-promise-capability"),f=S("./_perform");T(T.S,"Promise",{try:function(p){var u=w.f(this),o=f(p);return(o.e?u.reject:u.resolve)(o.v),u.promise}})},{"./_export":73,"./_new-promise-capability":95,"./_perform":109}],149:[function(S,D,x){S("./_wks-define")("asyncIterator")},{"./_wks-define":129}],150:[function(S,D,x){S("./_wks-define")("observable")},{"./_wks-define":129}],151:[function(S,D,x){S("./es6.array.iterator");for(var T=S("./_global"),w=S("./_hide"),f=S("./_iterators"),p=S("./_wks")("toStringTag"),u="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(","),o=0;o<u.length;o++){var i=u[o],l=T[i],s=l&&l.prototype;s&&!s[p]&&w(s,p,i),f[i]=f.Array}},{"./_global":76,"./_hide":78,"./_iterators":91,"./_wks":131,"./es6.array.iterator":134}],152:[function(S,D,x){var T=S("./_export"),w=S("./_task");T(T.G+T.B,{setImmediate:w.set,clearImmediate:w.clear})},{"./_export":73,"./_task":120}],153:[function(S,D,x){(function(T){"use strict";function w(g){return Array.isArray?Array.isArray(g):v(g)==="[object Array]"}function f(g){return typeof g=="boolean"}function p(g){return g===null}function u(g){return g==null}function o(g){return typeof g=="number"}function i(g){return typeof g=="string"}function l(g){return(g===void 0?"undefined":(0,E.default)(g))==="symbol"}function s(g){return g===void 0}function h(g){return v(g)==="[object RegExp]"}function r(g){return(g===void 0?"undefined":(0,E.default)(g))==="object"&&g!==null}function t(g){return v(g)==="[object Date]"}function n(g){return v(g)==="[object Error]"||g instanceof Error}function c(g){return typeof g=="function"}function m(g){return g===null||typeof g=="boolean"||typeof g=="number"||typeof g=="string"||(g===void 0?"undefined":(0,E.default)(g))==="symbol"||g===void 0}function v(g){return Object.prototype.toString.call(g)}var b=S("babel-runtime/helpers/typeof"),E=function(g){return g&&g.__esModule?g:{default:g}}(b);x.isArray=w,x.isBoolean=f,x.isNull=p,x.isNullOrUndefined=u,x.isNumber=o,x.isString=i,x.isSymbol=l,x.isUndefined=s,x.isRegExp=h,x.isObject=r,x.isDate=t,x.isError=n,x.isFunction=c,x.isPrimitive=m,x.isBuffer=T.isBuffer}).call(this,{isBuffer:S("../../is-buffer/index.js")})},{"../../is-buffer/index.js":163,"babel-runtime/helpers/typeof":32}],154:[function(S,D,x){"use strict";var T=S("babel-runtime/helpers/typeof"),w=function(f){return f&&f.__esModule?f:{default:f}}(T);!function(f){function p(s,h){for(s=String(s),h=h||2;s.length<h;)s="0"+s;return s}function u(s){var h=new Date(s.getFullYear(),s.getMonth(),s.getDate());h.setDate(h.getDate()-(h.getDay()+6)%7+3);var r=new Date(h.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var t=h.getTimezoneOffset()-r.getTimezoneOffset();h.setHours(h.getHours()-t);var n=(h-r)/6048e5;return 1+Math.floor(n)}function o(s){var h=s.getDay();return h===0&&(h=7),h}function i(s){return s===null?"null":s===void 0?"undefined":(s===void 0?"undefined":(0,w.default)(s))!=="object"?s===void 0?"undefined":(0,w.default)(s):Array.isArray(s)?"array":{}.toString.call(s).slice(8,-1).toLowerCase()}var l=function(){var s=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,h=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,r=/[^-+\dA-Z]/g;return function(t,n,c,m){if(arguments.length!==1||i(t)!=="string"||/\d/.test(t)||(n=t,t=void 0),t=t||new Date,t instanceof Date||(t=new Date(t)),isNaN(t))throw TypeError("Invalid date");n=String(l.masks[n]||n||l.masks.default);var v=n.slice(0,4);v!=="UTC:"&&v!=="GMT:"||(n=n.slice(4),c=!0,v==="GMT:"&&(m=!0));var b=c?"getUTC":"get",E=t[b+"Date"](),g=t[b+"Day"](),y=t[b+"Month"](),C=t[b+"FullYear"](),d=t[b+"Hours"](),_=t[b+"Minutes"](),O=t[b+"Seconds"](),A=t[b+"Milliseconds"](),P=c?0:t.getTimezoneOffset(),I=u(t),W=o(t),K={d:E,dd:p(E),ddd:l.i18n.dayNames[g],dddd:l.i18n.dayNames[g+7],m:y+1,mm:p(y+1),mmm:l.i18n.monthNames[y],mmmm:l.i18n.monthNames[y+12],yy:String(C).slice(2),yyyy:C,h:d%12||12,hh:p(d%12||12),H:d,HH:p(d),M:_,MM:p(_),s:O,ss:p(O),l:p(A,3),L:p(Math.round(A/10)),t:d<12?"a":"p",tt:d<12?"am":"pm",T:d<12?"A":"P",TT:d<12?"AM":"PM",Z:m?"GMT":c?"UTC":(String(t).match(h)||[""]).pop().replace(r,""),o:(P>0?"-":"+")+p(100*Math.floor(Math.abs(P)/60)+Math.abs(P)%60,4),S:["th","st","nd","rd"][E%10>3?0:(E%100-E%10!=10)*E%10],W:I,N:W};return n.replace(s,function(te){return te in K?K[te]:te.slice(1,te.length-1)})}}();l.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"},l.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 j=="function"&&j.amd?j(function(){return l}):(x===void 0?"undefined":(0,w.default)(x))==="object"?D.exports=l:f.dateFormat=l}(void 0)},{"babel-runtime/helpers/typeof":32}],155:[function(S,D,x){(function(T){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 f(i){var l=this.useColors;if(i[0]=(l?"%c":"")+this.namespace+(l?" %c":" ")+i[0]+(l?"%c ":" ")+"+"+x.humanize(this.diff),l){var s="color: "+this.color;i.splice(1,0,s,"color: inherit");var h=0,r=0;i[0].replace(/%[a-zA-Z%]/g,function(t){t!=="%%"&&(h++,t==="%c"&&(r=h))}),i.splice(r,0,s)}}function p(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function u(i){try{i==null?x.storage.removeItem("debug"):x.storage.debug=i}catch(l){}}function o(){var i;try{i=x.storage.debug}catch(l){}return!i&&T!==void 0&&"env"in T&&(i=T.env.DEBUG),i}x=D.exports=S("./debug"),x.log=p,x.formatArgs=f,x.save=u,x.load=o,x.useColors=w,x.storage=typeof chrome!="undefined"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch(i){}}(),x.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],x.formatters.j=function(i){try{return JSON.stringify(i)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}},x.enable(o())}).call(this,S("_process"))},{"./debug":156,_process:173}],156:[function(S,D,x){function T(l){var s,h=0;for(s in l)h=(h<<5)-h+l.charCodeAt(s),h|=0;return x.colors[Math.abs(h)%x.colors.length]}function w(l){function s(){if(s.enabled){var h=s,r=+new Date,t=r-(i||r);h.diff=t,h.prev=i,h.curr=r,i=r;for(var n=new Array(arguments.length),c=0;c<n.length;c++)n[c]=arguments[c];n[0]=x.coerce(n[0]),typeof n[0]!="string"&&n.unshift("%O");var m=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,function(v,b){if(v==="%%")return v;m++;var E=x.formatters[b];if(typeof E=="function"){var g=n[m];v=E.call(h,g),n.splice(m,1),m--}return v}),x.formatArgs.call(h,n),(s.log||x.log||console.log.bind(console)).apply(h,n)}}return s.namespace=l,s.enabled=x.enabled(l),s.useColors=x.useColors(),s.color=T(l),typeof x.init=="function"&&x.init(s),s}function f(l){x.save(l),x.names=[],x.skips=[];for(var s=(typeof l=="string"?l:"").split(/[\s,]+/),h=s.length,r=0;r<h;r++)s[r]&&(l=s[r].replace(/\*/g,".*?"),l[0]==="-"?x.skips.push(new RegExp("^"+l.substr(1)+"$")):x.names.push(new RegExp("^"+l+"$")))}function p(){x.enable("")}function u(l){var s,h;for(s=0,h=x.skips.length;s<h;s++)if(x.skips[s].test(l))return!1;for(s=0,h=x.names.length;s<h;s++)if(x.names[s].test(l))return!0;return!1}function o(l){return l instanceof Error?l.stack||l.message:l}x=D.exports=w.debug=w.default=w,x.coerce=o,x.disable=p,x.enable=f,x.enabled=u,x.humanize=S("ms"),x.names=[],x.skips=[],x.formatters={};var i},{ms:169}],157:[function(S,D,x){"use strict";function T(f){var p=""+f,u=w.exec(p);if(!u)return p;var o,i="",l=0,s=0;for(l=u.index;l<p.length;l++){switch(p.charCodeAt(l)){case 34:o=""";break;case 38:o="&";break;case 39:o="'";break;case 60:o="<";break;case 62:o=">";break;default:continue}s!==l&&(i+=p.substring(s,l)),s=l+1,i+=o}return s!==l?i+p.substring(s,l):i}var w=/["'&<>]/;D.exports=T},{}],158:[function(S,D,x){function T(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function w(o){return typeof o=="function"}function f(o){return typeof o=="number"}function p(o){return typeof o=="object"&&o!==null}function u(o){return o===void 0}D.exports=T,T.EventEmitter=T,T.prototype._events=void 0,T.prototype._maxListeners=void 0,T.defaultMaxListeners=10,T.prototype.setMaxListeners=function(o){if(!f(o)||o<0||isNaN(o))throw TypeError("n must be a positive number");return this._maxListeners=o,this},T.prototype.emit=function(o){var i,l,s,h,r,t;if(this._events||(this._events={}),o==="error"&&(!this._events.error||p(this._events.error)&&!this._events.error.length)){if((i=arguments[1])instanceof Error)throw i;var n=new Error('Uncaught, unspecified "error" event. ('+i+")");throw n.context=i,n}if(l=this._events[o],u(l))return!1;if(w(l))switch(arguments.length){case 1:l.call(this);break;case 2:l.call(this,arguments[1]);break;case 3:l.call(this,arguments[1],arguments[2]);break;default:h=Array.prototype.slice.call(arguments,1),l.apply(this,h)}else if(p(l))for(h=Array.prototype.slice.call(arguments,1),t=l.slice(),s=t.length,r=0;r<s;r++)t[r].apply(this,h);return!0},T.prototype.addListener=function(o,i){var l;if(!w(i))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",o,w(i.listener)?i.listener:i),this._events[o]?p(this._events[o])?this._events[o].push(i):this._events[o]=[this._events[o],i]:this._events[o]=i,p(this._events[o])&&!this._events[o].warned&&(l=u(this._maxListeners)?T.defaultMaxListeners:this._maxListeners)&&l>0&&this._events[o].length>l&&(this._events[o].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[o].length),typeof console.trace=="function"&&console.trace()),this},T.prototype.on=T.prototype.addListener,T.prototype.once=function(o,i){function l(){this.removeListener(o,l),s||(s=!0,i.apply(this,arguments))}if(!w(i))throw TypeError("listener must be a function");var s=!1;return l.listener=i,this.on(o,l),this},T.prototype.removeListener=function(o,i){var l,s,h,r;if(!w(i))throw TypeError("listener must be a function");if(!this._events||!this._events[o])return this;if(l=this._events[o],h=l.length,s=-1,l===i||w(l.listener)&&l.listener===i)delete this._events[o],this._events.removeListener&&this.emit("removeListener",o,i);else if(p(l)){for(r=h;r-- >0;)if(l[r]===i||l[r].listener&&l[r].listener===i){s=r;break}if(s<0)return this;l.length===1?(l.length=0,delete this._events[o]):l.splice(s,1),this._events.removeListener&&this.emit("removeListener",o,i)}return this},T.prototype.removeAllListeners=function(o){var i,l;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[o]&&delete this._events[o],this;if(arguments.length===0){for(i in this._events)i!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events={},this}if(l=this._events[o],w(l))this.removeListener(o,l);else if(l)for(;l.length;)this.removeListener(o,l[l.length-1]);return delete this._events[o],this},T.prototype.listeners=function(o){return this._events&&this._events[o]?w(this._events[o])?[this._events[o]]:this._events[o].slice():[]},T.prototype.listenerCount=function(o){if(this._events){var i=this._events[o];if(w(i))return 1;if(i)return i.length}return 0},T.listenerCount=function(o,i){return o.listenerCount(i)}},{}],159:[function(S,D,x){var T=S("http"),w=D.exports;for(var f in T)T.hasOwnProperty(f)&&(w[f]=T[f]);w.request=function(p,u){return p||(p={}),p.scheme="https",p.protocol="https:",T.request.call(this,p,u)}},{http:196}],160:[function(S,D,x){"use strict";var T=S("util"),w=S("ms");D.exports=function(f){if(typeof f=="number")return f;var p=w(f);if(p===void 0){var u=new Error(T.format("humanize-ms(%j) result undefined",f));console.warn(u.stack)}return p}},{ms:169,util:207}],161:[function(S,D,x){x.read=function(T,w,f,p,u){var o,i,l=8*u-p-1,s=(1<<l)-1,h=s>>1,r=-7,t=f?u-1:0,n=f?-1:1,c=T[w+t];for(t+=n,o=c&(1<<-r)-1,c>>=-r,r+=l;r>0;o=256*o+T[w+t],t+=n,r-=8);for(i=o&(1<<-r)-1,o>>=-r,r+=p;r>0;i=256*i+T[w+t],t+=n,r-=8);if(o===0)o=1-h;else{if(o===s)return i?NaN:1/0*(c?-1:1);i+=Math.pow(2,p),o-=h}return(c?-1:1)*i*Math.pow(2,o-p)},x.write=function(T,w,f,p,u,o){var i,l,s,h=8*o-u-1,r=(1<<h)-1,t=r>>1,n=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,c=p?0:o-1,m=p?1:-1,v=w<0||w===0&&1/w<0?1:0;for(w=Math.abs(w),isNaN(w)||w===1/0?(l=isNaN(w)?1:0,i=r):(i=Math.floor(Math.log(w)/Math.LN2),w*(s=Math.pow(2,-i))<1&&(i--,s*=2),w+=i+t>=1?n/s:n*Math.pow(2,1-t),w*s>=2&&(i++,s/=2),i+t>=r?(l=0,i=r):i+t>=1?(l=(w*s-1)*Math.pow(2,u),i+=t):(l=w*Math.pow(2,t-1)*Math.pow(2,u),i=0));u>=8;T[f+c]=255&l,c+=m,l/=256,u-=8);for(i=i<<u|l,h+=u;h>0;T[f+c]=255&i,c+=m,i/=256,h-=8);T[f+c-m]|=128*v}},{}],162:[function(S,D,x){typeof Object.create=="function"?D.exports=function(T,w){T.super_=w,T.prototype=Object.create(w.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}})}:D.exports=function(T,w){T.super_=w;var f=function(){};f.prototype=w.prototype,T.prototype=new f,T.prototype.constructor=T}},{}],163:[function(S,D,x){function T(f){return!!f.constructor&&typeof f.constructor.isBuffer=="function"&&f.constructor.isBuffer(f)}function w(f){return typeof f.readFloatLE=="function"&&typeof f.slice=="function"&&T(f.slice(0,0))}D.exports=function(f){return f!=null&&(T(f)||w(f)||!!f._isBuffer)}},{}],164:[function(S,D,x){!function(T){function w(u){return p.call(u).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}function f(u){return typeof u=="function"&&(/^class(\s|\{\}$)/.test(p.call(u))||/^.*classCallCheck\(/.test(w(u)))}var p=Function.prototype.toString;x!==void 0?(D!==void 0&&D.exports&&(x=D.exports=f),x.isClass=f):typeof j=="function"&&j.amd?j([],function(){return f}):T.isClass=f}(this)},{}],165:[function(S,D,x){"use strict";function T(o){var i=o.slice(2);return i=i[0].toLowerCase()+i.slice(1)}var w=S("core-util-is"),f=S("isstream"),p=S("is-class");Object.keys(w).map(function(o){x[T(o)]=w[o]}),x.stream=f,x.readableStream=f.isReadable,x.writableStream=f.isWritable,x.duplexStream=f.isDuplex,x.class=p,x.finite=function(o){return Number.isFinite(o)},x.NaN=function(o){return Number.isNaN(o)},x.generator=function(o){return o&&typeof o.next=="function"&&typeof o.throw=="function"},x.generatorFunction=function(o){return o&&o.constructor&&o.constructor.name==="GeneratorFunction"},x.asyncFunction=function(o){return o&&o.constructor&&o.constructor.name==="AsyncFunction"},x.promise=function(o){return o&&typeof o.then=="function"};var u=Math.pow(2,31);x.int=function(o){return w.isNumber(o)&&o%1==0},x.int32=function(o){return x.int(o)&&o<u&&o>=-u},x.long=function(o){return x.int(o)&&(o>=u||o<-u)},x.Long=function(o){return x.object(o)&&x.number(o.high)&&x.number(o.low)},x.double=function(o){return w.isNumber(o)&&!isNaN(o)&&o%1!=0},x.date=function(o){return o instanceof Date},x.regExp=function(o){return o instanceof RegExp},x.regexp=x.regExp,x.error=function(o){return o instanceof Error},x.array=function(o){return Array.isArray(o)}},{"core-util-is":153,"is-class":164,isstream:167}],166:[function(S,D,x){var T={}.toString;D.exports=Array.isArray||function(w){return T.call(w)=="[object Array]"}},{}],167:[function(S,D,x){function T(o){return o instanceof u.Stream}function w(o){return T(o)&&typeof o._read=="function"&&typeof o._readableState=="object"}function f(o){return T(o)&&typeof o._write=="function"&&typeof o._writableState=="object"}function p(o){return w(o)&&f(o)}var u=S("stream");D.exports=T,D.exports.isReadable=w,D.exports.isWritable=f,D.exports.isDuplex=p},{stream:195}],168:[function(S,D,x){"use strict";function T(f,p,u){if(!f)throw new TypeError("argument dest is required");if(!p)throw new TypeError("argument src is required");return u===void 0&&(u=!0),Object.getOwnPropertyNames(p).forEach(function(o){if(u||!w.call(f,o)){var i=Object.getOwnPropertyDescriptor(p,o);Object.defineProperty(f,o,i)}}),f}D.exports=T;var w=Object.prototype.hasOwnProperty},{}],169:[function(S,D,x){function T(h){if(h=String(h),!(h.length>100)){var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(h);if(r){var t=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return t*s;case"days":case"day":case"d":return t*l;case"hours":case"hour":case"hrs":case"hr":case"h":return t*i;case"minutes":case"minute":case"mins":case"min":case"m":return t*o;case"seconds":case"second":case"secs":case"sec":case"s":return t*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function w(h){return h>=l?Math.round(h/l)+"d":h>=i?Math.round(h/i)+"h":h>=o?Math.round(h/o)+"m":h>=u?Math.round(h/u)+"s":h+"ms"}function f(h){return p(h,l,"day")||p(h,i,"hour")||p(h,o,"minute")||p(h,u,"second")||h+" ms"}function p(h,r,t){if(!(h<r))return h<1.5*r?Math.floor(h/r)+" "+t:Math.ceil(h/r)+" "+t+"s"}var u=1e3,o=60*u,i=60*o,l=24*i,s=365.25*l;D.exports=function(h,r){r=r||{};var t=typeof h;if(t==="string"&&h.length>0)return T(h);if(t==="number"&&isNaN(h)===!1)return r.long?f(h):w(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))}},{}],170:[function(S,D,x){(function(T){function w(o,i){for(var l=0,s=o.length-1;s>=0;s--){var h=o[s];h==="."?o.splice(s,1):h===".."?(o.splice(s,1),l++):l&&(o.splice(s,1),l--)}if(i)for(;l--;l)o.unshift("..");return o}function f(o){typeof o!="string"&&(o+="");var i,l=0,s=-1,h=!0;for(i=o.length-1;i>=0;--i)if(o.charCodeAt(i)===47){if(!h){l=i+1;break}}else s===-1&&(h=!1,s=i+1);return s===-1?"":o.slice(l,s)}function p(o,i){if(o.filter)return o.filter(i);for(var l=[],s=0;s<o.length;s++)i(o[s],s,o)&&l.push(o[s]);return l}x.resolve=function(){for(var o="",i=!1,l=arguments.length-1;l>=-1&&!i;l--){var s=l>=0?arguments[l]:T.cwd();if(typeof s!="string")throw new TypeError("Arguments to path.resolve must be strings");s&&(o=s+"/"+o,i=s.charAt(0)==="/")}return o=w(p(o.split("/"),function(h){return!!h}),!i).join("/"),(i?"/":"")+o||"."},x.normalize=function(o){var i=x.isAbsolute(o),l=u(o,-1)==="/";return o=w(p(o.split("/"),function(s){return!!s}),!i).join("/"),o||i||(o="."),o&&l&&(o+="/"),(i?"/":"")+o},x.isAbsolute=function(o){return o.charAt(0)==="/"},x.join=function(){var o=Array.prototype.slice.call(arguments,0);return x.normalize(p(o,function(i,l){if(typeof i!="string")throw new TypeError("Arguments to path.join must be strings");return i}).join("/"))},x.relative=function(o,i){function l(m){for(var v=0;v<m.length&&m[v]==="";v++);for(var b=m.length-1;b>=0&&m[b]==="";b--);return v>b?[]:m.slice(v,b-v+1)}o=x.resolve(o).substr(1),i=x.resolve(i).substr(1);for(var s=l(o.split("/")),h=l(i.split("/")),r=Math.min(s.length,h.length),t=r,n=0;n<r;n++)if(s[n]!==h[n]){t=n;break}for(var c=[],n=t;n<s.length;n++)c.push("..");return c=c.concat(h.slice(t)),c.join("/")},x.sep="/",x.delimiter=":",x.dirname=function(o){if(typeof o!="string"&&(o+=""),o.length===0)return".";for(var i=o.charCodeAt(0),l=i===47,s=-1,h=!0,r=o.length-1;r>=1;--r)if((i=o.charCodeAt(r))===47){if(!h){s=r;break}}else h=!1;return s===-1?l?"/":".":l&&s===1?"/":o.slice(0,s)},x.basename=function(o,i){var l=f(o);return i&&l.substr(-1*i.length)===i&&(l=l.substr(0,l.length-i.length)),l},x.extname=function(o){typeof o!="string"&&(o+="");for(var i=-1,l=0,s=-1,h=!0,r=0,t=o.length-1;t>=0;--t){var n=o.charCodeAt(t);if(n!==47)s===-1&&(h=!1,s=t+1),n===46?i===-1?i=t:r!==1&&(r=1):i!==-1&&(r=-1);else if(!h){l=t+1;break}}return i===-1||s===-1||r===0||r===1&&i===s-1&&i===l+1?"":o.slice(i,s)};var u="ab".substr(-1)==="b"?function(o,i,l){return o.substr(i,l)}:function(o,i,l){return i<0&&(i=o.length+i),o.substr(i,l)}}).call(this,S("_process"))},{_process:173}],171:[function(S,D,x){(function(T){(function(){"use strict";function w(O){return O=String(O),O.charAt(0).toUpperCase()+O.slice(1)}function f(O,A,P){var I={"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 A&&P&&/^Win/i.test(O)&&!/^Windows Phone /i.test(O)&&(I=I[/[\d.]+$/.exec(O)])&&(O="Windows "+I),O=String(O),A&&P&&(O=O.replace(RegExp(A,"i"),P)),O=u(O.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 p(O,A){var P=-1,I=O?O.length:0;if(typeof I=="number"&&I>-1&&I<=E)for(;++P<I;)A(O[P],P,O);else o(O,A)}function u(O){return O=r(O),/^(?:webOS|i(?:OS|P))/.test(O)?O:w(O)}function o(O,A){for(var P in O)C.call(O,P)&&A(O[P],P,O)}function i(O){return O==null?w(O):d.call(O).slice(8,-1)}function l(O,A){var P=O!=null?typeof O[A]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(P)||P=="object"&&!O[A])}function s(O){return String(O).replace(/([ -])(?!$)/g,"$1?")}function h(O,A){var P=null;return p(O,function(I,W){P=A(P,I,W,O)}),P}function r(O){return String(O).replace(/^ +| +$/g,"")}function t(O){function A(q){return h(q,function(Y,J){var be=J.pattern||s(J);return!Y&&(Y=RegExp("\\b"+be+" *\\d+[.\\w_]*","i").exec(O)||RegExp("\\b"+be+" *\\w+-[\\w]*","i").exec(O)||RegExp("\\b"+be+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(O))&&((Y=String(J.label&&!RegExp(be,"i").test(J.label)?J.label:Y).split("/"))[1]&&!/[\d.]+/.test(Y[0])&&(Y[0]+=" "+Y[1]),J=J.label||J,Y=u(Y[0].replace(RegExp(be,"i"),J).replace(RegExp("; *(?:"+J+"[_-])?","i")," ").replace(RegExp("("+J+")[-_.]?(\\w)","i"),"$1 $2"))),Y})}function P(){return this.description||""}var I=c,W=O&&typeof O=="object"&&i(O)!="String";W&&(I=O,O=null);var K=I.navigator||{},te=K.userAgent||"";O||(O=te);var H,G,V=W?!!K.likeChrome:/\bChrome\b/.test(O)&&!/internal|\n/i.test(d.toString()),re=W?"Object":"ScriptBridgingProxyObject",$=W?"Object":"Environment",ne=W&&I.java?"JavaPackage":i(I.java),he=W?"Object":"RuntimeObject",pe=/\bJava/.test(ne)&&I.java,Te=pe&&i(I.environment)==$,we=pe?"a":"\u4F2A",Me=pe?"b":"\u5C3E",Ee=I.document||{},xe=I.operamini||I.opera,Ge=g.test(Ge=W&&xe?xe["[[Class]]"]:i(xe))?Ge:xe=null,je=O,We=[],ze=null,de=O==te,le=de&&xe&&typeof xe.version=="function"&&xe.version(),Oe=function(q){return h(q,function(Y,J){return Y||RegExp("\\b"+(J.pattern||s(J))+"\\b","i").exec(O)&&(J.label||J)})}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),Ie=function(q){return h(q,function(Y,J){return Y||RegExp("\\b"+(J.pattern||s(J))+"\\b","i").exec(O)&&(J.label||J)})}(["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"]),qe=A([{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"]),ee=function(q){return h(q,function(Y,J,be){return Y||(J[qe]||J[/^[a-z]+(?: +[a-z]+\b)*/i.exec(qe)]||RegExp("\\b"+s(be)+"(?:\\b|\\w*\\d)","i").exec(O))&&be})}({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}}),k=function(q){return h(q,function(Y,J){var be=J.pattern||s(J);return!Y&&(Y=RegExp("\\b"+be+"(?:/[\\d.]+|[ \\w.]*)","i").exec(O))&&(Y=f(Y,be,J.label||J)),Y})}(["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(Oe&&(Oe=[Oe]),ee&&!qe&&(qe=A([ee])),(H=/\bGoogle TV\b/.exec(qe))&&(qe=H[0]),/\bSimulator\b/i.test(O)&&(qe=(qe?qe+" ":"")+"Simulator"),Ie=="Opera Mini"&&/\bOPiOS\b/.test(O)&&We.push("running in Turbo/Uncompressed mode"),Ie=="IE"&&/\blike iPhone OS\b/.test(O)?(H=t(O.replace(/like iPhone OS/,"")),ee=H.manufacturer,qe=H.product):/^iP/.test(qe)?(Ie||(Ie="Safari"),k="iOS"+((H=/ OS ([\d_]+)/i.exec(O))?" "+H[1].replace(/_/g,"."):"")):Ie!="Konqueror"||/buntu/i.test(k)?ee&&ee!="Google"&&(/Chrome/.test(Ie)&&!/\bMobile Safari\b/i.test(O)||/\bVita\b/.test(qe))||/\bAndroid\b/.test(k)&&/^Chrome/.test(Ie)&&/\bVersion\//i.test(O)?(Ie="Android Browser",k=/\bAndroid\b/.test(k)?k:"Android"):Ie=="Silk"?(/\bMobi/i.test(O)||(k="Android",We.unshift("desktop mode")),/Accelerated *= *true/i.test(O)&&We.unshift("accelerated")):Ie=="PaleMoon"&&(H=/\bFirefox\/([\d.]+)\b/.exec(O))?We.push("identifying as Firefox "+H[1]):Ie=="Firefox"&&(H=/\b(Mobile|Tablet|TV)\b/i.exec(O))?(k||(k="Firefox OS"),qe||(qe=H[1])):!Ie||(H=!/\bMinefield\b/i.test(O)&&/\b(?:Firefox|Safari)\b/.exec(Ie))?(Ie&&!qe&&/[\/,]|^[^(]+?\)/.test(O.slice(O.indexOf(H+"/")+8))&&(Ie=null),(H=qe||ee||k)&&(qe||ee||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(k))&&(Ie=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(k)?k:H)+" Browser")):Ie=="Electron"&&(H=(/\bChrome\/([\d.]+)\b/.exec(O)||0)[1])&&We.push("Chromium "+H):k="Kubuntu",le||(le=function(q){return h(q,function(Y,J){return Y||(RegExp(J+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(O)||0)[1]||null})}(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",s(Ie),"(?:Firefox|Minefield|NetFront)"])),(H=Oe=="iCab"&&parseFloat(le)>3&&"WebKit"||/\bOpera\b/.test(Ie)&&(/\bOPR\b/.test(O)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(O)&&!/^(?:Trident|EdgeHTML)$/.test(Oe)&&"WebKit"||!Oe&&/\bMSIE\b/i.test(O)&&(k=="Mac OS"?"Tasman":"Trident")||Oe=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(Ie)&&"NetFront")&&(Oe=[H]),Ie=="IE"&&(H=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(O)||0)[1])?(Ie+=" Mobile",k="Windows Phone "+(/\+$/.test(H)?H:H+".x"),We.unshift("desktop mode")):/\bWPDesktop\b/i.test(O)?(Ie="IE Mobile",k="Windows Phone 8.x",We.unshift("desktop mode"),le||(le=(/\brv:([\d.]+)/.exec(O)||0)[1])):Ie!="IE"&&Oe=="Trident"&&(H=/\brv:([\d.]+)/.exec(O))&&(Ie&&We.push("identifying as "+Ie+(le?" "+le:"")),Ie="IE",le=H[1]),de){if(l(I,"global"))if(pe&&(H=pe.lang.System,je=H.getProperty("os.arch"),k=k||H.getProperty("os.name")+" "+H.getProperty("os.version")),Te){try{le=I.require("ringo/engine").version.join("."),Ie="RingoJS"}catch(q){(H=I.system)&&H.global.system==I.system&&(Ie="Narwhal",k||(k=H[0].os||null))}Ie||(Ie="Rhino")}else typeof I.process=="object"&&!I.process.browser&&(H=I.process)&&(typeof H.versions=="object"&&(typeof H.versions.electron=="string"?(We.push("Node "+H.versions.node),Ie="Electron",le=H.versions.electron):typeof H.versions.nw=="string"&&(We.push("Chromium "+le,"Node "+H.versions.node),Ie="NW.js",le=H.versions.nw)),Ie||(Ie="Node.js",je=H.arch,k=H.platform,le=/[\d.]+/.exec(H.version),le=le?le[0]:null));else i(H=I.runtime)==re?(Ie="Adobe AIR",k=H.flash.system.Capabilities.os):i(H=I.phantom)==he?(Ie="PhantomJS",le=(H=H.version||null)&&H.major+"."+H.minor+"."+H.patch):typeof Ee.documentMode=="number"&&(H=/\bTrident\/(\d+)/i.exec(O))?(le=[le,Ee.documentMode],(H=+H[1]+4)!=le[1]&&(We.push("IE "+le[1]+" mode"),Oe&&(Oe[1]=""),le[1]=H),le=Ie=="IE"?String(le[1].toFixed(1)):le[0]):typeof Ee.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(Ie)&&(We.push("masking as "+Ie+" "+le),Ie="IE",le="11.0",Oe=["Trident"],k="Windows");k=k&&u(k)}if(le&&(H=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(le)||/(?:alpha|beta)(?: ?\d)?/i.exec(O+";"+(de&&K.appMinorVersion))||/\bMinefield\b/i.test(O)&&"a")&&(ze=/b/i.test(H)?"beta":"alpha",le=le.replace(RegExp(H+"\\+?$"),"")+(ze=="beta"?Me:we)+(/\d+\+?/.exec(H)||"")),Ie=="Fennec"||Ie=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(k))Ie="Firefox Mobile";else if(Ie=="Maxthon"&&le)le=le.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(qe))qe=="Xbox 360"&&(k=null),qe=="Xbox 360"&&/\bIEMobile\b/.test(O)&&We.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(Ie)&&(!Ie||qe||/Browser|Mobi/.test(Ie))||k!="Windows CE"&&!/Mobi/i.test(O))if(Ie=="IE"&&de)try{I.external===null&&We.unshift("platform preview")}catch(q){We.unshift("embedded")}else(/\bBlackBerry\b/.test(qe)||/\bBB10\b/.test(O))&&(H=(RegExp(qe.replace(/ +/g," *")+"/([.\\d]+)","i").exec(O)||0)[1]||le)?(H=[H,/BB10/.test(O)],k=(H[1]?(qe=null,ee="BlackBerry"):"Device Software")+" "+H[0],le=null):this!=o&&qe!="Wii"&&(de&&xe||/Opera/.test(Ie)&&/\b(?:MSIE|Firefox)\b/i.test(O)||Ie=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(k)||Ie=="IE"&&(k&&!/^Win/.test(k)&&le>5.5||/\bWindows XP\b/.test(k)&&le>8||le==8&&!/\bTrident\b/.test(O)))&&!g.test(H=t.call(o,O.replace(g,"")+";"))&&H.name&&(H="ing as "+H.name+((H=H.version)?" "+H:""),g.test(Ie)?(/\bIE\b/.test(H)&&k=="Mac OS"&&(k=null),H="identify"+H):(H="mask"+H,Ie=Ge?u(Ge.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(H)&&(k=null),de||(le=null)),Oe=["Presto"],We.push(H));else Ie+=" Mobile";(H=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(O)||0)[1])&&(H=[parseFloat(H.replace(/\.(\d)$/,".0$1")),H],Ie=="Safari"&&H[1].slice(-1)=="+"?(Ie="WebKit Nightly",ze="alpha",le=H[1].slice(0,-1)):le!=H[1]&&le!=(H[2]=(/\bSafari\/([\d.]+\+?)/i.exec(O)||0)[1])||(le=null),H[1]=(/\bChrome\/([\d.]+)/i.exec(O)||0)[1],H[0]==537.36&&H[2]==537.36&&parseFloat(H[1])>=28&&Oe=="WebKit"&&(Oe=["Blink"]),de&&(V||H[1])?(Oe&&(Oe[1]="like Chrome"),H=H[1]||(H=H[0],H<530?1:H<532?2:H<532.05?3:H<533?4:H<534.03?5:H<534.07?6:H<534.1?7:H<534.13?8:H<534.16?9:H<534.24?10:H<534.3?11:H<535.01?12:H<535.02?"13+":H<535.07?15:H<535.11?16:H<535.19?17:H<536.05?18:H<536.1?19:H<537.01?20:H<537.11?"21+":H<537.13?23:H<537.18?24:H<537.24?25:H<537.36?26:Oe!="Blink"?"27":"28")):(Oe&&(Oe[1]="like Safari"),H=H[0],H=H<400?1:H<500?2:H<526?3:H<533?4:H<534?"4+":H<535?5:H<537?6:H<538?7:H<601?8:"8"),Oe&&(Oe[1]+=" "+(H+=typeof H=="number"?".x":/[.+]/.test(H)?"":"+")),Ie=="Safari"&&(!le||parseInt(le)>45)&&(le=H)),Ie=="Opera"&&(H=/\bzbov|zvav$/.exec(k))?(Ie+=" ",We.unshift("desktop mode"),H=="zvav"?(Ie+="Mini",le=null):Ie+="Mobile",k=k.replace(RegExp(" *"+H+"$"),"")):Ie=="Safari"&&/\bChrome\b/.exec(Oe&&Oe[1])&&(We.unshift("desktop mode"),Ie="Chrome Mobile",le=null,/\bOS X\b/.test(k)?(ee="Apple",k="iOS 4.3+"):k=null),le&&le.indexOf(H=/[\d.]+$/.exec(k))==0&&O.indexOf("/"+H+"-")>-1&&(k=r(k.replace(H,""))),Oe&&!/\b(?:Avant|Nook)\b/.test(Ie)&&(/Browser|Lunascape|Maxthon/.test(Ie)||Ie!="Safari"&&/^iOS/.test(k)&&/\bSafari\b/.test(Oe[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(Ie)&&Oe[1])&&(H=Oe[Oe.length-1])&&We.push(H),We.length&&(We=["("+We.join("; ")+")"]),ee&&qe&&qe.indexOf(ee)<0&&We.push("on "+ee),qe&&We.push((/^on /.test(We[We.length-1])?"":"on ")+qe),k&&(H=/ ([\d.+]+)$/.exec(k),G=H&&k.charAt(k.length-H[0].length-1)=="/",k={architecture:32,family:H&&!G?k.replace(H[0],""):k,version:H?H[1]:null,toString:function(){var q=this.version;return this.family+(q&&!G?" "+q:"")+(this.architecture==64?" 64-bit":"")}}),(H=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(je))&&!/\bi686\b/i.test(je)?(k&&(k.architecture=64,k.family=k.family.replace(RegExp(" *"+H),"")),Ie&&(/\bWOW64\b/i.test(O)||de&&/\w(?:86|32)$/.test(K.cpuClass||K.platform)&&!/\bWin64; x64\b/i.test(O))&&We.unshift("32-bit")):k&&/^OS X/.test(k.family)&&Ie=="Chrome"&&parseFloat(le)>=39&&(k.architecture=64),O||(O=null);var U={};return U.description=O,U.layout=Oe&&Oe[0],U.manufacturer=ee,U.name=Ie,U.prerelease=ze,U.product=qe,U.ua=O,U.version=Ie&&le,U.os=k||{architecture:null,family:null,version:null,toString:function(){return"null"}},U.parse=t,U.toString=P,U.version&&We.unshift(le),U.name&&We.unshift(Ie),k&&Ie&&(k!=String(k).split(" ")[0]||k!=Ie.split(" ")[0]&&!qe)&&We.push(qe?"("+k+")":"on "+k),We.length&&(U.description=We.join(" ")),U}var n={function:!0,object:!0},c=n[typeof window]&&window||this,m=n[typeof x]&&x,v=n[typeof D]&&D&&!D.nodeType&&D,b=m&&v&&typeof T=="object"&&T;!b||b.global!==b&&b.window!==b&&b.self!==b||(c=b);var E=Math.pow(2,53)-1,g=/\bOpera/,y=Object.prototype,C=y.hasOwnProperty,d=y.toString,_=t();typeof j=="function"&&typeof j.amd=="object"&&j.amd?(c.platform=_,j(function(){return _})):m&&v?o(_,function(O,A){m[A]=O}):c.platform=_}).call(this)}).call(this,typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],172:[function(S,D,x){(function(T){"use strict";function w(f,p,u,o){if(typeof f!="function")throw new TypeError('"callback" argument must be a function');var i,l,s=arguments.length;switch(s){case 0:case 1:return T.nextTick(f);case 2:return T.nextTick(function(){f.call(null,p)});case 3:return T.nextTick(function(){f.call(null,p,u)});case 4:return T.nextTick(function(){f.call(null,p,u,o)});default:for(i=new Array(s-1),l=0;l<i.length;)i[l++]=arguments[l];return T.nextTick(function(){f.apply(null,i)})}}!T.version||T.version.indexOf("v0.")===0||T.version.indexOf("v1.")===0&&T.version.indexOf("v1.8.")!==0?D.exports={nextTick:w}:D.exports=T}).call(this,S("_process"))},{_process:173}],173:[function(S,D,x){function T(){throw new Error("setTimeout has not been defined")}function w(){throw new Error("clearTimeout has not been defined")}function f(v){if(s===setTimeout)return setTimeout(v,0);if((s===T||!s)&&setTimeout)return s=setTimeout,setTimeout(v,0);try{return s(v,0)}catch(b){try{return s.call(null,v,0)}catch(E){return s.call(this,v,0)}}}function p(v){if(h===clearTimeout)return clearTimeout(v);if((h===w||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(v);try{return h(v)}catch(b){try{return h.call(null,v)}catch(E){return h.call(this,v)}}}function u(){c&&t&&(c=!1,t.length?n=t.concat(n):m=-1,n.length&&o())}function o(){if(!c){var v=f(u);c=!0;for(var b=n.length;b;){for(t=n,n=[];++m<b;)t&&t[m].run();m=-1,b=n.length}t=null,c=!1,p(v)}}function i(v,b){this.fun=v,this.array=b}function l(){}var s,h,r=D.exports={};!function(){try{s=typeof setTimeout=="function"?setTimeout:T}catch(v){s=T}try{h=typeof clearTimeout=="function"?clearTimeout:w}catch(v){h=w}}();var t,n=[],c=!1,m=-1;r.nextTick=function(v){var b=new Array(arguments.length-1);if(arguments.length>1)for(var E=1;E<arguments.length;E++)b[E-1]=arguments[E];n.push(new i(v,b)),n.length!==1||c||f(o)},i.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=l,r.addListener=l,r.once=l,r.off=l,r.removeListener=l,r.removeAllListeners=l,r.emit=l,r.prependListener=l,r.prependOnceListener=l,r.listeners=function(v){return[]},r.binding=function(v){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(v){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},{}],174:[function(S,D,x){(function(T){!function(w){function f(ne){throw new RangeError(G[ne])}function p(ne,he){for(var pe=ne.length,Te=[];pe--;)Te[pe]=he(ne[pe]);return Te}function u(ne,he){var pe=ne.split("@"),Te="";return pe.length>1&&(Te=pe[0]+"@",ne=pe[1]),ne=ne.replace(H,"."),Te+p(ne.split("."),he).join(".")}function o(ne){for(var he,pe,Te=[],we=0,Me=ne.length;we<Me;)he=ne.charCodeAt(we++),he>=55296&&he<=56319&&we<Me?(pe=ne.charCodeAt(we++),(64512&pe)==56320?Te.push(((1023&he)<<10)+(1023&pe)+65536):(Te.push(he),we--)):Te.push(he);return Te}function i(ne){return p(ne,function(he){var pe="";return he>65535&&(he-=65536,pe+=$(he>>>10&1023|55296),he=56320|1023&he),pe+=$(he)}).join("")}function l(ne){return ne-48<10?ne-22:ne-65<26?ne-65:ne-97<26?ne-97:C}function s(ne,he){return ne+22+75*(ne<26)-((he!=0)<<5)}function h(ne,he,pe){var Te=0;for(ne=pe?re(ne/A):ne>>1,ne+=re(ne/he);ne>V*_>>1;Te+=C)ne=re(ne/V);return re(Te+(V+1)*ne/(ne+O))}function r(ne){var he,pe,Te,we,Me,Ee,xe,Ge,je,We,ze=[],de=ne.length,le=0,Oe=I,Ie=P;for(pe=ne.lastIndexOf(W),pe<0&&(pe=0),Te=0;Te<pe;++Te)ne.charCodeAt(Te)>=128&&f("not-basic"),ze.push(ne.charCodeAt(Te));for(we=pe>0?pe+1:0;we<de;){for(Me=le,Ee=1,xe=C;we>=de&&f("invalid-input"),Ge=l(ne.charCodeAt(we++)),(Ge>=C||Ge>re((y-le)/Ee))&&f("overflow"),le+=Ge*Ee,je=xe<=Ie?d:xe>=Ie+_?_:xe-Ie,!(Ge<je);xe+=C)We=C-je,Ee>re(y/We)&&f("overflow"),Ee*=We;he=ze.length+1,Ie=h(le-Me,he,Me==0),re(le/he)>y-Oe&&f("overflow"),Oe+=re(le/he),le%=he,ze.splice(le++,0,Oe)}return i(ze)}function t(ne){var he,pe,Te,we,Me,Ee,xe,Ge,je,We,ze,de,le,Oe,Ie,qe=[];for(ne=o(ne),de=ne.length,he=I,pe=0,Me=P,Ee=0;Ee<de;++Ee)(ze=ne[Ee])<128&&qe.push($(ze));for(Te=we=qe.length,we&&qe.push(W);Te<de;){for(xe=y,Ee=0;Ee<de;++Ee)(ze=ne[Ee])>=he&&ze<xe&&(xe=ze);for(le=Te+1,xe-he>re((y-pe)/le)&&f("overflow"),pe+=(xe-he)*le,he=xe,Ee=0;Ee<de;++Ee)if(ze=ne[Ee],ze<he&&++pe>y&&f("overflow"),ze==he){for(Ge=pe,je=C;We=je<=Me?d:je>=Me+_?_:je-Me,!(Ge<We);je+=C)Ie=Ge-We,Oe=C-We,qe.push($(s(We+Ie%Oe,0))),Ge=re(Ie/Oe);qe.push($(s(Ge,0))),Me=h(pe,le,Te==we),pe=0,++Te}++pe,++he}return qe.join("")}function n(ne){return u(ne,function(he){return K.test(he)?r(he.slice(4).toLowerCase()):he})}function c(ne){return u(ne,function(he){return te.test(he)?"xn--"+t(he):he})}var m=typeof x=="object"&&x&&!x.nodeType&&x,v=typeof D=="object"&&D&&!D.nodeType&&D,b=typeof T=="object"&&T;b.global!==b&&b.window!==b&&b.self!==b||(w=b);var E,g,y=2147483647,C=36,d=1,_=26,O=38,A=700,P=72,I=128,W="-",K=/^xn--/,te=/[^\x20-\x7E]/,H=/[\x2E\u3002\uFF0E\uFF61]/g,G={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=C-d,re=Math.floor,$=String.fromCharCode;if(E={version:"1.4.1",ucs2:{decode:o,encode:i},decode:r,encode:t,toASCII:c,toUnicode:n},typeof j=="function"&&typeof j.amd=="object"&&j.amd)j("punycode",function(){return E});else if(m&&v)if(D.exports==m)v.exports=E;else for(g in E)E.hasOwnProperty(g)&&(m[g]=E[g]);else w.punycode=E}(this)}).call(this,typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],175:[function(S,D,x){"use strict";function T(f,p){return Object.prototype.hasOwnProperty.call(f,p)}D.exports=function(f,p,u,o){p=p||"&",u=u||"=";var i={};if(typeof f!="string"||f.length===0)return i;var l=/\+/g;f=f.split(p);var s=1e3;o&&typeof o.maxKeys=="number"&&(s=o.maxKeys);var h=f.length;s>0&&h>s&&(h=s);for(var r=0;r<h;++r){var t,n,c,m,v=f[r].replace(l,"%20"),b=v.indexOf(u);b>=0?(t=v.substr(0,b),n=v.substr(b+1)):(t=v,n=""),c=decodeURIComponent(t),m=decodeURIComponent(n),T(i,c)?w(i[c])?i[c].push(m):i[c]=[i[c],m]:i[c]=m}return i};var w=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"}},{}],176:[function(S,D,x){"use strict";function T(u,o){if(u.map)return u.map(o);for(var i=[],l=0;l<u.length;l++)i.push(o(u[l],l));return i}var w=function(u){switch(typeof u){case"string":return u;case"boolean":return u?"true":"false";case"number":return isFinite(u)?u:"";default:return""}};D.exports=function(u,o,i,l){return o=o||"&",i=i||"=",u===null&&(u=void 0),typeof u=="object"?T(p(u),function(s){var h=encodeURIComponent(w(s))+i;return f(u[s])?T(u[s],function(r){return h+encodeURIComponent(w(r))}).join(o):h+encodeURIComponent(w(u[s]))}).join(o):l?encodeURIComponent(w(l))+i+encodeURIComponent(w(u)):""};var f=Array.isArray||function(u){return Object.prototype.toString.call(u)==="[object Array]"},p=Object.keys||function(u){var o=[];for(var i in u)Object.prototype.hasOwnProperty.call(u,i)&&o.push(i);return o}},{}],177:[function(S,D,x){"use strict";x.decode=x.parse=S("./decode"),x.encode=x.stringify=S("./encode")},{"./decode":175,"./encode":176}],178:[function(S,D,x){D.exports=S("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":179}],179:[function(S,D,x){"use strict";function T(c){if(!(this instanceof T))return new T(c);s.call(this,c),h.call(this,c),c&&c.readable===!1&&(this.readable=!1),c&&c.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,c&&c.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",w)}function w(){this.allowHalfOpen||this._writableState.ended||o.nextTick(f,this)}function f(c){c.end()}var p=S("babel-runtime/core-js/object/keys"),u=function(c){return c&&c.__esModule?c:{default:c}}(p),o=S("process-nextick-args"),i=u.default||function(c){var m=[];for(var v in c)m.push(v);return m};D.exports=T;var l=S("core-util-is");l.inherits=S("inherits");var s=S("./_stream_readable"),h=S("./_stream_writable");l.inherits(T,s);for(var r=i(h.prototype),t=0;t<r.length;t++){var n=r[t];T.prototype[n]||(T.prototype[n]=h.prototype[n])}Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(T.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(c){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=c,this._writableState.destroyed=c)}}),T.prototype._destroy=function(c,m){this.push(null),this.end(),o.nextTick(m,c)}},{"./_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(S,D,x){"use strict";function T(p){if(!(this instanceof T))return new T(p);w.call(this,p)}D.exports=T;var w=S("./_stream_transform"),f=S("core-util-is");f.inherits=S("inherits"),f.inherits(T,w),T.prototype._transform=function(p,u,o){o(null,p)}},{"./_stream_transform":182,"core-util-is":153,inherits:162}],181:[function(S,D,x){(function(T,w){"use strict";function f(de){return pe.from(de)}function p(de){return pe.isBuffer(de)||de instanceof Te}function u(de,le,Oe){if(typeof de.prependListener=="function")return de.prependListener(le,Oe);de._events&&de._events[le]?$(de._events[le])?de._events[le].unshift(Oe):de._events[le]=[Oe,de._events[le]]:de.on(le,Oe)}function o(de,le){re=re||S("./_stream_duplex"),de=de||{};var Oe=le instanceof re;this.objectMode=!!de.objectMode,Oe&&(this.objectMode=this.objectMode||!!de.readableObjectMode);var Ie=de.highWaterMark,qe=de.readableHighWaterMark,ee=this.objectMode?16:16384;this.highWaterMark=Ie||Ie===0?Ie:Oe&&(qe||qe===0)?qe:ee,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Ge,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=de.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,de.encoding&&(xe||(xe=S("string_decoder/").StringDecoder),this.decoder=new xe(de.encoding),this.encoding=de.encoding)}function i(de){if(re=re||S("./_stream_duplex"),!(this instanceof i))return new i(de);this._readableState=new o(de,this),this.readable=!0,de&&(typeof de.read=="function"&&(this._read=de.read),typeof de.destroy=="function"&&(this._destroy=de.destroy)),he.call(this)}function l(de,le,Oe,Ie,qe){var ee=de._readableState;if(le===null)ee.reading=!1,c(de,ee);else{var k;qe||(k=h(ee,le)),k?de.emit("error",k):ee.objectMode||le&&le.length>0?(typeof le=="string"||ee.objectMode||(0,G.default)(le)===pe.prototype||(le=f(le)),Ie?ee.endEmitted?de.emit("error",new Error("stream.unshift() after end event")):s(de,ee,le,!0):ee.ended?de.emit("error",new Error("stream.push() after EOF")):(ee.reading=!1,ee.decoder&&!Oe?(le=ee.decoder.write(le),ee.objectMode||le.length!==0?s(de,ee,le,!1):b(de,ee)):s(de,ee,le,!1))):Ie||(ee.reading=!1)}return r(ee)}function s(de,le,Oe,Ie){le.flowing&&le.length===0&&!le.sync?(de.emit("data",Oe),de.read(0)):(le.length+=le.objectMode?1:Oe.length,Ie?le.buffer.unshift(Oe):le.buffer.push(Oe),le.needReadable&&m(de)),b(de,le)}function h(de,le){var Oe;return p(le)||typeof le=="string"||le===void 0||de.objectMode||(Oe=new TypeError("Invalid non-string/buffer chunk")),Oe}function r(de){return!de.ended&&(de.needReadable||de.length<de.highWaterMark||de.length===0)}function t(de){return de>=ze?de=ze:(de--,de|=de>>>1,de|=de>>>2,de|=de>>>4,de|=de>>>8,de|=de>>>16,de++),de}function n(de,le){return de<=0||le.length===0&&le.ended?0:le.objectMode?1:de!==de?le.flowing&&le.length?le.buffer.head.data.length:le.length:(de>le.highWaterMark&&(le.highWaterMark=t(de)),de<=le.length?de:le.ended?le.length:(le.needReadable=!0,0))}function c(de,le){if(!le.ended){if(le.decoder){var Oe=le.decoder.end();Oe&&Oe.length&&(le.buffer.push(Oe),le.length+=le.objectMode?1:Oe.length)}le.ended=!0,m(de)}}function m(de){var le=de._readableState;le.needReadable=!1,le.emittedReadable||(Ee("emitReadable",le.flowing),le.emittedReadable=!0,le.sync?V.nextTick(v,de):v(de))}function v(de){Ee("emit readable"),de.emit("readable"),_(de)}function b(de,le){le.readingMore||(le.readingMore=!0,V.nextTick(E,de,le))}function E(de,le){for(var Oe=le.length;!le.reading&&!le.flowing&&!le.ended&&le.length<le.highWaterMark&&(Ee("maybeReadMore read 0"),de.read(0),Oe!==le.length);)Oe=le.length;le.readingMore=!1}function g(de){return function(){var le=de._readableState;Ee("pipeOnDrain",le.awaitDrain),le.awaitDrain&&le.awaitDrain--,le.awaitDrain===0&&ne(de,"data")&&(le.flowing=!0,_(de))}}function y(de){Ee("readable nexttick read 0"),de.read(0)}function C(de,le){le.resumeScheduled||(le.resumeScheduled=!0,V.nextTick(d,de,le))}function d(de,le){le.reading||(Ee("resume read 0"),de.read(0)),le.resumeScheduled=!1,le.awaitDrain=0,de.emit("resume"),_(de),le.flowing&&!le.reading&&de.read(0)}function _(de){var le=de._readableState;for(Ee("flow",le.flowing);le.flowing&&de.read()!==null;);}function O(de,le){if(le.length===0)return null;var Oe;return le.objectMode?Oe=le.buffer.shift():!de||de>=le.length?(Oe=le.decoder?le.buffer.join(""):le.buffer.length===1?le.buffer.head.data:le.buffer.concat(le.length),le.buffer.clear()):Oe=A(de,le.buffer,le.decoder),Oe}function A(de,le,Oe){var Ie;return de<le.head.data.length?(Ie=le.head.data.slice(0,de),le.head.data=le.head.data.slice(de)):Ie=de===le.head.data.length?le.shift():Oe?P(de,le):I(de,le),Ie}function P(de,le){var Oe=le.head,Ie=1,qe=Oe.data;for(de-=qe.length;Oe=Oe.next;){var ee=Oe.data,k=de>ee.length?ee.length:de;if(k===ee.length?qe+=ee:qe+=ee.slice(0,de),(de-=k)===0){k===ee.length?(++Ie,Oe.next?le.head=Oe.next:le.head=le.tail=null):(le.head=Oe,Oe.data=ee.slice(k));break}++Ie}return le.length-=Ie,qe}function I(de,le){var Oe=pe.allocUnsafe(de),Ie=le.head,qe=1;for(Ie.data.copy(Oe),de-=Ie.data.length;Ie=Ie.next;){var ee=Ie.data,k=de>ee.length?ee.length:de;if(ee.copy(Oe,Oe.length-de,0,k),(de-=k)===0){k===ee.length?(++qe,Ie.next?le.head=Ie.next:le.head=le.tail=null):(le.head=Ie,Ie.data=ee.slice(k));break}++qe}return le.length-=qe,Oe}function W(de){var le=de._readableState;if(le.length>0)throw new Error('"endReadable()" called on non-empty stream');le.endEmitted||(le.ended=!0,V.nextTick(K,le,de))}function K(de,le){de.endEmitted||de.length!==0||(de.endEmitted=!0,le.readable=!1,le.emit("end"))}function te(de,le){for(var Oe=0,Ie=de.length;Oe<Ie;Oe++)if(de[Oe]===le)return Oe;return-1}var H=S("babel-runtime/core-js/object/get-prototype-of"),G=function(de){return de&&de.__esModule?de:{default:de}}(H),V=S("process-nextick-args");D.exports=i;var re,$=S("isarray");i.ReadableState=o;var ne=(S("events").EventEmitter,function(de,le){return de.listeners(le).length}),he=S("./internal/streams/stream"),pe=S("safe-buffer").Buffer,Te=w.Uint8Array||function(){},we=S("core-util-is");we.inherits=S("inherits");var Me=S("util"),Ee=void 0;Ee=Me&&Me.debuglog?Me.debuglog("stream"):function(){};var xe,Ge=S("./internal/streams/BufferList"),je=S("./internal/streams/destroy");we.inherits(i,he);var We=["error","close","destroy","pause","resume"];Object.defineProperty(i.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(de){this._readableState&&(this._readableState.destroyed=de)}}),i.prototype.destroy=je.destroy,i.prototype._undestroy=je.undestroy,i.prototype._destroy=function(de,le){this.push(null),le(de)},i.prototype.push=function(de,le){var Oe,Ie=this._readableState;return Ie.objectMode?Oe=!0:typeof de=="string"&&(le=le||Ie.defaultEncoding,le!==Ie.encoding&&(de=pe.from(de,le),le=""),Oe=!0),l(this,de,le,!1,Oe)},i.prototype.unshift=function(de){return l(this,de,null,!0,!1)},i.prototype.isPaused=function(){return this._readableState.flowing===!1},i.prototype.setEncoding=function(de){return xe||(xe=S("string_decoder/").StringDecoder),this._readableState.decoder=new xe(de),this._readableState.encoding=de,this};var ze=8388608;i.prototype.read=function(de){Ee("read",de),de=parseInt(de,10);var le=this._readableState,Oe=de;if(de!==0&&(le.emittedReadable=!1),de===0&&le.needReadable&&(le.length>=le.highWaterMark||le.ended))return Ee("read: emitReadable",le.length,le.ended),le.length===0&&le.ended?W(this):m(this),null;if((de=n(de,le))===0&&le.ended)return le.length===0&&W(this),null;var Ie=le.needReadable;Ee("need readable",Ie),(le.length===0||le.length-de<le.highWaterMark)&&(Ie=!0,Ee("length less than watermark",Ie)),le.ended||le.reading?(Ie=!1,Ee("reading or ended",Ie)):Ie&&(Ee("do read"),le.reading=!0,le.sync=!0,le.length===0&&(le.needReadable=!0),this._read(le.highWaterMark),le.sync=!1,le.reading||(de=n(Oe,le)));var qe;return qe=de>0?O(de,le):null,qe===null?(le.needReadable=!0,de=0):le.length-=de,le.length===0&&(le.ended||(le.needReadable=!0),Oe!==de&&le.ended&&W(this)),qe!==null&&this.emit("data",qe),qe},i.prototype._read=function(de){this.emit("error",new Error("_read() is not implemented"))},i.prototype.pipe=function(de,le){function Oe(ht,Qe){Ee("onunpipe"),ht===J&&Qe&&Qe.hasUnpiped===!1&&(Qe.hasUnpiped=!0,qe())}function Ie(){Ee("onend"),de.end()}function qe(){Ee("cleanup"),de.removeListener("close",U),de.removeListener("finish",q),de.removeListener("drain",He),de.removeListener("error",k),de.removeListener("unpipe",Oe),J.removeListener("end",Ie),J.removeListener("end",Y),J.removeListener("data",ee),Be=!0,!be.awaitDrain||de._writableState&&!de._writableState.needDrain||He()}function ee(ht){Ee("ondata"),Ze=!1,de.write(ht)!==!1||Ze||((be.pipesCount===1&&be.pipes===de||be.pipesCount>1&&te(be.pipes,de)!==-1)&&!Be&&(Ee("false write response, pause",J._readableState.awaitDrain),J._readableState.awaitDrain++,Ze=!0),J.pause())}function k(ht){Ee("onerror",ht),Y(),de.removeListener("error",k),ne(de,"error")===0&&de.emit("error",ht)}function U(){de.removeListener("finish",q),Y()}function q(){Ee("onfinish"),de.removeListener("close",U),Y()}function Y(){Ee("unpipe"),J.unpipe(de)}var J=this,be=this._readableState;switch(be.pipesCount){case 0:be.pipes=de;break;case 1:be.pipes=[be.pipes,de];break;default:be.pipes.push(de)}be.pipesCount+=1,Ee("pipe count=%d opts=%j",be.pipesCount,le);var ke=(!le||le.end!==!1)&&de!==T.stdout&&de!==T.stderr,ct=ke?Ie:Y;be.endEmitted?V.nextTick(ct):J.once("end",ct),de.on("unpipe",Oe);var He=g(J);de.on("drain",He);var Be=!1,Ze=!1;return J.on("data",ee),u(de,"error",k),de.once("close",U),de.once("finish",q),de.emit("pipe",J),be.flowing||(Ee("pipe resume"),J.resume()),de},i.prototype.unpipe=function(de){var le=this._readableState,Oe={hasUnpiped:!1};if(le.pipesCount===0)return this;if(le.pipesCount===1)return de&&de!==le.pipes?this:(de||(de=le.pipes),le.pipes=null,le.pipesCount=0,le.flowing=!1,de&&de.emit("unpipe",this,Oe),this);if(!de){var Ie=le.pipes,qe=le.pipesCount;le.pipes=null,le.pipesCount=0,le.flowing=!1;for(var ee=0;ee<qe;ee++)Ie[ee].emit("unpipe",this,Oe);return this}var k=te(le.pipes,de);return k===-1?this:(le.pipes.splice(k,1),le.pipesCount-=1,le.pipesCount===1&&(le.pipes=le.pipes[0]),de.emit("unpipe",this,Oe),this)},i.prototype.on=function(de,le){var Oe=he.prototype.on.call(this,de,le);if(de==="data")this._readableState.flowing!==!1&&this.resume();else if(de==="readable"){var Ie=this._readableState;Ie.endEmitted||Ie.readableListening||(Ie.readableListening=Ie.needReadable=!0,Ie.emittedReadable=!1,Ie.reading?Ie.length&&m(this):V.nextTick(y,this))}return Oe},i.prototype.addListener=i.prototype.on,i.prototype.resume=function(){var de=this._readableState;return de.flowing||(Ee("resume"),de.flowing=!0,C(this,de)),this},i.prototype.pause=function(){return Ee("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Ee("pause"),this._readableState.flowing=!1,this.emit("pause")),this},i.prototype.wrap=function(de){var le=this,Oe=this._readableState,Ie=!1;de.on("end",function(){if(Ee("wrapped end"),Oe.decoder&&!Oe.ended){var k=Oe.decoder.end();k&&k.length&&le.push(k)}le.push(null)}),de.on("data",function(k){(Ee("wrapped data"),Oe.decoder&&(k=Oe.decoder.write(k)),(!Oe.objectMode||k!=null)&&(Oe.objectMode||k&&k.length))&&(le.push(k)||(Ie=!0,de.pause()))});for(var qe in de)this[qe]===void 0&&typeof de[qe]=="function"&&(this[qe]=function(k){return function(){return de[k].apply(de,arguments)}}(qe));for(var ee=0;ee<We.length;ee++)de.on(We[ee],this.emit.bind(this,We[ee]));return this._read=function(k){Ee("wrapped _read",k),Ie&&(Ie=!1,de.resume())},this},Object.defineProperty(i.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),i._fromList=O}).call(this,S("_process"),typeof ue!="undefined"?ue: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(S,D,x){"use strict";function T(i,l){var s=this._transformState;s.transforming=!1;var h=s.writecb;if(!h)return this.emit("error",new Error("write callback called multiple times"));s.writechunk=null,s.writecb=null,l!=null&&this.push(l),h(i);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}function w(i){if(!(this instanceof w))return new w(i);u.call(this,i),this._transformState={afterTransform:T.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,i&&(typeof i.transform=="function"&&(this._transform=i.transform),typeof i.flush=="function"&&(this._flush=i.flush)),this.on("prefinish",f)}function f(){var i=this;typeof this._flush=="function"?this._flush(function(l,s){p(i,l,s)}):p(this,null,null)}function p(i,l,s){if(l)return i.emit("error",l);if(s!=null&&i.push(s),i._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(i._transformState.transforming)throw new Error("Calling transform done when still transforming");return i.push(null)}D.exports=w;var u=S("./_stream_duplex"),o=S("core-util-is");o.inherits=S("inherits"),o.inherits(w,u),w.prototype.push=function(i,l){return this._transformState.needTransform=!1,u.prototype.push.call(this,i,l)},w.prototype._transform=function(i,l,s){throw new Error("_transform() is not implemented")},w.prototype._write=function(i,l,s){var h=this._transformState;if(h.writecb=s,h.writechunk=i,h.writeencoding=l,!h.transforming){var r=this._readableState;(h.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}},w.prototype._read=function(i){var l=this._transformState;l.writechunk!==null&&l.writecb&&!l.transforming?(l.transforming=!0,this._transform(l.writechunk,l.writeencoding,l.afterTransform)):l.needTransform=!0},w.prototype._destroy=function(i,l){var s=this;u.prototype._destroy.call(this,i,function(h){l(h),s.emit("close")})}},{"./_stream_duplex":179,"core-util-is":153,inherits:162}],183:[function(S,D,x){(function(T,w){"use strict";function f(je){return je&&je.__esModule?je:{default:je}}function p(je){var We=this;this.next=null,this.entry=null,this.finish=function(){P(We,je)}}function u(je){return Me.from(je)}function o(je){return Me.isBuffer(je)||je instanceof Ee}function i(){}function l(je,We){ne=ne||S("./_stream_duplex"),je=je||{};var ze=We instanceof ne;this.objectMode=!!je.objectMode,ze&&(this.objectMode=this.objectMode||!!je.writableObjectMode);var de=je.highWaterMark,le=je.writableHighWaterMark,Oe=this.objectMode?16:16384;this.highWaterMark=de||de===0?de:ze&&(le||le===0)?le:Oe,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 Ie=je.decodeStrings===!1;this.decodeStrings=!Ie,this.defaultEncoding=je.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(qe){b(We,qe)},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 p(this)}function s(je){if(ne=ne||S("./_stream_duplex"),!(Ge.call(s,this)||this instanceof ne))return new s(je);this._writableState=new l(je,this),this.writable=!0,je&&(typeof je.write=="function"&&(this._write=je.write),typeof je.writev=="function"&&(this._writev=je.writev),typeof je.destroy=="function"&&(this._destroy=je.destroy),typeof je.final=="function"&&(this._final=je.final)),we.call(this)}function h(je,We){var ze=new Error("write after end");je.emit("error",ze),$.nextTick(We,ze)}function r(je,We,ze,de){var le=!0,Oe=!1;return ze===null?Oe=new TypeError("May not write null values to stream"):typeof ze=="string"||ze===void 0||We.objectMode||(Oe=new TypeError("Invalid non-string/buffer chunk")),Oe&&(je.emit("error",Oe),$.nextTick(de,Oe),le=!1),le}function t(je,We,ze){return je.objectMode||je.decodeStrings===!1||typeof We!="string"||(We=Me.from(We,ze)),We}function n(je,We,ze,de,le,Oe){if(!ze){var Ie=t(We,de,le);de!==Ie&&(ze=!0,le="buffer",de=Ie)}var qe=We.objectMode?1:de.length;We.length+=qe;var ee=We.length<We.highWaterMark;if(ee||(We.needDrain=!0),We.writing||We.corked){var k=We.lastBufferedRequest;We.lastBufferedRequest={chunk:de,encoding:le,isBuf:ze,callback:Oe,next:null},k?k.next=We.lastBufferedRequest:We.bufferedRequest=We.lastBufferedRequest,We.bufferedRequestCount+=1}else c(je,We,!1,qe,de,le,Oe);return ee}function c(je,We,ze,de,le,Oe,Ie){We.writelen=de,We.writecb=Ie,We.writing=!0,We.sync=!0,ze?je._writev(le,We.onwrite):je._write(le,Oe,We.onwrite),We.sync=!1}function m(je,We,ze,de,le){--We.pendingcb,ze?($.nextTick(le,de),$.nextTick(O,je,We),je._writableState.errorEmitted=!0,je.emit("error",de)):(le(de),je._writableState.errorEmitted=!0,je.emit("error",de),O(je,We))}function v(je){je.writing=!1,je.writecb=null,je.length-=je.writelen,je.writelen=0}function b(je,We){var ze=je._writableState,de=ze.sync,le=ze.writecb;if(v(ze),We)m(je,ze,de,We,le);else{var Oe=C(ze);Oe||ze.corked||ze.bufferProcessing||!ze.bufferedRequest||y(je,ze),de?he(E,je,ze,Oe,le):E(je,ze,Oe,le)}}function E(je,We,ze,de){ze||g(je,We),We.pendingcb--,de(),O(je,We)}function g(je,We){We.length===0&&We.needDrain&&(We.needDrain=!1,je.emit("drain"))}function y(je,We){We.bufferProcessing=!0;var ze=We.bufferedRequest;if(je._writev&&ze&&ze.next){var de=We.bufferedRequestCount,le=new Array(de),Oe=We.corkedRequestsFree;Oe.entry=ze;for(var Ie=0,qe=!0;ze;)le[Ie]=ze,ze.isBuf||(qe=!1),ze=ze.next,Ie+=1;le.allBuffers=qe,c(je,We,!0,We.length,le,"",Oe.finish),We.pendingcb++,We.lastBufferedRequest=null,Oe.next?(We.corkedRequestsFree=Oe.next,Oe.next=null):We.corkedRequestsFree=new p(We),We.bufferedRequestCount=0}else{for(;ze;){var ee=ze.chunk,k=ze.encoding,U=ze.callback;if(c(je,We,!1,We.objectMode?1:ee.length,ee,k,U),ze=ze.next,We.bufferedRequestCount--,We.writing)break}ze===null&&(We.lastBufferedRequest=null)}We.bufferedRequest=ze,We.bufferProcessing=!1}function C(je){return je.ending&&je.length===0&&je.bufferedRequest===null&&!je.finished&&!je.writing}function d(je,We){je._final(function(ze){We.pendingcb--,ze&&je.emit("error",ze),We.prefinished=!0,je.emit("prefinish"),O(je,We)})}function _(je,We){We.prefinished||We.finalCalled||(typeof je._final=="function"?(We.pendingcb++,We.finalCalled=!0,$.nextTick(d,je,We)):(We.prefinished=!0,je.emit("prefinish")))}function O(je,We){var ze=C(We);return ze&&(_(je,We),We.pendingcb===0&&(We.finished=!0,je.emit("finish"))),ze}function A(je,We,ze){We.ending=!0,O(je,We),ze&&(We.finished?$.nextTick(ze):je.once("finish",ze)),We.ended=!0,je.writable=!1}function P(je,We,ze){var de=je.entry;for(je.entry=null;de;){var le=de.callback;We.pendingcb--,le(ze),de=de.next}We.corkedRequestsFree?We.corkedRequestsFree.next=je:We.corkedRequestsFree=je}var I=S("babel-runtime/core-js/object/define-property"),W=f(I),K=S("babel-runtime/core-js/symbol/has-instance"),te=f(K),H=S("babel-runtime/core-js/symbol"),G=f(H),V=S("babel-runtime/core-js/set-immediate"),re=f(V),$=S("process-nextick-args");D.exports=s;var ne,he=!T.browser&&["v0.10","v0.9."].indexOf(T.version.slice(0,5))>-1?re.default:$.nextTick;s.WritableState=l;var pe=S("core-util-is");pe.inherits=S("inherits");var Te={deprecate:S("util-deprecate")},we=S("./internal/streams/stream"),Me=S("safe-buffer").Buffer,Ee=w.Uint8Array||function(){},xe=S("./internal/streams/destroy");pe.inherits(s,we),l.prototype.getBuffer=function(){for(var je=this.bufferedRequest,We=[];je;)We.push(je),je=je.next;return We},function(){try{Object.defineProperty(l.prototype,"buffer",{get:Te.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(je){}}();var Ge;typeof G.default=="function"&&te.default&&typeof Function.prototype[te.default]=="function"?(Ge=Function.prototype[te.default],(0,W.default)(s,te.default,{value:function(je){return!!Ge.call(this,je)||this===s&&je&&je._writableState instanceof l}})):Ge=function(je){return je instanceof this},s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(je,We,ze){var de=this._writableState,le=!1,Oe=!de.objectMode&&o(je);return Oe&&!Me.isBuffer(je)&&(je=u(je)),typeof We=="function"&&(ze=We,We=null),Oe?We="buffer":We||(We=de.defaultEncoding),typeof ze!="function"&&(ze=i),de.ended?h(this,ze):(Oe||r(this,de,je,ze))&&(de.pendingcb++,le=n(this,de,Oe,je,We,ze)),le},s.prototype.cork=function(){this._writableState.corked++},s.prototype.uncork=function(){var je=this._writableState;je.corked&&(je.corked--,je.writing||je.corked||je.finished||je.bufferProcessing||!je.bufferedRequest||y(this,je))},s.prototype.setDefaultEncoding=function(je){if(typeof je=="string"&&(je=je.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((je+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+je);return this._writableState.defaultEncoding=je,this},Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),s.prototype._write=function(je,We,ze){ze(new Error("_write() is not implemented"))},s.prototype._writev=null,s.prototype.end=function(je,We,ze){var de=this._writableState;typeof je=="function"?(ze=je,je=null,We=null):typeof We=="function"&&(ze=We,We=null),je!=null&&this.write(je,We),de.corked&&(de.corked=1,this.uncork()),de.ending||de.finished||A(this,de,ze)},Object.defineProperty(s.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(je){this._writableState&&(this._writableState.destroyed=je)}}),s.prototype.destroy=xe.destroy,s.prototype._undestroy=xe.undestroy,s.prototype._destroy=function(je,We){this.end(),We(je)}}).call(this,S("_process"),typeof ue!="undefined"?ue: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(S,D,x){"use strict";function T(u,o){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")}function w(u,o,i){u.copy(o,i)}var f=S("safe-buffer").Buffer,p=S("util");D.exports=function(){function u(){T(this,u),this.head=null,this.tail=null,this.length=0}return u.prototype.push=function(o){var i={data:o,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},u.prototype.unshift=function(o){var i={data:o,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},u.prototype.shift=function(){if(this.length!==0){var o=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,o}},u.prototype.clear=function(){this.head=this.tail=null,this.length=0},u.prototype.join=function(o){if(this.length===0)return"";for(var i=this.head,l=""+i.data;i=i.next;)l+=o+i.data;return l},u.prototype.concat=function(o){if(this.length===0)return f.alloc(0);if(this.length===1)return this.head.data;for(var i=f.allocUnsafe(o>>>0),l=this.head,s=0;l;)w(l.data,i,s),s+=l.data.length,l=l.next;return i},u}(),p&&p.inspect&&p.inspect.custom&&(D.exports.prototype[p.inspect.custom]=function(){var u=p.inspect({length:this.length});return this.constructor.name+" "+u})},{"safe-buffer":193,util:36}],185:[function(S,D,x){"use strict";function T(u,o){var i=this,l=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return l||s?(o?o(u):!u||this._writableState&&this._writableState.errorEmitted||p.nextTick(f,this,u),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(u||null,function(h){!o&&h?(p.nextTick(f,i,h),i._writableState&&(i._writableState.errorEmitted=!0)):o&&o(h)}),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 f(u,o){u.emit("error",o)}var p=S("process-nextick-args");D.exports={destroy:T,undestroy:w}},{"process-nextick-args":172}],186:[function(S,D,x){"use strict";D.exports=S("events").EventEmitter},{events:158}],187:[function(S,D,x){D.exports=S("./readable").PassThrough},{"./readable":188}],188:[function(S,D,x){x=D.exports=S("./lib/_stream_readable.js"),x.Stream=x,x.Readable=x,x.Writable=S("./lib/_stream_writable.js"),x.Duplex=S("./lib/_stream_duplex.js"),x.Transform=S("./lib/_stream_transform.js"),x.PassThrough=S("./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(S,D,x){D.exports=S("./readable").Transform},{"./readable":188}],190:[function(S,D,x){D.exports=S("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":183}],191:[function(S,D,x){var T=function(){return this}()||Function("return this")(),w=T.regeneratorRuntime&&Object.getOwnPropertyNames(T).indexOf("regeneratorRuntime")>=0,f=w&&T.regeneratorRuntime;if(T.regeneratorRuntime=void 0,D.exports=S("./runtime"),w)T.regeneratorRuntime=f;else try{delete T.regeneratorRuntime}catch(p){T.regeneratorRuntime=void 0}},{"./runtime":192}],192:[function(S,D,x){!function(T){"use strict";function w(re,$,ne,he){var pe=$&&$.prototype instanceof p?$:p,Te=Object.create(pe.prototype),we=new n(he||[]);return Te._invoke=s(re,ne,we),Te}function f(re,$,ne){try{return{type:"normal",arg:re.call($,ne)}}catch(he){return{type:"throw",arg:he}}}function p(){}function u(){}function o(){}function i(re){["next","throw","return"].forEach(function($){re[$]=function(ne){return this._invoke($,ne)}})}function l(re){function $(pe,Te,we,Me){var Ee=f(re[pe],re,Te);if(Ee.type!=="throw"){var xe=Ee.arg,Ge=xe.value;return Ge&&typeof Ge=="object"&&E.call(Ge,"__await")?Promise.resolve(Ge.__await).then(function(je){$("next",je,we,Me)},function(je){$("throw",je,we,Me)}):Promise.resolve(Ge).then(function(je){xe.value=je,we(xe)},Me)}Me(Ee.arg)}function ne(pe,Te){function we(){return new Promise(function(Me,Ee){$(pe,Te,Me,Ee)})}return he=he?he.then(we,we):we()}var he;this._invoke=ne}function s(re,$,ne){var he=A;return function(pe,Te){if(he===I)throw new Error("Generator is already running");if(he===W){if(pe==="throw")throw Te;return m()}for(ne.method=pe,ne.arg=Te;;){var we=ne.delegate;if(we){var Me=h(we,ne);if(Me){if(Me===K)continue;return Me}}if(ne.method==="next")ne.sent=ne._sent=ne.arg;else if(ne.method==="throw"){if(he===A)throw he=W,ne.arg;ne.dispatchException(ne.arg)}else ne.method==="return"&&ne.abrupt("return",ne.arg);he=I;var Ee=f(re,$,ne);if(Ee.type==="normal"){if(he=ne.done?W:P,Ee.arg===K)continue;return{value:Ee.arg,done:ne.done}}Ee.type==="throw"&&(he=W,ne.method="throw",ne.arg=Ee.arg)}}}function h(re,$){var ne=re.iterator[$.method];if(ne===v){if($.delegate=null,$.method==="throw"){if(re.iterator.return&&($.method="return",$.arg=v,h(re,$),$.method==="throw"))return K;$.method="throw",$.arg=new TypeError("The iterator does not provide a 'throw' method")}return K}var he=f(ne,re.iterator,$.arg);if(he.type==="throw")return $.method="throw",$.arg=he.arg,$.delegate=null,K;var pe=he.arg;return pe?pe.done?($[re.resultName]=pe.value,$.next=re.nextLoc,$.method!=="return"&&($.method="next",$.arg=v),$.delegate=null,K):pe:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,K)}function r(re){var $={tryLoc:re[0]};1 in re&&($.catchLoc=re[1]),2 in re&&($.finallyLoc=re[2],$.afterLoc=re[3]),this.tryEntries.push($)}function t(re){var $=re.completion||{};$.type="normal",delete $.arg,re.completion=$}function n(re){this.tryEntries=[{tryLoc:"root"}],re.forEach(r,this),this.reset(!0)}function c(re){if(re){var $=re[y];if($)return $.call(re);if(typeof re.next=="function")return re;if(!isNaN(re.length)){var ne=-1,he=function pe(){for(;++ne<re.length;)if(E.call(re,ne))return pe.value=re[ne],pe.done=!1,pe;return pe.value=v,pe.done=!0,pe};return he.next=he}}return{next:m}}function m(){return{value:v,done:!0}}var v,b=Object.prototype,E=b.hasOwnProperty,g=typeof Symbol=="function"?Symbol:{},y=g.iterator||"@@iterator",C=g.asyncIterator||"@@asyncIterator",d=g.toStringTag||"@@toStringTag",_=typeof D=="object",O=T.regeneratorRuntime;if(O)return void(_&&(D.exports=O));O=T.regeneratorRuntime=_?D.exports:{},O.wrap=w;var A="suspendedStart",P="suspendedYield",I="executing",W="completed",K={},te={};te[y]=function(){return this};var H=Object.getPrototypeOf,G=H&&H(H(c([])));G&&G!==b&&E.call(G,y)&&(te=G);var V=o.prototype=p.prototype=Object.create(te);u.prototype=V.constructor=o,o.constructor=u,o[d]=u.displayName="GeneratorFunction",O.isGeneratorFunction=function(re){var $=typeof re=="function"&&re.constructor;return!!$&&($===u||($.displayName||$.name)==="GeneratorFunction")},O.mark=function(re){return Object.setPrototypeOf?Object.setPrototypeOf(re,o):(re.__proto__=o,d in re||(re[d]="GeneratorFunction")),re.prototype=Object.create(V),re},O.awrap=function(re){return{__await:re}},i(l.prototype),l.prototype[C]=function(){return this},O.AsyncIterator=l,O.async=function(re,$,ne,he){var pe=new l(w(re,$,ne,he));return O.isGeneratorFunction($)?pe:pe.next().then(function(Te){return Te.done?Te.value:pe.next()})},i(V),V[d]="Generator",V[y]=function(){return this},V.toString=function(){return"[object Generator]"},O.keys=function(re){var $=[];for(var ne in re)$.push(ne);return $.reverse(),function he(){for(;$.length;){var pe=$.pop();if(pe in re)return he.value=pe,he.done=!1,he}return he.done=!0,he}},O.values=c,n.prototype={constructor:n,reset:function(re){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(t),!re)for(var $ in this)$.charAt(0)==="t"&&E.call(this,$)&&!isNaN(+$.slice(1))&&(this[$]=v)},stop:function(){this.done=!0;var re=this.tryEntries[0],$=re.completion;if($.type==="throw")throw $.arg;return this.rval},dispatchException:function(re){function $(Ee,xe){return Te.type="throw",Te.arg=re,ne.next=Ee,xe&&(ne.method="next",ne.arg=v),!!xe}if(this.done)throw re;for(var ne=this,he=this.tryEntries.length-1;he>=0;--he){var pe=this.tryEntries[he],Te=pe.completion;if(pe.tryLoc==="root")return $("end");if(pe.tryLoc<=this.prev){var we=E.call(pe,"catchLoc"),Me=E.call(pe,"finallyLoc");if(we&&Me){if(this.prev<pe.catchLoc)return $(pe.catchLoc,!0);if(this.prev<pe.finallyLoc)return $(pe.finallyLoc)}else if(we){if(this.prev<pe.catchLoc)return $(pe.catchLoc,!0)}else{if(!Me)throw new Error("try statement without catch or finally");if(this.prev<pe.finallyLoc)return $(pe.finallyLoc)}}}},abrupt:function(re,$){for(var ne=this.tryEntries.length-1;ne>=0;--ne){var he=this.tryEntries[ne];if(he.tryLoc<=this.prev&&E.call(he,"finallyLoc")&&this.prev<he.finallyLoc){var pe=he;break}}pe&&(re==="break"||re==="continue")&&pe.tryLoc<=$&&$<=pe.finallyLoc&&(pe=null);var Te=pe?pe.completion:{};return Te.type=re,Te.arg=$,pe?(this.method="next",this.next=pe.finallyLoc,K):this.complete(Te)},complete:function(re,$){if(re.type==="throw")throw re.arg;return re.type==="break"||re.type==="continue"?this.next=re.arg:re.type==="return"?(this.rval=this.arg=re.arg,this.method="return",this.next="end"):re.type==="normal"&&$&&(this.next=$),K},finish:function(re){for(var $=this.tryEntries.length-1;$>=0;--$){var ne=this.tryEntries[$];if(ne.finallyLoc===re)return this.complete(ne.completion,ne.afterLoc),t(ne),K}},catch:function(re){for(var $=this.tryEntries.length-1;$>=0;--$){var ne=this.tryEntries[$];if(ne.tryLoc===re){var he=ne.completion;if(he.type==="throw"){var pe=he.arg;t(ne)}return pe}}throw new Error("illegal catch attempt")},delegateYield:function(re,$,ne){return this.delegate={iterator:c(re),resultName:$,nextLoc:ne},this.method==="next"&&(this.arg=v),K}}}(function(){return this}()||Function("return this")())},{}],193:[function(S,D,x){function T(u,o){for(var i in u)o[i]=u[i]}function w(u,o,i){return p(u,o,i)}var f=S("buffer"),p=f.Buffer;p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?D.exports=f:(T(f,x),x.Buffer=w),T(p,w),w.from=function(u,o,i){if(typeof u=="number")throw new TypeError("Argument must not be a number");return p(u,o,i)},w.alloc=function(u,o,i){if(typeof u!="number")throw new TypeError("Argument must be a number");var l=p(u);return o!==void 0?typeof i=="string"?l.fill(o,i):l.fill(o):l.fill(0),l},w.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return p(u)},w.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return f.SlowBuffer(u)}},{buffer:38}],194:[function(S,D,x){(function(T){"use strict";function w(m){return m&&m.__esModule?m:{default:m}}var f=S("babel-runtime/core-js/string/from-code-point"),p=w(f),u=S("babel-runtime/core-js/json/stringify"),o=w(u),i=S("babel-runtime/helpers/typeof"),l=w(i),s=S("babel-runtime/core-js/object/define-property"),h=w(s),r=S("babel-runtime/core-js/object/keys"),t=w(r),n=S("babel-runtime/core-js/object/create"),c=w(n);!function(m){function v(Y,J){if(!(this instanceof v))return new v(Y,J);var be=this;E(be),be.q=be.c="",be.bufferCheckPosition=m.MAX_BUFFER_LENGTH,be.opt=J||{},be.opt.lowercase=be.opt.lowercase||be.opt.lowercasetags,be.looseCase=be.opt.lowercase?"toLowerCase":"toUpperCase",be.tags=[],be.closed=be.closedRoot=be.sawRoot=!1,be.tag=be.error=null,be.strict=!!Y,be.noscript=!(!Y&&!be.opt.noscript),be.state=U.BEGIN,be.strictEntities=be.opt.strictEntities,be.ENTITIES=be.strictEntities?(0,c.default)(m.XML_ENTITIES):(0,c.default)(m.ENTITIES),be.attribList=[],be.opt.xmlns&&(be.ns=(0,c.default)(Oe)),be.trackPosition=be.opt.position!==!1,be.trackPosition&&(be.position=be.line=be.column=0),I(be,"onready")}function b(Y){for(var J=Math.max(m.MAX_BUFFER_LENGTH,10),be=0,ke=0,ct=xe.length;ke<ct;ke++){var He=Y[xe[ke]].length;if(He>J)switch(xe[ke]){case"textNode":K(Y);break;case"cdata":W(Y,"oncdata",Y.cdata),Y.cdata="";break;case"script":W(Y,"onscript",Y.script),Y.script="";break;default:H(Y,"Max buffer length exceeded: "+xe[ke])}be=Math.max(be,He)}var Be=m.MAX_BUFFER_LENGTH-be;Y.bufferCheckPosition=Be+Y.position}function E(Y){for(var J=0,be=xe.length;J<be;J++)Y[xe[J]]=""}function g(Y){K(Y),Y.cdata!==""&&(W(Y,"oncdata",Y.cdata),Y.cdata=""),Y.script!==""&&(W(Y,"onscript",Y.script),Y.script="")}function y(Y,J){return new C(Y,J)}function C(Y,J){if(!(this instanceof C))return new C(Y,J);Ge.apply(this),this._parser=new v(Y,J),this.writable=!0,this.readable=!0;var be=this;this._parser.onend=function(){be.emit("end")},this._parser.onerror=function(ke){be.emit("error",ke),be._parser.error=null},this._decoder=null,je.forEach(function(ke){(0,h.default)(be,"on"+ke,{get:function(){return be._parser["on"+ke]},set:function(ct){if(!ct)return be.removeAllListeners(ke),be._parser["on"+ke]=ct,ct;be.on(ke,ct)},enumerable:!0,configurable:!1})})}function d(Y){return Y===" "||Y===`
|
|
|
`||Y==="\r"||Y===" "}function _(Y){return Y==='"'||Y==="'"}function O(Y){return Y===">"||d(Y)}function A(Y,J){return Y.test(J)}function P(Y,J){return!A(Y,J)}function I(Y,J,be){Y[J]&&Y[J](be)}function W(Y,J,be){Y.textNode&&K(Y),I(Y,J,be)}function K(Y){Y.textNode=te(Y.opt,Y.textNode),Y.textNode&&I(Y,"ontext",Y.textNode),Y.textNode=""}function te(Y,J){return Y.trim&&(J=J.trim()),Y.normalize&&(J=J.replace(/\s+/g," ")),J}function H(Y,J){return K(Y),Y.trackPosition&&(J+=`
|
|
|
Line: `+Y.line+`
|
|
|
Column: `+Y.column+`
|
|
|
Char: `+Y.c),J=new Error(J),Y.error=J,I(Y,"onerror",J),Y}function G(Y){return Y.sawRoot&&!Y.closedRoot&&V(Y,"Unclosed root tag"),Y.state!==U.BEGIN&&Y.state!==U.BEGIN_WHITESPACE&&Y.state!==U.TEXT&&H(Y,"Unexpected end"),K(Y),Y.c="",Y.closed=!0,I(Y,"onend"),v.call(Y,Y.strict,Y.opt),Y}function V(Y,J){if((Y===void 0?"undefined":(0,l.default)(Y))!=="object"||!(Y instanceof v))throw new Error("bad call to strictFail");Y.strict&&H(Y,J)}function re(Y){Y.strict||(Y.tagName=Y.tagName[Y.looseCase]());var J=Y.tags[Y.tags.length-1]||Y,be=Y.tag={name:Y.tagName,attributes:{}};Y.opt.xmlns&&(be.ns=J.ns),Y.attribList.length=0,W(Y,"onopentagstart",be)}function $(Y,J){var be=Y.indexOf(":"),ke=be<0?["",Y]:Y.split(":"),ct=ke[0],He=ke[1];return J&&Y==="xmlns"&&(ct="xmlns",He=""),{prefix:ct,local:He}}function ne(Y){if(Y.strict||(Y.attribName=Y.attribName[Y.looseCase]()),Y.attribList.indexOf(Y.attribName)!==-1||Y.tag.attributes.hasOwnProperty(Y.attribName))return void(Y.attribName=Y.attribValue="");if(Y.opt.xmlns){var J=$(Y.attribName,!0),be=J.prefix,ke=J.local;if(be==="xmlns")if(ke==="xml"&&Y.attribValue!==de)V(Y,"xml: prefix must be bound to "+de+`
|
|
|
Actual: `+Y.attribValue);else if(ke==="xmlns"&&Y.attribValue!==le)V(Y,"xmlns: prefix must be bound to "+le+`
|
|
|
Actual: `+Y.attribValue);else{var ct=Y.tag,He=Y.tags[Y.tags.length-1]||Y;ct.ns===He.ns&&(ct.ns=(0,c.default)(He.ns)),ct.ns[ke]=Y.attribValue}Y.attribList.push([Y.attribName,Y.attribValue])}else Y.tag.attributes[Y.attribName]=Y.attribValue,W(Y,"onattribute",{name:Y.attribName,value:Y.attribValue});Y.attribName=Y.attribValue=""}function he(Y,J){if(Y.opt.xmlns){var be=Y.tag,ke=$(Y.tagName);be.prefix=ke.prefix,be.local=ke.local,be.uri=be.ns[ke.prefix]||"",be.prefix&&!be.uri&&(V(Y,"Unbound namespace prefix: "+(0,o.default)(Y.tagName)),be.uri=ke.prefix);var ct=Y.tags[Y.tags.length-1]||Y;be.ns&&ct.ns!==be.ns&&(0,t.default)(be.ns).forEach(function(Ce){W(Y,"onopennamespace",{prefix:Ce,uri:be.ns[Ce]})});for(var He=0,Be=Y.attribList.length;He<Be;He++){var Ze=Y.attribList[He],ht=Ze[0],Qe=Ze[1],Xe=$(ht,!0),Ke=Xe.prefix,Fe=Xe.local,Ue=Ke===""?"":be.ns[Ke]||"",_e={name:ht,value:Qe,prefix:Ke,local:Fe,uri:Ue};Ke&&Ke!=="xmlns"&&!Ue&&(V(Y,"Unbound namespace prefix: "+(0,o.default)(Ke)),_e.uri=Ke),Y.tag.attributes[ht]=_e,W(Y,"onattribute",_e)}Y.attribList.length=0}Y.tag.isSelfClosing=!!J,Y.sawRoot=!0,Y.tags.push(Y.tag),W(Y,"onopentag",Y.tag),J||(Y.noscript||Y.tagName.toLowerCase()!=="script"?Y.state=U.TEXT:Y.state=U.SCRIPT,Y.tag=null,Y.tagName=""),Y.attribName=Y.attribValue="",Y.attribList.length=0}function pe(Y){if(!Y.tagName)return V(Y,"Weird empty close tag."),Y.textNode+="</>",void(Y.state=U.TEXT);if(Y.script){if(Y.tagName!=="script")return Y.script+="</"+Y.tagName+">",Y.tagName="",void(Y.state=U.SCRIPT);W(Y,"onscript",Y.script),Y.script=""}var J=Y.tags.length,be=Y.tagName;Y.strict||(be=be[Y.looseCase]());for(var ke=be;J--&&!(Y.tags[J].name===ke);)V(Y,"Unexpected close tag");if(J<0)return V(Y,"Unmatched closing tag: "+Y.tagName),Y.textNode+="</"+Y.tagName+">",void(Y.state=U.TEXT);Y.tagName=be;for(var ct=Y.tags.length;ct-- >J;){var He=Y.tag=Y.tags.pop();Y.tagName=Y.tag.name,W(Y,"onclosetag",Y.tagName);var Be={};for(var Ze in He.ns)Be[Ze]=He.ns[Ze];var ht=Y.tags[Y.tags.length-1]||Y;Y.opt.xmlns&&He.ns!==ht.ns&&(0,t.default)(He.ns).forEach(function(Qe){var Xe=He.ns[Qe];W(Y,"onclosenamespace",{prefix:Qe,uri:Xe})})}J===0&&(Y.closedRoot=!0),Y.tagName=Y.attribValue=Y.attribName="",Y.attribList.length=0,Y.state=U.TEXT}function Te(Y){var J,be=Y.entity,ke=be.toLowerCase(),ct="";return Y.ENTITIES[be]?Y.ENTITIES[be]:Y.ENTITIES[ke]?Y.ENTITIES[ke]:(be=ke,be.charAt(0)==="#"&&(be.charAt(1)==="x"?(be=be.slice(2),J=parseInt(be,16),ct=J.toString(16)):(be=be.slice(1),J=parseInt(be,10),ct=J.toString(10))),be=be.replace(/^0+/,""),isNaN(J)||ct.toLowerCase()!==be?(V(Y,"Invalid character entity"),"&"+Y.entity+";"):(0,p.default)(J))}function we(Y,J){J==="<"?(Y.state=U.OPEN_WAKA,Y.startTagPosition=Y.position):d(J)||(V(Y,"Non-whitespace before first tag."),Y.textNode=J,Y.state=U.TEXT)}function Me(Y,J){var be="";return J<Y.length&&(be=Y.charAt(J)),be}function Ee(Y){var J=this;if(this.error)throw this.error;if(J.closed)return H(J,"Cannot write after close. Assign an onready handler.");if(Y===null)return G(J);(Y===void 0?"undefined":(0,l.default)(Y))==="object"&&(Y=Y.toString());for(var be=0,ke="";!(ke=Me(Y,be++),J.c=ke,!ke);)switch(J.trackPosition&&(J.position++,ke===`
|
|
|
`?(J.line++,J.column=0):J.column++),J.state){case U.BEGIN:if(J.state=U.BEGIN_WHITESPACE,ke==="\uFEFF")continue;we(J,ke);continue;case U.BEGIN_WHITESPACE:we(J,ke);continue;case U.TEXT:if(J.sawRoot&&!J.closedRoot){for(var ct=be-1;ke&&ke!=="<"&&ke!=="&";)(ke=Me(Y,be++))&&J.trackPosition&&(J.position++,ke===`
|
|
|
`?(J.line++,J.column=0):J.column++);J.textNode+=Y.substring(ct,be-1)}ke!=="<"||J.sawRoot&&J.closedRoot&&!J.strict?(d(ke)||J.sawRoot&&!J.closedRoot||V(J,"Text data outside of root node."),ke==="&"?J.state=U.TEXT_ENTITY:J.textNode+=ke):(J.state=U.OPEN_WAKA,J.startTagPosition=J.position);continue;case U.SCRIPT:ke==="<"?J.state=U.SCRIPT_ENDING:J.script+=ke;continue;case U.SCRIPT_ENDING:ke==="/"?J.state=U.CLOSE_TAG:(J.script+="<"+ke,J.state=U.SCRIPT);continue;case U.OPEN_WAKA:if(ke==="!")J.state=U.SGML_DECL,J.sgmlDecl="";else if(!d(ke))if(A(Ie,ke))J.state=U.OPEN_TAG,J.tagName=ke;else if(ke==="/")J.state=U.CLOSE_TAG,J.tagName="";else if(ke==="?")J.state=U.PROC_INST,J.procInstName=J.procInstBody="";else{if(V(J,"Unencoded <"),J.startTagPosition+1<J.position){var He=J.position-J.startTagPosition;ke=new Array(He).join(" ")+ke}J.textNode+="<"+ke,J.state=U.TEXT}continue;case U.SGML_DECL:(J.sgmlDecl+ke).toUpperCase()===We?(W(J,"onopencdata"),J.state=U.CDATA,J.sgmlDecl="",J.cdata=""):J.sgmlDecl+ke==="--"?(J.state=U.COMMENT,J.comment="",J.sgmlDecl=""):(J.sgmlDecl+ke).toUpperCase()===ze?(J.state=U.DOCTYPE,(J.doctype||J.sawRoot)&&V(J,"Inappropriately located doctype declaration"),J.doctype="",J.sgmlDecl=""):ke===">"?(W(J,"onsgmldeclaration",J.sgmlDecl),J.sgmlDecl="",J.state=U.TEXT):(_(ke)&&(J.state=U.SGML_DECL_QUOTED),J.sgmlDecl+=ke);continue;case U.SGML_DECL_QUOTED:ke===J.q&&(J.state=U.SGML_DECL,J.q=""),J.sgmlDecl+=ke;continue;case U.DOCTYPE:ke===">"?(J.state=U.TEXT,W(J,"ondoctype",J.doctype),J.doctype=!0):(J.doctype+=ke,ke==="["?J.state=U.DOCTYPE_DTD:_(ke)&&(J.state=U.DOCTYPE_QUOTED,J.q=ke));continue;case U.DOCTYPE_QUOTED:J.doctype+=ke,ke===J.q&&(J.q="",J.state=U.DOCTYPE);continue;case U.DOCTYPE_DTD:J.doctype+=ke,ke==="]"?J.state=U.DOCTYPE:_(ke)&&(J.state=U.DOCTYPE_DTD_QUOTED,J.q=ke);continue;case U.DOCTYPE_DTD_QUOTED:J.doctype+=ke,ke===J.q&&(J.state=U.DOCTYPE_DTD,J.q="");continue;case U.COMMENT:ke==="-"?J.state=U.COMMENT_ENDING:J.comment+=ke;continue;case U.COMMENT_ENDING:ke==="-"?(J.state=U.COMMENT_ENDED,J.comment=te(J.opt,J.comment),J.comment&&W(J,"oncomment",J.comment),J.comment=""):(J.comment+="-"+ke,J.state=U.COMMENT);continue;case U.COMMENT_ENDED:ke!==">"?(V(J,"Malformed comment"),J.comment+="--"+ke,J.state=U.COMMENT):J.state=U.TEXT;continue;case U.CDATA:ke==="]"?J.state=U.CDATA_ENDING:J.cdata+=ke;continue;case U.CDATA_ENDING:ke==="]"?J.state=U.CDATA_ENDING_2:(J.cdata+="]"+ke,J.state=U.CDATA);continue;case U.CDATA_ENDING_2:ke===">"?(J.cdata&&W(J,"oncdata",J.cdata),W(J,"onclosecdata"),J.cdata="",J.state=U.TEXT):ke==="]"?J.cdata+="]":(J.cdata+="]]"+ke,J.state=U.CDATA);continue;case U.PROC_INST:ke==="?"?J.state=U.PROC_INST_ENDING:d(ke)?J.state=U.PROC_INST_BODY:J.procInstName+=ke;continue;case U.PROC_INST_BODY:if(!J.procInstBody&&d(ke))continue;ke==="?"?J.state=U.PROC_INST_ENDING:J.procInstBody+=ke;continue;case U.PROC_INST_ENDING:ke===">"?(W(J,"onprocessinginstruction",{name:J.procInstName,body:J.procInstBody}),J.procInstName=J.procInstBody="",J.state=U.TEXT):(J.procInstBody+="?"+ke,J.state=U.PROC_INST_BODY);continue;case U.OPEN_TAG:A(qe,ke)?J.tagName+=ke:(re(J),ke===">"?he(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:(d(ke)||V(J,"Invalid character in tag name"),J.state=U.ATTRIB));continue;case U.OPEN_TAG_SLASH:ke===">"?(he(J,!0),pe(J)):(V(J,"Forward-slash in opening tag not followed by >"),J.state=U.ATTRIB);continue;case U.ATTRIB:if(d(ke))continue;ke===">"?he(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:A(Ie,ke)?(J.attribName=ke,J.attribValue="",J.state=U.ATTRIB_NAME):V(J,"Invalid attribute name");continue;case U.ATTRIB_NAME:ke==="="?J.state=U.ATTRIB_VALUE:ke===">"?(V(J,"Attribute without value"),J.attribValue=J.attribName,ne(J),he(J)):d(ke)?J.state=U.ATTRIB_NAME_SAW_WHITE:A(qe,ke)?J.attribName+=ke:V(J,"Invalid attribute name");continue;case U.ATTRIB_NAME_SAW_WHITE:if(ke==="=")J.state=U.ATTRIB_VALUE;else{if(d(ke))continue;V(J,"Attribute without value"),J.tag.attributes[J.attribName]="",J.attribValue="",W(J,"onattribute",{name:J.attribName,value:""}),J.attribName="",ke===">"?he(J):A(Ie,ke)?(J.attribName=ke,J.state=U.ATTRIB_NAME):(V(J,"Invalid attribute name"),J.state=U.ATTRIB)}continue;case U.ATTRIB_VALUE:if(d(ke))continue;_(ke)?(J.q=ke,J.state=U.ATTRIB_VALUE_QUOTED):(V(J,"Unquoted attribute value"),J.state=U.ATTRIB_VALUE_UNQUOTED,J.attribValue=ke);continue;case U.ATTRIB_VALUE_QUOTED:if(ke!==J.q){ke==="&"?J.state=U.ATTRIB_VALUE_ENTITY_Q:J.attribValue+=ke;continue}ne(J),J.q="",J.state=U.ATTRIB_VALUE_CLOSED;continue;case U.ATTRIB_VALUE_CLOSED:d(ke)?J.state=U.ATTRIB:ke===">"?he(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:A(Ie,ke)?(V(J,"No whitespace between attributes"),J.attribName=ke,J.attribValue="",J.state=U.ATTRIB_NAME):V(J,"Invalid attribute name");continue;case U.ATTRIB_VALUE_UNQUOTED:if(!O(ke)){ke==="&"?J.state=U.ATTRIB_VALUE_ENTITY_U:J.attribValue+=ke;continue}ne(J),ke===">"?he(J):J.state=U.ATTRIB;continue;case U.CLOSE_TAG:if(J.tagName)ke===">"?pe(J):A(qe,ke)?J.tagName+=ke:J.script?(J.script+="</"+J.tagName,J.tagName="",J.state=U.SCRIPT):(d(ke)||V(J,"Invalid tagname in closing tag"),J.state=U.CLOSE_TAG_SAW_WHITE);else{if(d(ke))continue;P(Ie,ke)?J.script?(J.script+="</"+ke,J.state=U.SCRIPT):V(J,"Invalid tagname in closing tag."):J.tagName=ke}continue;case U.CLOSE_TAG_SAW_WHITE:if(d(ke))continue;ke===">"?pe(J):V(J,"Invalid characters in closing tag");continue;case U.TEXT_ENTITY:case U.ATTRIB_VALUE_ENTITY_Q:case U.ATTRIB_VALUE_ENTITY_U:var Be,Ze;switch(J.state){case U.TEXT_ENTITY:Be=U.TEXT,Ze="textNode";break;case U.ATTRIB_VALUE_ENTITY_Q:Be=U.ATTRIB_VALUE_QUOTED,Ze="attribValue";break;case U.ATTRIB_VALUE_ENTITY_U:Be=U.ATTRIB_VALUE_UNQUOTED,Ze="attribValue"}ke===";"?(J[Ze]+=Te(J),J.entity="",J.state=Be):A(J.entity.length?k:ee,ke)?J.entity+=ke:(V(J,"Invalid character in entity name"),J[Ze]+="&"+J.entity+ke,J.entity="",J.state=Be);continue;default:throw new Error(J,"Unknown state: "+J.state)}return J.position>=J.bufferCheckPosition&&b(J),J}m.parser=function(Y,J){return new v(Y,J)},m.SAXParser=v,m.SAXStream=C,m.createStream=y,m.MAX_BUFFER_LENGTH=65536;var xe=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];m.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],c.default||(Object.create=function(Y){function J(){}return J.prototype=Y,new J}),t.default||(Object.keys=function(Y){var J=[];for(var be in Y)Y.hasOwnProperty(be)&&J.push(be);return J}),v.prototype={end:function(){G(this)},write:Ee,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){g(this)}};var Ge;try{Ge=S("stream").Stream}catch(Y){Ge=function(){}}var je=m.EVENTS.filter(function(Y){return Y!=="error"&&Y!=="end"});C.prototype=(0,c.default)(Ge.prototype,{constructor:{value:C}}),C.prototype.write=function(Y){if(typeof T=="function"&&typeof T.isBuffer=="function"&&T.isBuffer(Y)){if(!this._decoder){var J=S("string_decoder").StringDecoder;this._decoder=new J("utf8")}Y=this._decoder.write(Y)}return this._parser.write(Y.toString()),this.emit("data",Y),!0},C.prototype.end=function(Y){return Y&&Y.length&&this.write(Y),this._parser.end(),!0},C.prototype.on=function(Y,J){var be=this;return be._parser["on"+Y]||je.indexOf(Y)===-1||(be._parser["on"+Y]=function(){var ke=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ke.splice(0,0,Y),be.emit.apply(be,ke)}),Ge.prototype.on.call(be,Y,J)};var We="[CDATA[",ze="DOCTYPE",de="http://www.w3.org/XML/1998/namespace",le="http://www.w3.org/2000/xmlns/",Oe={xml:de,xmlns:le},Ie=/[:_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]/,qe=/[:_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-]/,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]/,k=/[#:_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-]/,U=0;m.STATE={BEGIN:U++,BEGIN_WHITESPACE:U++,TEXT:U++,TEXT_ENTITY:U++,OPEN_WAKA:U++,SGML_DECL:U++,SGML_DECL_QUOTED:U++,DOCTYPE:U++,DOCTYPE_QUOTED:U++,DOCTYPE_DTD:U++,DOCTYPE_DTD_QUOTED:U++,COMMENT_STARTING:U++,COMMENT:U++,COMMENT_ENDING:U++,COMMENT_ENDED:U++,CDATA:U++,CDATA_ENDING:U++,CDATA_ENDING_2:U++,PROC_INST:U++,PROC_INST_BODY:U++,PROC_INST_ENDING:U++,OPEN_TAG:U++,OPEN_TAG_SLASH:U++,ATTRIB:U++,ATTRIB_NAME:U++,ATTRIB_NAME_SAW_WHITE:U++,ATTRIB_VALUE:U++,ATTRIB_VALUE_QUOTED:U++,ATTRIB_VALUE_CLOSED:U++,ATTRIB_VALUE_UNQUOTED:U++,ATTRIB_VALUE_ENTITY_Q:U++,ATTRIB_VALUE_ENTITY_U:U++,CLOSE_TAG:U++,CLOSE_TAG_SAW_WHITE:U++,SCRIPT:U++,SCRIPT_ENDING:U++},m.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},m.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,t.default)(m.ENTITIES).forEach(function(Y){var J=m.ENTITIES[Y],be=typeof J=="number"?String.fromCharCode(J):J;m.ENTITIES[Y]=be});for(var q in m.STATE)m.STATE[m.STATE[q]]=q;U=m.STATE,p.default||function(){var Y=String.fromCharCode,J=Math.floor,be=function(){var ke,ct,He=[],Be=-1,Ze=arguments.length;if(!Ze)return"";for(var ht="";++Be<Ze;){var Qe=Number(arguments[Be]);if(!isFinite(Qe)||Qe<0||Qe>1114111||J(Qe)!==Qe)throw RangeError("Invalid code point: "+Qe);Qe<=65535?He.push(Qe):(Qe-=65536,ke=55296+(Qe>>10),ct=Qe%1024+56320,He.push(ke,ct)),(Be+1===Ze||He.length>16384)&&(ht+=Y.apply(null,He),He.length=0)}return ht};h.default?Object.defineProperty(String,"fromCodePoint",{value:be,configurable:!0,writable:!0}):String.fromCodePoint=be}()}(x===void 0?(void 0).sax={}:x)}).call(this,S("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(S,D,x){function T(){w.call(this)}D.exports=T;var w=S("events").EventEmitter;S("inherits")(T,w),T.Readable=S("readable-stream/readable.js"),T.Writable=S("readable-stream/writable.js"),T.Duplex=S("readable-stream/duplex.js"),T.Transform=S("readable-stream/transform.js"),T.PassThrough=S("readable-stream/passthrough.js"),T.Stream=T,T.prototype.pipe=function(f,p){function u(n){f.writable&&f.write(n)===!1&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}function i(){t||(t=!0,f.end())}function l(){t||(t=!0,typeof f.destroy=="function"&&f.destroy())}function s(n){if(h(),w.listenerCount(this,"error")===0)throw n}function h(){r.removeListener("data",u),f.removeListener("drain",o),r.removeListener("end",i),r.removeListener("close",l),r.removeListener("error",s),f.removeListener("error",s),r.removeListener("end",h),r.removeListener("close",h),f.removeListener("close",h)}var r=this;r.on("data",u),f.on("drain",o),f._isStdio||p&&p.end===!1||(r.on("end",i),r.on("close",l));var t=!1;return r.on("error",s),f.on("error",s),r.on("end",h),r.on("close",h),f.on("close",h),f.emit("pipe",r),f}},{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(S,D,x){(function(T){var w=S("./lib/request"),f=S("./lib/response"),p=S("xtend"),u=S("builtin-status-codes"),o=S("url"),i=x;i.request=function(l,s){l=typeof l=="string"?o.parse(l):p(l);var h=T.location.protocol.search(/^https?:$/)===-1?"http:":"",r=l.protocol||h,t=l.hostname||l.host,n=l.port,c=l.path||"/";t&&t.indexOf(":")!==-1&&(t="["+t+"]"),l.url=(t?r+"//"+t:"")+(n?":"+n:"")+c,l.method=(l.method||"GET").toUpperCase(),l.headers=l.headers||{};var m=new w(l);return s&&m.on("response",s),m},i.get=function(l,s){var h=i.request(l,s);return h.end(),h},i.ClientRequest=w,i.IncomingMessage=f.IncomingMessage,i.Agent=function(){},i.Agent.defaultMaxSockets=4,i.globalAgent=new i.Agent,i.STATUS_CODES=u,i.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 ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":198,"./lib/response":199,"builtin-status-codes":39,url:203,xtend:236}],197:[function(S,D,x){(function(T){"use strict";function w(){if(u!==void 0)return u;if(T.XMLHttpRequest){u=new T.XMLHttpRequest;try{u.open("GET",T.XDomainRequest?"/":"https://example.com")}catch(l){u=null}}else u=null;return u}function f(l){var s=w();if(!s)return!1;try{return s.responseType=l,s.responseType===l}catch(h){}return!1}function p(l){return typeof l=="function"}x.fetch=p(T.fetch)&&p(T.ReadableStream),x.writableStream=p(T.WritableStream),x.abortController=p(T.AbortController),x.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),x.blobConstructor=!0}catch(l){}var u,o=T.ArrayBuffer!==void 0,i=o&&p(T.ArrayBuffer.prototype.slice);x.arraybuffer=x.fetch||o&&f("arraybuffer"),x.msstream=!x.fetch&&i&&f("ms-stream"),x.mozchunkedarraybuffer=!x.fetch&&o&&f("moz-chunked-arraybuffer"),x.overrideMimeType=x.fetch||!!w()&&p(w().overrideMimeType),x.vbArray=p(T.VBArray),u=null}).call(this,typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],198:[function(S,D,x){(function(T,w,f){"use strict";function p(b,E){return l.fetch&&E?"fetch":l.mozchunkedarraybuffer?"moz-chunked-arraybuffer":l.msstream?"ms-stream":l.arraybuffer&&b?"arraybuffer":l.vbArray&&b?"text:vbarray":"text"}function u(b){try{var E=b.status;return E!==null&&E!==0}catch(g){return!1}}var o=S("babel-runtime/core-js/object/keys"),i=function(b){return b&&b.__esModule?b:{default:b}}(o),l=S("./capability"),s=S("inherits"),h=S("./response"),r=S("readable-stream"),t=S("to-arraybuffer"),n=h.IncomingMessage,c=h.readyStates,m=D.exports=function(b){var E=this;r.Writable.call(E),E._opts=b,E._body=[],E._headers={},b.auth&&E.setHeader("Authorization","Basic "+new f(b.auth).toString("base64")),(0,i.default)(b.headers).forEach(function(C){E.setHeader(C,b.headers[C])});var g,y=!0;if(b.mode==="disable-fetch"||"requestTimeout"in b&&!l.abortController)y=!1,g=!0;else if(b.mode==="prefer-streaming")g=!1;else if(b.mode==="allow-wrong-content-type")g=!l.overrideMimeType;else{if(b.mode&&b.mode!=="default"&&b.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");g=!0}E._mode=p(g,y),E._fetchTimer=null,E.on("finish",function(){E._onFinish()})};s(m,r.Writable),m.prototype.setHeader=function(b,E){var g=this,y=b.toLowerCase();v.indexOf(y)===-1&&(g._headers[y]={name:b,value:E})},m.prototype.getHeader=function(b){var E=this._headers[b.toLowerCase()];return E?E.value:null},m.prototype.removeHeader=function(b){delete this._headers[b.toLowerCase()]},m.prototype._onFinish=function(){var b=this;if(!b._destroyed){var E=b._opts,g=b._headers,y=null;E.method!=="GET"&&E.method!=="HEAD"&&(y=l.arraybuffer?t(f.concat(b._body)):l.blobConstructor?new w.Blob(b._body.map(function(A){return t(A)}),{type:(g["content-type"]||{}).value||""}):f.concat(b._body).toString());var C=[];if((0,i.default)(g).forEach(function(A){var P=g[A].name,I=g[A].value;Array.isArray(I)?I.forEach(function(W){C.push([P,W])}):C.push([P,I])}),b._mode==="fetch"){var d=null;if(l.abortController){var _=new AbortController;d=_.signal,b._fetchAbortController=_,"requestTimeout"in E&&E.requestTimeout!==0&&(b._fetchTimer=w.setTimeout(function(){b.emit("requestTimeout"),b._fetchAbortController&&b._fetchAbortController.abort()},E.requestTimeout))}w.fetch(b._opts.url,{method:b._opts.method,headers:C,body:y||void 0,mode:"cors",credentials:E.withCredentials?"include":"same-origin",signal:d}).then(function(A){b._fetchResponse=A,b._connect()},function(A){w.clearTimeout(b._fetchTimer),b._destroyed||b.emit("error",A)})}else{var O=b._xhr=new w.XMLHttpRequest;try{O.open(b._opts.method,b._opts.url,!0)}catch(A){return void T.nextTick(function(){b.emit("error",A)})}"responseType"in O&&(O.responseType=b._mode.split(":")[0]),"withCredentials"in O&&(O.withCredentials=!!E.withCredentials),b._mode==="text"&&"overrideMimeType"in O&&O.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in E&&(O.timeout=E.requestTimeout,O.ontimeout=function(){b.emit("requestTimeout")}),C.forEach(function(A){O.setRequestHeader(A[0],A[1])}),b._response=null,O.onreadystatechange=function(){switch(O.readyState){case c.LOADING:case c.DONE:b._onXHRProgress()}},b._mode==="moz-chunked-arraybuffer"&&(O.onprogress=function(){b._onXHRProgress()}),O.onerror=function(){b._destroyed||b.emit("error",new Error("XHR error"))};try{O.send(y)}catch(A){return void T.nextTick(function(){b.emit("error",A)})}}}},m.prototype._onXHRProgress=function(){var b=this;u(b._xhr)&&!b._destroyed&&(b._response||b._connect(),b._response._onXHRProgress())},m.prototype._connect=function(){var b=this;b._destroyed||(b._response=new n(b._xhr,b._fetchResponse,b._mode,b._fetchTimer),b._response.on("error",function(E){b.emit("error",E)}),b.emit("response",b._response))},m.prototype._write=function(b,E,g){this._body.push(b),g()},m.prototype.abort=m.prototype.destroy=function(){var b=this;b._destroyed=!0,w.clearTimeout(b._fetchTimer),b._response&&(b._response._destroyed=!0),b._xhr?b._xhr.abort():b._fetchAbortController&&b._fetchAbortController.abort()},m.prototype.end=function(b,E,g){var y=this;typeof b=="function"&&(g=b,b=void 0),r.Writable.prototype.end.call(y,b,E,g)},m.prototype.flushHeaders=function(){},m.prototype.setTimeout=function(){},m.prototype.setNoDelay=function(){},m.prototype.setSocketKeepAlive=function(){};var v=["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,S("_process"),typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{},S("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(S,D,x){(function(T,w,f){"use strict";var p=S("babel-runtime/core-js/promise"),u=function(r){return r&&r.__esModule?r:{default:r}}(p),o=S("./capability"),i=S("inherits"),l=S("readable-stream"),s=x.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},h=x.IncomingMessage=function(r,t,n,c){var m=this;if(l.Readable.call(m),m._mode=n,m.headers={},m.rawHeaders=[],m.trailers={},m.rawTrailers=[],m.on("end",function(){T.nextTick(function(){m.emit("close")})}),n==="fetch"){if(m._fetchResponse=t,m.url=t.url,m.statusCode=t.status,m.statusMessage=t.statusText,t.headers.forEach(function(y,C){m.headers[C.toLowerCase()]=y,m.rawHeaders.push(C,y)}),o.writableStream){var v=new WritableStream({write:function(y){return new u.default(function(C,d){m._destroyed?d():m.push(new f(y))?C():m._resumeFetch=C})},close:function(){w.clearTimeout(c),m._destroyed||m.push(null)},abort:function(y){m._destroyed||m.emit("error",y)}});try{return void t.body.pipeTo(v).catch(function(y){w.clearTimeout(c),m._destroyed||m.emit("error",y)})}catch(y){}}var b=t.body.getReader();!function y(){b.read().then(function(C){if(!m._destroyed){if(C.done)return w.clearTimeout(c),void m.push(null);m.push(new f(C.value)),y()}}).catch(function(C){w.clearTimeout(c),m._destroyed||m.emit("error",C)})}()}else if(m._xhr=r,m._pos=0,m.url=r.responseURL,m.statusCode=r.status,m.statusMessage=r.statusText,r.getAllResponseHeaders().split(/\r?\n/).forEach(function(y){var C=y.match(/^([^:]+):\s*(.*)/);if(C){var d=C[1].toLowerCase();d==="set-cookie"?(m.headers[d]===void 0&&(m.headers[d]=[]),m.headers[d].push(C[2])):m.headers[d]!==void 0?m.headers[d]+=", "+C[2]:m.headers[d]=C[2],m.rawHeaders.push(C[1],C[2])}}),m._charset="x-user-defined",!o.overrideMimeType){var E=m.rawHeaders["mime-type"];if(E){var g=E.match(/;\s*charset=([^;])(;|$)/);g&&(m._charset=g[1].toLowerCase())}m._charset||(m._charset="utf-8")}};i(h,l.Readable),h.prototype._read=function(){var r=this,t=r._resumeFetch;t&&(r._resumeFetch=null,t())},h.prototype._onXHRProgress=function(){var r=this,t=r._xhr,n=null;switch(r._mode){case"text:vbarray":if(t.readyState!==s.DONE)break;try{n=new w.VBArray(t.responseBody).toArray()}catch(E){}if(n!==null){r.push(new f(n));break}case"text":try{n=t.responseText}catch(E){r._mode="text:vbarray";break}if(n.length>r._pos){var c=n.substr(r._pos);if(r._charset==="x-user-defined"){for(var m=new f(c.length),v=0;v<c.length;v++)m[v]=255&c.charCodeAt(v);r.push(m)}else r.push(c,r._charset);r._pos=n.length}break;case"arraybuffer":if(t.readyState!==s.DONE||!t.response)break;n=t.response,r.push(new f(new Uint8Array(n)));break;case"moz-chunked-arraybuffer":if(n=t.response,t.readyState!==s.LOADING||!n)break;r.push(new f(new Uint8Array(n)));break;case"ms-stream":if(n=t.response,t.readyState!==s.LOADING)break;var b=new w.MSStreamReader;b.onprogress=function(){b.result.byteLength>r._pos&&(r.push(new f(new Uint8Array(b.result.slice(r._pos)))),r._pos=b.result.byteLength)},b.onload=function(){r.push(null)},b.readAsArrayBuffer(n)}r._xhr.readyState===s.DONE&&r._mode!=="ms-stream"&&r.push(null)}}).call(this,S("_process"),typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{},S("buffer").Buffer)},{"./capability":197,_process:173,"babel-runtime/core-js/promise":24,buffer:38,inherits:162,"readable-stream":188}],200:[function(S,D,x){"use strict";function T(E){if(!E)return"utf8";for(var g;;)switch(E){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return E;default:if(g)return;E=(""+E).toLowerCase(),g=!0}}function w(E){var g=T(E);if(typeof g!="string"&&(v.isEncoding===b||!b(E)))throw new Error("Unknown encoding: "+E);return g||E}function f(E){this.encoding=w(E);var g;switch(this.encoding){case"utf16le":this.text=h,this.end=r,g=4;break;case"utf8":this.fillLast=i,g=4;break;case"base64":this.text=t,this.end=n,g=3;break;default:return this.write=c,void(this.end=m)}this.lastNeed=0,this.lastTotal=0,this.lastChar=v.allocUnsafe(g)}function p(E){return E<=127?0:E>>5==6?2:E>>4==14?3:E>>3==30?4:E>>6==2?-1:-2}function u(E,g,y){var C=g.length-1;if(C<y)return 0;var d=p(g[C]);return d>=0?(d>0&&(E.lastNeed=d-1),d):--C<y||d===-2?0:(d=p(g[C]))>=0?(d>0&&(E.lastNeed=d-2),d):--C<y||d===-2?0:(d=p(g[C]),d>=0?(d>0&&(d===2?d=0:E.lastNeed=d-3),d):0)}function o(E,g,y){if((192&g[0])!=128)return E.lastNeed=0,"\u951F\uFFFD";if(E.lastNeed>1&&g.length>1){if((192&g[1])!=128)return E.lastNeed=1,"\u951F\uFFFD";if(E.lastNeed>2&&g.length>2&&(192&g[2])!=128)return E.lastNeed=2,"\u951F\uFFFD"}}function i(E){var g=this.lastTotal-this.lastNeed,y=o(this,E,g);return y!==void 0?y:this.lastNeed<=E.length?(E.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(E.copy(this.lastChar,g,0,E.length),void(this.lastNeed-=E.length))}function l(E,g){var y=u(this,E,g);if(!this.lastNeed)return E.toString("utf8",g);this.lastTotal=y;var C=E.length-(y-this.lastNeed);return E.copy(this.lastChar,0,C),E.toString("utf8",g,C)}function s(E){var g=E&&E.length?this.write(E):"";return this.lastNeed?g+"\u951F\uFFFD":g}function h(E,g){if((E.length-g)%2==0){var y=E.toString("utf16le",g);if(y){var C=y.charCodeAt(y.length-1);if(C>=55296&&C<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=E[E.length-1],E.toString("utf16le",g,E.length-1)}function r(E){var g=E&&E.length?this.write(E):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,y)}return g}function t(E,g){var y=(E.length-g)%3;return y===0?E.toString("base64",g):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=E[E.length-1]:(this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1]),E.toString("base64",g,E.length-y))}function n(E){var g=E&&E.length?this.write(E):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function c(E){return E.toString(this.encoding)}function m(E){return E&&E.length?this.write(E):""}var v=S("safe-buffer").Buffer,b=v.isEncoding||function(E){switch((E=""+E)&&E.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};x.StringDecoder=f,f.prototype.write=function(E){if(E.length===0)return"";var g,y;if(this.lastNeed){if((g=this.fillLast(E))===void 0)return"";y=this.lastNeed,this.lastNeed=0}else y=0;return y<E.length?g?g+this.text(E,y):this.text(E,y):g||""},f.prototype.end=s,f.prototype.text=l,f.prototype.fillLast=function(E){if(this.lastNeed<=E.length)return E.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);E.copy(this.lastChar,this.lastTotal-this.lastNeed,0,E.length),this.lastNeed-=E.length}},{"safe-buffer":193}],201:[function(S,D,x){(function(T,w){function f(s,h){this._id=s,this._clearFn=h}var p=S("process/browser.js").nextTick,u=Function.prototype.apply,o=Array.prototype.slice,i={},l=0;x.setTimeout=function(){return new f(u.call(setTimeout,window,arguments),clearTimeout)},x.setInterval=function(){return new f(u.call(setInterval,window,arguments),clearInterval)},x.clearTimeout=x.clearInterval=function(s){s.close()},f.prototype.unref=f.prototype.ref=function(){},f.prototype.close=function(){this._clearFn.call(window,this._id)},x.enroll=function(s,h){clearTimeout(s._idleTimeoutId),s._idleTimeout=h},x.unenroll=function(s){clearTimeout(s._idleTimeoutId),s._idleTimeout=-1},x._unrefActive=x.active=function(s){clearTimeout(s._idleTimeoutId);var h=s._idleTimeout;h>=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},h))},x.setImmediate=typeof T=="function"?T:function(s){var h=l++,r=!(arguments.length<2)&&o.call(arguments,1);return i[h]=!0,p(function(){i[h]&&(r?s.apply(null,r):s.call(null),x.clearImmediate(h))}),h},x.clearImmediate=typeof w=="function"?w:function(s){delete i[s]}}).call(this,S("timers").setImmediate,S("timers").clearImmediate)},{"process/browser.js":173,timers:201}],202:[function(S,D,x){var T=S("buffer").Buffer;D.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(T.isBuffer(w)){for(var f=new Uint8Array(w.length),p=w.length,u=0;u<p;u++)f[u]=w[u];return f.buffer}throw new Error("Argument must be a Buffer")}},{buffer:38}],203:[function(S,D,x){"use strict";function T(){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(d,_,O){if(d&&i.isObject(d)&&d instanceof T)return d;var A=new T;return A.parse(d,_,O),A}function f(d){return i.isString(d)&&(d=w(d)),d instanceof T?d.format():T.prototype.format.call(d)}function p(d,_){return w(d,!1,!0).resolve(_)}function u(d,_){return d?w(d,!1,!0).resolveObject(_):_}var o=S("punycode"),i=S("./util");x.parse=w,x.resolve=p,x.resolveObject=u,x.format=f,x.Url=T;var l=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,r=["<",">",'"',"`"," ","\r",`
|
|
|
`," "],t=["{","}","|","\\","^","`"].concat(r),n=["'"].concat(t),c=["%","/","?",";","#"].concat(n),m=["/","?","#"],v=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},C=S("querystring");T.prototype.parse=function(d,_,O){if(!i.isString(d))throw new TypeError("Parameter 'url' must be a string, not "+typeof d);var A=d.indexOf("?"),P=A!==-1&&A<d.indexOf("#")?"?":"#",I=d.split(P),W=/\\/g;I[0]=I[0].replace(W,"/"),d=I.join(P);var K=d;if(K=K.trim(),!O&&d.split("#").length===1){var te=h.exec(K);if(te)return this.path=K,this.href=K,this.pathname=te[1],te[2]?(this.search=te[2],this.query=_?C.parse(this.search.substr(1)):this.search.substr(1)):_&&(this.search="",this.query={}),this}var H=l.exec(K);if(H){H=H[0];var G=H.toLowerCase();this.protocol=G,K=K.substr(H.length)}if(O||H||K.match(/^\/\/[^@\/]+@[^@\/]+/)){var V=K.substr(0,2)==="//";!V||H&&g[H]||(K=K.substr(2),this.slashes=!0)}if(!g[H]&&(V||H&&!y[H])){for(var re=-1,$=0;$<m.length;$++){var ne=K.indexOf(m[$]);ne!==-1&&(re===-1||ne<re)&&(re=ne)}var he,pe;pe=re===-1?K.lastIndexOf("@"):K.lastIndexOf("@",re),pe!==-1&&(he=K.slice(0,pe),K=K.slice(pe+1),this.auth=decodeURIComponent(he)),re=-1;for(var $=0;$<c.length;$++){var ne=K.indexOf(c[$]);ne!==-1&&(re===-1||ne<re)&&(re=ne)}re===-1&&(re=K.length),this.host=K.slice(0,re),K=K.slice(re),this.parseHost(),this.hostname=this.hostname||"";var Te=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Te)for(var we=this.hostname.split(/\./),$=0,Me=we.length;$<Me;$++){var Ee=we[$];if(Ee&&!Ee.match(v)){for(var xe="",Ge=0,je=Ee.length;Ge<je;Ge++)Ee.charCodeAt(Ge)>127?xe+="x":xe+=Ee[Ge];if(!xe.match(v)){var We=we.slice(0,$),ze=we.slice($+1),de=Ee.match(b);de&&(We.push(de[1]),ze.unshift(de[2])),ze.length&&(K="/"+ze.join(".")+K),this.hostname=We.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),Te||(this.hostname=o.toASCII(this.hostname));var le=this.port?":"+this.port:"",Oe=this.hostname||"";this.host=Oe+le,this.href+=this.host,Te&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),K[0]!=="/"&&(K="/"+K))}if(!E[G])for(var $=0,Me=n.length;$<Me;$++){var Ie=n[$];if(K.indexOf(Ie)!==-1){var qe=encodeURIComponent(Ie);qe===Ie&&(qe=escape(Ie)),K=K.split(Ie).join(qe)}}var ee=K.indexOf("#");ee!==-1&&(this.hash=K.substr(ee),K=K.slice(0,ee));var k=K.indexOf("?");if(k!==-1?(this.search=K.substr(k),this.query=K.substr(k+1),_&&(this.query=C.parse(this.query)),K=K.slice(0,k)):_&&(this.search="",this.query={}),K&&(this.pathname=K),y[G]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var le=this.pathname||"",U=this.search||"";this.path=le+U}return this.href=this.format(),this},T.prototype.format=function(){var d=this.auth||"";d&&(d=encodeURIComponent(d),d=d.replace(/%3A/i,":"),d+="@");var _=this.protocol||"",O=this.pathname||"",A=this.hash||"",P=!1,I="";this.host?P=d+this.host:this.hostname&&(P=d+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(P+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(I=C.stringify(this.query));var W=this.search||I&&"?"+I||"";return _&&_.substr(-1)!==":"&&(_+=":"),this.slashes||(!_||y[_])&&P!==!1?(P="//"+(P||""),O&&O.charAt(0)!=="/"&&(O="/"+O)):P||(P=""),A&&A.charAt(0)!=="#"&&(A="#"+A),W&&W.charAt(0)!=="?"&&(W="?"+W),O=O.replace(/[?#]/g,function(K){return encodeURIComponent(K)}),W=W.replace("#","%23"),_+P+O+W+A},T.prototype.resolve=function(d){return this.resolveObject(w(d,!1,!0)).format()},T.prototype.resolveObject=function(d){if(i.isString(d)){var _=new T;_.parse(d,!1,!0),d=_}for(var O=new T,A=Object.keys(this),P=0;P<A.length;P++){var I=A[P];O[I]=this[I]}if(O.hash=d.hash,d.href==="")return O.href=O.format(),O;if(d.slashes&&!d.protocol){for(var W=Object.keys(d),K=0;K<W.length;K++){var te=W[K];te!=="protocol"&&(O[te]=d[te])}return y[O.protocol]&&O.hostname&&!O.pathname&&(O.path=O.pathname="/"),O.href=O.format(),O}if(d.protocol&&d.protocol!==O.protocol){if(!y[d.protocol]){for(var H=Object.keys(d),G=0;G<H.length;G++){var V=H[G];O[V]=d[V]}return O.href=O.format(),O}if(O.protocol=d.protocol,d.host||g[d.protocol])O.pathname=d.pathname;else{for(var Me=(d.pathname||"").split("/");Me.length&&!(d.host=Me.shift()););d.host||(d.host=""),d.hostname||(d.hostname=""),Me[0]!==""&&Me.unshift(""),Me.length<2&&Me.unshift(""),O.pathname=Me.join("/")}if(O.search=d.search,O.query=d.query,O.host=d.host||"",O.auth=d.auth,O.hostname=d.hostname||d.host,O.port=d.port,O.pathname||O.search){var re=O.pathname||"",$=O.search||"";O.path=re+$}return O.slashes=O.slashes||d.slashes,O.href=O.format(),O}var ne=O.pathname&&O.pathname.charAt(0)==="/",he=d.host||d.pathname&&d.pathname.charAt(0)==="/",pe=he||ne||O.host&&d.pathname,Te=pe,we=O.pathname&&O.pathname.split("/")||[],Me=d.pathname&&d.pathname.split("/")||[],Ee=O.protocol&&!y[O.protocol];if(Ee&&(O.hostname="",O.port=null,O.host&&(we[0]===""?we[0]=O.host:we.unshift(O.host)),O.host="",d.protocol&&(d.hostname=null,d.port=null,d.host&&(Me[0]===""?Me[0]=d.host:Me.unshift(d.host)),d.host=null),pe=pe&&(Me[0]===""||we[0]==="")),he)O.host=d.host||d.host===""?d.host:O.host,O.hostname=d.hostname||d.hostname===""?d.hostname:O.hostname,O.search=d.search,O.query=d.query,we=Me;else if(Me.length)we||(we=[]),we.pop(),we=we.concat(Me),O.search=d.search,O.query=d.query;else if(!i.isNullOrUndefined(d.search)){if(Ee){O.hostname=O.host=we.shift();var xe=!!(O.host&&O.host.indexOf("@")>0)&&O.host.split("@");xe&&(O.auth=xe.shift(),O.host=O.hostname=xe.shift())}return O.search=d.search,O.query=d.query,i.isNull(O.pathname)&&i.isNull(O.search)||(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.href=O.format(),O}if(!we.length)return O.pathname=null,O.search?O.path="/"+O.search:O.path=null,O.href=O.format(),O;for(var Ge=we.slice(-1)[0],je=(O.host||d.host||we.length>1)&&(Ge==="."||Ge==="..")||Ge==="",We=0,ze=we.length;ze>=0;ze--)Ge=we[ze],Ge==="."?we.splice(ze,1):Ge===".."?(we.splice(ze,1),We++):We&&(we.splice(ze,1),We--);if(!pe&&!Te)for(;We--;We)we.unshift("..");!pe||we[0]===""||we[0]&&we[0].charAt(0)==="/"||we.unshift(""),je&&we.join("/").substr(-1)!=="/"&&we.push("");var de=we[0]===""||we[0]&&we[0].charAt(0)==="/";if(Ee){O.hostname=O.host=de?"":we.length?we.shift():"";var xe=!!(O.host&&O.host.indexOf("@")>0)&&O.host.split("@");xe&&(O.auth=xe.shift(),O.host=O.hostname=xe.shift())}return pe=pe||O.host&&we.length,pe&&!de&&we.unshift(""),we.length?O.pathname=we.join("/"):(O.pathname=null,O.path=null),i.isNull(O.pathname)&&i.isNull(O.search)||(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.auth=d.auth||O.auth,O.slashes=O.slashes||d.slashes,O.href=O.format(),O},T.prototype.parseHost=function(){var d=this.host,_=s.exec(d);_&&(_=_[0],_!==":"&&(this.port=_.substr(1)),d=d.substr(0,d.length-_.length)),d&&(this.hostname=d)}},{"./util":204,punycode:174,querystring:177}],204:[function(S,D,x){"use strict";D.exports={isString:function(T){return typeof T=="string"},isObject:function(T){return typeof T=="object"&&T!==null},isNull:function(T){return T===null},isNullOrUndefined:function(T){return T==null}}},{}],205:[function(S,D,x){(function(T){function w(p,u){function o(){if(!i){if(f("throwDeprecation"))throw new Error(u);f("traceDeprecation")?console.trace(u):console.warn(u),i=!0}return p.apply(this,arguments)}if(f("noDeprecation"))return p;var i=!1;return o}function f(p){try{if(!T.localStorage)return!1}catch(o){return!1}var u=T.localStorage[p];return u!=null&&String(u).toLowerCase()==="true"}D.exports=w}).call(this,typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],206:[function(S,D,x){D.exports=function(T){return T&&typeof T=="object"&&typeof T.copy=="function"&&typeof T.fill=="function"&&typeof T.readUInt8=="function"}},{}],207:[function(S,D,x){(function(T,w){function f($,ne){var he={seen:[],stylize:u};return arguments.length>=3&&(he.depth=arguments[2]),arguments.length>=4&&(he.colors=arguments[3]),c(ne)?he.showHidden=ne:ne&&x._extend(he,ne),y(he.showHidden)&&(he.showHidden=!1),y(he.depth)&&(he.depth=2),y(he.colors)&&(he.colors=!1),y(he.customInspect)&&(he.customInspect=!0),he.colors&&(he.stylize=p),i(he,$,he.depth)}function p($,ne){var he=f.styles[ne];return he?"["+f.colors[he][0]+"m"+$+"["+f.colors[he][1]+"m":$}function u($,ne){return $}function o($){var ne={};return $.forEach(function(he,pe){ne[he]=!0}),ne}function i($,ne,he){if($.customInspect&&ne&&A(ne.inspect)&&ne.inspect!==x.inspect&&(!ne.constructor||ne.constructor.prototype!==ne)){var pe=ne.inspect(he,$);return E(pe)||(pe=i($,pe,he)),pe}var Te=l($,ne);if(Te)return Te;var we=Object.keys(ne),Me=o(we);if($.showHidden&&(we=Object.getOwnPropertyNames(ne)),O(ne)&&(we.indexOf("message")>=0||we.indexOf("description")>=0))return s(ne);if(we.length===0){if(A(ne)){var Ee=ne.name?": "+ne.name:"";return $.stylize("[Function"+Ee+"]","special")}if(C(ne))return $.stylize(RegExp.prototype.toString.call(ne),"regexp");if(_(ne))return $.stylize(Date.prototype.toString.call(ne),"date");if(O(ne))return s(ne)}var xe="",Ge=!1,je=["{","}"];if((n(ne)&&(Ge=!0,je=["[","]"]),A(ne))&&(xe=" [Function"+(ne.name?": "+ne.name:"")+"]"),C(ne)&&(xe=" "+RegExp.prototype.toString.call(ne)),_(ne)&&(xe=" "+Date.prototype.toUTCString.call(ne)),O(ne)&&(xe=" "+s(ne)),we.length===0&&(!Ge||ne.length==0))return je[0]+xe+je[1];if(he<0)return C(ne)?$.stylize(RegExp.prototype.toString.call(ne),"regexp"):$.stylize("[Object]","special");$.seen.push(ne);var We;return We=Ge?h($,ne,he,Me,we):we.map(function(ze){return r($,ne,he,Me,ze,Ge)}),$.seen.pop(),t(We,xe,je)}function l($,ne){if(y(ne))return $.stylize("undefined","undefined");if(E(ne)){var he="'"+JSON.stringify(ne).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(he,"string")}return b(ne)?$.stylize(""+ne,"number"):c(ne)?$.stylize(""+ne,"boolean"):m(ne)?$.stylize("null","null"):void 0}function s($){return"["+Error.prototype.toString.call($)+"]"}function h($,ne,he,pe,Te){for(var we=[],Me=0,Ee=ne.length;Me<Ee;++Me)te(ne,String(Me))?we.push(r($,ne,he,pe,String(Me),!0)):we.push("");return Te.forEach(function(xe){xe.match(/^\d+$/)||we.push(r($,ne,he,pe,xe,!0))}),we}function r($,ne,he,pe,Te,we){var Me,Ee,xe;if(xe=Object.getOwnPropertyDescriptor(ne,Te)||{value:ne[Te]},xe.get?Ee=xe.set?$.stylize("[Getter/Setter]","special"):$.stylize("[Getter]","special"):xe.set&&(Ee=$.stylize("[Setter]","special")),te(pe,Te)||(Me="["+Te+"]"),Ee||($.seen.indexOf(xe.value)<0?(Ee=m(he)?i($,xe.value,null):i($,xe.value,he-1),Ee.indexOf(`
|
|
|
`)>-1&&(Ee=we?Ee.split(`
|
|
|
`).map(function(Ge){return" "+Ge}).join(`
|
|
|
`).substr(2):`
|
|
|
`+Ee.split(`
|
|
|
`).map(function(Ge){return" "+Ge}).join(`
|
|
|
`))):Ee=$.stylize("[Circular]","special")),y(Me)){if(we&&Te.match(/^\d+$/))return Ee;Me=JSON.stringify(""+Te),Me.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Me=Me.substr(1,Me.length-2),Me=$.stylize(Me,"name")):(Me=Me.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Me=$.stylize(Me,"string"))}return Me+": "+Ee}function t($,ne,he){var pe=0;return $.reduce(function(Te,we){return pe++,we.indexOf(`
|
|
|
`)>=0&&pe++,Te+we.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?he[0]+(ne===""?"":ne+`
|
|
|
`)+" "+$.join(`,
|
|
|
`)+" "+he[1]:he[0]+ne+" "+$.join(", ")+" "+he[1]}function n($){return Array.isArray($)}function c($){return typeof $=="boolean"}function m($){return $===null}function v($){return $==null}function b($){return typeof $=="number"}function E($){return typeof $=="string"}function g($){return typeof $=="symbol"}function y($){return $===void 0}function C($){return d($)&&I($)==="[object RegExp]"}function d($){return typeof $=="object"&&$!==null}function _($){return d($)&&I($)==="[object Date]"}function O($){return d($)&&(I($)==="[object Error]"||$ instanceof Error)}function A($){return typeof $=="function"}function P($){return $===null||typeof $=="boolean"||typeof $=="number"||typeof $=="string"||typeof $=="symbol"||$===void 0}function I($){return Object.prototype.toString.call($)}function W($){return $<10?"0"+$.toString(10):$.toString(10)}function K(){var $=new Date,ne=[W($.getHours()),W($.getMinutes()),W($.getSeconds())].join(":");return[$.getDate(),re[$.getMonth()],ne].join(" ")}function te($,ne){return Object.prototype.hasOwnProperty.call($,ne)}var H=/%[sdj%]/g;x.format=function($){if(!E($)){for(var ne=[],he=0;he<arguments.length;he++)ne.push(f(arguments[he]));return ne.join(" ")}for(var he=1,pe=arguments,Te=pe.length,we=String($).replace(H,function(xe){if(xe==="%%")return"%";if(he>=Te)return xe;switch(xe){case"%s":return String(pe[he++]);case"%d":return Number(pe[he++]);case"%j":try{return JSON.stringify(pe[he++])}catch(Ge){return"[Circular]"}default:return xe}}),Me=pe[he];he<Te;Me=pe[++he])m(Me)||!d(Me)?we+=" "+Me:we+=" "+f(Me);return we},x.deprecate=function($,ne){function he(){if(!pe){if(T.throwDeprecation)throw new Error(ne);T.traceDeprecation?console.trace(ne):console.error(ne),pe=!0}return $.apply(this,arguments)}if(y(w.process))return function(){return x.deprecate($,ne).apply(this,arguments)};if(T.noDeprecation===!0)return $;var pe=!1;return he};var G,V={};x.debuglog=function($){if(y(G)&&(G=T.env.NODE_DEBUG||""),$=$.toUpperCase(),!V[$])if(new RegExp("\\b"+$+"\\b","i").test(G)){var ne=T.pid;V[$]=function(){var he=x.format.apply(x,arguments);console.error("%s %d: %s",$,ne,he)}}else V[$]=function(){};return V[$]},x.inspect=f,f.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]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},x.isArray=n,x.isBoolean=c,x.isNull=m,x.isNullOrUndefined=v,x.isNumber=b,x.isString=E,x.isSymbol=g,x.isUndefined=y,x.isRegExp=C,x.isObject=d,x.isDate=_,x.isError=O,x.isFunction=A,x.isPrimitive=P,x.isBuffer=S("./support/isBuffer");var re=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];x.log=function(){console.log("%s - %s",K(),x.format.apply(x,arguments))},x.inherits=S("inherits"),x._extend=function($,ne){if(!ne||!d(ne))return $;for(var he=Object.keys(ne),pe=he.length;pe--;)$[he[pe]]=ne[he[pe]];return $}}).call(this,S("_process"),typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":206,_process:173,inherits:162}],208:[function(S,D,x){"use strict";(function(){x.stripBOM=function(T){return T[0]==="\uFEFF"?T.substring(1):T}}).call(void 0)},{}],209:[function(S,D,x){"use strict";function T(o){return o&&o.__esModule?o:{default:o}}var w=S("babel-runtime/helpers/typeof"),f=T(w),p=S("babel-runtime/core-js/object/keys"),u=T(p);(function(){var o,i,l,s,h,r={}.hasOwnProperty;o=S("xmlbuilder"),i=S("./defaults").defaults,s=function(t){return typeof t=="string"&&(t.indexOf("&")>=0||t.indexOf(">")>=0||t.indexOf("<")>=0)},h=function(t){return"<![CDATA["+l(t)+"]]>"},l=function(t){return t.replace("]]>","]]]]><![CDATA[>")},x.Builder=function(){function t(n){var c,m,v;this.options={},m=i[.2];for(c in m)r.call(m,c)&&(v=m[c],this.options[c]=v);for(c in n)r.call(n,c)&&(v=n[c],this.options[c]=v)}return t.prototype.buildObject=function(n){var c,m,v,b,E;return c=this.options.attrkey,m=this.options.charkey,(0,u.default)(n).length===1&&this.options.rootName===i[.2].rootName?(E=(0,u.default)(n)[0],n=n[E]):E=this.options.rootName,v=function(g){return function(y,C){var d,_,O,A,P,I;if((C===void 0?"undefined":(0,f.default)(C))!=="object")g.options.cdata&&s(C)?y.raw(h(C)):y.txt(C);else if(Array.isArray(C)){for(A in C)if(r.call(C,A)){_=C[A];for(P in _)O=_[P],y=v(y.ele(P),O).up()}}else for(P in C)if(r.call(C,P))if(_=C[P],P===c){if((_===void 0?"undefined":(0,f.default)(_))==="object")for(d in _)I=_[d],y=y.att(d,I)}else if(P===m)y=g.options.cdata&&s(_)?y.raw(h(_)):y.txt(_);else if(Array.isArray(_))for(A in _)r.call(_,A)&&(O=_[A],y=typeof O=="string"?g.options.cdata&&s(O)?y.ele(P).raw(h(O)).up():y.ele(P,O).up():v(y.ele(P),O).up());else(_===void 0?"undefined":(0,f.default)(_))==="object"?y=v(y.ele(P),_).up():typeof _=="string"&&g.options.cdata&&s(_)?y=y.ele(P).raw(h(_)).up():(_==null&&(_=""),y=y.ele(P,_.toString()).up());return y}}(this),b=o.create(E,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),v(b,n).end(this.options.renderOpts)},t}()}).call(void 0)},{"./defaults":210,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,xmlbuilder:235}],210:[function(S,D,x){"use strict";(function(){x.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(S,D,x){"use strict";function T(l){return l&&l.__esModule?l:{default:l}}var w=S("babel-runtime/core-js/object/get-own-property-names"),f=T(w),p=S("babel-runtime/core-js/object/keys"),u=T(p),o=S("babel-runtime/helpers/typeof"),i=T(o);(function(){var l,s,h,r,t,n,c,m,v=function(g,y){return function(){return g.apply(y,arguments)}},b=function(g,y){function C(){this.constructor=g}for(var d in y)E.call(y,d)&&(g[d]=y[d]);return C.prototype=y.prototype,g.prototype=new C,g.__super__=y.prototype,g},E={}.hasOwnProperty;c=S("sax"),h=S("events"),l=S("./bom"),n=S("./processors"),m=S("timers").setImmediate,s=S("./defaults").defaults,r=function(g){return(g===void 0?"undefined":(0,i.default)(g))==="object"&&g!=null&&(0,u.default)(g).length===0},t=function(g,y,C){var d,_,O;for(d=0,_=g.length;d<_;d++)O=g[d],y=O(y,C);return y},x.Parser=function(g){function y(C){this.parseString=v(this.parseString,this),this.reset=v(this.reset,this),this.assignOrPush=v(this.assignOrPush,this),this.processAsync=v(this.processAsync,this);var d,_,O;if(!(this instanceof x.Parser))return new x.Parser(C);this.options={},_=s[.2];for(d in _)E.call(_,d)&&(O=_[d],this.options[d]=O);for(d in C)E.call(C,d)&&(O=C[d],this.options[d]=O);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(n.normalize)),this.reset()}return b(y,g),y.prototype.processAsync=function(){var C,d;try{return this.remaining.length<=this.options.chunkSize?(C=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(C),this.saxParser.close()):(C=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(C),m(this.processAsync))}catch(_){if(d=_,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(d)}},y.prototype.assignOrPush=function(C,d,_){return d in C?(C[d]instanceof Array||(C[d]=[C[d]]),C[d].push(_)):this.options.explicitArray?C[d]=[_]:C[d]=_},y.prototype.reset=function(){var C,d,_,O;return this.removeAllListeners(),this.saxParser=c.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(A){return function(P){if(A.saxParser.resume(),!A.saxParser.errThrown)return A.saxParser.errThrown=!0,A.emit("error",P)}}(this),this.saxParser.onend=function(A){return function(){if(!A.saxParser.ended)return A.saxParser.ended=!0,A.emit("end",A.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,O=[],C=this.options.attrkey,d=this.options.charkey,this.saxParser.onopentag=function(A){return function(P){var I,W,K,te,H;if(K={},K[d]="",!A.options.ignoreAttrs){H=P.attributes;for(I in H)E.call(H,I)&&(C in K||A.options.mergeAttrs||(K[C]={}),W=A.options.attrValueProcessors?t(A.options.attrValueProcessors,P.attributes[I],I):P.attributes[I],te=A.options.attrNameProcessors?t(A.options.attrNameProcessors,I):I,A.options.mergeAttrs?A.assignOrPush(K,te,W):K[C][te]=W)}return K["#name"]=A.options.tagNameProcessors?t(A.options.tagNameProcessors,P.name):P.name,A.options.xmlns&&(K[A.options.xmlnskey]={uri:P.uri,local:P.local}),O.push(K)}}(this),this.saxParser.onclosetag=function(A){return function(){var P,I,W,K,te,H,G,V,re,$;if(H=O.pop(),te=H["#name"],A.options.explicitChildren&&A.options.preserveChildrenOrder||delete H["#name"],H.cdata===!0&&(P=H.cdata,delete H.cdata),re=O[O.length-1],H[d].match(/^\s*$/)&&!P?(I=H[d],delete H[d]):(A.options.trim&&(H[d]=H[d].trim()),A.options.normalize&&(H[d]=H[d].replace(/\s{2,}/g," ").trim()),H[d]=A.options.valueProcessors?t(A.options.valueProcessors,H[d],te):H[d],(0,u.default)(H).length===1&&d in H&&!A.EXPLICIT_CHARKEY&&(H=H[d])),r(H)&&(H=A.options.emptyTag!==""?A.options.emptyTag:I),A.options.validator!=null&&($="/"+function(){var ne,he,pe;for(pe=[],ne=0,he=O.length;ne<he;ne++)K=O[ne],pe.push(K["#name"]);return pe}().concat(te).join("/"),function(){var ne;try{H=A.options.validator($,re&&re[te],H)}catch(he){return ne=he,A.emit("error",ne)}}()),A.options.explicitChildren&&!A.options.mergeAttrs&&(H===void 0?"undefined":(0,i.default)(H))==="object")if(A.options.preserveChildrenOrder){if(re){re[A.options.childkey]=re[A.options.childkey]||[],G={};for(W in H)E.call(H,W)&&(G[W]=H[W]);re[A.options.childkey].push(G),delete H["#name"],(0,u.default)(H).length===1&&d in H&&!A.EXPLICIT_CHARKEY&&(H=H[d])}}else K={},A.options.attrkey in H&&(K[A.options.attrkey]=H[A.options.attrkey],delete H[A.options.attrkey]),!A.options.charsAsChildren&&A.options.charkey in H&&(K[A.options.charkey]=H[A.options.charkey],delete H[A.options.charkey]),(0,f.default)(H).length>0&&(K[A.options.childkey]=H),H=K;return O.length>0?A.assignOrPush(re,te,H):(A.options.explicitRoot&&(V=H,H={},H[te]=V),A.resultObject=H,A.saxParser.ended=!0,A.emit("end",A.resultObject))}}(this),_=function(A){return function(P){var I,W;if(W=O[O.length-1])return W[d]+=P,A.options.explicitChildren&&A.options.preserveChildrenOrder&&A.options.charsAsChildren&&(A.options.includeWhiteChars||P.replace(/\\n/g,"").trim()!=="")&&(W[A.options.childkey]=W[A.options.childkey]||[],I={"#name":"__text__"},I[d]=P,A.options.normalize&&(I[d]=I[d].replace(/\s{2,}/g," ").trim()),W[A.options.childkey].push(I)),W}}(this),this.saxParser.ontext=_,this.saxParser.oncdata=function(A){return function(P){var I;if(I=_(P))return I.cdata=!0}}()},y.prototype.parseString=function(C,d){var _;d!=null&&typeof d=="function"&&(this.on("end",function(O){return this.reset(),d(null,O)}),this.on("error",function(O){return this.reset(),d(O)}));try{return C=C.toString(),C.trim()===""?(this.emit("end",null),!0):(C=l.stripBOM(C),this.options.async?(this.remaining=C,m(this.processAsync),this.saxParser):this.saxParser.write(C).close())}catch(O){if(_=O,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",_),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw _}},y}(h.EventEmitter),x.parseString=function(g,y,C){var d,_,O;return C!=null?(typeof C=="function"&&(d=C),(y===void 0?"undefined":(0,i.default)(y))==="object"&&(_=y)):(typeof y=="function"&&(d=y),_={}),O=new x.Parser(_),O.parseString(g,d)}}).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(S,D,x){"use strict";(function(){var T;T=new RegExp(/(?!xmlns)^.*:/),x.normalize=function(w){return w.toLowerCase()},x.firstCharLowerCase=function(w){return w.charAt(0).toLowerCase()+w.slice(1)},x.stripPrefix=function(w){return w.replace(T,"")},x.parseNumbers=function(w){return isNaN(w)||(w=w%1==0?parseInt(w,10):parseFloat(w)),w},x.parseBooleans=function(w){return/^(?:true|false)$/i.test(w)&&(w=w.toLowerCase()==="true"),w}}).call(void 0)},{}],213:[function(S,D,x){"use strict";(function(){var T,w,f,p,u=function(i,l){function s(){this.constructor=i}for(var h in l)o.call(l,h)&&(i[h]=l[h]);return s.prototype=l.prototype,i.prototype=new s,i.__super__=l.prototype,i},o={}.hasOwnProperty;w=S("./defaults"),T=S("./builder"),f=S("./parser"),p=S("./processors"),x.defaults=w.defaults,x.processors=p,x.ValidationError=function(i){function l(s){this.message=s}return u(l,i),l}(Error),x.Builder=T.Builder,x.Parser=f.Parser,x.parseString=f.parseString}).call(void 0)},{"./builder":209,"./defaults":210,"./parser":211,"./processors":212}],214:[function(S,D,x){"use strict";function T(l){return l&&l.__esModule?l:{default:l}}var w=S("babel-runtime/core-js/object/get-prototype-of"),f=T(w),p=S("babel-runtime/helpers/typeof"),u=T(p),o=S("babel-runtime/core-js/object/assign"),i=T(o);(function(){var l,s,h,r,t,n,c=[].slice,m={}.hasOwnProperty;l=function(){var v,b,E,g,y,C;if(C=arguments[0],y=2<=arguments.length?c.call(arguments,1):[],r(i.default))i.default.apply(null,arguments);else for(v=0,E=y.length;v<E;v++)if((g=y[v])!=null)for(b in g)m.call(g,b)&&(C[b]=g[b]);return C},r=function(v){return!!v&&Object.prototype.toString.call(v)==="[object Function]"},t=function(v){var b;return!!v&&((b=v===void 0?"undefined":(0,u.default)(v))==="function"||b==="object")},s=function(v){return r(Array.isArray)?Array.isArray(v):Object.prototype.toString.call(v)==="[object Array]"},h=function(v){var b;if(s(v))return!v.length;for(b in v)if(m.call(v,b))return!1;return!0},n=function(v){var b,E;return t(v)&&(E=(0,f.default)(v))&&(b=E.constructor)&&typeof b=="function"&&b instanceof b&&Function.prototype.toString.call(b)===Function.prototype.toString.call(Object)},D.exports.assign=l,D.exports.isFunction=r,D.exports.isObject=t,D.exports.isArray=s,D.exports.isEmpty=h,D.exports.isPlainObject=n}).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(S,D,x){"use strict";var T=S("babel-runtime/core-js/object/create"),w=function(f){return f&&f.__esModule?f:{default:f}}(T);(function(){D.exports=function(){function f(p,u,o){if(this.options=p.options,this.stringify=p.stringify,u==null)throw new Error("Missing attribute name of element "+p.name);if(o==null)throw new Error("Missing attribute value for attribute "+u+" of element "+p.name);this.name=this.stringify.attName(u),this.value=this.stringify.attValue(o)}return f.prototype.clone=function(){return(0,w.default)(this)},f.prototype.toString=function(p){return this.options.writer.set(p).attribute(this)},f}()}).call(void 0)},{"babel-runtime/core-js/object/create":19}],216:[function(S,D,x){"use strict";var T=S("babel-runtime/core-js/object/create"),w=function(f){return f&&f.__esModule?f:{default:f}}(T);(function(){var f,p=function(o,i){function l(){this.constructor=o}for(var s in i)u.call(i,s)&&(o[s]=i[s]);return l.prototype=i.prototype,o.prototype=new l,o.__super__=i.prototype,o},u={}.hasOwnProperty;f=S("./XMLNode"),D.exports=function(o){function i(l,s){if(i.__super__.constructor.call(this,l),s==null)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(s)}return p(i,o),i.prototype.clone=function(){return(0,w.default)(this)},i.prototype.toString=function(l){return this.options.writer.set(l).cdata(this)},i}(f)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],217:[function(S,D,x){"use strict";var T=S("babel-runtime/core-js/object/create"),w=function(f){return f&&f.__esModule?f:{default:f}}(T);(function(){var f,p=function(o,i){function l(){this.constructor=o}for(var s in i)u.call(i,s)&&(o[s]=i[s]);return l.prototype=i.prototype,o.prototype=new l,o.__super__=i.prototype,o},u={}.hasOwnProperty;f=S("./XMLNode"),D.exports=function(o){function i(l,s){if(i.__super__.constructor.call(this,l),s==null)throw new Error("Missing comment text");this.text=this.stringify.comment(s)}return p(i,o),i.prototype.clone=function(){return(0,w.default)(this)},i.prototype.toString=function(l){return this.options.writer.set(l).comment(this)},i}(f)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],218:[function(S,D,x){"use strict";(function(){var T,w=function(p,u){function o(){this.constructor=p}for(var i in u)f.call(u,i)&&(p[i]=u[i]);return o.prototype=u.prototype,p.prototype=new o,p.__super__=u.prototype,p},f={}.hasOwnProperty;T=S("./XMLNode"),D.exports=function(p){function u(o,i,l,s,h,r){if(u.__super__.constructor.call(this,o),i==null)throw new Error("Missing DTD element name");if(l==null)throw new Error("Missing DTD attribute name");if(!s)throw new Error("Missing DTD attribute type");if(!h)throw new Error("Missing DTD attribute default");if(h.indexOf("#")!==0&&(h="#"+h),!h.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(r&&!h.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(i),this.attributeName=this.stringify.attName(l),this.attributeType=this.stringify.dtdAttType(s),this.defaultValue=this.stringify.dtdAttDefault(r),this.defaultValueType=h}return w(u,p),u.prototype.toString=function(o){return this.options.writer.set(o).dtdAttList(this)},u}(T)}).call(void 0)},{"./XMLNode":227}],219:[function(S,D,x){"use strict";(function(){var T,w=function(p,u){function o(){this.constructor=p}for(var i in u)f.call(u,i)&&(p[i]=u[i]);return o.prototype=u.prototype,p.prototype=new o,p.__super__=u.prototype,p},f={}.hasOwnProperty;T=S("./XMLNode"),D.exports=function(p){function u(o,i,l){if(u.__super__.constructor.call(this,o),i==null)throw new Error("Missing DTD element name");l||(l="(#PCDATA)"),Array.isArray(l)&&(l="("+l.join(",")+")"),this.name=this.stringify.eleName(i),this.value=this.stringify.dtdElementValue(l)}return w(u,p),u.prototype.toString=function(o){return this.options.writer.set(o).dtdElement(this)},u}(T)}).call(void 0)},{"./XMLNode":227}],220:[function(S,D,x){"use strict";(function(){var T,w,f=function(u,o){function i(){this.constructor=u}for(var l in o)p.call(o,l)&&(u[l]=o[l]);return i.prototype=o.prototype,u.prototype=new i,u.__super__=o.prototype,u},p={}.hasOwnProperty;w=S("./Utility").isObject,T=S("./XMLNode"),D.exports=function(u){function o(i,l,s,h){if(o.__super__.constructor.call(this,i),s==null)throw new Error("Missing entity name");if(h==null)throw new Error("Missing entity value");if(this.pe=!!l,this.name=this.stringify.eleName(s),w(h)){if(!h.pubID&&!h.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(h.pubID&&!h.sysID)throw new Error("System identifier is required for a public external entity");if(h.pubID!=null&&(this.pubID=this.stringify.dtdPubID(h.pubID)),h.sysID!=null&&(this.sysID=this.stringify.dtdSysID(h.sysID)),h.nData!=null&&(this.nData=this.stringify.dtdNData(h.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}else this.value=this.stringify.dtdEntityValue(h)}return f(o,u),o.prototype.toString=function(i){return this.options.writer.set(i).dtdEntity(this)},o}(T)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],221:[function(S,D,x){"use strict";(function(){var T,w=function(p,u){function o(){this.constructor=p}for(var i in u)f.call(u,i)&&(p[i]=u[i]);return o.prototype=u.prototype,p.prototype=new o,p.__super__=u.prototype,p},f={}.hasOwnProperty;T=S("./XMLNode"),D.exports=function(p){function u(o,i,l){if(u.__super__.constructor.call(this,o),i==null)throw new Error("Missing notation name");if(!l.pubID&&!l.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(i),l.pubID!=null&&(this.pubID=this.stringify.dtdPubID(l.pubID)),l.sysID!=null&&(this.sysID=this.stringify.dtdSysID(l.sysID))}return w(u,p),u.prototype.toString=function(o){return this.options.writer.set(o).dtdNotation(this)},u}(T)}).call(void 0)},{"./XMLNode":227}],222:[function(S,D,x){"use strict";(function(){var T,w,f=function(u,o){function i(){this.constructor=u}for(var l in o)p.call(o,l)&&(u[l]=o[l]);return i.prototype=o.prototype,u.prototype=new i,u.__super__=o.prototype,u},p={}.hasOwnProperty;w=S("./Utility").isObject,T=S("./XMLNode"),D.exports=function(u){function o(i,l,s,h){var r;o.__super__.constructor.call(this,i),w(l)&&(r=l,l=r.version,s=r.encoding,h=r.standalone),l||(l="1.0"),this.version=this.stringify.xmlVersion(l),s!=null&&(this.encoding=this.stringify.xmlEncoding(s)),h!=null&&(this.standalone=this.stringify.xmlStandalone(h))}return f(o,u),o.prototype.toString=function(i){return this.options.writer.set(i).declaration(this)},o}(T)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],223:[function(S,D,x){"use strict";(function(){var T,w,f,p,u,o,i=function(s,h){function r(){this.constructor=s}for(var t in h)l.call(h,t)&&(s[t]=h[t]);return r.prototype=h.prototype,s.prototype=new r,s.__super__=h.prototype,s},l={}.hasOwnProperty;o=S("./Utility").isObject,u=S("./XMLNode"),T=S("./XMLDTDAttList"),f=S("./XMLDTDEntity"),w=S("./XMLDTDElement"),p=S("./XMLDTDNotation"),D.exports=function(s){function h(r,t,n){var c,m;h.__super__.constructor.call(this,r),this.documentObject=r,o(t)&&(c=t,t=c.pubID,n=c.sysID),n==null&&(m=[t,n],n=m[0],t=m[1]),t!=null&&(this.pubID=this.stringify.dtdPubID(t)),n!=null&&(this.sysID=this.stringify.dtdSysID(n))}return i(h,s),h.prototype.element=function(r,t){var n;return n=new w(this,r,t),this.children.push(n),this},h.prototype.attList=function(r,t,n,c,m){var v;return v=new T(this,r,t,n,c,m),this.children.push(v),this},h.prototype.entity=function(r,t){var n;return n=new f(this,!1,r,t),this.children.push(n),this},h.prototype.pEntity=function(r,t){var n;return n=new f(this,!0,r,t),this.children.push(n),this},h.prototype.notation=function(r,t){var n;return n=new p(this,r,t),this.children.push(n),this},h.prototype.toString=function(r){return this.options.writer.set(r).docType(this)},h.prototype.ele=function(r,t){return this.element(r,t)},h.prototype.att=function(r,t,n,c,m){return this.attList(r,t,n,c,m)},h.prototype.ent=function(r,t){return this.entity(r,t)},h.prototype.pent=function(r,t){return this.pEntity(r,t)},h.prototype.not=function(r,t){return this.notation(r,t)},h.prototype.up=function(){return this.root()||this.documentObject},h}(u)}).call(void 0)},{"./Utility":214,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLNode":227}],224:[function(S,D,x){"use strict";(function(){var T,w,f,p,u=function(i,l){function s(){this.constructor=i}for(var h in l)o.call(l,h)&&(i[h]=l[h]);return s.prototype=l.prototype,i.prototype=new s,i.__super__=l.prototype,i},o={}.hasOwnProperty;p=S("./Utility").isPlainObject,T=S("./XMLNode"),f=S("./XMLStringifier"),w=S("./XMLStringWriter"),D.exports=function(i){function l(s){l.__super__.constructor.call(this,null),s||(s={}),s.writer||(s.writer=new w),this.options=s,this.stringify=new f(s),this.isDocument=!0}return u(l,i),l.prototype.end=function(s){var h;return s?p(s)&&(h=s,s=this.options.writer.set(h)):s=this.options.writer,s.document(this)},l.prototype.toString=function(s){return this.options.writer.set(s).document(this)},l}(T)}).call(void 0)},{"./Utility":214,"./XMLNode":227,"./XMLStringWriter":231,"./XMLStringifier":232}],225:[function(S,D,x){"use strict";(function(){var T,w,f,p,u,o,i,l,s,h,r,t,n,c,m,v,b,E,g,y={}.hasOwnProperty;g=S("./Utility"),b=g.isObject,v=g.isFunction,E=g.isPlainObject,h=S("./XMLElement"),w=S("./XMLCData"),f=S("./XMLComment"),t=S("./XMLRaw"),m=S("./XMLText"),r=S("./XMLProcessingInstruction"),l=S("./XMLDeclaration"),s=S("./XMLDocType"),p=S("./XMLDTDAttList"),o=S("./XMLDTDEntity"),u=S("./XMLDTDElement"),i=S("./XMLDTDNotation"),T=S("./XMLAttribute"),c=S("./XMLStringifier"),n=S("./XMLStringWriter"),D.exports=function(){function C(d,_,O){var A;d||(d={}),d.writer?E(d.writer)&&(A=d.writer,d.writer=new n(A)):d.writer=new n(d),this.options=d,this.writer=d.writer,this.stringify=new c(d),this.onDataCallback=_||function(){},this.onEndCallback=O||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return C.prototype.node=function(d,_,O){var A;if(d==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(),d=d.valueOf(),_==null&&(_={}),_=_.valueOf(),b(_)||(A=[_,O],O=A[0],_=A[1]),this.currentNode=new h(this,d,_),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,O!=null&&this.text(O),this},C.prototype.element=function(d,_,O){return this.currentNode&&this.currentNode instanceof s?this.dtdElement.apply(this,arguments):this.node(d,_,O)},C.prototype.attribute=function(d,_){var O,A;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode");if(d!=null&&(d=d.valueOf()),b(d))for(O in d)y.call(d,O)&&(A=d[O],this.attribute(O,A));else v(_)&&(_=_.apply()),this.options.skipNullAttributes&&_==null||(this.currentNode.attributes[d]=new T(this,d,_));return this},C.prototype.text=function(d){var _;return this.openCurrent(),_=new m(this,d),this.onData(this.writer.text(_,this.currentLevel+1)),this},C.prototype.cdata=function(d){var _;return this.openCurrent(),_=new w(this,d),this.onData(this.writer.cdata(_,this.currentLevel+1)),this},C.prototype.comment=function(d){var _;return this.openCurrent(),_=new f(this,d),this.onData(this.writer.comment(_,this.currentLevel+1)),this},C.prototype.raw=function(d){var _;return this.openCurrent(),_=new t(this,d),this.onData(this.writer.raw(_,this.currentLevel+1)),this},C.prototype.instruction=function(d,_){var O,A,P,I,W;if(this.openCurrent(),d!=null&&(d=d.valueOf()),_!=null&&(_=_.valueOf()),Array.isArray(d))for(O=0,I=d.length;O<I;O++)A=d[O],this.instruction(A);else if(b(d))for(A in d)y.call(d,A)&&(P=d[A],this.instruction(A,P));else v(_)&&(_=_.apply()),W=new r(this,d,_),this.onData(this.writer.processingInstruction(W,this.currentLevel+1));return this},C.prototype.declaration=function(d,_,O){var A;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node");return A=new l(this,d,_,O),this.onData(this.writer.declaration(A,this.currentLevel+1)),this},C.prototype.doctype=function(d,_,O){if(this.openCurrent(),d==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 s(this,_,O),this.currentNode.rootNodeName=d,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},C.prototype.dtdElement=function(d,_){var O;return this.openCurrent(),O=new u(this,d,_),this.onData(this.writer.dtdElement(O,this.currentLevel+1)),this},C.prototype.attList=function(d,_,O,A,P){var I;return this.openCurrent(),I=new p(this,d,_,O,A,P),this.onData(this.writer.dtdAttList(I,this.currentLevel+1)),this},C.prototype.entity=function(d,_){var O;return this.openCurrent(),O=new o(this,!1,d,_),this.onData(this.writer.dtdEntity(O,this.currentLevel+1)),this},C.prototype.pEntity=function(d,_){var O;return this.openCurrent(),O=new o(this,!0,d,_),this.onData(this.writer.dtdEntity(O,this.currentLevel+1)),this},C.prototype.notation=function(d,_){var O;return this.openCurrent(),O=new i(this,d,_),this.onData(this.writer.dtdNotation(O,this.currentLevel+1)),this},C.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},C.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},C.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},C.prototype.openNode=function(d){if(!d.isOpen)return!this.root&&this.currentLevel===0&&d instanceof h&&(this.root=d),this.onData(this.writer.openNode(d,this.currentLevel)),d.isOpen=!0},C.prototype.closeNode=function(d){if(!d.isClosed)return this.onData(this.writer.closeNode(d,this.currentLevel)),d.isClosed=!0},C.prototype.onData=function(d){return this.documentStarted=!0,this.onDataCallback(d)},C.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},C.prototype.ele=function(){return this.element.apply(this,arguments)},C.prototype.nod=function(d,_,O){return this.node(d,_,O)},C.prototype.txt=function(d){return this.text(d)},C.prototype.dat=function(d){return this.cdata(d)},C.prototype.com=function(d){return this.comment(d)},C.prototype.ins=function(d,_){return this.instruction(d,_)},C.prototype.dec=function(d,_,O){return this.declaration(d,_,O)},C.prototype.dtd=function(d,_,O){return this.doctype(d,_,O)},C.prototype.e=function(d,_,O){return this.element(d,_,O)},C.prototype.n=function(d,_,O){return this.node(d,_,O)},C.prototype.t=function(d){return this.text(d)},C.prototype.d=function(d){return this.cdata(d)},C.prototype.c=function(d){return this.comment(d)},C.prototype.r=function(d){return this.raw(d)},C.prototype.i=function(d,_){return this.instruction(d,_)},C.prototype.att=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},C.prototype.a=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},C.prototype.ent=function(d,_){return this.entity(d,_)},C.prototype.pent=function(d,_){return this.pEntity(d,_)},C.prototype.not=function(d,_){return this.notation(d,_)},C}()}).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(S,D,x){"use strict";var T=S("babel-runtime/core-js/object/create"),w=function(f){return f&&f.__esModule?f:{default:f}}(T);(function(){var f,p,u,o,i,l=function(h,r){function t(){this.constructor=h}for(var n in r)s.call(r,n)&&(h[n]=r[n]);return t.prototype=r.prototype,h.prototype=new t,h.__super__=r.prototype,h},s={}.hasOwnProperty;i=S("./Utility"),o=i.isObject,u=i.isFunction,p=S("./XMLNode"),f=S("./XMLAttribute"),D.exports=function(h){function r(t,n,c){if(r.__super__.constructor.call(this,t),n==null)throw new Error("Missing element name");this.name=this.stringify.eleName(n),this.attributes={},c!=null&&this.attribute(c),t.isDocument&&(this.isRoot=!0,this.documentObject=t,t.rootObject=this)}return l(r,h),r.prototype.clone=function(){var t,n,c,m;c=(0,w.default)(this),c.isRoot&&(c.documentObject=null),c.attributes={},m=this.attributes;for(n in m)s.call(m,n)&&(t=m[n],c.attributes[n]=t.clone());return c.children=[],this.children.forEach(function(v){var b;return b=v.clone(),b.parent=c,c.children.push(b)}),c},r.prototype.attribute=function(t,n){var c,m;if(t!=null&&(t=t.valueOf()),o(t))for(c in t)s.call(t,c)&&(m=t[c],this.attribute(c,m));else u(n)&&(n=n.apply()),this.options.skipNullAttributes&&n==null||(this.attributes[t]=new f(this,t,n));return this},r.prototype.removeAttribute=function(t){var n,c,m;if(t==null)throw new Error("Missing attribute name");if(t=t.valueOf(),Array.isArray(t))for(c=0,m=t.length;c<m;c++)n=t[c],delete this.attributes[n];else delete this.attributes[t];return this},r.prototype.toString=function(t){return this.options.writer.set(t).element(this)},r.prototype.att=function(t,n){return this.attribute(t,n)},r.prototype.a=function(t,n){return this.attribute(t,n)},r}(p)}).call(void 0)},{"./Utility":214,"./XMLAttribute":215,"./XMLNode":227,"babel-runtime/core-js/object/create":19}],227:[function(S,D,x){"use strict";(function(){var T,w,f,p,u,o,i,l,s,h,r,t,n={}.hasOwnProperty;t=S("./Utility"),r=t.isObject,h=t.isFunction,s=t.isEmpty,u=null,T=null,w=null,f=null,p=null,i=null,l=null,o=null,D.exports=function(){function c(m){this.parent=m,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],u||(u=S("./XMLElement"),T=S("./XMLCData"),w=S("./XMLComment"),f=S("./XMLDeclaration"),p=S("./XMLDocType"),i=S("./XMLRaw"),l=S("./XMLText"),o=S("./XMLProcessingInstruction"))}return c.prototype.element=function(m,v,b){var E,g,y,C,d,_,O,A,P,I;if(_=null,v==null&&(v={}),v=v.valueOf(),r(v)||(P=[v,b],b=P[0],v=P[1]),m!=null&&(m=m.valueOf()),Array.isArray(m))for(y=0,O=m.length;y<O;y++)g=m[y],_=this.element(g);else if(h(m))_=this.element(m.apply());else if(r(m)){for(d in m)if(n.call(m,d))if(I=m[d],h(I)&&(I=I.apply()),r(I)&&s(I)&&(I=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&d.indexOf(this.stringify.convertAttKey)===0)_=this.attribute(d.substr(this.stringify.convertAttKey.length),I);else if(!this.options.separateArrayItems&&Array.isArray(I))for(C=0,A=I.length;C<A;C++)g=I[C],E={},E[d]=g,_=this.element(E);else r(I)?(_=this.element(d),_.element(I)):_=this.element(d,I)}else _=!this.options.ignoreDecorators&&this.stringify.convertTextKey&&m.indexOf(this.stringify.convertTextKey)===0?this.text(b):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&m.indexOf(this.stringify.convertCDataKey)===0?this.cdata(b):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&m.indexOf(this.stringify.convertCommentKey)===0?this.comment(b):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&m.indexOf(this.stringify.convertRawKey)===0?this.raw(b):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&m.indexOf(this.stringify.convertPIKey)===0?this.instruction(m.substr(this.stringify.convertPIKey.length),b):this.node(m,v,b);if(_==null)throw new Error("Could not create any elements with: "+m);return _},c.prototype.insertBefore=function(m,v,b){var E,g,y;if(this.isRoot)throw new Error("Cannot insert elements at root level");return g=this.parent.children.indexOf(this),y=this.parent.children.splice(g),E=this.parent.element(m,v,b),Array.prototype.push.apply(this.parent.children,y),E},c.prototype.insertAfter=function(m,v,b){var E,g,y;if(this.isRoot)throw new Error("Cannot insert elements at root level");return g=this.parent.children.indexOf(this),y=this.parent.children.splice(g+1),E=this.parent.element(m,v,b),Array.prototype.push.apply(this.parent.children,y),E},c.prototype.remove=function(){var m;if(this.isRoot)throw new Error("Cannot remove the root element");return m=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[m,m-m+1].concat([])),this.parent},c.prototype.node=function(m,v,b){var E,g;return m!=null&&(m=m.valueOf()),v||(v={}),v=v.valueOf(),r(v)||(g=[v,b],b=g[0],v=g[1]),E=new u(this,m,v),b!=null&&E.text(b),this.children.push(E),E},c.prototype.text=function(m){var v;return v=new l(this,m),this.children.push(v),this},c.prototype.cdata=function(m){var v;return v=new T(this,m),this.children.push(v),this},c.prototype.comment=function(m){var v;return v=new w(this,m),this.children.push(v),this},c.prototype.commentBefore=function(m){var v,b;return v=this.parent.children.indexOf(this),b=this.parent.children.splice(v),this.parent.comment(m),Array.prototype.push.apply(this.parent.children,b),this},c.prototype.commentAfter=function(m){var v,b;return v=this.parent.children.indexOf(this),b=this.parent.children.splice(v+1),this.parent.comment(m),Array.prototype.push.apply(this.parent.children,b),this},c.prototype.raw=function(m){var v;return v=new i(this,m),this.children.push(v),this},c.prototype.instruction=function(m,v){var b,E,g,y,C;if(m!=null&&(m=m.valueOf()),v!=null&&(v=v.valueOf()),Array.isArray(m))for(y=0,C=m.length;y<C;y++)b=m[y],this.instruction(b);else if(r(m))for(b in m)n.call(m,b)&&(E=m[b],this.instruction(b,E));else h(v)&&(v=v.apply()),g=new o(this,m,v),this.children.push(g);return this},c.prototype.instructionBefore=function(m,v){var b,E;return b=this.parent.children.indexOf(this),E=this.parent.children.splice(b),this.parent.instruction(m,v),Array.prototype.push.apply(this.parent.children,E),this},c.prototype.instructionAfter=function(m,v){var b,E;return b=this.parent.children.indexOf(this),E=this.parent.children.splice(b+1),this.parent.instruction(m,v),Array.prototype.push.apply(this.parent.children,E),this},c.prototype.declaration=function(m,v,b){var E,g;return E=this.document(),g=new f(E,m,v,b),E.children[0]instanceof f?E.children[0]=g:E.children.unshift(g),E.root()||E},c.prototype.doctype=function(m,v){var b,E,g,y,C,d,_,O,A,P;for(E=this.document(),g=new p(E,m,v),A=E.children,y=C=0,_=A.length;C<_;y=++C)if((b=A[y])instanceof p)return E.children[y]=g,g;for(P=E.children,y=d=0,O=P.length;d<O;y=++d)if(b=P[y],b.isRoot)return E.children.splice(y,0,g),g;return E.children.push(g),g},c.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},c.prototype.root=function(){var m;for(m=this;m;){if(m.isDocument)return m.rootObject;if(m.isRoot)return m;m=m.parent}},c.prototype.document=function(){var m;for(m=this;m;){if(m.isDocument)return m;m=m.parent}},c.prototype.end=function(m){return this.document().end(m)},c.prototype.prev=function(){var m;if((m=this.parent.children.indexOf(this))<1)throw new Error("Already at the first node");return this.parent.children[m-1]},c.prototype.next=function(){var m;if((m=this.parent.children.indexOf(this))===-1||m===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[m+1]},c.prototype.importDocument=function(m){var v;return v=m.root().clone(),v.parent=this,v.isRoot=!1,this.children.push(v),this},c.prototype.ele=function(m,v,b){return this.element(m,v,b)},c.prototype.nod=function(m,v,b){return this.node(m,v,b)},c.prototype.txt=function(m){return this.text(m)},c.prototype.dat=function(m){return this.cdata(m)},c.prototype.com=function(m){return this.comment(m)},c.prototype.ins=function(m,v){return this.instruction(m,v)},c.prototype.doc=function(){return this.document()},c.prototype.dec=function(m,v,b){return this.declaration(m,v,b)},c.prototype.dtd=function(m,v){return this.doctype(m,v)},c.prototype.e=function(m,v,b){return this.element(m,v,b)},c.prototype.n=function(m,v,b){return this.node(m,v,b)},c.prototype.t=function(m){return this.text(m)},c.prototype.d=function(m){return this.cdata(m)},c.prototype.c=function(m){return this.comment(m)},c.prototype.r=function(m){return this.raw(m)},c.prototype.i=function(m,v){return this.instruction(m,v)},c.prototype.u=function(){return this.up()},c.prototype.importXMLBuilder=function(m){return this.importDocument(m)},c}()}).call(void 0)},{"./Utility":214,"./XMLCData":216,"./XMLComment":217,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233}],228:[function(S,D,x){"use strict";var T=S("babel-runtime/core-js/object/create"),w=function(f){return f&&f.__esModule?f:{default:f}}(T);(function(){var f,p=function(o,i){function l(){this.constructor=o}for(var s in i)u.call(i,s)&&(o[s]=i[s]);return l.prototype=i.prototype,o.prototype=new l,o.__super__=i.prototype,o},u={}.hasOwnProperty;f=S("./XMLNode"),D.exports=function(o){function i(l,s,h){if(i.__super__.constructor.call(this,l),s==null)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(s),h&&(this.value=this.stringify.insValue(h))}return p(i,o),i.prototype.clone=function(){return(0,w.default)(this)},i.prototype.toString=function(l){return this.options.writer.set(l).processingInstruction(this)},i}(f)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],229:[function(S,D,x){"use strict";var T=S("babel-runtime/core-js/object/create"),w=function(f){return f&&f.__esModule?f:{default:f}}(T);(function(){var f,p=function(o,i){function l(){this.constructor=o}for(var s in i)u.call(i,s)&&(o[s]=i[s]);return l.prototype=i.prototype,o.prototype=new l,o.__super__=i.prototype,o},u={}.hasOwnProperty;f=S("./XMLNode"),D.exports=function(o){function i(l,s){if(i.__super__.constructor.call(this,l),s==null)throw new Error("Missing raw text");this.value=this.stringify.raw(s)}return p(i,o),i.prototype.clone=function(){return(0,w.default)(this)},i.prototype.toString=function(l){return this.options.writer.set(l).raw(this)},i}(f)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],230:[function(S,D,x){"use strict";(function(){var T,w,f,p,u,o,i,l,s,h,r,t,n,c=function(v,b){function E(){this.constructor=v}for(var g in b)m.call(b,g)&&(v[g]=b[g]);return E.prototype=b.prototype,v.prototype=new E,v.__super__=b.prototype,v},m={}.hasOwnProperty;i=S("./XMLDeclaration"),l=S("./XMLDocType"),T=S("./XMLCData"),w=S("./XMLComment"),s=S("./XMLElement"),r=S("./XMLRaw"),t=S("./XMLText"),h=S("./XMLProcessingInstruction"),f=S("./XMLDTDAttList"),p=S("./XMLDTDElement"),u=S("./XMLDTDEntity"),o=S("./XMLDTDNotation"),n=S("./XMLWriterBase"),D.exports=function(v){function b(E,g){b.__super__.constructor.call(this,g),this.stream=E}return c(b,v),b.prototype.document=function(E){var g,y,C,d,_,O,A,P;for(O=E.children,y=0,d=O.length;y<d;y++)g=O[y],g.isLastRootNode=!1;for(E.children[E.children.length-1].isLastRootNode=!0,A=E.children,P=[],C=0,_=A.length;C<_;C++)switch(g=A[C],!1){case!(g instanceof i):P.push(this.declaration(g));break;case!(g instanceof l):P.push(this.docType(g));break;case!(g instanceof w):P.push(this.comment(g));break;case!(g instanceof h):P.push(this.processingInstruction(g));break;default:P.push(this.element(g))}return P},b.prototype.attribute=function(E){return this.stream.write(" "+E.name+'="'+E.value+'"')},b.prototype.cdata=function(E,g){return this.stream.write(this.space(g)+"<![CDATA["+E.text+"]]>"+this.endline(E))},b.prototype.comment=function(E,g){return this.stream.write(this.space(g)+"<!-- "+E.text+" -->"+this.endline(E))},b.prototype.declaration=function(E,g){return this.stream.write(this.space(g)),this.stream.write('<?xml version="'+E.version+'"'),E.encoding!=null&&this.stream.write(' encoding="'+E.encoding+'"'),E.standalone!=null&&this.stream.write(' standalone="'+E.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(E))},b.prototype.docType=function(E,g){var y,C,d,_;if(g||(g=0),this.stream.write(this.space(g)),this.stream.write("<!DOCTYPE "+E.root().name),E.pubID&&E.sysID?this.stream.write(' PUBLIC "'+E.pubID+'" "'+E.sysID+'"'):E.sysID&&this.stream.write(' SYSTEM "'+E.sysID+'"'),E.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(E)),_=E.children,C=0,d=_.length;C<d;C++)switch(y=_[C],!1){case!(y instanceof f):this.dtdAttList(y,g+1);break;case!(y instanceof p):this.dtdElement(y,g+1);break;case!(y instanceof u):this.dtdEntity(y,g+1);break;case!(y instanceof o):this.dtdNotation(y,g+1);break;case!(y instanceof T):this.cdata(y,g+1);break;case!(y instanceof w):this.comment(y,g+1);break;case!(y instanceof h):this.processingInstruction(y,g+1);break;default:throw new Error("Unknown DTD node type: "+y.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(E))},b.prototype.element=function(E,g){var y,C,d,_,O,A,P,I;g||(g=0),I=this.space(g),this.stream.write(I+"<"+E.name),A=E.attributes;for(O in A)m.call(A,O)&&(y=A[O],this.attribute(y));if(E.children.length===0||E.children.every(function(W){return W.value===""}))this.allowEmpty?this.stream.write("></"+E.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&E.children.length===1&&E.children[0].value!=null)this.stream.write(">"),this.stream.write(E.children[0].value),this.stream.write("</"+E.name+">");else{for(this.stream.write(">"+this.newline),P=E.children,d=0,_=P.length;d<_;d++)switch(C=P[d],!1){case!(C instanceof T):this.cdata(C,g+1);break;case!(C instanceof w):this.comment(C,g+1);break;case!(C instanceof s):this.element(C,g+1);break;case!(C instanceof r):this.raw(C,g+1);break;case!(C instanceof t):this.text(C,g+1);break;case!(C instanceof h):this.processingInstruction(C,g+1);break;default:throw new Error("Unknown XML node type: "+C.constructor.name)}this.stream.write(I+"</"+E.name+">")}return this.stream.write(this.endline(E))},b.prototype.processingInstruction=function(E,g){return this.stream.write(this.space(g)+"<?"+E.target),E.value&&this.stream.write(" "+E.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(E))},b.prototype.raw=function(E,g){return this.stream.write(this.space(g)+E.value+this.endline(E))},b.prototype.text=function(E,g){return this.stream.write(this.space(g)+E.value+this.endline(E))},b.prototype.dtdAttList=function(E,g){return this.stream.write(this.space(g)+"<!ATTLIST "+E.elementName+" "+E.attributeName+" "+E.attributeType),E.defaultValueType!=="#DEFAULT"&&this.stream.write(" "+E.defaultValueType),E.defaultValue&&this.stream.write(' "'+E.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(E))},b.prototype.dtdElement=function(E,g){return this.stream.write(this.space(g)+"<!ELEMENT "+E.name+" "+E.value),this.stream.write(this.spacebeforeslash+">"+this.endline(E))},b.prototype.dtdEntity=function(E,g){return this.stream.write(this.space(g)+"<!ENTITY"),E.pe&&this.stream.write(" %"),this.stream.write(" "+E.name),E.value?this.stream.write(' "'+E.value+'"'):(E.pubID&&E.sysID?this.stream.write(' PUBLIC "'+E.pubID+'" "'+E.sysID+'"'):E.sysID&&this.stream.write(' SYSTEM "'+E.sysID+'"'),E.nData&&this.stream.write(" NDATA "+E.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(E))},b.prototype.dtdNotation=function(E,g){return this.stream.write(this.space(g)+"<!NOTATION "+E.name),E.pubID&&E.sysID?this.stream.write(' PUBLIC "'+E.pubID+'" "'+E.sysID+'"'):E.pubID?this.stream.write(' PUBLIC "'+E.pubID+'"'):E.sysID&&this.stream.write(' SYSTEM "'+E.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(E))},b.prototype.endline=function(E){return E.isLastRootNode?"":this.newline},b}(n)}).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(S,D,x){"use strict";(function(){var T,w,f,p,u,o,i,l,s,h,r,t,n,c=function(v,b){function E(){this.constructor=v}for(var g in b)m.call(b,g)&&(v[g]=b[g]);return E.prototype=b.prototype,v.prototype=new E,v.__super__=b.prototype,v},m={}.hasOwnProperty;i=S("./XMLDeclaration"),l=S("./XMLDocType"),T=S("./XMLCData"),w=S("./XMLComment"),s=S("./XMLElement"),r=S("./XMLRaw"),t=S("./XMLText"),h=S("./XMLProcessingInstruction"),f=S("./XMLDTDAttList"),p=S("./XMLDTDElement"),u=S("./XMLDTDEntity"),o=S("./XMLDTDNotation"),n=S("./XMLWriterBase"),D.exports=function(v){function b(E){b.__super__.constructor.call(this,E)}return c(b,v),b.prototype.document=function(E){var g,y,C,d,_;for(this.textispresent=!1,d="",_=E.children,y=0,C=_.length;y<C;y++)g=_[y],d+=function(){switch(!1){case!(g instanceof i):return this.declaration(g);case!(g instanceof l):return this.docType(g);case!(g instanceof w):return this.comment(g);case!(g instanceof h):return this.processingInstruction(g);default:return this.element(g,0)}}.call(this);return this.pretty&&d.slice(-this.newline.length)===this.newline&&(d=d.slice(0,-this.newline.length)),d},b.prototype.attribute=function(E){return" "+E.name+'="'+E.value+'"'},b.prototype.cdata=function(E,g){return this.space(g)+"<![CDATA["+E.text+"]]>"+this.newline},b.prototype.comment=function(E,g){return this.space(g)+"<!-- "+E.text+" -->"+this.newline},b.prototype.declaration=function(E,g){var y;return y=this.space(g),y+='<?xml version="'+E.version+'"',E.encoding!=null&&(y+=' encoding="'+E.encoding+'"'),E.standalone!=null&&(y+=' standalone="'+E.standalone+'"'),y+=this.spacebeforeslash+"?>",y+=this.newline},b.prototype.docType=function(E,g){var y,C,d,_,O;if(g||(g=0),_=this.space(g),_+="<!DOCTYPE "+E.root().name,E.pubID&&E.sysID?_+=' PUBLIC "'+E.pubID+'" "'+E.sysID+'"':E.sysID&&(_+=' SYSTEM "'+E.sysID+'"'),E.children.length>0){for(_+=" [",_+=this.newline,O=E.children,C=0,d=O.length;C<d;C++)y=O[C],_+=function(){switch(!1){case!(y instanceof f):return this.dtdAttList(y,g+1);case!(y instanceof p):return this.dtdElement(y,g+1);case!(y instanceof u):return this.dtdEntity(y,g+1);case!(y instanceof o):return this.dtdNotation(y,g+1);case!(y instanceof T):return this.cdata(y,g+1);case!(y instanceof w):return this.comment(y,g+1);case!(y instanceof h):return this.processingInstruction(y,g+1);default:throw new Error("Unknown DTD node type: "+y.constructor.name)}}.call(this);_+="]"}return _+=this.spacebeforeslash+">",_+=this.newline},b.prototype.element=function(E,g){var y,C,d,_,O,A,P,I,W,K,te,H,G;g||(g=0),G=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),H=this.space(g),I="",I+=H+"<"+E.name,W=E.attributes;for(P in W)m.call(W,P)&&(y=W[P],I+=this.attribute(y));if(E.children.length===0||E.children.every(function(V){return V.value===""}))this.allowEmpty?I+="></"+E.name+">"+this.newline:I+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&E.children.length===1&&E.children[0].value!=null)I+=">",I+=E.children[0].value,I+="</"+E.name+">"+this.newline;else{if(this.dontprettytextnodes){for(K=E.children,d=0,O=K.length;d<O;d++)if(C=K[d],C.value!=null){this.textispresent++,G=!0;break}}for(this.textispresent&&(this.newline="",this.pretty=!1,H=this.space(g)),I+=">"+this.newline,te=E.children,_=0,A=te.length;_<A;_++)C=te[_],I+=function(){switch(!1){case!(C instanceof T):return this.cdata(C,g+1);case!(C instanceof w):return this.comment(C,g+1);case!(C instanceof s):return this.element(C,g+1);case!(C instanceof r):return this.raw(C,g+1);case!(C instanceof t):return this.text(C,g+1);case!(C instanceof h):return this.processingInstruction(C,g+1);default:throw new Error("Unknown XML node type: "+C.constructor.name)}}.call(this);G&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),I+=H+"</"+E.name+">"+this.newline}return I},b.prototype.processingInstruction=function(E,g){var y;return y=this.space(g)+"<?"+E.target,E.value&&(y+=" "+E.value),y+=this.spacebeforeslash+"?>"+this.newline},b.prototype.raw=function(E,g){return this.space(g)+E.value+this.newline},b.prototype.text=function(E,g){return this.space(g)+E.value+this.newline},b.prototype.dtdAttList=function(E,g){var y;return y=this.space(g)+"<!ATTLIST "+E.elementName+" "+E.attributeName+" "+E.attributeType,E.defaultValueType!=="#DEFAULT"&&(y+=" "+E.defaultValueType),E.defaultValue&&(y+=' "'+E.defaultValue+'"'),y+=this.spacebeforeslash+">"+this.newline},b.prototype.dtdElement=function(E,g){return this.space(g)+"<!ELEMENT "+E.name+" "+E.value+this.spacebeforeslash+">"+this.newline},b.prototype.dtdEntity=function(E,g){var y;return y=this.space(g)+"<!ENTITY",E.pe&&(y+=" %"),y+=" "+E.name,E.value?y+=' "'+E.value+'"':(E.pubID&&E.sysID?y+=' PUBLIC "'+E.pubID+'" "'+E.sysID+'"':E.sysID&&(y+=' SYSTEM "'+E.sysID+'"'),E.nData&&(y+=" NDATA "+E.nData)),y+=this.spacebeforeslash+">"+this.newline},b.prototype.dtdNotation=function(E,g){var y;return y=this.space(g)+"<!NOTATION "+E.name,E.pubID&&E.sysID?y+=' PUBLIC "'+E.pubID+'" "'+E.sysID+'"':E.pubID?y+=' PUBLIC "'+E.pubID+'"':E.sysID&&(y+=' SYSTEM "'+E.sysID+'"'),y+=this.spacebeforeslash+">"+this.newline},b.prototype.openNode=function(E,g){var y,C,d,_;if(g||(g=0),E instanceof s){d=this.space(g)+"<"+E.name,_=E.attributes;for(C in _)m.call(_,C)&&(y=_[C],d+=this.attribute(y));return d+=(E.children?">":"/>")+this.newline}return d=this.space(g)+"<!DOCTYPE "+E.rootNodeName,E.pubID&&E.sysID?d+=' PUBLIC "'+E.pubID+'" "'+E.sysID+'"':E.sysID&&(d+=' SYSTEM "'+E.sysID+'"'),d+=(E.children?" [":">")+this.newline},b.prototype.closeNode=function(E,g){switch(g||(g=0),!1){case!(E instanceof s):return this.space(g)+"</"+E.name+">"+this.newline;case!(E instanceof l):return this.space(g)+"]>"+this.newline}},b}(n)}).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(S,D,x){"use strict";(function(){var T=function(f,p){return function(){return f.apply(p,arguments)}},w={}.hasOwnProperty;D.exports=function(){function f(p){this.assertLegalChar=T(this.assertLegalChar,this);var u,o,i;p||(p={}),this.noDoubleEncoding=p.noDoubleEncoding,o=p.stringify||{};for(u in o)w.call(o,u)&&(i=o[u],this[u]=i)}return f.prototype.eleName=function(p){return p=""+p||"",this.assertLegalChar(p)},f.prototype.eleText=function(p){return p=""+p||"",this.assertLegalChar(this.elEscape(p))},f.prototype.cdata=function(p){return p=""+p||"",p=p.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(p)},f.prototype.comment=function(p){if(p=""+p||"",p.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+p);return this.assertLegalChar(p)},f.prototype.raw=function(p){return""+p||""},f.prototype.attName=function(p){return p=""+p||""},f.prototype.attValue=function(p){return p=""+p||"",this.attEscape(p)},f.prototype.insTarget=function(p){return""+p||""},f.prototype.insValue=function(p){if(p=""+p||"",p.match(/\?>/))throw new Error("Invalid processing instruction value: "+p);return p},f.prototype.xmlVersion=function(p){if(p=""+p||"",!p.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+p);return p},f.prototype.xmlEncoding=function(p){if(p=""+p||"",!p.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+p);return p},f.prototype.xmlStandalone=function(p){return p?"yes":"no"},f.prototype.dtdPubID=function(p){return""+p||""},f.prototype.dtdSysID=function(p){return""+p||""},f.prototype.dtdElementValue=function(p){return""+p||""},f.prototype.dtdAttType=function(p){return""+p||""},f.prototype.dtdAttDefault=function(p){return p!=null?""+p||"":p},f.prototype.dtdEntityValue=function(p){return""+p||""},f.prototype.dtdNData=function(p){return""+p||""},f.prototype.convertAttKey="@",f.prototype.convertPIKey="?",f.prototype.convertTextKey="#text",f.prototype.convertCDataKey="#cdata",f.prototype.convertCommentKey="#comment",f.prototype.convertRawKey="#raw",f.prototype.assertLegalChar=function(p){var u;if(u=p.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+p+" at index "+u.index);return p},f.prototype.elEscape=function(p){var u;return u=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(u,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
")},f.prototype.attEscape=function(p){var u;return u=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(u,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
")},f}()}).call(void 0)},{}],233:[function(S,D,x){"use strict";var T=S("babel-runtime/core-js/object/create"),w=function(f){return f&&f.__esModule?f:{default:f}}(T);(function(){var f,p=function(o,i){function l(){this.constructor=o}for(var s in i)u.call(i,s)&&(o[s]=i[s]);return l.prototype=i.prototype,o.prototype=new l,o.__super__=i.prototype,o},u={}.hasOwnProperty;f=S("./XMLNode"),D.exports=function(o){function i(l,s){if(i.__super__.constructor.call(this,l),s==null)throw new Error("Missing element text");this.value=this.stringify.eleText(s)}return p(i,o),i.prototype.clone=function(){return(0,w.default)(this)},i.prototype.toString=function(l){return this.options.writer.set(l).text(this)},i}(f)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],234:[function(S,D,x){"use strict";(function(){var T={}.hasOwnProperty;D.exports=function(){function w(f){var p,u,o,i,l,s,h,r,t;f||(f={}),this.pretty=f.pretty||!1,this.allowEmpty=(u=f.allowEmpty)!=null&&u,this.pretty?(this.indent=(o=f.indent)!=null?o:" ",this.newline=(i=f.newline)!=null?i:`
|
|
|
`,this.offset=(l=f.offset)!=null?l:0,this.dontprettytextnodes=(s=f.dontprettytextnodes)!=null?s:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=(h=f.spacebeforeslash)!=null?h:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,r=f.writer||{};for(p in r)T.call(r,p)&&(t=r[p],this[p]=t)}return w.prototype.set=function(f){var p,u,o;f||(f={}),"pretty"in f&&(this.pretty=f.pretty),"allowEmpty"in f&&(this.allowEmpty=f.allowEmpty),this.pretty?(this.indent="indent"in f?f.indent:" ",this.newline="newline"in f?f.newline:`
|
|
|
`,this.offset="offset"in f?f.offset:0,this.dontprettytextnodes="dontprettytextnodes"in f?f.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in f?f.spacebeforeslash:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,u=f.writer||{};for(p in u)T.call(u,p)&&(o=u[p],this[p]=o);return this},w.prototype.space=function(f){var p;return this.pretty?(p=(f||0)+this.offset+1,p>0?new Array(p).join(this.indent):""):""},w}()}).call(void 0)},{}],235:[function(S,D,x){"use strict";(function(){var T,w,f,p,u,o,i;i=S("./Utility"),u=i.assign,o=i.isFunction,T=S("./XMLDocument"),w=S("./XMLDocumentCB"),p=S("./XMLStringWriter"),f=S("./XMLStreamWriter"),D.exports.create=function(l,s,h,r){var t,n;if(l==null)throw new Error("Root element needs a name");return r=u({},s,h,r),t=new T(r),n=t.element(l),r.headless||(t.declaration(r),r.pubID==null&&r.sysID==null||t.doctype(r)),n},D.exports.begin=function(l,s,h){var r;return o(l)&&(r=[l,s],s=r[0],h=r[1],l={}),s?new w(l,s,h):new T(l)},D.exports.stringWriter=function(l){return new p(l)},D.exports.streamWriter=function(l,s){return new f(l,s)}}).call(void 0)},{"./Utility":214,"./XMLDocument":224,"./XMLDocumentCB":225,"./XMLStreamWriter":230,"./XMLStringWriter":231}],236:[function(S,D,x){function T(){for(var f={},p=0;p<arguments.length;p++){var u=arguments[p];for(var o in u)w.call(u,o)&&(f[o]=u[o])}return f}D.exports=T;var w=Object.prototype.hasOwnProperty},{}],237:[function(S,D,x){"use strict";function T(r,t,n){p.isBuffer(t)||(t=new p(t)),p.isBuffer(n)||(n=new p(n)),t.length>s?t=r(t):t.length<s&&(t=p.concat([t,h],s));for(var c=new p(s),m=new p(s),v=0;v<s;v++)c[v]=54^t[v],m[v]=92^t[v];var b=r(p.concat([c,n]));return r(p.concat([m,b]))}function w(r,t){r=r||"sha1";var n=l[r],c=[],m=0;return n||f("algorithm:",r,"is not yet supported"),{update:function(v){return p.isBuffer(v)||(v=new p(v)),c.push(v),m+=v.length,this},digest:function(v){var b=p.concat(c),E=t?T(n,t,b):n(b);return c=null,v?E.toString(v):E}}}function f(){var r=[].slice.call(arguments).join(" ");throw new Error([r,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
|
|
|
`))}var p=S("buffer").Buffer,u=S("./sha"),o=S("./sha256"),i=S("./md5"),l={sha1:u,sha256:o,md5:i},s=64,h=new p(s);h.fill(0),x.createHash=function(r){return w(r)},x.createHmac=function(r,t){return w(r,t)},function(r,t){for(var n in r)t(r[n],n)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(r){x[r]=function(){f("sorry,",r,"is not implemented yet")}})},{"./md5":239,"./sha":240,"./sha256":241,buffer:38}],238:[function(S,D,x){"use strict";function T(l,s){if(l.length%u!=0){var h=l.length+(u-l.length%u);l=p.concat([l,o],h)}for(var r=[],t=s?l.readInt32BE:l.readInt32LE,n=0;n<l.length;n+=u)r.push(t.call(l,n));return r}function w(l,s,h){for(var r=new p(s),t=h?r.writeInt32BE:r.writeInt32LE,n=0;n<l.length;n++)t.call(r,l[n],4*n,!0);return r}function f(l,s,h,r){return p.isBuffer(l)||(l=new p(l)),w(s(T(l,r),l.length*i),h,r)}var p=S("buffer").Buffer,u=4,o=new p(u);o.fill(0);var i=8;D.exports={hash:f}},{buffer:38}],239:[function(S,D,x){"use strict";function T(h,r){h[r>>5]|=128<<r%32,h[14+(r+64>>>9<<4)]=r;for(var t=1732584193,n=-271733879,c=-1732584194,m=271733878,v=0;v<h.length;v+=16){var b=t,E=n,g=c,y=m;t=f(t,n,c,m,h[v+0],7,-680876936),m=f(m,t,n,c,h[v+1],12,-389564586),c=f(c,m,t,n,h[v+2],17,606105819),n=f(n,c,m,t,h[v+3],22,-1044525330),t=f(t,n,c,m,h[v+4],7,-176418897),m=f(m,t,n,c,h[v+5],12,1200080426),c=f(c,m,t,n,h[v+6],17,-1473231341),n=f(n,c,m,t,h[v+7],22,-45705983),t=f(t,n,c,m,h[v+8],7,1770035416),m=f(m,t,n,c,h[v+9],12,-1958414417),c=f(c,m,t,n,h[v+10],17,-42063),n=f(n,c,m,t,h[v+11],22,-1990404162),t=f(t,n,c,m,h[v+12],7,1804603682),m=f(m,t,n,c,h[v+13],12,-40341101),c=f(c,m,t,n,h[v+14],17,-1502002290),n=f(n,c,m,t,h[v+15],22,1236535329),t=p(t,n,c,m,h[v+1],5,-165796510),m=p(m,t,n,c,h[v+6],9,-1069501632),c=p(c,m,t,n,h[v+11],14,643717713),n=p(n,c,m,t,h[v+0],20,-373897302),t=p(t,n,c,m,h[v+5],5,-701558691),m=p(m,t,n,c,h[v+10],9,38016083),c=p(c,m,t,n,h[v+15],14,-660478335),n=p(n,c,m,t,h[v+4],20,-405537848),t=p(t,n,c,m,h[v+9],5,568446438),m=p(m,t,n,c,h[v+14],9,-1019803690),c=p(c,m,t,n,h[v+3],14,-187363961),n=p(n,c,m,t,h[v+8],20,1163531501),t=p(t,n,c,m,h[v+13],5,-1444681467),m=p(m,t,n,c,h[v+2],9,-51403784),c=p(c,m,t,n,h[v+7],14,1735328473),n=p(n,c,m,t,h[v+12],20,-1926607734),t=u(t,n,c,m,h[v+5],4,-378558),m=u(m,t,n,c,h[v+8],11,-2022574463),c=u(c,m,t,n,h[v+11],16,1839030562),n=u(n,c,m,t,h[v+14],23,-35309556),t=u(t,n,c,m,h[v+1],4,-1530992060),m=u(m,t,n,c,h[v+4],11,1272893353),c=u(c,m,t,n,h[v+7],16,-155497632),n=u(n,c,m,t,h[v+10],23,-1094730640),t=u(t,n,c,m,h[v+13],4,681279174),m=u(m,t,n,c,h[v+0],11,-358537222),c=u(c,m,t,n,h[v+3],16,-722521979),n=u(n,c,m,t,h[v+6],23,76029189),t=u(t,n,c,m,h[v+9],4,-640364487),m=u(m,t,n,c,h[v+12],11,-421815835),c=u(c,m,t,n,h[v+15],16,530742520),n=u(n,c,m,t,h[v+2],23,-995338651),t=o(t,n,c,m,h[v+0],6,-198630844),m=o(m,t,n,c,h[v+7],10,1126891415),c=o(c,m,t,n,h[v+14],15,-1416354905),n=o(n,c,m,t,h[v+5],21,-57434055),t=o(t,n,c,m,h[v+12],6,1700485571),m=o(m,t,n,c,h[v+3],10,-1894986606),c=o(c,m,t,n,h[v+10],15,-1051523),n=o(n,c,m,t,h[v+1],21,-2054922799),t=o(t,n,c,m,h[v+8],6,1873313359),m=o(m,t,n,c,h[v+15],10,-30611744),c=o(c,m,t,n,h[v+6],15,-1560198380),n=o(n,c,m,t,h[v+13],21,1309151649),t=o(t,n,c,m,h[v+4],6,-145523070),m=o(m,t,n,c,h[v+11],10,-1120210379),c=o(c,m,t,n,h[v+2],15,718787259),n=o(n,c,m,t,h[v+9],21,-343485551),t=i(t,b),n=i(n,E),c=i(c,g),m=i(m,y)}return Array(t,n,c,m)}function w(h,r,t,n,c,m){return i(l(i(i(r,h),i(n,m)),c),t)}function f(h,r,t,n,c,m,v){return w(r&t|~r&n,h,r,c,m,v)}function p(h,r,t,n,c,m,v){return w(r&n|t&~n,h,r,c,m,v)}function u(h,r,t,n,c,m,v){return w(r^t^n,h,r,c,m,v)}function o(h,r,t,n,c,m,v){return w(t^(r|~n),h,r,c,m,v)}function i(h,r){var t=(65535&h)+(65535&r);return(h>>16)+(r>>16)+(t>>16)<<16|65535&t}function l(h,r){return h<<r|h>>>32-r}var s=S("./helpers");D.exports=function(h){return s.hash(h,T,16)}},{"./helpers":238}],240:[function(S,D,x){"use strict";function T(i,l){i[l>>5]|=128<<24-l%32,i[15+(l+64>>9<<4)]=l;for(var s=Array(80),h=1732584193,r=-271733879,t=-1732584194,n=271733878,c=-1009589776,m=0;m<i.length;m+=16){for(var v=h,b=r,E=t,g=n,y=c,C=0;C<80;C++){s[C]=C<16?i[m+C]:u(s[C-3]^s[C-8]^s[C-14]^s[C-16],1);var d=p(p(u(h,5),w(C,r,t,n)),p(p(c,s[C]),f(C)));c=n,n=t,t=u(r,30),r=h,h=d}h=p(h,v),r=p(r,b),t=p(t,E),n=p(n,g),c=p(c,y)}return Array(h,r,t,n,c)}function w(i,l,s,h){return i<20?l&s|~l&h:i<40?l^s^h:i<60?l&s|l&h|s&h:l^s^h}function f(i){return i<20?1518500249:i<40?1859775393:i<60?-1894007588:-899497514}function p(i,l){var s=(65535&i)+(65535&l);return(i>>16)+(l>>16)+(s>>16)<<16|65535&s}function u(i,l){return i<<l|i>>>32-l}var o=S("./helpers");D.exports=function(i){return o.hash(i,T,20,!0)}},{"./helpers":238}],241:[function(S,D,x){"use strict";var T=S("./helpers"),w=function(t,n){var c=(65535&t)+(65535&n);return(t>>16)+(n>>16)+(c>>16)<<16|65535&c},f=function(t,n){return t>>>n|t<<32-n},p=function(t,n){return t>>>n},u=function(t,n,c){return t&n^~t&c},o=function(t,n,c){return t&n^t&c^n&c},i=function(t){return f(t,2)^f(t,13)^f(t,22)},l=function(t){return f(t,6)^f(t,11)^f(t,25)},s=function(t){return f(t,7)^f(t,18)^p(t,3)},h=function(t){return f(t,17)^f(t,19)^p(t,10)},r=function(t,n){var c,m,v,b,E,g,y,C,d,_,O,A,P=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),I=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),W=new Array(64);t[n>>5]|=128<<24-n%32,t[15+(n+64>>9<<4)]=n;for(var d=0;d<t.length;d+=16){c=I[0],m=I[1],v=I[2],b=I[3],E=I[4],g=I[5],y=I[6],C=I[7];for(var _=0;_<64;_++)W[_]=_<16?t[_+d]:w(w(w(h(W[_-2]),W[_-7]),s(W[_-15])),W[_-16]),O=w(w(w(w(C,l(E)),u(E,g,y)),P[_]),W[_]),A=w(i(c),o(c,m,v)),C=y,y=g,g=E,E=w(b,O),b=v,v=m,m=c,c=w(O,A);I[0]=w(c,I[0]),I[1]=w(m,I[1]),I[2]=w(v,I[2]),I[3]=w(b,I[3]),I[4]=w(E,I[4]),I[5]=w(g,I[5]),I[6]=w(y,I[6]),I[7]=w(C,I[7])}return I};D.exports=function(t){return T.hash(t,r,32,!0)}},{"./helpers":238}],242:[function(S,D,x){(function(T){"use strict";function w(r){return r&&r.__esModule?r:{default:r}}var f=S("babel-runtime/core-js/object/create"),p=w(f),u=S("babel-runtime/helpers/classCallCheck"),o=w(u),i=S("babel-runtime/helpers/createClass"),l=w(i),s=S("babel-runtime/helpers/typeof"),h=w(s);!function(r){if((x===void 0?"undefined":(0,h.default)(x))==="object"&&D!==void 0)D.exports=r();else if(typeof j=="function"&&j.amd)j([],r);else{var t;t=typeof window!="undefined"?window:T!==void 0?T:typeof self!="undefined"?self:this,t.mime=r()}}(function(){return function r(t,n,c){function m(E,g){if(!n[E]){if(!t[E]){var y=typeof S=="function"&&S;if(!g&&y)return y(E,!0);if(v)return v(E,!0);var C=new Error("Cannot find module '"+E+"'");throw C.code="MODULE_NOT_FOUND",C}var d=n[E]={exports:{}};t[E][0].call(d.exports,function(_){var O=t[E][1][_];return m(O||_)},d,d.exports,r,t,n,c)}return n[E].exports}for(var v=typeof S=="function"&&S,b=0;b<c.length;b++)m(c[b]);return m}({1:[function(r,t,n){var c=function(){function m(){(0,o.default)(this,m),this._types=(0,p.default)(null),this._extensions=(0,p.default)(null);for(var v=0;v<arguments.length;v++)this.define(arguments[v])}return(0,l.default)(m,[{key:"define",value:function(v,b){for(var E in v){for(var g=v[E],y=0;y<g.length;y++){var C=g[y];if(!b&&C in this._types)throw new Error('Attempt to change mapping for "'+C+'" extension from "'+this._types[C]+'" to "'+E+'". Pass `force=true` to allow this, otherwise remove "'+C+'" from the list of extensions for "'+E+'".');this._types[C]=E}!b&&this._extensions[E]||(this._extensions[E]=g[0])}}},{key:"getType",value:function(v){v=String(v);var b=v.replace(/^.*[\/\\]/,"").toLowerCase(),E=b.replace(/^.*\./,"").toLowerCase(),g=b.length<v.length;return(E.length<b.length-1||!g)&&this._types[E]||null}},{key:"getExtension",value:function(v){return(v=/^\s*([^;\s]*)/.test(v)&&RegExp.$1)&&this._extensions[v.toLowerCase()]||null}}]),m}();t.exports=c},{}],2:[function(r,t,n){var c=r("./Mime");t.exports=new c(r("./types/standard"),r("./types/other"))},{"./Mime":1,"./types/other":3,"./types/standard":4}],3:[function(r,t,n){t.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(r,t,n){t.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 ue!="undefined"?ue: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(S,D,x){"use strict";x.encodeURIComponent=function(T){try{return encodeURIComponent(T)}catch(w){return T}},x.escape=S("escape-html"),x.timestamp=function(T){if(T){var w=T;return typeof w=="string"&&(w=Number(w)),String(T).length===10&&(w*=1e3),new Date(w)}return Math.round(Date.now()/1e3)}},{"escape-html":157}],244:[function(S,D,x){(function(T,w){"use strict";function f(C){return C&&C.__esModule?C:{default:C}}function p(C,d){return C===void 0?d:C}function u(C,d){return function(_,O,A){if(_)return d(_);C({data:O,status:A.statusCode,headers:A.headers,res:A})}}var o,i=S("babel-runtime/core-js/json/stringify"),l=f(i),s=S("babel-runtime/helpers/typeof"),h=f(s),r=S("util"),t=S("url"),n=S("http"),c=S("https"),m=S("debug")("urllib"),v=S("humanize-ms"),b=0,E=Math.pow(2,31)-10,g=/^https?:\/\//i;x.TIMEOUTS=[v("300s"),v("300s")];var y=["json","text"];x.request=function(C,d,_){return arguments.length===2&&typeof d=="function"&&(_=d,d=null),typeof _=="function"?x.requestWithCallback(C,d,_):(o||(o=S("any-promise")),new o(function(O,A){x.requestWithCallback(C,d,u(O,A))}))},x.requestWithCallback=function(C,d,_){function O(){qe&&(clearTimeout(qe),qe=null)}function A(){ee&&(clearTimeout(ee),ee=null)}function P(Xe,Ke,Fe){if(A(),!_)return console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),V,T.pid,Ee.method,C),void(Xe&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
|
|
|
stack: %s`,Date(),V,T.pid,Xe.name,Xe.message,Xe.stack));var Ue=_;_=null;var _e={};if(Fe&&(J=Fe.statusCode,_e=Fe.headers),J===401&&_e["www-authenticate"]&&(!d.headers||!d.headers.Authorization)&&d.digestAuth){var Ce=_e["www-authenticate"];if(Ce.indexOf("Digest ")>=0)return m("Request#%d %s: got digest auth header WWW-Authenticate: %s",V,C,Ce),d.headers=d.headers||{},d.headers.Authorization=digestAuthHeader(Ee.method,Ee.path,Ce,d.digestAuth),m("Request#%d %s: auth with digest header: %s",V,C,d.headers.Authorization),Fe.headers["set-cookie"]&&(d.headers.Cookie=Fe.headers["set-cookie"].join(";")),x.requestWithCallback(C,d,Ue)}var Ne=Date.now()-ne;He&&(He.contentDownload=Ne),m("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",Ne,Y,J,Ee.method,Ee.host,Ee.path,q,He);var De={status:J,statusCode:J,headers:_e,size:Y,aborted:be,rt:Ne,keepAliveSocket:q,data:Ke,requestUrls:d.requestUrls,timing:He,remoteAddress:ke,remotePort:ct};if(Xe){var rt="";we&&typeof we.getCurrentStatus=="function"&&(rt=", agent status: "+(0,l.default)(we.getCurrentStatus())),Xe.message+=", "+Ee.method+" "+C+" "+J+" (connected: "+U+", keepalive socket: "+q+rt+`)
|
|
|
headers: `+(0,l.default)(_e),Xe.data=Ke,Xe.path=Ee.path,Xe.status=J,Xe.headers=_e,Xe.res=De}Ue(Xe,Ke,d.streaming?Fe:De),d.emitter&&(re.url=C,re.socket=Qe&&Qe.connection,re.options=Ee,re.size=Oe,d.emitter.emit("response",{requestId:V,error:Xe,ctx:d.ctx,req:re,res:De}))}function I(Xe){var Ke=null;if(d.followRedirect&&statuses.redirect[Xe.statusCode]){d._followRedirectCount=(d._followRedirectCount||0)+1;var Fe=Xe.headers.location;if(Fe){if(!(d._followRedirectCount>d.maxRedirects)){var Ue=d.formatRedirectUrl?d.formatRedirectUrl(C,Fe):t.resolve(C,Fe);m("Request#%d %s: `redirected` from %s to %s",V,Ee.path,C,Ue),A(),d.headers&&d.headers.Host&&g.test(Fe)&&(d.headers.Host=null);var _e=_;return _=null,x.requestWithCallback(Ue,d,_e),{redirect:!0,error:null}}Ke=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+C),Ke.name="MaxRedirectError"}else Ke=new Error("Got statusCode "+Xe.statusCode+" but cannot resolve next location from headers"),Ke.name="FollowRedirectError"}return{redirect:!1,error:Ke}}function W(Xe,Ke,Fe){return Fe(null,Ke,Xe.headers["content-encoding"])}function K(Xe){if(He&&(He.waiting=Date.now()-ne),m("Request#%d %s `req response` event emit: status %d, headers: %j",V,C,Xe.statusCode,Xe.headers),d.streaming){var Ke=I(Xe);return Ke.redirect?void Xe.resume():Ke.error?(Xe.resume(),P(Ke.error,null,Xe)):P(null,null,Xe)}if(Xe.on("close",function(){m("Request#%d %s: `res close` event emit, total size %d",V,C,Y)}),Xe.on("error",function(){m("Request#%d %s: `res error` event emit, total size %d",V,C,Y)}),Xe.on("aborted",function(){be=!0,m("Request#%d %s: `res aborted` event emit, total size %d",V,C,Y)}),Be){var Ke=I(Xe);return Ke.redirect?void Xe.resume():Ke.error?(Xe.resume(),Be.end(),P(Ke.error,null,Xe)):(d.consumeWriteStream===!1?Xe.on("end",P.bind(null,null,null,Xe)):isNode010||isNode012?first([[Be,"close"],[Xe,"aborted"]],function(_e,Ce,Ne){m("Request#%d %s: writeStream or res %s event emitted",V,C,Ne),P(k||null,null,Xe)}):Be.on("close",function(){m("Request#%d %s: writeStream close event emitted",V,C),P(k||null,null,Xe)}),Xe.pipe(Be))}var Fe=[];Xe.on("data",function(Ue){m("Request#%d %s: `res data` event emit, size %d",V,C,Ue.length),Y+=Ue.length,Fe.push(Ue)}),Xe.on("end",function(){var Ue=w.concat(Fe,Y);if(m("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",V,C,Y,Xe._dumped),k)return P(k,Ue,Xe);var _e=I(Xe);if(_e.error)return P(_e.error,Ue,Xe);_e.redirect||W(Xe,Ue,function(Ce,Ne,De){if(Ce)return P(Ce,Ue,Xe);if(!De&&y.indexOf(d.dataType)>=0){try{Ne=decodeBodyByCharset(Ne,Xe)}catch(tt){return m("decodeBodyByCharset error: %s",tt),P(null,Ne,Xe)}if(d.dataType==="json")if(Y===0)Ne=null;else{var rt=parseJSON(Ne,Me);rt.error?Ce=rt.error:Ne=rt.data}}be&&m("Request#%d %s: Remote socket was terminated before `response.end()` was called",V,C),P(Ce,Ne,Xe)})})}function te(){m("Response timer ticking, timeout: %d",ht),ee=setTimeout(function(){ee=null;var Xe="Response timeout for "+ht+"ms";k=new Error(Xe),k.name="ResponseTimeoutError",k.requestId=V,m("ResponseTimeout: Request#%d %s %s: %s, connected: %s",V,C,k.name,Xe,U),H()},ht)}function H(){m("Request#%d %s abort, connected: %s",V,C,U),Qe.socket||(k.noSocket=!0,P(k)),Qe.abort()}if(!C||typeof C!="string"&&(C===void 0?"undefined":(0,h.default)(C))!=="object"){var G=r.format("expect request url to be a string or a http request options, but got %j",C);throw new Error(G)}arguments.length===2&&typeof d=="function"&&(_=d,d=null),d=d||{},b>=E&&(b=0);var V=++b;d.requestUrls=d.requestUrls||[];var re={requestId:V,url:C,args:d,ctx:d.ctx};d.emitter&&d.emitter.emit("request",re),d.timeout=d.timeout||x.TIMEOUTS,d.maxRedirects=d.maxRedirects||10,d.streaming=d.streaming||d.customResponse;var $,ne=Date.now();typeof C=="string"?(g.test(C)||(C="http://"+C),$=t.parse(C)):$=C;var he=(d.type||d.method||$.method||"GET").toUpperCase(),pe=$.port||80,Te=n,we=p(d.agent,x.agent),Me=d.fixJSONCtlChars;$.protocol==="https:"&&(Te=c,we=p(d.httpsAgent,x.httpsAgent),$.port||(pe=443));var Ee={host:$.hostname||$.host||"localhost",path:$.path||"/",method:he,port:pe,agent:we,headers:d.headers||{},lookup:d.lookup};Array.isArray(d.timeout)?Ee.requestTimeout=d.timeout[d.timeout.length-1]:d.timeout!==void 0&&(Ee.requestTimeout=d.timeout);for(var xe=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],Ge=0;Ge<xe.length;Ge++){var je=xe[Ge];d.hasOwnProperty(je)&&(Ee[je]=d[je])}Ee.rejectUnauthorized!==!1||Ee.hasOwnProperty("secureOptions")||(Ee.secureOptions=S("constants").SSL_OP_NO_TLSv1_2);var We=d.auth||$.auth;We&&(Ee.auth=We);var ze=d.content||d.data,de=he==="GET"||he==="HEAD"||d.dataAsQueryString;if(!d.content&&ze&&typeof ze!="string"&&!w.isBuffer(ze))if(de)ze=d.nestedQuerystring?qs.stringify(ze):querystring.stringify(ze);else{var le=Ee.headers["Content-Type"]||Ee.headers["content-type"];le||(le=d.contentType==="json"?"application/json":"application/x-www-form-urlencoded",Ee.headers["Content-Type"]=le),ze=parseContentType(le).type==="application/json"?(0,l.default)(ze):d.nestedQuerystring?qs.stringify(ze):querystring.stringify(ze)}de&&ze&&(Ee.path+=($.query?"&":"?")+ze,ze=null);var Oe=0;if(ze){var Ie=ze.length;w.isBuffer(ze)||(Ie=w.byteLength(ze)),Oe=Ee.headers["Content-Length"]=Ie}d.dataType==="json"&&(Ee.headers.Accept="application/json"),typeof d.beforeRequest=="function"&&d.beforeRequest(Ee);var qe=null,ee=null,k=null,U=!1,q=!1,Y=0,J=-1,be=!1,ke="",ct="",He=null;d.timing&&(He={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0}),Ee.headers["User-Agent"]||Ee.headers["user-agent"]||(Ee.headers["User-Agent"]=navigator.userAgent),d.gzip&&(Ee.headers["Accept-Encoding"]||Ee.headers["accept-encoding"]||(Ee.headers["Accept-Encoding"]="gzip"));var Be=d.writeStream;m("Request#%d %s %s with headers %j, options.path: %s",V,he,C,Ee.headers,Ee.path),d.requestUrls.push(C);var Ze,ht;Array.isArray(d.timeout)?(Ze=v(d.timeout[0]),ht=v(d.timeout[1])):Ze=ht=v(d.timeout),m("ConnectTimeout: %d, ResponseTimeout: %d",Ze,ht);var Qe;try{Qe=Te.request(Ee,K)}catch(Xe){return P(Xe)}return typeof window=="undefined"?function(){m("Connect timer ticking, timeout: %d",Ze),qe=setTimeout(function(){qe=null,J===-1&&(J=-2);var Xe="Connect timeout for "+Ze+"ms",Ke="ConnectionTimeoutError";Qe.socket||(Ke="SocketAssignTimeoutError",Xe+=", working sockets is full"),k=new Error(Xe),k.name=Ke,k.requestId=V,m("ConnectTimeout: Request#%d %s %s: %s, connected: %s",V,C,k.name,Xe,U),H()},Ze)}():Qe.on("requestTimeout",function(){J===-1&&(J=-2);var Xe="Connect timeout for "+Ze+"ms";k=new Error(Xe),k.name="ConnectionTimeoutError",k.requestId=V,H()}),He&&Qe.on("finish",function(){He.requestSent=Date.now()-ne}),Qe.once("socket",function(Xe){He&&(He.queuing=Date.now()-ne),isNode010&&Xe.socket&&(Xe=Xe.socket);var Ke=Xe.readyState;if(Ke==="opening")return Xe.once("lookup",function(Fe,Ue,_e){m("Request#%d %s lookup: %s, %s, %s",V,C,Fe,Ue,_e),He&&(He.dnslookup=Date.now()-ne),Ue&&(ke=Ue)}),void Xe.once("connect",function(){He&&(He.connected=Date.now()-ne),O(),te(),m("Request#%d %s new socket connected",V,C),U=!0,ke||(ke=Xe.remoteAddress),ct=Xe.remotePort});m("Request#%d %s reuse socket connected, readyState: %s",V,C,Ke),U=!0,q=!0,ke||(ke=Xe.remoteAddress),ct=Xe.remotePort,O(),te()}),Qe.on("error",function(Xe){Xe.name!=="Error"&&Xe.name!=="TypeError"||(Xe.name=U?"ResponseError":"RequestError"),Xe.message+=' (req "error")',m("Request#%d %s `req error` event emit, %s: %s",V,C,Xe.name,Xe.message),P(k||Xe)}),Be&&Be.once("error",function(Xe){Xe.message+=' (writeStream "error")',k=Xe,m("Request#%d %s `writeStream error` event emit, %s: %s",V,C,Xe.name,Xe.message),H()}),d.stream?(d.stream.pipe(Qe),d.stream.once("error",function(Xe){Xe.message+=' (stream "error")',k=Xe,m("Request#%d %s `readStream error` event emit, %s: %s",V,C,Xe.name,Xe.message),H()})):Qe.end(ze),Qe.requestId=V,Qe}}).call(this,S("_process"),S("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(j){function S(x){if(D[x])return D[x].exports;var T=D[x]={i:x,l:!1,exports:{}};return j[x].call(T.exports,T,T.exports,S),T.l=!0,T.exports}var D={};S.m=j,S.c=D,S.d=function(x,T,w){S.o(x,T)||Object.defineProperty(x,T,{configurable:!1,enumerable:!0,get:w})},S.n=function(x){var T=x&&x.__esModule?function(){return x.default}:function(){return x};return S.d(T,"a",T),T},S.o=function(x,T){return Object.prototype.hasOwnProperty.call(x,T)},S.p="",S(S.s=12)}([function(j,S,D){!function(x,T){j.exports=S=T()}(0,function(){var x=x||function(T,w){var f=Object.create||function(){function c(){}return function(m){var v;return c.prototype=m,v=new c,c.prototype=null,v}}(),p={},u=p.lib={},o=u.Base=function(){return{extend:function(c){var m=f(this);return c&&m.mixIn(c),m.hasOwnProperty("init")&&this.init!==m.init||(m.init=function(){m.$super.init.apply(this,arguments)}),m.init.prototype=m,m.$super=this,m},create:function(){var c=this.extend();return c.init.apply(c,arguments),c},init:function(){},mixIn:function(c){for(var m in c)c.hasOwnProperty(m)&&(this[m]=c[m]);c.hasOwnProperty("toString")&&(this.toString=c.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),i=u.WordArray=o.extend({init:function(c,m){c=this.words=c||[],this.sigBytes=m!=null?m:4*c.length},toString:function(c){return(c||s).stringify(this)},concat:function(c){var m=this.words,v=c.words,b=this.sigBytes,E=c.sigBytes;if(this.clamp(),b%4)for(var g=0;g<E;g++){var y=v[g>>>2]>>>24-g%4*8&255;m[b+g>>>2]|=y<<24-(b+g)%4*8}else for(var g=0;g<E;g+=4)m[b+g>>>2]=v[g>>>2];return this.sigBytes+=E,this},clamp:function(){var c=this.words,m=this.sigBytes;c[m>>>2]&=4294967295<<32-m%4*8,c.length=T.ceil(m/4)},clone:function(){var c=o.clone.call(this);return c.words=this.words.slice(0),c},random:function(c){for(var m,v=[],b=0;b<c;b+=4){var E=function(g){var g=g,y=987654321,C=4294967295;return function(){y=36969*(65535&y)+(y>>16)&C,g=18e3*(65535&g)+(g>>16)&C;var d=(y<<16)+g&C;return d/=4294967296,(d+=.5)*(T.random()>.5?1:-1)}}(4294967296*(m||T.random()));m=987654071*E(),v.push(4294967296*E()|0)}return new i.init(v,c)}}),l=p.enc={},s=l.Hex={stringify:function(c){for(var m=c.words,v=c.sigBytes,b=[],E=0;E<v;E++){var g=m[E>>>2]>>>24-E%4*8&255;b.push((g>>>4).toString(16)),b.push((15&g).toString(16))}return b.join("")},parse:function(c){for(var m=c.length,v=[],b=0;b<m;b+=2)v[b>>>3]|=parseInt(c.substr(b,2),16)<<24-b%8*4;return new i.init(v,m/2)}},h=l.Latin1={stringify:function(c){for(var m=c.words,v=c.sigBytes,b=[],E=0;E<v;E++){var g=m[E>>>2]>>>24-E%4*8&255;b.push(String.fromCharCode(g))}return b.join("")},parse:function(c){for(var m=c.length,v=[],b=0;b<m;b++)v[b>>>2]|=(255&c.charCodeAt(b))<<24-b%4*8;return new i.init(v,m)}},r=l.Utf8={stringify:function(c){try{return decodeURIComponent(escape(h.stringify(c)))}catch(m){throw new Error("Malformed UTF-8 data")}},parse:function(c){return h.parse(unescape(encodeURIComponent(c)))}},t=u.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new i.init,this._nDataBytes=0},_append:function(c){typeof c=="string"&&(c=r.parse(c)),this._data.concat(c),this._nDataBytes+=c.sigBytes},_process:function(c){var m=this._data,v=m.words,b=m.sigBytes,E=this.blockSize,g=4*E,y=b/g;y=c?T.ceil(y):T.max((0|y)-this._minBufferSize,0);var C=y*E,d=T.min(4*C,b);if(C){for(var _=0;_<C;_+=E)this._doProcessBlock(v,_);var O=v.splice(0,C);m.sigBytes-=d}return new i.init(O,d)},clone:function(){var c=o.clone.call(this);return c._data=this._data.clone(),c},_minBufferSize:0}),n=(u.Hasher=t.extend({cfg:o.extend(),init:function(c){this.cfg=this.cfg.extend(c),this.reset()},reset:function(){t.reset.call(this),this._doReset()},update:function(c){return this._append(c),this._process(),this},finalize:function(c){return c&&this._append(c),this._doFinalize()},blockSize:16,_createHelper:function(c){return function(m,v){return new c.init(v).finalize(m)}},_createHmacHelper:function(c){return function(m,v){return new n.HMAC.init(c,v).finalize(m)}}}),p.algo={});return p}(Math);return x})},function(j,S,D){"use strict";function x(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function f(p,u){for(var o=0;o<u.length;o++){var i=u[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(p,i.key,i)}}return function(p,u,o){return u&&f(p.prototype,u),o&&f(p,o),p}}(),w=function(){function f(){x(this,f)}return T(f,null,[{key:"detectIEVersion",value:function(){for(var p=4,u=document.createElement("div"),o=u.getElementsByTagName("i");u.innerHTML="<!--[if gt IE "+p+"]><i></i><![endif]-->",o[0];)p++;return p>4&&p}},{key:"extend",value:function(p,u){for(var o in u)Object.prototype.hasOwnProperty.call(u,o)&&u[o]&&(p[o]=u[o])}},{key:"isArray",value:function(p){return Object.prototype.toString.call(arg)==="[object Array]"}},{key:"getFileType",value:function(p){return p=p.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(p)?"video":/.mp3|.wav|.ape|.cda|.au|.midi|.mac|.aac|.ac3|.acm|.amr|.caf|.flac|.m4a|.ra|.wma/.test(p)?"audio":/.bmp|.jpg|.jpeg|.png/.test(p)?"img":"other"}},{key:"isImage",value:function(p){return p=p.toLowerCase(),!!/.jpg|.jpeg|.png/.test(p)}},{key:"ISODateString",value:function(p){function u(o){return o<10?"0"+o:o}return p.getUTCFullYear()+"-"+u(p.getUTCMonth()+1)+"-"+u(p.getUTCDate())+"T"+u(p.getUTCHours())+":"+u(p.getUTCMinutes())+":"+u(p.getUTCSeconds())+"Z"}},{key:"isIntNum",value:function(p){return!!/^\d+$/.test(p)}}]),f}();S.default=w},function(j,S,D){!function(x,T){j.exports=S=T(D(0))}(0,function(x){return function(T){function w(n,c,m,v,b,E,g){var y=n+(c&m|~c&v)+b+g;return(y<<E|y>>>32-E)+c}function f(n,c,m,v,b,E,g){var y=n+(c&v|m&~v)+b+g;return(y<<E|y>>>32-E)+c}function p(n,c,m,v,b,E,g){var y=n+(c^m^v)+b+g;return(y<<E|y>>>32-E)+c}function u(n,c,m,v,b,E,g){var y=n+(m^(c|~v))+b+g;return(y<<E|y>>>32-E)+c}var o=x,i=o.lib,l=i.WordArray,s=i.Hasher,h=o.algo,r=[];!function(){for(var n=0;n<64;n++)r[n]=4294967296*T.abs(T.sin(n+1))|0}();var t=h.MD5=s.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(n,c){for(var m=0;m<16;m++){var v=c+m,b=n[v];n[v]=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8)}var E=this._hash.words,g=n[c+0],y=n[c+1],C=n[c+2],d=n[c+3],_=n[c+4],O=n[c+5],A=n[c+6],P=n[c+7],I=n[c+8],W=n[c+9],K=n[c+10],te=n[c+11],H=n[c+12],G=n[c+13],V=n[c+14],re=n[c+15],$=E[0],ne=E[1],he=E[2],pe=E[3];$=w($,ne,he,pe,g,7,r[0]),pe=w(pe,$,ne,he,y,12,r[1]),he=w(he,pe,$,ne,C,17,r[2]),ne=w(ne,he,pe,$,d,22,r[3]),$=w($,ne,he,pe,_,7,r[4]),pe=w(pe,$,ne,he,O,12,r[5]),he=w(he,pe,$,ne,A,17,r[6]),ne=w(ne,he,pe,$,P,22,r[7]),$=w($,ne,he,pe,I,7,r[8]),pe=w(pe,$,ne,he,W,12,r[9]),he=w(he,pe,$,ne,K,17,r[10]),ne=w(ne,he,pe,$,te,22,r[11]),$=w($,ne,he,pe,H,7,r[12]),pe=w(pe,$,ne,he,G,12,r[13]),he=w(he,pe,$,ne,V,17,r[14]),ne=w(ne,he,pe,$,re,22,r[15]),$=f($,ne,he,pe,y,5,r[16]),pe=f(pe,$,ne,he,A,9,r[17]),he=f(he,pe,$,ne,te,14,r[18]),ne=f(ne,he,pe,$,g,20,r[19]),$=f($,ne,he,pe,O,5,r[20]),pe=f(pe,$,ne,he,K,9,r[21]),he=f(he,pe,$,ne,re,14,r[22]),ne=f(ne,he,pe,$,_,20,r[23]),$=f($,ne,he,pe,W,5,r[24]),pe=f(pe,$,ne,he,V,9,r[25]),he=f(he,pe,$,ne,d,14,r[26]),ne=f(ne,he,pe,$,I,20,r[27]),$=f($,ne,he,pe,G,5,r[28]),pe=f(pe,$,ne,he,C,9,r[29]),he=f(he,pe,$,ne,P,14,r[30]),ne=f(ne,he,pe,$,H,20,r[31]),$=p($,ne,he,pe,O,4,r[32]),pe=p(pe,$,ne,he,I,11,r[33]),he=p(he,pe,$,ne,te,16,r[34]),ne=p(ne,he,pe,$,V,23,r[35]),$=p($,ne,he,pe,y,4,r[36]),pe=p(pe,$,ne,he,_,11,r[37]),he=p(he,pe,$,ne,P,16,r[38]),ne=p(ne,he,pe,$,K,23,r[39]),$=p($,ne,he,pe,G,4,r[40]),pe=p(pe,$,ne,he,g,11,r[41]),he=p(he,pe,$,ne,d,16,r[42]),ne=p(ne,he,pe,$,A,23,r[43]),$=p($,ne,he,pe,W,4,r[44]),pe=p(pe,$,ne,he,H,11,r[45]),he=p(he,pe,$,ne,re,16,r[46]),ne=p(ne,he,pe,$,C,23,r[47]),$=u($,ne,he,pe,g,6,r[48]),pe=u(pe,$,ne,he,P,10,r[49]),he=u(he,pe,$,ne,V,15,r[50]),ne=u(ne,he,pe,$,O,21,r[51]),$=u($,ne,he,pe,H,6,r[52]),pe=u(pe,$,ne,he,d,10,r[53]),he=u(he,pe,$,ne,K,15,r[54]),ne=u(ne,he,pe,$,y,21,r[55]),$=u($,ne,he,pe,I,6,r[56]),pe=u(pe,$,ne,he,re,10,r[57]),he=u(he,pe,$,ne,A,15,r[58]),ne=u(ne,he,pe,$,G,21,r[59]),$=u($,ne,he,pe,_,6,r[60]),pe=u(pe,$,ne,he,te,10,r[61]),he=u(he,pe,$,ne,C,15,r[62]),ne=u(ne,he,pe,$,W,21,r[63]),E[0]=E[0]+$|0,E[1]=E[1]+ne|0,E[2]=E[2]+he|0,E[3]=E[3]+pe|0},_doFinalize:function(){var n=this._data,c=n.words,m=8*this._nDataBytes,v=8*n.sigBytes;c[v>>>5]|=128<<24-v%32;var b=T.floor(m/4294967296),E=m;c[15+(v+64>>>9<<4)]=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8),c[14+(v+64>>>9<<4)]=16711935&(E<<8|E>>>24)|4278255360&(E<<24|E>>>8),n.sigBytes=4*(c.length+1),this._process();for(var g=this._hash,y=g.words,C=0;C<4;C++){var d=y[C];y[C]=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8)}return g},clone:function(){var n=s.clone.call(this);return n._hash=this._hash.clone(),n}});o.MD5=s._createHelper(t),o.HmacMD5=s._createHmacHelper(t)}(Math),x.MD5})},function(j,S,D){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UPLOADSTATE={INIT:"init",UPLOADING:"uploading",COMPLETE:"complete",INTERRUPT:"interrupt"},S.UPLOADSTEP={INIT:"init",PART:"part",COMPLETE:"complete"},S.UPLOADDEFAULT={PARALLEL:5,PARTSIZE:1048576}},function(j,S,D){"use strict";function x(t){return t&&t.__esModule?t:{default:t}}function T(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var w=function(){function t(n,c){for(var m=0;m<c.length;m++){var v=c[m];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(n,v.key,v)}}return function(n,c,m){return c&&t(n.prototype,c),m&&t(n,m),n}}(),f=D(5),p=x(f),u=D(25),o=x(u),i=D(6),l=x(i),s=D(7),h=x(s),r=function(){function t(n){T(this,t);var c=h.default.os.name,m=h.default.os.version||"",v=h.default.browser.name,b=h.default.browser.version||"",E=window.location.href,g="";E&&(g=h.default.getHost(E));var y="pc";h.default.os.ipad?y="pad":(h.default.os.iphone||h.default.os.android)&&(y="phone"),this._ri=p.default.create(),this.initParam={APIVersion:"0.6.0",lv:"1",av:l.default.version,pd:"upload",sm:"upload",md:"uploader",uuid:t.getUuid(),os:c,ov:m,et:v,ev:b,uat:navigator.userAgent,app_n:g,tt:y,dm:"h5",ut:""}}return w(t,[{key:"log",value:function(n,c){c&&c.ri?(this._ri=c.ri,delete c.ri):this._ri=p.default.create(),c&&c.ut&&(this.initParam.ut=c.ut,delete c.ut),this.initParam.t=new Date().getTime(),this.initParam.ll=n=="20006"?"error":"info",this.initParam.ri=this._ri,this.initParam.e=n;var m=[];if(c)for(var v in c)m.push(v+"="+c[v]);var b=m.join("&");this.initParam.args=encodeURIComponent(b==""?"0":b);var E=[];for(var v in this.initParam)E.push(v+"="+this.initParam[v]);var g=E.join("&");AliyunUpload&&AliyunUpload.__logTestCallback__?AliyunUpload.__logTestCallback__(g):new Image(0,0).src="https://videocloud.cn-hangzhou.log.aliyuncs.com/logstores/upload/track?"+g}}],[{key:"getUuid",value:function(){var n=o.default.get("p_h5_upload_u");return n||(n=p.default.create(),o.default.set("p_h5_upload_u",n,730)),n}},{key:"getClientId",value:function(){return o.default.get("p_h5_upload_clientId")}},{key:"setClientId",value:function(n){return n||(n=p.default.create()),o.default.set("p_h5_upload_clientId",n,730),n}}]),t}();S.default=r},function(j,S,D){"use strict";function x(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function f(p,u){for(var o=0;o<u.length;o++){var i=u[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(p,i.key,i)}}return function(p,u,o){return u&&f(p.prototype,u),o&&f(p,o),p}}(),w=function(){function f(){x(this,f)}return T(f,null,[{key:"create",value:function(p,u){var o,i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),l=[];if(u=u||i.length,p)for(o=0;o<p;o++)l[o]=i[0|Math.random()*u];else{var s;for(l[8]=l[13]=l[18]=l[23]="-",l[14]="4",o=0;o<36;o++)l[o]||(s=0|16*Math.random(),l[o]=i[o==19?3&s|8:s])}return l.join("")}}]),f}();S.default=w},function(j,S,D){"use strict";Object.defineProperty(S,"__esModule",{value:!0});var x={version:"1.5.0"};S.default=x},function(j,S,D){"use strict";function x(i,l){if(!(i instanceof l))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function i(l,s){for(var h=0;h<s.length;h++){var r=s[h];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(l,r.key,r)}}return function(l,s,h){return s&&i(l.prototype,s),h&&i(l,h),l}}(),w=function(i){var l=navigator.userAgent,s="other";if(i.ios)return"iOS";if(i.android)return"android";if(l.indexOf("Baiduspider")>-1)return"Baiduspider";if(l.indexOf("PlayStation")>-1)return"PS4";var h=navigator.platform=="Win32"||navigator.platform=="Windows"||l.indexOf("Windows")>-1,r=navigator.platform=="Mac68K"||navigator.platform=="MacPPC"||navigator.platform=="Macintosh"||navigator.platform=="MacIntel";return r&&(s="macOS"),navigator.platform=="X11"&&!h&&!r&&(s="Unix"),String(navigator.platform).indexOf("Linux")>-1&&(s="Linux"),h?"windows":s},f=function(){var i=navigator.userAgent,l="";return(i.indexOf("Windows NT 5.0")>-1||i.indexOf("Windows 2000")>-1)&&(l="2000"),(i.indexOf("Windows NT 5.1")>-1||i.indexOf("Windows XP")>-1)&&(l="XP"),(i.indexOf("Windows NT 5.2")>-1||i.indexOf("Windows 2003")>-1)&&(l="2003"),(i.indexOf("Windows NT 6.0")>-1||i.indexOf("Windows Vista")>-1)&&(l="Vista"),(i.indexOf("Windows NT 6.1")>-1||i.indexOf("Windows 7")>-1)&&(l="7"),(i.indexOf("Windows NT 6.2")>-1||i.indexOf("Windows 8")>-1)&&(l="8"),(i.indexOf("Windows NT 6.3")>-1||i.indexOf("Windows 8.1")>-1)&&(l="8.1"),(i.indexOf("Windows NT 10")>-1||i.indexOf("Windows 10")>-1)&&(l="10"),l},p=function(i){var l=navigator.userAgent.toLowerCase();return i.chrome?"Chrome":i.firefox?"Firefox":i.safari?"Safari":i.webview?"webview":i.ie?/edge/.test(l)?"Edge":"IE":/baiduspider/.test(l)?"Baiduspider":/ucweb/.test(l)||/UCBrowser/.test(l)?"UC":/opera/.test(l)?"Opera":/ucweb/.test(l)?"UC":/360se/.test(l)?"360\u6D4F\u89C8\u5668":/bidubrowser/.test(l)?"\u767E\u5EA6\u6D4F\u89C8\u5668":/metasr/.test(l)?"\u641C\u72D7\u6D4F\u89C8\u5668":/lbbrowser/.test(l)?"\u730E\u8C79\u6D4F\u89C8\u5668":/micromessenger/.test(l)?"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668":/qqbrowser/.test(l)?"QQ\u6D4F\u89C8\u5668":/playstation/.test(l)?"PS4\u6D4F\u89C8\u5668":void 0},u=function(){var i={},l={},s=navigator.userAgent,h=navigator.platform,r=s.match(/Web[kK]it[\/]{0,1}([\d.]+)/),t=s.match(/(Android);?[\s\/]+([\d.]+)?/),n=!!s.match(/\(Macintosh\; Intel /),c=s.match(/(iPad).*OS\s([\d_]+)/),m=s.match(/(iPod)(.*OS\s([\d_]+))?/),v=!c&&s.match(/(iPhone\sOS)\s([\d_]+)/),b=s.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),E=/Win\d{2}|Windows/.test(h),g=s.match(/Windows Phone ([\d.]+)/),y=b&&s.match(/TouchPad/),C=s.match(/Kindle\/([\d.]+)/),d=s.match(/Silk\/([\d._]+)/),_=s.match(/(BlackBerry).*Version\/([\d.]+)/),O=s.match(/(BB10).*Version\/([\d.]+)/),A=s.match(/(RIM\sTablet\sOS)\s([\d.]+)/),P=s.match(/PlayBook/),I=s.match(/Chrome\/([\d.]+)/)||s.match(/CriOS\/([\d.]+)/),W=s.match(/Firefox\/([\d.]+)/),K=s.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/),te=s.match(/MSIE\s([\d.]+)/)||s.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),H=!I&&s.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),G=H||s.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if((l.webkit=!!r)&&(l.version=r[1]),t&&(i.android=!0,i.version=t[2]),v&&!m&&(i.ios=i.iphone=!0,i.version=v[2].replace(/_/g,".")),c&&(i.ios=i.ipad=!0,i.version=c[2].replace(/_/g,".")),m&&(i.ios=i.ipod=!0,i.version=m[3]?m[3].replace(/_/g,"."):null),g&&(i.wp=!0,i.version=g[1]),b&&(i.webos=!0,i.version=b[2]),y&&(i.touchpad=!0),_&&(i.blackberry=!0,i.version=_[2]),O&&(i.bb10=!0,i.version=O[2]),A&&(i.rimtabletos=!0,i.version=A[2]),P&&(l.playbook=!0),C&&(i.kindle=!0,i.version=C[1]),d&&(l.silk=!0,l.version=d[1]),!d&&i.android&&s.match(/Kindle Fire/)&&(l.silk=!0),I&&(l.chrome=!0,l.version=I[1]),W&&(l.firefox=!0,l.version=W[1]),K&&(i.firefoxos=!0,i.version=K[1]),te&&(l.ie=!0,l.version=te[1]),G&&(n||i.ios||E||t)&&(l.safari=!0,i.ios||(l.version=G[1])),H&&(l.webview=!0),n){var V=s.match(/[\d]*_[\d]*_[\d]*/);V&&V.length>0&&V[0]&&(i.version=V[0].replace(/_/g,"."))}return i.tablet=!!(c||P||t&&!s.match(/Mobile/)||W&&s.match(/Tablet/)||te&&!s.match(/Phone/)&&s.match(/Touch/)),i.phone=!(i.tablet||i.ipod||!(t||v||b||_||O||I&&s.match(/Android/)||I&&s.match(/CriOS\/([\d.]+)/)||W&&s.match(/Mobile/)||te&&s.match(/Touch/))),i.pc=!i.tablet&&!i.phone,n?i.name="macOS":E?(i.name="windows",i.version=f()):i.name=w(i),l.name=p(l),{os:i,browser:l}}(),o=function(){function i(){x(this,i)}return T(i,null,[{key:"getHost",value:function(l){var s="";if(l===void 0||l==null||l=="")return"";var h=l.indexOf("//"),r=l;h>-1&&(r=l.substring(h+2));var s=r,t=r.split("/");return t&&t.length>0&&(s=t[0]),t=s.split(":"),t&&t.length>0&&(s=t[0]),s}},{key:"os",get:function(){return u.os}},{key:"browser",get:function(){var l=u.browser;return l.name||(l.name=p()),l}}]),i}();S.default=o},function(j,S,D){"use strict";function x(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function f(p,u){for(var o=0;o<u.length;o++){var i=u[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(p,i.key,i)}}return function(p,u,o){return u&&f(p.prototype,u),o&&f(p,o),p}}(),w=function(){function f(){x(this,f)}return T(f,null,[{key:"get",value:function(p,u,o,i,l){var s;o=o||function(){},typeof XMLHttpRequest=="undefined"&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(h){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(h){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(h){}throw new Error("This browser does not support XMLHttpRequest.")}),s=new XMLHttpRequest,s.onreadystatechange=function(){s.readyState===4&&(s.status===200?u(s.responseText):o(s.responseText))};try{i===void 0&&(i=!0),s.open("GET",p,i),l&&(s.withCredentials=!0)}catch(h){return void o(h)}try{s.send()}catch(h){o(h)}}}]),f}();S.default=w},function(j,S,D){"use strict";function x(u,o){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function u(o,i){for(var l=0;l<i.length;l++){var s=i[l];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}return function(o,i,l){return i&&u(o.prototype,i),l&&u(o,l),o}}(),w=D(27),f=D(30),p=(D(10),function(){function u(){x(this,u)}return T(u,null,[{key:"randomUUID",value:function(){for(var o=[],i="0123456789abcdef",l=0;l<36;l++)o[l]=i.substr(Math.floor(16*Math.random()),1);return o[14]="4",o[19]=i.substr(3&o[19]|8,1),o[8]=o[13]=o[18]=o[23]="-",o.join("")}},{key:"aliyunEncodeURI",value:function(o){var i=encodeURIComponent(o);return i=i.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(o,i,l){if(!o)throw new Error("PrismPlayer Error: vid should not be null!");var s=[];for(var h in o)s.push(h);for(var r=s.sort(),t="",n=r.length,h=0;h<n;h++){var c=u.aliyunEncodeURI(r[h]),m=u.aliyunEncodeURI(o[r[h]]);t==""?t=c+i+m:t+=l+c+i+m}return t}},{key:"makeChangeSiga",value:function(o,i){if(!o)throw new Error("PrismPlayer Error: vid should not be null!");return f.stringify(w("GET&"+u.aliyunEncodeURI("/")+"&"+u.aliyunEncodeURI(u.makeUTF8sort(o,"=","&")),i+"&"))}}]),u}());S.default=p},function(j,S,D){!function(x,T){j.exports=S=T(D(0))}(0,function(x){return x.enc.Utf8})},function(j,S,D){!function(x,T){j.exports=S=T(D(0))}(0,function(x){return x.enc.Hex})},function(j,S,D){j.exports=D(13)},function(j,S,D){"use strict";var x,T,w=(typeof Symbol=="function"&&Symbol.iterator,D(14)),f=function(u){return u&&u.__esModule?u:{default:u}}(w),p={Vod:f.default};x=[],(T=function(){return p}.apply(S,x))!==void 0&&(j.exports=T),window.AliyunUpload=p,nt.exports=AliyunUpload},function(j,S,D){"use strict";function x(O){return O&&O.__esModule?O:{default:O}}function T(O,A){if(!(O instanceof A))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var w=function(){function O(A,P){for(var I=0;I<P.length;I++){var W=P[I];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(A,W.key,W)}}return function(A,P,I){return P&&O(A.prototype,P),I&&O(A,I),A}}(),f=D(15),p=D(3),u=D(16),o=x(u),i=D(18),l=x(i),s=D(24),h=x(s),r=D(4),t=x(r),n=D(1),c=x(n),m=D(5),v=x(m),b=D(26),E=x(b),g=D(31),y=x(g),C=D(32),d=x(C),_=(D(2),function(){function O(A){T(this,O),this.options=A,this.options.partSize=this.options.partSize||p.UPLOADDEFAULT.PARTSIZE,this.options.parallel=this.options.parallel||p.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=f.VODSTATE.INIT,this._uploadList=[],this._curIndex=-1,this._ossUpload=null,this._log=new t.default,this._retryCount=0,this._retryTotal=this.options.retryCount||3,this._retryDuration=this.options.retryDuration||2,this._state=f.VODSTATE.INIT,this._uploadWay="vod",this._onbeforeunload=!1,this._invalidUserId=!1,this._initEvent()}return w(O,[{key:"init",value:function(A,P,I,W){return this._retryCount=0,!(I&&!W||!I&&W)&&!(A&&!P||!A&&P)&&(this._ossCreditor.accessKeyId=A,this._ossCreditor.accessKeySecret=P,this._ossCreditor.securityToken=I,this._ossCreditor.expireTime=W,!0)}},{key:"addFile",value:function(A,P,I,W,K,te){if(!A)return!1;if(A.size==0)try{this.options.onUploadFailed({file:A},"EmptyFile","\u6587\u4EF6\u5927\u5C0F\u4E3A0\uFF0C\u4E0D\u80FD\u4E0A\u4F20")}catch(re){console.log(re)}for(var H=(this.options,0);H<this._uploadList.length;H++)if(this._uploadList[H].file==A)return!1;var G=new Object;if(G.file=A,G._endpoint=P,G._bucket=I,G._object=W,G.state=f.UPLOADSTATE.INIT,G.isImage=c.default.isImage(A.name),!G.isImage&&this.options.enableUploadProgress){var V=this;d.default.getMd5(A,function(re){G.fileHash=re;var $=V._getCheckoutpoint(G);V.options.localCheckpoint||$||V._getCheckoutpointFromCloud(G,function(ne){if(ne.UploadPoint){var he=JSON.parse(ne.UploadPoint);he.loaded!=1&&(G.checkpoint=he.checkpoint,G.loaded=he.loaded,G.videoId=ne.VideoId,V._saveCheckoutpoint(G,he.checkpoint))}},function(ne){try{if((ne=JSON.parse(ne))&&ne.Code=="InvalidParameter"&&ne.Message.indexOf("UserId")>0){V._invalidUserId=!0;var he=ne.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(he)}}catch(pe){console.log(pe)}})})}K&&(G.videoInfo=K?JSON.parse(K).Vod:{},G.userData=l.default.encode(K)),G.ri=v.default.create(),this._uploadList.push(G),this._reportLog("20001",G,{ql:this._uploadList.length});try{this.options.addFileSuccess&&this.options.addFileSuccess(G)}catch(re){console.log(re)}return!0}},{key:"deleteFile",value:function(A){return!!this.cancelFile(A)&&(this._uploadList.splice(A,1),!0)}},{key:"cleanList",value:function(){this.stopUpload(),this._uploadList.length=0,this._curIndex=-1}},{key:"cancelFile",value:function(A){if(this.options,A<0||A>=this._uploadList.length)return!1;var P=this._uploadList[A];if(A==this._curIndex&&P.state==f.UPLOADSTATE.UPLOADING){P.state=f.UPLOADSTATE.CANCELED;var I=this._getCheckoutpoint(P);I&&I.checkpoint&&(I=I.checkpoint),I&&this._ossUpload.abort(P),this._removeCheckoutpoint(P),this.nextUpload()}else P.state!=f.UPLOADSTATE.SUCCESS&&(P.state=f.UPLOADSTATE.CANCELED);return this._reportLog("20008",P),!0}},{key:"resumeFile",value:function(A){if(this.options,A<0||A>=this._uploadList.length)return!1;var P=this._uploadList[A];return P.state==f.UPLOADSTATE.CANCELED&&(P.state=f.UPLOADSTATE.INIT,!0)}},{key:"listFiles",value:function(){return this._uploadList}},{key:"getCheckpoint",value:function(A){return this._getCheckoutpoint({file:A})}},{key:"startUpload",value:function(A){if(this._retryCount=0,this.options,this._state==f.VODSTATE.START||this._state==f.VODSTATE.EXPIRE)return void console.log("already started or expired");if(this._initState(),this._curIndex=this._findUploadIndex(),this._curIndex==-1)return void(this._state=f.VODSTATE.END);var P=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(P),this._state=f.VODSTATE.START}},{key:"nextUpload",value:function(){var A=this.options;if(this._state==f.VODSTATE.START)if(this._curIndex=this._findUploadIndex(),this._curIndex!=-1){var P=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(P)}else{this._state=f.VODSTATE.END;try{A.onUploadEnd&&A.onUploadEnd(P)}catch(I){console.log(I)}}}},{key:"clear",value:function(A){for(var P=this.options,I=0,W=0;W<this._uploadList.length;W++)P.uploadList[W].state==f.UPLOADSTATE.SUCCESS&&I++,this._uploadList[W].state==A&&(P.uploadList.splice(W,1),W--);P.onClear&&P.onClear(P.uploadList.length,I)}},{key:"stopUpload",value:function(){if((this._state==f.VODSTATE.START||this._state==f.VODSTATE.FAILURE||this._curIndex==-1)&&this._curIndex!=-1){var A=this._uploadList[this._curIndex];this._state=f.VODSTATE.STOP,A.state=f.UPLOADSTATE.STOPED,this._changeState(A,f.UPLOADSTATE.STOPED),this._ossUpload.cancel()}}},{key:"resumeUploadWithAuth",value:function(A){var P=this;if(!A)return!1;var I=JSON.parse(l.default.decode(A));return!!(I.AccessKeyId&&I.AccessKeySecret&&I.SecurityToken&&I.Expiration)&&P.resumeUploadWithToken(I.AccessKeyId,I.AccessKeySecret,I.SecurityToken,I.Expiration)}},{key:"resumeUploadWithToken",value:function(A,P,I,W){if(this.options,!(A&&P&&I&&W))return!1;if(this._state!=f.VODSTATE.EXPIRE)return!1;if(this._curIndex==-1)return!1;var K="";return this._uploadList.length>this._curIndex&&(K=this._uploadList[this._curIndex]),K&&(this.init(A,P,I,W),this._state=f.VODSTATE.START,this._ossUpload=null,this._uploadCore(K,K.retry),K.retry=!1),!0}},{key:"resumeUploadWithSTSToken",value:function(A,P,I){if(this._curIndex==-1)return!1;if(this._state!=f.VODSTATE.EXPIRE)return!1;if(this._uploadList.length>this._curIndex){var W=this._uploadList[this._curIndex];W.object?this._refreshSTSTokenUpload(W,A,P,I):this.setSTSToken(W,A,P,I)}}},{key:"setSTSTokenDirectlyUpload",value:function(A,P,I,W,K){if(!(P&&I&&W&&K))return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken and expiration should not be empty."),!1;this._ut="oss";var te=A;this.init(P,I,W,K),te.endpoint=te._endpoint,te.bucket=te._bucket,te.object=te._object,this._ossUpload=null,this._uploadCore(te,A.retry),A.retry=!1}},{key:"setSTSToken",value:function(A,P,I,W){if(!P||!I||!W)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;this._ut="vod",this._uploadWay="sts";var K=A.videoInfo,te={accessKeyId:P,securityToken:W,accessKeySecret:I,fileName:A.file.name,title:K.Title,requestId:A.ri,region:this.options.region};K.ImageType&&(te.imageType=K.ImageType),K.ImageExt&&(te.imageExt=K.ImageExt),K.FileSize&&(te.fileSize=K.FileSize),K.Description&&(te.description=K.Description),K.CateId&&(te.cateId=K.CateId),K.Tags&&(te.tags=K.Tags),K.TemplateGroupId&&(te.templateGroupId=K.TemplateGroupId),K.StorageLocation&&(te.storageLocation=K.StorageLocation),K.CoverURL&&(te.coverUrl=K.CoverURL),K.TransCodeMode&&(te.transCodeMode=K.TransCodeMode),K.UserData&&(te.userData=K.UserData);var H=this,G="getUploadAuth";A.videoId?(te.videoId=A.videoId,G="refreshUploadAuth"):A.isImage&&(G="getImageUploadAuth"),E.default[G](te,function(V){A.videoId=V.VideoId?V.VideoId:A.videoId,H.setUploadAuthAndAddress(A,V.UploadAuth,V.UploadAddress),H._state=f.VODSTATE.START},function(V){H._error(A,{name:V.Code,code:V.Code,message:V.Message,requestId:V.RequestId})})}},{key:"setUploadAuthAndAddress",value:function(A,P,I,W){if(!A||!P||!I)return!1;var K=JSON.parse(l.default.decode(P));if(!(K.AccessKeyId&&K.AccessKeySecret&&K.SecurityToken&&K.Expiration))return console.error("uploadauth is invalid"),!1;var te={},H=A;if(I){if(te=JSON.parse(l.default.decode(I)),!te.Endpoint||!te.Bucket||!te.FileName)return console.error("uploadAddress is invalid"),!1}else te.Endpoint=H.endpoint,te.Bucket=H.bucket,te.FileName=H.object;this._ut="vod",this._uploadWay="vod",this.options.region=K.Region||this.options.region,this.init(K.AccessKeyId,K.AccessKeySecret,K.SecurityToken,K.Expiration),H.endpoint=H._endpoint?H._endpoint:te.Endpoint,H.bucket=H._bucket?H._bucket:te.Bucket,H.object=H._object?H._object:te.FileName,H.region=this.options.region,W&&(H.videoId=W),this._ossUpload=null,this._uploadCore(H,A.retry),A.retry=!1}},{key:"_refreshSTSTokenUpload",value:function(A,P,I,W){if(!P||!I||!W)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;var K={accessKeyId:P,securityToken:W,accessKeySecret:I,videoId:A.object,requestId:A.ri,region:this.options.region},te=this,H="refreshUploadAuth";A.isImage&&(H="getImageUploadAuth"),E.default[H](K,function(G){te.setUploadAuthAndAddress(A,G.UploadAuth,UploadAddress),te._state=f.VODSTATE.START},function(G){te._error(A,{name:G.Code,code:G.Code,message:G.Message,requestId:G.RequestId})})}},{key:"_upload",value:function(A){var P=arguments.length>1&&arguments[1]!==void 0&&arguments[1],I=this.options;if(A.retry=P,I.onUploadstarted&&!P)try{var W=this._getCheckoutpoint(A);W&&W.state!=f.UPLOADSTATE.UPLOADING&&(A.checkpoint=W,A.videoId=W.videoId),I.onUploadstarted(A)}catch(K){console.log(K)}}},{key:"_uploadCore",value:function(A){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(A.state=f.UPLOADSTATE.UPLOADING,!this._ossUpload){A.endpoint=A.endpoint||"http://oss-cn-hangzhou.aliyuncs.com";var P=this;this._ossUpload=new o.default({bucket:A.bucket,endpoint:A.endpoint,AccessKeyId:this._ossCreditor.accessKeyId,AccessKeySecret:this._ossCreditor.accessKeySecret,SecurityToken:this._ossCreditor.securityToken,timeout:this.options.timeout,cname:this.options.cname},{onerror:function(V,re){P._error.call(P,V,re)},oncomplete:function(V,re){P._complete.call(P,V,re)},onprogress:function(V,re,$){P._progress.call(P,V,re,$)}})}var I=c.default.getFileType(A.file.name),W=this._getCheckoutpoint(A),K="",te="";W&&W.checkpoint&&(te=W.state,K=W.videoId,W=W.checkpoint),W&&K==A.videoId&&te!=f.UPLOADSTATE.UPLOADING&&(W.file=A.file,A.checkpoint=W,W.uploadId);var H=this._adjustPartSize(A);this._reportLog("20002",A,{ft:I,fs:A.file.size,bu:A.bucket,ok:A.object,vid:A.videoId||"",fn:A.file.name,fw:null,fh:null,ps:H});var G={headers:{"x-oss-notification":A.userData?A.userData:""},partSize:H,parallel:this.options.parallel};this._ossUpload.upload(A,G)}},{key:"_findUploadIndex",value:function(){for(var A=-1,P=0;P<this._uploadList.length;P++)if(this._uploadList[P].state==f.UPLOADSTATE.INIT){A=P;break}return A}},{key:"_error",value:function(A,P){if(P.name=="cancel")try{this.options.onUploadCanceled(A,P)}catch(W){console.log(W)}else{if(P.message.indexOf("InvalidAccessKeyIdError")>0||P.name=="SignatureDoesNotMatchError"||P.code=="SecurityTokenExpired"||P.code=="InvalidSecurityToken.Expired"||P.code=="InvalidAccessKeyId"&&this._ossCreditor.securityToken){if(this.options.onUploadTokenExpired){this._state=f.VODSTATE.EXPIRE,A.state=f.UPLOADSTATE.FAIlURE;try{this.options.onUploadTokenExpired(A,P)}catch(W){console.log(W)}}return}if((P.name=="RequestTimeoutError"||P.name=="ConnectionTimeout"||P.name=="ConnectionTimeoutError")&&this._retryTotal>this._retryCount){var I=this;return setTimeout(function(){I._uploadCore(A,!0)},1e3*I._retryDuration),void this._retryCount++}P.name=="NoSuchUploadError"&&this._removeCheckoutpoint(A),this._handleError(A,P)}}},{key:"_handleError",value:function(A,P){var I=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],W=f.UPLOADSTATE.FAIlURE;if(A.state!=f.UPLOADSTATE.CANCELED&&(A.state=f.UPLOADSTATE.FAIlURE,this._state=f.VODSTATE.FAILURE,this.options.onUploadFailed&&P&&P.code&&P.message))try{this.options.onUploadFailed(A,P.code,P.message)}catch(te){console.log(te)}if(I&&this._changeState(A,W),this._reportLog("20006",A,{code:P.name,message:P.message,requestId:P.requestId,fs:A.file.size,bu:A.bucket,ok:A.object,fn:A.file.name}),this._reportLog("20004",A,{requestId:P.requestId,fs:A.file.size,bu:A.bucket,ok:A.object,fn:A.file.name}),A.ri=v.default.create(),this._findUploadIndex()!=-1){var K=this;this._state=f.VODSTATE.START,setTimeout(function(){K.nextUpload()},100)}}},{key:"_complete",value:function(A,P){if(A.state=f.UPLOADSTATE.SUCCESS,this.options.onUploadSucceed)try{this.options.onUploadSucceed(A)}catch(K){console.log(K)}var I=0;P&&P.res&&P.res.headers&&(I=P.res.headers["x-oss-request-id"]),this._removeCheckoutpoint(A);var W=this;setTimeout(function(){W.nextUpload()},100),this._retryCount=0,this._reportLog("20003",A,{requestId:I})}},{key:"_progress",value:function(A,P,I){if(this.options.onUploadProgress)try{A.loaded=P.loaded,this.options.onUploadProgress(A,P.total,P.loaded)}catch(re){console.log(re)}var W=P.checkpoint,K=0;W&&(A.checkpoint=W,this._saveCheckoutpoint(A,W,f.UPLOADSTATE.UPLOADING),K=W.uploadId),this._retryCount=0;var te=this._getPortNumber(W),H=0;if(I&&I.headers&&(H=I.headers["x-oss-request-id"]),P.loaded!=0&&this._reportLog("20007",A,{pn:te,requestId:H}),P.loaded!=1&&this._reportLog("20005",A,{UploadId:K,pn:te+1,pr:A.retry?1:0,fs:A.file.size,bu:A.bucket,ok:A.object,fn:A.file.name}),!this._invalidUserId&&!A.isImage&&this._ut=="vod"&&this.options.enableUploadProgress){var G={file:A.file,checkpoint:P,userId:this.options.userId,videoId:A.videoId,region:this.options.region,fileHash:A.fileHash};try{var V=this;y.default.upload(G,function(){},function(re){if((re=JSON.parse(re))&&re.Code=="InvalidParameter"&&re.Message.indexOf("UserId")>0){V._invalidUserId=!0;var $=re.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log($)}})}catch(re){console.log(re)}}}},{key:"_getPortNumber",value:function(A){if(A){var P=A.doneParts;if(P&&P.length>0)return P[P.length-1].number}return 0}},{key:"_removeCheckoutpoint",value:function(A){var P=this._getCheckoutpointKey(A);h.default.remove(P)}},{key:"_getCheckoutpoint",value:function(A){var P=this._getCheckoutpointKey(A),I=h.default.get(P);if(I)try{return JSON.parse(I)}catch(W){}return""}},{key:"_saveCheckoutpoint",value:function(A,P,I){if(P){var W=this._getCheckoutpointKey(A),K=A.file,te={fileName:K.name,lastModified:K.lastModified,size:K.size,object:A.object,videoId:A.videoId,bucket:A.bucket,endpoint:A.endpoint,checkpoint:P,loaded:A.loaded,state:I};h.default.set(W,JSON.stringify(te))}}},{key:"_changeState",value:function(A,P){var I=this._getCheckoutpoint(A);I&&((this._onbeforeunload=!0)&&(P=f.UPLOADSTATE.STOPED),this._saveCheckoutpoint(A,I.checkpoint,P))}},{key:"_getCheckoutpointKey",value:function(A){return"upload_"+A.file.lastModified+"_"+A.file.name+"_"+A.file.size}},{key:"_getCheckoutpointFromCloud",value:function(A,P,I){var W={userId:this.options.userId,uploadInfoList:[{FileName:A.file.name,FileSize:A.file.size,FileCreateTime:A.file.lastModified,FileHash:A.fileHash}],region:this.options.region};y.default.get(W,function(K){P(K)},I)}},{key:"_reportLog",value:function(A,P,I){I||(I={}),I.ri=P.ri,this._ut&&(I.ut=this._ut),this._log.log(A,I)}},{key:"_initEvent",value:function(){var A=this;window&&(window.onbeforeunload=function(P){if(A._onbeforeunload=!0,A._curIndex!=-1&&A._uploadList.length>A._curIndex){var I=A._uploadList[A._curIndex];A._changeState(I,f.UPLOADSTATE.STOPED)}})}},{key:"_initState",value:function(){for(var A=0;A<this._uploadList.length;A++){var P=this._uploadList[A];P.state!=f.UPLOADSTATE.FAIlURE&&P.state!=f.UPLOADSTATE.STOPED||(P.state=f.UPLOADSTATE.INIT)}this._state=f.VODSTATE.INIT}},{key:"_adjustPartSize",value:function(A){return A.file.size/this.options.partSize>1e4?A.file.size/9999:this.options.partSize}}]),O}());S.default=_},function(j,S,D){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UPLOADSTATE={INIT:"Ready",UPLOADING:"Uploading",SUCCESS:"Success",FAIlURE:"Failure",CANCELED:"Canceled",STOPED:"Stoped"},S.VODSTATE={INIT:"Init",START:"Start",STOP:"Stop",FAILURE:"Failure",EXPIRE:"Expire",END:"End"}},function(j,S,D){"use strict";function x(i){return i&&i.__esModule?i:{default:i}}function T(i,l){if(!(i instanceof l))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var w=function(){function i(l,s){for(var h=0;h<s.length;h++){var r=s[h];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(l,r.key,r)}}return function(l,s,h){return s&&i(l.prototype,s),h&&i(l,h),l}}(),f=D(3),p=D(17),u=(x(p),D(1)),o=(x(u),function(){function i(l,s){if(T(this,i),l){this._config=l,this.create(this._config),this._uploadInfo=null,this._callback={};var h=function(){};this._callback.onerror=s.onerror||h,this._callback.oncomplete=s.oncomplete||h,this._callback.onprogress=s.onprogress||h}}return w(i,[{key:"create",value:function(l){if(l.endpoint=l.endpoint||this._config.endpoint,l.bucket=l.bucket||this._config.bucket,!(l.AccessKeyId&&l.AccessKeySecret&&l.endpoint&&l.SecurityToken))throw new Error("AccessKeyId\u3001AccessKeySecret\u3001endpoint should not be null");var s={accessKeyId:l.AccessKeyId,accessKeySecret:l.AccessKeySecret,stsToken:l.SecurityToken,endpoint:l.endpoint||this._config.endpoint,bucket:l.bucket||this._config.bucket,secure:!0,cname:l.cname};l.timeout&&(s.timeout=l.timeout),this.oss=new OSS.Wrapper(s)}},{key:"abort",value:function(l){if(l.checkpoint){var s=l.checkpoint.uploadId;this.oss.abortMultipartUpload(l.object,s)}}},{key:"getVersion",value:function(){}},{key:"cancel",value:function(){this.oss.cancel&&this.oss.cancel()}},{key:"upload",value:function(l,s){this._uploadInfo=l;var h=this,r=function(n,c,m){return function(v){h._progress(n,c,m),v()}},t={parallel:s.parallel||this._config.parallel||f.UPLOADDEFAULT.PARALLEL,partSize:s.partSize||this._config.partSize||f.UPLOADDEFAULT.PARTSIZE,progress:r};s.headers&&(t.headers=s.headers),l.checkpoint&&(t.checkpoint=l.checkpoint),l.bucket||(this.oss.options.bucket=l.bucket),l.endpoint||(this.oss.options.endpoint=l.endpoint),this.oss.multipartUpload(l.object,l.file,t).then(function(n,c){h._complete(n)}).catch(function(n){h.oss.cancel&&(h.oss&&h.oss.isCancel()?console.log("oss is cancel as error"):h.oss.cancel()),h._error(n)})}},{key:"header",value:function(l,s,h){this.oss.get(l.object).then(function(r){s(r)}).catch(function(r){h(r)})}},{key:"_progress",value:function(l,s,h){this._callback.onprogress(this._uploadInfo,{loaded:l,total:this._uploadInfo.file.size,checkpoint:s},h)}},{key:"_error",value:function(l){this._callback.onerror(this._uploadInfo,l)}},{key:"_complete",value:function(l){this._callback.oncomplete(this._uploadInfo,l)}}]),i}());S.default=o},function(j,S,D){"use strict";function x(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function f(p,u){for(var o=0;o<u.length;o++){var i=u[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(p,i.key,i)}}return function(p,u,o){return u&&f(p.prototype,u),o&&f(p,o),p}}(),w=function(){function f(){x(this,f)}return T(f,null,[{key:"format",value:function(p){if(arguments.length<2)return null;for(var u=arguments[1],o=1;o<arguments.length;o++){var i=new RegExp("\\{"+(o-1)+"\\}","gm");u=u.replace(i,arguments[o+1])}return{code:p,message:u}}},{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."}}}]),f}();S.default=w},function(j,S,D){"use strict";(function(x){function T(p,u){if(!(p instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var w=function(){function p(u,o){for(var i=0;i<o.length;i++){var l=o[i];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(u,l.key,l)}}return function(u,o,i){return o&&p(u.prototype,o),i&&p(u,i),u}}(),f=function(){function p(){T(this,p)}return w(p,null,[{key:"encode",value:function(u){return new x(u).toString("base64")}},{key:"decode",value:function(u){return new x(u,"base64").toString()}}]),p}();S.default=f}).call(S,D(19).Buffer)},function(j,S,D){"use strict";(function(x){function T(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function w(ee,k){if(T()<k)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(ee=new Uint8Array(k),ee.__proto__=f.prototype):(ee===null&&(ee=new f(k)),ee.length=k),ee}function f(ee,k,U){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(ee,k,U);if(typeof ee=="number"){if(typeof k=="string")throw new Error("If encoding is specified then the first argument must be a string");return i(this,ee)}return p(this,ee,k,U)}function p(ee,k,U,q){if(typeof k=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&k instanceof ArrayBuffer?h(ee,k,U,q):typeof k=="string"?l(ee,k,U):r(ee,k)}function u(ee){if(typeof ee!="number")throw new TypeError('"size" argument must be a number');if(ee<0)throw new RangeError('"size" argument must not be negative')}function o(ee,k,U,q){return u(k),k<=0?w(ee,k):U!==void 0?typeof q=="string"?w(ee,k).fill(U,q):w(ee,k).fill(U):w(ee,k)}function i(ee,k){if(u(k),ee=w(ee,k<0?0:0|t(k)),!f.TYPED_ARRAY_SUPPORT)for(var U=0;U<k;++U)ee[U]=0;return ee}function l(ee,k,U){if(typeof U=="string"&&U!==""||(U="utf8"),!f.isEncoding(U))throw new TypeError('"encoding" must be a valid string encoding');var q=0|c(k,U);ee=w(ee,q);var Y=ee.write(k,U);return Y!==q&&(ee=ee.slice(0,Y)),ee}function s(ee,k){var U=k.length<0?0:0|t(k.length);ee=w(ee,U);for(var q=0;q<U;q+=1)ee[q]=255&k[q];return ee}function h(ee,k,U,q){if(k.byteLength,U<0||k.byteLength<U)throw new RangeError("'offset' is out of bounds");if(k.byteLength<U+(q||0))throw new RangeError("'length' is out of bounds");return k=U===void 0&&q===void 0?new Uint8Array(k):q===void 0?new Uint8Array(k,U):new Uint8Array(k,U,q),f.TYPED_ARRAY_SUPPORT?(ee=k,ee.__proto__=f.prototype):ee=s(ee,k),ee}function r(ee,k){if(f.isBuffer(k)){var U=0|t(k.length);return ee=w(ee,U),ee.length===0||k.copy(ee,0,0,U),ee}if(k){if(typeof ArrayBuffer!="undefined"&&k.buffer instanceof ArrayBuffer||"length"in k)return typeof k.length!="number"||ze(k.length)?w(ee,0):s(ee,k);if(k.type==="Buffer"&&Oe(k.data))return s(ee,k.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function t(ee){if(ee>=T())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T().toString(16)+" bytes");return 0|ee}function n(ee){return+ee!=ee&&(ee=0),f.alloc(+ee)}function c(ee,k){if(f.isBuffer(ee))return ee.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(ee)||ee instanceof ArrayBuffer))return ee.byteLength;typeof ee!="string"&&(ee=""+ee);var U=ee.length;if(U===0)return 0;for(var q=!1;;)switch(k){case"ascii":case"latin1":case"binary":return U;case"utf8":case"utf-8":case void 0:return Ee(ee).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*U;case"hex":return U>>>1;case"base64":return je(ee).length;default:if(q)return Ee(ee).length;k=(""+k).toLowerCase(),q=!0}}function m(ee,k,U){var q=!1;if((k===void 0||k<0)&&(k=0),k>this.length)return"";if((U===void 0||U>this.length)&&(U=this.length),U<=0)return"";if(U>>>=0,k>>>=0,U<=k)return"";for(ee||(ee="utf8");;)switch(ee){case"hex":return te(this,k,U);case"utf8":case"utf-8":return P(this,k,U);case"ascii":return W(this,k,U);case"latin1":case"binary":return K(this,k,U);case"base64":return A(this,k,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,k,U);default:if(q)throw new TypeError("Unknown encoding: "+ee);ee=(ee+"").toLowerCase(),q=!0}}function v(ee,k,U){var q=ee[k];ee[k]=ee[U],ee[U]=q}function b(ee,k,U,q,Y){if(ee.length===0)return-1;if(typeof U=="string"?(q=U,U=0):U>2147483647?U=2147483647:U<-2147483648&&(U=-2147483648),U=+U,isNaN(U)&&(U=Y?0:ee.length-1),U<0&&(U=ee.length+U),U>=ee.length){if(Y)return-1;U=ee.length-1}else if(U<0){if(!Y)return-1;U=0}if(typeof k=="string"&&(k=f.from(k,q)),f.isBuffer(k))return k.length===0?-1:E(ee,k,U,q,Y);if(typeof k=="number")return k&=255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Y?Uint8Array.prototype.indexOf.call(ee,k,U):Uint8Array.prototype.lastIndexOf.call(ee,k,U):E(ee,[k],U,q,Y);throw new TypeError("val must be string, number or Buffer")}function E(ee,k,U,q,Y){function J(Qe,Xe){return be===1?Qe[Xe]:Qe.readUInt16BE(Xe*be)}var be=1,ke=ee.length,ct=k.length;if(q!==void 0&&((q=String(q).toLowerCase())==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(ee.length<2||k.length<2)return-1;be=2,ke/=2,ct/=2,U/=2}var He;if(Y){var Be=-1;for(He=U;He<ke;He++)if(J(ee,He)===J(k,Be===-1?0:He-Be)){if(Be===-1&&(Be=He),He-Be+1===ct)return Be*be}else Be!==-1&&(He-=He-Be),Be=-1}else for(U+ct>ke&&(U=ke-ct),He=U;He>=0;He--){for(var Ze=!0,ht=0;ht<ct;ht++)if(J(ee,He+ht)!==J(k,ht)){Ze=!1;break}if(Ze)return He}return-1}function g(ee,k,U,q){U=Number(U)||0;var Y=ee.length-U;q?(q=Number(q))>Y&&(q=Y):q=Y;var J=k.length;if(J%2!=0)throw new TypeError("Invalid hex string");q>J/2&&(q=J/2);for(var be=0;be<q;++be){var ke=parseInt(k.substr(2*be,2),16);if(isNaN(ke))return be;ee[U+be]=ke}return be}function y(ee,k,U,q){return We(Ee(k,ee.length-U),ee,U,q)}function C(ee,k,U,q){return We(xe(k),ee,U,q)}function d(ee,k,U,q){return C(ee,k,U,q)}function _(ee,k,U,q){return We(je(k),ee,U,q)}function O(ee,k,U,q){return We(Ge(k,ee.length-U),ee,U,q)}function A(ee,k,U){return k===0&&U===ee.length?de.fromByteArray(ee):de.fromByteArray(ee.slice(k,U))}function P(ee,k,U){U=Math.min(ee.length,U);for(var q=[],Y=k;Y<U;){var J=ee[Y],be=null,ke=J>239?4:J>223?3:J>191?2:1;if(Y+ke<=U){var ct,He,Be,Ze;switch(ke){case 1:J<128&&(be=J);break;case 2:ct=ee[Y+1],(192&ct)==128&&(Ze=(31&J)<<6|63&ct)>127&&(be=Ze);break;case 3:ct=ee[Y+1],He=ee[Y+2],(192&ct)==128&&(192&He)==128&&(Ze=(15&J)<<12|(63&ct)<<6|63&He)>2047&&(Ze<55296||Ze>57343)&&(be=Ze);break;case 4:ct=ee[Y+1],He=ee[Y+2],Be=ee[Y+3],(192&ct)==128&&(192&He)==128&&(192&Be)==128&&(Ze=(15&J)<<18|(63&ct)<<12|(63&He)<<6|63&Be)>65535&&Ze<1114112&&(be=Ze)}}be===null?(be=65533,ke=1):be>65535&&(be-=65536,q.push(be>>>10&1023|55296),be=56320|1023&be),q.push(be),Y+=ke}return I(q)}function I(ee){var k=ee.length;if(k<=Ie)return String.fromCharCode.apply(String,ee);for(var U="",q=0;q<k;)U+=String.fromCharCode.apply(String,ee.slice(q,q+=Ie));return U}function W(ee,k,U){var q="";U=Math.min(ee.length,U);for(var Y=k;Y<U;++Y)q+=String.fromCharCode(127&ee[Y]);return q}function K(ee,k,U){var q="";U=Math.min(ee.length,U);for(var Y=k;Y<U;++Y)q+=String.fromCharCode(ee[Y]);return q}function te(ee,k,U){var q=ee.length;(!k||k<0)&&(k=0),(!U||U<0||U>q)&&(U=q);for(var Y="",J=k;J<U;++J)Y+=Me(ee[J]);return Y}function H(ee,k,U){for(var q=ee.slice(k,U),Y="",J=0;J<q.length;J+=2)Y+=String.fromCharCode(q[J]+256*q[J+1]);return Y}function G(ee,k,U){if(ee%1!=0||ee<0)throw new RangeError("offset is not uint");if(ee+k>U)throw new RangeError("Trying to access beyond buffer length")}function V(ee,k,U,q,Y,J){if(!f.isBuffer(ee))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>Y||k<J)throw new RangeError('"value" argument is out of bounds');if(U+q>ee.length)throw new RangeError("Index out of range")}function re(ee,k,U,q){k<0&&(k=65535+k+1);for(var Y=0,J=Math.min(ee.length-U,2);Y<J;++Y)ee[U+Y]=(k&255<<8*(q?Y:1-Y))>>>8*(q?Y:1-Y)}function $(ee,k,U,q){k<0&&(k=4294967295+k+1);for(var Y=0,J=Math.min(ee.length-U,4);Y<J;++Y)ee[U+Y]=k>>>8*(q?Y:3-Y)&255}function ne(ee,k,U,q,Y,J){if(U+q>ee.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("Index out of range")}function he(ee,k,U,q,Y){return Y||ne(ee,k,U,4,34028234663852886e22,-34028234663852886e22),le.write(ee,k,U,q,23,4),U+4}function pe(ee,k,U,q,Y){return Y||ne(ee,k,U,8,17976931348623157e292,-17976931348623157e292),le.write(ee,k,U,q,52,8),U+8}function Te(ee){if(ee=we(ee).replace(qe,""),ee.length<2)return"";for(;ee.length%4!=0;)ee+="=";return ee}function we(ee){return ee.trim?ee.trim():ee.replace(/^\s+|\s+$/g,"")}function Me(ee){return ee<16?"0"+ee.toString(16):ee.toString(16)}function Ee(ee,k){k=k||1/0;for(var U,q=ee.length,Y=null,J=[],be=0;be<q;++be){if((U=ee.charCodeAt(be))>55295&&U<57344){if(!Y){if(U>56319){(k-=3)>-1&&J.push(239,191,189);continue}if(be+1===q){(k-=3)>-1&&J.push(239,191,189);continue}Y=U;continue}if(U<56320){(k-=3)>-1&&J.push(239,191,189),Y=U;continue}U=65536+(Y-55296<<10|U-56320)}else Y&&(k-=3)>-1&&J.push(239,191,189);if(Y=null,U<128){if((k-=1)<0)break;J.push(U)}else if(U<2048){if((k-=2)<0)break;J.push(U>>6|192,63&U|128)}else if(U<65536){if((k-=3)<0)break;J.push(U>>12|224,U>>6&63|128,63&U|128)}else{if(!(U<1114112))throw new Error("Invalid code point");if((k-=4)<0)break;J.push(U>>18|240,U>>12&63|128,U>>6&63|128,63&U|128)}}return J}function xe(ee){for(var k=[],U=0;U<ee.length;++U)k.push(255&ee.charCodeAt(U));return k}function Ge(ee,k){for(var U,q,Y,J=[],be=0;be<ee.length&&!((k-=2)<0);++be)U=ee.charCodeAt(be),q=U>>8,Y=U%256,J.push(Y),J.push(q);return J}function je(ee){return de.toByteArray(Te(ee))}function We(ee,k,U,q){for(var Y=0;Y<q&&!(Y+U>=k.length||Y>=ee.length);++Y)k[Y+U]=ee[Y];return Y}function ze(ee){return ee!==ee}/*!
|
|
|
* The buffer module from node.js, for the browser.
|
|
|
*
|
|
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
|
* @license MIT
|
|
|
*/var de=D(21),le=D(22),Oe=D(23);S.Buffer=f,S.SlowBuffer=n,S.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=x.TYPED_ARRAY_SUPPORT!==void 0?x.TYPED_ARRAY_SUPPORT:function(){try{var ee=new Uint8Array(1);return ee.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},ee.foo()===42&&typeof ee.subarray=="function"&&ee.subarray(1,1).byteLength===0}catch(k){return!1}}(),S.kMaxLength=T(),f.poolSize=8192,f._augment=function(ee){return ee.__proto__=f.prototype,ee},f.from=function(ee,k,U){return p(null,ee,k,U)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(ee,k,U){return o(null,ee,k,U)},f.allocUnsafe=function(ee){return i(null,ee)},f.allocUnsafeSlow=function(ee){return i(null,ee)},f.isBuffer=function(ee){return!(ee==null||!ee._isBuffer)},f.compare=function(ee,k){if(!f.isBuffer(ee)||!f.isBuffer(k))throw new TypeError("Arguments must be Buffers");if(ee===k)return 0;for(var U=ee.length,q=k.length,Y=0,J=Math.min(U,q);Y<J;++Y)if(ee[Y]!==k[Y]){U=ee[Y],q=k[Y];break}return U<q?-1:q<U?1:0},f.isEncoding=function(ee){switch(String(ee).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}},f.concat=function(ee,k){if(!Oe(ee))throw new TypeError('"list" argument must be an Array of Buffers');if(ee.length===0)return f.alloc(0);var U;if(k===void 0)for(k=0,U=0;U<ee.length;++U)k+=ee[U].length;var q=f.allocUnsafe(k),Y=0;for(U=0;U<ee.length;++U){var J=ee[U];if(!f.isBuffer(J))throw new TypeError('"list" argument must be an Array of Buffers');J.copy(q,Y),Y+=J.length}return q},f.byteLength=c,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var ee=this.length;if(ee%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var k=0;k<ee;k+=2)v(this,k,k+1);return this},f.prototype.swap32=function(){var ee=this.length;if(ee%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var k=0;k<ee;k+=4)v(this,k,k+3),v(this,k+1,k+2);return this},f.prototype.swap64=function(){var ee=this.length;if(ee%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var k=0;k<ee;k+=8)v(this,k,k+7),v(this,k+1,k+6),v(this,k+2,k+5),v(this,k+3,k+4);return this},f.prototype.toString=function(){var ee=0|this.length;return ee===0?"":arguments.length===0?P(this,0,ee):m.apply(this,arguments)},f.prototype.equals=function(ee){if(!f.isBuffer(ee))throw new TypeError("Argument must be a Buffer");return this===ee||f.compare(this,ee)===0},f.prototype.inspect=function(){var ee="",k=S.INSPECT_MAX_BYTES;return this.length>0&&(ee=this.toString("hex",0,k).match(/.{2}/g).join(" "),this.length>k&&(ee+=" ... ")),"<Buffer "+ee+">"},f.prototype.compare=function(ee,k,U,q,Y){if(!f.isBuffer(ee))throw new TypeError("Argument must be a Buffer");if(k===void 0&&(k=0),U===void 0&&(U=ee?ee.length:0),q===void 0&&(q=0),Y===void 0&&(Y=this.length),k<0||U>ee.length||q<0||Y>this.length)throw new RangeError("out of range index");if(q>=Y&&k>=U)return 0;if(q>=Y)return-1;if(k>=U)return 1;if(k>>>=0,U>>>=0,q>>>=0,Y>>>=0,this===ee)return 0;for(var J=Y-q,be=U-k,ke=Math.min(J,be),ct=this.slice(q,Y),He=ee.slice(k,U),Be=0;Be<ke;++Be)if(ct[Be]!==He[Be]){J=ct[Be],be=He[Be];break}return J<be?-1:be<J?1:0},f.prototype.includes=function(ee,k,U){return this.indexOf(ee,k,U)!==-1},f.prototype.indexOf=function(ee,k,U){return b(this,ee,k,U,!0)},f.prototype.lastIndexOf=function(ee,k,U){return b(this,ee,k,U,!1)},f.prototype.write=function(ee,k,U,q){if(k===void 0)q="utf8",U=this.length,k=0;else if(U===void 0&&typeof k=="string")q=k,U=this.length,k=0;else{if(!isFinite(k))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");k|=0,isFinite(U)?(U|=0,q===void 0&&(q="utf8")):(q=U,U=void 0)}var Y=this.length-k;if((U===void 0||U>Y)&&(U=Y),ee.length>0&&(U<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");for(var J=!1;;)switch(q){case"hex":return g(this,ee,k,U);case"utf8":case"utf-8":return y(this,ee,k,U);case"ascii":return C(this,ee,k,U);case"latin1":case"binary":return d(this,ee,k,U);case"base64":return _(this,ee,k,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,ee,k,U);default:if(J)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),J=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Ie=4096;f.prototype.slice=function(ee,k){var U=this.length;ee=~~ee,k=k===void 0?U:~~k,ee<0?(ee+=U)<0&&(ee=0):ee>U&&(ee=U),k<0?(k+=U)<0&&(k=0):k>U&&(k=U),k<ee&&(k=ee);var q;if(f.TYPED_ARRAY_SUPPORT)q=this.subarray(ee,k),q.__proto__=f.prototype;else{var Y=k-ee;q=new f(Y,void 0);for(var J=0;J<Y;++J)q[J]=this[J+ee]}return q},f.prototype.readUIntLE=function(ee,k,U){ee|=0,k|=0,U||G(ee,k,this.length);for(var q=this[ee],Y=1,J=0;++J<k&&(Y*=256);)q+=this[ee+J]*Y;return q},f.prototype.readUIntBE=function(ee,k,U){ee|=0,k|=0,U||G(ee,k,this.length);for(var q=this[ee+--k],Y=1;k>0&&(Y*=256);)q+=this[ee+--k]*Y;return q},f.prototype.readUInt8=function(ee,k){return k||G(ee,1,this.length),this[ee]},f.prototype.readUInt16LE=function(ee,k){return k||G(ee,2,this.length),this[ee]|this[ee+1]<<8},f.prototype.readUInt16BE=function(ee,k){return k||G(ee,2,this.length),this[ee]<<8|this[ee+1]},f.prototype.readUInt32LE=function(ee,k){return k||G(ee,4,this.length),(this[ee]|this[ee+1]<<8|this[ee+2]<<16)+16777216*this[ee+3]},f.prototype.readUInt32BE=function(ee,k){return k||G(ee,4,this.length),16777216*this[ee]+(this[ee+1]<<16|this[ee+2]<<8|this[ee+3])},f.prototype.readIntLE=function(ee,k,U){ee|=0,k|=0,U||G(ee,k,this.length);for(var q=this[ee],Y=1,J=0;++J<k&&(Y*=256);)q+=this[ee+J]*Y;return Y*=128,q>=Y&&(q-=Math.pow(2,8*k)),q},f.prototype.readIntBE=function(ee,k,U){ee|=0,k|=0,U||G(ee,k,this.length);for(var q=k,Y=1,J=this[ee+--q];q>0&&(Y*=256);)J+=this[ee+--q]*Y;return Y*=128,J>=Y&&(J-=Math.pow(2,8*k)),J},f.prototype.readInt8=function(ee,k){return k||G(ee,1,this.length),128&this[ee]?-1*(255-this[ee]+1):this[ee]},f.prototype.readInt16LE=function(ee,k){k||G(ee,2,this.length);var U=this[ee]|this[ee+1]<<8;return 32768&U?4294901760|U:U},f.prototype.readInt16BE=function(ee,k){k||G(ee,2,this.length);var U=this[ee+1]|this[ee]<<8;return 32768&U?4294901760|U:U},f.prototype.readInt32LE=function(ee,k){return k||G(ee,4,this.length),this[ee]|this[ee+1]<<8|this[ee+2]<<16|this[ee+3]<<24},f.prototype.readInt32BE=function(ee,k){return k||G(ee,4,this.length),this[ee]<<24|this[ee+1]<<16|this[ee+2]<<8|this[ee+3]},f.prototype.readFloatLE=function(ee,k){return k||G(ee,4,this.length),le.read(this,ee,!0,23,4)},f.prototype.readFloatBE=function(ee,k){return k||G(ee,4,this.length),le.read(this,ee,!1,23,4)},f.prototype.readDoubleLE=function(ee,k){return k||G(ee,8,this.length),le.read(this,ee,!0,52,8)},f.prototype.readDoubleBE=function(ee,k){return k||G(ee,8,this.length),le.read(this,ee,!1,52,8)},f.prototype.writeUIntLE=function(ee,k,U,q){(ee=+ee,k|=0,U|=0,!q)&&V(this,ee,k,U,Math.pow(2,8*U)-1,0);var Y=1,J=0;for(this[k]=255ⅇ++J<U&&(Y*=256);)this[k+J]=ee/Y&255;return k+U},f.prototype.writeUIntBE=function(ee,k,U,q){(ee=+ee,k|=0,U|=0,!q)&&V(this,ee,k,U,Math.pow(2,8*U)-1,0);var Y=U-1,J=1;for(this[k+Y]=255ⅇ--Y>=0&&(J*=256);)this[k+Y]=ee/J&255;return k+U},f.prototype.writeUInt8=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,1,255,0),f.TYPED_ARRAY_SUPPORT||(ee=Math.floor(ee)),this[k]=255&ee,k+1},f.prototype.writeUInt16LE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[k]=255&ee,this[k+1]=ee>>>8):re(this,ee,k,!0),k+2},f.prototype.writeUInt16BE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[k]=ee>>>8,this[k+1]=255&ee):re(this,ee,k,!1),k+2},f.prototype.writeUInt32LE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[k+3]=ee>>>24,this[k+2]=ee>>>16,this[k+1]=ee>>>8,this[k]=255&ee):$(this,ee,k,!0),k+4},f.prototype.writeUInt32BE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[k]=ee>>>24,this[k+1]=ee>>>16,this[k+2]=ee>>>8,this[k+3]=255&ee):$(this,ee,k,!1),k+4},f.prototype.writeIntLE=function(ee,k,U,q){if(ee=+ee,k|=0,!q){var Y=Math.pow(2,8*U-1);V(this,ee,k,U,Y-1,-Y)}var J=0,be=1,ke=0;for(this[k]=255ⅇ++J<U&&(be*=256);)ee<0&&ke===0&&this[k+J-1]!==0&&(ke=1),this[k+J]=(ee/be>>0)-ke&255;return k+U},f.prototype.writeIntBE=function(ee,k,U,q){if(ee=+ee,k|=0,!q){var Y=Math.pow(2,8*U-1);V(this,ee,k,U,Y-1,-Y)}var J=U-1,be=1,ke=0;for(this[k+J]=255ⅇ--J>=0&&(be*=256);)ee<0&&ke===0&&this[k+J+1]!==0&&(ke=1),this[k+J]=(ee/be>>0)-ke&255;return k+U},f.prototype.writeInt8=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,1,127,-128),f.TYPED_ARRAY_SUPPORT||(ee=Math.floor(ee)),ee<0&&(ee=255+ee+1),this[k]=255&ee,k+1},f.prototype.writeInt16LE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[k]=255&ee,this[k+1]=ee>>>8):re(this,ee,k,!0),k+2},f.prototype.writeInt16BE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[k]=ee>>>8,this[k+1]=255&ee):re(this,ee,k,!1),k+2},f.prototype.writeInt32LE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[k]=255&ee,this[k+1]=ee>>>8,this[k+2]=ee>>>16,this[k+3]=ee>>>24):$(this,ee,k,!0),k+4},f.prototype.writeInt32BE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,4,2147483647,-2147483648),ee<0&&(ee=4294967295+ee+1),f.TYPED_ARRAY_SUPPORT?(this[k]=ee>>>24,this[k+1]=ee>>>16,this[k+2]=ee>>>8,this[k+3]=255&ee):$(this,ee,k,!1),k+4},f.prototype.writeFloatLE=function(ee,k,U){return he(this,ee,k,!0,U)},f.prototype.writeFloatBE=function(ee,k,U){return he(this,ee,k,!1,U)},f.prototype.writeDoubleLE=function(ee,k,U){return pe(this,ee,k,!0,U)},f.prototype.writeDoubleBE=function(ee,k,U){return pe(this,ee,k,!1,U)},f.prototype.copy=function(ee,k,U,q){if(U||(U=0),q||q===0||(q=this.length),k>=ee.length&&(k=ee.length),k||(k=0),q>0&&q<U&&(q=U),q===U)return 0;if(ee.length===0||this.length===0)return 0;if(k<0)throw new RangeError("targetStart out of bounds");if(U<0||U>=this.length)throw new RangeError("sourceStart out of bounds");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),ee.length-k<q-U&&(q=ee.length-k+U);var Y,J=q-U;if(this===ee&&U<k&&k<q)for(Y=J-1;Y>=0;--Y)ee[Y+k]=this[Y+U];else if(J<1e3||!f.TYPED_ARRAY_SUPPORT)for(Y=0;Y<J;++Y)ee[Y+k]=this[Y+U];else Uint8Array.prototype.set.call(ee,this.subarray(U,U+J),k);return J},f.prototype.fill=function(ee,k,U,q){if(typeof ee=="string"){if(typeof k=="string"?(q=k,k=0,U=this.length):typeof U=="string"&&(q=U,U=this.length),ee.length===1){var Y=ee.charCodeAt(0);Y<256&&(ee=Y)}if(q!==void 0&&typeof q!="string")throw new TypeError("encoding must be a string");if(typeof q=="string"&&!f.isEncoding(q))throw new TypeError("Unknown encoding: "+q)}else typeof ee=="number"&&(ee&=255);if(k<0||this.length<k||this.length<U)throw new RangeError("Out of range index");if(U<=k)return this;k>>>=0,U=U===void 0?this.length:U>>>0,ee||(ee=0);var J;if(typeof ee=="number")for(J=k;J<U;++J)this[J]=ee;else{var be=f.isBuffer(ee)?ee:Ee(new f(ee,q).toString()),ke=be.length;for(J=0;J<U-k;++J)this[J+k]=be[J%ke]}return this};var qe=/[^+\/0-9A-Za-z-_]/g}).call(S,D(20))},function(j,S){var D;D=function(){return this}();try{D=D||Function("return this")()||(0,eval)("this")}catch(x){typeof window=="object"&&(D=window)}j.exports=D},function(j,S,D){"use strict";function x(t){var n=t.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return t[n-2]==="="?2:t[n-1]==="="?1:0}function T(t){return 3*t.length/4-x(t)}function w(t){var n,c,m,v,b,E=t.length;v=x(t),b=new l(3*E/4-v),c=v>0?E-4:E;var g=0;for(n=0;n<c;n+=4)m=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],b[g++]=m>>16&255,b[g++]=m>>8&255,b[g++]=255&m;return v===2?(m=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,b[g++]=255&m):v===1&&(m=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,b[g++]=m>>8&255,b[g++]=255&m),b}function f(t){return o[t>>18&63]+o[t>>12&63]+o[t>>6&63]+o[63&t]}function p(t,n,c){for(var m,v=[],b=n;b<c;b+=3)m=(t[b]<<16)+(t[b+1]<<8)+t[b+2],v.push(f(m));return v.join("")}function u(t){for(var n,c=t.length,m=c%3,v="",b=[],E=0,g=c-m;E<g;E+=16383)b.push(p(t,E,E+16383>g?g:E+16383));return m===1?(n=t[c-1],v+=o[n>>2],v+=o[n<<4&63],v+="=="):m===2&&(n=(t[c-2]<<8)+t[c-1],v+=o[n>>10],v+=o[n>>4&63],v+=o[n<<2&63],v+="="),b.push(v),b.join("")}S.byteLength=T,S.toByteArray=w,S.fromByteArray=u;for(var o=[],i=[],l=typeof Uint8Array!="undefined"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,r=s.length;h<r;++h)o[h]=s[h],i[s.charCodeAt(h)]=h;i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(j,S){S.read=function(D,x,T,w,f){var p,u,o=8*f-w-1,i=(1<<o)-1,l=i>>1,s=-7,h=T?f-1:0,r=T?-1:1,t=D[x+h];for(h+=r,p=t&(1<<-s)-1,t>>=-s,s+=o;s>0;p=256*p+D[x+h],h+=r,s-=8);for(u=p&(1<<-s)-1,p>>=-s,s+=w;s>0;u=256*u+D[x+h],h+=r,s-=8);if(p===0)p=1-l;else{if(p===i)return u?NaN:1/0*(t?-1:1);u+=Math.pow(2,w),p-=l}return(t?-1:1)*u*Math.pow(2,p-w)},S.write=function(D,x,T,w,f,p){var u,o,i,l=8*p-f-1,s=(1<<l)-1,h=s>>1,r=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,t=w?0:p-1,n=w?1:-1,c=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(o=isNaN(x)?1:0,u=s):(u=Math.floor(Math.log(x)/Math.LN2),x*(i=Math.pow(2,-u))<1&&(u--,i*=2),x+=u+h>=1?r/i:r*Math.pow(2,1-h),x*i>=2&&(u++,i/=2),u+h>=s?(o=0,u=s):u+h>=1?(o=(x*i-1)*Math.pow(2,f),u+=h):(o=x*Math.pow(2,h-1)*Math.pow(2,f),u=0));f>=8;D[T+t]=255&o,t+=n,o/=256,f-=8);for(u=u<<f|o,l+=f;l>0;D[T+t]=255&u,t+=n,u/=256,l-=8);D[T+t-n]|=128*c}},function(j,S){var D={}.toString;j.exports=Array.isArray||function(x){return D.call(x)=="[object Array]"}},function(j,S,D){"use strict";function x(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function f(p,u){for(var o=0;o<u.length;o++){var i=u[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(p,i.key,i)}}return function(p,u,o){return u&&f(p.prototype,u),o&&f(p,o),p}}(),w=function(){function f(){x(this,f)}return T(f,null,[{key:"set",value:function(p,u){try{window.localStorage&&localStorage.setItem(p,u)}catch(o){window[p+"_localStorage"]=u}}},{key:"get",value:function(p){try{if(window.localStorage)return localStorage.getItem(p)}catch(u){return window[p+"_localStorage"]}return""}},{key:"remove",value:function(p){try{window.localStorage&&localStorage.removeItem(p)}catch(u){delete window[p+"_localStorage"]}}}]),f}();S.default=w},function(j,S,D){"use strict";function x(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function f(p,u){for(var o=0;o<u.length;o++){var i=u[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(p,i.key,i)}}return function(p,u,o){return u&&f(p.prototype,u),o&&f(p,o),p}}(),w=function(){function f(){x(this,f)}return T(f,null,[{key:"get",value:function(p){for(var u=p+"",o=document.cookie.split(";"),i=0;i<o.length;i++){var l=o[i].trim();if(l.indexOf(u)==0)return unescape(l.substring(u.length+1,l.length))}return""}},{key:"set",value:function(p,u,o){var i=new Date;i.setTime(i.getTime()+24*o*60*60*1e3);var l="expires="+i.toGMTString();document.cookie=p+"="+escape(u)+"; "+l}}]),f}();S.default=w},function(j,S,D){"use strict";function x(l){return l&&l.__esModule?l:{default:l}}function T(l,s){if(!(l instanceof s))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var w=function(){function l(s,h){for(var r=0;r<h.length;r++){var t=h[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(s,t.key,t)}}return function(s,h,r){return h&&l(s.prototype,h),r&&l(s,r),s}}(),f=D(8),p=x(f),u=D(9),o=x(u),i=function(){function l(){T(this,l)}return w(l,null,[{key:"refreshUploadAuth",value:function(s,h,r){var t=(o.default.randomUUID(),o.default.randomUUID()),n={AccessKeyId:s.accessKeyId,SecurityToken:s.securityToken,Action:"RefreshUploadVideo",VideoId:s.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:t,RequestId:s.requestId},c=o.default.makeUTF8sort(n,"=","&")+"&Signature="+o.default.aliyunEncodeURI(o.default.makeChangeSiga(n,s.accessKeySecret)),m="https://vod."+s.region+".aliyuncs.com/?"+c;p.default.get(m,function(v){var v=JSON.parse(v);h&&h(v)},function(v){if(r){var b=JSON.parse(v);r(b)}})}},{key:"getUploadAuth",value:function(s,h,r){var t=(o.default.randomUUID(),o.default.randomUUID()),n={AccessKeyId:s.accessKeyId,SecurityToken:s.securityToken,Action:"CreateUploadVideo",Title:s.title,FileName:s.fileName,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:t,RequestId:s.requestId};s.fileSize&&(n.FileSize=s.fileSize),s.description&&(n.Description=s.description),s.cateId&&(n.CateId=s.cateId),s.tags&&(n.Tags=s.tags),s.templateGroupId&&(n.TemplateGroupId=s.templateGroupId),s.storageLocation&&(n.StorageLocation=s.storageLocation),s.coverUrl&&(n.CoverURL=s.coverUrl),s.transCodeMode&&(n.TransCodeMode=s.transCodeMode),s.userData&&(n.UserData=JSON.stringify(s.userData));var c=o.default.makeUTF8sort(n,"=","&")+"&Signature="+o.default.aliyunEncodeURI(o.default.makeChangeSiga(n,s.accessKeySecret)),m="https://vod."+s.region+".aliyuncs.com/?"+c;p.default.get(m,function(v){try{v=JSON.parse(v)}catch(b){if(r)return void r({Code:"GetUploadAuthFailed",Message:"\u83B7\u53D6uploadauth\u5931\u8D25"})}h&&h(v)},function(v){if(r){var b={Code:"GetUploadAuthFailed",Message:"\u83B7\u53D6uploadauth\u5931\u8D25"};try{b=JSON.parse(v)}catch(E){}r(b)}})}},{key:"getImageUploadAuth",value:function(s,h,r){var t=(o.default.randomUUID(),o.default.randomUUID()),n={AccessKeyId:s.accessKeyId,SecurityToken:s.securityToken,Action:"CreateUploadImage",ImageType:s.imageType?s.imageType:"default",Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:t,RequestId:s.requestId};s.title&&(n.Title=s.title),s.imageExt&&(n.ImageExt=s.imageExt),s.tags&&(n.Tags=s.tags),s.storageLocation&&(n.StorageLocation=s.storageLocation);var c=o.default.makeUTF8sort(n,"=","&")+"&Signature="+o.default.aliyunEncodeURI(o.default.makeChangeSiga(n,s.accessKeySecret)),m="https://vod."+s.region+".aliyuncs.com/?"+c;p.default.get(m,function(v){v=JSON.parse(v),h&&h(v)},function(v){if(r){var b=JSON.parse(v);r(b)}})}}]),l}();S.default=i},function(j,S,D){!function(x,T,w){j.exports=S=T(D(0),D(28),D(29))}(0,function(x){return x.HmacSHA1})},function(j,S,D){!function(x,T){j.exports=S=T(D(0))}(0,function(x){return function(){var T=x,w=T.lib,f=w.WordArray,p=w.Hasher,u=T.algo,o=[],i=u.SHA1=p.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(l,s){for(var h=this._hash.words,r=h[0],t=h[1],n=h[2],c=h[3],m=h[4],v=0;v<80;v++){if(v<16)o[v]=0|l[s+v];else{var b=o[v-3]^o[v-8]^o[v-14]^o[v-16];o[v]=b<<1|b>>>31}var E=(r<<5|r>>>27)+m+o[v];E+=v<20?1518500249+(t&n|~t&c):v<40?1859775393+(t^n^c):v<60?(t&n|t&c|n&c)-1894007588:(t^n^c)-899497514,m=c,c=n,n=t<<30|t>>>2,t=r,r=E}h[0]=h[0]+r|0,h[1]=h[1]+t|0,h[2]=h[2]+n|0,h[3]=h[3]+c|0,h[4]=h[4]+m|0},_doFinalize:function(){var l=this._data,s=l.words,h=8*this._nDataBytes,r=8*l.sigBytes;return s[r>>>5]|=128<<24-r%32,s[14+(r+64>>>9<<4)]=Math.floor(h/4294967296),s[15+(r+64>>>9<<4)]=h,l.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var l=p.clone.call(this);return l._hash=this._hash.clone(),l}});T.SHA1=p._createHelper(i),T.HmacSHA1=p._createHmacHelper(i)}(),x.SHA1})},function(j,S,D){!function(x,T){j.exports=S=T(D(0))}(0,function(x){!function(){var T=x,w=T.lib,f=w.Base,p=T.enc,u=p.Utf8,o=T.algo;o.HMAC=f.extend({init:function(i,l){i=this._hasher=new i.init,typeof l=="string"&&(l=u.parse(l));var s=i.blockSize,h=4*s;l.sigBytes>h&&(l=i.finalize(l)),l.clamp();for(var r=this._oKey=l.clone(),t=this._iKey=l.clone(),n=r.words,c=t.words,m=0;m<s;m++)n[m]^=1549556828,c[m]^=909522486;r.sigBytes=t.sigBytes=h,this.reset()},reset:function(){var i=this._hasher;i.reset(),i.update(this._iKey)},update:function(i){return this._hasher.update(i),this},finalize:function(i){var l=this._hasher,s=l.finalize(i);return l.reset(),l.finalize(this._oKey.clone().concat(s))}})}()})},function(j,S,D){!function(x,T){j.exports=S=T(D(0))}(0,function(x){return function(){function T(o,i,l){for(var s=[],h=0,r=0;r<i;r++)if(r%4){var t=l[o.charCodeAt(r-1)]<<r%4*2,n=l[o.charCodeAt(r)]>>>6-r%4*2;s[h>>>2]|=(t|n)<<24-h%4*8,h++}return p.create(s,h)}var w=x,f=w.lib,p=f.WordArray,u=w.enc;u.Base64={stringify:function(o){var i=o.words,l=o.sigBytes,s=this._map;o.clamp();for(var h=[],r=0;r<l;r+=3)for(var t=i[r>>>2]>>>24-r%4*8&255,n=i[r+1>>>2]>>>24-(r+1)%4*8&255,c=i[r+2>>>2]>>>24-(r+2)%4*8&255,m=t<<16|n<<8|c,v=0;v<4&&r+.75*v<l;v++)h.push(s.charAt(m>>>6*(3-v)&63));var b=s.charAt(64);if(b)for(;h.length%4;)h.push(b);return h.join("")},parse:function(o){var i=o.length,l=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var h=0;h<l.length;h++)s[l.charCodeAt(h)]=h}var r=l.charAt(64);if(r){var t=o.indexOf(r);t!==-1&&(i=t)}return T(o,i,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),x.enc.Base64})},function(j,S,D){"use strict";function x(g){return g&&g.__esModule?g:{default:g}}function T(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var w=function(){function g(y,C){for(var d=0;d<C.length;d++){var _=C[d];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,C,d){return C&&g(y.prototype,C),d&&g(y,d),y}}(),f=D(8),p=x(f),u=D(7),o=x(u),i=D(4),l=x(i),s=D(6),h=x(s),r=D(1),t=x(r),n=D(9),c=x(n),m=D(2),v=D(11),b=D(10),E=function(){function g(){T(this,g)}return w(g,null,[{key:"getAuthInfo",value:function(y,C,d){var _=y+"|f#Ylm&^1TppeRhLg|"+d;return C&&(_=y+"|"+C+"|f#Ylm&^1TppeRhLg|"+d),m(b.parse(_)).toString(v)}},{key:"upload",value:function(y,C,d){var _=t.default.ISODateString(new Date),O=Math.floor(new Date().valueOf()/1e3),A=l.default.getClientId();A=l.default.setClientId(A);var P=g.getAuthInfo(y.userId,A,O),I=c.default.randomUUID(),W={Source:"WebSDK",BusinessType:"UploadVideo",Action:"ReportUploadProgress",TerminalType:"H5",DeviceModel:o.default.browser.name+(o.default.browser.version||""),AppVersion:h.default.version,AuthTimestamp:O,Timestamp:_,AuthInfo:P,FileName:y.file.name,FileSize:y.file.size,FileCreateTime:y.file.lastModified,FileHash:y.fileHash,UploadId:y.checkpoint.checkpoint.uploadId,PartSize:y.checkpoint.checkpoint.partSize,DonePartsCount:y.checkpoint.checkpoint.doneParts.length,UploadPoint:JSON.stringify(y.checkpoint),UploadRatio:y.checkpoint.loaded,UserId:y.userId,VideoId:y.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:I};A&&(W.ClientId=A);var K=c.default.makeUTF8sort(W,"=","&")+"&Signature="+c.default.aliyunEncodeURI(c.default.makeChangeSiga(W,y.accessKeySecret)),te="https://vod."+y.region+".aliyuncs.com/?"+K;p.default.get(te,function(H){C&&C()},function(H){H&&(d(H),console.log(H))})}},{key:"get",value:function(y,C,d){var _=t.default.ISODateString(new Date),O=Math.floor(new Date().valueOf()/1e3),A=l.default.getClientId(),P=g.getAuthInfo(y.userId,A,O),I=c.default.randomUUID(),W={Source:"WebSDK",BusinessType:"UploadVideo",Action:"GetUploadProgress",TerminalType:"H5",DeviceModel:o.default.browser.name+(o.default.browser.version||""),AppVersion:h.default.version,AuthTimestamp:O,Timestamp:_,AuthInfo:P,UserId:y.userId,UploadInfoList:JSON.stringify(y.uploadInfoList),Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:I};A&&(W.ClientId=A);var K=c.default.makeUTF8sort(W,"=","&")+"&Signature="+c.default.aliyunEncodeURI(c.default.makeChangeSiga(W,y.accessKeySecret)),te="https://vod."+y.region+".aliyuncs.com/?"+K;p.default.get(te,function(H){var G={},V=A;H=H?JSON.parse(H):{},H.UploadProgress&&H.UploadProgress.UploadProgressList&&H.UploadProgress.UploadProgressList.length>0&&(G=H.UploadProgress.UploadProgressList[0],V=G.ClientId),l.default.setClientId(V),C&&C(G)},function(H){H&&(d(H),console.log(H))})}}]),g}();S.default=E},function(j,S,D){"use strict";function x(u,o){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function u(o,i){for(var l=0;l<i.length;l++){var s=i[l];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}return function(o,i,l){return i&&u(o.prototype,i),l&&u(o,l),o}}(),w=D(2),f=D(33),p=(D(11),function(){function u(){x(this,u)}return T(u,null,[{key:"getMd5",value:function(o,i,l){var s=new FileReader;s.onload=function(t){try{if(t&&t.target){var n=w(f.parse(t.target.result)),c=n.toString();i(c)}}catch(m){console.log(m)}},s.onerror=function(t){console.log(t),errorCallback(t)};var h=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,r=h.call(o,0,1024);s.readAsBinaryString(r)}}]),u}());S.default=p},function(j,S,D){!function(x,T){j.exports=S=T(D(0))}(0,function(x){return x.enc.Latin1})}])}).call(this,F("IyRk"))},ps8w:function(nt,Le,F){nt.exports=F.p+"static/show.6268a056.svg"},"rAM+":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return Q});var ue=F("Qw5x");function Q(j,S){var D;if(typeof Symbol=="undefined"||j[Symbol.iterator]==null){if(Array.isArray(j)||(D=Object(ue.a)(j))||S&&j&&typeof j.length=="number"){D&&(j=D);var x=0,T=function(){};return{s:T,n:function(){return x>=j.length?{done:!0}:{done:!1,value:j[x++]}},e:function(o){throw o},f:T}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var w=!0,f=!1,p;return{s:function(){D=j[Symbol.iterator]()},n:function(){var o=D.next();return w=o.done,o},e:function(o){f=!0,p=o},f:function(){try{!w&&D.return!=null&&D.return()}finally{if(f)throw p}}}}},rHrb:function(nt,Le,F){"use strict";Object.defineProperty(Le,"__esModule",{value:!0}),Le.CopyToClipboard=void 0;var ue=j(F("q1tI")),Q=j(F("+QRC"));function j(n){return n&&n.__esModule?n:{default:n}}function S(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?S=function(m){return typeof m}:S=function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},S(n)}function D(n,c){var m=Object.keys(n);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(n);c&&(v=v.filter(function(b){return Object.getOwnPropertyDescriptor(n,b).enumerable})),m.push.apply(m,v)}return m}function x(n){for(var c=1;c<arguments.length;c++){var m=arguments[c]!=null?arguments[c]:{};c%2?D(m,!0).forEach(function(v){r(n,v,m[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(m)):D(m).forEach(function(v){Object.defineProperty(n,v,Object.getOwnPropertyDescriptor(m,v))})}return n}function T(n,c){if(n==null)return{};var m=w(n,c),v,b;if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(n);for(b=0;b<E.length;b++){if(v=E[b],c.indexOf(v)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(n,v))continue;m[v]=n[v]}}return m}function w(n,c){if(n==null)return{};var m={},v=Object.keys(n),b,E;for(E=0;E<v.length;E++){if(b=v[E],c.indexOf(b)>=0)continue;m[b]=n[b]}return m}function f(n,c){if(!(n instanceof c))throw new TypeError("Cannot call a class as a function")}function p(n,c){for(var m=0;m<c.length;m++){var v=c[m];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(n,v.key,v)}}function u(n,c,m){return c&&p(n.prototype,c),m&&p(n,m),n}function o(n,c){return c&&(S(c)==="object"||typeof c=="function")?c:l(n)}function i(n){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},i(n)}function l(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function s(n,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(c&&c.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),c&&h(n,c)}function h(n,c){return h=Object.setPrototypeOf||function(v,b){return v.__proto__=b,v},h(n,c)}function r(n,c,m){return c in n?Object.defineProperty(n,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):n[c]=m,n}var t=function(n){s(c,n);function c(){var m,v;f(this,c);for(var b=arguments.length,E=new Array(b),g=0;g<b;g++)E[g]=arguments[g];return v=o(this,(m=i(c)).call.apply(m,[this].concat(E))),r(l(v),"onClick",function(y){var C=v.props,d=C.text,_=C.onCopy,O=C.children,A=C.options,P=ue.default.Children.only(O),I=(0,Q.default)(d,A);_&&_(d,I),P&&P.props&&typeof P.props.onClick=="function"&&P.props.onClick(y)}),v}return u(c,[{key:"render",value:function(){var v=this.props,b=v.text,E=v.onCopy,g=v.options,y=v.children,C=T(v,["text","onCopy","options","children"]),d=ue.default.Children.only(y);return ue.default.cloneElement(d,x({},C,{onClick:this.onClick}))}}]),c}(ue.default.PureComponent);Le.CopyToClipboard=t,r(t,"defaultProps",{onCopy:void 0,options:void 0})},rUJ1:function(nt,Le){const F=/[&<>"']/,ue=/[&<>"']/g,Q=/[<>"']|&(?!#?\w+;)/,j=/[<>"']|&(?!#?\w+;)/g,S={"&":"&","<":"<",">":">",'"':""","'":"'"},D=g=>S[g];function x(g,y){if(y){if(F.test(g))return g.replace(ue,D)}else if(Q.test(g))return g.replace(j,D);return g}const T=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function w(g){return g.replace(T,(y,C)=>(C=C.toLowerCase(),C==="colon"?":":C.charAt(0)==="#"?C.charAt(1)==="x"?String.fromCharCode(parseInt(C.substring(2),16)):String.fromCharCode(+C.substring(1)):""))}const f=/(^|[^\[])\^/g;function p(g,y){g=g.source||g,y=y||"";const C={replace:(d,_)=>(_=_.source||_,_=_.replace(f,"$1"),g=g.replace(d,_),C),getRegex:()=>new RegExp(g,y)};return C}const u=/[^\w:]/g,o=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function i(g,y,C){if(g){let d;try{d=decodeURIComponent(w(C)).replace(u,"").toLowerCase()}catch(_){return null}if(d.indexOf("javascript:")===0||d.indexOf("vbscript:")===0||d.indexOf("data:")===0)return null}y&&!o.test(C)&&(C=t(y,C));try{C=encodeURI(C).replace(/%25/g,"%")}catch(d){return null}return C}const l={},s=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,r=/^([^:]+:\/*[^/]*)[\s\S]*$/;function t(g,y){l[" "+g]||(s.test(g)?l[" "+g]=g+"/":l[" "+g]=v(g,"/",!0)),g=l[" "+g];const C=g.indexOf(":")===-1;return y.substring(0,2)==="//"?C?y:g.replace(h,"$1")+y:y.charAt(0)==="/"?C?y:g.replace(r,"$1")+y:g+y}const n={exec:function(){}};function c(g){let y=1,C,d;for(;y<arguments.length;y++){C=arguments[y];for(d in C)Object.prototype.hasOwnProperty.call(C,d)&&(g[d]=C[d])}return g}function m(g,y){const C=g.replace(/\|/g,(O,A,P)=>{let I=!1,W=A;for(;--W>=0&&P[W]==="\\";)I=!I;return I?"|":" |"}),d=C.split(/ \|/);let _=0;if(d.length>y)d.splice(y);else for(;d.length<y;)d.push("");for(;_<d.length;_++)d[_]=d[_].trim().replace(/\\\|/g,"|");return d}function v(g,y,C){const d=g.length;if(d===0)return"";let _=0;for(;_<d;){const O=g.charAt(d-_-1);if(O===y&&!C)_++;else if(O!==y&&C)_++;else break}return g.substr(0,d-_)}function b(g,y){if(g.indexOf(y[1])===-1)return-1;const C=g.length;let d=0,_=0;for(;_<C;_++)if(g[_]==="\\")_++;else if(g[_]===y[0])d++;else if(g[_]===y[1]&&(d--,d<0))return _;return-1}function E(g){g&&g.sanitize&&!g.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")}nt.exports={escape:x,unescape:w,edit:p,cleanUrl:i,resolveUrl:t,noopTest:n,merge:c,splitCells:m,rtrim:v,findClosingBracket:b,checkSanitizeDeprecation:E}},rdUC:function(nt,Le,F){var ue=F("MFOe"),Q=ue.Global;nt.exports={name:"localStorage",read:S,write:D,each:x,remove:T,clearAll:w};function j(){return Q.localStorage}function S(f){return j().getItem(f)}function D(f,p){return j().setItem(f,p)}function x(f){for(var p=j().length-1;p>=0;p--){var u=j().key(p);f(S(u),u)}}function T(f){return j().removeItem(f)}function w(){return j().clear()}},"s8/Y":function(nt,Le,F){nt.exports=F.p+"static/jx.6713fc81.svg"},"sB/4":function(nt,Le,F){nt.exports=F.p+"static/b.7405990c.svg"},sNtx:function(nt,Le,F){},sR1s:function(nt,Le,F){"use strict";F.d(Le,"b",function(){return S}),F.d(Le,"a",function(){return D}),F.d(Le,"c",function(){return x}),F.d(Le,"d",function(){return T});var ue=F("U8pU"),Q="RC_TABLE_KEY";function j(w){return w==null?[]:Array.isArray(w)?w:[w]}function S(w,f){if(!f&&typeof f!="number")return w;for(var p=j(f),u=w,o=0;o<p.length;o+=1){if(!u)return null;var i=p[o];u=u[i]}return u}function D(w){var f=[],p={};return w.forEach(function(u){for(var o=u||{},i=o.key,l=o.dataIndex,s=i||j(l).join("-")||Q;p[s];)s="".concat(s,"_next");p[s]=!0,f.push(s)}),f}function x(){var w={};function f(i,l){l&&Object.keys(l).forEach(function(s){var h=l[s];h&&Object(ue.a)(h)==="object"?(i[s]=i[s]||{},f(i[s],h)):i[s]=h})}for(var p=arguments.length,u=new Array(p),o=0;o<p;o++)u[o]=arguments[o];return u.forEach(function(i){f(w,i)}),w}function T(w){return w!=null}},sboe:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return j});var ue=F("q1tI"),Q=F.n(ue),j=ue.createContext(null)},"t/PP":function(nt,Le,F){nt.exports=F.p+"static/title.dd3b799f.svg"},t23M:function(nt,Le,F){"use strict";var ue=F("VTBJ"),Q=F("1OyB"),j=F("vuIU"),S=F("Ji7U"),D=F("LK+K"),x=F("q1tI"),T=F.n(x),w=F("m+aA"),f=F("Zm9Q"),p=F("Kwbf"),u=F("c+Xe"),o=F("bdgK"),i="rc-observer-key",l=function(s){Object(S.a)(r,s);var h=Object(D.a)(r);function r(){var t;return Object(Q.a)(this,r),t=h.apply(this,arguments),t.resizeObserver=null,t.childNode=null,t.currentElement=null,t.state={width:0,height:0,offsetHeight:0,offsetWidth:0},t.onResize=function(n){var c=t.props.onResize,m=n[0].target,v=m.getBoundingClientRect(),b=v.width,E=v.height,g=m.offsetWidth,y=m.offsetHeight,C=Math.floor(b),d=Math.floor(E);if(t.state.width!==C||t.state.height!==d||t.state.offsetWidth!==g||t.state.offsetHeight!==y){var _={width:C,height:d,offsetWidth:g,offsetHeight:y};t.setState(_),c&&Promise.resolve().then(function(){c(Object(ue.a)(Object(ue.a)({},_),{},{offsetWidth:g,offsetHeight:y}))})}},t.setChildNode=function(n){t.childNode=n},t}return Object(j.a)(r,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var n=this.props.disabled;if(n){this.destroyObserver();return}var c=Object(w.a)(this.childNode||this),m=c!==this.currentElement;m&&(this.destroyObserver(),this.currentElement=c),!this.resizeObserver&&c&&(this.resizeObserver=new o.default(this.onResize),this.resizeObserver.observe(c))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var n=this.props.children,c=Object(f.a)(n);if(c.length>1)Object(p.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(c.length===0)return Object(p.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var m=c[0];if(x.isValidElement(m)&&Object(u.c)(m)){var v=m.ref;c[0]=x.cloneElement(m,{ref:Object(u.a)(v,this.setChildNode)})}return c.length===1?c[0]:c.map(function(b,E){return!x.isValidElement(b)||"key"in b&&b.key!==null?b:x.cloneElement(b,{key:"".concat(i,"-").concat(E)})})}}]),r}(x.Component);l.displayName="ResizeObserver",Le.a=l},twBr:function(nt,Le,F){nt.exports=F.p+"static/s.1f286590.svg"},uMZB:function(nt,Le,F){nt.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(nt,Le,F){nt.exports=ue;function ue(){return F("gaXo"),{}}},ulZh:function(nt,Le,F){typeof window!="undefined"&&function(Q,j){nt.exports=j()}(this,function(){return function(ue){var Q={};function j(S){if(Q[S])return Q[S].exports;var D=Q[S]={i:S,l:!1,exports:{}};return ue[S].call(D.exports,D,D.exports,j),D.l=!0,D.exports}return j.m=ue,j.c=Q,j.d=function(S,D,x){j.o(S,D)||Object.defineProperty(S,D,{enumerable:!0,get:x})},j.r=function(S){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(S,"__esModule",{value:!0})},j.t=function(S,D){if(D&1&&(S=j(S)),D&8)return S;if(D&4&&typeof S=="object"&&S&&S.__esModule)return S;var x=Object.create(null);if(j.r(x),Object.defineProperty(x,"default",{enumerable:!0,value:S}),D&2&&typeof S!="string")for(var T in S)j.d(x,T,function(w){return S[w]}.bind(null,T));return x},j.n=function(S){var D=S&&S.__esModule?function(){return S.default}:function(){return S};return j.d(D,"a",D),D},j.o=function(S,D){return Object.prototype.hasOwnProperty.call(S,D)},j.p="/dist/",j(j.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ue,Q,j){"use strict";var S=Object.prototype.hasOwnProperty,D="~";function x(){}Object.create&&(x.prototype=Object.create(null),new x().__proto__||(D=!1));function T(u,o,i){this.fn=u,this.context=o,this.once=i||!1}function w(u,o,i,l,s){if(typeof i!="function")throw new TypeError("The listener must be a function");var h=new T(i,l||u,s),r=D?D+o:o;return u._events[r]?u._events[r].fn?u._events[r]=[u._events[r],h]:u._events[r].push(h):(u._events[r]=h,u._eventsCount++),u}function f(u,o){--u._eventsCount===0?u._events=new x:delete u._events[o]}function p(){this._events=new x,this._eventsCount=0}p.prototype.eventNames=function(){var o=[],i,l;if(this._eventsCount===0)return o;for(l in i=this._events)S.call(i,l)&&o.push(D?l.slice(1):l);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(i)):o},p.prototype.listeners=function(o){var i=D?D+o:o,l=this._events[i];if(!l)return[];if(l.fn)return[l.fn];for(var s=0,h=l.length,r=new Array(h);s<h;s++)r[s]=l[s].fn;return r},p.prototype.listenerCount=function(o){var i=D?D+o:o,l=this._events[i];return l?l.fn?1:l.length:0},p.prototype.emit=function(o,i,l,s,h,r){var t=D?D+o:o;if(!this._events[t])return!1;var n=this._events[t],c=arguments.length,m,v;if(n.fn){n.once&&this.removeListener(o,n.fn,void 0,!0);switch(c){case 1:return n.fn.call(n.context),!0;case 2:return n.fn.call(n.context,i),!0;case 3:return n.fn.call(n.context,i,l),!0;case 4:return n.fn.call(n.context,i,l,s),!0;case 5:return n.fn.call(n.context,i,l,s,h),!0;case 6:return n.fn.call(n.context,i,l,s,h,r),!0}for(v=1,m=new Array(c-1);v<c;v++)m[v-1]=arguments[v];n.fn.apply(n.context,m)}else{var b=n.length,E;for(v=0;v<b;v++){n[v].once&&this.removeListener(o,n[v].fn,void 0,!0);switch(c){case 1:n[v].fn.call(n[v].context);break;case 2:n[v].fn.call(n[v].context,i);break;case 3:n[v].fn.call(n[v].context,i,l);break;case 4:n[v].fn.call(n[v].context,i,l,s);break;default:if(!m)for(E=1,m=new Array(c-1);E<c;E++)m[E-1]=arguments[E];n[v].fn.apply(n[v].context,m)}}}return!0},p.prototype.on=function(o,i,l){return w(this,o,i,l,!1)},p.prototype.once=function(o,i,l){return w(this,o,i,l,!0)},p.prototype.removeListener=function(o,i,l,s){var h=D?D+o:o;if(!this._events[h])return this;if(!i)return f(this,h),this;var r=this._events[h];if(r.fn)r.fn===i&&(!s||r.once)&&(!l||r.context===l)&&f(this,h);else{for(var t=0,n=[],c=r.length;t<c;t++)(r[t].fn!==i||s&&!r[t].once||l&&r[t].context!==l)&&n.push(r[t]);n.length?this._events[h]=n.length===1?n[0]:n:f(this,h)}return this},p.prototype.removeAllListeners=function(o){var i;return o?(i=D?D+o:o,this._events[i]&&f(this,i)):(this._events=new x,this._eventsCount=0),this},p.prototype.off=p.prototype.removeListener,p.prototype.addListener=p.prototype.on,p.prefixed=D,p.EventEmitter=p,ue.exports=p},"./node_modules/url-toolkit/src/url-toolkit.js":function(ue,Q,j){(function(S){var D=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,x=/^([^\/?#]*)([^]*)$/,T=/(?:\/|^)\.(?=\/)/g,w=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,f={buildAbsoluteURL:function(p,u,o){if(o=o||{},p=p.trim(),u=u.trim(),!u){if(!o.alwaysNormalize)return p;var i=f.parseURL(p);if(!i)throw new Error("Error trying to parse base URL.");return i.path=f.normalizePath(i.path),f.buildURLFromParts(i)}var l=f.parseURL(u);if(!l)throw new Error("Error trying to parse relative URL.");if(l.scheme)return o.alwaysNormalize?(l.path=f.normalizePath(l.path),f.buildURLFromParts(l)):u;var s=f.parseURL(p);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&s.path[0]!=="/"){var h=x.exec(s.path);s.netLoc=h[1],s.path=h[2]}s.netLoc&&!s.path&&(s.path="/");var r={scheme:s.scheme,netLoc:l.netLoc,path:null,params:l.params,query:l.query,fragment:l.fragment};if(!l.netLoc&&(r.netLoc=s.netLoc,l.path[0]!=="/"))if(!l.path)r.path=s.path,l.params||(r.params=s.params,l.query||(r.query=s.query));else{var t=s.path,n=t.substring(0,t.lastIndexOf("/")+1)+l.path;r.path=f.normalizePath(n)}return r.path===null&&(r.path=o.alwaysNormalize?f.normalizePath(l.path):l.path),f.buildURLFromParts(r)},parseURL:function(p){var u=D.exec(p);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(p){for(p=p.split("").reverse().join("").replace(T,"");p.length!==(p=p.replace(w,"")).length;);return p.split("").reverse().join("")},buildURLFromParts:function(p){return p.scheme+p.netLoc+p.path+p.params+p.query+p.fragment}};ue.exports=f})(this)},"./node_modules/webworkify-webpack/index.js":function(ue,Q,j){function S(o){var i={};function l(h){if(i[h])return i[h].exports;var r=i[h]={i:h,l:!1,exports:{}};return o[h].call(r.exports,r,r.exports,l),r.l=!0,r.exports}l.m=o,l.c=i,l.i=function(h){return h},l.d=function(h,r,t){l.o(h,r)||Object.defineProperty(h,r,{configurable:!1,enumerable:!0,get:t})},l.r=function(h){Object.defineProperty(h,"__esModule",{value:!0})},l.n=function(h){var r=h&&h.__esModule?function(){return h.default}:function(){return h};return l.d(r,"a",r),r},l.o=function(h,r){return Object.prototype.hasOwnProperty.call(h,r)},l.p="/",l.oe=function(h){throw console.error(h),h};var s=l(l.s=ENTRY_MODULE);return s.default||s}var D="[\\.|\\-|\\+|\\w|/|@]+",x="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+D+").*?\\)";function T(o){return(o+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function w(o){return!isNaN(1*o)}function f(o,i,l){var s={};s[l]=[];var h=i.toString(),r=h.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!r)return s;for(var t=r[1],n=new RegExp("(\\\\n|\\W)"+T(t)+x,"g"),c;c=n.exec(h);){if(c[3]==="dll-reference")continue;s[l].push(c[3])}for(n=new RegExp("\\("+T(t)+'\\("(dll-reference\\s('+D+'))"\\)\\)'+x,"g");c=n.exec(h);)o[c[2]]||(s[l].push(c[1]),o[c[2]]=j(c[1]).m),s[c[2]]=s[c[2]]||[],s[c[2]].push(c[4]);for(var m=Object.keys(s),v=0;v<m.length;v++)for(var b=0;b<s[m[v]].length;b++)w(s[m[v]][b])&&(s[m[v]][b]=1*s[m[v]][b]);return s}function p(o){var i=Object.keys(o);return i.reduce(function(l,s){return l||o[s].length>0},!1)}function u(o,i){for(var l={main:[i]},s={main:[]},h={main:{}};p(l);)for(var r=Object.keys(l),t=0;t<r.length;t++){var n=r[t],c=l[n],m=c.pop();if(h[n]=h[n]||{},h[n][m]||!o[n][m])continue;h[n][m]=!0,s[n]=s[n]||[],s[n].push(m);for(var v=f(o,o[n][m],n),b=Object.keys(v),E=0;E<b.length;E++)l[b[E]]=l[b[E]]||[],l[b[E]]=l[b[E]].concat(v[b[E]])}return s}ue.exports=function(o,i){i=i||{};var l={main:j.m},s=i.all?{main:Object.keys(l.main)}:u(l,o),h="";Object.keys(s).filter(function(m){return m!=="main"}).forEach(function(m){for(var v=0;s[m][v];)v++;s[m].push(v),l[m][v]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",h=h+"var "+m+" = ("+S.toString().replace("ENTRY_MODULE",JSON.stringify(v))+")({"+s[m].map(function(b){return""+JSON.stringify(b)+": "+l[m][b].toString()}).join(",")+`});
|
|
|
`}),h=h+"new (("+S.toString().replace("ENTRY_MODULE",JSON.stringify(o))+")({"+s.main.map(function(m){return""+JSON.stringify(m)+": "+l.main[m].toString()}).join(",")+"}))(self);";var r=new window.Blob([h],{type:"text/javascript"});if(i.bare)return r;var t=window.URL||window.webkitURL||window.mozURL||window.msURL,n=t.createObjectURL(r),c=new window.Worker(n);return c.objectURL=n,c}},"./src/config.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"hlsDefaultConfig",function(){return E}),j.d(Q,"mergeConfig",function(){return y}),j.d(Q,"enableStreamingMode",function(){return C});var S=j("./src/controller/abr-controller.ts"),D=j("./src/controller/audio-stream-controller.ts"),x=j("./src/controller/audio-track-controller.ts"),T=j("./src/controller/subtitle-stream-controller.ts"),w=j("./src/controller/subtitle-track-controller.ts"),f=j("./src/controller/buffer-controller.ts"),p=j("./src/controller/timeline-controller.ts"),u=j("./src/controller/cap-level-controller.ts"),o=j("./src/controller/fps-controller.ts"),i=j("./src/controller/eme-controller.ts"),l=j("./src/controller/cmcd-controller.ts"),s=j("./src/utils/xhr-loader.ts"),h=j("./src/utils/fetch-loader.ts"),r=j("./src/utils/cues.ts"),t=j("./src/utils/mediakeys-helper.ts"),n=j("./src/utils/logger.ts");function c(){return c=Object.assign||function(d){for(var _=1;_<arguments.length;_++){var O=arguments[_];for(var A in O)Object.prototype.hasOwnProperty.call(O,A)&&(d[A]=O[A])}return d},c.apply(this,arguments)}function m(d,_){var O=Object.keys(d);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(d);_&&(A=A.filter(function(P){return Object.getOwnPropertyDescriptor(d,P).enumerable})),O.push.apply(O,A)}return O}function v(d){for(var _=1;_<arguments.length;_++){var O=arguments[_]!=null?arguments[_]:{};_%2?m(Object(O),!0).forEach(function(A){b(d,A,O[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(O)):m(Object(O)).forEach(function(A){Object.defineProperty(d,A,Object.getOwnPropertyDescriptor(O,A))})}return d}function b(d,_,O){return _ in d?Object.defineProperty(d,_,{value:O,enumerable:!0,configurable:!0,writable:!0}):d[_]=O,d}var E=v(v({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:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:S.default,bufferController:f.default,capLevelController:u.default,fpsController:o.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:t.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},g()),{},{subtitleStreamController:T.SubtitleStreamController,subtitleTrackController:w.default,timelineController:p.TimelineController,audioStreamController:D.default,audioTrackController:x.default,emeController:i.default,cmcdController:l.default});function g(){return{cueHandler:r.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 y(d,_){if((_.liveSyncDurationCount||_.liveMaxLatencyDurationCount)&&(_.liveSyncDuration||_.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(_.liveMaxLatencyDurationCount!==void 0&&(_.liveSyncDurationCount===void 0||_.liveMaxLatencyDurationCount<=_.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(_.liveMaxLatencyDuration!==void 0&&(_.liveSyncDuration===void 0||_.liveMaxLatencyDuration<=_.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return c({},d,_)}function C(d){var _=d.loader;if(_!==h.default&&_!==s.default)n.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),d.progressive=!1;else{var O=Object(h.fetchSupported)();O&&(d.loader=h.default,d.progressive=!0,d.enableSoftwareAES=!0,n.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/polyfills/number.ts"),D=j("./src/utils/ewma-bandwidth-estimator.ts"),x=j("./src/events.ts"),T=j("./src/utils/buffer-helper.ts"),w=j("./src/errors.ts"),f=j("./src/types/loader.ts"),p=j("./src/utils/logger.ts");function u(l,s){for(var h=0;h<s.length;h++){var r=s[h];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(l,r.key,r)}}function o(l,s,h){return s&&u(l.prototype,s),h&&u(l,h),l}var i=function(){function l(h){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=h;var r=h.config;this.bwEstimator=new D.default(r.abrEwmaSlowVoD,r.abrEwmaFastVoD,r.abrEwmaDefaultEstimate),this.registerListeners()}var s=l.prototype;return s.registerListeners=function(){var r=this.hls;r.on(x.Events.FRAG_LOADING,this.onFragLoading,this),r.on(x.Events.FRAG_LOADED,this.onFragLoaded,this),r.on(x.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.on(x.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.on(x.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var r=this.hls;r.off(x.Events.FRAG_LOADING,this.onFragLoading,this),r.off(x.Events.FRAG_LOADED,this.onFragLoaded,this),r.off(x.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.off(x.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.off(x.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},s.onFragLoading=function(r,t){var n=t.frag;if(n.type===f.PlaylistLevelType.MAIN&&!this.timer){var c;this.fragCurrent=n,this.partCurrent=(c=t.part)!=null?c:null,this.timer=self.setInterval(this.onCheck,100)}},s.onLevelLoaded=function(r,t){var n=this.hls.config;t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)},s._abandonRulesCheck=function(){var r=this.fragCurrent,t=this.partCurrent,n=this.hls,c=n.autoLevelEnabled,m=n.config,v=n.media;if(!r||!v)return;var b=t?t.stats:r.stats,E=t?t.duration:r.duration;if(b.aborted){p.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!c||v.paused||!v.playbackRate||!v.readyState)return;var g=performance.now()-b.loading.start,y=Math.abs(v.playbackRate);if(g<=500*E/y)return;var C=n.levels,d=n.minAutoLevel,_=C[r.level],O=b.total||Math.max(b.loaded,Math.round(E*_.maxBitrate/8)),A=Math.max(1,b.bwEstimate?b.bwEstimate/8:b.loaded*1e3/g),P=(O-b.loaded)/A,I=v.currentTime,W=(T.BufferHelper.bufferInfo(v,I,m.maxBufferHole).end-I)/y;if(W>=2*E/y||P<=W)return;var K=Number.POSITIVE_INFINITY,te;for(te=r.level-1;te>d;te--){var H=C[te].maxBitrate;if(K=E*H/(8*.8*A),K<W)break}if(K>=P)return;var G=this.bwEstimator.getEstimate();p.logger.warn("Fragment "+r.sn+(t?" part "+t.index:"")+" of level "+r.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+te+`
|
|
|
Current BW estimate: `+(Object(S.isFiniteNumber)(G)?(G/1024).toFixed(3):"Unknown")+` Kb/s
|
|
|
Estimated load time for current fragment: `+P.toFixed(3)+` s
|
|
|
Estimated load time for the next fragment: `+K.toFixed(3)+` s
|
|
|
Time to underbuffer: `+W.toFixed(3)+" s"),n.nextLoadLevel=te,this.bwEstimator.sample(g,b.loaded),this.clearTimer(),r.loader&&(this.fragCurrent=this.partCurrent=null,r.loader.abort()),n.trigger(x.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,part:t,stats:b})},s.onFragLoaded=function(r,t){var n=t.frag,c=t.part;if(n.type===f.PlaylistLevelType.MAIN&&Object(S.isFiniteNumber)(n.sn)){var m=c?c.stats:n.stats,v=c?c.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var b=this.hls.levels[n.level],E=(b.loaded?b.loaded.bytes:0)+m.loaded,g=(b.loaded?b.loaded.duration:0)+v;b.loaded={bytes:E,duration:g},b.realBitrate=Math.round(8*E/g)}if(n.bitrateTest){var y={stats:m,frag:n,part:c,id:n.type};this.onFragBuffered(x.Events.FRAG_BUFFERED,y),n.bitrateTest=!1}}},s.onFragBuffered=function(r,t){var n=t.frag,c=t.part,m=c?c.stats:n.stats;if(m.aborted)return;if(n.type!==f.PlaylistLevelType.MAIN||n.sn==="initSegment")return;var v=m.parsing.end-m.loading.start;this.bwEstimator.sample(v,m.loaded),m.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=v/1e3:this.bitrateTestDelay=0},s.onError=function(r,t){switch(t.details){case w.ErrorDetails.FRAG_LOAD_ERROR:case w.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var r=this.fragCurrent,t=this.partCurrent,n=this.hls,c=n.maxAutoLevel,m=n.config,v=n.minAutoLevel,b=n.media,E=t?t.duration:r?r.duration:0,g=b?b.currentTime:0,y=b&&b.playbackRate!==0?Math.abs(b.playbackRate):1,C=this.bwEstimator?this.bwEstimator.getEstimate():m.abrEwmaDefaultEstimate,d=(T.BufferHelper.bufferInfo(b,g,m.maxBufferHole).end-g)/y,_=this.findBestLevel(C,v,c,d,m.abrBandWidthFactor,m.abrBandWidthUpFactor);if(_>=0)return _;p.logger.trace((d?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var O=E?Math.min(E,m.maxStarvationDelay):m.maxStarvationDelay,A=m.abrBandWidthFactor,P=m.abrBandWidthUpFactor;if(!d){var I=this.bitrateTestDelay;if(I){var W=E?Math.min(E,m.maxLoadingDelay):m.maxLoadingDelay;O=W-I,p.logger.trace("bitrate test took "+Math.round(1e3*I)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*O)+" ms"),A=P=1}}return _=this.findBestLevel(C,v,c,d+O,A,P),Math.max(_,0)},s.findBestLevel=function(r,t,n,c,m,v){for(var b,E=this.fragCurrent,g=this.partCurrent,y=this.lastLoadedFragLevel,C=this.hls.levels,d=C[y],_=!!(d!=null&&(b=d.details)!==null&&b!==void 0&&b.live),O=d==null?void 0:d.codecSet,A=g?g.duration:E?E.duration:0,P=n;P>=t;P--){var I=C[P];if(!I||O&&I.codecSet!==O)continue;var W=I.details,K=(g?W==null?void 0:W.partTarget:W==null?void 0:W.averagetargetduration)||A,te=void 0;P<=y?te=m*r:te=v*r;var H=C[P].maxBitrate,G=H*K/te;if(p.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+P+"/"+Math.round(te)+"/"+H+"/"+K+"/"+c+"/"+G),te>H&&(!G||_&&!this.bitrateTestDelay||G<c))return P}return-1},o(l,[{key:"nextAutoLevel",get:function(){var r=this._nextAutoLevel,t=this.bwEstimator;if(r!==-1&&(!t||!t.canEstimate()))return r;var n=this.getNextABRAutoLevel();return r!==-1&&(n=Math.min(r,n)),n},set:function(r){this._nextAutoLevel=r}}]),l}();Q.default=i},"./src/controller/audio-stream-controller.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/polyfills/number.ts"),D=j("./src/controller/base-stream-controller.ts"),x=j("./src/events.ts"),T=j("./src/utils/buffer-helper.ts"),w=j("./src/controller/fragment-tracker.ts"),f=j("./src/types/level.ts"),p=j("./src/types/loader.ts"),u=j("./src/loader/fragment.ts"),o=j("./src/demux/chunk-cache.ts"),i=j("./src/demux/transmuxer-interface.ts"),l=j("./src/types/transmuxer.ts"),s=j("./src/controller/fragment-finders.ts"),h=j("./src/utils/discontinuities.ts"),r=j("./src/errors.ts"),t=j("./src/utils/logger.ts");function n(){return n=Object.assign||function(E){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var C in y)Object.prototype.hasOwnProperty.call(y,C)&&(E[C]=y[C])}return E},n.apply(this,arguments)}function c(E,g){E.prototype=Object.create(g.prototype),E.prototype.constructor=E,m(E,g)}function m(E,g){return m=Object.setPrototypeOf||function(C,d){return C.__proto__=d,C},m(E,g)}var v=100,b=function(E){c(g,E);function g(C,d){var _;return _=E.call(this,C,d,"[audio-stream-controller]")||this,_.videoBuffer=null,_.videoTrackCC=-1,_.waitingVideoCC=-1,_.audioSwitch=!1,_.trackId=-1,_.waitingData=null,_.mainDetails=null,_.bufferFlushed=!1,_._registerListeners(),_}var y=g.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var d=this.hls;d.on(x.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(x.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(x.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(x.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(x.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),d.on(x.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.on(x.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.on(x.Events.ERROR,this.onError,this),d.on(x.Events.BUFFER_RESET,this.onBufferReset,this),d.on(x.Events.BUFFER_CREATED,this.onBufferCreated,this),d.on(x.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.on(x.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.on(x.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._unregisterListeners=function(){var d=this.hls;d.off(x.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(x.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(x.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(x.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(x.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),d.off(x.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.off(x.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.off(x.Events.ERROR,this.onError,this),d.off(x.Events.BUFFER_RESET,this.onBufferReset,this),d.off(x.Events.BUFFER_CREATED,this.onBufferCreated,this),d.off(x.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.off(x.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(x.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onInitPtsFound=function(d,_){var O=_.frag,A=_.id,P=_.initPTS;if(A==="main"){var I=O.cc;this.initPTS[O.cc]=P,this.log("InitPTS for cc: "+I+" found from main: "+P),this.videoTrackCC=I,this.state===D.State.WAITING_INIT_PTS&&this.tick()}},y.startLoad=function(d){if(!this.levels){this.startPosition=d,this.state=D.State.STOPPED;return}var _=this.lastCurrentTime;this.stopLoad(),this.setInterval(v),this.fragLoadError=0,_>0&&d===-1?(this.log("Override startPosition with lastCurrentTime @"+_.toFixed(3)),this.state=D.State.IDLE):(this.loadedmetadata=!1,this.state=D.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()},y.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_TRACK:{var d,_=this.levels,O=this.trackId,A=_==null||((d=_[O])===null||d===void 0)?void 0:d.details;if(A){if(this.waitForCdnTuneIn(A))break;this.state=D.State.WAITING_INIT_PTS}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var P,I=performance.now(),W=this.retryDate;(!W||I>=W||(P=this.media)!==null&&P!==void 0&&P.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=D.State.IDLE);break}case D.State.WAITING_INIT_PTS:{var K=this.waitingData;if(K){var te=K.frag,H=K.part,G=K.cache,V=K.complete;if(this.initPTS[te.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.FRAG_LOADING;var re=G.flush(),$={frag:te,part:H,payload:re,networkDetails:null};this._handleFragmentLoadProgress($),V&&E.prototype._handleFragmentLoadComplete.call(this,$)}else if(this.videoTrackCC!==this.waitingVideoCC)t.logger.log("Waiting fragment cc ("+te.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ne=this.getLoadPosition(),he=T.BufferHelper.bufferInfo(this.mediaBuffer,ne,this.config.maxBufferHole),pe=Object(s.fragmentWithinToleranceTest)(he.end,this.config.maxFragLookUpTolerance,te);pe<0&&(t.logger.log("Waiting fragment cc ("+te.cc+") @ "+te.start+" cancelled because another fragment at "+he.end+" is needed"),this.clearWaitingFragment())}}else this.state=D.State.IDLE}}this.onTickEnd()},y.clearWaitingFragment=function(){var d=this.waitingData;d&&(this.fragmentTracker.removeFragment(d.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.IDLE)},y.onTickEnd=function(){var d=this.media;if(!d||!d.readyState)return;var _=this.mediaBuffer?this.mediaBuffer:d,O=_.buffered;!this.loadedmetadata&&O.length&&(this.loadedmetadata=!0),this.lastCurrentTime=d.currentTime},y.doTickIdle=function(){var d,_,O=this.hls,A=this.levels,P=this.media,I=this.trackId,W=O.config;if(!A||!A[I])return;if(!P&&(this.startFragRequested||!W.startFragPrefetch))return;var K=A[I],te=K.details;if(!te||te.live&&this.levelLastLoaded!==I||this.waitForCdnTuneIn(te)){this.state=D.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,u.ElementaryStreamTypes.AUDIO,p.PlaylistLevelType.AUDIO));var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,p.PlaylistLevelType.AUDIO);if(H===null)return;var G=H.len,V=this.getMaxBufferLength(),re=this.audioSwitch;if(G>=V&&!re)return;if(!re&&this._streamEnded(H,te)){O.trigger(x.Events.BUFFER_EOS,{type:"audio"}),this.state=D.State.ENDED;return}var $=te.fragments,ne=$[0].start,he=H.end;if(re){var pe=this.getLoadPosition();he=pe,te.PTSKnown&&pe<ne&&((H.end>ne||H.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),P.currentTime=ne+.05))}var Te=this.getNextFragment(he,te);if(!Te){this.bufferFlushed=!0;return}((d=Te.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((_=Te.decryptdata)!==null&&_!==void 0&&_.key)?this.loadKey(Te,te):this.loadFragment(Te,te,he)},y.getMaxBufferLength=function(){var d=E.prototype.getMaxBufferLength.call(this),_=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,p.PlaylistLevelType.MAIN);return _===null?d:Math.max(d,_.len)},y.onMediaDetaching=function(){this.videoBuffer=null,E.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(d,_){var O=_.audioTracks;this.resetTransmuxer(),this.levels=O.map(function(A){return new f.Level(A)})},y.onAudioTrackSwitching=function(d,_){var O=!!_.url;this.trackId=_.id;var A=this.fragCurrent;A!=null&&A.loader&&A.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),O?this.setInterval(v):this.resetTransmuxer(),O?(this.audioSwitch=!0,this.state=D.State.IDLE):this.state=D.State.STOPPED,this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},y.onLevelLoaded=function(d,_){this.mainDetails=_.details},y.onAudioTrackLoaded=function(d,_){var O,A=this.levels,P=_.details,I=_.id;if(!A){this.warn("Audio tracks were reset while loading level "+I);return}this.log("Track "+I+" loaded ["+P.startSN+","+P.endSN+"],duration:"+P.totalduration);var W=A[I],K=0;if(P.live||(O=W.details)!==null&&O!==void 0&&O.live){var te=this.mainDetails;if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed||!te)return;!W.details&&P.hasProgramDateTime&&te.hasProgramDateTime?(Object(h.alignMediaPlaylistByPDT)(P,te),K=P.fragments[0].start):K=this.alignPlaylists(P,W.details)}W.details=P,this.levelLastLoaded=I,!this.startFragRequested&&(this.mainDetails||!P.live)&&this.setStartPosition(W.details,K),this.state===D.State.WAITING_TRACK&&!this.waitForCdnTuneIn(P)&&(this.state=D.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(d){var _,O=d.frag,A=d.part,P=d.payload,I=this.config,W=this.trackId,K=this.levels;if(!K){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+O.sn+" of level "+O.level+" will not be buffered");return}var te=K[W];console.assert(te,"Audio track is defined on fragment load progress");var H=te.details;console.assert(H,"Audio track details are defined on fragment load progress");var G=I.defaultAudioCodec||te.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new i.default(this.hls,p.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var re=this.initPTS[O.cc],$=(_=O.initSegment)===null||_===void 0?void 0:_.data;if(re!==void 0){var ne=!1,he=A?A.index:-1,pe=he!==-1,Te=new l.ChunkMetadata(O.level,O.sn,O.stats.chunkCount,P.byteLength,he,pe);V.push(P,$,G,"",O,A,H.totalduration,ne,Te,re)}else{t.logger.log("Unknown video PTS for cc "+O.cc+", waiting for video PTS before demuxing audio frag "+O.sn+" of ["+H.startSN+" ,"+H.endSN+"],track "+W);var we=this.waitingData=this.waitingData||{frag:O,part:A,cache:new o.default,complete:!1},Me=we.cache;Me.push(new Uint8Array(P)),this.waitingVideoCC=this.videoTrackCC,this.state=D.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(d){if(this.waitingData){this.waitingData.complete=!0;return}E.prototype._handleFragmentLoadComplete.call(this,d)},y.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},y.onBufferCreated=function(d,_){var O=_.tracks.audio;O&&(this.mediaBuffer=O.buffer),_.tracks.video&&(this.videoBuffer=_.tracks.video.buffer)},y.onFragBuffered=function(d,_){var O=_.frag,A=_.part;if(O.type!==p.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(O)){this.warn("Fragment "+O.sn+(A?" p: "+A.index:"")+" of level "+O.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}O.sn!=="initSegment"&&(this.fragPrevious=O,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(x.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(O,A)},y.onError=function(d,_){switch(_.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p.PlaylistLevelType.AUDIO,_);break;case r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==D.State.ERROR&&this.state!==D.State.STOPPED&&(this.state=_.fatal?D.State.ERROR:D.State.IDLE,this.warn(_.details+" while loading frag, switching to "+this.state+" state"));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(_.parent==="audio"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var O=!0,A=this.getFwdBufferInfo(this.mediaBuffer,p.PlaylistLevelType.AUDIO);A&&A.len>.5&&(O=!this.reduceMaxBufferLength(A.len)),O&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},y.onBufferFlushed=function(d,_){var O=_.type;O===u.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(d){var _,O="audio",A=this.hls,P=d.remuxResult,I=d.chunkMeta,W=this.getCurrentContext(I);if(!W){this.warn("The loading context changed while buffering fragment "+I.sn+" of level "+I.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(I.level);return}var K=W.frag,te=W.part,H=P.audio,G=P.text,V=P.id3,re=P.initSegment;if(this.fragContextChanged(K))return;if(this.state=D.State.PARSING,this.audioSwitch&&H&&this.completeAudioSwitch(),re!=null&&re.tracks&&(this._bufferInitSegment(re.tracks,K,I),A.trigger(x.Events.FRAG_PARSING_INIT_SEGMENT,{frag:K,id:O,tracks:re.tracks})),H){var $=H.startPTS,ne=H.endPTS,he=H.startDTS,pe=H.endDTS;te&&(te.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:$,endPTS:ne,startDTS:he,endDTS:pe}),K.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,$,ne,he,pe),this.bufferFragmentData(H,K,te,I)}if(V!=null&&(_=V.samples)!==null&&_!==void 0&&_.length){var Te=n({frag:K,id:O},V);A.trigger(x.Events.FRAG_PARSING_METADATA,Te)}if(G){var we=n({frag:K,id:O},G);A.trigger(x.Events.FRAG_PARSING_USERDATA,we)}},y._bufferInitSegment=function(d,_,O){if(this.state!==D.State.PARSING)return;d.video&&delete d.video;var A=d.audio;if(!A)return;A.levelCodec=A.codec,A.id="audio",this.log("Init audio buffer, container:"+A.container+", codecs[parsed]=["+A.codec+"]"),this.hls.trigger(x.Events.BUFFER_CODECS,d);var P=A.initSegment;if(P!=null&&P.byteLength){var I={type:"audio",frag:_,part:null,chunkMeta:O,parent:_.type,data:P};this.hls.trigger(x.Events.BUFFER_APPENDING,I)}this.tick()},y.loadFragment=function(d,_,O){var A=this.fragmentTracker.getState(d);this.fragCurrent=d,(this.audioSwitch||A===w.FragmentState.NOT_LOADED||A===w.FragmentState.PARTIAL)&&(d.sn==="initSegment"?this._loadInitSegment(d):_.live&&!Object(S.isFiniteNumber)(this.initPTS[d.cc])?(this.log("Waiting for video PTS in continuity counter "+d.cc+" of live stream before loading audio fragment "+d.sn+" of level "+this.trackId),this.state=D.State.WAITING_INIT_PTS):(this.startFragRequested=!0,E.prototype.loadFragment.call(this,d,_,O)))},y.completeAudioSwitch=function(){var d=this.hls,_=this.media,O=this.trackId;_&&(this.log("Switching audio track : flushing all audio"),E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,d.trigger(x.Events.AUDIO_TRACK_SWITCHED,{id:O})},g}(D.default);Q.default=b},"./src/controller/audio-track-controller.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/events.ts"),D=j("./src/errors.ts"),x=j("./src/controller/base-playlist-controller.ts"),T=j("./src/types/loader.ts");function w(i,l){for(var s=0;s<l.length;s++){var h=l[s];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(i,h.key,h)}}function f(i,l,s){return l&&w(i.prototype,l),s&&w(i,s),i}function p(i,l){i.prototype=Object.create(l.prototype),i.prototype.constructor=i,u(i,l)}function u(i,l){return u=Object.setPrototypeOf||function(h,r){return h.__proto__=r,h},u(i,l)}var o=function(i){p(l,i);function l(h){var r;return r=i.call(this,h,"[audio-track-controller]")||this,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.trackName="",r.selectDefaultTrack=!0,r.registerListeners(),r}var s=l.prototype;return s.registerListeners=function(){var r=this.hls;r.on(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(S.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(S.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(S.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.on(S.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var r=this.hls;r.off(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(S.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(S.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(S.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.off(S.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,i.prototype.destroy.call(this)},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},s.onManifestParsed=function(r,t){this.tracks=t.audioTracks||[]},s.onAudioTrackLoaded=function(r,t){var n=t.id,c=t.details,m=this.tracksInGroup[n];if(!m){this.warn("Invalid audio track id "+n);return}var v=m.details;m.details=t.details,this.log("audioTrack "+n+" loaded ["+c.startSN+"-"+c.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,t,v))},s.onLevelLoading=function(r,t){this.switchLevel(t.level)},s.onLevelSwitching=function(r,t){this.switchLevel(t.level)},s.switchLevel=function(r){var t=this.hls.levels[r];if(!(t!=null&&t.audioGroupIds))return;var n=t.audioGroupIds[t.urlId];if(this.groupId!==n){this.groupId=n;var c=this.tracks.filter(function(v){return!n||v.groupId===n});this.selectDefaultTrack&&!c.some(function(v){return v.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=c;var m={audioTracks:c};this.log("Updating audio tracks, "+c.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(S.Events.AUDIO_TRACKS_UPDATED,m),this.selectInitialTrack()}},s.onError=function(r,t){if(i.prototype.onError.call(this,r,t),t.fatal||!t.context)return;t.context.type===T.PlaylistContextType.AUDIO_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},s.setAudioTrack=function(r){var t=this.tracksInGroup;if(r<0||r>=t.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var n=t[this.trackId];this.log("Now switching to audio-track index "+r);var c=t[r],m=c.id,v=c.groupId,b=v===void 0?"":v,E=c.name,g=c.type,y=c.url;if(this.trackId=r,this.trackName=E,this.selectDefaultTrack=!1,this.hls.trigger(S.Events.AUDIO_TRACK_SWITCHING,{id:m,groupId:b,name:E,type:g,url:y}),c.details&&!c.details.live)return;var C=this.switchParams(c.url,n==null?void 0:n.details);this.loadPlaylist(C)},s.selectInitialTrack=function(){var r=this.tracksInGroup;console.assert(r.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,n=this.findTrackId(t)||this.findTrackId();n!==-1?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(r){for(var t=this.tracksInGroup,n=0;n<t.length;n++){var c=t[n];if((!this.selectDefaultTrack||c.default)&&(!r||r===c.name))return c.id}return-1},s.loadPlaylist=function(r){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var n=t.id,c=t.groupId,m=t.url;if(r)try{m=r.addDirectives(m)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("loading audio-track playlist for id: "+n),this.clearTimer(),this.hls.trigger(S.Events.AUDIO_TRACK_LOADING,{url:m,id:n,groupId:c,deliveryDirectives:r||null})}},f(l,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1,this.setAudioTrack(r)}}]),l}(x.default);Q.default=o},"./src/controller/base-playlist-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return f});var S=j("./src/polyfills/number.ts"),D=j("./src/types/level.ts"),x=j("./src/controller/level-helper.ts"),T=j("./src/utils/logger.ts"),w=j("./src/errors.ts"),f=function(){function p(o,i){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=T.logger.log.bind(T.logger,i+":"),this.warn=T.logger.warn.bind(T.logger,i+":"),this.hls=o}var u=p.prototype;return u.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},u.onError=function(i,l){l.fatal&&l.type===w.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},u.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},u.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},u.stopLoad=function(){this.canLoad=!1,this.clearTimer()},u.switchParams=function(i,l){var s=l==null?void 0:l.renditionReports;if(s)for(var h=0;h<s.length;h++){var r=s[h],t=""+r.URI;if(t===i.substr(-t.length)){var n=parseInt(r["LAST-MSN"]),c=parseInt(r["LAST-PART"]);if(l&&this.hls.config.lowLatencyMode){var m=Math.min(l.age-l.partTarget,l.targetduration);c!==void 0&&m>l.partTarget&&(c+=1)}if(Object(S.isFiniteNumber)(n))return new D.HlsUrlParameters(n,Object(S.isFiniteNumber)(c)?c:void 0,D.HlsSkip.No)}}},u.loadPlaylist=function(i){},u.shouldLoadTrack=function(i){return this.canLoad&&i&&!!i.url&&(!i.details||i.details.live)},u.playlistLoaded=function(i,l,s){var h=this,r=l.details,t=l.stats,n=t.loading.end?Math.max(0,self.performance.now()-t.loading.end):0;if(r.advancedDateTime=Date.now()-n,r.live||s!=null&&s.live){if(r.reloaded(s),s&&this.log("live playlist "+i+" "+(r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:"MISSED")),s&&r.fragments.length>0&&Object(x.mergeDetails)(s,r),!this.canLoad||!r.live)return;var c,m=void 0,v=void 0;if(r.canBlockReload&&r.endSN&&r.advanced){var b=this.hls.config.lowLatencyMode,E=r.lastPartSn,g=r.endSN,y=r.lastPartIndex,C=y!==-1,d=E===g,_=b?0:y;C?(m=d?g+1:E,v=d?_:y+1):m=g+1;var O=r.age,A=O+r.ageHeader,P=Math.min(A-r.partTarget,r.targetduration*1.5);if(P>0){if(s&&P>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+P+" with playlist age: "+r.age),P=0;else{var I=Math.floor(P/r.targetduration);if(m+=I,v!==void 0){var W=Math.round(P%r.targetduration/r.partTarget);v+=W}this.log("CDN Tune-in age: "+r.ageHeader+"s last advanced "+O.toFixed(2)+"s goal: "+P+" skip sn "+I+" to part "+v)}r.tuneInGoal=P}if(c=this.getDeliveryDirectives(r,l.deliveryDirectives,m,v),b||!d){this.loadPlaylist(c);return}}else c=this.getDeliveryDirectives(r,l.deliveryDirectives,m,v);var K=Object(x.computeReloadInterval)(r,t);m!==void 0&&r.canBlockReload&&(K-=r.partTarget||1),this.log("reload live playlist "+i+" in "+Math.round(K)+" ms"),this.timer=self.setTimeout(function(){return h.loadPlaylist(c)},K)}else this.clearTimer()},u.getDeliveryDirectives=function(i,l,s,h){var r=Object(D.getSkipValue)(i,s);return l!=null&&l.skip&&i.deltaUpdateFailed&&(s=l.msn,h=l.part,r=D.HlsSkip.No),new D.HlsUrlParameters(s,h,r)},u.retryLoadingOrFail=function(i){var l=this,s=this.hls.config,h=this.retryCount<s.levelLoadingMaxRetry;if(h){var r;if(this.retryCount++,i.details.indexOf("LoadTimeOut")>-1&&(r=i.context)!==null&&r!==void 0&&r.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+i.details+'"'),this.loadPlaylist();else{var t=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return l.loadPlaylist()},t),this.warn("retry playlist loading #"+this.retryCount+" in "+t+' ms after "'+i.details+'"')}}else this.warn('cannot recover from error "'+i.details+'"'),this.clearTimer(),i.fatal=!0;return h},p}()},"./src/controller/base-stream-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"State",function(){return g}),j.d(Q,"default",function(){return y});var S=j("./src/polyfills/number.ts"),D=j("./src/task-loop.ts"),x=j("./src/controller/fragment-tracker.ts"),T=j("./src/utils/buffer-helper.ts"),w=j("./src/utils/logger.ts"),f=j("./src/events.ts"),p=j("./src/errors.ts"),u=j("./src/types/transmuxer.ts"),o=j("./src/utils/mp4-tools.ts"),i=j("./src/utils/discontinuities.ts"),l=j("./src/controller/fragment-finders.ts"),s=j("./src/controller/level-helper.ts"),h=j("./src/loader/fragment-loader.ts"),r=j("./src/crypt/decrypter.ts"),t=j("./src/utils/time-ranges.ts"),n=j("./src/types/loader.ts");function c(C,d){for(var _=0;_<d.length;_++){var O=d[_];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(C,O.key,O)}}function m(C,d,_){return d&&c(C.prototype,d),_&&c(C,_),C}function v(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function b(C,d){C.prototype=Object.create(d.prototype),C.prototype.constructor=C,E(C,d)}function E(C,d){return E=Object.setPrototypeOf||function(O,A){return O.__proto__=A,O},E(C,d)}var g={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"},y=function(C){b(d,C);function d(O,A,P){var I;return I=C.call(this)||this,I.hls=void 0,I.fragPrevious=null,I.fragCurrent=null,I.fragmentTracker=void 0,I.transmuxer=null,I._state=g.STOPPED,I.media=void 0,I.mediaBuffer=void 0,I.config=void 0,I.bitrateTest=!1,I.lastCurrentTime=0,I.nextLoadPosition=0,I.startPosition=0,I.loadedmetadata=!1,I.fragLoadError=0,I.retryDate=0,I.levels=null,I.fragmentLoader=void 0,I.levelLastLoaded=null,I.startFragRequested=!1,I.decrypter=void 0,I.initPTS=[],I.onvseeking=null,I.onvended=null,I.logPrefix="",I.log=void 0,I.warn=void 0,I.logPrefix=P,I.log=w.logger.log.bind(w.logger,P+":"),I.warn=w.logger.warn.bind(w.logger,P+":"),I.hls=O,I.fragmentLoader=new h.default(O.config),I.fragmentTracker=A,I.config=O.config,I.decrypter=new r.default(O,O.config),O.on(f.Events.KEY_LOADED,I.onKeyLoaded,v(I)),I}var _=d.prototype;return _.doTick=function(){this.onTickEnd()},_.onTickEnd=function(){},_.startLoad=function(A){},_.stopLoad=function(){this.fragmentLoader.abort();var A=this.fragCurrent;A&&this.fragmentTracker.removeFragment(A),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=g.STOPPED},_._streamEnded=function(A,P){var I=this.fragCurrent,W=this.fragmentTracker;if(!P.live&&I&&I.sn===P.endSN&&!A.nextStart){var K=W.getState(I);return K===x.FragmentState.PARTIAL||K===x.FragmentState.OK}return!1},_.onMediaAttached=function(A,P){var I=this.media=this.mediaBuffer=P.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),I.addEventListener("seeking",this.onvseeking),I.addEventListener("ended",this.onvended);var W=this.config;this.levels&&W.autoStartLoad&&this.state===g.STOPPED&&this.startLoad(W.startPosition)},_.onMediaDetaching=function(){var A=this.media;A!=null&&A.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),A&&(A.removeEventListener("seeking",this.onvseeking),A.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},_.onMediaSeeking=function(){var A=this.config,P=this.fragCurrent,I=this.media,W=this.mediaBuffer,K=this.state,te=I?I.currentTime:0,H=T.BufferHelper.bufferInfo(W||I,te,A.maxBufferHole);if(this.log("media seeking to "+(Object(S.isFiniteNumber)(te)?te.toFixed(3):te)+", state: "+K),K===g.ENDED)this.resetLoadingState();else if(P&&!H.len){var G=A.maxFragLookUpTolerance,V=P.start-G,re=P.start+P.duration+G,$=te>re;(te<V||$)&&($&&P.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),P.loader.abort()),this.resetLoadingState())}I&&(this.lastCurrentTime=te),!this.loadedmetadata&&!H.len&&(this.nextLoadPosition=this.startPosition=te),this.tickImmediate()},_.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},_.onKeyLoaded=function(A,P){if(this.state!==g.KEY_LOADING||P.frag!==this.fragCurrent||!this.levels)return;this.state=g.IDLE;var I=this.levels[P.frag.level].details;I&&this.loadFragment(P.frag,I,P.frag.start)},_.onHandlerDestroying=function(){this.stopLoad(),C.prototype.onHandlerDestroying.call(this)},_.onHandlerDestroyed=function(){this.state=g.STOPPED,this.hls.off(f.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,C.prototype.onHandlerDestroyed.call(this)},_.loadKey=function(A,P){this.log("Loading key for "+A.sn+" of ["+P.startSN+"-"+P.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+A.level),this.state=g.KEY_LOADING,this.fragCurrent=A,this.hls.trigger(f.Events.KEY_LOADING,{frag:A})},_.loadFragment=function(A,P,I){this._loadFragForPlayback(A,P,I)},_._loadFragForPlayback=function(A,P,I){var W=this,K=function(H){if(W.fragContextChanged(A)){W.warn("Fragment "+A.sn+(H.part?" p: "+H.part.index:"")+" of level "+A.level+" was dropped during download."),W.fragmentTracker.removeFragment(A);return}A.stats.chunkCount++,W._handleFragmentLoadProgress(H)};this._doFragLoad(A,P,I,K).then(function(te){if(!te)return;W.fragLoadError=0;var H=W.state;if(W.fragContextChanged(A)){(H===g.FRAG_LOADING||H===g.BACKTRACKING||!W.fragCurrent&&H===g.PARSING)&&(W.fragmentTracker.removeFragment(A),W.state=g.IDLE);return}if("payload"in te&&(W.log("Loaded fragment "+A.sn+" of level "+A.level),W.hls.trigger(f.Events.FRAG_LOADED,te),W.state===g.BACKTRACKING)){W.fragmentTracker.backtrack(A,te),W.resetFragmentLoading(A);return}W._handleFragmentLoadComplete(te)}).catch(function(te){W.warn(te),W.resetFragmentLoading(A)})},_.flushMainBuffer=function(A,P,I){if(I===void 0&&(I=null),!(A-P))return;var W={startOffset:A,endOffset:P,type:I};this.fragLoadError=0,this.hls.trigger(f.Events.BUFFER_FLUSHING,W)},_._loadInitSegment=function(A){var P=this;this._doFragLoad(A).then(function(I){if(!I||P.fragContextChanged(A)||!P.levels)throw new Error("init load aborted");return I}).then(function(I){var W=P.hls,K=I.payload,te=A.decryptdata;if(K&&K.byteLength>0&&te&&te.key&&te.iv&&te.method==="AES-128"){var H=self.performance.now();return P.decrypter.webCryptoDecrypt(new Uint8Array(K),te.key.buffer,te.iv.buffer).then(function(G){var V=self.performance.now();return W.trigger(f.Events.FRAG_DECRYPTED,{frag:A,payload:G,stats:{tstart:H,tdecrypt:V}}),I.payload=G,I})}return I}).then(function(I){var W=P.fragCurrent,K=P.hls,te=P.levels;if(!te)throw new Error("init load aborted, missing levels");var H=te[A.level].details;console.assert(H,"Level details are defined when init segment is loaded");var G=A.stats;P.state=g.IDLE,P.fragLoadError=0,A.data=new Uint8Array(I.payload),G.parsing.start=G.buffering.start=self.performance.now(),G.parsing.end=G.buffering.end=self.performance.now(),I.frag===W&&K.trigger(f.Events.FRAG_BUFFERED,{stats:G,frag:W,part:null,id:A.type}),P.tick()}).catch(function(I){P.warn(I),P.resetFragmentLoading(A)})},_.fragContextChanged=function(A){var P=this.fragCurrent;return!A||!P||A.level!==P.level||A.sn!==P.sn||A.urlId!==P.urlId},_.fragBufferedComplete=function(A,P){var I=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+A.type+" sn: "+A.sn+(P?" part: "+P.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+A.level+" "+t.default.toString(T.BufferHelper.getBuffered(I))),this.state=g.IDLE,this.tick()},_._handleFragmentLoadComplete=function(A){var P=this.transmuxer;if(!P)return;var I=A.frag,W=A.part,K=A.partsLoaded,te=!K||K.length===0||K.some(function(G){return!G}),H=new u.ChunkMetadata(I.level,I.sn,I.stats.chunkCount+1,0,W?W.index:-1,!te);P.flush(H)},_._handleFragmentLoadProgress=function(A){},_._doFragLoad=function(A,P,I,W){var K=this;if(I===void 0&&(I=null),!this.levels)throw new Error("frag load aborted, missing levels");if(I=Math.max(A.start,I||0),this.config.lowLatencyMode&&P){var te=P.partList;if(te&&W){I>A.end&&P.fragmentHint&&(A=P.fragmentHint);var H=this.getNextPart(te,A,I);if(H>-1){var G=te[H];return this.log("Loading part sn: "+A.sn+" p: "+G.index+" cc: "+A.cc+" of playlist ["+P.startSN+"-"+P.endSN+"] parts [0-"+H+"-"+(te.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+A.level+", target: "+parseFloat(I.toFixed(3))),this.nextLoadPosition=G.start+G.duration,this.state=g.FRAG_LOADING,this.hls.trigger(f.Events.FRAG_LOADING,{frag:A,part:te[H],targetBufferTime:I}),this.doFragPartsLoad(A,te,H,W).catch(function(V){return K.handleFragLoadError(V)})}else if(!A.url||this.loadedEndOfParts(te,I))return Promise.resolve(null)}}return this.log("Loading fragment "+A.sn+" cc: "+A.cc+" "+(P?"of ["+P.startSN+"-"+P.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+A.level+", target: "+parseFloat(I.toFixed(3))),Object(S.isFiniteNumber)(A.sn)&&!this.bitrateTest&&(this.nextLoadPosition=A.start+A.duration),this.state=g.FRAG_LOADING,this.hls.trigger(f.Events.FRAG_LOADING,{frag:A,targetBufferTime:I}),this.fragmentLoader.load(A,W).catch(function(V){return K.handleFragLoadError(V)})},_.doFragPartsLoad=function(A,P,I,W){var K=this;return new Promise(function(te,H){var G=[],V=function re($){var ne=P[$];K.fragmentLoader.loadPart(A,ne,W).then(function(he){G[ne.index]=he;var pe=he.part;K.hls.trigger(f.Events.FRAG_LOADED,he);var Te=P[$+1];if(Te&&Te.fragment===A)re($+1);else return te({frag:A,part:pe,partsLoaded:G})}).catch(H)};V(I)})},_.handleFragLoadError=function(A){var P=A.data;return P&&P.details===p.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(P.frag,P.part):this.hls.trigger(f.Events.ERROR,P),null},_._handleTransmuxerFlush=function(A){var P=this.getCurrentContext(A);if(!P||this.state!==g.PARSING){this.fragCurrent||(this.state=g.IDLE);return}var I=P.frag,W=P.part,K=P.level,te=self.performance.now();I.stats.parsing.end=te,W&&(W.stats.parsing.end=te),this.updateLevelTiming(I,W,K,A.partial)},_.getCurrentContext=function(A){var P=this.levels,I=A.level,W=A.sn,K=A.part;if(!P||!P[I])return this.warn("Levels object was unset while buffering fragment "+W+" of level "+I+". The current chunk will not be buffered."),null;var te=P[I],H=K>-1?Object(s.getPartWith)(te,W,K):null,G=H?H.fragment:Object(s.getFragmentWithSN)(te,W,this.fragCurrent);return G?{frag:G,part:H,level:te}:null},_.bufferFragmentData=function(A,P,I,W){if(!A||this.state!==g.PARSING)return;var K=A.data1,te=A.data2,H=K;if(K&&te&&(H=Object(o.appendUint8Array)(K,te)),!H||!H.length)return;var G={type:A.type,frag:P,part:I,chunkMeta:W,parent:P.type,data:H};this.hls.trigger(f.Events.BUFFER_APPENDING,G),A.dropped&&A.independent&&!I&&this.flushBufferGap(P)},_.flushBufferGap=function(A){var P=this.media;if(!P)return;if(!T.BufferHelper.isBuffered(P,P.currentTime)){this.flushMainBuffer(0,A.start);return}var I=P.currentTime,W=T.BufferHelper.bufferInfo(P,I,0),K=A.duration,te=Math.min(this.config.maxFragLookUpTolerance*2,K*.25),H=Math.max(Math.min(A.start-te,W.end-te),I+te);A.start-H>te&&this.flushMainBuffer(H,A.start)},_.getFwdBufferInfo=function(A,P){var I=this.config,W=this.getLoadPosition();if(!Object(S.isFiniteNumber)(W))return null;var K=T.BufferHelper.bufferInfo(A,W,I.maxBufferHole);if(K.len===0&&K.nextStart!==void 0){var te=this.fragmentTracker.getBufferedFrag(W,P);if(te&&K.nextStart<te.end)return T.BufferHelper.bufferInfo(A,W,Math.max(K.nextStart,I.maxBufferHole))}return K},_.getMaxBufferLength=function(A){var P=this.config,I;return A?I=Math.max(8*P.maxBufferSize/A,P.maxBufferLength):I=P.maxBufferLength,Math.min(I,P.maxMaxBufferLength)},_.reduceMaxBufferLength=function(A){var P=this.config,I=A||P.maxBufferLength;return P.maxMaxBufferLength>=I?(P.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+P.maxMaxBufferLength+"s"),!0):!1},_.getNextFragment=function(A,P){var I,W,K=P.fragments,te=K.length;if(!te)return null;var H=this.config,G=K[0].start,V;if(P.live){var re=H.initialLiveManifestSize;if(te<re)return this.warn("Not enough fragments to start playback (have: "+te+", need: "+re+")"),null;!P.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(V=this.getInitialLiveFragment(P,K),this.startPosition=V?this.hls.liveSyncPosition||V.start:A)}else A<=G&&(V=K[0]);if(!V){var $=H.lowLatencyMode?P.partEnd:P.fragmentEnd;V=this.getFragmentAtPosition(A,$,P)}return(I=V)!==null&&I!==void 0&&I.initSegment&&!((W=V)!==null&&W!==void 0&&W.initSegment.data)&&!this.bitrateTest&&(V=V.initSegment),V},_.getNextPart=function(A,P,I){for(var W=-1,K=!1,te=!0,H=0,G=A.length;H<G;H++){var V=A[H];if(te=te&&!V.independent,W>-1&&I<V.start)break;var re=V.loaded;!re&&(K||V.independent||te)&&V.fragment===P&&(W=H),K=re}return W},_.loadedEndOfParts=function(A,P){var I=A[A.length-1];return I&&P>I.start&&I.loaded},_.getInitialLiveFragment=function(A,P){var I=this.fragPrevious,W=null;if(I){if(A.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+I.programDateTime),W=Object(l.findFragmentByPDT)(P,I.endProgramDateTime,this.config.maxFragLookUpTolerance)),!W){var K=I.sn+1;if(K>=A.startSN&&K<=A.endSN){var te=P[K-A.startSN];I.cc===te.cc&&(W=te,this.log("Live playlist, switching playlist, load frag with next SN: "+W.sn))}W||(W=Object(l.findFragWithCC)(P,I.cc),W&&this.log("Live playlist, switching playlist, load frag with same CC: "+W.sn))}}else{var H=this.hls.liveSyncPosition;H!==null&&(W=this.getFragmentAtPosition(H,this.bitrateTest?A.fragmentEnd:A.edge,A))}return W},_.getFragmentAtPosition=function(A,P,I){var W=this.config,K=this.fragPrevious,te=I.fragments,H=I.endSN,G=I.fragmentHint,V=W.maxFragLookUpTolerance,re=!!(W.lowLatencyMode&&I.partList&&G);re&&G&&!this.bitrateTest&&(te=te.concat(G),H=G.sn);var $;if(A<P){var ne=A>P-V?0:V;$=Object(l.findFragmentByPTS)(K,te,A,ne)}else $=te[te.length-1];if($){var he=$.sn-I.startSN,pe=K&&$.level===K.level,Te=te[he+1],we=this.fragmentTracker.getState($);if(we===x.FragmentState.BACKTRACKED){$=null;for(var Me=he;te[Me]&&this.fragmentTracker.getState(te[Me])===x.FragmentState.BACKTRACKED;)K?$=te[Me--]:$=te[--Me];$||($=Te)}else K&&$.sn===K.sn&&!re&&(pe&&($.sn<H&&this.fragmentTracker.getState(Te)!==x.FragmentState.OK?(this.log("SN "+$.sn+" just loaded, load next one: "+Te.sn),$=Te):$=null))}return $},_.synchronizeToLiveEdge=function(A){var P=this.config,I=this.media;if(!I)return;var W=this.hls.liveSyncPosition,K=I.currentTime,te=A.fragments[0].start,H=A.edge,G=K>=te-P.maxFragLookUpTolerance&&K<=H;if(W!==null&&I.duration>W&&(K<W||!G)){var V=P.liveMaxLatencyDuration!==void 0?P.liveMaxLatencyDuration:P.liveMaxLatencyDurationCount*A.targetduration;(!G&&I.readyState<4||K<H-V)&&(this.loadedmetadata||(this.nextLoadPosition=W),I.readyState&&(this.warn("Playback: "+K.toFixed(3)+" is located too far from the end of live sliding playlist: "+H+", reset currentTime to : "+W.toFixed(3)),I.currentTime=W))}},_.alignPlaylists=function(A,P){var I=this.levels,W=this.levelLastLoaded,K=this.fragPrevious,te=W!==null?I[W]:null,H=A.fragments.length;if(!H)return this.warn("No fragments in live playlist"),0;var G=A.fragments[0].start,V=!P,re=A.alignedSliding&&Object(S.isFiniteNumber)(G);if(V||!re&&!G){Object(i.alignStream)(K,te,A);var $=A.fragments[0].start;return this.log("Live playlist sliding: "+$.toFixed(2)+" start-sn: "+(P?P.startSN:"na")+"->"+A.startSN+" prev-sn: "+(K?K.sn:"na")+" fragments: "+H),$}return G},_.waitForCdnTuneIn=function(A){var P=3;return A.live&&A.canBlockReload&&A.tuneInGoal>Math.max(A.partHoldBack,A.partTarget*P)},_.setStartPosition=function(A,P){var I=this.startPosition;if(I<P&&(I=-1),I===-1||this.lastCurrentTime===-1){var W=A.startTimeOffset;Object(S.isFiniteNumber)(W)?(I=P+W,W<0&&(I+=A.totalduration),I=Math.min(Math.max(P,I),P+A.totalduration),this.log("Start time offset "+W+" found in playlist, adjust startPosition to "+I),this.startPosition=I):A.live?I=this.hls.liveSyncPosition||P:this.startPosition=I=0,this.lastCurrentTime=I}this.nextLoadPosition=I},_.getLoadPosition=function(){var A=this.media,P=0;return this.loadedmetadata&&A?P=A.currentTime:this.nextLoadPosition&&(P=this.nextLoadPosition),P},_.handleFragLoadAborted=function(A,P){this.transmuxer&&A.sn!=="initSegment"&&A.stats.aborted&&(this.warn("Fragment "+A.sn+(P?" part"+P.index:"")+" of level "+A.level+" was aborted"),this.resetFragmentLoading(A))},_.resetFragmentLoading=function(A){(!this.fragCurrent||!this.fragContextChanged(A))&&(this.state=g.IDLE)},_.onFragmentOrKeyLoadError=function(A,P){if(P.fatal)return;var I=P.frag;if(!I||I.type!==A)return;var W=this.fragCurrent;console.assert(W&&I.sn===W.sn&&I.level===W.level&&I.urlId===W.urlId,"Frag load error must match current frag to retry");var K=this.config;if(this.fragLoadError+1<=K.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(I.level))return;var te=Math.min(Math.pow(2,this.fragLoadError)*K.fragLoadingRetryDelay,K.fragLoadingMaxRetryTimeout);this.warn("Fragment "+I.sn+" of "+A+" "+I.level+" failed to load, retrying in "+te+"ms"),this.retryDate=self.performance.now()+te,this.fragLoadError++,this.state=g.FRAG_LOADING_WAITING_RETRY}else P.levelRetry?(A===n.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=g.IDLE):(w.logger.error(P.details+" reaches max retry, redispatch as fatal ..."),P.fatal=!0,this.hls.stopLoad(),this.state=g.ERROR)},_.afterBufferFlushed=function(A,P,I){if(!A)return;var W=T.BufferHelper.getBuffered(A);this.fragmentTracker.detectEvictedFragments(P,W,I),this.state===g.ENDED&&this.resetLoadingState()},_.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=g.IDLE},_.resetLiveStartWhenNotLoaded=function(A){if(!this.loadedmetadata){this.startFragRequested=!1;var P=this.levels?this.levels[A].details:null;if(P!=null&&P.live)return this.startPosition=-1,this.setStartPosition(P,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},_.updateLevelTiming=function(A,P,I,W){var K=this,te=I.details;console.assert(!!te,"level.details must be defined");var H=Object.keys(A.elementaryStreams).reduce(function(G,V){var re=A.elementaryStreams[V];if(re){var $=re.endPTS-re.startPTS;if($<=0)return K.warn("Could not parse fragment "+A.sn+" "+V+" duration reliably ("+$+") resetting transmuxer to fallback to playlist timing"),K.resetTransmuxer(),G||!1;var ne=W?0:Object(s.updateFragPTSDTS)(te,A,re.startPTS,re.endPTS,re.startDTS,re.endDTS);return K.hls.trigger(f.Events.LEVEL_PTS_UPDATED,{details:te,level:I,drift:ne,type:V,frag:A,start:re.startPTS,end:re.endPTS}),!0}return G},!1);H?(this.state=g.PARSED,this.hls.trigger(f.Events.FRAG_PARSED,{frag:A,part:P})):this.resetLoadingState()},_.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},m(d,[{key:"state",get:function(){return this._state},set:function(A){var P=this._state;P!==A&&(this._state=A,this.log(P+"->"+A))}}]),d}(D.default)},"./src/controller/buffer-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return l});var S=j("./src/polyfills/number.ts"),D=j("./src/events.ts"),x=j("./src/utils/logger.ts"),T=j("./src/errors.ts"),w=j("./src/utils/buffer-helper.ts"),f=j("./src/utils/mediasource-helper.ts"),p=j("./src/loader/fragment.ts"),u=j("./src/controller/buffer-operation-queue.ts"),o=Object(f.getMediaSource)(),i=/([ha]vc.)(?:\.[^.,]+)+/,l=function(){function s(r){var t=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 n=t.hls,c=t.media,m=t.mediaSource;x.logger.log("[buffer-controller]: Media source opened"),c&&(t.updateMediaElementDuration(),n.trigger(D.Events.MEDIA_ATTACHED,{media:c})),m&&m.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){x.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){x.logger.log("[buffer-controller]: Media source ended")},this.hls=r,this._initSourceBuffer(),this.registerListeners()}var h=s.prototype;return h.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},h.destroy=function(){this.unregisterListeners(),this.details=null},h.registerListeners=function(){var t=this.hls;t.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(D.Events.BUFFER_RESET,this.onBufferReset,this),t.on(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(D.Events.BUFFER_EOS,this.onBufferEos,this),t.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(D.Events.FRAG_PARSED,this.onFragParsed,this),t.on(D.Events.FRAG_CHANGED,this.onFragChanged,this)},h.unregisterListeners=function(){var t=this.hls;t.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(D.Events.BUFFER_RESET,this.onBufferReset,this),t.off(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(D.Events.BUFFER_EOS,this.onBufferEos,this),t.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(D.Events.FRAG_PARSED,this.onFragParsed,this),t.off(D.Events.FRAG_CHANGED,this.onFragChanged,this)},h._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new u.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},h.onManifestParsed=function(t,n){var c=2;(n.audio&&!n.video||!n.altAudio)&&(c=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=c,this.details=null,x.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},h.onMediaAttaching=function(t,n){var c=this.media=n.media;if(c&&o){var m=this.mediaSource=new o;m.addEventListener("sourceopen",this._onMediaSourceOpen),m.addEventListener("sourceended",this._onMediaSourceEnded),m.addEventListener("sourceclose",this._onMediaSourceClose),c.src=self.URL.createObjectURL(m),this._objectUrl=c.src}},h.onMediaDetaching=function(){var t=this.media,n=this.mediaSource,c=this._objectUrl;if(n){if(x.logger.log("[buffer-controller]: media source detaching"),n.readyState==="open")try{n.endOfStream()}catch(m){x.logger.warn("[buffer-controller]: onMediaDetaching: "+m.message+" while calling endOfStream")}this.onBufferReset(),n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(c&&self.URL.revokeObjectURL(c),t.src===c?(t.removeAttribute("src"),t.load()):x.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(D.Events.MEDIA_DETACHED,void 0)},h.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach(function(n){var c=t.sourceBuffer[n];try{c&&(t.removeBufferListeners(n),t.mediaSource&&t.mediaSource.removeSourceBuffer(c),t.sourceBuffer[n]=void 0)}catch(m){x.logger.warn("[buffer-controller]: Failed to reset the "+n+" buffer",m)}}),this._initSourceBuffer()},h.onBufferCodecs=function(t,n){var c=this,m=this.getSourceBufferTypes().length;if(Object.keys(n).forEach(function(v){if(m){var b=c.tracks[v];if(b&&typeof b.buffer.changeType=="function"){var E=n[v],g=E.codec,y=E.levelCodec,C=E.container,d=(b.levelCodec||b.codec).replace(i,"$1"),_=(y||g).replace(i,"$1");if(d!==_){var O=C+";codecs="+(y||g);c.appendChangeType(v,O)}}}else c.pendingTracks[v]=n[v]}),m)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},h.appendChangeType=function(t,n){var c=this,m=this.operationQueue,v={execute:function(){var E=c.sourceBuffer[t];E&&(x.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+n),E.changeType(n)),m.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(E){x.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",E)}};m.append(v,t)},h.onBufferAppending=function(t,n){var c=this,m=this.hls,v=this.operationQueue,b=this.tracks,E=n.data,g=n.type,y=n.frag,C=n.part,d=n.chunkMeta,_=d.buffering[g],O=self.performance.now();_.start=O;var A=y.stats.buffering,P=C?C.stats.buffering:null;A.start===0&&(A.start=O),P&&P.start===0&&(P.start=O);var I=b.audio,W=g==="audio"&&d.id===1&&(I==null?void 0:I.container)==="audio/mpeg",K={execute:function(){if(_.executeStart=self.performance.now(),W){var H=c.sourceBuffer[g];if(H){var G=y.start-H.timestampOffset;Math.abs(G)>=.1&&(x.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+G+") sn: "+y.sn+")"),H.timestampOffset=y.start)}}c.appendExecutor(E,g)},onStart:function(){},onComplete:function(){var H=self.performance.now();_.executeEnd=_.end=H,A.first===0&&(A.first=H),P&&P.first===0&&(P.first=H);var G=c.sourceBuffer,V={};for(var re in G)V[re]=w.BufferHelper.getBuffered(G[re]);c.appendError=0,c.hls.trigger(D.Events.BUFFER_APPENDED,{type:g,frag:y,part:C,chunkMeta:d,parent:y.type,timeRanges:V})},onError:function(H){x.logger.error("[buffer-controller]: Error encountered while trying to append to the "+g+" SourceBuffer",H);var G={type:T.ErrorTypes.MEDIA_ERROR,parent:y.type,details:T.ErrorDetails.BUFFER_APPEND_ERROR,err:H,fatal:!1};H.code===DOMException.QUOTA_EXCEEDED_ERR?G.details=T.ErrorDetails.BUFFER_FULL_ERROR:(c.appendError++,G.details=T.ErrorDetails.BUFFER_APPEND_ERROR,c.appendError>m.config.appendErrorMaxRetry&&(x.logger.error("[buffer-controller]: Failed "+m.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),G.fatal=!0)),m.trigger(D.Events.ERROR,G)}};v.append(K,g)},h.onBufferFlushing=function(t,n){var c=this,m=this.operationQueue,v=function(E){return{execute:c.removeExecutor.bind(c,E,n.startOffset,n.endOffset),onStart:function(){},onComplete:function(){c.hls.trigger(D.Events.BUFFER_FLUSHED,{type:E})},onError:function(y){x.logger.warn("[buffer-controller]: Failed to remove from "+E+" SourceBuffer",y)}}};n.type?m.append(v(n.type),n.type):this.getSourceBufferTypes().forEach(function(b){m.append(v(b),b)})},h.onFragParsed=function(t,n){var c=this,m=n.frag,v=n.part,b=[],E=v?v.elementaryStreams:m.elementaryStreams;E[p.ElementaryStreamTypes.AUDIOVIDEO]?b.push("audiovideo"):(E[p.ElementaryStreamTypes.AUDIO]&&b.push("audio"),E[p.ElementaryStreamTypes.VIDEO]&&b.push("video"));var g=function(){var C=self.performance.now();m.stats.buffering.end=C,v&&(v.stats.buffering.end=C);var d=v?v.stats:m.stats;c.hls.trigger(D.Events.FRAG_BUFFERED,{frag:m,part:v,stats:d,id:m.type})};b.length===0&&x.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+m.type+" level: "+m.level+" sn: "+m.sn),this.blockBuffers(g,b)},h.onFragChanged=function(t,n){this.flushBackBuffer()},h.onBufferEos=function(t,n){var c=this,m=this.getSourceBufferTypes().reduce(function(v,b){var E=c.sourceBuffer[b];return(!n.type||n.type===b)&&(E&&!E.ended&&(E.ended=!0,x.logger.log("[buffer-controller]: "+b+" sourceBuffer now EOS"))),v&&!!(!E||E.ended)},!0);m&&this.blockBuffers(function(){var v=c.mediaSource;if(!v||v.readyState!=="open")return;v.endOfStream()})},h.onLevelUpdated=function(t,n){var c=n.details;if(!c.fragments.length)return;this.details=c,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},h.flushBackBuffer=function(){var t=this.hls,n=this.details,c=this.media,m=this.sourceBuffer;if(!c||n===null)return;var v=this.getSourceBufferTypes();if(!v.length)return;var b=n.live&&t.config.liveBackBufferLength!==null?t.config.liveBackBufferLength:t.config.backBufferLength;if(!Object(S.isFiniteNumber)(b)||b<0)return;var E=c.currentTime,g=n.levelTargetDuration,y=Math.max(b,g),C=Math.floor(E/g)*g-y;v.forEach(function(d){var _=m[d];if(_){var O=w.BufferHelper.getBuffered(_);O.length>0&&C>O.start(0)&&(t.trigger(D.Events.BACK_BUFFER_REACHED,{bufferEnd:C}),n.live&&t.trigger(D.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:C}),t.trigger(D.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:C,type:d}))}})},h.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var t=this.details,n=this.hls,c=this.media,m=this.mediaSource,v=t.fragments[0].start+t.totalduration,b=c.duration,E=Object(S.isFiniteNumber)(m.duration)?m.duration:0;t.live&&n.config.liveDurationInfinity?(x.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),m.duration=Infinity,this.updateSeekableRange(t)):(v>E&&v>b||!Object(S.isFiniteNumber)(b))&&(x.logger.log("[buffer-controller]: Updating Media Source duration to "+v.toFixed(3)),m.duration=v)},h.updateSeekableRange=function(t){var n=this.mediaSource,c=t.fragments,m=c.length;if(m&&t.live&&n!==null&&n!==void 0&&n.setLiveSeekableRange){var v=Math.max(0,c[0].start),b=Math.max(v,v+t.totalduration);n.setLiveSeekableRange(v,b)}},h.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,n=this.operationQueue,c=this.pendingTracks,m=Object.keys(c).length;if(m&&!t||m===2){this.createSourceBuffers(c),this.pendingTracks={};var v=this.getSourceBufferTypes();if(v.length===0){this.hls.trigger(D.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}v.forEach(function(b){n.executeNext(b)})}},h.createSourceBuffers=function(t){var n=this.sourceBuffer,c=this.mediaSource;if(!c)throw Error("createSourceBuffers called when mediaSource was null");var m=0;for(var v in t)if(!n[v]){var b=t[v];if(!b)throw Error("source buffer exists for track "+v+", however track does not");var E=b.levelCodec||b.codec,g=b.container+";codecs="+E;x.logger.log("[buffer-controller]: creating sourceBuffer("+g+")");try{var y=n[v]=c.addSourceBuffer(g),C=v;this.addBufferListener(C,"updatestart",this._onSBUpdateStart),this.addBufferListener(C,"updateend",this._onSBUpdateEnd),this.addBufferListener(C,"error",this._onSBUpdateError),this.tracks[v]={buffer:y,codec:E,container:b.container,levelCodec:b.levelCodec,id:b.id},m++}catch(d){x.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+d.message),this.hls.trigger(D.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:d,mimeType:g})}}m&&this.hls.trigger(D.Events.BUFFER_CREATED,{tracks:this.tracks})},h._onSBUpdateStart=function(t){var n=this.operationQueue,c=n.current(t);c.onStart()},h._onSBUpdateEnd=function(t){var n=this.operationQueue,c=n.current(t);c.onComplete(),n.shiftAndExecuteNext(t)},h._onSBUpdateError=function(t,n){x.logger.error("[buffer-controller]: "+t+" SourceBuffer error",n),this.hls.trigger(D.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var c=this.operationQueue.current(t);c&&c.onError(n)},h.removeExecutor=function(t,n,c){var m=this.media,v=this.mediaSource,b=this.operationQueue,E=this.sourceBuffer,g=E[t];if(!m||!v||!g){x.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),b.shiftAndExecuteNext(t);return}var y=Object(S.isFiniteNumber)(m.duration)?m.duration:Infinity,C=Object(S.isFiniteNumber)(v.duration)?v.duration:Infinity,d=Math.max(0,n),_=Math.min(c,y,C);_>d?(x.logger.log("[buffer-controller]: Removing ["+d+","+_+"] from the "+t+" SourceBuffer"),console.assert(!g.updating,t+" sourceBuffer must not be updating"),g.remove(d,_)):b.shiftAndExecuteNext(t)},h.appendExecutor=function(t,n){var c=this.operationQueue,m=this.sourceBuffer,v=m[n];if(!v){x.logger.warn("[buffer-controller]: Attempting to append to the "+n+" SourceBuffer, but it does not exist"),c.shiftAndExecuteNext(n);return}v.ended=!1,console.assert(!v.updating,n+" sourceBuffer must not be updating"),v.appendBuffer(t)},h.blockBuffers=function(t,n){var c=this;if(n===void 0&&(n=this.getSourceBufferTypes()),!n.length){x.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(t);return}var m=this.operationQueue,v=n.map(function(b){return m.appendBlocker(b)});Promise.all(v).then(function(){t(),n.forEach(function(b){var E=c.sourceBuffer[b];(!E||!E.updating)&&m.shiftAndExecuteNext(b)})})},h.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},h.addBufferListener=function(t,n,c){var m=this.sourceBuffer[t];if(!m)return;var v=c.bind(this,t);this.listeners[t].push({event:n,listener:v}),m.addEventListener(n,v)},h.removeBufferListeners=function(t){var n=this.sourceBuffer[t];if(!n)return;this.listeners[t].forEach(function(c){n.removeEventListener(c.event,c.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return D});var S=j("./src/utils/logger.ts"),D=function(){function x(w){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=w}var T=x.prototype;return T.append=function(f,p){var u=this.queues[p];u.push(f),u.length===1&&this.buffers[p]&&this.executeNext(p)},T.insertAbort=function(f,p){var u=this.queues[p];u.unshift(f),this.executeNext(p)},T.appendBlocker=function(f){var p,u=new Promise(function(i){p=i}),o={execute:p,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(o,f),u},T.executeNext=function(f){var p=this.buffers,u=this.queues,o=p[f],i=u[f];if(i.length){var l=i[0];try{l.execute()}catch(s){S.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),l.onError(s),(!o||!o.updating)&&(i.shift(),this.executeNext(f))}}},T.shiftAndExecuteNext=function(f){this.queues[f].shift(),this.executeNext(f)},T.current=function(f){return this.queues[f][0]},x}()},"./src/controller/cap-level-controller.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/events.ts");function D(w,f){for(var p=0;p<f.length;p++){var u=f[p];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(w,u.key,u)}}function x(w,f,p){return f&&D(w.prototype,f),p&&D(w,p),w}var T=function(){function w(p){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=p,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var f=w.prototype;return f.setStreamController=function(u){this.streamController=u},f.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},f.registerListeners=function(){var u=this.hls;u.on(S.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),u.on(S.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(S.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},f.unregisterListener=function(){var u=this.hls;u.off(S.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),u.off(S.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(S.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},f.onFpsDropLevelCapping=function(u,o){w.isLevelAllowed(o.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(o.droppedLevel)},f.onMediaAttaching=function(u,o){this.media=o.media instanceof HTMLVideoElement?o.media:null},f.onManifestParsed=function(u,o){var i=this.hls;this.restrictedLevels=[],this.firstLevel=o.firstLevel,i.config.capLevelToPlayerSize&&o.video&&this.startCapping()},f.onBufferCodecs=function(u,o){var i=this.hls;i.config.capLevelToPlayerSize&&o.video&&this.startCapping()},f.onMediaDetaching=function(){this.stopCapping()},f.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var u=this.hls.levels;if(u.length){var o=this.hls;o.autoLevelCapping=this.getMaxLevel(u.length-1),o.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=o.autoLevelCapping}}},f.getMaxLevel=function(u){var o=this,i=this.hls.levels;if(!i.length)return-1;var l=i.filter(function(s,h){return w.isLevelAllowed(h,o.restrictedLevels)&&h<=u});return this.clientRect=null,w.getMaxLevelByMediaSize(l,this.mediaWidth,this.mediaHeight)},f.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()},f.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},f.getDimensions=function(){if(this.clientRect)return this.clientRect;var u=this.media,o={width:0,height:0};if(u){var i=u.getBoundingClientRect();o.width=i.width,o.height=i.height,!o.width&&!o.height&&(o.width=i.right-i.left||u.width||0,o.height=i.bottom-i.top||u.height||0)}return this.clientRect=o,o},w.isLevelAllowed=function(u,o){return o===void 0&&(o=[]),o.indexOf(u)===-1},w.getMaxLevelByMediaSize=function(u,o,i){if(!u||!u.length)return-1;for(var l=function(n,c){return c?n.width!==c.width||n.height!==c.height:!0},s=u.length-1,h=0;h<u.length;h+=1){var r=u[h];if((r.width>=o||r.height>=i)&&l(r,u[h+1])){s=h;break}}return s},x(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 u=1;try{u=self.devicePixelRatio}catch(o){}return u}}]),w}();Q.default=T},"./src/controller/cmcd-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return l});var S=j("./src/events.ts"),D=j("./src/types/cmcd.ts"),x=j("./src/utils/buffer-helper.ts"),T=j("./src/utils/logger.ts");function w(s,h){for(var r=0;r<h.length;r++){var t=h[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(s,t.key,t)}}function f(s,h,r){return h&&w(s.prototype,h),r&&w(s,r),s}function p(s,h){var r=typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(r)return(r=r.call(s)).next.bind(r);if(Array.isArray(s)||(r=u(s))||h&&s&&typeof s.length=="number"){r&&(s=r);var t=0;return function(){return t>=s.length?{done:!0}:{done:!1,value:s[t++]}}}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 u(s,h){if(!s)return;if(typeof s=="string")return o(s,h);var r=Object.prototype.toString.call(s).slice(8,-1);if(r==="Object"&&s.constructor&&(r=s.constructor.name),r==="Map"||r==="Set")return Array.from(s);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(s,h)}function o(s,h){(h==null||h>s.length)&&(h=s.length);for(var r=0,t=new Array(h);r<h;r++)t[r]=s[r];return t}function i(){return i=Object.assign||function(s){for(var h=1;h<arguments.length;h++){var r=arguments[h];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(s[t]=r[t])}return s},i.apply(this,arguments)}var l=function(){function s(r){var t=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(){t.initialized&&(t.starved=!0),t.buffering=!0},this.onPlaying=function(){t.initialized||(t.initialized=!0),t.buffering=!1},this.applyPlaylistData=function(m){try{t.apply(m,{ot:D.CMCDObjectType.MANIFEST,su:!t.initialized})}catch(v){T.logger.warn("Could not generate manifest CMCD data.",v)}},this.applyFragmentData=function(m){try{var v=m.frag,b=t.hls.levels[v.level],E=t.getObjectType(v),g={d:v.duration*1e3,ot:E};(E===D.CMCDObjectType.VIDEO||E===D.CMCDObjectType.AUDIO||E==D.CMCDObjectType.MUXED)&&(g.br=b.bitrate/1e3,g.tb=t.getTopBandwidth(E),g.bl=t.getBufferLength(E)),t.apply(m,g)}catch(y){T.logger.warn("Could not generate segment CMCD data.",y)}},this.hls=r;var n=this.config=r.config,c=n.cmcd;c!=null&&(n.pLoader=this.createPlaylistLoader(),n.fLoader=this.createFragmentLoader(),this.sid=c.sessionId||s.uuid(),this.cid=c.contentId,this.useHeaders=c.useHeaders===!0,this.registerListeners())}var h=s.prototype;return h.registerListeners=function(){var t=this.hls;t.on(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(S.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.on(S.Events.BUFFER_CREATED,this.onBufferCreated,this)},h.unregisterListeners=function(){var t=this.hls;t.off(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(S.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.off(S.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},h.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},h.onMediaAttached=function(t,n){this.media=n.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},h.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},h.onBufferCreated=function(t,n){var c,m;this.audioBuffer=(c=n.tracks.audio)===null||c===void 0?void 0:c.buffer,this.videoBuffer=(m=n.tracks.video)===null||m===void 0?void 0:m.buffer},h.createData=function(){var t;return{v:D.CMCDVersion,sf:D.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(t=this.media)===null||t===void 0?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},h.apply=function(t,n){n===void 0&&(n={}),i(n,this.createData());var c=n.ot===D.CMCDObjectType.INIT||n.ot===D.CMCDObjectType.VIDEO||n.ot===D.CMCDObjectType.MUXED;if(this.starved&&c&&(n.bs=!0,n.su=!0,this.starved=!1),n.su==null&&(n.su=this.buffering),this.useHeaders){var m=s.toHeaders(n);if(!Object.keys(m).length)return;t.headers||(t.headers={}),i(t.headers,m)}else{var v=s.toQuery(n);if(!v)return;t.url=s.appendQueryToUri(t.url,v)}},h.getObjectType=function(t){var n=t.type;return n==="subtitle"?D.CMCDObjectType.TIMED_TEXT:t.sn==="initSegment"?D.CMCDObjectType.INIT:n==="audio"?D.CMCDObjectType.AUDIO:n==="main"?this.hls.audioTracks.length?D.CMCDObjectType.VIDEO:D.CMCDObjectType.MUXED:void 0},h.getTopBandwidth=function(t){for(var n=0,c=t===D.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,m=p(c),v;!(v=m()).done;){var b=v.value;b.bitrate>n&&(n=b.bitrate)}return n>0?n:NaN},h.getBufferLength=function(t){var n=this.hls.media,c=t===D.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!c||!n)return NaN;var m=x.BufferHelper.bufferInfo(c,n.currentTime,this.config.maxBufferHole);return m.len*1e3},h.createPlaylistLoader=function(){var t=this.config.pLoader,n=this.applyPlaylistData,c=t||this.config.loader;return function(){function m(b){this.loader=void 0,this.loader=new c(b)}var v=m.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(E,g,y){n(E),this.loader.load(E,g,y)},f(m,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),m}()},h.createFragmentLoader=function(){var t=this.config.fLoader,n=this.applyFragmentData,c=t||this.config.loader;return function(){function m(b){this.loader=void 0,this.loader=new c(b)}var v=m.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(E,g,y){n(E),this.loader.load(E,g,y)},f(m,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),m}()},s.uuid=function(){var t=URL.createObjectURL(new Blob),n=t.toString();return URL.revokeObjectURL(t),n.substr(n.lastIndexOf("/")+1)},s.serialize=function(t){for(var n=[],c=function(W){return!Number.isNaN(W)&&W!=null&&W!==""&&W!==!1},m=function(W){return Math.round(W)},v=function(W){return m(W/100)*100},b=function(W){return encodeURIComponent(W)},E={br:m,d:m,bl:v,dl:v,mtp:v,nor:b,rtp:v,tb:m},g=Object.keys(t||{}).sort(),y=p(g),C;!(C=y()).done;){var d=C.value,_=t[d];if(!c(_))continue;if(d==="v"&&_===1)continue;if(d=="pr"&&_===1)continue;var O=E[d];O&&(_=O(_));var A=typeof _,P=void 0;d==="ot"||d==="sf"||d==="st"?P=d+"="+_:A==="boolean"?P=d:A==="number"?P=d+"="+_:P=d+"="+JSON.stringify(_),n.push(P)}return n.join(",")},s.toHeaders=function(t){for(var n=Object.keys(t),c={},m=["Object","Request","Session","Status"],v=[{},{},{},{}],b={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},E=0,g=n;E<g.length;E++){var y=g[E],C=b[y]!=null?b[y]:1;v[C][y]=t[y]}for(var d=0;d<v.length;d++){var _=s.serialize(v[d]);_&&(c["CMCD-"+m[d]]=_)}return c},s.toQuery=function(t){return"CMCD="+encodeURIComponent(s.serialize(t))},s.appendQueryToUri=function(t,n){if(!n)return t;var c=t.includes("?")?"&":"?";return""+t+c+n},s}()},"./src/controller/eme-controller.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/events.ts"),D=j("./src/errors.ts"),x=j("./src/utils/logger.ts"),T=j("./src/utils/mediakeys-helper.ts");function w(l,s){for(var h=0;h<s.length;h++){var r=s[h];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(l,r.key,r)}}function f(l,s,h){return s&&w(l.prototype,s),h&&w(l,h),l}var p=3,u=function(s,h,r){var t={audioCapabilities:[],videoCapabilities:[]};return s.forEach(function(n){t.audioCapabilities.push({contentType:'audio/mp4; codecs="'+n+'"',robustness:r.audioRobustness||""})}),h.forEach(function(n){t.videoCapabilities.push({contentType:'video/mp4; codecs="'+n+'"',robustness:r.videoRobustness||""})}),[t]},o=function(s,h,r,t){switch(s){case T.KeySystems.WIDEVINE:return u(h,r,t);default:throw new Error("Unknown key-system: "+s)}},i=function(){function l(h){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=h,this._config=h.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 s=l.prototype;return s.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},s._registerListeners=function(){this.hls.on(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(S.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(S.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s._unregisterListeners=function(){this.hls.off(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(S.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(S.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s.getLicenseServerUrl=function(r){switch(r){case T.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+r+'"')},s._attemptKeySystemAccess=function(r,t,n){var c=this,m=o(r,t,n,this._drmSystemOptions);x.logger.log("Requesting encrypted media key-system access");var v=this.requestMediaKeySystemAccess(r,m);this.mediaKeysPromise=v.then(function(b){return c._onMediaKeySystemAccessObtained(r,b)}),v.catch(function(b){x.logger.error('Failed to obtain key-system "'+r+'" access:',b)})},s._onMediaKeySystemAccessObtained=function(r,t){var n=this;x.logger.log('Access for key-system "'+r+'" obtained');var c={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:r};this._mediaKeysList.push(c);var m=Promise.resolve().then(function(){return t.createMediaKeys()}).then(function(v){return c.mediaKeys=v,x.logger.log('Media-keys created for key-system "'+r+'"'),n._onMediaKeysCreated(),v});return m.catch(function(v){x.logger.error("Failed to create media-keys:",v)}),m},s._onMediaKeysCreated=function(){var r=this;this._mediaKeysList.forEach(function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),r._onNewMediaKeySession(t.mediaKeysSession))})},s._onNewMediaKeySession=function(r){var t=this;x.logger.log("New key-system session "+r.sessionId),r.addEventListener("message",function(n){t._onKeySessionMessage(r,n.message)},!1)},s._onKeySessionMessage=function(r,t){x.logger.log("Got EME message event, creating license request"),this._requestLicense(t,function(n){x.logger.log("Received license data (length: "+(n&&n.byteLength)+"), updating key-session"),r.update(n)})},s.onMediaEncrypted=function(r){var t=this;if(x.logger.log('Media is encrypted using "'+r.initDataType+'" init data type'),!this.mediaKeysPromise){x.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var n=function(m){if(!t._media)return;t._attemptSetMediaKeys(m),t._generateRequestWithPreferredKeySession(r.initDataType,r.initData)};this.mediaKeysPromise.then(n).catch(n)},s._attemptSetMediaKeys=function(r){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var t=this._mediaKeysList[0];if(!t||!t.mediaKeys){x.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}x.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},s._generateRequestWithPreferredKeySession=function(r,t){var n=this,c=this._mediaKeysList[0];if(!c){x.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(c.mediaKeysSessionInitialized){x.logger.warn("Key-Session already initialized but requested again");return}var m=c.mediaKeysSession;if(!m){x.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!t){x.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}x.logger.log('Generating key-session request for "'+r+'" init data type'),c.mediaKeysSessionInitialized=!0,m.generateRequest(r,t).then(function(){x.logger.debug("Key-session generation succeeded")}).catch(function(v){x.logger.error("Error generating key-session request:",v),n.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},s._createLicenseXhr=function(r,t,n){var c=new XMLHttpRequest;c.responseType="arraybuffer",c.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,c,r,t,n);var m=this._licenseXhrSetup;if(m)try{m.call(this.hls,c,r),m=void 0}catch(v){x.logger.error(v)}try{c.readyState||c.open("POST",r,!0),m&&m.call(this.hls,c,r)}catch(v){throw new Error("issue setting up KeySystem license XHR "+v)}return c},s._onLicenseRequestReadyStageChange=function(r,t,n,c){switch(r.readyState){case 4:if(r.status===200){this._requestLicenseFailureCount=0,x.logger.log("License request succeeded");var m=r.response,v=this._licenseResponseCallback;if(v)try{m=v.call(this.hls,r,t)}catch(E){x.logger.error(E)}c(m)}else{if(x.logger.error("License Request XHR failed ("+t+"). Status: "+r.status+" ("+r.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>p){this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var b=p-this._requestLicenseFailureCount+1;x.logger.warn("Retrying license request, "+b+" attempts left"),this._requestLicense(n,c)}break}},s._generateLicenseRequestChallenge=function(r,t){switch(r.mediaKeySystemDomain){case T.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+r.mediaKeySystemDomain)},s._requestLicense=function(r,t){x.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n){x.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var c=this.getLicenseServerUrl(n.mediaKeySystemDomain),m=this._createLicenseXhr(c,r,t);x.logger.log("Sending license request to URL: "+c);var v=this._generateLicenseRequestChallenge(n,r);m.send(v)}catch(b){x.logger.error("Failure requesting DRM license: "+b),this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(r,t){if(!this._emeEnabled)return;var n=t.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var r=this._media,t=this._mediaKeysList;if(!r)return;r.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(t.map(function(n){if(n.mediaKeysSession)return n.mediaKeysSession.close().catch(function(){})})).then(function(){return r.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(r,t){if(!this._emeEnabled)return;var n=t.levels.map(function(m){return m.audioCodec}).filter(function(m){return!!m}),c=t.levels.map(function(m){return m.videoCodec}).filter(function(m){return!!m});this._attemptKeySystemAccess(T.KeySystems.WIDEVINE,n,c)},f(l,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),l}();Q.default=i},"./src/controller/fps-controller.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/events.ts"),D=j("./src/utils/logger.ts"),x=function(){function T(f){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=f,this.registerListeners()}var w=T.prototype;return w.setStreamController=function(p){this.streamController=p},w.registerListeners=function(){this.hls.on(S.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},w.unregisterListeners=function(){this.hls.off(S.Events.MEDIA_ATTACHING,this.onMediaAttaching)},w.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},w.onMediaAttaching=function(p,u){var o=this.hls.config;if(o.capLevelOnFPSDrop){var i=u.media instanceof self.HTMLVideoElement?u.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),o.fpsDroppedMonitoringPeriod)}},w.checkFPS=function(p,u,o){var i=performance.now();if(u){if(this.lastTime){var l=i-this.lastTime,s=o-this.lastDroppedFrames,h=u-this.lastDecodedFrames,r=1e3*s/l,t=this.hls;if(t.trigger(S.Events.FPS_DROP,{currentDropped:s,currentDecoded:h,totalDroppedFrames:o}),r>0&&s>t.config.fpsDroppedMonitoringThreshold*h){var n=t.currentLevel;D.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+n),n>0&&(t.autoLevelCapping===-1||t.autoLevelCapping>=n)&&(n=n-1,t.trigger(S.Events.FPS_DROP_LEVEL_CAPPING,{level:n,droppedLevel:t.currentLevel}),t.autoLevelCapping=n,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=o,this.lastDecodedFrames=u}},w.checkFPSInterval=function(){var p=this.media;if(p)if(this.isVideoPlaybackQualityAvailable){var u=p.getVideoPlaybackQuality();this.checkFPS(p,u.totalVideoFrames,u.droppedVideoFrames)}else this.checkFPS(p,p.webkitDecodedFrameCount,p.webkitDroppedFrameCount)},T}();Q.default=x},"./src/controller/fragment-finders.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"findFragmentByPDT",function(){return x}),j.d(Q,"findFragmentByPTS",function(){return T}),j.d(Q,"fragmentWithinToleranceTest",function(){return w}),j.d(Q,"pdtWithinToleranceTest",function(){return f}),j.d(Q,"findFragWithCC",function(){return p});var S=j("./src/polyfills/number.ts"),D=j("./src/utils/binary-search.ts");function x(u,o,i){if(o===null||!Array.isArray(u)||!u.length||!Object(S.isFiniteNumber)(o))return null;var l=u[0].programDateTime;if(o<(l||0))return null;var s=u[u.length-1].endProgramDateTime;if(o>=(s||0))return null;i=i||0;for(var h=0;h<u.length;++h){var r=u[h];if(f(o,i,r))return r}return null}function T(u,o,i,l){i===void 0&&(i=0),l===void 0&&(l=0);var s=null;if(u?s=o[u.sn-o[0].sn+1]||null:i===0&&o[0].start===0&&(s=o[0]),s&&w(i,l,s)===0)return s;var h=D.default.search(o,w.bind(null,i,l));return h||s}function w(u,o,i){u===void 0&&(u=0),o===void 0&&(o=0);var l=Math.min(o,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-l<=u?1:i.start-l>u&&i.start?-1:0}function f(u,o,i){var l=Math.min(o,i.duration+(i.deltaPTS?i.deltaPTS:0))*1e3,s=i.endProgramDateTime||0;return s-l>u}function p(u,o){return D.default.search(u,function(i){return i.cc<o?1:i.cc>o?-1:0})}},"./src/controller/fragment-tracker.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"FragmentState",function(){return x}),j.d(Q,"FragmentTracker",function(){return T});var S=j("./src/events.ts"),D=j("./src/types/loader.ts"),x;(function(p){p.NOT_LOADED="NOT_LOADED",p.BACKTRACKED="BACKTRACKED",p.APPENDING="APPENDING",p.PARTIAL="PARTIAL",p.OK="OK"})(x||(x={}));var T=function(){function p(o){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=o,this._registerListeners()}var u=p.prototype;return u._registerListeners=function(){var i=this.hls;i.on(S.Events.BUFFER_APPENDED,this.onBufferAppended,this),i.on(S.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(S.Events.FRAG_LOADED,this.onFragLoaded,this)},u._unregisterListeners=function(){var i=this.hls;i.off(S.Events.BUFFER_APPENDED,this.onBufferAppended,this),i.off(S.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(S.Events.FRAG_LOADED,this.onFragLoaded,this)},u.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},u.getAppendedFrag=function(i,l){if(l===D.PlaylistLevelType.MAIN){var s=this.activeFragment,h=this.activeParts;if(!s)return null;if(h)for(var r=h.length;r--;){var t=h[r],n=t?t.end:s.appendedPTS;if(t.start<=i&&n!==void 0&&i<=n)return r>9&&(this.activeParts=h.slice(r-9)),t}else if(s.start<=i&&s.appendedPTS!==void 0&&i<=s.appendedPTS)return s}return this.getBufferedFrag(i,l)},u.getBufferedFrag=function(i,l){for(var s=this.fragments,h=Object.keys(s),r=h.length;r--;){var t=s[h[r]];if((t==null?void 0:t.body.type)===l&&t.buffered){var n=t.body;if(n.start<=i&&i<=n.end)return n}}return null},u.detectEvictedFragments=function(i,l,s){var h=this;Object.keys(this.fragments).forEach(function(r){var t=h.fragments[r];if(!t)return;if(!t.buffered){t.body.type===s&&h.removeFragment(t.body);return}var n=t.range[i];if(!n)return;n.time.some(function(c){var m=!h.isTimeBuffered(c.startPTS,c.endPTS,l);return m&&h.removeFragment(t.body),m})})},u.detectPartialFragments=function(i){var l=this,s=this.timeRanges,h=i.frag,r=i.part;if(!s||h.sn==="initSegment")return;var t=f(h),n=this.fragments[t];if(!n)return;Object.keys(s).forEach(function(c){var m=h.elementaryStreams[c];if(!m)return;var v=s[c],b=r!==null||m.partial===!0;n.range[c]=l.getBufferedTimes(h,r,b,v)}),n.backtrack=n.loaded=null,Object.keys(n.range).length?n.buffered=!0:this.removeFragment(n.body)},u.fragBuffered=function(i){var l=f(i),s=this.fragments[l];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},u.getBufferedTimes=function(i,l,s,h){for(var r={time:[],partial:s},t=l?l.start:i.start,n=l?l.end:i.end,c=i.minEndPTS||n,m=i.maxStartPTS||t,v=0;v<h.length;v++){var b=h.start(v)-this.bufferPadding,E=h.end(v)+this.bufferPadding;if(m>=b&&c<=E){r.time.push({startPTS:Math.max(t,h.start(v)),endPTS:Math.min(n,h.end(v))});break}else if(t<E&&n>b)r.partial=!0,r.time.push({startPTS:Math.max(t,h.start(v)),endPTS:Math.min(n,h.end(v))});else if(n<=b)break}return r},u.getPartialFragment=function(i){var l=null,s,h,r,t=0,n=this.bufferPadding,c=this.fragments;return Object.keys(c).forEach(function(m){var v=c[m];if(!v)return;w(v)&&(h=v.body.start-n,r=v.body.end+n,i>=h&&i<=r&&(s=Math.min(i-h,r-i),t<=s&&(l=v.body,t=s)))}),l},u.getState=function(i){var l=f(i),s=this.fragments[l];return s?s.buffered?w(s)?x.PARTIAL:x.OK:s.backtrack?x.BACKTRACKED:x.APPENDING:x.NOT_LOADED},u.backtrack=function(i,l){var s=f(i),h=this.fragments[s];if(!h||h.backtrack)return null;var r=h.backtrack=l||h.loaded;return h.loaded=null,r},u.getBacktrackData=function(i){var l=f(i),s=this.fragments[l];if(s){var h,r=s.backtrack;if(r!=null&&(h=r.payload)!==null&&h!==void 0&&h.byteLength)return r;this.removeFragment(i)}return null},u.isTimeBuffered=function(i,l,s){for(var h,r,t=0;t<s.length;t++){if(h=s.start(t)-this.bufferPadding,r=s.end(t)+this.bufferPadding,i>=h&&l<=r)return!0;if(l<=h)return!1}return!1},u.onFragLoaded=function(i,l){var s=l.frag,h=l.part;if(s.sn==="initSegment"||s.bitrateTest||h)return;var r=f(s);this.fragments[r]={body:s,loaded:l,backtrack:null,buffered:!1,range:Object.create(null)}},u.onBufferAppended=function(i,l){var s=this,h=l.frag,r=l.part,t=l.timeRanges;if(h.type===D.PlaylistLevelType.MAIN)if(this.activeFragment=h,r){var n=this.activeParts;n||(this.activeParts=n=[]),n.push(r)}else this.activeParts=null;this.timeRanges=t,Object.keys(t).forEach(function(c){var m=t[c];if(s.detectEvictedFragments(c,m),!r)for(var v=0;v<m.length;v++)h.appendedPTS=Math.max(m.end(v),h.appendedPTS||0)})},u.onFragBuffered=function(i,l){this.detectPartialFragments(l)},u.hasFragment=function(i){var l=f(i);return!!this.fragments[l]},u.removeFragmentsInRange=function(i,l,s){var h=this;Object.keys(this.fragments).forEach(function(r){var t=h.fragments[r];if(!t)return;if(t.buffered){var n=t.body;n.type===s&&n.start<l&&n.end>i&&h.removeFragment(n)}})},u.removeFragment=function(i){var l=f(i);i.stats.loaded=0,i.clearElementaryStreamInfo(),delete this.fragments[l]},u.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},p}();function w(p){var u,o;return p.buffered&&(((u=p.range.video)===null||u===void 0?void 0:u.partial)||((o=p.range.audio)===null||o===void 0?void 0:o.partial))}function f(p){return p.type+"_"+p.level+"_"+p.urlId+"_"+p.sn}},"./src/controller/gap-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"STALL_MINIMUM_DURATION_MS",function(){return w}),j.d(Q,"MAX_START_GAP_JUMP",function(){return f}),j.d(Q,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return p}),j.d(Q,"SKIP_BUFFER_RANGE_START",function(){return u}),j.d(Q,"default",function(){return o});var S=j("./src/utils/buffer-helper.ts"),D=j("./src/errors.ts"),x=j("./src/events.ts"),T=j("./src/utils/logger.ts"),w=250,f=2,p=.1,u=.05,o=function(){function i(s,h,r,t){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=s,this.media=h,this.fragmentTracker=r,this.hls=t}var l=i.prototype;return l.destroy=function(){this.hls=this.fragmentTracker=this.media=null},l.poll=function(h){var r=this.config,t=this.media,n=this.stalled,c=t.currentTime,m=t.seeking,v=this.seeking&&!m,b=!this.seeking&&m;if(this.seeking=m,c!==h){if(this.moved=!0,n!==null){if(this.stallReported){var E=self.performance.now()-n;T.logger.warn("playback not stuck anymore @"+c+", after "+Math.round(E)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((b||v)&&(this.stalled=null),t.paused||t.ended||t.playbackRate===0||!S.BufferHelper.getBuffered(t).length)return;var g=S.BufferHelper.bufferInfo(t,c,0),y=g.len>0,C=g.nextStart||0;if(!y&&!C)return;if(m){var d=g.len>f,_=!C||C-c>f&&!this.fragmentTracker.getPartialFragment(c);if(d||_)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var O,A=Math.max(C,g.start||0)-c,P=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=P==null||((O=P.details)===null||O===void 0)?void 0:O.live,W=I?P.details.targetduration*2:f;if(A>0&&A<=W){this._trySkipBufferHole(null);return}}var K=self.performance.now();if(n===null){this.stalled=K;return}var te=K-n;!m&&te>=w&&this._reportStall(g.len);var H=S.BufferHelper.bufferInfo(t,c,r.maxBufferHole);this._tryFixBufferStall(H,te)},l._tryFixBufferStall=function(h,r){var t=this.config,n=this.fragmentTracker,c=this.media,m=c.currentTime,v=n.getPartialFragment(m);if(v){var b=this._trySkipBufferHole(v);if(b)return}h.len>t.maxBufferHole&&r>t.highBufferWatchdogPeriod*1e3&&(T.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},l._reportStall=function(h){var r=this.hls,t=this.media,n=this.stallReported;n||(this.stallReported=!0,T.logger.warn("Playback stalling at @"+t.currentTime+" due to low buffer (buffer="+h+")"),r.trigger(x.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h}))},l._trySkipBufferHole=function(h){for(var r=this.config,t=this.hls,n=this.media,c=n.currentTime,m=0,v=S.BufferHelper.getBuffered(n),b=0;b<v.length;b++){var E=v.start(b);if(c+r.maxBufferHole>=m&&c<E){var g=Math.max(E+u,n.currentTime+p);return T.logger.warn("skipping hole, adjusting currentTime from "+c+" to "+g),this.moved=!0,this.stalled=null,n.currentTime=g,h&&t.trigger(x.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+c+" to "+g,frag:h}),g}m=v.end(b)}return 0},l._tryNudgeBuffer=function(){var h=this.config,r=this.hls,t=this.media,n=t.currentTime,c=(this.nudgeRetry||0)+1;if(this.nudgeRetry=c,c<h.nudgeMaxRetry){var m=n+c*h.nudgeOffset;T.logger.warn("Nudging 'currentTime' from "+n+" to "+m),t.currentTime=m,r.trigger(x.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else T.logger.error("Playhead still not moving while enough data buffered @"+n+" after "+h.nudgeMaxRetry+" nudges"),r.trigger(x.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},i}()},"./src/controller/id3-track-controller.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/events.ts"),D=j("./src/utils/texttrack-utils.ts"),x=j("./src/demux/id3.ts"),T=.25,w=function(){function f(u){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=u,this._registerListeners()}var p=f.prototype;return p.destroy=function(){this._unregisterListeners()},p._registerListeners=function(){var o=this.hls;o.on(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(S.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),o.on(S.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p._unregisterListeners=function(){var o=this.hls;o.off(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(S.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),o.off(S.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p.onMediaAttached=function(o,i){this.media=i.media},p.onMediaDetaching=function(){if(!this.id3Track)return;Object(D.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},p.getID3Track=function(o){if(!this.media)return;for(var i=0;i<o.length;i++){var l=o[i];if(l.kind==="metadata"&&l.label==="id3")return Object(D.sendAddTrackEvent)(l,this.media),l}return this.media.addTextTrack("metadata","id3")},p.onFragParsingMetadata=function(o,i){if(!this.media)return;var l=i.frag,s=i.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var h=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,r=0;r<s.length;r++){var t=x.getID3Frames(s[r].data);if(t){var n=s[r].pts,c=r<s.length-1?s[r+1].pts:l.end,m=c-n;m<=0&&(c=n+T);for(var v=0;v<t.length;v++){var b=t[v];if(!x.isTimeStampFrame(b)){var E=new h(n,c,"");E.value=b,this.id3Track.addCue(E)}}}}},p.onBufferFlushing=function(o,i){var l=i.startOffset,s=i.endOffset,h=i.type;if(!h||h==="audio"){var r=this.id3Track;r&&Object(D.removeCuesInRange)(r,l,s)}},f}();Q.default=w},"./src/controller/latency-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return f});var S=j("./src/errors.ts"),D=j("./src/events.ts"),x=j("./src/utils/logger.ts");function T(p,u){for(var o=0;o<u.length;o++){var i=u[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(p,i.key,i)}}function w(p,u,o){return u&&T(p.prototype,u),o&&T(p,o),p}var f=function(){function p(o){var i=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 i.timeupdate()},this.hls=o,this.config=o.config,this.registerListeners()}var u=p.prototype;return u.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},u.registerListeners=function(){this.hls.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(D.Events.ERROR,this.onError,this)},u.unregisterListeners=function(){this.hls.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(D.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(D.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(D.Events.ERROR,this.onError)},u.onMediaAttached=function(i,l){this.media=l.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},u.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},u.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},u.onLevelUpdated=function(i,l){var s=l.details;this.levelDetails=s,s.advanced&&this.timeupdate(),!s.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},u.onError=function(i,l){if(l.details!==S.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,x.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},u.timeupdate=function(){var i=this.media,l=this.levelDetails;if(!i||!l)return;this.currentTime=i.currentTime;var s=this.computeLatency();if(s===null)return;this._latency=s;var h=this.config,r=h.lowLatencyMode,t=h.maxLiveSyncPlaybackRate;if(!r||t===1)return;var n=this.targetLatency;if(n===null)return;var c=s-n,m=Math.min(this.maxLatency,n+l.targetduration),v=c<m;if(l.live&&v&&c>.05&&this.forwardBufferLength>1){var b=Math.min(2,Math.max(1,t)),E=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20;i.playbackRate=Math.min(b,Math.max(1,E))}else i.playbackRate!==1&&i.playbackRate!==0&&(i.playbackRate=1)},u.estimateLiveEdge=function(){var i=this.levelDetails;return i===null?null:i.edge+i.age},u.computeLatency=function(){var i=this.estimateLiveEdge();return i===null?null:i-this.currentTime},w(p,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var i=this.config,l=this.levelDetails;return i.liveMaxLatencyDuration!==void 0?i.liveMaxLatencyDuration:l?i.liveMaxLatencyDurationCount*l.targetduration:0}},{key:"targetLatency",get:function(){var i=this.levelDetails;if(i===null)return null;var l=i.holdBack,s=i.partHoldBack,h=i.targetduration,r=this.config,t=r.liveSyncDuration,n=r.liveSyncDurationCount,c=r.lowLatencyMode,m=this.hls.userConfig,v=c&&s||l;(m.liveSyncDuration||m.liveSyncDurationCount||v===0)&&(v=t!==void 0?t:n*h);var b=h,E=1;return v+Math.min(this.stallCount*E,b)}},{key:"liveSyncPosition",get:function(){var i=this.estimateLiveEdge(),l=this.targetLatency,s=this.levelDetails;if(i===null||l===null||s===null)return null;var h=s.edge,r=i-l-this.edgeStalled,t=h-s.totalduration,n=h-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(t,r),n)}},{key:"drift",get:function(){var i=this.levelDetails;return i===null?1:i.drift}},{key:"edgeStalled",get:function(){var i=this.levelDetails;if(i===null)return 0;var l=(this.config.lowLatencyMode&&i.partTarget||i.targetduration)*3;return Math.max(i.age-l,0)}},{key:"forwardBufferLength",get:function(){var i=this.media,l=this.levelDetails;if(!i||!l)return 0;var s=i.buffered.length;return s?i.buffered.end(s-1):l.edge-this.currentTime}}]),p}()},"./src/controller/level-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return r});var S=j("./src/types/level.ts"),D=j("./src/events.ts"),x=j("./src/errors.ts"),T=j("./src/utils/codecs.ts"),w=j("./src/controller/level-helper.ts"),f=j("./src/controller/base-playlist-controller.ts"),p=j("./src/types/loader.ts");function u(){return u=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var c=arguments[n];for(var m in c)Object.prototype.hasOwnProperty.call(c,m)&&(t[m]=c[m])}return t},u.apply(this,arguments)}function o(t,n){for(var c=0;c<n.length;c++){var m=n[c];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(t,m.key,m)}}function i(t,n,c){return n&&o(t.prototype,n),c&&o(t,c),t}function l(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n)}function s(t,n){return s=Object.setPrototypeOf||function(m,v){return m.__proto__=v,m},s(t,n)}var h=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),r=function(t){l(n,t);function n(m){var v;return v=t.call(this,m,"[level-controller]")||this,v._levels=[],v._firstLevel=-1,v._startLevel=void 0,v.currentLevelIndex=-1,v.manualLevelIndex=-1,v.onParsedComplete=void 0,v._registerListeners(),v}var c=n.prototype;return c._registerListeners=function(){var v=this.hls;v.on(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),v.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),v.on(D.Events.ERROR,this.onError,this)},c._unregisterListeners=function(){var v=this.hls;v.off(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),v.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),v.off(D.Events.ERROR,this.onError,this)},c.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},c.startLoad=function(){var v=this._levels;v.forEach(function(b){b.loadError=0}),t.prototype.startLoad.call(this)},c.onManifestLoaded=function(v,b){var E=[],g=[],y=[],C,d={},_,O=!1,A=!1,P=!1;if(b.levels.forEach(function(te){var H=te.attrs;O=O||!!(te.width&&te.height),A=A||!!te.videoCodec,P=P||!!te.audioCodec,h&&te.audioCodec&&te.audioCodec.indexOf("mp4a.40.34")!==-1&&(te.audioCodec=void 0);var G=te.bitrate+"-"+te.attrs.RESOLUTION+"-"+te.attrs.CODECS;_=d[G],_?_.url.push(te.url):(_=new S.Level(te),d[G]=_,E.push(_)),H&&(H.AUDIO&&Object(w.addGroupId)(_,"audio",H.AUDIO),H.SUBTITLES&&Object(w.addGroupId)(_,"text",H.SUBTITLES))}),(O||A)&&P&&(E=E.filter(function(te){var H=te.videoCodec,G=te.width,V=te.height;return!!H||!!(G&&V)})),E=E.filter(function(te){var H=te.audioCodec,G=te.videoCodec;return(!H||Object(T.isCodecSupportedInMp4)(H,"audio"))&&(!G||Object(T.isCodecSupportedInMp4)(G,"video"))}),b.audioTracks&&(g=b.audioTracks.filter(function(te){return!te.audioCodec||Object(T.isCodecSupportedInMp4)(te.audioCodec,"audio")}),Object(w.assignTrackIdsByGroup)(g)),b.subtitles&&(y=b.subtitles,Object(w.assignTrackIdsByGroup)(y)),E.length>0){C=E[0].bitrate,E.sort(function(te,H){return te.bitrate-H.bitrate}),this._levels=E;for(var I=0;I<E.length;I++)if(E[I].bitrate===C){this._firstLevel=I,this.log("manifest loaded, "+E.length+" level(s) found, first bitrate: "+C);break}var W=P&&!A,K={levels:E,audioTracks:g,subtitleTracks:y,firstLevel:this._firstLevel,stats:b.stats,audio:P,video:A,altAudio:!W&&g.some(function(te){return!!te.url})};this.hls.trigger(D.Events.MANIFEST_PARSED,K),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(D.Events.ERROR,{type:x.ErrorTypes.MEDIA_ERROR,details:x.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:b.url,reason:"no level with compatible codecs found in manifest"})},c.onError=function(v,b){if(t.prototype.onError.call(this,v,b),b.fatal)return;var E=b.context,g=this._levels[this.currentLevelIndex];if(E&&(E.type===p.PlaylistContextType.AUDIO_TRACK&&g.audioGroupIds&&E.groupId===g.audioGroupIds[g.urlId]||E.type===p.PlaylistContextType.SUBTITLE_TRACK&&g.textGroupIds&&E.groupId===g.textGroupIds[g.urlId])){this.redundantFailover(this.currentLevelIndex);return}var y=!1,C=!0,d;switch(b.details){case x.ErrorDetails.FRAG_LOAD_ERROR:case x.ErrorDetails.FRAG_LOAD_TIMEOUT:case x.ErrorDetails.KEY_LOAD_ERROR:case x.ErrorDetails.KEY_LOAD_TIMEOUT:if(b.frag){var _=this._levels[b.frag.level];_?(_.fragmentError++,_.fragmentError>this.hls.config.fragLoadingMaxRetry&&(d=b.frag.level)):d=b.frag.level}break;case x.ErrorDetails.LEVEL_LOAD_ERROR:case x.ErrorDetails.LEVEL_LOAD_TIMEOUT:E&&(E.deliveryDirectives&&(C=!1),d=E.level),y=!0;break;case x.ErrorDetails.REMUX_ALLOC_ERROR:d=b.level,y=!0;break}d!==void 0&&this.recoverLevel(b,d,y,C)},c.recoverLevel=function(v,b,E,g){var y=v.details,C=this._levels[b];if(C.loadError++,E){var d=this.retryLoadingOrFail(v);if(d)v.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(g){var _=C.url.length;if(_>1&&C.loadError<_)v.levelRetry=!0,this.redundantFailover(b);else if(this.manualLevelIndex===-1){var O=b===0?this._levels.length-1:b-1;this.currentLevelIndex!==O&&this._levels[O].loadError===0&&(this.warn(y+": switch to "+O),v.levelRetry=!0,this.hls.nextAutoLevel=O)}}},c.redundantFailover=function(v){var b=this._levels[v],E=b.url.length;if(E>1){var g=(b.urlId+1)%E;this.warn("Switching to redundant URL-id "+g),this._levels.forEach(function(y){y.urlId=g}),this.level=v}},c.onFragLoaded=function(v,b){var E=b.frag;if(E!==void 0&&E.type===p.PlaylistLevelType.MAIN){var g=this._levels[E.level];g!==void 0&&(g.fragmentError=0,g.loadError=0)}},c.onLevelLoaded=function(v,b){var E,g=b.level,y=b.details,C=this._levels[g];if(!C){var d;this.warn("Invalid level index "+g),(d=b.deliveryDirectives)!==null&&d!==void 0&&d.skip&&(y.deltaUpdateFailed=!0);return}g===this.currentLevelIndex?(C.fragmentError===0&&(C.loadError=0,this.retryCount=0),this.playlistLoaded(g,b,C.details)):(E=b.deliveryDirectives)!==null&&E!==void 0&&E.skip&&(y.deltaUpdateFailed=!0)},c.onAudioTrackSwitched=function(v,b){var E=this.hls.levels[this.currentLevelIndex];if(!E)return;if(E.audioGroupIds){for(var g=-1,y=this.hls.audioTracks[b.id].groupId,C=0;C<E.audioGroupIds.length;C++)if(E.audioGroupIds[C]===y){g=C;break}g!==E.urlId&&(E.urlId=g,this.startLoad())}},c.loadPlaylist=function(v){var b=this.currentLevelIndex,E=this._levels[b];if(this.canLoad&&E&&E.url.length>0){var g=E.urlId,y=E.url[g];if(v)try{y=v.addDirectives(y)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Attempt loading level index "+b+(v?" at sn "+v.msn+" part "+v.part:"")+" with URL-id "+g+" "+y),this.clearTimer(),this.hls.trigger(D.Events.LEVEL_LOADING,{url:y,level:b,id:g,deliveryDirectives:v||null})}},c.removeLevel=function(v,b){var E=function(C,d){return d!==b},g=this._levels.filter(function(y,C){return C!==v?!0:y.url.length>1&&b!==void 0?(y.url=y.url.filter(E),y.audioGroupIds&&(y.audioGroupIds=y.audioGroupIds.filter(E)),y.textGroupIds&&(y.textGroupIds=y.textGroupIds.filter(E)),y.urlId=0,!0):!1}).map(function(y,C){var d=y.details;return d!=null&&d.fragments&&d.fragments.forEach(function(_){_.level=C}),y});this._levels=g,this.hls.trigger(D.Events.LEVELS_UPDATED,{levels:g})},i(n,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(v){var b,E=this._levels;if(E.length===0)return;if(this.currentLevelIndex===v&&(b=E[v])!==null&&b!==void 0&&b.details)return;if(v<0||v>=E.length){var g=v<0;if(this.hls.trigger(D.Events.ERROR,{type:x.ErrorTypes.OTHER_ERROR,details:x.ErrorDetails.LEVEL_SWITCH_ERROR,level:v,fatal:g,reason:"invalid level idx"}),g)return;v=Math.min(v,E.length-1)}this.clearTimer();var y=this.currentLevelIndex,C=E[y],d=E[v];this.log("switching to level "+v+" from "+y),this.currentLevelIndex=v;var _=u({},d,{level:v,maxBitrate:d.maxBitrate,uri:d.uri,urlId:d.urlId});delete _._urlId,this.hls.trigger(D.Events.LEVEL_SWITCHING,_);var O=d.details;if(!O||O.live){var A=this.switchParams(d.uri,C==null?void 0:C.details);this.loadPlaylist(A)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(v){this.manualLevelIndex=v,this._startLevel===void 0&&(this._startLevel=v),v!==-1&&(this.level=v)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(v){this._firstLevel=v}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var v=this.hls.config.startLevel;return v!==void 0?v:this._firstLevel}else return this._startLevel},set:function(v){this._startLevel=v}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(v){this.level=v,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=v)}}]),n}(f.default)},"./src/controller/level-helper.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"addGroupId",function(){return x}),j.d(Q,"assignTrackIdsByGroup",function(){return T}),j.d(Q,"updatePTS",function(){return w}),j.d(Q,"updateFragPTSDTS",function(){return p}),j.d(Q,"mergeDetails",function(){return u}),j.d(Q,"mapPartIntersection",function(){return o}),j.d(Q,"mapFragmentIntersection",function(){return i}),j.d(Q,"adjustSliding",function(){return l}),j.d(Q,"addSliding",function(){return s}),j.d(Q,"computeReloadInterval",function(){return h}),j.d(Q,"getFragmentWithSN",function(){return r}),j.d(Q,"getPartWith",function(){return t});var S=j("./src/polyfills/number.ts"),D=j("./src/utils/logger.ts");function x(n,c,m){switch(c){case"audio":n.audioGroupIds||(n.audioGroupIds=[]),n.audioGroupIds.push(m);break;case"text":n.textGroupIds||(n.textGroupIds=[]),n.textGroupIds.push(m);break}}function T(n){var c={};n.forEach(function(m){var v=m.groupId||"";m.id=c[v]=c[v]||0,c[v]++})}function w(n,c,m){var v=n[c],b=n[m];f(v,b)}function f(n,c){var m=c.startPTS;if(Object(S.isFiniteNumber)(m)){var v=0,b;c.sn>n.sn?(v=m-n.start,b=n):(v=n.start-m,b=c),b.duration!==v&&(b.duration=v)}else if(c.sn>n.sn){var E=n.cc===c.cc;E&&n.minEndPTS?c.start=n.start+(n.minEndPTS-n.start):c.start=n.start+n.duration}else c.start=Math.max(n.start-c.duration,0)}function p(n,c,m,v,b,E){var g=v-m;g<=0&&(D.logger.warn("Fragment should have a positive duration",c),v=m+c.duration,E=b+c.duration);var y=m,C=v,d=c.startPTS,_=c.endPTS;if(Object(S.isFiniteNumber)(d)){var O=Math.abs(d-m);Object(S.isFiniteNumber)(c.deltaPTS)?c.deltaPTS=Math.max(O,c.deltaPTS):c.deltaPTS=O,y=Math.max(m,d),m=Math.min(m,d),b=Math.min(b,c.startDTS),C=Math.min(v,_),v=Math.max(v,_),E=Math.max(E,c.endDTS)}c.duration=v-m;var A=m-c.start;c.appendedPTS=v,c.start=c.startPTS=m,c.maxStartPTS=y,c.startDTS=b,c.endPTS=v,c.minEndPTS=C,c.endDTS=E;var P=c.sn;if(!n||P<n.startSN||P>n.endSN)return 0;var I,W=P-n.startSN,K=n.fragments;for(K[W]=c,I=W;I>0;I--)f(K[I],K[I-1]);for(I=W;I<K.length-1;I++)f(K[I],K[I+1]);return n.fragmentHint&&f(K[K.length-1],n.fragmentHint),n.PTSKnown=n.alignedSliding=!0,A}function u(n,c){for(var m=null,v=n.fragments,b=v.length-1;b>=0;b--){var E=v[b].initSegment;if(E){m=E;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;var g=0,y;if(i(n,c,function(I,W){I.relurl&&(g=I.cc-W.cc),Object(S.isFiniteNumber)(I.startPTS)&&Object(S.isFiniteNumber)(I.endPTS)&&(W.start=W.startPTS=I.startPTS,W.startDTS=I.startDTS,W.appendedPTS=I.appendedPTS,W.maxStartPTS=I.maxStartPTS,W.endPTS=I.endPTS,W.endDTS=I.endDTS,W.minEndPTS=I.minEndPTS,W.duration=I.endPTS-I.startPTS,W.duration&&(y=W),c.PTSKnown=c.alignedSliding=!0),W.elementaryStreams=I.elementaryStreams,W.loader=I.loader,W.stats=I.stats,W.urlId=I.urlId,I.initSegment&&(W.initSegment=I.initSegment,m=I.initSegment)}),m){var C=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments;C.forEach(function(I){var W;(!I.initSegment||I.initSegment.relurl===((W=m)===null||W===void 0?void 0:W.relurl))&&(I.initSegment=m)})}if(c.skippedSegments&&(c.deltaUpdateFailed=c.fragments.some(function(I){return!I}),c.deltaUpdateFailed)){D.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var d=c.skippedSegments;d--;)c.fragments.shift();c.startSN=c.fragments[0].sn,c.startCC=c.fragments[0].cc}var _=c.fragments;if(g){D.logger.warn("discontinuity sliding from playlist, take drift into account");for(var O=0;O<_.length;O++)_[O].cc+=g}c.skippedSegments&&(c.startCC=c.fragments[0].cc),o(n.partList,c.partList,function(I,W){W.elementaryStreams=I.elementaryStreams,W.stats=I.stats}),y?p(c,y,y.startPTS,y.endPTS,y.startDTS,y.endDTS):l(n,c),_.length&&(c.totalduration=c.edge-_[0].start),c.driftStartTime=n.driftStartTime,c.driftStart=n.driftStart;var A=c.advancedDateTime;if(c.advanced&&A){var P=c.edge;c.driftStart||(c.driftStartTime=A,c.driftStart=P),c.driftEndTime=A,c.driftEnd=P}else c.driftEndTime=n.driftEndTime,c.driftEnd=n.driftEnd,c.advancedDateTime=n.advancedDateTime}function o(n,c,m){if(n&&c)for(var v=0,b=0,E=n.length;b<=E;b++){var g=n[b],y=c[b+v];g&&y&&g.index===y.index&&g.fragment.sn===y.fragment.sn?m(g,y):v--}}function i(n,c,m){for(var v=c.skippedSegments,b=Math.max(n.startSN,c.startSN)-c.startSN,E=(n.fragmentHint?1:0)+(v?c.endSN:Math.min(n.endSN,c.endSN))-c.startSN,g=c.startSN-n.startSN,y=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments,C=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,d=b;d<=E;d++){var _=C[g+d],O=y[d];v&&!O&&d<v&&(O=c.fragments[d]=_),_&&O&&m(_,O)}}function l(n,c){var m=c.startSN+c.skippedSegments-n.startSN,v=n.fragments;if(m<0||m>=v.length)return;s(c,v[m].start)}function s(n,c){if(c){for(var m=n.fragments,v=n.skippedSegments;v<m.length;v++)m[v].start+=c;n.fragmentHint&&(n.fragmentHint.start+=c)}}function h(n,c){var m=1e3*n.levelTargetDuration,v=m/2,b=n.age,E=b>0&&b<m*3,g=c.loading.end-c.loading.start,y,C=n.availabilityDelay;if(n.updated===!1)if(E){var d=333*n.misses;y=Math.max(Math.min(v,g*2),d),n.availabilityDelay=(n.availabilityDelay||0)+y}else y=v;else E?(C=Math.min(C||m/2,b),n.availabilityDelay=C,y=C+m-b):y=m-g;return Math.round(y)}function r(n,c,m){if(!n||!n.details)return null;var v=n.details,b=v.fragments[c-v.startSN];return b||(b=v.fragmentHint,b&&b.sn===c?b:c<v.startSN&&m&&m.sn===c?m:null)}function t(n,c,m){if(!n||!n.details)return null;var v=n.details.partList;if(v)for(var b=v.length;b--;){var E=v[b];if(E.index===m&&E.fragment.sn===c)return E}return null}},"./src/controller/stream-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return v});var S=j("./src/polyfills/number.ts"),D=j("./src/controller/base-stream-controller.ts"),x=j("./src/is-supported.ts"),T=j("./src/events.ts"),w=j("./src/utils/buffer-helper.ts"),f=j("./src/controller/fragment-tracker.ts"),p=j("./src/types/loader.ts"),u=j("./src/loader/fragment.ts"),o=j("./src/demux/transmuxer-interface.ts"),i=j("./src/types/transmuxer.ts"),l=j("./src/controller/gap-controller.ts"),s=j("./src/errors.ts"),h=j("./src/utils/logger.ts");function r(b,E){for(var g=0;g<E.length;g++){var y=E[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,y.key,y)}}function t(b,E,g){return E&&r(b.prototype,E),g&&r(b,g),b}function n(b,E){b.prototype=Object.create(E.prototype),b.prototype.constructor=b,c(b,E)}function c(b,E){return c=Object.setPrototypeOf||function(y,C){return y.__proto__=C,y},c(b,E)}var m=100,v=function(b){n(E,b);function E(y,C){var d;return d=b.call(this,y,C,"[stream-controller]")||this,d.audioCodecSwap=!1,d.gapController=null,d.level=-1,d._forceStartLoad=!1,d.altAudio=!1,d.audioOnly=!1,d.fragPlaying=null,d.onvplaying=null,d.onvseeked=null,d.fragLastKbps=0,d.stalled=!1,d.couldBacktrack=!1,d.audioCodecSwitch=!1,d.videoBuffer=null,d._registerListeners(),d}var g=E.prototype;return g._registerListeners=function(){var C=this.hls;C.on(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.on(T.Events.LEVEL_LOADING,this.onLevelLoading,this),C.on(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(T.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.on(T.Events.ERROR,this.onError,this),C.on(T.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.on(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(T.Events.BUFFER_CREATED,this.onBufferCreated,this),C.on(T.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.on(T.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.on(T.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g._unregisterListeners=function(){var C=this.hls;C.off(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.off(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(T.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.off(T.Events.ERROR,this.onError,this),C.off(T.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.off(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(T.Events.BUFFER_CREATED,this.onBufferCreated,this),C.off(T.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.off(T.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.off(T.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},g.startLoad=function(C){if(this.levels){var d=this.lastCurrentTime,_=this.hls;if(this.stopLoad(),this.setInterval(m),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var O=_.startLevel;O===-1&&(_.config.testBandwidth?(O=0,this.bitrateTest=!0):O=_.nextAutoLevel),this.level=_.nextLoadLevel=O,this.loadedmetadata=!1}d>0&&C===-1&&(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),C=d),this.state=D.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=C,this.tick()}else this._forceStartLoad=!0,this.state=D.State.STOPPED},g.stopLoad=function(){this._forceStartLoad=!1,b.prototype.stopLoad.call(this)},g.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_LEVEL:{var C,d=this.levels,_=this.level,O=d==null||((C=d[_])===null||C===void 0)?void 0:C.details;if(O&&(!O.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(O))break;this.state=D.State.IDLE;break}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var A,P=self.performance.now(),I=this.retryDate;(!I||P>=I||(A=this.media)!==null&&A!==void 0&&A.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=D.State.IDLE)}break;default:break}this.onTickEnd()},g.onTickEnd=function(){b.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},g.doTickIdle=function(){var C,d,_=this.hls,O=this.levelLastLoaded,A=this.levels,P=this.media,I=_.config,W=_.nextLoadLevel;if(O===null||!P&&(this.startFragRequested||!I.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!A||!A[W])return;var K=A[W];this.level=_.nextLoadLevel=W;var te=K.details;if(!te||this.state===D.State.WAITING_LEVEL||te.live&&this.levelLastLoaded!==W){this.state=D.State.WAITING_LEVEL;return}var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:P,p.PlaylistLevelType.MAIN);if(H===null)return;var G=H.len,V=this.getMaxBufferLength(K.maxBitrate);if(G>=V)return;if(this._streamEnded(H,te)){var re={};this.altAudio&&(re.type="video"),this.hls.trigger(T.Events.BUFFER_EOS,re),this.state=D.State.ENDED;return}var $=H.end,ne=this.getNextFragment($,te);if(this.couldBacktrack&&!this.fragPrevious&&ne&&ne.sn!=="initSegment"){var he=ne.sn-te.startSN;he>1&&(ne=te.fragments[he-1],this.fragmentTracker.removeFragment(ne))}if(ne&&this.fragmentTracker.getState(ne)===f.FragmentState.OK&&this.nextLoadPosition>$){var pe=this.audioOnly&&!this.altAudio?u.ElementaryStreamTypes.AUDIO:u.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(P,pe,p.PlaylistLevelType.MAIN),ne=this.getNextFragment(this.nextLoadPosition,te)}if(!ne)return;ne.initSegment&&!ne.initSegment.data&&!this.bitrateTest&&(ne=ne.initSegment),((C=ne.decryptdata)===null||C===void 0?void 0:C.keyFormat)==="identity"&&!((d=ne.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(ne,te):this.loadFragment(ne,te,$)},g.loadFragment=function(C,d,_){var O,A=this.fragmentTracker.getState(C);if(this.fragCurrent=C,A===f.FragmentState.BACKTRACKED){var P=this.fragmentTracker.getBacktrackData(C);if(P){this._handleFragmentLoadProgress(P),this._handleFragmentLoadComplete(P);return}else A=f.FragmentState.NOT_LOADED}A===f.FragmentState.NOT_LOADED||A===f.FragmentState.PARTIAL?C.sn==="initSegment"?this._loadInitSegment(C):this.bitrateTest?(C.bitrateTest=!0,this.log("Fragment "+C.sn+" of level "+C.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(C)):(this.startFragRequested=!0,b.prototype.loadFragment.call(this,C,d,_)):A===f.FragmentState.APPENDING?this.reduceMaxBufferLength(C.duration)&&this.fragmentTracker.removeFragment(C):((O=this.media)===null||O===void 0?void 0:O.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},g.getAppendedFrag=function(C){var d=this.fragmentTracker.getAppendedFrag(C,p.PlaylistLevelType.MAIN);return d&&"fragment"in d?d.fragment:d},g.getBufferedFrag=function(C){return this.fragmentTracker.getBufferedFrag(C,p.PlaylistLevelType.MAIN)},g.followingBufferedFrag=function(C){return C?this.getBufferedFrag(C.end+.5):null},g.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},g.nextLevelSwitch=function(){var C=this.levels,d=this.media;if(d!=null&&d.readyState){var _,O=this.getAppendedFrag(d.currentTime);if(O&&O.start>1&&this.flushMainBuffer(0,O.start-1),!d.paused&&C){var A=this.hls.nextLoadLevel,P=C[A],I=this.fragLastKbps;I&&this.fragCurrent?_=this.fragCurrent.duration*P.maxBitrate/(1e3*I)+1:_=0}else _=0;var W=this.getBufferedFrag(d.currentTime+_);if(W){var K=this.followingBufferedFrag(W);if(K){this.abortCurrentFrag();var te=K.maxStartPTS?K.maxStartPTS:K.start,H=K.duration,G=Math.max(W.end,te+Math.min(Math.max(H-this.config.maxFragLookUpTolerance,H*.5),H*.75));this.flushMainBuffer(G,Number.POSITIVE_INFINITY)}}}},g.abortCurrentFrag=function(){var C=this.fragCurrent;this.fragCurrent=null,C!=null&&C.loader&&C.loader.abort(),this.state===D.State.KEY_LOADING&&(this.state=D.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},g.flushMainBuffer=function(C,d){b.prototype.flushMainBuffer.call(this,C,d,this.altAudio?"video":null)},g.onMediaAttached=function(C,d){b.prototype.onMediaAttached.call(this,C,d);var _=d.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),_.addEventListener("playing",this.onvplaying),_.addEventListener("seeked",this.onvseeked),this.gapController=new l.default(this.config,_,this.fragmentTracker,this.hls)},g.onMediaDetaching=function(){var C=this.media;C&&(C.removeEventListener("playing",this.onvplaying),C.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),b.prototype.onMediaDetaching.call(this)},g.onMediaPlaying=function(){this.tick()},g.onMediaSeeked=function(){var C=this.media,d=C?C.currentTime:null;Object(S.isFiniteNumber)(d)&&this.log("Media seeked to "+d.toFixed(3)),this.tick()},g.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(T.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},g.onManifestParsed=function(C,d){var _=!1,O=!1,A;d.levels.forEach(function(P){A=P.audioCodec,A&&(A.indexOf("mp4a.40.2")!==-1&&(_=!0),A.indexOf("mp4a.40.5")!==-1&&(O=!0))}),this.audioCodecSwitch=_&&O&&!Object(x.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=d.levels,this.startFragRequested=!1},g.onLevelLoading=function(C,d){var _=this.levels;if(!_||this.state!==D.State.IDLE)return;var O=_[d.level];(!O.details||O.details.live&&this.levelLastLoaded!==d.level||this.waitForCdnTuneIn(O.details))&&(this.state=D.State.WAITING_LEVEL)},g.onLevelLoaded=function(C,d){var _,O=this.levels,A=d.level,P=d.details,I=P.totalduration;if(!O){this.warn("Levels were reset while loading level "+A);return}this.log("Level "+A+" loaded ["+P.startSN+","+P.endSN+"], cc ["+P.startCC+", "+P.endCC+"] duration:"+I);var W=this.fragCurrent;W&&(this.state===D.State.FRAG_LOADING||this.state===D.State.FRAG_LOADING_WAITING_RETRY)&&(W.level!==d.level&&W.loader&&(this.state=D.State.IDLE,W.loader.abort()));var K=O[A],te=0;if(P.live||(_=K.details)!==null&&_!==void 0&&_.live){if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed)return;te=this.alignPlaylists(P,K.details)}if(K.details=P,this.levelLastLoaded=A,this.hls.trigger(T.Events.LEVEL_UPDATED,{details:P,level:A}),this.state===D.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(P))return;this.state=D.State.IDLE}this.startFragRequested?P.live&&this.synchronizeToLiveEdge(P):this.setStartPosition(P,te),this.tick()},g._handleFragmentLoadProgress=function(C){var d,_=C.frag,O=C.part,A=C.payload,P=this.levels;if(!P){this.warn("Levels were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var I=P[_.level],W=I.details;if(!W){this.warn("Dropping fragment "+_.sn+" of level "+_.level+" after level details were reset");return}var K=I.videoCodec,te=W.PTSKnown||!W.live,H=(d=_.initSegment)===null||d===void 0?void 0:d.data,G=this._getAudioCodec(I),V=this.transmuxer=this.transmuxer||new o.default(this.hls,p.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),re=O?O.index:-1,$=re!==-1,ne=new i.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,A.byteLength,re,$),he=this.initPTS[_.cc];V.push(A,H,G,K,_,O,W.totalduration,te,ne,he)},g.onAudioTrackSwitching=function(C,d){var _=this.altAudio,O=!!d.url,A=d.id;if(!O){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var P=this.fragCurrent;P!=null&&P.loader&&(this.log("Switching to main audio track, cancel main fragment load"),P.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var I=this.hls;_&&I.trigger(T.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),I.trigger(T.Events.AUDIO_TRACK_SWITCHED,{id:A})}},g.onAudioTrackSwitched=function(C,d){var _=d.id,O=!!this.hls.audioTracks[_].url;if(O){var A=this.videoBuffer;A&&this.mediaBuffer!==A&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=A)}this.altAudio=O,this.tick()},g.onBufferCreated=function(C,d){var _=d.tracks,O,A,P=!1;for(var I in _){var W=_[I];if(W.id==="main"){if(A=I,O=W,I==="video"){var K=_[I];K&&(this.videoBuffer=K.buffer)}}else P=!0}P&&O?(this.log("Alternate track found, use "+A+".buffered to schedule main fragment loading"),this.mediaBuffer=O.buffer):this.mediaBuffer=this.media},g.onFragBuffered=function(C,d){var _=d.frag,O=d.part;if(_&&_.type!==p.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(O?" p: "+O.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state),this.state===D.State.PARSED&&(this.state=D.State.IDLE);return}var A=O?O.stats:_.stats;this.fragLastKbps=Math.round(8*A.total/(A.buffering.end-A.loading.first)),_.sn!=="initSegment"&&(this.fragPrevious=_),this.fragBufferedComplete(_,O)},g.onError=function(C,d){switch(d.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p.PlaylistLevelType.MAIN,d);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==D.State.ERROR&&(d.fatal?(this.warn(""+d.details),this.state=D.State.ERROR):!d.levelRetry&&this.state===D.State.WAITING_LEVEL&&(this.state=D.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="main"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var _=!0,O=this.getFwdBufferInfo(this.media,p.PlaylistLevelType.MAIN);O&&O.len>.5&&(_=!this.reduceMaxBufferLength(O.len)),_&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},g.checkBuffer=function(){var C=this.media,d=this.gapController;if(!C||!d||!C.readyState)return;var _=w.BufferHelper.getBuffered(C);!this.loadedmetadata&&_.length?(this.loadedmetadata=!0,this.seekToStartPos()):d.poll(this.lastCurrentTime),this.lastCurrentTime=C.currentTime},g.onFragLoadEmergencyAborted=function(){this.state=D.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},g.onBufferFlushed=function(C,d){var _=d.type;if(_!==u.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var O=(_===u.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(O,_,p.PlaylistLevelType.MAIN)}},g.onLevelsUpdated=function(C,d){this.levels=d.levels},g.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},g.seekToStartPos=function(){var C=this.media,d=C.currentTime,_=this.startPosition;if(_>=0&&d<_){if(C.seeking){h.logger.log("could not seek to "+_+", already seeking at "+d);return}var O=w.BufferHelper.getBuffered(C),A=O.length?O.start(0):0,P=A-_;P>0&&(P<this.config.maxBufferHole||P<this.config.maxFragLookUpTolerance)&&(h.logger.log("adjusting start position by "+P+" to match buffer start"),_+=P,this.startPosition=_),this.log("seek to target start position "+_+" from current time "+d),C.currentTime=_}},g._getAudioCodec=function(C){var d=this.config.defaultAudioCodec||C.audioCodec;return this.audioCodecSwap&&d&&(this.log("Swapping audio codec"),d.indexOf("mp4a.40.5")!==-1?d="mp4a.40.2":d="mp4a.40.5"),d},g._loadBitrateTestFrag=function(C){var d=this;this._doFragLoad(C).then(function(_){var O=d.hls;if(!_||O.nextLoadLevel||d.fragContextChanged(C))return;d.fragLoadError=0,d.state=D.State.IDLE,d.startFragRequested=!1,d.bitrateTest=!1;var A=C.stats;A.parsing.start=A.parsing.end=A.buffering.start=A.buffering.end=self.performance.now(),O.trigger(T.Events.FRAG_LOADED,_)})},g._handleTransmuxComplete=function(C){var d,_="main",O=this.hls,A=C.remuxResult,P=C.chunkMeta,I=this.getCurrentContext(P);if(!I){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var W=I.frag,K=I.part,te=I.level,H=A.video,G=A.text,V=A.id3,re=A.initSegment,$=this.altAudio?void 0:A.audio;if(this.fragContextChanged(W))return;if(this.state=D.State.PARSING,re){re.tracks&&(this._bufferInitSegment(te,re.tracks,W,P),O.trigger(T.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:_,tracks:re.tracks}));var ne=re.initPTS,he=re.timescale;Object(S.isFiniteNumber)(ne)&&(this.initPTS[W.cc]=ne,O.trigger(T.Events.INIT_PTS_FOUND,{frag:W,id:_,initPTS:ne,timescale:he}))}if(H&&A.independent!==!1){if(te.details){var pe=H.startPTS,Te=H.endPTS,we=H.startDTS,Me=H.endDTS;if(K)K.elementaryStreams[H.type]={startPTS:pe,endPTS:Te,startDTS:we,endDTS:Me};else if(H.firstKeyFrame&&H.independent&&(this.couldBacktrack=!0),H.dropped&&H.independent){var Ee=this.getLoadPosition()+this.config.maxBufferHole;if(Ee<pe){this.backtrack(W);return}W.setElementaryStreamInfo(H.type,W.start,Te,W.start,Me,!0)}W.setElementaryStreamInfo(H.type,pe,Te,we,Me),this.bufferFragmentData(H,W,K,P)}}else if(A.independent===!1){this.backtrack(W);return}if($){var xe=$.startPTS,Ge=$.endPTS,je=$.startDTS,We=$.endDTS;K&&(K.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:xe,endPTS:Ge,startDTS:je,endDTS:We}),W.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,xe,Ge,je,We),this.bufferFragmentData($,W,K,P)}if(V!=null&&(d=V.samples)!==null&&d!==void 0&&d.length){var ze={frag:W,id:_,samples:V.samples};O.trigger(T.Events.FRAG_PARSING_METADATA,ze)}if(G){var de={frag:W,id:_,samples:G.samples};O.trigger(T.Events.FRAG_PARSING_USERDATA,de)}},g._bufferInitSegment=function(C,d,_,O){var A=this;if(this.state!==D.State.PARSING)return;this.audioOnly=!!d.audio&&!d.video,this.altAudio&&!this.audioOnly&&delete d.audio;var P=d.audio,I=d.video,W=d.audiovideo;if(P){var K=C.audioCodec,te=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(K&&(K.indexOf("mp4a.40.5")!==-1?K="mp4a.40.2":K="mp4a.40.5"),P.metadata.channelCount!==1&&te.indexOf("firefox")===-1&&(K="mp4a.40.5")),te.indexOf("android")!==-1&&P.container!=="audio/mpeg"&&(K="mp4a.40.2",this.log("Android: force audio codec to "+K)),C.audioCodec&&C.audioCodec!==K&&this.log('Swapping manifest audio codec "'+C.audioCodec+'" for "'+K+'"'),P.levelCodec=K,P.id="main",this.log("Init audio buffer, container:"+P.container+", codecs[selected/level/parsed]=["+(K||"")+"/"+(C.audioCodec||"")+"/"+P.codec+"]")}I&&(I.levelCodec=C.videoCodec,I.id="main",this.log("Init video buffer, container:"+I.container+", codecs[level/parsed]=["+(C.videoCodec||"")+"/"+I.codec+"]")),W&&this.log("Init audiovideo buffer, container:"+W.container+", codecs[level/parsed]=["+(C.attrs.CODECS||"")+"/"+W.codec+"]"),this.hls.trigger(T.Events.BUFFER_CODECS,d),Object.keys(d).forEach(function(H){var G=d[H],V=G.initSegment;V!=null&&V.byteLength&&A.hls.trigger(T.Events.BUFFER_APPENDING,{type:H,data:V,frag:_,part:null,chunkMeta:O,parent:_.type})}),this.tick()},g.backtrack=function(C){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(C);var d=this.fragmentTracker.backtrack(C);this.fragPrevious=null,this.nextLoadPosition=C.start,d?this.resetFragmentLoading(C):this.state=D.State.BACKTRACKING},g.checkFragmentChanged=function(){var C=this.media,d=null;if(C&&C.readyState>1&&C.seeking===!1){var _=C.currentTime;if(w.BufferHelper.isBuffered(C,_)?d=this.getAppendedFrag(_):w.BufferHelper.isBuffered(C,_+.1)&&(d=this.getAppendedFrag(_+.1)),d){var O=this.fragPlaying,A=d.level;(!O||d.sn!==O.sn||O.level!==A||d.urlId!==O.urlId)&&(this.hls.trigger(T.Events.FRAG_CHANGED,{frag:d}),(!O||O.level!==A)&&this.hls.trigger(T.Events.LEVEL_SWITCHED,{level:A}),this.fragPlaying=d)}}},t(E,[{key:"nextLevel",get:function(){var C=this.nextBufferedFrag;return C?C.level:-1}},{key:"currentLevel",get:function(){var C=this.media;if(C){var d=this.getAppendedFrag(C.currentTime);if(d)return d.level}return-1}},{key:"nextBufferedFrag",get:function(){var C=this.media;if(C){var d=this.getAppendedFrag(C.currentTime);return this.followingBufferedFrag(d)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),E}(D.default)},"./src/controller/subtitle-stream-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"SubtitleStreamController",function(){return n});var S=j("./src/events.ts"),D=j("./src/utils/logger.ts"),x=j("./src/utils/buffer-helper.ts"),T=j("./src/controller/fragment-finders.ts"),w=j("./src/utils/discontinuities.ts"),f=j("./src/controller/level-helper.ts"),p=j("./src/controller/fragment-tracker.ts"),u=j("./src/controller/base-stream-controller.ts"),o=j("./src/types/loader.ts"),i=j("./src/types/level.ts");function l(c,m){for(var v=0;v<m.length;v++){var b=m[v];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(c,b.key,b)}}function s(c,m,v){return m&&l(c.prototype,m),v&&l(c,v),c}function h(c,m){c.prototype=Object.create(m.prototype),c.prototype.constructor=c,r(c,m)}function r(c,m){return r=Object.setPrototypeOf||function(b,E){return b.__proto__=E,b},r(c,m)}var t=500,n=function(c){h(m,c);function m(b,E){var g;return g=c.call(this,b,E,"[subtitle-stream-controller]")||this,g.levels=[],g.currentTrackId=-1,g.tracksBuffered=[],g.mainDetails=null,g._registerListeners(),g}var v=m.prototype;return v.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},v._registerListeners=function(){var E=this.hls;E.on(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(S.Events.ERROR,this.onError,this),E.on(S.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),E.on(S.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),E.on(S.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),E.on(S.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),E.on(S.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},v._unregisterListeners=function(){var E=this.hls;E.off(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(S.Events.ERROR,this.onError,this),E.off(S.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),E.off(S.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),E.off(S.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),E.off(S.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),E.off(S.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},v.startLoad=function(){this.stopLoad(),this.state=u.State.IDLE,this.setInterval(t),this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},v.onLevelLoaded=function(E,g){this.mainDetails=g.details},v.onSubtitleFragProcessed=function(E,g){var y=g.frag,C=g.success;if(this.fragPrevious=y,this.state=u.State.IDLE,!C)return;var d=this.tracksBuffered[this.currentTrackId];if(!d)return;for(var _,O=y.start,A=0;A<d.length;A++)if(O>=d[A].start&&O<=d[A].end){_=d[A];break}var P=y.start+y.duration;_?_.end=P:(_={start:O,end:P},d.push(_)),this.fragmentTracker.fragBuffered(y)},v.onBufferFlushing=function(E,g){var y=g.startOffset,C=g.endOffset;if(y===0&&C!==Number.POSITIVE_INFINITY){var d=this.currentTrackId,_=this.levels;if(!_.length||!_[d]||!_[d].details)return;var O=_[d].details,A=O.targetduration,P=C-A;if(P<=0)return;g.endOffsetSubtitles=Math.max(0,P),this.tracksBuffered.forEach(function(I){for(var W=0;W<I.length;){if(I[W].end<=P){I.shift();continue}else if(I[W].start<P)I[W].start=P;else break;W++}}),this.fragmentTracker.removeFragmentsInRange(y,P,o.PlaylistLevelType.SUBTITLE)}},v.onError=function(E,g){var y,C=g.frag;if(!C||C.type!==o.PlaylistLevelType.SUBTITLE)return;(y=this.fragCurrent)!==null&&y!==void 0&&y.loader&&this.fragCurrent.loader.abort(),this.state=u.State.IDLE},v.onSubtitleTracksUpdated=function(E,g){var y=this,C=g.subtitleTracks;this.tracksBuffered=[],this.levels=C.map(function(d){return new i.Level(d)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(d){y.tracksBuffered[d.id]=[]}),this.mediaBuffer=null},v.onSubtitleTrackSwitch=function(E,g){if(this.currentTrackId=g.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var y=this.levels[this.currentTrackId];y!=null&&y.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,y&&this.setInterval(t)},v.onSubtitleTrackLoaded=function(E,g){var y,C=g.details,d=g.id,_=this.currentTrackId,O=this.levels;if(!O.length)return;var A=O[_];if(d>=O.length||d!==_||!A)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,C.live||(y=A.details)!==null&&y!==void 0&&y.live){var P=this.mainDetails;if(C.deltaUpdateFailed||!P)return;var I=P.fragments[0];if(!A.details)C.hasProgramDateTime&&P.hasProgramDateTime?Object(w.alignMediaPlaylistByPDT)(C,P):I&&Object(f.addSliding)(C,I.start);else{var W=this.alignPlaylists(C,A.details);W===0&&I&&Object(f.addSliding)(C,I.start)}}if(A.details=C,this.levelLastLoaded=d,this.tick(),C.live&&!this.fragCurrent&&this.media&&this.state===u.State.IDLE){var K=Object(T.findFragmentByPTS)(null,C.fragments,this.media.currentTime,0);K||(this.warn("Subtitle playlist not aligned with playback"),A.details=void 0)}},v._handleFragmentLoadComplete=function(E){var g=E.frag,y=E.payload,C=g.decryptdata,d=this.hls;if(this.fragContextChanged(g))return;if(y&&y.byteLength>0&&C&&C.key&&C.iv&&C.method==="AES-128"){var _=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(y),C.key.buffer,C.iv.buffer).then(function(O){var A=performance.now();d.trigger(S.Events.FRAG_DECRYPTED,{frag:g,payload:O,stats:{tstart:_,tdecrypt:A}})})}},v.doTick=function(){if(!this.media){this.state=u.State.IDLE;return}if(this.state===u.State.IDLE){var E,g=this.currentTrackId,y=this.levels;if(!y.length||!y[g]||!y[g].details)return;var C=y[g].details,d=C.targetduration,_=this.config,O=this.media,A=x.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,O.currentTime-d,_.maxBufferHole),P=A.end,I=A.len,W=this.getMaxBufferLength()+d;if(I>W)return;console.assert(C,"Subtitle track details are defined on idle subtitle stream controller tick");var K=C.fragments,te=K.length,H=C.edge,G,V=this.fragPrevious;if(P<H){var re=_.maxFragLookUpTolerance;V&&C.hasProgramDateTime&&(G=Object(T.findFragmentByPDT)(K,V.endProgramDateTime,re)),G||(G=Object(T.findFragmentByPTS)(V,K,P,re),!G&&V&&V.start<K[0].start&&(G=K[0]))}else G=K[te-1];(E=G)!==null&&E!==void 0&&E.encrypted?(D.logger.log("Loading key for "+G.sn),this.state=u.State.KEY_LOADING,this.hls.trigger(S.Events.KEY_LOADING,{frag:G})):G&&this.fragmentTracker.getState(G)===p.FragmentState.NOT_LOADED&&this.loadFragment(G,C,P)}},v.loadFragment=function(E,g,y){this.fragCurrent=E,c.prototype.loadFragment.call(this,E,g,y)},s(m,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),m}(u.default)},"./src/controller/subtitle-track-controller.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/events.ts"),D=j("./src/utils/texttrack-utils.ts"),x=j("./src/controller/base-playlist-controller.ts"),T=j("./src/types/loader.ts");function w(l,s){for(var h=0;h<s.length;h++){var r=s[h];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(l,r.key,r)}}function f(l,s,h){return s&&w(l.prototype,s),h&&w(l,h),l}function p(l,s){l.prototype=Object.create(s.prototype),l.prototype.constructor=l,u(l,s)}function u(l,s){return u=Object.setPrototypeOf||function(r,t){return r.__proto__=t,r},u(l,s)}var o=function(l){p(s,l);function s(r){var t;return t=l.call(this,r,"[subtitle-track-controller]")||this,t.media=null,t.tracks=[],t.groupId=null,t.tracksInGroup=[],t.trackId=-1,t.selectDefaultTrack=!0,t.queuedDefaultTrack=-1,t.trackChangeListener=function(){return t.onTextTracksChanged()},t.asyncPollTrackChange=function(){return t.pollTrackChange(0)},t.useTextTrackPolling=!1,t.subtitlePollingInterval=-1,t.subtitleDisplay=!0,t.registerListeners(),t}var h=s.prototype;return h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,l.prototype.destroy.call(this)},h.registerListeners=function(){var t=this.hls;t.on(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(S.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(S.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(S.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(S.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var t=this.hls;t.off(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(S.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(S.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(S.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(S.Events.ERROR,this.onError,this)},h.onMediaAttached=function(t,n){if(this.media=n.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)},h.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},h.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 t=i(this.media.textTracks);t.forEach(function(n){Object(D.clearCurrentCues)(n)}),this.subtitleTrack=-1,this.media=null},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},h.onManifestParsed=function(t,n){this.tracks=n.subtitleTracks},h.onSubtitleTrackLoaded=function(t,n){var c=n.id,m=n.details,v=this.trackId,b=this.tracksInGroup[v];if(!b){this.warn("Invalid subtitle track id "+c);return}var E=b.details;b.details=n.details,this.log("subtitle track "+c+" loaded ["+m.startSN+"-"+m.endSN+"]"),c===this.trackId&&(this.retryCount=0,this.playlistLoaded(c,n,E))},h.onLevelLoading=function(t,n){this.switchLevel(n.level)},h.onLevelSwitching=function(t,n){this.switchLevel(n.level)},h.switchLevel=function(t){var n=this.hls.levels[t];if(!(n!=null&&n.textGroupIds))return;var c=n.textGroupIds[n.urlId];if(this.groupId!==c){var m=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,v=this.tracks.filter(function(g){return!c||g.groupId===c});this.tracksInGroup=v;var b=this.findTrackId(m==null?void 0:m.name)||this.findTrackId();this.groupId=c;var E={subtitleTracks:v};this.log("Updating subtitle tracks, "+v.length+' track(s) found in "'+c+'" group-id'),this.hls.trigger(S.Events.SUBTITLE_TRACKS_UPDATED,E),b!==-1&&this.setSubtitleTrack(b,m)}},h.findTrackId=function(t){for(var n=this.tracksInGroup,c=0;c<n.length;c++){var m=n[c];if((!this.selectDefaultTrack||m.default)&&(!t||t===m.name))return m.id}return-1},h.onError=function(t,n){if(l.prototype.onError.call(this,t,n),n.fatal||!n.context)return;n.context.type===T.PlaylistContextType.SUBTITLE_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},h.loadPlaylist=function(t){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var c=n.id,m=n.groupId,v=n.url;if(t)try{v=t.addDirectives(v)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Loading subtitle playlist for id "+c),this.hls.trigger(S.Events.SUBTITLE_TRACK_LOADING,{url:v,id:c,groupId:m,deliveryDirectives:t||null})}},h.toggleTrackModes=function(t){var n=this,c=this.media,m=this.subtitleDisplay,v=this.trackId;if(!c)return;var b=i(c.textTracks),E=b.filter(function(C){return C.groupId===n.groupId});if(t===-1)[].slice.call(b).forEach(function(C){C.mode="disabled"});else{var g=E[v];g&&(g.mode="disabled")}var y=E[t];y&&(y.mode=m?"showing":"hidden")},h.setSubtitleTrack=function(t,n){var c,m=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(this.trackId!==t&&this.toggleTrackModes(t),this.trackId===t&&(t===-1||(c=m[t])!==null&&c!==void 0&&c.details)||t<-1||t>=m.length)return;this.clearTimer();var v=m[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,v){var b=v.id,E=v.groupId,g=E===void 0?"":E,y=v.name,C=v.type,d=v.url;this.hls.trigger(S.Events.SUBTITLE_TRACK_SWITCH,{id:b,groupId:g,name:y,type:C,url:d});var _=this.switchParams(v.url,n==null?void 0:n.details);this.loadPlaylist(_)}else this.hls.trigger(S.Events.SUBTITLE_TRACK_SWITCH,{id:t})},h.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var t=-1,n=i(this.media.textTracks),c=0;c<n.length;c++)if(n[c].mode==="hidden")t=c;else if(n[c].mode==="showing"){t=c;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)},f(s,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,n)}}]),s}(x.default);function i(l){for(var s=[],h=0;h<l.length;h++){var r=l[h];r.kind==="subtitles"&&r.label&&s.push(l[h])}return s}Q.default=o},"./src/controller/timeline-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"TimelineController",function(){return i});var S=j("./src/polyfills/number.ts"),D=j("./src/events.ts"),x=j("./src/utils/cea-608-parser.ts"),T=j("./src/utils/output-filter.ts"),w=j("./src/utils/webvtt-parser.ts"),f=j("./src/utils/texttrack-utils.ts"),p=j("./src/utils/imsc1-ttml-parser.ts"),u=j("./src/types/loader.ts"),o=j("./src/utils/logger.ts"),i=function(){function r(n){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=h(),this.captionsProperties=void 0,this.hls=n,this.config=n.config,this.Cues=n.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 c=new T.default(this,"textTrack1"),m=new T.default(this,"textTrack2"),v=new T.default(this,"textTrack3"),b=new T.default(this,"textTrack4");this.cea608Parser1=new x.default(1,c,m),this.cea608Parser2=new x.default(3,v,b)}n.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.on(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.on(D.Events.FRAG_LOADING,this.onFragLoading,this),n.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),n.on(D.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.on(D.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.on(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.on(D.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=r.prototype;return t.destroy=function(){var c=this.hls;c.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.off(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),c.off(D.Events.FRAG_LOADING,this.onFragLoading,this),c.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(D.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),c.off(D.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),c.off(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.off(D.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),c.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(c,m,v,b,E){for(var g=!1,y=E.length;y--;){var C=E[y],d=s(C[0],C[1],m,v);if(d>=0&&(C[0]=Math.min(C[0],m),C[1]=Math.max(C[1],v),g=!0,d/(v-m)>.5))return}if(g||E.push([m,v]),this.config.renderTextTracksNatively){var _=this.captionsTracks[c];this.Cues.newCue(_,m,v,b)}else{var O=this.Cues.newCue(null,m,v,b);this.hls.trigger(D.Events.CUES_PARSED,{type:"captions",cues:O,track:c})}},t.onInitPtsFound=function(c,m){var v=this,b=m.frag,E=m.id,g=m.initPTS,y=m.timescale,C=this.unparsedVttFrags;E==="main"&&(this.initPTS[b.cc]=g,this.timescale[b.cc]=y),C.length&&(this.unparsedVttFrags=[],C.forEach(function(d){v.onFragLoaded(D.Events.FRAG_LOADED,d)}))},t.getExistingTrack=function(c){var m=this.media;if(m)for(var v=0;v<m.textTracks.length;v++){var b=m.textTracks[v];if(b[c])return b}return null},t.createCaptionsTrack=function(c){this.config.renderTextTracksNatively?this.createNativeTrack(c):this.createNonNativeTrack(c)},t.createNativeTrack=function(c){if(this.captionsTracks[c])return;var m=this.captionsProperties,v=this.captionsTracks,b=this.media,E=m[c],g=E.label,y=E.languageCode,C=this.getExistingTrack(c);if(C)v[c]=C,Object(f.clearCurrentCues)(v[c]),Object(f.sendAddTrackEvent)(v[c],b);else{var d=this.createTextTrack("captions",g,y);d&&(d[c]=!0,v[c]=d)}},t.createNonNativeTrack=function(c){if(this.nonNativeCaptionsTracks[c])return;var m=this.captionsProperties[c];if(!m)return;var v=m.label,b={_id:c,label:v,kind:"captions",default:m.media?!!m.media.default:!1,closedCaptions:m.media};this.nonNativeCaptionsTracks[c]=b,this.hls.trigger(D.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[b]})},t.createTextTrack=function(c,m,v){var b=this.media;return b?b.addTextTrack(c,m,v):void 0},t.onMediaAttaching=function(c,m){this.media=m.media,this._cleanTracks()},t.onMediaDetaching=function(){var c=this.captionsTracks;Object.keys(c).forEach(function(m){Object(f.clearCurrentCues)(c[m]),delete c[m]}),this.nonNativeCaptionsTracks={}},t.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=h(),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())},t._cleanTracks=function(){var c=this.media;if(!c)return;var m=c.textTracks;if(m)for(var v=0;v<m.length;v++)Object(f.clearCurrentCues)(m[v])},t.onSubtitleTracksUpdated=function(c,m){var v=this;this.textTracks=[];var b=m.subtitleTracks||[],E=b.some(function(d){return d.textCodec===p.IMSC1_CODEC});if(this.config.enableWebVTT||E&&this.config.enableIMSC1){var g=this.tracks&&b&&this.tracks.length===b.length;if(this.tracks=b||[],this.config.renderTextTracksNatively){var y=this.media?this.media.textTracks:[];this.tracks.forEach(function(d,_){var O;if(_<y.length){for(var A=null,P=0;P<y.length;P++)if(l(y[P],d)){A=y[P];break}A&&(O=A)}O?Object(f.clearCurrentCues)(O):(O=v.createTextTrack("subtitles",d.name,d.lang),O&&(O.mode="disabled")),O&&(O.groupId=d.groupId,v.textTracks.push(O))})}else if(!g&&this.tracks&&this.tracks.length){var C=this.tracks.map(function(d){return{label:d.name,kind:d.type.toLowerCase(),default:d.default,subtitleTrack:d}});this.hls.trigger(D.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:C})}}},t.onManifestLoaded=function(c,m){var v=this;this.config.enableCEA708Captions&&m.captions&&m.captions.forEach(function(b){var E=/(?:CC|SERVICE)([1-4])/.exec(b.instreamId);if(!E)return;var g="textTrack"+E[1],y=v.captionsProperties[g];if(!y)return;y.label=b.name,b.lang&&(y.languageCode=b.lang),y.media=b})},t.onFragLoading=function(c,m){var v=this.cea608Parser1,b=this.cea608Parser2,E=this.lastSn,g=this.lastPartIndex;if(!this.enabled||!(v&&b))return;if(m.frag.type===u.PlaylistLevelType.MAIN){var y,C,d=m.frag.sn,_=(y=m==null||((C=m.part)===null||C===void 0)?void 0:C.index)!=null?y:-1;d===E+1||d===E&&_===g+1||(v.reset(),b.reset()),this.lastSn=d,this.lastPartIndex=_}},t.onFragLoaded=function(c,m){var v=m.frag,b=m.payload,E=this.initPTS,g=this.unparsedVttFrags;if(v.type===u.PlaylistLevelType.SUBTITLE)if(b.byteLength){if(!Object(S.isFiniteNumber)(E[v.cc])){g.push(m),E.length&&this.hls.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:v,error:new Error("Missing initial subtitle PTS")});return}var y=v.decryptdata;if(y==null||y.key==null||y.method!=="AES-128"){var C=this.tracks[v.level],d=this.vttCCs;d[v.cc]||(d[v.cc]={start:v.start,prevCC:this.prevCC,new:!0},this.prevCC=v.cc),C&&C.textCodec===p.IMSC1_CODEC?this._parseIMSC1(v,b):this._parseVTTs(v,b,d)}}else this.hls.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:v,error:new Error("Empty subtitle payload")})},t._parseIMSC1=function(c,m){var v=this,b=this.hls;Object(p.parseIMSC1)(m,this.initPTS[c.cc],this.timescale[c.cc],function(E){v._appendCues(E,c.level),b.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:c})},function(E){o.logger.log("Failed to parse IMSC1: "+E),b.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:E})})},t._parseVTTs=function(c,m,v){var b=this,E=this.hls;Object(w.parseWebVTT)(m,this.initPTS[c.cc],this.timescale[c.cc],v,c.cc,c.start,function(g){b._appendCues(g,c.level),E.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:c})},function(g){b._fallbackToIMSC1(c,m),o.logger.log("Failed to parse VTT cue: "+g),E.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:g})})},t._fallbackToIMSC1=function(c,m){var v=this,b=this.tracks[c.level];b.textCodec||Object(p.parseIMSC1)(m,this.initPTS[c.cc],this.timescale[c.cc],function(){b.textCodec=p.IMSC1_CODEC,v._parseIMSC1(c,m)},function(){b.textCodec="wvtt"})},t._appendCues=function(c,m){var v=this.hls;if(this.config.renderTextTracksNatively){var b=this.textTracks[m];if(b.mode==="disabled")return;c.forEach(function(y){return Object(f.addCueToTrack)(b,y)})}else{var E=this.tracks[m],g=E.default?"default":"subtitles"+m;v.trigger(D.Events.CUES_PARSED,{type:"subtitles",cues:c,track:g})}},t.onFragDecrypted=function(c,m){var v=m.frag;if(v.type===u.PlaylistLevelType.SUBTITLE){if(!Object(S.isFiniteNumber)(this.initPTS[v.cc])){this.unparsedVttFrags.push(m);return}this.onFragLoaded(D.Events.FRAG_LOADED,m)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(c,m){var v=this.cea608Parser1,b=this.cea608Parser2;if(!this.enabled||!(v&&b))return;for(var E=0;E<m.samples.length;E++){var g=m.samples[E].bytes;if(g){var y=this.extractCea608Data(g);v.addData(m.samples[E].pts,y[0]),b.addData(m.samples[E].pts,y[1])}}},t.onBufferFlushing=function(c,m){var v=m.startOffset,b=m.endOffset,E=m.endOffsetSubtitles,g=m.type,y=this.media;if(!y||y.currentTime<b)return;if(!g||g==="video"){var C=this.captionsTracks;Object.keys(C).forEach(function(_){return Object(f.removeCuesInRange)(C[_],v,b)})}if(this.config.renderTextTracksNatively&&(v===0&&E!==void 0)){var d=this.textTracks;Object.keys(d).forEach(function(_){return Object(f.removeCuesInRange)(d[_],v,E)})}},t.extractCea608Data=function(c){for(var m=c[0]&31,v=2,b=[[],[]],E=0;E<m;E++){var g=c[v++],y=127&c[v++],C=127&c[v++],d=(4&g)!==0,_=3&g;if(y===0&&C===0)continue;d&&((_===0||_===1)&&(b[_].push(y),b[_].push(C)))}return b},r}();function l(r,t){return r&&r.label===t.name&&!(r.textTrack1||r.textTrack2)}function s(r,t,n,c){return Math.min(t,c)-Math.max(r,n)}function h(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return S});var S=function(){function D(T,w){this.subtle=void 0,this.aesIV=void 0,this.subtle=T,this.aesIV=w}var x=D.prototype;return x.decrypt=function(w,f){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},f,w)},D}()},"./src/crypt/aes-decryptor.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"removePadding",function(){return D}),j.d(Q,"default",function(){return x});var S=j("./src/utils/typed-array.ts");function D(T){var w=T.byteLength,f=w&&new DataView(T.buffer).getUint8(w-1);return f?Object(S.sliceUint8)(T,0,w-f):T}var x=function(){function T(){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=T.prototype;return w.uint8ArrayToUint32Array_=function(p){for(var u=new DataView(p),o=new Uint32Array(4),i=0;i<4;i++)o[i]=u.getUint32(i*4);return o},w.initTable=function(){var p=this.sBox,u=this.invSBox,o=this.subMix,i=o[0],l=o[1],s=o[2],h=o[3],r=this.invSubMix,t=r[0],n=r[1],c=r[2],m=r[3],v=new Uint32Array(256),b=0,E=0,g=0;for(g=0;g<256;g++)g<128?v[g]=g<<1:v[g]=g<<1^283;for(g=0;g<256;g++){var y=E^E<<1^E<<2^E<<3^E<<4;y=y>>>8^y&255^99,p[b]=y,u[y]=b;var C=v[b],d=v[C],_=v[d],O=v[y]*257^y*16843008;i[b]=O<<24|O>>>8,l[b]=O<<16|O>>>16,s[b]=O<<8|O>>>24,h[b]=O,O=_*16843009^d*65537^C*257^b*16843008,t[y]=O<<24|O>>>8,n[y]=O<<16|O>>>16,c[y]=O<<8|O>>>24,m[y]=O,b?(b=C^v[v[v[_^C]]],E^=v[v[E]]):b=E=1}},w.expandKey=function(p){for(var u=this.uint8ArrayToUint32Array_(p),o=!0,i=0;i<u.length&&o;)o=u[i]===this.key[i],i++;if(o)return;this.key=u;var l=this.keySize=u.length;if(l!==4&&l!==6&&l!==8)throw new Error("Invalid aes key size="+l);var s=this.ksRows=(l+6+1)*4,h,r,t=this.keySchedule=new Uint32Array(s),n=this.invKeySchedule=new Uint32Array(s),c=this.sBox,m=this.rcon,v=this.invSubMix,b=v[0],E=v[1],g=v[2],y=v[3],C,d;for(h=0;h<s;h++){if(h<l){C=t[h]=u[h];continue}d=C,h%l===0?(d=d<<8|d>>>24,d=c[d>>>24]<<24|c[d>>>16&255]<<16|c[d>>>8&255]<<8|c[d&255],d^=m[h/l|0]<<24):l>6&&h%l===4&&(d=c[d>>>24]<<24|c[d>>>16&255]<<16|c[d>>>8&255]<<8|c[d&255]),t[h]=C=(t[h-l]^d)>>>0}for(r=0;r<s;r++)h=s-r,r&3?d=t[h]:d=t[h-4],r<4||h<=4?n[r]=d:n[r]=b[c[d>>>24]]^E[c[d>>>16&255]]^g[c[d>>>8&255]]^y[c[d&255]],n[r]=n[r]>>>0},w.networkToHostOrderSwap=function(p){return p<<24|(p&65280)<<8|(p&16711680)>>8|p>>>24},w.decrypt=function(p,u,o){for(var i=this.keySize+6,l=this.invKeySchedule,s=this.invSBox,h=this.invSubMix,r=h[0],t=h[1],n=h[2],c=h[3],m=this.uint8ArrayToUint32Array_(o),v=m[0],b=m[1],E=m[2],g=m[3],y=new Int32Array(p),C=new Int32Array(y.length),d,_,O,A,P,I,W,K,te,H,G,V,re,$,ne=this.networkToHostOrderSwap;u<y.length;){for(te=ne(y[u]),H=ne(y[u+1]),G=ne(y[u+2]),V=ne(y[u+3]),P=te^l[0],I=V^l[1],W=G^l[2],K=H^l[3],re=4,$=1;$<i;$++)d=r[P>>>24]^t[I>>16&255]^n[W>>8&255]^c[K&255]^l[re],_=r[I>>>24]^t[W>>16&255]^n[K>>8&255]^c[P&255]^l[re+1],O=r[W>>>24]^t[K>>16&255]^n[P>>8&255]^c[I&255]^l[re+2],A=r[K>>>24]^t[P>>16&255]^n[I>>8&255]^c[W&255]^l[re+3],P=d,I=_,W=O,K=A,re=re+4;d=s[P>>>24]<<24^s[I>>16&255]<<16^s[W>>8&255]<<8^s[K&255]^l[re],_=s[I>>>24]<<24^s[W>>16&255]<<16^s[K>>8&255]<<8^s[P&255]^l[re+1],O=s[W>>>24]<<24^s[K>>16&255]<<16^s[P>>8&255]<<8^s[I&255]^l[re+2],A=s[K>>>24]<<24^s[P>>16&255]<<16^s[I>>8&255]<<8^s[W&255]^l[re+3],C[u]=ne(d^v),C[u+1]=ne(A^b),C[u+2]=ne(O^E),C[u+3]=ne(_^g),v=te,b=H,E=G,g=V,u=u+4}return C.buffer},T}()},"./src/crypt/decrypter.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return u});var S=j("./src/crypt/aes-crypto.ts"),D=j("./src/crypt/fast-aes-key.ts"),x=j("./src/crypt/aes-decryptor.ts"),T=j("./src/utils/logger.ts"),w=j("./src/utils/mp4-tools.ts"),f=j("./src/utils/typed-array.ts"),p=16,u=function(){function o(l,s,h){var r=h===void 0?{}:h,t=r.removePKCS7Padding,n=t===void 0?!0:t;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=l,this.config=s,this.removePKCS7Padding=n,n)try{var c=self.crypto;c&&(this.subtle=c.subtle||c.webkitSubtle)}catch(m){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var i=o.prototype;return i.destroy=function(){this.observer=null},i.isSync=function(){return this.config.enableSoftwareAES},i.flush=function(){var s=this.currentResult;if(!s){this.reset();return}var h=new Uint8Array(s);return this.reset(),this.removePKCS7Padding?Object(x.removePadding)(h):h},i.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},i.decrypt=function(s,h,r,t){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(s),h,r);var n=this.flush();n&&t(n.buffer)}else this.webCryptoDecrypt(new Uint8Array(s),h,r).then(t)},i.softwareDecrypt=function(s,h,r){var t=this.currentIV,n=this.currentResult,c=this.remainderData;this.logOnce("JS AES decrypt"),c&&(s=Object(w.appendUint8Array)(c,s),this.remainderData=null);var m=this.getValidChunk(s);if(!m.length)return null;t&&(r=t);var v=this.softwareDecrypter;v||(v=this.softwareDecrypter=new x.default),v.expandKey(h);var b=n;return this.currentResult=v.decrypt(m.buffer,0,r),this.currentIV=Object(f.sliceUint8)(m,-16).buffer,b||null},i.webCryptoDecrypt=function(s,h,r){var t=this,n=this.subtle;return(this.key!==h||!this.fastAesKey)&&(this.key=h,this.fastAesKey=new D.default(n,h)),this.fastAesKey.expandKey().then(function(c){if(!n)return Promise.reject(new Error("web crypto not initialized"));var m=new S.default(n,r);return m.decrypt(s.buffer,c)}).catch(function(c){return t.onWebCryptoError(c,s,h,r)})},i.onWebCryptoError=function(s,h,r,t){return T.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",s),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(h,r,t)},i.getValidChunk=function(s){var h=s,r=s.length-s.length%p;return r!==s.length&&(h=Object(f.sliceUint8)(s,0,r),this.remainderData=Object(f.sliceUint8)(s,r)),h},i.logOnce=function(s){if(!this.logEnabled)return;T.logger.log("[decrypter.ts]: "+s),this.logEnabled=!1},o}()},"./src/crypt/fast-aes-key.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return S});var S=function(){function D(T,w){this.subtle=void 0,this.key=void 0,this.subtle=T,this.key=w}var x=D.prototype;return x.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},D}()},"./src/demux/aacdemuxer.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/demux/base-audio-demuxer.ts"),D=j("./src/demux/adts.ts"),x=j("./src/utils/logger.ts"),T=j("./src/demux/id3.ts");function w(u,o){u.prototype=Object.create(o.prototype),u.prototype.constructor=u,f(u,o)}function f(u,o){return f=Object.setPrototypeOf||function(l,s){return l.__proto__=s,l},f(u,o)}var p=function(u){w(o,u);function o(l,s){var h;return h=u.call(this)||this,h.observer=void 0,h.config=void 0,h.observer=l,h.config=s,h}var i=o.prototype;return i.resetInitSegment=function(s,h,r){u.prototype.resetInitSegment.call(this,s,h,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:s,duration:r,inputTimeScale:9e4,dropped:0}},o.probe=function(s){if(!s)return!1;for(var h=T.getID3Data(s,0)||[],r=h.length,t=s.length;r<t;r++)if(D.probe(s,r))return x.logger.log("ADTS sync word found !"),!0;return!1},i.canParse=function(s,h){return D.canParse(s,h)},i.appendFrame=function(s,h,r){D.initTrackConfig(s,this.observer,h,r,s.manifestCodec);var t=D.appendFrame(s,h,r,this.initPTS,this.frameIndex);if(t&&t.missing===0)return t},o}(S.default);p.minProbeByteLength=9,Q.default=p},"./src/demux/adts.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"getAudioConfig",function(){return T}),j.d(Q,"isHeaderPattern",function(){return w}),j.d(Q,"getHeaderLength",function(){return f}),j.d(Q,"getFullFrameLength",function(){return p}),j.d(Q,"canGetFrameLength",function(){return u}),j.d(Q,"isHeader",function(){return o}),j.d(Q,"canParse",function(){return i}),j.d(Q,"probe",function(){return l}),j.d(Q,"initTrackConfig",function(){return s}),j.d(Q,"getFrameDuration",function(){return h}),j.d(Q,"parseFrameHeader",function(){return r}),j.d(Q,"appendFrame",function(){return t});var S=j("./src/utils/logger.ts"),D=j("./src/errors.ts"),x=j("./src/events.ts");function T(n,c,m,v){var b,E,g,y,C=navigator.userAgent.toLowerCase(),d=v,_=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];b=((c[m+2]&192)>>>6)+1;var O=(c[m+2]&60)>>>2;if(O>_.length-1){n.trigger(x.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+O});return}return g=(c[m+2]&1)<<2,g|=(c[m+3]&192)>>>6,S.logger.log("manifest codec:"+v+", ADTS type:"+b+", samplingIndex:"+O),/firefox/i.test(C)?O>=6?(b=5,y=new Array(4),E=O-3):(b=2,y=new Array(2),E=O):C.indexOf("android")!==-1?(b=2,y=new Array(2),E=O):(b=5,y=new Array(4),v&&(v.indexOf("mp4a.40.29")!==-1||v.indexOf("mp4a.40.5")!==-1)||!v&&O>=6?E=O-3:((v&&v.indexOf("mp4a.40.2")!==-1&&(O>=6&&g===1||/vivaldi/i.test(C))||!v&&g===1)&&(b=2,y=new Array(2)),E=O)),y[0]=b<<3,y[0]|=(O&14)>>1,y[1]|=(O&1)<<7,y[1]|=g<<3,b===5&&(y[1]|=(E&14)>>1,y[2]=(E&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:_[O],channelCount:g,codec:"mp4a.40."+b,manifestCodec:d}}function w(n,c){return n[c]===255&&(n[c+1]&246)===240}function f(n,c){return n[c+1]&1?7:9}function p(n,c){return(n[c+3]&3)<<11|n[c+4]<<3|(n[c+5]&224)>>>5}function u(n,c){return c+5<n.length}function o(n,c){return c+1<n.length&&w(n,c)}function i(n,c){return u(n,c)&&w(n,c)&&p(n,c)<=n.length-c}function l(n,c){if(o(n,c)){var m=f(n,c);if(c+m>=n.length)return!1;var v=p(n,c);if(v<=m)return!1;var b=c+v;return b===n.length||o(n,b)}return!1}function s(n,c,m,v,b){if(!n.samplerate){var E=T(c,m,v,b);if(!E)return;n.config=E.config,n.samplerate=E.samplerate,n.channelCount=E.channelCount,n.codec=E.codec,n.manifestCodec=E.manifestCodec,S.logger.log("parsed codec:"+n.codec+", rate:"+E.samplerate+", channels:"+E.channelCount)}}function h(n){return 1024*9e4/n}function r(n,c,m,v,b){var E=f(n,c),g=p(n,c);if(g-=E,g>0){var y=m+v*b;return{headerLength:E,frameLength:g,stamp:y}}}function t(n,c,m,v,b){var E=h(n.samplerate),g=r(c,m,v,b,E);if(g){var y=g.frameLength,C=g.headerLength,d=g.stamp,_=C+y,O=Math.max(0,m+_-c.length),A;O?(A=new Uint8Array(_-C),A.set(c.subarray(m+C,c.length),0)):A=c.subarray(m+C,m+_);var P={unit:A,pts:d};return O||n.samples.push(P),{sample:P,length:_,missing:O}}}},"./src/demux/base-audio-demuxer.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"initPTSFn",function(){return p});var S=j("./src/polyfills/number.ts"),D=j("./src/demux/id3.ts"),x=j("./src/demux/dummy-demuxed-track.ts"),T=j("./src/utils/mp4-tools.ts"),w=j("./src/utils/typed-array.ts"),f=function(){function u(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var o=u.prototype;return o.resetInitSegment=function(l,s,h){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},o.resetTimeStamp=function(){},o.resetContiguity=function(){},o.canParse=function(l,s){return!1},o.appendFrame=function(l,s,h){},o.demux=function(l,s){this.cachedData&&(l=Object(T.appendUint8Array)(this.cachedData,l),this.cachedData=null);var h=D.getID3Data(l,0),r=h?h.length:0,t,n,c=this._audioTrack,m=this._id3Track,v=h?D.getTimeStamp(h):void 0,b=l.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=p(v,s)),h&&h.length>0&&m.samples.push({pts:this.initPTS,dts:this.initPTS,data:h}),n=this.initPTS;r<b;){if(this.canParse(l,r)){var E=this.appendFrame(c,l,r);E?(this.frameIndex++,n=E.sample.pts,r+=E.length,t=r):r=b}else D.canParse(l,r)?(h=D.getID3Data(l,r),m.samples.push({pts:n,dts:n,data:h}),r+=h.length,t=r):r++;if(r===b&&t!==b){var g=Object(w.sliceUint8)(l,t);this.cachedData?this.cachedData=Object(T.appendUint8Array)(this.cachedData,g):this.cachedData=g}}return{audioTrack:c,avcTrack:Object(x.dummyTrack)(),id3Track:m,textTrack:Object(x.dummyTrack)()}},o.demuxSampleAes=function(l,s,h){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},o.flush=function(l){var s=this.cachedData;return s&&(this.cachedData=null,this.demux(s,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(x.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(x.dummyTrack)()}},o.destroy=function(){},u}(),p=function(o,i){return Object(S.isFiniteNumber)(o)?o*90:i*9e4};Q.default=f},"./src/demux/chunk-cache.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return S});var S=function(){function x(){this.chunks=[],this.dataLength=0}var T=x.prototype;return T.push=function(f){this.chunks.push(f),this.dataLength+=f.length},T.flush=function(){var f=this.chunks,p=this.dataLength,u;if(f.length)f.length===1?u=f[0]:u=D(f,p);else return new Uint8Array(0);return this.reset(),u},T.reset=function(){this.chunks.length=0,this.dataLength=0},x}();function D(x,T){for(var w=new Uint8Array(T),f=0,p=0;p<x.length;p++){var u=x[p];w.set(u,f),f+=u.length}return w}},"./src/demux/dummy-demuxed-track.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"dummyTrack",function(){return S});function S(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/utils/logger.ts"),D=function(){function x(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 T=x.prototype;return T.loadWord=function(){var f=this.data,p=this.bytesAvailable,u=f.byteLength-p,o=new Uint8Array(4),i=Math.min(4,p);if(i===0)throw new Error("no bytes available");o.set(f.subarray(u,u+i)),this.word=new DataView(o.buffer).getUint32(0),this.bitsAvailable=i*8,this.bytesAvailable-=i},T.skipBits=function(f){var p;this.bitsAvailable>f?(this.word<<=f,this.bitsAvailable-=f):(f-=this.bitsAvailable,p=f>>3,f-=p>>3,this.bytesAvailable-=p,this.loadWord(),this.word<<=f,this.bitsAvailable-=f)},T.readBits=function(f){var p=Math.min(this.bitsAvailable,f),u=this.word>>>32-p;return f>32&&S.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=p,this.bitsAvailable>0?this.word<<=p:this.bytesAvailable>0&&this.loadWord(),p=f-p,p>0&&this.bitsAvailable?u<<p|this.readBits(p):u},T.skipLZ=function(){var f;for(f=0;f<this.bitsAvailable;++f)if((this.word&2147483648>>>f)!==0)return this.word<<=f,this.bitsAvailable-=f,f;return this.loadWord(),f+this.skipLZ()},T.skipUEG=function(){this.skipBits(1+this.skipLZ())},T.skipEG=function(){this.skipBits(1+this.skipLZ())},T.readUEG=function(){var f=this.skipLZ();return this.readBits(f+1)-1},T.readEG=function(){var f=this.readUEG();return 1&f?1+f>>>1:-1*(f>>>1)},T.readBoolean=function(){return this.readBits(1)===1},T.readUByte=function(){return this.readBits(8)},T.readUShort=function(){return this.readBits(16)},T.readUInt=function(){return this.readBits(32)},T.skipScalingList=function(f){for(var p=8,u=8,o,i=0;i<f;i++)u!==0&&(o=this.readEG(),u=(p+o+256)%256),p=u===0?p:u},T.readSPS=function(){var f=0,p=0,u=0,o=0,i,l,s,h=this.readUByte.bind(this),r=this.readBits.bind(this),t=this.readUEG.bind(this),n=this.readBoolean.bind(this),c=this.skipBits.bind(this),m=this.skipEG.bind(this),v=this.skipUEG.bind(this),b=this.skipScalingList.bind(this);h();var E=h();if(r(5),c(3),h(),v(),E===100||E===110||E===122||E===244||E===44||E===83||E===86||E===118||E===128){var g=t();if(g===3&&c(1),v(),v(),c(1),n())for(l=g!==3?8:12,s=0;s<l;s++)n()&&(s<6?b(16):b(64))}v();var y=t();if(y===0)t();else if(y===1)for(c(1),m(),m(),i=t(),s=0;s<i;s++)m();v(),c(1);var C=t(),d=t(),_=r(1);_===0&&c(1),c(1),n()&&(f=t(),p=t(),u=t(),o=t());var O=[1,1];if(n()&&n()){var A=h();switch(A){case 1:O=[1,1];break;case 2:O=[12,11];break;case 3:O=[10,11];break;case 4:O=[16,11];break;case 5:O=[40,33];break;case 6:O=[24,11];break;case 7:O=[20,11];break;case 8:O=[32,11];break;case 9:O=[80,33];break;case 10:O=[18,11];break;case 11:O=[15,11];break;case 12:O=[64,33];break;case 13:O=[160,99];break;case 14:O=[4,3];break;case 15:O=[3,2];break;case 16:O=[2,1];break;case 255:{O=[h()<<8|h(),h()<<8|h()];break}}}return{width:Math.ceil((C+1)*16-f*2-p*2),height:(2-_)*(d+1)*16-(_?2:4)*(u+o),pixelRatio:O}},T.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},x}();Q.default=D},"./src/demux/id3.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"isHeader",function(){return S}),j.d(Q,"isFooter",function(){return D}),j.d(Q,"getID3Data",function(){return x}),j.d(Q,"canParse",function(){return w}),j.d(Q,"getTimeStamp",function(){return f}),j.d(Q,"isTimeStampFrame",function(){return p}),j.d(Q,"getID3Frames",function(){return o}),j.d(Q,"decodeFrame",function(){return i}),j.d(Q,"utf8ArrayToStr",function(){return t}),j.d(Q,"testables",function(){return n});var S=function(b,E){return E+10<=b.length&&(b[E]===73&&b[E+1]===68&&b[E+2]===51&&(b[E+3]<255&&b[E+4]<255&&(b[E+6]<128&&b[E+7]<128&&b[E+8]<128&&b[E+9]<128)))},D=function(b,E){return E+10<=b.length&&(b[E]===51&&b[E+1]===68&&b[E+2]===73&&(b[E+3]<255&&b[E+4]<255&&(b[E+6]<128&&b[E+7]<128&&b[E+8]<128&&b[E+9]<128)))},x=function(b,E){for(var g=E,y=0;S(b,E);){y+=10;var C=T(b,E+6);y+=C,D(b,E+10)&&(y+=10),E+=y}return y>0?b.subarray(g,g+y):void 0},T=function(b,E){var g=0;return g=(b[E]&127)<<21,g|=(b[E+1]&127)<<14,g|=(b[E+2]&127)<<7,g|=b[E+3]&127,g},w=function(b,E){return S(b,E)&&T(b,E+6)+10<=b.length-E},f=function(b){for(var E=o(b),g=0;g<E.length;g++){var y=E[g];if(p(y))return r(y)}return},p=function(b){return b&&b.key==="PRIV"&&b.info==="com.apple.streaming.transportStreamTimestamp"},u=function(b){var E=String.fromCharCode(b[0],b[1],b[2],b[3]),g=T(b,4),y=10;return{type:E,size:g,data:b.subarray(y,y+g)}},o=function(b){for(var E=0,g=[];S(b,E);){var y=T(b,E+6);E+=10;for(var C=E+y;E+8<C;){var d=u(b.subarray(E)),_=i(d);_&&g.push(_),E+=d.size+10}D(b,E)&&(E+=10)}return g},i=function(b){return b.type==="PRIV"?l(b):b.type[0]==="W"?h(b):s(b)},l=function(b){if(b.size<2)return;var E=t(b.data,!0),g=new Uint8Array(b.data.subarray(E.length+1));return{key:b.type,info:E,data:g.buffer}},s=function(b){if(b.size<2)return;if(b.type==="TXXX"){var E=1,g=t(b.data.subarray(E),!0);E+=g.length+1;var y=t(b.data.subarray(E));return{key:b.type,info:g,data:y}}var C=t(b.data.subarray(1));return{key:b.type,data:C}},h=function(b){if(b.type==="WXXX"){if(b.size<2)return;var E=1,g=t(b.data.subarray(E),!0);E+=g.length+1;var y=t(b.data.subarray(E));return{key:b.type,info:g,data:y}}var C=t(b.data);return{key:b.type,data:C}},r=function(b){if(b.data.byteLength===8){var E=new Uint8Array(b.data),g=E[3]&1,y=(E[4]<<23)+(E[5]<<15)+(E[6]<<7)+E[7];return y/=45,g&&(y+=4772185884e-2),Math.round(y)}return},t=function(b,E){E===void 0&&(E=!1);var g=m();if(g){var y=g.decode(b);if(E){var C=y.indexOf("\0");return C!==-1?y.substring(0,C):y}return y.replace(/\0/g,"")}for(var d=b.length,_,O,A,P="",I=0;I<d;){if(_=b[I++],_===0&&E)return P;if(_===0||_===3)continue;switch(_>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:P+=String.fromCharCode(_);break;case 12:case 13:O=b[I++],P+=String.fromCharCode((_&31)<<6|O&63);break;case 14:O=b[I++],A=b[I++],P+=String.fromCharCode((_&15)<<12|(O&63)<<6|(A&63)<<0);break;default:}}return P},n={decodeTextFrame:s},c;function m(){return!c&&typeof self.TextDecoder!="undefined"&&(c=new self.TextDecoder("utf-8")),c}},"./src/demux/mp3demuxer.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/demux/base-audio-demuxer.ts"),D=j("./src/demux/id3.ts"),x=j("./src/utils/logger.ts"),T=j("./src/demux/mpegaudio.ts");function w(u,o){u.prototype=Object.create(o.prototype),u.prototype.constructor=u,f(u,o)}function f(u,o){return f=Object.setPrototypeOf||function(l,s){return l.__proto__=s,l},f(u,o)}var p=function(u){w(o,u);function o(){return u.apply(this,arguments)||this}var i=o.prototype;return i.resetInitSegment=function(s,h,r){u.prototype.resetInitSegment.call(this,s,h,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:r,inputTimeScale:9e4,dropped:0}},o.probe=function(s){if(!s)return!1;for(var h=D.getID3Data(s,0)||[],r=h.length,t=s.length;r<t;r++)if(T.probe(s,r))return x.logger.log("MPEG Audio sync word found !"),!0;return!1},i.canParse=function(s,h){return T.canParse(s,h)},i.appendFrame=function(s,h,r){return this.initPTS===null?void 0:T.appendFrame(s,h,r,this.initPTS,this.frameIndex)},o}(S.default);p.minProbeByteLength=4,Q.default=p},"./src/demux/mp4demuxer.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/utils/mp4-tools.ts"),D=j("./src/demux/dummy-demuxed-track.ts"),x=function(){function T(f,p){this.remainderData=null,this.config=void 0,this.config=p}var w=T.prototype;return w.resetTimeStamp=function(){},w.resetInitSegment=function(){},w.resetContiguity=function(){},T.probe=function(p){return Object(S.findBox)({data:p,start:0,end:Math.min(p.length,16384)},["moof"]).length>0},w.demux=function(p){var u=p,o=Object(D.dummyTrack)();if(this.config.progressive){this.remainderData&&(u=Object(S.appendUint8Array)(this.remainderData,p));var i=Object(S.segmentValidRange)(u);this.remainderData=i.remainder,o.samples=i.valid||new Uint8Array}else o.samples=u;return{audioTrack:Object(D.dummyTrack)(),avcTrack:o,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},w.flush=function(){var p=Object(D.dummyTrack)();return p.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(D.dummyTrack)(),avcTrack:p,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},w.demuxSampleAes=function(p,u,o){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},w.destroy=function(){},T}();x.minProbeByteLength=1024,Q.default=x},"./src/demux/mpegaudio.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"appendFrame",function(){return f}),j.d(Q,"parseHeader",function(){return p}),j.d(Q,"isHeaderPattern",function(){return u}),j.d(Q,"isHeader",function(){return o}),j.d(Q,"canParse",function(){return i}),j.d(Q,"probe",function(){return l});var S=null,D=[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],x=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],T=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],w=[0,1,1,4];function f(s,h,r,t,n){if(r+24>h.length)return;var c=p(h,r);if(c&&r+c.frameLength<=h.length){var m=c.samplesPerFrame*9e4/c.sampleRate,v=t+n*m,b={unit:h.subarray(r,r+c.frameLength),pts:v,dts:v};return s.config=[],s.channelCount=c.channelCount,s.samplerate=c.sampleRate,s.samples.push(b),{sample:b,length:c.frameLength,missing:0}}}function p(s,h){var r=s[h+1]>>3&3,t=s[h+1]>>1&3,n=s[h+2]>>4&15,c=s[h+2]>>2&3;if(r!==1&&n!==0&&n!==15&&c!==3){var m=s[h+2]>>1&1,v=s[h+3]>>6,b=r===3?3-t:t===3?3:4,E=D[b*14+n-1]*1e3,g=r===3?0:r===2?1:2,y=x[g*3+c],C=v===3?1:2,d=T[r][t],_=w[t],O=d*8*_,A=Math.floor(d*E/y+m)*_;if(S===null){var P=navigator.userAgent||"",I=P.match(/Chrome\/(\d+)/i);S=I?parseInt(I[1]):0}var W=!!S&&S<=87;return W&&t===2&&E>=224e3&&v===0&&(s[h+3]=s[h+3]|128),{sampleRate:y,channelCount:C,frameLength:A,samplesPerFrame:O}}}function u(s,h){return s[h]===255&&(s[h+1]&224)===224&&(s[h+1]&6)!==0}function o(s,h){return h+1<s.length&&u(s,h)}function i(s,h){var r=4;return u(s,h)&&r<=s.length-h}function l(s,h){if(h+1<s.length&&u(s,h)){var r=4,t=p(s,h),n=r;t!=null&&t.frameLength&&(n=t.frameLength);var c=h+n;return c===s.length||o(s,c)}return!1}},"./src/demux/sample-aes.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/crypt/decrypter.ts"),D=j("./src/demux/tsdemuxer.ts"),x=function(){function T(f,p,u){this.keyData=void 0,this.decrypter=void 0,this.keyData=u,this.decrypter=new S.default(f,p,{removePKCS7Padding:!1})}var w=T.prototype;return w.decryptBuffer=function(p,u){this.decrypter.decrypt(p,this.keyData.key.buffer,this.keyData.iv.buffer,u)},w.decryptAacSample=function(p,u,o,i){var l=p[u].unit,s=l.subarray(16,l.length-l.length%16),h=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),r=this;this.decryptBuffer(h,function(t){var n=new Uint8Array(t);l.set(n,16),i||r.decryptAacSamples(p,u+1,o)})},w.decryptAacSamples=function(p,u,o){for(;;u++){if(u>=p.length){o();return}if(p[u].unit.length<32)continue;var i=this.decrypter.isSync();if(this.decryptAacSample(p,u,o,i),!i)return}},w.getAvcEncryptedData=function(p){for(var u=Math.floor((p.length-48)/160)*16+16,o=new Int8Array(u),i=0,l=32;l<=p.length-16;l+=160,i+=16)o.set(p.subarray(l,l+16),i);return o},w.getAvcDecryptedUnit=function(p,u){for(var o=new Uint8Array(u),i=0,l=32;l<=p.length-16;l+=160,i+=16)p.set(o.subarray(i,i+16),l);return p},w.decryptAvcSample=function(p,u,o,i,l,s){var h=Object(D.discardEPB)(l.data),r=this.getAvcEncryptedData(h),t=this;this.decryptBuffer(r.buffer,function(n){l.data=t.getAvcDecryptedUnit(h,n),s||t.decryptAvcSamples(p,u,o+1,i)})},w.decryptAvcSamples=function(p,u,o,i){if(p instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;u++,o=0){if(u>=p.length){i();return}for(var l=p[u].units;!(o>=l.length);o++){var s=l[o];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var h=this.decrypter.isSync();if(this.decryptAvcSample(p,u,o,i,s,h),!h)return}}},T}();Q.default=x},"./src/demux/transmuxer-interface.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return l});var S=j("./node_modules/webworkify-webpack/index.js"),D=j.n(S),x=j("./src/events.ts"),T=j("./src/demux/transmuxer.ts"),w=j("./src/utils/logger.ts"),f=j("./src/errors.ts"),p=j("./src/utils/mediasource-helper.ts"),u=j("./node_modules/eventemitter3/index.js"),o=j.n(u),i=Object(p.getMediaSource)()||{isTypeSupported:function(){return!1}},l=function(){function s(r,t,n,c){var m=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=r,this.id=t,this.onTransmuxComplete=n,this.onFlush=c;var v=r.config,b=function(d,_){_=_||{},_.frag=m.frag,_.id=m.id,r.trigger(d,_)};this.observer=new u.EventEmitter,this.observer.on(x.Events.FRAG_DECRYPTED,b),this.observer.on(x.Events.ERROR,b);var E={mp4:i.isTypeSupported("video/mp4"),mpeg:i.isTypeSupported("audio/mpeg"),mp3:i.isTypeSupported('audio/mp4; codecs="mp3"')},g=navigator.vendor;if(v.enableWorker&&typeof Worker!="undefined"){w.logger.log("demuxing in webworker");var y;try{y=this.worker=S("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(C){r.trigger(x.Events.ERROR,{type:f.ErrorTypes.OTHER_ERROR,details:f.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(C.message+" ("+C.filename+":"+C.lineno+")")})},y.postMessage({cmd:"init",typeSupported:E,vendor:g,id:t,config:JSON.stringify(v)})}catch(C){w.logger.warn("Error in worker:",C),w.logger.error("Error while initializing DemuxerWorker, fallback to inline"),y&&self.URL.revokeObjectURL(y.objectURL),this.transmuxer=new T.default(this.observer,E,v,g,t),this.worker=null}}else this.transmuxer=new T.default(this.observer,E,v,g,t)}var h=s.prototype;return h.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var n=this.transmuxer;n&&(n.destroy(),this.transmuxer=null)}var c=this.observer;c&&c.removeAllListeners(),this.observer=null},h.push=function(t,n,c,m,v,b,E,g,y,C){var d=this;y.transmuxing.start=self.performance.now();var _=this.transmuxer,O=this.worker,A=b?b.start:v.start,P=v.decryptdata,I=this.frag,W=!(I&&v.cc===I.cc),K=!(I&&y.level===I.level),te=I?y.sn-I.sn:-1,H=this.part?y.part-this.part.index:1,G=!K&&(te===1||te===0&&H===1),V=self.performance.now();(K||te||v.stats.parsing.start===0)&&(v.stats.parsing.start=V),b&&(H||!G)&&(b.stats.parsing.start=V);var re=new T.TransmuxState(W,G,g,K,A);if(!G||W){w.logger.log("[transmuxer-interface, "+v.type+"]: Starting new transmux session for sn: "+y.sn+" p: "+y.part+" level: "+y.level+" id: "+y.id+`
|
|
|
discontinuity: `+W+`
|
|
|
trackSwitch: `+K+`
|
|
|
contiguous: `+G+`
|
|
|
accurateTimeOffset: `+g+`
|
|
|
timeOffset: `+A);var $=new T.TransmuxConfig(c,m,n,E,C);this.configureTransmuxer($)}if(this.frag=v,this.part=b,O)O.postMessage({cmd:"demux",data:t,decryptdata:P,chunkMeta:y,state:re},t instanceof ArrayBuffer?[t]:[]);else if(_){var ne=_.push(t,P,y,re);Object(T.isPromise)(ne)?ne.then(function(he){d.handleTransmuxComplete(he)}):this.handleTransmuxComplete(ne)}},h.flush=function(t){var n=this;t.transmuxing.start=self.performance.now();var c=this.transmuxer,m=this.worker;if(m)m.postMessage({cmd:"flush",chunkMeta:t});else if(c){var v=c.flush(t);Object(T.isPromise)(v)?v.then(function(b){n.handleFlushResult(b,t)}):this.handleFlushResult(v,t)}},h.handleFlushResult=function(t,n){var c=this;t.forEach(function(m){c.handleTransmuxComplete(m)}),this.onFlush(n)},h.onWorkerMessage=function(t){var n=t.data,c=this.hls;switch(n.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(n.data);break}case"flush":{this.onFlush(n.data);break}default:{n.data=n.data||{},n.data.frag=this.frag,n.data.id=this.id,c.trigger(n.event,n.data);break}}},h.configureTransmuxer=function(t){var n=this.worker,c=this.transmuxer;n?n.postMessage({cmd:"configure",config:t}):c&&c.configure(t)},h.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},s}()},"./src/demux/transmuxer-worker.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return f});var S=j("./src/demux/transmuxer.ts"),D=j("./src/events.ts"),x=j("./src/utils/logger.ts"),T=j("./node_modules/eventemitter3/index.js"),w=j.n(T);function f(l){var s=new T.EventEmitter,h=function(t,n){l.postMessage({event:t,data:n})};s.on(D.Events.FRAG_DECRYPTED,h),s.on(D.Events.ERROR,h),l.addEventListener("message",function(r){var t=r.data;switch(t.cmd){case"init":{var n=JSON.parse(t.config);l.transmuxer=new S.default(s,t.typeSupported,n,t.vendor,t.id),Object(x.enableLogs)(n.debug),h("init",null);break}case"configure":{l.transmuxer.configure(t.config);break}case"demux":{var c=l.transmuxer.push(t.data,t.decryptdata,t.chunkMeta,t.state);Object(S.isPromise)(c)?c.then(function(b){p(l,b)}):p(l,c);break}case"flush":{var m=t.chunkMeta,v=l.transmuxer.flush(m);Object(S.isPromise)(v)?v.then(function(b){o(l,b,m)}):o(l,v,m);break}default:break}})}function p(l,s){if(i(s.remuxResult))return;var h=[],r=s.remuxResult,t=r.audio,n=r.video;t&&u(h,t),n&&u(h,n),l.postMessage({event:"transmuxComplete",data:s},h)}function u(l,s){s.data1&&l.push(s.data1.buffer),s.data2&&l.push(s.data2.buffer)}function o(l,s,h){s.forEach(function(r){p(l,r)}),l.postMessage({event:"flush",data:h})}function i(l){return!l.audio&&!l.video&&!l.text&&!l.id3&&!l.initSegment}},"./src/demux/transmuxer.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return n}),j.d(Q,"isPromise",function(){return v}),j.d(Q,"TransmuxConfig",function(){return b}),j.d(Q,"TransmuxState",function(){return E});var S=j("./src/events.ts"),D=j("./src/errors.ts"),x=j("./src/crypt/decrypter.ts"),T=j("./src/demux/aacdemuxer.ts"),w=j("./src/demux/mp4demuxer.ts"),f=j("./src/demux/tsdemuxer.ts"),p=j("./src/demux/mp3demuxer.ts"),u=j("./src/remux/mp4-remuxer.ts"),o=j("./src/remux/passthrough-remuxer.ts"),i=j("./src/demux/chunk-cache.ts"),l=j("./src/utils/mp4-tools.ts"),s=j("./src/utils/logger.ts"),h;try{h=self.performance.now.bind(self.performance)}catch(g){s.logger.debug("Unable to use Performance API on this environment"),h=self.Date.now}var r=[{demux:f.default,remux:u.default},{demux:w.default,remux:o.default},{demux:T.default,remux:u.default},{demux:p.default,remux:u.default}],t=1024;r.forEach(function(g){var y=g.demux;t=Math.max(t,y.minProbeByteLength)});var n=function(){function g(C,d,_,O,A){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 i.default,this.observer=C,this.typeSupported=d,this.config=_,this.vendor=O,this.id=A}var y=g.prototype;return y.configure=function(d){this.transmuxConfig=d,this.decrypter&&this.decrypter.reset()},y.push=function(d,_,O,A){var P=this,I=O.transmuxing;I.executeStart=h();var W=new Uint8Array(d),K=this.cache,te=this.config,H=this.currentTransmuxState,G=this.transmuxConfig;A&&(this.currentTransmuxState=A);var V=c(W,_);if(V&&V.method==="AES-128"){var re=this.getDecrypter();if(te.enableSoftwareAES){var $=re.softwareDecrypt(W,V.key.buffer,V.iv.buffer);if(!$)return I.executeEnd=h(),m(O);W=new Uint8Array($)}else return this.decryptionPromise=re.webCryptoDecrypt(W,V.key.buffer,V.iv.buffer).then(function(Oe){var Ie=P.push(Oe,null,O);return P.decryptionPromise=null,Ie}),this.decryptionPromise}var ne=A||H,he=ne.contiguous,pe=ne.discontinuity,Te=ne.trackSwitch,we=ne.accurateTimeOffset,Me=ne.timeOffset,Ee=G.audioCodec,xe=G.videoCodec,Ge=G.defaultInitPts,je=G.duration,We=G.initSegmentData;if((pe||Te)&&this.resetInitSegment(We,Ee,xe,je),pe&&this.resetInitialTimestamp(Ge),he||this.resetContiguity(),this.needsProbing(W,pe,Te)){if(K.dataLength){var ze=K.flush();W=Object(l.appendUint8Array)(ze,W)}this.configureTransmuxer(W,G)}var de=this.transmux(W,V,Me,we,O),le=this.currentTransmuxState;return le.contiguous=!0,le.discontinuity=!1,le.trackSwitch=!1,I.executeEnd=h(),de},y.flush=function(d){var _=this,O=d.transmuxing;O.executeStart=h();var A=this.decrypter,P=this.cache,I=this.currentTransmuxState,W=this.decryptionPromise;if(W)return W.then(function(){return _.flush(d)});var K=[],te=I.timeOffset;if(A){var H=A.flush();H&&K.push(this.push(H,null,d))}var G=P.dataLength;P.reset();var V=this.demuxer,re=this.remuxer;if(!V||!re)return G>=t&&this.observer.emit(S.Events.ERROR,S.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),O.executeEnd=h(),[m(d)];var $=V.flush(te);return v($)?$.then(function(ne){return _.flushRemux(K,ne,d),K}):(this.flushRemux(K,$,d),K)},y.flushRemux=function(d,_,O){var A=_.audioTrack,P=_.avcTrack,I=_.id3Track,W=_.textTrack,K=this.currentTransmuxState,te=K.accurateTimeOffset,H=K.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+O.sn+(O.part>-1?" p: "+O.part:"")+" of level "+O.level);var G=this.remuxer.remux(A,P,I,W,H,te,!0,this.id);d.push({remuxResult:G,chunkMeta:O}),O.transmuxing.executeEnd=h()},y.resetInitialTimestamp=function(d){var _=this.demuxer,O=this.remuxer;if(!_||!O)return;_.resetTimeStamp(d),O.resetTimeStamp(d)},y.resetContiguity=function(){var d=this.demuxer,_=this.remuxer;if(!d||!_)return;d.resetContiguity(),_.resetNextTimestamp()},y.resetInitSegment=function(d,_,O,A){var P=this.demuxer,I=this.remuxer;if(!P||!I)return;P.resetInitSegment(_,O,A),I.resetInitSegment(d,_,O)},y.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},y.transmux=function(d,_,O,A,P){var I;return _&&_.method==="SAMPLE-AES"?I=this.transmuxSampleAes(d,_,O,A,P):I=this.transmuxUnencrypted(d,O,A,P),I},y.transmuxUnencrypted=function(d,_,O,A){var P=this.demuxer.demux(d,_,!1,!this.config.progressive),I=P.audioTrack,W=P.avcTrack,K=P.id3Track,te=P.textTrack,H=this.remuxer.remux(I,W,K,te,_,O,!1,this.id);return{remuxResult:H,chunkMeta:A}},y.transmuxSampleAes=function(d,_,O,A,P){var I=this;return this.demuxer.demuxSampleAes(d,_,O).then(function(W){var K=I.remuxer.remux(W.audioTrack,W.avcTrack,W.id3Track,W.textTrack,O,A,!1,I.id);return{remuxResult:K,chunkMeta:P}})},y.configureTransmuxer=function(d,_){for(var O=this.config,A=this.observer,P=this.typeSupported,I=this.vendor,W=_.audioCodec,K=_.defaultInitPts,te=_.duration,H=_.initSegmentData,G=_.videoCodec,V,re=0,$=r.length;re<$;re++)if(r[re].demux.probe(d)){V=r[re];break}V||(s.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),V={demux:w.default,remux:o.default});var ne=this.demuxer,he=this.remuxer,pe=V.remux,Te=V.demux;(!he||!(he instanceof pe))&&(this.remuxer=new pe(A,O,P,I)),(!ne||!(ne instanceof Te))&&(this.demuxer=new Te(A,O,P),this.probe=Te.probe),this.resetInitSegment(H,W,G,te),this.resetInitialTimestamp(K)},y.needsProbing=function(d,_,O){return!this.demuxer||!this.remuxer||_||O},y.getDecrypter=function(){var d=this.decrypter;return d||(d=this.decrypter=new x.default(this.observer,this.config)),d},g}();function c(g,y){var C=null;return g.byteLength>0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(C=y),C}var m=function(y){return{remuxResult:{},chunkMeta:y}};function v(g){return"then"in g&&g.then instanceof Function}var b=function(y,C,d,_,O){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=y,this.videoCodec=C,this.initSegmentData=d,this.duration=_,this.defaultInitPts=O},E=function(y,C,d,_,O){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=y,this.contiguous=C,this.accurateTimeOffset=d,this.trackSwitch=_,this.timeOffset=O}},"./src/demux/tsdemuxer.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"discardEPB",function(){return m});var S=j("./src/demux/adts.ts"),D=j("./src/demux/mpegaudio.ts"),x=j("./src/demux/exp-golomb.ts"),T=j("./src/demux/id3.ts"),w=j("./src/demux/sample-aes.ts"),f=j("./src/events.ts"),p=j("./src/utils/mp4-tools.ts"),u=j("./src/utils/logger.ts"),o=j("./src/errors.ts"),i={video:1,audio:2,id3:3,text:4},l=function(){function v(E,g,y){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=E,this.config=g,this.typeSupported=y}v.probe=function(g){var y=v.syncOffset(g);return y<0?!1:(y&&u.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},v.syncOffset=function(g){for(var y=Math.min(1e3,g.length-3*188),C=0;C<y;){if(g[C]===71&&g[C+188]===71&&g[C+2*188]===71)return C;C++}return-1},v.createTrack=function(g,y){return{container:g==="video"||g==="audio"?"video/mp2t":void 0,type:g,id:i[g],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:g==="audio"?y:void 0}};var b=v.prototype;return b.resetInitSegment=function(g,y,C){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=v.createTrack("video",C),this._audioTrack=v.createTrack("audio",C),this._id3Track=v.createTrack("id3",C),this._txtTrack=v.createTrack("text",C),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=g,this.videoCodec=y,this._duration=C},b.resetTimeStamp=function(){},b.resetContiguity=function(){var g=this._audioTrack,y=this._avcTrack,C=this._id3Track;g&&(g.pesData=null),y&&(y.pesData=null),C&&(C.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},b.demux=function(g,y,C,d){C===void 0&&(C=!1),d===void 0&&(d=!1),C||(this.sampleAes=null);var _,O=this._avcTrack,A=this._audioTrack,P=this._id3Track,I=O.pid,W=O.pesData,K=A.pid,te=P.pid,H=A.pesData,G=P.pesData,V=!1,re=this.pmtParsed,$=this._pmtId,ne=g.length;if(this.remainderData&&(g=Object(p.appendUint8Array)(this.remainderData,g),ne=g.length,this.remainderData=null),ne<188&&!d)return this.remainderData=g,{audioTrack:A,avcTrack:O,id3Track:P,textTrack:this._txtTrack};var he=Math.max(0,v.syncOffset(g));ne-=(ne+he)%188,ne<g.byteLength&&!d&&(this.remainderData=new Uint8Array(g.buffer,ne,g.buffer.byteLength-ne));for(var pe=he;pe<ne;pe+=188)if(g[pe]===71){var Te=!!(g[pe+1]&64),we=((g[pe+1]&31)<<8)+g[pe+2],Me=(g[pe+3]&48)>>4,Ee=void 0;if(Me>1){if(Ee=pe+5+g[pe+4],Ee===pe+188)continue}else Ee=pe+4;switch(we){case I:Te&&(W&&(_=t(W))&&this.parseAVCPES(_,!1),W={data:[],size:0}),W&&(W.data.push(g.subarray(Ee,pe+188)),W.size+=pe+188-Ee);break;case K:Te&&(H&&(_=t(H))&&(A.isAAC?this.parseAACPES(_):this.parseMPEGPES(_)),H={data:[],size:0}),H&&(H.data.push(g.subarray(Ee,pe+188)),H.size+=pe+188-Ee);break;case te:Te&&(G&&(_=t(G))&&this.parseID3PES(_),G={data:[],size:0}),G&&(G.data.push(g.subarray(Ee,pe+188)),G.size+=pe+188-Ee);break;case 0:Te&&(Ee+=g[Ee]+1),$=this._pmtId=h(g,Ee);break;case $:{Te&&(Ee+=g[Ee]+1);var xe=r(g,Ee,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,C);I=xe.avc,I>0&&(O.pid=I),K=xe.audio,K>0&&(A.pid=K,A.isAAC=xe.isAAC),te=xe.id3,te>0&&(P.pid=te),V&&!re&&(u.logger.log("reparse from beginning"),V=!1,pe=he-188),re=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(f.Events.ERROR,f.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});O.pesData=W,A.pesData=H,P.pesData=G;var Ge={audioTrack:A,avcTrack:O,id3Track:P,textTrack:this._txtTrack};return d&&this.extractRemainingSamples(Ge),Ge},b.flush=function(){var g=this.remainderData;this.remainderData=null;var y;return g?y=this.demux(g,-1,!1,!0):y={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(y),this.sampleAes?this.decrypt(y,this.sampleAes):y},b.extractRemainingSamples=function(g){var y=g.audioTrack,C=g.avcTrack,d=g.id3Track,_=C.pesData,O=y.pesData,A=d.pesData,P;_&&(P=t(_))?(this.parseAVCPES(P,!0),C.pesData=null):C.pesData=_,O&&(P=t(O))?(y.isAAC?this.parseAACPES(P):this.parseMPEGPES(P),y.pesData=null):(O!=null&&O.size&&u.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=O),A&&(P=t(A))?(this.parseID3PES(P),d.pesData=null):d.pesData=A},b.demuxSampleAes=function(g,y,C){var d=this.demux(g,C,!0,!this.config.progressive),_=this.sampleAes=new w.default(this.observer,this.config,y);return this.decrypt(d,_)},b.decrypt=function(g,y){return new Promise(function(C){var d=g.audioTrack,_=g.avcTrack;d.samples&&d.isAAC?y.decryptAacSamples(d.samples,0,function(){_.samples?y.decryptAvcSamples(_.samples,0,0,function(){C(g)}):C(g)}):_.samples&&y.decryptAvcSamples(_.samples,0,0,function(){C(g)})})},b.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},b.parseAVCPES=function(g,y){var C=this,d=this._avcTrack,_=this.parseAVCNALu(g.data),O=!1,A=this.avcSample,P,I=!1;g.data=null,A&&_.length&&!d.audFound&&(n(A,d),A=this.avcSample=s(!1,g.pts,g.dts,"")),_.forEach(function(W){switch(W.type){case 1:{P=!0,A||(A=C.avcSample=s(!0,g.pts,g.dts,"")),O&&(A.debug+="NDR "),A.frame=!0;var K=W.data;if(I&&K.length>4){var te=new x.default(K).readSliceType();(te===2||te===4||te===7||te===9)&&(A.key=!0)}break}case 5:P=!0,A||(A=C.avcSample=s(!0,g.pts,g.dts,"")),O&&(A.debug+="IDR "),A.key=!0,A.frame=!0;break;case 6:{P=!0,O&&A&&(A.debug+="SEI ");var H=new x.default(m(W.data));H.readUByte();for(var G=0,V=0,re=!1,$=0;!re&&H.bytesAvailable>1;){G=0;do $=H.readUByte(),G+=$;while($===255);V=0;do $=H.readUByte(),V+=$;while($===255);if(G===4&&H.bytesAvailable!==0){re=!0;var ne=H.readUByte();if(ne===181){var he=H.readUShort();if(he===49){var pe=H.readUInt();if(pe===1195456820){var Te=H.readUByte();if(Te===3){for(var we=H.readUByte(),Me=H.readUByte(),Ee=31&we,xe=[we,Me],Ge=0;Ge<Ee;Ge++)xe.push(H.readUByte()),xe.push(H.readUByte()),xe.push(H.readUByte());c(C._txtTrack.samples,{type:3,pts:g.pts,bytes:xe})}}}}}else if(G===5&&H.bytesAvailable!==0){if(re=!0,V>16){for(var je=[],We=0;We<16;We++)je.push(H.readUByte().toString(16)),(We===3||We===5||We===7||We===9)&&je.push("-");for(var ze=V-16,de=new Uint8Array(ze),le=0;le<ze;le++)de[le]=H.readUByte();c(C._txtTrack.samples,{pts:g.pts,payloadType:G,uuid:je.join(""),userData:Object(T.utf8ArrayToStr)(de),userDataBytes:de})}}else if(V<H.bytesAvailable)for(var Oe=0;Oe<V;Oe++)H.readUByte()}break}case 7:if(P=!0,I=!0,O&&A&&(A.debug+="SPS "),!d.sps){var Ie=new x.default(W.data),qe=Ie.readSPS();d.width=qe.width,d.height=qe.height,d.pixelRatio=qe.pixelRatio,d.sps=[W.data],d.duration=C._duration;for(var ee=W.data.subarray(1,4),k="avc1.",U=0;U<3;U++){var q=ee[U].toString(16);q.length<2&&(q="0"+q),k+=q}d.codec=k}break;case 8:P=!0,O&&A&&(A.debug+="PPS "),d.pps||(d.pps=[W.data]);break;case 9:P=!1,d.audFound=!0,A&&n(A,d),A=C.avcSample=s(!1,g.pts,g.dts,O?"AUD ":"");break;case 12:P=!1;break;default:P=!1,A&&(A.debug+="unknown NAL "+W.type+" ");break}if(A&&P){var Y=A.units;Y.push(W)}}),y&&A&&(n(A,d),this.avcSample=null)},b.getLastNalUnit=function(){var g,y=this.avcSample,C;if(!y||y.units.length===0){var d=this._avcTrack.samples;y=d[d.length-1]}if((g=y)!==null&&g!==void 0&&g.units){var _=y.units;C=_[_.length-1]}return C},b.parseAVCNALu=function(g){var y=g.byteLength,C=this._avcTrack,d=C.naluState||0,_=d,O=[],A=0,P,I,W,K=-1,te=0;for(d===-1&&(K=0,te=g[0]&31,d=0,A=1);A<y;){if(P=g[A++],!d){d=P?0:1;continue}if(d===1){d=P?0:2;continue}if(!P)d=3;else if(P===1){if(K>=0){var H={data:g.subarray(K,A-d-1),type:te};O.push(H)}else{var G=this.getLastNalUnit();if(G&&(_&&A<=4-_&&(G.state&&(G.data=G.data.subarray(0,G.data.byteLength-_))),I=A-d-1,I>0)){var V=new Uint8Array(G.data.byteLength+I);V.set(G.data,0),V.set(g.subarray(0,I),G.data.byteLength),G.data=V,G.state=0}}A<y?(W=g[A]&31,K=A,te=W,d=0):d=-1}else d=0}if(K>=0&&d>=0){var re={data:g.subarray(K,y),type:te,state:d};O.push(re)}if(O.length===0){var $=this.getLastNalUnit();if($){var ne=new Uint8Array($.data.byteLength+g.byteLength);ne.set($.data,0),ne.set(g,$.data.byteLength),$.data=ne}}return C.naluState=d,O},b.parseAACPES=function(g){var y=0,C=this._audioTrack,d=this.aacOverFlow,_=g.data;if(d){this.aacOverFlow=null;var O=d.sample.unit.byteLength,A=Math.min(d.missing,O),P=O-A;d.sample.unit.set(_.subarray(0,A),P),C.samples.push(d.sample),y=d.missing}var I,W;for(I=y,W=_.length;I<W-1&&!S.isHeader(_,I);I++);if(I!==y){var K,te;if(I<W-1?(K="AAC PES did not start with ADTS header,offset:"+I,te=!1):(K="no ADTS header found in AAC PES",te=!0),u.logger.warn("parsing error:"+K),this.observer.emit(f.Events.ERROR,f.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:te,reason:K}),te)return}S.initTrackConfig(C,this.observer,_,I,this.audioCodec);var H;if(g.pts!==void 0)H=g.pts;else if(d){var G=S.getFrameDuration(C.samplerate);H=d.sample.pts+G}else{u.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var V=0;I<W;)if(S.isHeader(_,I)){if(I+5<W){var re=S.appendFrame(C,_,I,H,V);if(re)if(re.missing)this.aacOverFlow=re;else{I+=re.length,V++;continue}}break}else I++},b.parseMPEGPES=function(g){var y=g.data,C=y.length,d=0,_=0,O=g.pts;if(O===void 0){u.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;_<C;)if(D.isHeader(y,_)){var A=D.appendFrame(this._audioTrack,y,_,O,d);if(A)_+=A.length,d++;else break}else _++},b.parseID3PES=function(g){if(g.pts===void 0){u.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(g)},v}();l.minProbeByteLength=188;function s(v,b,E,g){return{key:v,frame:!1,pts:b,dts:E,units:[],debug:g,length:0}}function h(v,b){return(v[b+10]&31)<<8|v[b+11]}function r(v,b,E,g){var y={audio:-1,avc:-1,id3:-1,isAAC:!0},C=(v[b+1]&15)<<8|v[b+2],d=b+3+C-4,_=(v[b+10]&15)<<8|v[b+11];for(b+=12+_;b<d;){var O=(v[b+1]&31)<<8|v[b+2];switch(v[b]){case 207:if(!g){u.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:y.audio===-1&&(y.audio=O);break;case 21:y.id3===-1&&(y.id3=O);break;case 219:if(!g){u.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:y.avc===-1&&(y.avc=O);break;case 3:case 4:E?y.audio===-1&&(y.audio=O,y.isAAC=!1):u.logger.log("MPEG audio found, not supported in this browser");break;case 36:u.logger.warn("Unsupported HEVC stream type found");break;default:break}b+=((v[b+3]&15)<<8|v[b+4])+5}return y}function t(v){var b=0,E,g,y,C,d,_=v.data;if(!v||v.size===0)return null;for(;_[0].length<19&&_.length>1;){var O=new Uint8Array(_[0].length+_[1].length);O.set(_[0]),O.set(_[1],_[0].length),_[0]=O,_.splice(1,1)}E=_[0];var A=(E[0]<<16)+(E[1]<<8)+E[2];if(A===1){if(g=(E[4]<<8)+E[5],g&&g>v.size-6)return null;var P=E[7];P&192&&(C=(E[9]&14)*536870912+(E[10]&255)*4194304+(E[11]&254)*16384+(E[12]&255)*128+(E[13]&254)/2,P&64?(d=(E[14]&14)*536870912+(E[15]&255)*4194304+(E[16]&254)*16384+(E[17]&255)*128+(E[18]&254)/2,C-d>60*9e4&&(u.logger.warn(Math.round((C-d)/9e4)+"s delta between PTS and DTS, align them"),C=d)):d=C),y=E[8];var I=y+9;if(v.size<=I)return null;v.size-=I;for(var W=new Uint8Array(v.size),K=0,te=_.length;K<te;K++){E=_[K];var H=E.byteLength;if(I)if(I>H){I-=H;continue}else E=E.subarray(I),H-=I,I=0;W.set(E,b),b+=H}return g&&(g-=y+3),{data:W,pts:C,dts:d,len:g}}return null}function n(v,b){if(v.units.length&&v.frame){if(v.pts===void 0){var E=b.samples,g=E.length;if(g){var y=E[g-1];v.pts=y.pts,v.dts=y.dts}else{b.dropped++;return}}b.samples.push(v)}v.debug.length&&u.logger.log(v.pts+"/"+v.dts+":"+v.debug)}function c(v,b){var E=v.length;if(E>0){if(b.pts>=v[E-1].pts)v.push(b);else for(var g=E-1;g>=0;g--)if(b.pts<v[g].pts){v.splice(g,0,b);break}}else v.push(b)}function m(v){for(var b=v.byteLength,E=[],g=1;g<b-2;)v[g]===0&&v[g+1]===0&&v[g+2]===3?(E.push(g+2),g+=2):g++;if(E.length===0)return v;var y=b-E.length,C=new Uint8Array(y),d=0;for(g=0;g<y;d++,g++)d===E[0]&&(d++,E.shift()),C[g]=v[d];return C}Q.default=l},"./src/errors.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"ErrorTypes",function(){return S}),j.d(Q,"ErrorDetails",function(){return D});var S;(function(x){x.NETWORK_ERROR="networkError",x.MEDIA_ERROR="mediaError",x.KEY_SYSTEM_ERROR="keySystemError",x.MUX_ERROR="muxError",x.OTHER_ERROR="otherError"})(S||(S={}));var D;(function(x){x.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",x.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",x.KEY_SYSTEM_NO_SESSION="keySystemNoSession",x.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",x.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",x.MANIFEST_LOAD_ERROR="manifestLoadError",x.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",x.MANIFEST_PARSING_ERROR="manifestParsingError",x.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",x.LEVEL_EMPTY_ERROR="levelEmptyError",x.LEVEL_LOAD_ERROR="levelLoadError",x.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",x.LEVEL_SWITCH_ERROR="levelSwitchError",x.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",x.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",x.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",x.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",x.FRAG_LOAD_ERROR="fragLoadError",x.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",x.FRAG_DECRYPT_ERROR="fragDecryptError",x.FRAG_PARSING_ERROR="fragParsingError",x.REMUX_ALLOC_ERROR="remuxAllocError",x.KEY_LOAD_ERROR="keyLoadError",x.KEY_LOAD_TIMEOUT="keyLoadTimeOut",x.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",x.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",x.BUFFER_APPEND_ERROR="bufferAppendError",x.BUFFER_APPENDING_ERROR="bufferAppendingError",x.BUFFER_STALLED_ERROR="bufferStalledError",x.BUFFER_FULL_ERROR="bufferFullError",x.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",x.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",x.INTERNAL_EXCEPTION="internalException",x.INTERNAL_ABORTED="aborted",x.UNKNOWN="unknown"})(D||(D={}))},"./src/events.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"Events",function(){return S});var S;(function(D){D.MEDIA_ATTACHING="hlsMediaAttaching",D.MEDIA_ATTACHED="hlsMediaAttached",D.MEDIA_DETACHING="hlsMediaDetaching",D.MEDIA_DETACHED="hlsMediaDetached",D.BUFFER_RESET="hlsBufferReset",D.BUFFER_CODECS="hlsBufferCodecs",D.BUFFER_CREATED="hlsBufferCreated",D.BUFFER_APPENDING="hlsBufferAppending",D.BUFFER_APPENDED="hlsBufferAppended",D.BUFFER_EOS="hlsBufferEos",D.BUFFER_FLUSHING="hlsBufferFlushing",D.BUFFER_FLUSHED="hlsBufferFlushed",D.MANIFEST_LOADING="hlsManifestLoading",D.MANIFEST_LOADED="hlsManifestLoaded",D.MANIFEST_PARSED="hlsManifestParsed",D.LEVEL_SWITCHING="hlsLevelSwitching",D.LEVEL_SWITCHED="hlsLevelSwitched",D.LEVEL_LOADING="hlsLevelLoading",D.LEVEL_LOADED="hlsLevelLoaded",D.LEVEL_UPDATED="hlsLevelUpdated",D.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",D.LEVELS_UPDATED="hlsLevelsUpdated",D.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",D.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",D.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",D.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",D.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",D.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",D.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",D.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",D.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",D.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",D.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",D.CUES_PARSED="hlsCuesParsed",D.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",D.INIT_PTS_FOUND="hlsInitPtsFound",D.FRAG_LOADING="hlsFragLoading",D.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",D.FRAG_LOADED="hlsFragLoaded",D.FRAG_DECRYPTED="hlsFragDecrypted",D.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",D.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",D.FRAG_PARSING_METADATA="hlsFragParsingMetadata",D.FRAG_PARSED="hlsFragParsed",D.FRAG_BUFFERED="hlsFragBuffered",D.FRAG_CHANGED="hlsFragChanged",D.FPS_DROP="hlsFpsDrop",D.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",D.ERROR="hlsError",D.DESTROYING="hlsDestroying",D.KEY_LOADING="hlsKeyLoading",D.KEY_LOADED="hlsKeyLoaded",D.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",D.BACK_BUFFER_REACHED="hlsBackBufferReached"})(S||(S={}))},"./src/hls.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return v});var S=j("./node_modules/url-toolkit/src/url-toolkit.js"),D=j.n(S),x=j("./src/loader/playlist-loader.ts"),T=j("./src/loader/key-loader.ts"),w=j("./src/controller/id3-track-controller.ts"),f=j("./src/controller/latency-controller.ts"),p=j("./src/controller/level-controller.ts"),u=j("./src/controller/fragment-tracker.ts"),o=j("./src/controller/stream-controller.ts"),i=j("./src/is-supported.ts"),l=j("./src/utils/logger.ts"),s=j("./src/config.ts"),h=j("./node_modules/eventemitter3/index.js"),r=j.n(h),t=j("./src/events.ts"),n=j("./src/errors.ts");function c(b,E){for(var g=0;g<E.length;g++){var y=E[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,y.key,y)}}function m(b,E,g){return E&&c(b.prototype,E),g&&c(b,g),b}var v=function(){b.isSupported=function(){return Object(i.isSupported)()};function b(g){g===void 0&&(g={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new h.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 y=this.config=Object(s.mergeConfig)(b.DefaultConfig,g);this.userConfig=g,Object(l.enableLogs)(y.debug),this._autoLevelCapping=-1,y.progressive&&Object(s.enableStreamingMode)(y);var C=y.abrController,d=y.bufferController,_=y.capLevelController,O=y.fpsController,A=this.abrController=new C(this),P=this.bufferController=new d(this),I=this.capLevelController=new _(this),W=new O(this),K=new x.default(this),te=new T.default(this),H=new w.default(this),G=this.levelController=new p.default(this),V=new u.FragmentTracker(this),re=this.streamController=new o.default(this,V);I.setStreamController(re),W.setStreamController(re);var $=[G,re];this.networkControllers=$;var ne=[K,te,A,P,I,W,H,V];this.audioTrackController=this.createController(y.audioTrackController,null,$),this.createController(y.audioStreamController,V,$),this.subtitleTrackController=this.createController(y.subtitleTrackController,null,$),this.createController(y.subtitleStreamController,V,$),this.createController(y.timelineController,null,ne),this.emeController=this.createController(y.emeController,null,ne),this.cmcdController=this.createController(y.cmcdController,null,ne),this.latencyController=this.createController(f.default,null,ne),this.coreComponents=ne}var E=b.prototype;return E.createController=function(y,C,d){if(y){var _=C?new y(this,C):new y(this);return d&&d.push(_),_}return null},E.on=function(y,C,d){d===void 0&&(d=this),this._emitter.on(y,C,d)},E.once=function(y,C,d){d===void 0&&(d=this),this._emitter.once(y,C,d)},E.removeAllListeners=function(y){this._emitter.removeAllListeners(y)},E.off=function(y,C,d,_){d===void 0&&(d=this),this._emitter.off(y,C,d,_)},E.listeners=function(y){return this._emitter.listeners(y)},E.emit=function(y,C,d){return this._emitter.emit(y,C,d)},E.trigger=function(y,C){if(this.config.debug)return this.emit(y,y,C);try{return this.emit(y,y,C)}catch(d){l.logger.error("An internal error happened while handling event "+y+'. Error message: "'+d.message+'". Here is a stacktrace:',d),this.trigger(t.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:y,error:d})}return!1},E.listenerCount=function(y){return this._emitter.listenerCount(y)},E.destroy=function(){l.logger.log("destroy"),this.trigger(t.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(y){return y.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(y){return y.destroy()}),this.coreComponents.length=0},E.attachMedia=function(y){l.logger.log("attachMedia"),this._media=y,this.trigger(t.Events.MEDIA_ATTACHING,{media:y})},E.detachMedia=function(){l.logger.log("detachMedia"),this.trigger(t.Events.MEDIA_DETACHING,void 0),this._media=null},E.loadSource=function(y){this.stopLoad();var C=this.media,d=this.url,_=this.url=S.buildAbsoluteURL(self.location.href,y,{alwaysNormalize:!0});l.logger.log("loadSource:"+_),C&&d&&d!==_&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(C)),this.trigger(t.Events.MANIFEST_LOADING,{url:y})},E.startLoad=function(y){y===void 0&&(y=-1),l.logger.log("startLoad("+y+")"),this.networkControllers.forEach(function(C){C.startLoad(y)})},E.stopLoad=function(){l.logger.log("stopLoad"),this.networkControllers.forEach(function(y){y.stopLoad()})},E.swapAudioCodec=function(){l.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},E.recoverMediaError=function(){l.logger.log("recoverMediaError");var y=this._media;this.detachMedia(),y&&this.attachMedia(y)},E.removeLevel=function(y,C){C===void 0&&(C=0),this.levelController.removeLevel(y,C)},m(b,[{key:"levels",get:function(){var y=this.levelController.levels;return y||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(y){l.logger.log("set currentLevel:"+y),this.loadLevel=y,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(y){l.logger.log("set nextLevel:"+y),this.levelController.manualLevel=y,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(y){l.logger.log("set loadLevel:"+y),this.levelController.manualLevel=y}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(y){this.levelController.nextLoadLevel=y}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(y){l.logger.log("set firstLevel:"+y),this.levelController.firstLevel=y}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(y){l.logger.log("set startLevel:"+y),y!==-1&&(y=Math.max(y,this.minAutoLevel)),this.levelController.startLevel=y}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(y){var C=!!y;C!==this.config.capLevelToPlayerSize&&(C?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=C)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(y){this._autoLevelCapping!==y&&(l.logger.log("set autoLevelCapping:"+y),this._autoLevelCapping=y)}},{key:"bandwidthEstimate",get:function(){var y=this.abrController.bwEstimator;return y?y.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var y=this.levels,C=this.config.minAutoBitrate;if(!y)return 0;for(var d=y.length,_=0;_<d;_++)if(y[_].maxBitrate>C)return _;return 0}},{key:"maxAutoLevel",get:function(){var y=this.levels,C=this.autoLevelCapping,d;return C===-1&&y&&y.length?d=y.length-1:d=C,d}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(y){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,y)}},{key:"audioTracks",get:function(){var y=this.audioTrackController;return y?y.audioTracks:[]}},{key:"audioTrack",get:function(){var y=this.audioTrackController;return y?y.audioTrack:-1},set:function(y){var C=this.audioTrackController;C&&(C.audioTrack=y)}},{key:"subtitleTracks",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTrack:-1},set:function(y){var C=this.subtitleTrackController;C&&(C.subtitleTrack=y)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var y=this.subtitleTrackController;return y?y.subtitleDisplay:!1},set:function(y){var C=this.subtitleTrackController;C&&(C.subtitleDisplay=y)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(y){this.config.lowLatencyMode=y}},{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 t.Events}},{key:"ErrorTypes",get:function(){return n.ErrorTypes}},{key:"ErrorDetails",get:function(){return n.ErrorDetails}},{key:"DefaultConfig",get:function(){return b.defaultConfig?b.defaultConfig:s.hlsDefaultConfig},set:function(y){b.defaultConfig=y}}]),b}();v.defaultConfig=void 0},"./src/is-supported.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"isSupported",function(){return x}),j.d(Q,"changeTypeSupported",function(){return T});var S=j("./src/utils/mediasource-helper.ts");function D(){return self.SourceBuffer||self.WebKitSourceBuffer}function x(){var w=Object(S.getMediaSource)();if(!w)return!1;var f=D(),p=w&&typeof w.isTypeSupported=="function"&&w.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),u=!f||f.prototype&&typeof f.prototype.appendBuffer=="function"&&typeof f.prototype.remove=="function";return!!p&&!!u}function T(){var w,f=D();return typeof(f==null||((w=f.prototype)===null||w===void 0)?void 0:w.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return l}),j.d(Q,"LoadError",function(){return h});var S=j("./src/polyfills/number.ts"),D=j("./src/errors.ts");function x(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,u(r,t)}function T(r){var t=typeof Map=="function"?new Map:void 0;return T=function(c){if(c===null||!p(c))return c;if(typeof c!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(c))return t.get(c);t.set(c,m)}function m(){return w(c,arguments,o(this).constructor)}return m.prototype=Object.create(c.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),u(m,c)},T(r)}function w(r,t,n){return f()?w=Reflect.construct:w=function(m,v,b){var E=[null];E.push.apply(E,v);var g=Function.bind.apply(m,E),y=new g;return b&&u(y,b.prototype),y},w.apply(null,arguments)}function f(){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 p(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function u(r,t){return u=Object.setPrototypeOf||function(c,m){return c.__proto__=m,c},u(r,t)}function o(r){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},o(r)}var i=Math.pow(2,17),l=function(){function r(n){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=n}var t=r.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(c,m){var v=this,b=c.url;if(!b)return Promise.reject(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,networkDetails:null},"Fragment does not have a "+(b?"part list":"url")));this.abort();var E=this.config,g=E.fLoader,y=E.loader;return new Promise(function(C,d){v.loader&&v.loader.destroy();var _=v.loader=c.loader=g?new g(E):new y(E),O=s(c),A={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:i};c.stats=_.stats,_.load(O,A,{onSuccess:function(I,W,K,te){v.resetLoader(c,_),C({frag:c,part:null,payload:I.data,networkDetails:te})},onError:function(I,W,K){v.resetLoader(c,_),d(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,response:I,networkDetails:K}))},onAbort:function(I,W,K){v.resetLoader(c,_),d(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,networkDetails:K}))},onTimeout:function(I,W,K){v.resetLoader(c,_),d(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,networkDetails:K}))},onProgress:function(I,W,K,te){m&&m({frag:c,part:null,payload:K,networkDetails:te})}})})},t.loadPart=function(c,m,v){var b=this;this.abort();var E=this.config,g=E.fLoader,y=E.loader;return new Promise(function(C,d){b.loader&&b.loader.destroy();var _=b.loader=c.loader=g?new g(E):new y(E),O=s(c,m),A={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:i};m.stats=_.stats,_.load(O,A,{onSuccess:function(I,W,K,te){b.resetLoader(c,_),b.updateStatsFromPart(c,m);var H={frag:c,part:m,payload:I.data,networkDetails:te};v(H),C(H)},onError:function(I,W,K){b.resetLoader(c,_),d(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,part:m,response:I,networkDetails:K}))},onAbort:function(I,W,K){c.stats.aborted=m.stats.aborted,b.resetLoader(c,_),d(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,part:m,networkDetails:K}))},onTimeout:function(I,W,K){b.resetLoader(c,_),d(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,part:m,networkDetails:K}))}})})},t.updateStatsFromPart=function(c,m){var v=c.stats,b=m.stats,E=b.total;if(v.loaded+=b.loaded,E){var g=Math.round(c.duration/m.duration),y=Math.min(Math.round(v.loaded/E),g),C=g-y,d=C*Math.round(v.loaded/y);v.total=v.loaded+d}else v.total=Math.max(v.loaded,v.total);var _=v.loading,O=b.loading;_.start?_.first+=O.first-O.start:(_.start=O.start,_.first=O.first),_.end=O.end},t.resetLoader=function(c,m){c.loader=null,this.loader===m&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),m.destroy()},r}();function s(r,t){t===void 0&&(t=null);var n=t||r,c={frag:r,part:t,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},m=n.byteRangeStartOffset,v=n.byteRangeEndOffset;return Object(S.isFiniteNumber)(m)&&Object(S.isFiniteNumber)(v)&&(c.rangeStart=m,c.rangeEnd=v),c}var h=function(r){x(t,r);function t(n){for(var c,m=arguments.length,v=new Array(m>1?m-1:0),b=1;b<m;b++)v[b-1]=arguments[b];return c=r.call.apply(r,[this].concat(v))||this,c.data=void 0,c.data=n,c}return t}(T(Error))},"./src/loader/fragment.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"ElementaryStreamTypes",function(){return l}),j.d(Q,"BaseSegment",function(){return s}),j.d(Q,"Fragment",function(){return h}),j.d(Q,"Part",function(){return r});var S=j("./src/polyfills/number.ts"),D=j("./node_modules/url-toolkit/src/url-toolkit.js"),x=j.n(D),T=j("./src/utils/logger.ts"),w=j("./src/loader/level-key.ts"),f=j("./src/loader/load-stats.ts");function p(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,u(t,n)}function u(t,n){return u=Object.setPrototypeOf||function(m,v){return m.__proto__=v,m},u(t,n)}function o(t,n){for(var c=0;c<n.length;c++){var m=n[c];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(t,m.key,m)}}function i(t,n,c){return n&&o(t.prototype,n),c&&o(t,c),t}var l;(function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"})(l||(l={}));var s=function(){function t(c){var m;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(m={},m[l.AUDIO]=null,m[l.VIDEO]=null,m[l.AUDIOVIDEO]=null,m),this.baseurl=c}var n=t.prototype;return n.setByteRange=function(m,v){var b=m.split("@",2),E=[];b.length===1?E[0]=v?v.byteRangeEndOffset:0:E[0]=parseInt(b[1]),E[1]=parseInt(b[0])+E[0],this._byteRange=E},i(t,[{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(D.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(m){this._url=m}}]),t}(),h=function(t){p(n,t);function n(m,v){var b;return b=t.call(this,v)||this,b._decryptdata=null,b.rawProgramDateTime=null,b.programDateTime=null,b.tagList=[],b.duration=0,b.sn=0,b.levelkey=void 0,b.type=void 0,b.loader=null,b.level=-1,b.cc=0,b.startPTS=void 0,b.endPTS=void 0,b.appendedPTS=void 0,b.startDTS=void 0,b.endDTS=void 0,b.start=0,b.deltaPTS=void 0,b.maxStartPTS=void 0,b.minEndPTS=void 0,b.stats=new f.LoadStats,b.urlId=0,b.data=void 0,b.bitrateTest=!1,b.title=null,b.initSegment=null,b.type=m,b}var c=n.prototype;return c.createInitializationVector=function(v){for(var b=new Uint8Array(16),E=12;E<16;E++)b[E]=v>>8*(15-E)&255;return b},c.setDecryptDataFromLevelKey=function(v,b){var E=v;return(v==null?void 0:v.method)==="AES-128"&&v.uri&&!v.iv&&(E=w.LevelKey.fromURI(v.uri),E.method=v.method,E.iv=this.createInitializationVector(b),E.keyFormat="identity"),E},c.setElementaryStreamInfo=function(v,b,E,g,y,C){C===void 0&&(C=!1);var d=this.elementaryStreams,_=d[v];if(!_){d[v]={startPTS:b,endPTS:E,startDTS:g,endDTS:y,partial:C};return}_.startPTS=Math.min(_.startPTS,b),_.endPTS=Math.max(_.endPTS,E),_.startDTS=Math.min(_.startDTS,g),_.endDTS=Math.max(_.endDTS,y)},c.clearElementaryStreamInfo=function(){var v=this.elementaryStreams;v[l.AUDIO]=null,v[l.VIDEO]=null,v[l.AUDIOVIDEO]=null},i(n,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var v=this.sn;typeof v!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&T.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),v=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,v)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(S.isFiniteNumber)(this.programDateTime))return null;var v=Object(S.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+v*1e3}},{key:"encrypted",get:function(){var v;return!!((v=this.decryptdata)!==null&&v!==void 0&&v.keyFormat&&this.decryptdata.uri)}}]),n}(s),r=function(t){p(n,t);function n(c,m,v,b,E){var g;g=t.call(this,v)||this,g.fragOffset=0,g.duration=0,g.gap=!1,g.independent=!1,g.relurl=void 0,g.fragment=void 0,g.index=void 0,g.stats=new f.LoadStats,g.duration=c.decimalFloatingPoint("DURATION"),g.gap=c.bool("GAP"),g.independent=c.bool("INDEPENDENT"),g.relurl=c.enumeratedString("URI"),g.fragment=m,g.index=b;var y=c.enumeratedString("BYTERANGE");return y&&g.setByteRange(y,E),E&&(g.fragOffset=E.fragOffset+E.duration),g}return i(n,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var m=this.elementaryStreams;return!!(m.audio||m.video||m.audiovideo)}}]),n}(s)},"./src/loader/key-loader.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return T});var S=j("./src/events.ts"),D=j("./src/errors.ts"),x=j("./src/utils/logger.ts"),T=function(){function w(p){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=p,this._registerListeners()}var f=w.prototype;return f._registerListeners=function(){this.hls.on(S.Events.KEY_LOADING,this.onKeyLoading,this)},f._unregisterListeners=function(){this.hls.off(S.Events.KEY_LOADING,this.onKeyLoading)},f.destroy=function(){this._unregisterListeners();for(var u in this.loaders){var o=this.loaders[u];o&&o.destroy()}this.loaders={}},f.onKeyLoading=function(u,o){var i=o.frag,l=i.type,s=this.loaders[l];if(!i.decryptdata){x.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var h=i.decryptdata.uri;if(h!==this.decrypturl||this.decryptkey===null){var r=this.hls.config;if(s&&(x.logger.warn("abort previous key loader for type:"+l),s.abort()),!h){x.logger.warn("key uri is falsy");return}var t=r.loader,n=i.loader=this.loaders[l]=new t(r);this.decrypturl=h,this.decryptkey=null;var c={url:h,frag:i,responseType:"arraybuffer"},m={timeout:r.fragLoadingTimeOut,maxRetry:0,retryDelay:r.fragLoadingRetryDelay,maxRetryDelay:r.fragLoadingMaxRetryTimeout,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};n.load(c,m,v)}else this.decryptkey&&(i.decryptdata.key=this.decryptkey,this.hls.trigger(S.Events.KEY_LOADED,{frag:i}))},f.loadsuccess=function(u,o,i){var l=i.frag;if(!l.decryptdata){x.logger.error("after key load, decryptdata unset");return}this.decryptkey=l.decryptdata.key=new Uint8Array(u.data),l.loader=null,delete this.loaders[l.type],this.hls.trigger(S.Events.KEY_LOADED,{frag:l})},f.loaderror=function(u,o){var i=o.frag,l=i.loader;l&&l.abort(),delete this.loaders[i.type],this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:i,response:u})},f.loadtimeout=function(u,o){var i=o.frag,l=i.loader;l&&l.abort(),delete this.loaders[i.type],this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:i})},w}()},"./src/loader/level-details.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"LevelDetails",function(){return w});var S=j("./src/polyfills/number.ts");function D(f,p){for(var u=0;u<p.length;u++){var o=p[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(f,o.key,o)}}function x(f,p,u){return p&&D(f.prototype,p),u&&D(f,u),f}var T=10,w=function(){function f(u){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=u}var p=f.prototype;return p.reloaded=function(o){if(!o){this.advanced=!0,this.updated=!0;return}var i=this.lastPartSn-o.lastPartSn,l=this.lastPartIndex-o.lastPartIndex;this.updated=this.endSN!==o.endSN||!!l||!!i,this.advanced=this.endSN>o.endSN||i>0||i===0&&l>0,this.updated||this.advanced?this.misses=Math.floor(o.misses*.6):this.misses=o.misses+1,this.availabilityDelay=o.availabilityDelay},x(f,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(S.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||T}},{key:"drift",get:function(){var o=this.driftEndTime-this.driftStartTime;if(o>0){var i=this.driftEnd-this.driftStart;return i*1e3/o}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var o;return(o=this.partList)!==null&&o!==void 0&&o.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var o;return(o=this.fragments)!==null&&o!==void 0&&o.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 o;return(o=this.partList)!==null&&o!==void 0&&o.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var o;return(o=this.partList)!==null&&o!==void 0&&o.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),f}()},"./src/loader/level-key.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"LevelKey",function(){return w});var S=j("./node_modules/url-toolkit/src/url-toolkit.js"),D=j.n(S);function x(f,p){for(var u=0;u<p.length;u++){var o=p[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(f,o.key,o)}}function T(f,p,u){return p&&x(f.prototype,p),u&&x(f,u),f}var w=function(){f.fromURL=function(u,o){return new f(u,o)},f.fromURI=function(u){return new f(u)};function f(p,u){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,u?this._uri=Object(S.buildAbsoluteURL)(p,u,{alwaysNormalize:!0}):this._uri=p}return T(f,[{key:"uri",get:function(){return this._uri}}]),f}()},"./src/loader/load-stats.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"LoadStats",function(){return S});var S=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(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return n});var S=j("./src/polyfills/number.ts"),D=j("./node_modules/url-toolkit/src/url-toolkit.js"),x=j.n(D),T=j("./src/loader/fragment.ts"),w=j("./src/loader/level-details.ts"),f=j("./src/loader/level-key.ts"),p=j("./src/utils/attr-list.ts"),u=j("./src/utils/logger.ts"),o=j("./src/utils/codecs.ts"),i=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,l=/#EXT-X-MEDIA:(.*)/g,s=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),h=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("|")),r=/\.(mp4|m4s|m4v|m4a)$/i;function t(E){var g,y;return r.test((g=(y=D.parseURL(E))===null||y===void 0?void 0:y.path)!=null?g:"")}var n=function(){function E(){}return E.findGroup=function(y,C){for(var d=0;d<y.length;d++){var _=y[d];if(_.id===C)return _}},E.convertAVC1ToAVCOTI=function(y){var C=y.split(".");if(C.length>2){var d=C.shift()+".";return d+=parseInt(C.shift()).toString(16),d+=("000"+parseInt(C.shift()).toString(16)).substr(-4),d}return y},E.resolve=function(y,C){return D.buildAbsoluteURL(C,y,{alwaysNormalize:!0})},E.parseMasterPlaylist=function(y,C){var d=[],_={},O=!1;i.lastIndex=0;for(var A;(A=i.exec(y))!=null;)if(A[1]){var P=new p.AttrList(A[1]),I={attrs:P,bitrate:P.decimalInteger("AVERAGE-BANDWIDTH")||P.decimalInteger("BANDWIDTH"),name:P.NAME,url:E.resolve(A[2],C)},W=P.decimalResolution("RESOLUTION");W&&(I.width=W.width,I.height=W.height),c((P.CODECS||"").split(/[ ,]+/).filter(function(te){return te}),I),I.videoCodec&&I.videoCodec.indexOf("avc1")!==-1&&(I.videoCodec=E.convertAVC1ToAVCOTI(I.videoCodec)),d.push(I)}else if(A[3]){var K=new p.AttrList(A[3]);K["DATA-ID"]&&(O=!0,_[K["DATA-ID"]]=K)}return{levels:d,sessionData:O?_:null}},E.parseMasterPlaylistMedia=function(y,C,d,_){_===void 0&&(_=[]);var O,A=[],P=0;for(l.lastIndex=0;(O=l.exec(y))!==null;){var I=new p.AttrList(O[1]);if(I.TYPE===d){var W={attrs:I,bitrate:0,id:P++,groupId:I["GROUP-ID"],instreamId:I["INSTREAM-ID"],name:I.NAME||I.LANGUAGE||"",type:d,default:I.bool("DEFAULT"),autoselect:I.bool("AUTOSELECT"),forced:I.bool("FORCED"),lang:I.LANGUAGE,url:I.URI?E.resolve(I.URI,C):""};if(_.length){var K=E.findGroup(_,W.groupId)||_[0];m(W,K,"audioCodec"),m(W,K,"textCodec")}A.push(W)}}return A},E.parseLevelPlaylist=function(y,C,d,_,O){var A=new w.LevelDetails(C),P=A.fragments,I=null,W=0,K=0,te=0,H=0,G=null,V=new T.Fragment(_,C),re,$,ne,he=-1,pe=!1;for(s.lastIndex=0,A.m3u8=y;(re=s.exec(y))!==null;){pe&&(pe=!1,V=new T.Fragment(_,C),V.start=te,V.sn=W,V.cc=H,V.level=d,I&&(V.initSegment=I,V.rawProgramDateTime=I.rawProgramDateTime));var Te=re[1];if(Te){V.duration=parseFloat(Te);var we=(" "+re[2]).slice(1);V.title=we||null,V.tagList.push(we?["INF",Te,we]:["INF",Te])}else if(re[3])Object(S.isFiniteNumber)(V.duration)&&(V.start=te,ne&&(V.levelkey=ne),V.sn=W,V.level=d,V.cc=H,V.urlId=O,P.push(V),V.relurl=(" "+re[3]).slice(1),b(V,G),G=V,te+=V.duration,W++,K=0,pe=!0);else if(re[4]){var Me=(" "+re[4]).slice(1);G?V.setByteRange(Me,G):V.setByteRange(Me)}else if(re[5])V.rawProgramDateTime=(" "+re[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),he===-1&&(he=P.length);else{if(re=re[0].match(h),!re){u.logger.warn("No matches on slow regex match for level playlist!");continue}for($=1;$<re.length&&!(typeof re[$]!="undefined");$++);var Ee=(" "+re[$]).slice(1),xe=(" "+re[$+1]).slice(1),Ge=re[$+2]?(" "+re[$+2]).slice(1):"";switch(Ee){case"PLAYLIST-TYPE":A.type=xe.toUpperCase();break;case"MEDIA-SEQUENCE":W=A.startSN=parseInt(xe);break;case"SKIP":{var je=new p.AttrList(xe),We=je.decimalInteger("SKIPPED-SEGMENTS");if(Object(S.isFiniteNumber)(We)){A.skippedSegments=We;for(var ze=We;ze--;)P.unshift(null);W+=We}var de=je.enumeratedString("RECENTLY-REMOVED-DATERANGES");de&&(A.recentlyRemovedDateranges=de.split(" "));break}case"TARGETDURATION":A.targetduration=parseFloat(xe);break;case"VERSION":A.version=parseInt(xe);break;case"EXTM3U":break;case"ENDLIST":A.live=!1;break;case"#":(xe||Ge)&&V.tagList.push(Ge?[xe,Ge]:[xe]);break;case"DIS":H++;case"GAP":V.tagList.push([Ee]);break;case"BITRATE":V.tagList.push([Ee,xe]);break;case"DISCONTINUITY-SEQ":H=parseInt(xe);break;case"KEY":{var le,Oe=new p.AttrList(xe),Ie=Oe.enumeratedString("METHOD"),qe=Oe.URI,ee=Oe.hexadecimalInteger("IV"),k=Oe.enumeratedString("KEYFORMATVERSIONS"),U=Oe.enumeratedString("KEYID"),q=(le=Oe.enumeratedString("KEYFORMAT"))!=null?le:"identity",Y=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Y.indexOf(q)>-1){u.logger.warn("Keyformat "+q+" is not supported from the manifest");continue}else if(q!=="identity")continue;Ie&&(ne=f.LevelKey.fromURL(C,qe),qe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ie)>=0&&(ne.method=Ie,ne.keyFormat=q,U&&(ne.keyID=U),k&&(ne.keyFormatVersions=k),ne.iv=ee));break}case"START":{var J=new p.AttrList(xe),be=J.decimalFloatingPoint("TIME-OFFSET");Object(S.isFiniteNumber)(be)&&(A.startTimeOffset=be);break}case"MAP":{var ke=new p.AttrList(xe);V.relurl=ke.URI,ke.BYTERANGE&&V.setByteRange(ke.BYTERANGE),V.level=d,V.sn="initSegment",ne&&(V.levelkey=ne),V.initSegment=null,I=V,pe=!0;break}case"SERVER-CONTROL":{var ct=new p.AttrList(xe);A.canBlockReload=ct.bool("CAN-BLOCK-RELOAD"),A.canSkipUntil=ct.optionalFloat("CAN-SKIP-UNTIL",0),A.canSkipDateRanges=A.canSkipUntil>0&&ct.bool("CAN-SKIP-DATERANGES"),A.partHoldBack=ct.optionalFloat("PART-HOLD-BACK",0),A.holdBack=ct.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var He=new p.AttrList(xe);A.partTarget=He.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Be=A.partList;Be||(Be=A.partList=[]);var Ze=K>0?Be[Be.length-1]:void 0,ht=K++,Qe=new T.Part(new p.AttrList(xe),V,C,ht,Ze);Be.push(Qe),V.duration+=Qe.duration;break}case"PRELOAD-HINT":{var Xe=new p.AttrList(xe);A.preloadHint=Xe;break}case"RENDITION-REPORT":{var Ke=new p.AttrList(xe);A.renditionReports=A.renditionReports||[],A.renditionReports.push(Ke);break}default:u.logger.warn("line parsed but not handled: "+re);break}}}G&&!G.relurl?(P.pop(),te-=G.duration,A.partList&&(A.fragmentHint=G)):A.partList&&(b(V,G),V.cc=H,A.fragmentHint=V);var Fe=P.length,Ue=P[0],_e=P[Fe-1];if(te+=A.skippedSegments*A.targetduration,te>0&&Fe&&_e){A.averagetargetduration=te/Fe;var Ce=_e.sn;A.endSN=Ce!=="initSegment"?Ce:0,Ue&&(A.startCC=Ue.cc,Ue.initSegment||A.fragments.every(function(Ne){return Ne.relurl&&t(Ne.relurl)})&&(u.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new T.Fragment(_,C),V.relurl=_e.relurl,V.level=d,V.sn="initSegment",Ue.initSegment=V,A.needSidxRanges=!0))}else A.endSN=0,A.startCC=0;return A.fragmentHint&&(te+=A.fragmentHint.duration),A.totalduration=te,A.endCC=H,he>0&&v(P,he),A},E}();function c(E,g){["video","audio","text"].forEach(function(y){var C=E.filter(function(_){return Object(o.isCodecType)(_,y)});if(C.length){var d=C.filter(function(_){return _.lastIndexOf("avc1",0)===0||_.lastIndexOf("mp4a",0)===0});g[y+"Codec"]=d.length>0?d[0]:C[0],E=E.filter(function(_){return C.indexOf(_)===-1})}}),g.unknownCodecs=E}function m(E,g,y){var C=g[y];C&&(E[y]=C)}function v(E,g){for(var y=E[g],C=g;C--;){var d=E[C];if(!d)return;d.programDateTime=y.programDateTime-d.duration*1e3,y=d}}function b(E,g){E.rawProgramDateTime?E.programDateTime=Date.parse(E.rawProgramDateTime):g!=null&&g.programDateTime&&(E.programDateTime=g.endProgramDateTime),Object(S.isFiniteNumber)(E.programDateTime)||(E.programDateTime=null,E.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/polyfills/number.ts"),D=j("./src/events.ts"),x=j("./src/errors.ts"),T=j("./src/utils/logger.ts"),w=j("./src/utils/mp4-tools.ts"),f=j("./src/loader/m3u8-parser.ts"),p=j("./src/types/loader.ts"),u=j("./src/utils/attr-list.ts");function o(s){var h=s.type;switch(h){case p.PlaylistContextType.AUDIO_TRACK:return p.PlaylistLevelType.AUDIO;case p.PlaylistContextType.SUBTITLE_TRACK:return p.PlaylistLevelType.SUBTITLE;default:return p.PlaylistLevelType.MAIN}}function i(s,h){var r=s.url;return(r===void 0||r.indexOf("data:")===0)&&(r=h.url),r}var l=function(){function s(r){this.hls=void 0,this.loaders=Object.create(null),this.hls=r,this.registerListeners()}var h=s.prototype;return h.registerListeners=function(){var t=this.hls;t.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.unregisterListeners=function(){var t=this.hls;t.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(D.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.createInternalLoader=function(t){var n=this.hls.config,c=n.pLoader,m=n.loader,v=c||m,b=new v(n);return t.loader=b,this.loaders[t.type]=b,b},h.getInternalLoader=function(t){return this.loaders[t.type]},h.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},h.destroyInternalLoaders=function(){for(var t in this.loaders){var n=this.loaders[t];n&&n.destroy(),this.resetInternalLoader(t)}},h.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},h.onManifestLoading=function(t,n){var c=n.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:p.PlaylistContextType.MANIFEST,url:c,deliveryDirectives:null})},h.onLevelLoading=function(t,n){var c=n.id,m=n.level,v=n.url,b=n.deliveryDirectives;this.load({id:c,groupId:null,level:m,responseType:"text",type:p.PlaylistContextType.LEVEL,url:v,deliveryDirectives:b})},h.onAudioTrackLoading=function(t,n){var c=n.id,m=n.groupId,v=n.url,b=n.deliveryDirectives;this.load({id:c,groupId:m,level:null,responseType:"text",type:p.PlaylistContextType.AUDIO_TRACK,url:v,deliveryDirectives:b})},h.onSubtitleTrackLoading=function(t,n){var c=n.id,m=n.groupId,v=n.url,b=n.deliveryDirectives;this.load({id:c,groupId:m,level:null,responseType:"text",type:p.PlaylistContextType.SUBTITLE_TRACK,url:v,deliveryDirectives:b})},h.load=function(t){var n,c=this.hls.config,m=this.getInternalLoader(t);if(m){var v=m.context;if(v&&v.url===t.url){T.logger.trace("[playlist-loader]: playlist request ongoing");return}T.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),m.abort()}var b,E,g,y;switch(t.type){case p.PlaylistContextType.MANIFEST:b=c.manifestLoadingMaxRetry,E=c.manifestLoadingTimeOut,g=c.manifestLoadingRetryDelay,y=c.manifestLoadingMaxRetryTimeout;break;case p.PlaylistContextType.LEVEL:case p.PlaylistContextType.AUDIO_TRACK:case p.PlaylistContextType.SUBTITLE_TRACK:b=0,E=c.levelLoadingTimeOut;break;default:b=c.levelLoadingMaxRetry,E=c.levelLoadingTimeOut,g=c.levelLoadingRetryDelay,y=c.levelLoadingMaxRetryTimeout;break}if(m=this.createInternalLoader(t),(n=t.deliveryDirectives)!==null&&n!==void 0&&n.part){var C;if(t.type===p.PlaylistContextType.LEVEL&&t.level!==null?C=this.hls.levels[t.level].details:t.type===p.PlaylistContextType.AUDIO_TRACK&&t.id!==null?C=this.hls.audioTracks[t.id].details:t.type===p.PlaylistContextType.SUBTITLE_TRACK&&t.id!==null&&(C=this.hls.subtitleTracks[t.id].details),C){var d=C.partTarget,_=C.targetduration;d&&_&&(E=Math.min(Math.max(d*3,_*.8)*1e3,E))}}var O={timeout:E,maxRetry:b,retryDelay:g,maxRetryDelay:y,highWaterMark:0},A={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};m.load(t,O,A)},h.loadsuccess=function(t,n,c,m){if(m===void 0&&(m=null),c.isSidxRequest){this.handleSidxRequest(t,c),this.handlePlaylistLoaded(t,n,c,m);return}this.resetInternalLoader(c.type);var v=t.data;if(v.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(t,c,"no EXTM3U delimiter",m);return}n.parsing.start=performance.now(),v.indexOf("#EXTINF:")>0||v.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,n,c,m):this.handleMasterPlaylist(t,n,c,m)},h.loaderror=function(t,n,c){c===void 0&&(c=null),this.handleNetworkError(n,c,!1,t)},h.loadtimeout=function(t,n,c){c===void 0&&(c=null),this.handleNetworkError(n,c,!0)},h.handleMasterPlaylist=function(t,n,c,m){var v=this.hls,b=t.data,E=i(t,c),g=f.default.parseMasterPlaylist(b,E),y=g.levels,C=g.sessionData;if(!y.length){this.handleManifestParsingError(t,c,"no level found in manifest",m);return}var d=y.map(function(W){return{id:W.attrs.AUDIO,audioCodec:W.audioCodec}}),_=y.map(function(W){return{id:W.attrs.SUBTITLES,textCodec:W.textCodec}}),O=f.default.parseMasterPlaylistMedia(b,E,"AUDIO",d),A=f.default.parseMasterPlaylistMedia(b,E,"SUBTITLES",_),P=f.default.parseMasterPlaylistMedia(b,E,"CLOSED-CAPTIONS");if(O.length){var I=O.some(function(W){return!W.url});!I&&y[0].audioCodec&&!y[0].attrs.AUDIO&&(T.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),O.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new u.AttrList({}),bitrate:0,url:""}))}v.trigger(D.Events.MANIFEST_LOADED,{levels:y,audioTracks:O,subtitles:A,captions:P,url:E,stats:n,networkDetails:m,sessionData:C})},h.handleTrackOrLevelPlaylist=function(t,n,c,m){var v=this.hls,b=c.id,E=c.level,g=c.type,y=i(t,c),C=Object(S.isFiniteNumber)(b)?b:0,d=Object(S.isFiniteNumber)(E)?E:C,_=o(c),O=f.default.parseLevelPlaylist(t.data,y,d,_,C);if(!O.fragments.length){v.trigger(D.Events.ERROR,{type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:y,reason:"no fragments found in level",level:typeof c.level=="number"?c.level:void 0});return}if(g===p.PlaylistContextType.MANIFEST){var A={attrs:new u.AttrList({}),bitrate:0,details:O,name:"",url:y};v.trigger(D.Events.MANIFEST_LOADED,{levels:[A],audioTracks:[],url:y,stats:n,networkDetails:m,sessionData:null})}if(n.parsing.end=performance.now(),O.needSidxRanges){var P,I=(P=O.fragments[0].initSegment)===null||P===void 0?void 0:P.url;this.load({url:I,isSidxRequest:!0,type:g,level:E,levelDetails:O,id:b,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}c.levelDetails=O,this.handlePlaylistLoaded(t,n,c,m)},h.handleSidxRequest=function(t,n){var c=Object(w.parseSegmentIndex)(new Uint8Array(t.data));if(!c)return;var m=c.references,v=n.levelDetails;m.forEach(function(b,E){var g=b.info,y=v.fragments[E];y.byteRange.length===0&&y.setByteRange(String(1+g.end-g.start)+"@"+String(g.start)),y.initSegment&&y.initSegment.setByteRange(String(c.moovEndOffset)+"@0")})},h.handleManifestParsingError=function(t,n,c,m){this.hls.trigger(D.Events.ERROR,{type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:n.type===p.PlaylistContextType.MANIFEST,url:t.url,reason:c,response:t,context:n,networkDetails:m})},h.handleNetworkError=function(t,n,c,m){c===void 0&&(c=!1),T.logger.warn("[playlist-loader]: A network "+(c?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var v=x.ErrorDetails.UNKNOWN,b=!1,E=this.getInternalLoader(t);switch(t.type){case p.PlaylistContextType.MANIFEST:v=c?x.ErrorDetails.MANIFEST_LOAD_TIMEOUT:x.ErrorDetails.MANIFEST_LOAD_ERROR,b=!0;break;case p.PlaylistContextType.LEVEL:v=c?x.ErrorDetails.LEVEL_LOAD_TIMEOUT:x.ErrorDetails.LEVEL_LOAD_ERROR,b=!1;break;case p.PlaylistContextType.AUDIO_TRACK:v=c?x.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:x.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,b=!1;break;case p.PlaylistContextType.SUBTITLE_TRACK:v=c?x.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:x.ErrorDetails.SUBTITLE_LOAD_ERROR,b=!1;break}E&&this.resetInternalLoader(t.type);var g={type:x.ErrorTypes.NETWORK_ERROR,details:v,fatal:b,url:t.url,loader:E,context:t,networkDetails:n};m&&(g.response=m),this.hls.trigger(D.Events.ERROR,g)},h.handlePlaylistLoaded=function(t,n,c,m){var v=c.type,b=c.level,E=c.id,g=c.groupId,y=c.loader,C=c.levelDetails,d=c.deliveryDirectives;if(!(C!=null&&C.targetduration)){this.handleManifestParsingError(t,c,"invalid target duration",m);return}if(!y)return;C.live&&(y.getCacheAge&&(C.ageHeader=y.getCacheAge()||0),(!y.getCacheAge||isNaN(C.ageHeader))&&(C.ageHeader=0));switch(v){case p.PlaylistContextType.MANIFEST:case p.PlaylistContextType.LEVEL:this.hls.trigger(D.Events.LEVEL_LOADED,{details:C,level:b||0,id:E||0,stats:n,networkDetails:m,deliveryDirectives:d});break;case p.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(D.Events.AUDIO_TRACK_LOADED,{details:C,id:E||0,groupId:g||"",stats:n,networkDetails:m,deliveryDirectives:d});break;case p.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(D.Events.SUBTITLE_TRACK_LOADED,{details:C,id:E||0,groupId:g||"",stats:n,networkDetails:m,deliveryDirectives:d});break}},s}();Q.default=l},"./src/polyfills/number.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"isFiniteNumber",function(){return S}),j.d(Q,"MAX_SAFE_INTEGER",function(){return D});var S=Number.isFinite||function(x){return typeof x=="number"&&isFinite(x)},D=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ue,Q,j){"use strict";j.r(Q);var S=function(){function D(){}return D.getSilentFrame=function(T,w){switch(T){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},D}();Q.default=S},"./src/remux/mp4-generator.ts":function(ue,Q,j){"use strict";j.r(Q);var S=Math.pow(2,32)-1,D=function(){function x(){}return x.init=function(){x.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 x.types)x.types.hasOwnProperty(w)&&(x.types[w]=[w.charCodeAt(0),w.charCodeAt(1),w.charCodeAt(2),w.charCodeAt(3)]);var f=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]),p=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]);x.HDLR_TYPES={video:f,audio:p};var u=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),o=new Uint8Array([0,0,0,0,0,0,0,0]);x.STTS=x.STSC=x.STCO=o,x.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),x.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),x.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),x.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var i=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);x.FTYP=x.box(x.types.ftyp,i,s,i,l),x.DINF=x.box(x.types.dinf,x.box(x.types.dref,u))},x.box=function(w){for(var f=8,p=arguments.length,u=new Array(p>1?p-1:0),o=1;o<p;o++)u[o-1]=arguments[o];for(var i=u.length,l=i;i--;)f+=u[i].byteLength;var s=new Uint8Array(f);for(s[0]=f>>24&255,s[1]=f>>16&255,s[2]=f>>8&255,s[3]=f&255,s.set(w,4),i=0,f=8;i<l;i++)s.set(u[i],f),f+=u[i].byteLength;return s},x.hdlr=function(w){return x.box(x.types.hdlr,x.HDLR_TYPES[w])},x.mdat=function(w){return x.box(x.types.mdat,w)},x.mdhd=function(w,f){f*=w;var p=Math.floor(f/(S+1)),u=Math.floor(f%(S+1));return x.box(x.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,p>>24,p>>16&255,p>>8&255,p&255,u>>24,u>>16&255,u>>8&255,u&255,85,196,0,0]))},x.mdia=function(w){return x.box(x.types.mdia,x.mdhd(w.timescale,w.duration),x.hdlr(w.type),x.minf(w))},x.mfhd=function(w){return x.box(x.types.mfhd,new Uint8Array([0,0,0,0,w>>24,w>>16&255,w>>8&255,w&255]))},x.minf=function(w){return w.type==="audio"?x.box(x.types.minf,x.box(x.types.smhd,x.SMHD),x.DINF,x.stbl(w)):x.box(x.types.minf,x.box(x.types.vmhd,x.VMHD),x.DINF,x.stbl(w))},x.moof=function(w,f,p){return x.box(x.types.moof,x.mfhd(w),x.traf(p,f))},x.moov=function(w){for(var f=w.length,p=[];f--;)p[f]=x.trak(w[f]);return x.box.apply(null,[x.types.moov,x.mvhd(w[0].timescale,w[0].duration)].concat(p).concat(x.mvex(w)))},x.mvex=function(w){for(var f=w.length,p=[];f--;)p[f]=x.trex(w[f]);return x.box.apply(null,[x.types.mvex].concat(p))},x.mvhd=function(w,f){f*=w;var p=Math.floor(f/(S+1)),u=Math.floor(f%(S+1)),o=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,p>>24,p>>16&255,p>>8&255,p&255,u>>24,u>>16&255,u>>8&255,u&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 x.box(x.types.mvhd,o)},x.sdtp=function(w){var f=w.samples||[],p=new Uint8Array(4+f.length),u,o;for(u=0;u<f.length;u++)o=f[u].flags,p[u+4]=o.dependsOn<<4|o.isDependedOn<<2|o.hasRedundancy;return x.box(x.types.sdtp,p)},x.stbl=function(w){return x.box(x.types.stbl,x.stsd(w),x.box(x.types.stts,x.STTS),x.box(x.types.stsc,x.STSC),x.box(x.types.stsz,x.STSZ),x.box(x.types.stco,x.STCO))},x.avc1=function(w){var f=[],p=[],u,o,i;for(u=0;u<w.sps.length;u++)o=w.sps[u],i=o.byteLength,f.push(i>>>8&255),f.push(i&255),f=f.concat(Array.prototype.slice.call(o));for(u=0;u<w.pps.length;u++)o=w.pps[u],i=o.byteLength,p.push(i>>>8&255),p.push(i&255),p=p.concat(Array.prototype.slice.call(o));var l=x.box(x.types.avcC,new Uint8Array([1,f[3],f[4],f[5],252|3,224|w.sps.length].concat(f).concat([w.pps.length]).concat(p))),s=w.width,h=w.height,r=w.pixelRatio[0],t=w.pixelRatio[1];return x.box(x.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,s>>8&255,s&255,h>>8&255,h&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]),l,x.box(x.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),x.box(x.types.pasp,new Uint8Array([r>>24,r>>16&255,r>>8&255,r&255,t>>24,t>>16&255,t>>8&255,t&255])))},x.esds=function(w){var f=w.config.length;return new Uint8Array([0,0,0,0,3,23+f,0,1,0,4,15+f,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([f]).concat(w.config).concat([6,1,2]))},x.mp4a=function(w){var f=w.samplerate;return x.box(x.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,f>>8&255,f&255,0,0]),x.box(x.types.esds,x.esds(w)))},x.mp3=function(w){var f=w.samplerate;return x.box(x.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,f>>8&255,f&255,0,0]))},x.stsd=function(w){return w.type==="audio"?!w.isAAC&&w.codec==="mp3"?x.box(x.types.stsd,x.STSD,x.mp3(w)):x.box(x.types.stsd,x.STSD,x.mp4a(w)):x.box(x.types.stsd,x.STSD,x.avc1(w))},x.tkhd=function(w){var f=w.id,p=w.duration*w.timescale,u=w.width,o=w.height,i=Math.floor(p/(S+1)),l=Math.floor(p%(S+1));return x.box(x.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,f>>24&255,f>>16&255,f>>8&255,f&255,0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,l>>24,l>>16&255,l>>8&255,l&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,u>>8&255,u&255,0,0,o>>8&255,o&255,0,0]))},x.traf=function(w,f){var p=x.sdtp(w),u=w.id,o=Math.floor(f/(S+1)),i=Math.floor(f%(S+1));return x.box(x.types.traf,x.box(x.types.tfhd,new Uint8Array([0,0,0,0,u>>24,u>>16&255,u>>8&255,u&255])),x.box(x.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,i>>24,i>>16&255,i>>8&255,i&255])),x.trun(w,p.length+16+20+8+16+8+8),p)},x.trak=function(w){return w.duration=w.duration||4294967295,x.box(x.types.trak,x.tkhd(w),x.mdia(w))},x.trex=function(w){var f=w.id;return x.box(x.types.trex,new Uint8Array([0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},x.trun=function(w,f){var p=w.samples||[],u=p.length,o=12+16*u,i=new Uint8Array(o),l,s,h,r,t,n;for(f+=8+o,i.set([0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,u&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255],0),l=0;l<u;l++)s=p[l],h=s.duration,r=s.size,t=s.flags,n=s.cts,i.set([h>>>24&255,h>>>16&255,h>>>8&255,h&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,t.isLeading<<2|t.dependsOn,t.isDependedOn<<6|t.hasRedundancy<<4|t.paddingValue<<1|t.isNonSync,t.degradPrio&240<<8,t.degradPrio&15,n>>>24&255,n>>>16&255,n>>>8&255,n&255],12+16*l);return x.box(x.types.trun,i)},x.initSegment=function(w){x.types||x.init();var f=x.moov(w),p=new Uint8Array(x.FTYP.byteLength+f.byteLength);return p.set(x.FTYP),p.set(f,x.FTYP.byteLength),p},x}();D.types=void 0,D.HDLR_TYPES=void 0,D.STTS=void 0,D.STSC=void 0,D.STCO=void 0,D.STSZ=void 0,D.VMHD=void 0,D.SMHD=void 0,D.STSD=void 0,D.FTYP=void 0,D.DINF=void 0,Q.default=D},"./src/remux/mp4-remuxer.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return n}),j.d(Q,"normalizePts",function(){return c});var S=j("./src/polyfills/number.ts"),D=j("./src/remux/aac-helper.ts"),x=j("./src/remux/mp4-generator.ts"),T=j("./src/events.ts"),w=j("./src/errors.ts"),f=j("./src/utils/logger.ts"),p=j("./src/types/loader.ts"),u=j("./src/utils/timescale-conversion.ts");function o(){return o=Object.assign||function(E){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var C in y)Object.prototype.hasOwnProperty.call(y,C)&&(E[C]=y[C])}return E},o.apply(this,arguments)}var i=10*1e3,l=1024,s=1152,h=null,r=null,t=!1,n=function(){function E(y,C,d,_){if(_===void 0&&(_=""),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=y,this.config=C,this.typeSupported=d,this.ISGenerated=!1,h===null){var O=navigator.userAgent||"",A=O.match(/Chrome\/(\d+)/i);h=A?parseInt(A[1]):0}if(r===null){var P=navigator.userAgent.match(/Safari\/(\d+)/i);r=P?parseInt(P[1]):0}t=!!h&&h<75||!!r&&r<600}var g=E.prototype;return g.destroy=function(){},g.resetTimeStamp=function(C){f.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=C},g.resetNextTimestamp=function(){f.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},g.resetInitSegment=function(){f.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},g.getVideoStartPts=function(C){var d=!1,_=C.reduce(function(O,A){var P=A.pts-O;return P<-4294967296?(d=!0,c(O,A.pts)):P>0?O:A.pts},C[0].pts);return d&&f.logger.debug("PTS rollover detected"),_},g.remux=function(C,d,_,O,A,P,I,W){var K,te,H,G,V,re,$=A,ne=A,he=C.pid>-1,pe=d.pid>-1,Te=d.samples.length,we=C.samples.length>0,Me=Te>1,Ee=(!he||we)&&(!pe||Me)||this.ISGenerated||I;if(Ee){this.ISGenerated||(H=this.generateIS(C,d,A));var xe=this.isVideoContiguous,Ge=-1;if(Me&&(Ge=m(d.samples),!xe&&this.config.forceKeyFrameOnDiscontinuity))if(re=!0,Ge>0){f.logger.warn("[mp4-remuxer]: Dropped "+Ge+" out of "+Te+" video samples due to a missing keyframe");var je=this.getVideoStartPts(d.samples);d.samples=d.samples.slice(Ge),d.dropped+=Ge,ne+=(d.samples[0].pts-je)/(d.timescale||9e4)}else Ge===-1&&(f.logger.warn("[mp4-remuxer]: No keyframe found out of "+Te+" video samples"),re=!1);if(this.ISGenerated){if(we&&Me){var We=this.getVideoStartPts(d.samples),ze=c(C.samples[0].pts,We)-We,de=ze/d.inputTimeScale;$+=Math.max(0,de),ne+=Math.max(0,-de)}if(we){if(C.samplerate||(f.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),H=this.generateIS(C,d,A)),te=this.remuxAudio(C,$,this.isAudioContiguous,P,pe||Me||W===p.PlaylistLevelType.AUDIO?ne:void 0),Me){var le=te?te.endPTS-te.startPTS:0;d.inputTimeScale||(f.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),H=this.generateIS(C,d,A)),K=this.remuxVideo(d,ne,xe,le)}}else Me&&(K=this.remuxVideo(d,ne,xe,0));K&&(K.firstKeyFrame=Ge,K.independent=Ge!==-1)}}return this.ISGenerated&&(_.samples.length&&(V=this.remuxID3(_,A)),O.samples.length&&(G=this.remuxText(O,A))),{audio:te,video:K,initSegment:H,independent:re,text:G,id3:V}},g.generateIS=function(C,d,_){var O=C.samples,A=d.samples,P=this.typeSupported,I={},W=!Object(S.isFiniteNumber)(this._initPTS),K="audio/mp4",te,H,G;if(W&&(te=H=Infinity),C.config&&O.length&&(C.timescale=C.samplerate,C.isAAC||(P.mpeg?(K="audio/mpeg",C.codec=""):P.mp3&&(C.codec="mp3")),I.audio={id:"audio",container:K,codec:C.codec,initSegment:!C.isAAC&&P.mpeg?new Uint8Array(0):x.default.initSegment([C]),metadata:{channelCount:C.channelCount}},W&&(G=C.inputTimeScale,te=H=O[0].pts-Math.round(G*_))),d.sps&&d.pps&&A.length&&(d.timescale=d.inputTimeScale,I.video={id:"main",container:"video/mp4",codec:d.codec,initSegment:x.default.initSegment([d]),metadata:{width:d.width,height:d.height}},W)){G=d.inputTimeScale;var V=this.getVideoStartPts(A),re=Math.round(G*_);H=Math.min(H,c(A[0].dts,V)-re),te=Math.min(te,V-re)}if(Object.keys(I).length)return this.ISGenerated=!0,W&&(this._initPTS=te,this._initDTS=H),{tracks:I,initPTS:te,timescale:G}},g.remuxVideo=function(C,d,_,O){var A=C.inputTimeScale,P=C.samples,I=[],W=P.length,K=this._initPTS,te=this.nextAvcDts,H=8,G,V,re,$=Number.POSITIVE_INFINITY,ne=Number.NEGATIVE_INFINITY,he=0,pe=!1;if(!_||te===null){var Te=d*A,we=P[0].pts-c(P[0].dts,P[0].pts);te=Te-we}for(var Me=0;Me<W;Me++){var Ee=P[Me];if(Ee.pts=c(Ee.pts-K,te),Ee.dts=c(Ee.dts-K,te),Ee.dts>Ee.pts){var xe=9e4*.2;he=Math.max(Math.min(he,Ee.pts-Ee.dts),-1*xe)}Ee.dts<P[Me>0?Me-1:Me].dts&&(pe=!0)}pe&&P.sort(function(Dt,lt){var pt=Dt.dts-lt.dts,ut=Dt.pts-lt.pts;return pt||ut}),V=P[0].dts,re=P[P.length-1].dts;var Ge=Math.round((re-V)/(W-1));if(he<0){if(he<Ge*-2){f.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(u.toMsFromMpegTsClock)(-Ge,!0)+" ms");for(var je=he,We=0;We<W;We++)P[We].dts=je=Math.max(je,P[We].pts-Ge),P[We].pts=Math.max(je,P[We].pts)}else{f.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(u.toMsFromMpegTsClock)(he,!0)+" ms to overcome this issue");for(var ze=0;ze<W;ze++)P[ze].dts=P[ze].dts+he}V=P[0].dts}if(_){var de=V-te,le=de>Ge,Oe=de<-1;if(le||Oe){le?f.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(de,!0)+" ms ("+de+"dts) hole between fragments detected, filling it"):f.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(-de,!0)+" ms ("+de+"dts) overlapping between fragments detected"),V=te;var Ie=P[0].pts-de;P[0].dts=V,P[0].pts=Ie,f.logger.log("Video: First PTS/DTS adjusted: "+Object(u.toMsFromMpegTsClock)(Ie,!0)+"/"+Object(u.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(u.toMsFromMpegTsClock)(de,!0)+" ms")}}t&&(V=Math.max(0,V));for(var qe=0,ee=0,k=0;k<W;k++){for(var U=P[k],q=U.units,Y=q.length,J=0,be=0;be<Y;be++)J+=q[be].data.length;ee+=J,qe+=Y,U.length=J,U.dts=Math.max(U.dts,V),U.pts=Math.max(U.pts,U.dts,0),$=Math.min(U.pts,$),ne=Math.max(U.pts,ne)}re=P[W-1].dts;var ke=ee+4*qe+8,ct;try{ct=new Uint8Array(ke)}catch(Dt){this.observer.emit(T.Events.ERROR,T.Events.ERROR,{type:w.ErrorTypes.MUX_ERROR,details:w.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ke,reason:"fail allocating video mdat "+ke});return}var He=new DataView(ct.buffer);He.setUint32(0,ke),ct.set(x.default.types.mdat,4);for(var Be=0;Be<W;Be++){for(var Ze=P[Be],ht=Ze.units,Qe=0,Xe=0,Ke=ht.length;Xe<Ke;Xe++){var Fe=ht[Xe],Ue=Fe.data,_e=Fe.data.byteLength;He.setUint32(H,_e),H+=4,ct.set(Ue,H),H+=_e,Qe+=4+_e}if(Be<W-1)G=P[Be+1].dts-Ze.dts;else{var Ce=this.config,Ne=Ze.dts-P[Be>0?Be-1:Be].dts;if(Ce.stretchShortVideoTrack&&this.nextAudioPts!==null){var De=Math.floor(Ce.maxBufferHole*A),rt=(O?$+O*A:this.nextAudioPts)-Ze.pts;rt>De?(G=rt-Ne,G<0&&(G=Ne),f.logger.log("[mp4-remuxer]: It is approximately "+rt/90+" ms to the next segment; using duration "+G/90+" ms for the last video frame.")):G=Ne}else G=Ne}var tt=Math.round(Ze.pts-Ze.dts);I.push(new v(Ze.key,G,Qe,tt))}if(I.length&&h&&h<70){var xt=I[0].flags;xt.dependsOn=2,xt.isNonSync=0}console.assert(G!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=te=re+G,this.isVideoContiguous=!0;var Mt=x.default.moof(C.sequenceNumber++,V,o({},C,{samples:I})),Bt="video",It={data1:Mt,data2:ct,startPTS:$/A,endPTS:(ne+G)/A,startDTS:V/A,endDTS:te/A,type:Bt,hasAudio:!1,hasVideo:!0,nb:I.length,dropped:C.dropped};return C.samples=[],C.dropped=0,console.assert(ct.length,"MDAT length must not be zero"),It},g.remuxAudio=function(C,d,_,O,A){var P=C.inputTimeScale,I=C.samplerate?C.samplerate:P,W=P/I,K=C.isAAC?l:s,te=K*W,H=this._initPTS,G=!C.isAAC&&this.typeSupported.mpeg,V=[],re=C.samples,$=G?0:8,ne=this.nextAudioPts||-1,he=d*P;if(this.isAudioContiguous=_=_||re.length&&ne>0&&(O&&Math.abs(he-ne)<9e3||Math.abs(c(re[0].pts-H,he)-ne)<20*te),re.forEach(function(Ue){Ue.pts=c(Ue.pts-H,he)}),!_||ne<0){if(re=re.filter(function(Ue){return Ue.pts>=0}),!re.length)return;A===0?ne=0:O?ne=Math.max(0,he):ne=re[0].pts}if(C.isAAC)for(var pe=A!==void 0,Te=this.config.maxAudioFramesDrift,we=0,Me=ne;we<re.length;we++){var Ee=re[we],xe=Ee.pts,Ge=xe-Me,je=Math.abs(1e3*Ge/P);if(Ge<=-Te*te&&pe)we===0&&(f.logger.warn("Audio frame @ "+(xe/P).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ge/P)+" ms."),this.nextAudioPts=ne=Me=xe);else if(Ge>=Te*te&&je<i&&pe){var We=Math.round(Ge/te);Me=xe-We*te,Me<0&&(We--,Me+=te),we===0&&(this.nextAudioPts=ne=Me),f.logger.warn("[mp4-remuxer]: Injecting "+We+" audio frame @ "+(Me/P).toFixed(3)+"s due to "+Math.round(1e3*Ge/P)+" ms gap.");for(var ze=0;ze<We;ze++){var de=Math.max(Me,0),le=D.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);le||(f.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),le=Ee.unit.subarray()),re.splice(we,0,{unit:le,pts:de}),Me+=te,we++}}Ee.pts=Me,Me+=te}for(var Oe=null,Ie=null,qe,ee=0,k=re.length;k--;)ee+=re[k].unit.byteLength;for(var U=0,q=re.length;U<q;U++){var Y=re[U],J=Y.unit,be=Y.pts;if(Ie!==null){var ke=V[U-1];ke.duration=Math.round((be-Ie)/W)}else if(_&&C.isAAC&&(be=ne),Oe=be,ee>0){ee+=$;try{qe=new Uint8Array(ee)}catch(Ue){this.observer.emit(T.Events.ERROR,T.Events.ERROR,{type:w.ErrorTypes.MUX_ERROR,details:w.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ee,reason:"fail allocating audio mdat "+ee});return}if(!G){var ct=new DataView(qe.buffer);ct.setUint32(0,ee),qe.set(x.default.types.mdat,4)}}else return;qe.set(J,$);var He=J.byteLength;$+=He,V.push(new v(!0,K,He,0)),Ie=be}var Be=V.length;if(!Be)return;var Ze=V[V.length-1];this.nextAudioPts=ne=Ie+W*Ze.duration;var ht=G?new Uint8Array(0):x.default.moof(C.sequenceNumber++,Oe/W,o({},C,{samples:V}));C.samples=[];var Qe=Oe/P,Xe=ne/P,Ke="audio",Fe={data1:ht,data2:qe,startPTS:Qe,endPTS:Xe,startDTS:Qe,endDTS:Xe,type:Ke,hasAudio:!0,hasVideo:!1,nb:Be};return this.isAudioContiguous=!0,console.assert(qe.length,"MDAT length must not be zero"),Fe},g.remuxEmptyAudio=function(C,d,_,O){var A=C.inputTimeScale,P=C.samplerate?C.samplerate:A,I=A/P,W=this.nextAudioPts,K=(W!==null?W:O.startDTS*A)+this._initDTS,te=O.endDTS*A+this._initDTS,H=I*l,G=Math.ceil((te-K)/H),V=D.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);if(f.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){f.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var re=[],$=0;$<G;$++){var ne=K+$*H;re.push({unit:V,pts:ne,dts:ne})}return C.samples=re,this.remuxAudio(C,d,_,!1)},g.remuxID3=function(C,d){var _=C.samples.length;if(!_)return;for(var O=C.inputTimeScale,A=this._initPTS,P=this._initDTS,I=0;I<_;I++){var W=C.samples[I];W.pts=c(W.pts-A,d*O)/O,W.dts=c(W.dts-P,d*O)/O}var K=C.samples;return C.samples=[],{samples:K}},g.remuxText=function(C,d){var _=C.samples.length;if(!_)return;for(var O=C.inputTimeScale,A=this._initPTS,P=0;P<_;P++){var I=C.samples[P];I.pts=c(I.pts-A,d*O)/O}C.samples.sort(function(K,te){return K.pts-te.pts});var W=C.samples;return C.samples=[],{samples:W}},E}();function c(E,g){var y;if(g===null)return E;for(g<E?y=-8589934592:y=8589934592;Math.abs(E-g)>4294967296;)E+=y;return E}function m(E){for(var g=0;g<E.length;g++)if(E[g].key)return g;return-1}var v=function(g,y,C,d){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=y,this.size=C,this.cts=d,this.flags=new b(g)},b=function(g){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=g?2:1,this.isNonSync=g?0:1}},"./src/remux/passthrough-remuxer.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/polyfills/number.ts"),D=j("./src/utils/mp4-tools.ts"),x=j("./src/loader/fragment.ts"),T=j("./src/utils/logger.ts"),w=function(){function u(){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 o=u.prototype;return o.destroy=function(){},o.resetTimeStamp=function(l){this.initPTS=l,this.lastEndDTS=null},o.resetNextTimestamp=function(){this.lastEndDTS=null},o.resetInitSegment=function(l,s,h){this.audioCodec=s,this.videoCodec=h,this.generateInitSegment(l),this.emitInitSegment=!0},o.generateInitSegment=function(l){var s=this.audioCodec,h=this.videoCodec;if(!l||!l.byteLength){this.initTracks=void 0,this.initData=void 0;return}var r=this.initData=Object(D.parseInitSegment)(l);s||(s=p(r.audio,x.ElementaryStreamTypes.AUDIO)),h||(h=p(r.video,x.ElementaryStreamTypes.VIDEO));var t={};r.audio&&r.video?t.audiovideo={container:"video/mp4",codec:s+","+h,initSegment:l,id:"main"}:r.audio?t.audio={container:"audio/mp4",codec:s,initSegment:l,id:"audio"}:r.video?t.video={container:"video/mp4",codec:h,initSegment:l,id:"main"}:T.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=t},o.remux=function(l,s,h,r,t){var n=this.initPTS,c=this.lastEndDTS,m={audio:void 0,video:void 0,text:r,id3:h,initSegment:void 0};Object(S.isFiniteNumber)(c)||(c=this.lastEndDTS=t||0);var v=s.samples;if(!v||!v.length)return m;var b={initPTS:void 0,timescale:1},E=this.initData;if((!E||!E.length)&&(this.generateInitSegment(v),E=this.initData),!E||!E.length)return T.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),m;this.emitInitSegment&&(b.tracks=this.initTracks,this.emitInitSegment=!1),Object(S.isFiniteNumber)(n)||(this.initPTS=b.initPTS=n=f(E,v,c));var g=Object(D.getDuration)(v,E),y=c,C=g+y;Object(D.offsetStartDTS)(E,v,n),g>0?this.lastEndDTS=C:(T.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var d=!!E.audio,_=!!E.video,O="";d&&(O+="audio"),_&&(O+="video");var A={data1:v,startPTS:y,startDTS:y,endPTS:C,endDTS:C,type:O,hasAudio:d,hasVideo:_,nb:1,dropped:0};return m.audio=A.type==="audio"?A:void 0,m.video=A.type!=="audio"?A:void 0,m.text=r,m.id3=h,m.initSegment=b,m},u}(),f=function(o,i,l){return Object(D.getStartDTS)(o,i)-l};function p(u,o){var i=u==null?void 0:u.codec;return i&&i.length>4?i:i==="hvc1"?"hvc1.1.c.L120.90":i==="av01"?"av01.0.04M.08":i==="avc1"||o===x.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Q.default=w},"./src/task-loop.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return S});var S=function(){function D(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var x=D.prototype;return x.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},x.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},x.onHandlerDestroyed=function(){},x.hasInterval=function(){return!!this._tickInterval},x.hasNextTick=function(){return!!this._tickTimer},x.setInterval=function(w){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,w),!0)},x.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},x.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},x.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},x.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},x.doTick=function(){},D}()},"./src/types/cmcd.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"CMCDVersion",function(){return S}),j.d(Q,"CMCDObjectType",function(){return D}),j.d(Q,"CMCDStreamingFormat",function(){return x}),j.d(Q,"CMCDStreamType",function(){return T});var S=1,D;(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"})(D||(D={}));var x;(function(w){w.DASH="d",w.HLS="h",w.SMOOTH="s",w.OTHER="o"})(x||(x={}));var T;(function(w){w.VOD="v",w.LIVE="l"})(T||(T={}))},"./src/types/level.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"HlsSkip",function(){return x}),j.d(Q,"getSkipValue",function(){return T}),j.d(Q,"HlsUrlParameters",function(){return w}),j.d(Q,"Level",function(){return f});function S(p,u){for(var o=0;o<u.length;o++){var i=u[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(p,i.key,i)}}function D(p,u,o){return u&&S(p.prototype,u),o&&S(p,o),p}var x;(function(p){p.No="",p.Yes="YES",p.v2="v2"})(x||(x={}));function T(p,u){var o=p.canSkipUntil,i=p.canSkipDateRanges,l=p.endSN,s=u!==void 0?u-l:0;return o&&s<o?i?x.v2:x.Yes:x.No}var w=function(){function p(o,i,l){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=o,this.part=i,this.skip=l}var u=p.prototype;return u.addDirectives=function(i){var l=new self.URL(i);return this.msn!==void 0&&l.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&l.searchParams.set("_HLS_part",this.part.toString()),this.skip&&l.searchParams.set("_HLS_skip",this.skip),l.toString()},p}(),f=function(){function p(u){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=[u.url],this.attrs=u.attrs,this.bitrate=u.bitrate,u.details&&(this.details=u.details),this.id=u.id||0,this.name=u.name,this.width=u.width||0,this.height=u.height||0,this.audioCodec=u.audioCodec,this.videoCodec=u.videoCodec,this.unknownCodecs=u.unknownCodecs,this.codecSet=[u.videoCodec,u.audioCodec].filter(function(o){return o}).join(",").replace(/\.[^.,]+/g,"")}return D(p,[{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(o){var i=o%this.url.length;this._urlId!==i&&(this.details=void 0,this._urlId=i)}}]),p}()},"./src/types/loader.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"PlaylistContextType",function(){return S}),j.d(Q,"PlaylistLevelType",function(){return D});var S;(function(x){x.MANIFEST="manifest",x.LEVEL="level",x.AUDIO_TRACK="audioTrack",x.SUBTITLE_TRACK="subtitleTrack"})(S||(S={}));var D;(function(x){x.MAIN="main",x.AUDIO="audio",x.SUBTITLE="subtitle"})(D||(D={}))},"./src/types/transmuxer.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"ChunkMetadata",function(){return S});var S=function(T,w,f,p,u,o){p===void 0&&(p=0),u===void 0&&(u=-1),o===void 0&&(o=!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=D(),this.buffering={audio:D(),video:D(),audiovideo:D()},this.level=T,this.sn=w,this.id=f,this.size=p,this.part=u,this.partial=o};function D(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"AttrList",function(){return x});var S=/^(\d+)x(\d+)$/,D=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,x=function(){function T(f){typeof f=="string"&&(f=T.parseAttrList(f));for(var p in f)f.hasOwnProperty(p)&&(this[p]=f[p])}var w=T.prototype;return w.decimalInteger=function(p){var u=parseInt(this[p],10);return u>Number.MAX_SAFE_INTEGER?Infinity:u},w.hexadecimalInteger=function(p){if(this[p]){var u=(this[p]||"0x").slice(2);u=(u.length&1?"0":"")+u;for(var o=new Uint8Array(u.length/2),i=0;i<u.length/2;i++)o[i]=parseInt(u.slice(i*2,i*2+2),16);return o}else return null},w.hexadecimalIntegerAsNumber=function(p){var u=parseInt(this[p],16);return u>Number.MAX_SAFE_INTEGER?Infinity:u},w.decimalFloatingPoint=function(p){return parseFloat(this[p])},w.optionalFloat=function(p,u){var o=this[p];return o?parseFloat(o):u},w.enumeratedString=function(p){return this[p]},w.bool=function(p){return this[p]==="YES"},w.decimalResolution=function(p){var u=S.exec(this[p]);return u===null?void 0:{width:parseInt(u[1],10),height:parseInt(u[2],10)}},T.parseAttrList=function(p){var u,o={},i='"';for(D.lastIndex=0;(u=D.exec(p))!==null;){var l=u[2];l.indexOf(i)===0&&l.lastIndexOf(i)===l.length-1&&(l=l.slice(1,-1)),o[u[1]]=l}return o},T}()},"./src/utils/binary-search.ts":function(ue,Q,j){"use strict";j.r(Q);var S={search:function(x,T){for(var w=0,f=x.length-1,p=null,u=null;w<=f;){p=(w+f)/2|0,u=x[p];var o=T(u);if(o>0)w=p+1;else if(o<0)f=p-1;else return u}return null}};Q.default=S},"./src/utils/buffer-helper.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"BufferHelper",function(){return x});var S=j("./src/utils/logger.ts"),D={length:0,start:function(){return 0},end:function(){return 0}},x=function(){function T(){}return T.isBuffered=function(f,p){try{if(f){for(var u=T.getBuffered(f),o=0;o<u.length;o++)if(p>=u.start(o)&&p<=u.end(o))return!0}}catch(i){}return!1},T.bufferInfo=function(f,p,u){try{if(f){var o=T.getBuffered(f),i=[],l;for(l=0;l<o.length;l++)i.push({start:o.start(l),end:o.end(l)});return this.bufferedInfo(i,p,u)}}catch(s){}return{len:0,start:p,end:p,nextStart:void 0}},T.bufferedInfo=function(f,p,u){p=Math.max(0,p),f.sort(function(b,E){var g=b.start-E.start;return g||E.end-b.end});var o=[];if(u)for(var i=0;i<f.length;i++){var l=o.length;if(l){var s=o[l-1].end;f[i].start-s<u?f[i].end>s&&(o[l-1].end=f[i].end):o.push(f[i])}else o.push(f[i])}else o=f;for(var h=0,r,t=p,n=p,c=0;c<o.length;c++){var m=o[c].start,v=o[c].end;if(p+u>=m&&p<v)t=m,n=v,h=n-p;else if(p+u<m){r=m;break}}return{len:h,start:t||0,end:n||0,nextStart:r}},T.getBuffered=function(f){try{return f.buffered}catch(p){return S.logger.log("failed to get media.buffered",p),D}},T}()},"./src/utils/cea-608-parser.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"Row",function(){return n}),j.d(Q,"CaptionScreen",function(){return c});var S=j("./src/utils/logger.ts"),D={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},x=function(C){var d=C;return D.hasOwnProperty(C)&&(d=D[C]),String.fromCharCode(d)},T=15,w=100,f={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},p={17:2,18:4,21:6,22:8,23:10,19:13,20:15},u={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},o={25:2,26:4,29:6,30:8,31:10,27:13,28:15},i=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],l;(function(y){y[y.ERROR=0]="ERROR",y[y.TEXT=1]="TEXT",y[y.WARNING=2]="WARNING",y[y.INFO=2]="INFO",y[y.DEBUG=3]="DEBUG",y[y.DATA=3]="DATA"})(l||(l={}));var s=function(){function y(){this.time=null,this.verboseLevel=l.ERROR}var C=y.prototype;return C.log=function(_,O){this.verboseLevel>=_&&S.logger.log(this.time+" ["+_+"] "+O)},y}(),h=function(C){for(var d=[],_=0;_<C.length;_++)d.push(C[_].toString(16));return d},r=function(){function y(d,_,O,A,P){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=d||"white",this.underline=_||!1,this.italics=O||!1,this.background=A||"black",this.flash=P||!1}var C=y.prototype;return C.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},C.setStyles=function(_){for(var O=["foreground","underline","italics","background","flash"],A=0;A<O.length;A++){var P=O[A];_.hasOwnProperty(P)&&(this[P]=_[P])}},C.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},C.equals=function(_){return this.foreground===_.foreground&&this.underline===_.underline&&this.italics===_.italics&&this.background===_.background&&this.flash===_.flash},C.copy=function(_){this.foreground=_.foreground,this.underline=_.underline,this.italics=_.italics,this.background=_.background,this.flash=_.flash},C.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},y}(),t=function(){function y(d,_,O,A,P,I){this.uchar=void 0,this.penState=void 0,this.uchar=d||" ",this.penState=new r(_,O,A,P,I)}var C=y.prototype;return C.reset=function(){this.uchar=" ",this.penState.reset()},C.setChar=function(_,O){this.uchar=_,this.penState.copy(O)},C.setPenState=function(_){this.penState.copy(_)},C.equals=function(_){return this.uchar===_.uchar&&this.penState.equals(_.penState)},C.copy=function(_){this.uchar=_.uchar,this.penState.copy(_.penState)},C.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},y}(),n=function(){function y(d){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var _=0;_<w;_++)this.chars.push(new t);this.logger=d,this.pos=0,this.currPenState=new r}var C=y.prototype;return C.equals=function(_){for(var O=!0,A=0;A<w;A++)if(!this.chars[A].equals(_.chars[A])){O=!1;break}return O},C.copy=function(_){for(var O=0;O<w;O++)this.chars[O].copy(_.chars[O])},C.isEmpty=function(){for(var _=!0,O=0;O<w;O++)if(!this.chars[O].isEmpty()){_=!1;break}return _},C.setCursor=function(_){this.pos!==_&&(this.pos=_),this.pos<0?(this.logger.log(l.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>w&&(this.logger.log(l.DEBUG,"Too large cursor position "+this.pos),this.pos=w)},C.moveCursor=function(_){var O=this.pos+_;if(_>1)for(var A=this.pos+1;A<O+1;A++)this.chars[A].setPenState(this.currPenState);this.setCursor(O)},C.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},C.insertChar=function(_){_>=144&&this.backSpace();var O=x(_);if(this.pos>=w){this.logger.log(l.ERROR,"Cannot insert "+_.toString(16)+" ("+O+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(O,this.currPenState),this.moveCursor(1)},C.clearFromPos=function(_){var O;for(O=_;O<w;O++)this.chars[O].reset()},C.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},C.clearToEndOfRow=function(){this.clearFromPos(this.pos)},C.getTextString=function(){for(var _=[],O=!0,A=0;A<w;A++){var P=this.chars[A].uchar;P!==" "&&(O=!1),_.push(P)}return O?"":_.join("")},C.setPenStyles=function(_){this.currPenState.setStyles(_);var O=this.chars[this.pos];O.setPenState(this.currPenState)},y}(),c=function(){function y(d){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var _=0;_<T;_++)this.rows.push(new n(d));this.logger=d,this.currRow=T-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var C=y.prototype;return C.reset=function(){for(var _=0;_<T;_++)this.rows[_].clear();this.currRow=T-1},C.equals=function(_){for(var O=!0,A=0;A<T;A++)if(!this.rows[A].equals(_.rows[A])){O=!1;break}return O},C.copy=function(_){for(var O=0;O<T;O++)this.rows[O].copy(_.rows[O])},C.isEmpty=function(){for(var _=!0,O=0;O<T;O++)if(!this.rows[O].isEmpty()){_=!1;break}return _},C.backSpace=function(){var _=this.rows[this.currRow];_.backSpace()},C.clearToEndOfRow=function(){var _=this.rows[this.currRow];_.clearToEndOfRow()},C.insertChar=function(_){var O=this.rows[this.currRow];O.insertChar(_)},C.setPen=function(_){var O=this.rows[this.currRow];O.setPenStyles(_)},C.moveCursor=function(_){var O=this.rows[this.currRow];O.moveCursor(_)},C.setCursor=function(_){this.logger.log(l.INFO,"setCursor: "+_);var O=this.rows[this.currRow];O.setCursor(_)},C.setPAC=function(_){this.logger.log(l.INFO,"pacData = "+JSON.stringify(_));var O=_.row-1;if(this.nrRollUpRows&&O<this.nrRollUpRows-1&&(O=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==O){for(var A=0;A<T;A++)this.rows[A].clear();var P=this.currRow+1-this.nrRollUpRows,I=this.lastOutputScreen;if(I){var W=I.rows[P].cueStartTime,K=this.logger.time;if(W&&K!==null&&W<K)for(var te=0;te<this.nrRollUpRows;te++)this.rows[O-this.nrRollUpRows+te+1].copy(I.rows[P+te])}}this.currRow=O;var H=this.rows[this.currRow];if(_.indent!==null){var G=_.indent,V=Math.max(G-1,0);H.setCursor(_.indent),_.color=H.chars[V].penState.foreground}var re={foreground:_.color,underline:_.underline,italics:_.italics,background:"black",flash:!1};this.setPen(re)},C.setBkgData=function(_){this.logger.log(l.INFO,"bkgData = "+JSON.stringify(_)),this.backSpace(),this.setPen(_),this.insertChar(32)},C.setRollUpRows=function(_){this.nrRollUpRows=_},C.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(l.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(l.TEXT,this.getDisplayText());var _=this.currRow+1-this.nrRollUpRows,O=this.rows.splice(_,1)[0];O.clear(),this.rows.splice(this.currRow,0,O),this.logger.log(l.INFO,"Rolling up")},C.getDisplayText=function(_){_=_||!1;for(var O=[],A="",P=-1,I=0;I<T;I++){var W=this.rows[I].getTextString();W&&(P=I+1,_?O.push("Row "+P+": '"+W+"'"):O.push(W.trim()))}return O.length>0&&(_?A="["+O.join(" | ")+"]":A=O.join(`
|
|
|
`)),A},C.getTextAndFormat=function(){return this.rows},y}(),m=function(){function y(d,_,O){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=d,this.outputFilter=_,this.mode=null,this.verbose=0,this.displayedMemory=new c(O),this.nonDisplayedMemory=new c(O),this.lastOutputScreen=new c(O),this.currRollUpRow=this.displayedMemory.rows[T-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=O}var C=y.prototype;return C.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[T-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},C.getHandler=function(){return this.outputFilter},C.setHandler=function(_){this.outputFilter=_},C.setPAC=function(_){this.writeScreen.setPAC(_)},C.setBkgData=function(_){this.writeScreen.setBkgData(_)},C.setMode=function(_){if(_===this.mode)return;this.mode=_,this.logger.log(l.INFO,"MODE="+_),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=_},C.insertChars=function(_){for(var O=0;O<_.length;O++)this.writeScreen.insertChar(_[O]);var A=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(l.INFO,A+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(l.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},C.ccRCL=function(){this.logger.log(l.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},C.ccBS=function(){if(this.logger.log(l.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},C.ccAOF=function(){},C.ccAON=function(){},C.ccDER=function(){this.logger.log(l.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},C.ccRU=function(_){this.logger.log(l.INFO,"RU("+_+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(_)},C.ccFON=function(){this.logger.log(l.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},C.ccRDC=function(){this.logger.log(l.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},C.ccTR=function(){this.logger.log(l.INFO,"TR"),this.setMode("MODE_TEXT")},C.ccRTD=function(){this.logger.log(l.INFO,"RTD"),this.setMode("MODE_TEXT")},C.ccEDM=function(){this.logger.log(l.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},C.ccCR=function(){this.logger.log(l.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},C.ccENM=function(){this.logger.log(l.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},C.ccEOC=function(){if(this.logger.log(l.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var _=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=_,this.writeScreen=this.nonDisplayedMemory,this.logger.log(l.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},C.ccTO=function(_){this.logger.log(l.INFO,"TO("+_+") - Tab Offset"),this.writeScreen.moveCursor(_)},C.ccMIDROW=function(_){var O={flash:!1};if(O.underline=_%2===1,O.italics=_>=46,O.italics)O.foreground="white";else{var A=Math.floor(_/2)-16,P=["white","green","blue","cyan","red","yellow","magenta"];O.foreground=P[A]}this.logger.log(l.INFO,"MIDROW: "+JSON.stringify(O)),this.writeScreen.setPen(O)},C.outputDataUpdate=function(_){_===void 0&&(_=!1);var O=this.logger.time;if(O===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=O:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,O,this.lastOutputScreen),_&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:O),this.lastOutputScreen.copy(this.displayedMemory))},C.cueSplitAtTime=function(_){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,_,this.displayedMemory),this.cueStartTime=_))},y}(),v=function(){function y(d,_,O){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var A=new s;this.channels=[null,new m(d,_,A),new m(d+1,O,A)],this.cmdHistory=g(),this.logger=A}var C=y.prototype;return C.getHandler=function(_){return this.channels[_].getHandler()},C.setHandler=function(_,O){this.channels[_].setHandler(O)},C.addData=function(_,O){var A,P,I,W=!1;this.logger.time=_;for(var K=0;K<O.length;K+=2){if(P=O[K]&127,I=O[K+1]&127,P===0&&I===0)continue;if(this.logger.log(l.DATA,"["+h([O[K],O[K+1]])+"] -> ("+h([P,I])+")"),A=this.parseCmd(P,I),A||(A=this.parseMidrow(P,I)),A||(A=this.parsePAC(P,I)),A||(A=this.parseBackgroundAttributes(P,I)),!A&&(W=this.parseChars(P,I),W)){var te=this.currentChannel;if(te&&te>0){var H=this.channels[te];H.insertChars(W)}else this.logger.log(l.WARNING,"No channel found yet. TEXT-MODE?")}!A&&!W&&this.logger.log(l.WARNING,"Couldn't parse cleaned data "+h([P,I])+" orig: "+h([O[K],O[K+1]]))}},C.parseCmd=function(_,O){var A=this.cmdHistory,P=(_===20||_===28||_===21||_===29)&&O>=32&&O<=47,I=(_===23||_===31)&&O>=33&&O<=35;if(!(P||I))return!1;if(E(_,O,A))return b(null,null,A),this.logger.log(l.DEBUG,"Repeated command ("+h([_,O])+") is dropped"),!0;var W=_===20||_===21||_===23?1:2,K=this.channels[W];return _===20||_===21||_===28||_===29?O===32?K.ccRCL():O===33?K.ccBS():O===34?K.ccAOF():O===35?K.ccAON():O===36?K.ccDER():O===37?K.ccRU(2):O===38?K.ccRU(3):O===39?K.ccRU(4):O===40?K.ccFON():O===41?K.ccRDC():O===42?K.ccTR():O===43?K.ccRTD():O===44?K.ccEDM():O===45?K.ccCR():O===46?K.ccENM():O===47&&K.ccEOC():K.ccTO(O-32),b(_,O,A),this.currentChannel=W,!0},C.parseMidrow=function(_,O){var A=0;if((_===17||_===25)&&O>=32&&O<=47){if(_===17?A=1:A=2,A!==this.currentChannel)return this.logger.log(l.ERROR,"Mismatch channel in midrow parsing"),!1;var P=this.channels[A];return P?(P.ccMIDROW(O),this.logger.log(l.DEBUG,"MIDROW ("+h([_,O])+")"),!0):!1}return!1},C.parsePAC=function(_,O){var A,P=this.cmdHistory,I=(_>=17&&_<=23||_>=25&&_<=31)&&O>=64&&O<=127,W=(_===16||_===24)&&O>=64&&O<=95;if(!(I||W))return!1;if(E(_,O,P))return b(null,null,P),!0;var K=_<=23?1:2;O>=64&&O<=95?A=K===1?f[_]:u[_]:A=K===1?p[_]:o[_];var te=this.channels[K];return te?(te.setPAC(this.interpretPAC(A,O)),b(_,O,P),this.currentChannel=K,!0):!1},C.interpretPAC=function(_,O){var A,P={color:null,italics:!1,indent:null,underline:!1,row:_};return O>95?A=O-96:A=O-64,P.underline=(A&1)===1,A<=13?P.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(A/2)]:A<=15?(P.italics=!0,P.color="white"):P.indent=Math.floor((A-16)/2)*4,P},C.parseChars=function(_,O){var A,P=null,I=null;if(_>=25?(A=2,I=_-8):(A=1,I=_),I>=17&&I<=19){var W;I===17?W=O+80:I===18?W=O+112:W=O+144,this.logger.log(l.INFO,"Special char '"+x(W)+"' in channel "+A),P=[W]}else _>=32&&_<=127&&(P=O===0?[_]:[_,O]);if(P){var K=h(P);this.logger.log(l.DEBUG,"Char codes = "+K.join(",")),b(_,O,this.cmdHistory)}return P},C.parseBackgroundAttributes=function(_,O){var A=(_===16||_===24)&&O>=32&&O<=47,P=(_===23||_===31)&&O>=45&&O<=47;if(!(A||P))return!1;var I,W={};_===16||_===24?(I=Math.floor((O-32)/2),W.background=i[I],O%2===1&&(W.background=W.background+"_semi")):O===45?W.background="transparent":(W.foreground="black",O===47&&(W.underline=!0));var K=_<=23?1:2,te=this.channels[K];return te.setBkgData(W),b(_,O,this.cmdHistory),!0},C.reset=function(){for(var _=0;_<Object.keys(this.channels).length;_++){var O=this.channels[_];O&&O.reset()}this.cmdHistory=g()},C.cueSplitAtTime=function(_){for(var O=0;O<this.channels.length;O++){var A=this.channels[O];A&&A.cueSplitAtTime(_)}},y}();function b(y,C,d){d.a=y,d.b=C}function E(y,C,d){return d.a===y&&d.b===C}function g(){return{a:null,b:null}}Q.default=v},"./src/utils/codecs.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"isCodecType",function(){return D}),j.d(Q,"isCodecSupportedInMp4",function(){return x});var S={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 D(T,w){var f=S[w];return!!f&&f[T.slice(0,4)]===!0}function x(T,w){return MediaSource.isTypeSupported((w||"video")+'/mp4;codecs="'+T+'"')}},"./src/utils/cues.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/utils/vttparser.ts"),D=j("./src/utils/webvtt-parser.ts"),x=j("./src/utils/texttrack-utils.ts"),T=/\s/,w={newCue:function(p,u,o,i){for(var l=[],s,h,r,t,n,c=self.VTTCue||self.TextTrackCue,m=0;m<i.rows.length;m++)if(s=i.rows[m],r=!0,t=0,n="",!s.isEmpty()){for(var v=0;v<s.chars.length;v++)T.test(s.chars[v].uchar)&&r?t++:(n+=s.chars[v].uchar,r=!1);s.cueStartTime=u,u===o&&(o+=1e-4),t>=16?t--:t++;var b=Object(S.fixLineBreaks)(n.trim()),E=Object(D.generateCueId)(u,o,b);(!p||!p.cues||!p.cues.getCueById(E))&&(h=new c(u,o,b),h.id=E,h.line=m+1,h.align="left",h.position=10+Math.min(80,Math.floor(t*8/32)*10),l.push(h))}return p&&l.length&&(l.sort(function(g,y){return g.line==="auto"||y.line==="auto"?0:g.line>8&&y.line>8?y.line-g.line:g.line-y.line}),l.forEach(function(g){return Object(x.addCueToTrack)(p,g)})),l}};Q.default=w},"./src/utils/discontinuities.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"findFirstFragWithCC",function(){return T}),j.d(Q,"shouldAlignOnDiscontinuities",function(){return w}),j.d(Q,"findDiscontinuousReferenceFrag",function(){return f}),j.d(Q,"adjustSlidingStart",function(){return u}),j.d(Q,"alignStream",function(){return o}),j.d(Q,"alignPDT",function(){return l}),j.d(Q,"alignFragmentByPDTDelta",function(){return s}),j.d(Q,"alignMediaPlaylistByPDT",function(){return h});var S=j("./src/polyfills/number.ts"),D=j("./src/utils/logger.ts"),x=j("./src/controller/level-helper.ts");function T(r,t){for(var n=null,c=0,m=r.length;c<m;c++){var v=r[c];if(v&&v.cc===t){n=v;break}}return n}function w(r,t,n){return!!(t.details&&(n.endCC>n.startCC||r&&r.cc<n.startCC))}function f(r,t){var n=r.fragments,c=t.fragments;if(!c.length||!n.length){D.logger.log("No fragments to align");return}var m=T(n,c[0].cc);if(!m||m&&!m.startPTS){D.logger.log("No frag in previous level to align on");return}return m}function p(r,t){if(r){var n=r.start+t;r.start=r.startPTS=n,r.endPTS=n+r.duration}}function u(r,t){for(var n=t.fragments,c=0,m=n.length;c<m;c++)p(n[c],r);t.fragmentHint&&p(t.fragmentHint,r),t.alignedSliding=!0}function o(r,t,n){if(!t)return;i(r,n,t),!n.alignedSliding&&t.details&&l(n,t.details),!n.alignedSliding&&t.details&&!n.skippedSegments&&Object(x.adjustSliding)(t.details,n)}function i(r,t,n){if(w(r,n,t)){var c=f(n.details,t);c&&Object(S.isFiniteNumber)(c.start)&&(D.logger.log("Adjusting PTS using last level due to CC increase within current level "+t.url),u(c.start,t))}}function l(r,t){if(!t.fragments.length||!r.hasProgramDateTime||!t.hasProgramDateTime)return;var n=t.fragments[0].programDateTime,c=r.fragments[0].programDateTime,m=(c-n)/1e3+t.fragments[0].start;m&&Object(S.isFiniteNumber)(m)&&(D.logger.log("Adjusting PTS using programDateTime delta "+(c-n)+"ms, sliding:"+m.toFixed(3)+" "+r.url+" "),u(m,r))}function s(r,t){var n=r.programDateTime;if(!n)return;var c=(n-t)/1e3;r.start=r.startPTS=c,r.endPTS=c+r.duration}function h(r,t){if(!t.fragments.length||!r.hasProgramDateTime||!t.hasProgramDateTime)return;var n=t.fragments[0].programDateTime,c=t.fragments[0].start,m=n-c*1e3;r.fragments.forEach(function(v){s(v,m)}),r.fragmentHint&&s(r.fragmentHint,m),r.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/utils/ewma.ts"),D=function(){function x(w,f,p){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=p,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new S.default(w),this.fast_=new S.default(f)}var T=x.prototype;return T.update=function(f,p){var u=this.slow_,o=this.fast_;this.slow_.halfLife!==f&&(this.slow_=new S.default(f,u.getEstimate(),u.getTotalWeight())),this.fast_.halfLife!==p&&(this.fast_=new S.default(p,o.getEstimate(),o.getTotalWeight()))},T.sample=function(f,p){f=Math.max(f,this.minDelayMs_);var u=8*p,o=f/1e3,i=u/o;this.fast_.sample(o,i),this.slow_.sample(o,i)},T.canEstimate=function(){var f=this.fast_;return f&&f.getTotalWeight()>=this.minWeight_},T.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},T.destroy=function(){},x}();Q.default=D},"./src/utils/ewma.ts":function(ue,Q,j){"use strict";j.r(Q);var S=function(){function D(T,w,f){w===void 0&&(w=0),f===void 0&&(f=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=T,this.alpha_=T?Math.exp(Math.log(.5)/T):0,this.estimate_=w,this.totalWeight_=f}var x=D.prototype;return x.sample=function(w,f){var p=Math.pow(this.alpha_,w);this.estimate_=f*(1-p)+p*this.estimate_,this.totalWeight_+=w},x.getTotalWeight=function(){return this.totalWeight_},x.getEstimate=function(){if(this.alpha_){var w=1-Math.pow(this.alpha_,this.totalWeight_);if(w)return this.estimate_/w}return this.estimate_},D}();Q.default=S},"./src/utils/fetch-loader.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"fetchSupported",function(){return s});var S=j("./src/polyfills/number.ts"),D=j("./src/loader/load-stats.ts"),x=j("./src/demux/chunk-cache.ts");function T(c,m){c.prototype=Object.create(m.prototype),c.prototype.constructor=c,o(c,m)}function w(c){var m=typeof Map=="function"?new Map:void 0;return w=function(b){if(b===null||!u(b))return b;if(typeof b!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m!="undefined"){if(m.has(b))return m.get(b);m.set(b,E)}function E(){return f(b,arguments,i(this).constructor)}return E.prototype=Object.create(b.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),o(E,b)},w(c)}function f(c,m,v){return p()?f=Reflect.construct:f=function(E,g,y){var C=[null];C.push.apply(C,g);var d=Function.bind.apply(E,C),_=new d;return y&&o(_,y.prototype),_},f.apply(null,arguments)}function p(){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(c){return!1}}function u(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function o(c,m){return o=Object.setPrototypeOf||function(b,E){return b.__proto__=E,b},o(c,m)}function i(c){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},i(c)}function l(){return l=Object.assign||function(c){for(var m=1;m<arguments.length;m++){var v=arguments[m];for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(c[b]=v[b])}return c},l.apply(this,arguments)}function s(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(c){}return!1}var h=function(){function c(v){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=v.fetchSetup||t,this.controller=new self.AbortController,this.stats=new D.LoadStats}var m=c.prototype;return m.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},m.abortInternal=function(){var b=this.response;(!b||!b.ok)&&(this.stats.aborted=!0,this.controller.abort())},m.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},m.load=function(b,E,g){var y=this,C=this.stats;if(C.loading.start)throw new Error("Loader can only be used once.");C.loading.start=self.performance.now();var d=r(b,this.controller.signal),_=g.onProgress,O=b.responseType==="arraybuffer",A=O?"byteLength":"length";this.context=b,this.config=E,this.callbacks=g,this.request=this.fetchSetup(b,d),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){y.abortInternal(),g.onTimeout(C,b,y.response)},E.timeout),self.fetch(this.request).then(function(P){if(y.response=y.loader=P,!P.ok){var I=P.status,W=P.statusText;throw new n(W||"fetch, bad network response",I,P)}return C.loading.first=Math.max(self.performance.now(),C.loading.start),C.total=parseInt(P.headers.get("Content-Length")||"0"),_&&Object(S.isFiniteNumber)(E.highWaterMark)?y.loadProgressively(P,C,b,E.highWaterMark,_):O?P.arrayBuffer():P.text()}).then(function(P){var I=y.response;self.clearTimeout(y.requestTimeout),C.loading.end=Math.max(self.performance.now(),C.loading.first),C.loaded=C.total=P[A];var W={url:I.url,data:P};_&&!Object(S.isFiniteNumber)(E.highWaterMark)&&_(C,b,P,I),g.onSuccess(W,C,b,I)}).catch(function(P){if(self.clearTimeout(y.requestTimeout),C.aborted)return;var I=P.code||0;g.onError({code:I,text:P.message},b,P.details)})},m.getCacheAge=function(){var b=null;if(this.response){var E=this.response.headers.get("age");b=E?parseFloat(E):null}return b},m.loadProgressively=function(b,E,g,y,C){y===void 0&&(y=0);var d=new x.default,_=b.body.getReader(),O=function A(){return _.read().then(function(P){if(P.done)return d.dataLength&&C(E,g,d.flush(),b),Promise.resolve(new ArrayBuffer(0));var I=P.value,W=I.length;return E.loaded+=W,W<y||d.dataLength?(d.push(I),d.dataLength>=y&&C(E,g,d.flush(),b)):C(E,g,I,b),A()}).catch(function(){return Promise.reject()})};return O()},c}();function r(c,m){var v={method:"GET",mode:"cors",credentials:"same-origin",signal:m,headers:new self.Headers(l({},c.headers))};return c.rangeEnd&&v.headers.set("Range","bytes="+c.rangeStart+"-"+String(c.rangeEnd-1)),v}function t(c,m){return new self.Request(c.url,m)}var n=function(c){T(m,c);function m(v,b,E){var g;return g=c.call(this,v)||this,g.code=void 0,g.details=void 0,g.code=b,g.details=E,g}return m}(w(Error));Q.default=h},"./src/utils/imsc1-ttml-parser.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"IMSC1_CODEC",function(){return u}),j.d(Q,"parseIMSC1",function(){return s});var S=j("./src/utils/mp4-tools.ts"),D=j("./src/utils/vttparser.ts"),x=j("./src/utils/vttcue.ts"),T=j("./src/demux/id3.ts"),w=j("./src/utils/timescale-conversion.ts"),f=j("./src/utils/webvtt-parser.ts");function p(){return p=Object.assign||function(y){for(var C=1;C<arguments.length;C++){var d=arguments[C];for(var _ in d)Object.prototype.hasOwnProperty.call(d,_)&&(y[_]=d[_])}return y},p.apply(this,arguments)}var u="stpp.ttml.im1t",o=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,i=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,l={left:"start",center:"center",right:"end",start:"start",end:"end"};function s(y,C,d,_,O){var A=Object(S.findBox)(new Uint8Array(y),["mdat"]);if(A.length===0){O(new Error("Could not parse IMSC1 mdat"));return}var P=A[0],I=Object(T.utf8ArrayToStr)(new Uint8Array(y,P.start,P.end-P.start)),W=Object(w.toTimescaleFromScale)(C,1,d);try{_(h(I,W))}catch(K){O(K)}}function h(y,C){var d=new DOMParser,_=d.parseFromString(y,"text/xml"),O=_.getElementsByTagName("tt")[0];if(!O)throw new Error("Invalid ttml");var A={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},P=Object.keys(A).reduce(function(H,G){return H[G]=O.getAttribute("ttp:"+G)||A[G],H},{}),I=O.getAttribute("xml:space")!=="preserve",W=t(r(O,"styling","style")),K=t(r(O,"layout","region")),te=r(O,"body","[begin]");return[].map.call(te,function(H){var G=n(H,I);if(!G||!H.hasAttribute("begin"))return null;var V=b(H.getAttribute("begin"),P),re=b(H.getAttribute("dur"),P),$=b(H.getAttribute("end"),P);if(V===null)throw v(H);if($===null){if(re===null)throw v(H);$=V+re}var ne=new x.default(V-C,$-C,G);ne.id=Object(f.generateCueId)(ne.startTime,ne.endTime,ne.text);var he=K[H.getAttribute("region")],pe=W[H.getAttribute("style")];ne.position=10,ne.size=80;var Te=c(he,pe),we=Te.textAlign;if(we){var Me=l[we];Me&&(ne.lineAlign=Me),ne.align=we}return p(ne,Te),ne}).filter(function(H){return H!==null})}function r(y,C,d){var _=y.getElementsByTagName(C)[0];return _?[].slice.call(_.querySelectorAll(d)):[]}function t(y){return y.reduce(function(C,d){var _=d.getAttribute("xml:id");return _&&(C[_]=d),C},{})}function n(y,C){return[].slice.call(y.childNodes).reduce(function(d,_,O){var A;return _.nodeName==="br"&&O?d+`
|
|
|
`:(A=_.childNodes)!==null&&A!==void 0&&A.length?n(_,C):C?d+_.textContent.trim().replace(/\s+/g," "):d+_.textContent},"")}function c(y,C){var d="http://www.w3.org/ns/ttml#styling",_=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return _.reduce(function(O,A){var P=m(C,d,A)||m(y,d,A);return P&&(O[A]=P),O},{})}function m(y,C,d){return y.hasAttributeNS(C,d)?y.getAttributeNS(C,d):null}function v(y){return new Error("Could not parse ttml timestamp "+y)}function b(y,C){if(!y)return null;var d=Object(D.parseTimeStamp)(y);return d===null&&(o.test(y)?d=E(y,C):i.test(y)&&(d=g(y,C))),d}function E(y,C){var d=o.exec(y),_=(d[4]|0)+(d[5]|0)/C.subFrameRate;return(d[1]|0)*3600+(d[2]|0)*60+(d[3]|0)+_/C.frameRate}function g(y,C){var d=i.exec(y),_=Number(d[1]),O=d[2];switch(O){case"h":return _*3600;case"m":return _*60;case"ms":return _*1e3;case"f":return _/C.frameRate;case"t":return _/C.tickRate}return _}},"./src/utils/logger.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"enableLogs",function(){return f}),j.d(Q,"logger",function(){return p});var S=function(){},D={trace:S,debug:S,log:S,warn:S,info:S,error:S},x=D;function T(u){var o=self.console[u];return o?o.bind(self.console,"["+u+"] >"):S}function w(u){for(var o=arguments.length,i=new Array(o>1?o-1:0),l=1;l<o;l++)i[l-1]=arguments[l];i.forEach(function(s){x[s]=u[s]?u[s].bind(u):T(s)})}function f(u){if(self.console&&u===!0||typeof u=="object"){w(u,"debug","log","info","warn","error");try{x.log()}catch(o){x=D}}else x=D}var p=x},"./src/utils/mediakeys-helper.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"KeySystems",function(){return S}),j.d(Q,"requestMediaKeySystemAccess",function(){return D});var S;(function(x){x.WIDEVINE="com.widevine.alpha",x.PLAYREADY="com.microsoft.playready"})(S||(S={}));var D=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"getMediaSource",function(){return S});function S(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"bin2str",function(){return w}),j.d(Q,"readUint16",function(){return f}),j.d(Q,"readUint32",function(){return p}),j.d(Q,"writeUint32",function(){return u}),j.d(Q,"findBox",function(){return o}),j.d(Q,"parseSegmentIndex",function(){return i}),j.d(Q,"parseInitSegment",function(){return l}),j.d(Q,"getStartDTS",function(){return s}),j.d(Q,"getDuration",function(){return h}),j.d(Q,"computeRawDurationFromSamples",function(){return r}),j.d(Q,"offsetStartDTS",function(){return t}),j.d(Q,"segmentValidRange",function(){return n}),j.d(Q,"appendUint8Array",function(){return c});var S=j("./src/utils/typed-array.ts"),D=j("./src/loader/fragment.ts"),x=Math.pow(2,32)-1,T=[].push;function w(m){return String.fromCharCode.apply(null,m)}function f(m,v){"data"in m&&(v+=m.start,m=m.data);var b=m[v]<<8|m[v+1];return b<0?65536+b:b}function p(m,v){"data"in m&&(v+=m.start,m=m.data);var b=m[v]<<24|m[v+1]<<16|m[v+2]<<8|m[v+3];return b<0?4294967296+b:b}function u(m,v,b){"data"in m&&(v+=m.start,m=m.data),m[v]=b>>24,m[v+1]=b>>16&255,m[v+2]=b>>8&255,m[v+3]=b&255}function o(m,v){var b=[];if(!v.length)return b;var E,g,y;"data"in m?(E=m.data,g=m.start,y=m.end):(E=m,g=0,y=E.byteLength);for(var C=g;C<y;){var d=p(E,C),_=w(E.subarray(C+4,C+8)),O=d>1?C+d:y;if(_===v[0])if(v.length===1)b.push({data:E,start:C+8,end:O});else{var A=o({data:E,start:C+8,end:O},v.slice(1));A.length&&T.apply(b,A)}C=O}return b}function i(m){var v=o(m,["moov"]),b=v[0],E=b?b.end:null,g=o(m,["sidx"]);if(!g||!g[0])return null;var y=[],C=g[0],d=C.data[0],_=d===0?8:16,O=p(C,_);_+=4;var A=0,P=0;d===0?_+=8:_+=16,_+=2;var I=C.end+P,W=f(C,_);_+=2;for(var K=0;K<W;K++){var te=_,H=p(C,te);te+=4;var G=H&2147483647,V=(H&2147483648)>>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var re=p(C,te);te+=4,y.push({referenceSize:G,subsegmentDuration:re,info:{duration:re/O,start:I,end:I+G-1}}),I+=G,te+=4,_=te}return{earliestPresentationTime:A,timescale:O,version:d,referencesCount:W,references:y,moovEndOffset:E}}function l(m){for(var v=[],b=o(m,["moov","trak"]),E=0;E<b.length;E++){var g=b[E],y=o(g,["tkhd"])[0];if(y){var C=y.data[y.start],d=C===0?12:20,_=p(y,d),O=o(g,["mdia","mdhd"])[0];if(O){C=O.data[O.start],d=C===0?12:20;var A=p(O,d),P=o(g,["mdia","hdlr"])[0];if(P){var I=w(P.data.subarray(P.start+8,P.start+12)),W={soun:D.ElementaryStreamTypes.AUDIO,vide:D.ElementaryStreamTypes.VIDEO}[I];if(W){var K=o(g,["mdia","minf","stbl","stsd"])[0],te=void 0;K&&(te=w(K.data.subarray(K.start+12,K.start+16))),v[_]={timescale:A,type:W},v[W]={timescale:A,id:_,codec:te}}}}}}var H=o(m,["moov","mvex","trex"]);return H.forEach(function(G){var V=p(G,4),re=v[V];re&&(re.default={duration:p(G,12),flags:p(G,20)})}),v}function s(m,v){return o(v,["moof","traf"]).reduce(function(b,E){var g=o(E,["tfdt"])[0],y=g.data[g.start],C=o(E,["tfhd"]).reduce(function(d,_){var O=p(_,4),A=m[O];if(A){var P=p(g,4);y===1&&(P*=Math.pow(2,32),P+=p(g,8));var I=A.timescale||9e4,W=P/I;if(isFinite(W)&&(d===null||W<d))return W}return d},null);return C!==null&&isFinite(C)&&(b===null||C<b)?C:b},null)||0}function h(m,v){for(var b=0,E=0,g=0,y=o(m,["moof","traf"]),C=0;C<y.length;C++){var d=y[C],_=o(d,["tfhd"])[0],O=p(_,4),A=v[O];if(!A)continue;var P=A.default,I=p(_,0)|(P==null?void 0:P.flags),W=P==null?void 0:P.duration;I&8&&(I&2?W=p(_,12):W=p(_,8));for(var K=A.timescale||9e4,te=o(d,["trun"]),H=0;H<te.length;H++){if(W){var G=p(te[H],4);b=W*G}else b=r(te[H]);A.type===D.ElementaryStreamTypes.VIDEO?E+=b/K:A.type===D.ElementaryStreamTypes.AUDIO&&(g+=b/K)}}if(E===0&&g===0){var V=i(m);if(V!=null&&V.references)return V.references.reduce(function(re,$){return re+$.info.duration||0},0)}return E||g}function r(m){var v=p(m,0),b=8;v&1&&(b+=4),v&4&&(b+=4);for(var E=0,g=p(m,4),y=0;y<g;y++){if(v&256){var C=p(m,b);E+=C,b+=4}v&512&&(b+=4),v&1024&&(b+=4),v&2048&&(b+=4)}return E}function t(m,v,b){o(v,["moof","traf"]).forEach(function(E){o(E,["tfhd"]).forEach(function(g){var y=p(g,4),C=m[y];if(!C)return;var d=C.timescale||9e4;o(E,["tfdt"]).forEach(function(_){var O=_.data[_.start],A=p(_,4);if(O===0)u(_,4,A-b*d);else{A*=Math.pow(2,32),A+=p(_,8),A-=b*d,A=Math.max(A,0);var P=Math.floor(A/(x+1)),I=Math.floor(A%(x+1));u(_,4,P),u(_,8,I)}})})})}function n(m){var v={valid:null,remainder:null},b=o(m,["moof"]);if(b){if(b.length<2)return v.remainder=m,v}else return v;var E=b[b.length-1];return v.valid=Object(S.sliceUint8)(m,0,E.start-8),v.remainder=Object(S.sliceUint8)(m,E.start-8),v}function c(m,v){var b=new Uint8Array(m.length+v.length);return b.set(m),b.set(v,m.length),b}},"./src/utils/output-filter.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return S});var S=function(){function D(T,w){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=T,this.trackName=w}var x=D.prototype;return x.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},x.newCue=function(w,f,p){(this.startTime===null||this.startTime>w)&&(this.startTime=w),this.endTime=f,this.screen=p,this.timelineController.createCaptionsTrack(this.trackName)},x.reset=function(){this.cueRanges=[]},D}()},"./src/utils/texttrack-utils.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"sendAddTrackEvent",function(){return D}),j.d(Q,"addCueToTrack",function(){return x}),j.d(Q,"clearCurrentCues",function(){return T}),j.d(Q,"removeCuesInRange",function(){return w}),j.d(Q,"getCuesInRange",function(){return p});var S=j("./src/utils/logger.ts");function D(u,o){var i;try{i=new Event("addtrack")}catch(l){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=u,o.dispatchEvent(i)}function x(u,o){var i=u.mode;if(i==="disabled"&&(u.mode="hidden"),u.cues&&!u.cues.getCueById(o.id))try{if(u.addCue(o),!u.cues.getCueById(o.id))throw new Error("addCue is failed for: "+o)}catch(s){S.logger.debug("[texttrack-utils]: "+s);var l=new self.TextTrackCue(o.startTime,o.endTime,o.text);l.id=o.id,u.addCue(l)}i==="disabled"&&(u.mode=i)}function T(u){var o=u.mode;if(o==="disabled"&&(u.mode="hidden"),u.cues)for(var i=u.cues.length;i--;)u.removeCue(u.cues[i]);o==="disabled"&&(u.mode=o)}function w(u,o,i){var l=u.mode;if(l==="disabled"&&(u.mode="hidden"),u.cues&&u.cues.length>0)for(var s=p(u.cues,o,i),h=0;h<s.length;h++)u.removeCue(s[h]);l==="disabled"&&(u.mode=l)}function f(u,o){if(o<u[0].startTime)return 0;var i=u.length-1;if(o>u[i].endTime)return-1;for(var l=0,s=i;l<=s;){var h=Math.floor((s+l)/2);if(o<u[h].startTime)s=h-1;else if(o>u[h].startTime&&l<i)l=h+1;else return h}return u[l].startTime-o<o-u[s].startTime?l:s}function p(u,o,i){var l=[],s=f(u,o);if(s>-1)for(var h=s,r=u.length;h<r;h++){var t=u[h];if(t.startTime>=o&&t.endTime<=i)l.push(t);else if(t.startTime>i)return l}return l}},"./src/utils/time-ranges.ts":function(ue,Q,j){"use strict";j.r(Q);var S={toString:function(x){for(var T="",w=x.length,f=0;f<w;f++)T+="["+x.start(f).toFixed(3)+","+x.end(f).toFixed(3)+"]";return T}};Q.default=S},"./src/utils/timescale-conversion.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"toTimescaleFromBase",function(){return D}),j.d(Q,"toTimescaleFromScale",function(){return x}),j.d(Q,"toMsFromMpegTsClock",function(){return T}),j.d(Q,"toMpegTsClockFromTimescale",function(){return w});var S=9e4;function D(f,p,u,o){u===void 0&&(u=1),o===void 0&&(o=!1);var i=f*p*u;return o?Math.round(i):i}function x(f,p,u,o){return u===void 0&&(u=1),o===void 0&&(o=!1),D(f,p,1/u,o)}function T(f,p){return p===void 0&&(p=!1),D(f,1e3,1/S,p)}function w(f,p){return p===void 0&&(p=1),D(f,S,1/p)}},"./src/utils/typed-array.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"sliceUint8",function(){return S});function S(D,x,T){return Uint8Array.prototype.slice?D.slice(x,T):new Uint8Array(Array.prototype.slice.call(D,x,T))}},"./src/utils/vttcue.ts":function(ue,Q,j){"use strict";j.r(Q),Q.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var S=["","lr","rl"],D=["start","middle","end","left","right"];function x(u,o){if(typeof o!="string")return!1;if(!Array.isArray(u))return!1;var i=o.toLowerCase();return~u.indexOf(i)?i:!1}function T(u){return x(S,u)}function w(u){return x(D,u)}function f(u){for(var o=arguments.length,i=new Array(o>1?o-1:0),l=1;l<o;l++)i[l-1]=arguments[l];for(var s=1;s<arguments.length;s++){var h=arguments[s];for(var r in h)u[r]=h[r]}return u}function p(u,o,i){var l=this,s={enumerable:!0};l.hasBeenReset=!1;var h="",r=!1,t=u,n=o,c=i,m=null,v="",b=!0,E="auto",g="start",y=50,C="middle",d=50,_="middle";Object.defineProperty(l,"id",f({},s,{get:function(){return h},set:function(A){h=""+A}})),Object.defineProperty(l,"pauseOnExit",f({},s,{get:function(){return r},set:function(A){r=!!A}})),Object.defineProperty(l,"startTime",f({},s,{get:function(){return t},set:function(A){if(typeof A!="number")throw new TypeError("Start time must be set to a number.");t=A,this.hasBeenReset=!0}})),Object.defineProperty(l,"endTime",f({},s,{get:function(){return n},set:function(A){if(typeof A!="number")throw new TypeError("End time must be set to a number.");n=A,this.hasBeenReset=!0}})),Object.defineProperty(l,"text",f({},s,{get:function(){return c},set:function(A){c=""+A,this.hasBeenReset=!0}})),Object.defineProperty(l,"region",f({},s,{get:function(){return m},set:function(A){m=A,this.hasBeenReset=!0}})),Object.defineProperty(l,"vertical",f({},s,{get:function(){return v},set:function(A){var P=T(A);if(P===!1)throw new SyntaxError("An invalid or illegal string was specified.");v=P,this.hasBeenReset=!0}})),Object.defineProperty(l,"snapToLines",f({},s,{get:function(){return b},set:function(A){b=!!A,this.hasBeenReset=!0}})),Object.defineProperty(l,"line",f({},s,{get:function(){return E},set:function(A){if(typeof A!="number"&&A!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");E=A,this.hasBeenReset=!0}})),Object.defineProperty(l,"lineAlign",f({},s,{get:function(){return g},set:function(A){var P=w(A);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");g=P,this.hasBeenReset=!0}})),Object.defineProperty(l,"position",f({},s,{get:function(){return y},set:function(A){if(A<0||A>100)throw new Error("Position must be between 0 and 100.");y=A,this.hasBeenReset=!0}})),Object.defineProperty(l,"positionAlign",f({},s,{get:function(){return C},set:function(A){var P=w(A);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");C=P,this.hasBeenReset=!0}})),Object.defineProperty(l,"size",f({},s,{get:function(){return d},set:function(A){if(A<0||A>100)throw new Error("Size must be between 0 and 100.");d=A,this.hasBeenReset=!0}})),Object.defineProperty(l,"align",f({},s,{get:function(){return _},set:function(A){var P=w(A);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");_=P,this.hasBeenReset=!0}})),l.displayState=void 0}return p.prototype.getCueAsHTML=function(){var u=self.WebVTT;return u.convertCueToDOMTree(self,this.text)},p}()},"./src/utils/vttparser.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"parseTimeStamp",function(){return x}),j.d(Q,"fixLineBreaks",function(){return o}),j.d(Q,"VTTParser",function(){return i});var S=j("./src/utils/vttcue.ts"),D=function(){function l(){}var s=l.prototype;return s.decode=function(r,t){if(!r)return"";if(typeof r!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(r))},l}();function x(l){function s(r,t,n,c){return(r|0)*3600+(t|0)*60+(n|0)+parseFloat(c||0)}var h=l.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return h?parseFloat(h[2])>59?s(h[2],h[3],0,h[4]):s(h[1],h[2],h[3],h[4]):null}var T=function(){function l(){this.values=Object.create(null)}var s=l.prototype;return s.set=function(r,t){!this.get(r)&&t!==""&&(this.values[r]=t)},s.get=function(r,t,n){return n?this.has(r)?this.values[r]:t[n]:this.has(r)?this.values[r]:t},s.has=function(r){return r in this.values},s.alt=function(r,t,n){for(var c=0;c<n.length;++c)if(t===n[c]){this.set(r,t);break}},s.integer=function(r,t){/^-?\d+$/.test(t)&&this.set(r,parseInt(t,10))},s.percent=function(r,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var n=parseFloat(t);if(n>=0&&n<=100)return this.set(r,n),!0}return!1},l}();function w(l,s,h,r){var t=r?l.split(r):[l];for(var n in t){if(typeof t[n]!="string")continue;var c=t[n].split(h);if(c.length!==2)continue;var m=c[0],v=c[1];s(m,v)}}var f=new S.default(0,0,""),p=f.align==="middle"?"middle":"center";function u(l,s,h){var r=l;function t(){var m=x(l);if(m===null)throw new Error("Malformed timestamp: "+r);return l=l.replace(/^[^\sa-zA-Z-]+/,""),m}function n(m,v){var b=new T;w(m,function(y,C){var d;switch(y){case"region":for(var _=h.length-1;_>=0;_--)if(h[_].id===C){b.set(y,h[_].region);break}break;case"vertical":b.alt(y,C,["rl","lr"]);break;case"line":d=C.split(","),b.integer(y,d[0]),b.percent(y,d[0])&&b.set("snapToLines",!1),b.alt(y,d[0],["auto"]),d.length===2&&b.alt("lineAlign",d[1],["start",p,"end"]);break;case"position":d=C.split(","),b.percent(y,d[0]),d.length===2&&b.alt("positionAlign",d[1],["start",p,"end","line-left","line-right","auto"]);break;case"size":b.percent(y,C);break;case"align":b.alt(y,C,["start",p,"end","left","right"]);break}},/:/,/\s/),v.region=b.get("region",null),v.vertical=b.get("vertical","");var E=b.get("line","auto");E==="auto"&&f.line===-1&&(E=-1),v.line=E,v.lineAlign=b.get("lineAlign","start"),v.snapToLines=b.get("snapToLines",!0),v.size=b.get("size",100),v.align=b.get("align",p);var g=b.get("position","auto");g==="auto"&&f.position===50&&(g=v.align==="start"||v.align==="left"?0:v.align==="end"||v.align==="right"?100:50),v.position=g}function c(){l=l.replace(/^\s+/,"")}if(c(),s.startTime=t(),c(),l.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+r);l=l.substr(3),c(),s.endTime=t(),c(),n(l,s)}function o(l){return l.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}var i=function(){function l(){this.state="INITIAL",this.buffer="",this.decoder=new D,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=l.prototype;return s.parse=function(r){var t=this;r&&(t.buffer+=t.decoder.decode(r,{stream:!0}));function n(){var g=t.buffer,y=0;for(g=o(g);y<g.length&&g[y]!=="\r"&&g[y]!==`
|
|
|
`;)++y;var C=g.substr(0,y);return g[y]==="\r"&&++y,g[y]===`
|
|
|
`&&++y,t.buffer=g.substr(y),C}function c(g){w(g,function(y,C){},/:/)}try{var m="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;m=n();var v=m.match(/^()?WEBVTT([ \t].*)?$/);if(!v||!v[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var b=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;b?b=!1:m=n();switch(t.state){case"HEADER":/:/.test(m)?c(m):m||(t.state="ID");continue;case"NOTE":m||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(m)){t.state="NOTE";break}if(!m)continue;if(t.cue=new S.default(0,0,""),t.state="CUE",m.indexOf("-->")===-1){t.cue.id=m;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{u(m,t.cue,t.regionList)}catch(g){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{var E=m.indexOf("-->")!==-1;if(!m||E&&(b=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
|
`),t.cue.text+=m}continue;case"BADCUE":m||(t.state="ID")}}}catch(g){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var r=this;try{if((r.cue||r.state==="HEADER")&&(r.buffer+=`
|
|
|
|
|
|
`,r.parse()),r.state==="INITIAL"||r.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){r.onparsingerror&&r.onparsingerror(t)}return r.onflush&&r.onflush(),this},l}()},"./src/utils/webvtt-parser.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"generateCueId",function(){return i}),j.d(Q,"parseWebVTT",function(){return s});var S=j("./src/polyfills/number.ts"),D=j("./src/utils/vttparser.ts"),x=j("./src/demux/id3.ts"),T=j("./src/utils/timescale-conversion.ts"),w=j("./src/remux/mp4-remuxer.ts"),f=/\r\n|\n\r|\n|\r/g,p=function(r,t,n){return n===void 0&&(n=0),r.substr(n,t.length)===t},u=function(r){var t=parseInt(r.substr(-3)),n=parseInt(r.substr(-6,2)),c=parseInt(r.substr(-9,2)),m=r.length>9?parseInt(r.substr(0,r.indexOf(":"))):0;if(!Object(S.isFiniteNumber)(t)||!Object(S.isFiniteNumber)(n)||!Object(S.isFiniteNumber)(c)||!Object(S.isFiniteNumber)(m))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+r);return t+=1e3*n,t+=60*1e3*c,t+=60*60*1e3*m,t},o=function(r){for(var t=5381,n=r.length;n;)t=t*33^r.charCodeAt(--n);return(t>>>0).toString()};function i(h,r,t){return o(h.toString())+o(r.toString())+o(t)}var l=function(r,t,n){var c=r[t],m=r[c.prevCC];if(!m||!m.new&&c.new){r.ccOffset=r.presentationOffset=c.start,c.new=!1;return}for(;(v=m)!==null&&v!==void 0&&v.new;){var v;r.ccOffset+=c.start-m.start,c.new=!1,c=m,m=r[c.prevCC]}r.presentationOffset=n};function s(h,r,t,n,c,m,v,b){var E=new D.VTTParser,g=Object(x.utf8ArrayToStr)(new Uint8Array(h)).trim().replace(f,`
|
|
|
`).split(`
|
|
|
`),y=[],C=Object(T.toMpegTsClockFromTimescale)(r,t),d="00:00.000",_=0,O=0,A,P=!0,I=!1;E.oncue=function(W){var K=n[c],te=n.ccOffset,H=(_-C)/9e4;if(K!=null&&K.new&&(O!==void 0?te=n.ccOffset=K.start:l(n,c,H)),H&&(te=H-n.presentationOffset),I){var G=W.endTime-W.startTime,V=Object(w.normalizePts)((W.startTime+te-O)*9e4,m*9e4)/9e4;W.startTime=V,W.endTime=V+G}var re=W.text.trim();W.text=decodeURIComponent(encodeURIComponent(re)),W.id||(W.id=i(W.startTime,W.endTime,re)),W.endTime>0&&y.push(W)},E.onparsingerror=function(W){A=W},E.onflush=function(){if(A){b(A);return}v(y)},g.forEach(function(W){if(P)if(p(W,"X-TIMESTAMP-MAP=")){P=!1,I=!0,W.substr(16).split(",").forEach(function(K){p(K,"LOCAL:")?d=K.substr(6):p(K,"MPEGTS:")&&(_=parseInt(K.substr(7)))});try{O=u(d)/1e3}catch(K){I=!1,A=K}return}else W===""&&(P=!1);E.parse(W+`
|
|
|
`)}),E.flush()}},"./src/utils/xhr-loader.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/utils/logger.ts"),D=j("./src/loader/load-stats.ts"),x=/^age:\s*[\d.]+\s*$/m,T=function(){function w(p){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=p?p.xhrSetup:null,this.stats=new D.LoadStats,this.retryDelay=0}var f=w.prototype;return f.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},f.abortInternal=function(){var u=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),u&&(u.onreadystatechange=null,u.onprogress=null,u.readyState!==4&&(this.stats.aborted=!0,u.abort()))},f.abort=function(){var u;this.abortInternal(),(u=this.callbacks)!==null&&u!==void 0&&u.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},f.load=function(u,o,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=u,this.config=o,this.callbacks=i,this.retryDelay=o.retryDelay,this.loadInternal()},f.loadInternal=function(){var u=this.config,o=this.context;if(!u)return;var i=this.loader=new self.XMLHttpRequest,l=this.stats;l.loading.first=0,l.loaded=0;var s=this.xhrSetup;try{if(s)try{s(i,o.url)}catch(t){i.open("GET",o.url,!0),s(i,o.url)}i.readyState||i.open("GET",o.url,!0);var h=this.context.headers;if(h)for(var r in h)i.setRequestHeader(r,h[r])}catch(t){this.callbacks.onError({code:i.status,text:t.message},o,i);return}o.rangeEnd&&i.setRequestHeader("Range","bytes="+o.rangeStart+"-"+(o.rangeEnd-1)),i.onreadystatechange=this.readystatechange.bind(this),i.onprogress=this.loadprogress.bind(this),i.responseType=o.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),u.timeout),i.send()},f.readystatechange=function(){var u=this.context,o=this.loader,i=this.stats;if(!u||!o)return;var l=o.readyState,s=this.config;if(i.aborted)return;if(l>=2)if(self.clearTimeout(this.requestTimeout),i.loading.first===0&&(i.loading.first=Math.max(self.performance.now(),i.loading.start)),l===4){o.onreadystatechange=null,o.onprogress=null;var h=o.status;if(h>=200&&h<300){i.loading.end=Math.max(self.performance.now(),i.loading.first);var r,t;if(u.responseType==="arraybuffer"?(r=o.response,t=r.byteLength):(r=o.responseText,t=r.length),i.loaded=i.total=t,!this.callbacks)return;var n=this.callbacks.onProgress;if(n&&n(i,u,r,o),!this.callbacks)return;var c={url:o.responseURL,data:r};this.callbacks.onSuccess(c,i,u,o)}else i.retry>=s.maxRetry||h>=400&&h<499?(S.logger.error(h+" while loading "+u.url),this.callbacks.onError({code:h,text:o.statusText},u,o)):(S.logger.warn(h+" while loading "+u.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,s.maxRetryDelay),i.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},f.loadtimeout=function(){S.logger.warn("timeout while loading "+this.context.url);var u=this.callbacks;u&&(this.abortInternal(),u.onTimeout(this.stats,this.context,this.loader))},f.loadprogress=function(u){var o=this.stats;o.loaded=u.loaded,u.lengthComputable&&(o.total=u.total)},f.getCacheAge=function(){var u=null;if(this.loader&&x.test(this.loader.getAllResponseHeaders())){var o=this.loader.getResponseHeader("age");u=o?parseFloat(o):null}return u},w}();Q.default=T}}).default})},vHTk:function(nt,Le,F){nt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return J});var ue=F("rePB"),Q=F("VTBJ"),j=F("KQm4"),S=F("U8pU"),D=F("ODXe"),x=F("q1tI"),T=F("TSYQ"),w=F.n(T),f=F("Gytx"),p=F.n(f),u=F("Kwbf"),o=F("t23M"),i=F("qx4F"),l=F("6eGT"),s=F("IBYe"),h=F("Ff2n"),r=F("c+Xe"),t=F("fyJ8"),n=F("biw7");function c(He,Be,Ze,ht,Qe){var Xe=Ze[He]||{},Ke=Ze[Be]||{},Fe,Ue;Xe.fixed==="left"?Fe=ht.left[He]:Ke.fixed==="right"&&(Ue=ht.right[Be]);var _e=!1,Ce=!1,Ne=!1,De=!1,rt=Ze[Be+1],tt=Ze[He-1];if(Qe==="rtl"){if(Fe!==void 0){var xt=tt&&tt.fixed==="left";De=!xt}else if(Ue!==void 0){var Mt=rt&&rt.fixed==="right";Ne=!Mt}}else if(Fe!==void 0){var Bt=rt&&rt.fixed==="left";_e=!Bt}else if(Ue!==void 0){var It=tt&&tt.fixed==="right";Ce=!It}return{fixLeft:Fe,fixRight:Ue,lastFixLeft:_e,firstFixRight:Ce,lastFixRight:Ne,firstFixLeft:De,isSticky:ht.isSticky}}var m=F("sR1s");function v(He){var Be=He.cells,Ze=He.stickyOffsets,ht=He.flattenColumns,Qe=He.rowComponent,Xe=He.cellComponent,Ke=He.onHeaderRow,Fe=He.index,Ue=x.useContext(n.a),_e=Ue.prefixCls,Ce=Ue.direction,Ne;Ke&&(Ne=Ke(Be.map(function(rt){return rt.column}),Fe));var De=Object(m.a)(Be.map(function(rt){return rt.column}));return x.createElement(Qe,Object.assign({},Ne),Be.map(function(rt,tt){var xt=rt.column,Mt=c(rt.colStart,rt.colEnd,ht,Ze,Ce),Bt;return xt&&xt.onHeaderCell&&(Bt=rt.column.onHeaderCell(xt)),x.createElement(t.a,Object.assign({},rt,{ellipsis:xt.ellipsis,align:xt.align,component:Xe,prefixCls:_e,key:De[tt]},Mt,{additionalProps:Bt,rowType:"header"}))}))}v.displayName="HeaderRow";var b=v;function E(He){var Be=[];function Ze(Ke,Fe){var Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Be[Ue]=Be[Ue]||[];var _e=Fe,Ce=Ke.filter(Boolean).map(function(Ne){var De={key:Ne.key,className:Ne.className||"",children:Ne.title,column:Ne,colStart:_e},rt=1,tt=Ne.children;return tt&&tt.length>0&&(rt=Ze(tt,_e,Ue+1).reduce(function(xt,Mt){return xt+Mt},0),De.hasSubColumns=!0),"colSpan"in Ne&&(rt=Ne.colSpan),"rowSpan"in Ne&&(De.rowSpan=Ne.rowSpan),De.colSpan=rt,De.colEnd=De.colStart+rt-1,Be[Ue].push(De),_e+=rt,rt});return Ce}Ze(He,0);for(var ht=Be.length,Qe=function(Fe){Be[Fe].forEach(function(Ue){!("rowSpan"in Ue)&&!Ue.hasSubColumns&&(Ue.rowSpan=ht-Fe)})},Xe=0;Xe<ht;Xe+=1)Qe(Xe);return Be}function g(He){var Be=He.stickyOffsets,Ze=He.columns,ht=He.flattenColumns,Qe=He.onHeaderRow,Xe=x.useContext(n.a),Ke=Xe.prefixCls,Fe=Xe.getComponent,Ue=x.useMemo(function(){return E(Ze)},[Ze]),_e=Fe(["header","wrapper"],"thead"),Ce=Fe(["header","row"],"tr"),Ne=Fe(["header","cell"],"th");return x.createElement(_e,{className:"".concat(Ke,"-thead")},Ue.map(function(De,rt){var tt=x.createElement(b,{key:rt,flattenColumns:ht,cells:De,stickyOffsets:Be,rowComponent:Ce,cellComponent:Ne,onHeaderRow:Qe,index:rt});return tt}))}var y=g,C=F("hW8S");function d(He){for(var Be=He.colWidths,Ze=He.columns,ht=He.columCount,Qe=[],Xe=ht||Ze.length,Ke=!1,Fe=Xe-1;Fe>=0;Fe-=1){var Ue=Be[Fe],_e=Ze&&Ze[Fe],Ce=_e&&_e[C.a];(Ue||Ce||Ke)&&(Qe.unshift(x.createElement("col",Object.assign({key:Fe,style:{width:Ue,minWidth:Ue}},Ce))),Ke=!0)}return x.createElement("colgroup",null,Qe)}var _=d;function O(He,Be){return Object(x.useMemo)(function(){for(var Ze=[],ht=0;ht<Be;ht+=1){var Qe=He[ht];if(Qe!==void 0)Ze[ht]=Qe;else return null}return Ze},[He.join("_"),Be])}var A=x.forwardRef(function(He,Be){var Ze=He.noData,ht=He.columns,Qe=He.flattenColumns,Xe=He.colWidths,Ke=He.columCount,Fe=He.stickyOffsets,Ue=He.direction,_e=He.fixHeader,Ce=He.offsetHeader,Ne=He.stickyClassName,De=He.onScroll,rt=Object(h.a)(He,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),tt=x.useContext(n.a),xt=tt.prefixCls,Mt=tt.scrollbarSize,Bt=tt.isSticky,It=Bt&&!_e?0:Mt,Dt=x.useRef(null),lt=x.useCallback(function(Nt){Object(r.b)(Be,Nt),Object(r.b)(Dt,Nt)},[]);x.useEffect(function(){var Nt;function Ut(it){var mt=it.currentTarget,bt=it.deltaX;bt&&(De({currentTarget:mt,scrollLeft:mt.scrollLeft+bt}),it.preventDefault())}return(Nt=Dt.current)===null||Nt===void 0||Nt.addEventListener("wheel",Ut),function(){var it;(it=Dt.current)===null||it===void 0||it.removeEventListener("wheel",Ut)}},[]);var pt=Qe[Qe.length-1],ut={fixed:pt?pt.fixed:null,onHeaderCell:function(){return{className:"".concat(xt,"-cell-scrollbar")}}},Pe=Object(x.useMemo)(function(){return It?[].concat(Object(j.a)(ht),[ut]):ht},[It,ht]),Ve=Object(x.useMemo)(function(){return It?[].concat(Object(j.a)(Qe),[ut]):Qe},[It,Qe]),yt=Object(x.useMemo)(function(){var Nt=Fe.right,Ut=Fe.left;return Object(Q.a)(Object(Q.a)({},Fe),{},{left:Ue==="rtl"?[].concat(Object(j.a)(Ut.map(function(it){return it+It})),[0]):Ut,right:Ue==="rtl"?Nt:[].concat(Object(j.a)(Nt.map(function(it){return it+It})),[0]),isSticky:Bt})},[It,Fe,Bt]),st=O(Xe,Ke);return x.createElement("div",{style:Object(Q.a)({overflow:"hidden"},Bt?{top:Ce}:{}),ref:lt,className:w()("".concat(xt,"-header"),Object(ue.a)({},Ne,!!Ne))},x.createElement("table",{style:{tableLayout:"fixed",visibility:Ze||st?null:"hidden"}},x.createElement(_,{colWidths:st?[].concat(Object(j.a)(st),[It]):[],columCount:Ke+1,columns:Ve}),x.createElement(y,Object.assign({},rt,{stickyOffsets:yt,columns:Pe,flattenColumns:Ve}))))});A.displayName="FixedHeader";var P=A,I=x.createContext(null),W=I;function K(He){var Be=He.prefixCls,Ze=He.children,ht=He.component,Qe=He.cellComponent,Xe=He.fixHeader,Ke=He.fixColumn,Fe=He.horizonScroll,Ue=He.className,_e=He.expanded,Ce=He.componentWidth,Ne=He.colSpan,De=x.useContext(n.a),rt=De.scrollbarSize;return x.useMemo(function(){var tt=Ze;return Ke&&(tt=x.createElement("div",{style:{width:Ce-(Xe?rt:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Be,"-expanded-row-fixed")},tt)),x.createElement(ht,{className:Ue,style:{display:_e?null:"none"}},x.createElement(t.a,{component:Qe,prefixCls:Be,colSpan:Ne},tt))},[Ze,ht,Xe,Fe,Ue,_e,Ce,Ne,rt])}var te=K;function H(He){var Be=He.className,Ze=He.style,ht=He.record,Qe=He.index,Xe=He.rowKey,Ke=He.getRowKey,Fe=He.rowExpandable,Ue=He.expandedKeys,_e=He.onRow,Ce=He.indent,Ne=Ce===void 0?0:Ce,De=He.rowComponent,rt=He.cellComponent,tt=He.childrenColumnName,xt=x.useContext(n.a),Mt=xt.prefixCls,Bt=xt.fixedInfoList,It=x.useContext(W),Dt=It.fixHeader,lt=It.fixColumn,pt=It.horizonScroll,ut=It.componentWidth,Pe=It.flattenColumns,Ve=It.expandableType,yt=It.expandRowByClick,st=It.onTriggerExpand,Nt=It.rowClassName,Ut=It.expandedRowClassName,it=It.indentSize,mt=It.expandIcon,bt=It.expandedRowRender,At=It.expandIconColumnIndex,Xt=x.useState(!1),Ae=Object(D.a)(Xt,2),ge=Ae[0],z=Ae[1],Z=Ue&&Ue.has(He.recordKey);x.useEffect(function(){Z&&z(!0)},[Z]);var oe=Ve==="row"&&(!Fe||Fe(ht)),me=Ve==="nest",Re=tt&&ht&&ht[tt],Je=oe||me,at;_e&&(at=_e(ht,Qe));var kt=function(N){if(yt&&Je&&st(ht,N),at&&at.onClick){for(var B,ae=arguments.length,fe=new Array(ae>1?ae-1:0),se=1;se<ae;se++)fe[se-1]=arguments[se];(B=at).onClick.apply(B,[N].concat(fe))}},jt;typeof Nt=="string"?jt=Nt:typeof Nt=="function"&&(jt=Nt(ht,Qe,Ne));var ot=Object(m.a)(Pe),wt=x.createElement(De,Object.assign({},at,{"data-row-key":Xe,className:w()(Be,"".concat(Mt,"-row"),"".concat(Mt,"-row-level-").concat(Ne),jt,at&&at.className),style:Object(Q.a)(Object(Q.a)({},Ze),at?at.style:null),onClick:kt}),Pe.map(function(ie,N){var B=ie.render,ae=ie.dataIndex,fe=ie.className,se=ot[N],$e=Bt[N],St;N===(At||0)&&me&&(St=x.createElement(x.Fragment,null,x.createElement("span",{style:{paddingLeft:"".concat(it*Ne,"px")},className:"".concat(Mt,"-row-indent indent-level-").concat(Ne)}),mt({prefixCls:Mt,expanded:Z,expandable:Re,record:ht,onExpand:st})));var Pt;return ie.onCell&&(Pt=ie.onCell(ht,Qe)),x.createElement(t.a,Object.assign({className:fe,ellipsis:ie.ellipsis,align:ie.align,component:rt,prefixCls:Mt,key:se,record:ht,index:Qe,dataIndex:ae,render:B,shouldCellUpdate:ie.shouldCellUpdate},$e,{appendNode:St,additionalProps:Pt}))})),Kt;if(oe&&(ge||Z)){var Et=bt(ht,Qe,Ne+1,Z),Qt=Ut&&Ut(ht,Qe,Ne);Kt=x.createElement(te,{expanded:Z,className:w()("".concat(Mt,"-expanded-row"),"".concat(Mt,"-expanded-row-level-").concat(Ne+1),Qt),prefixCls:Mt,fixHeader:Dt,fixColumn:lt,horizonScroll:pt,component:De,componentWidth:ut,cellComponent:rt,colSpan:Pe.length},Et)}var Vt;return Re&&Z&&(Vt=(ht[tt]||[]).map(function(ie,N){var B=Ke(ie,N);return x.createElement(H,Object.assign({},He,{key:B,rowKey:B,record:ie,recordKey:B,index:N,indent:Ne+1}))})),x.createElement(x.Fragment,null,wt,Kt,Vt)}H.displayName="BodyRow";var G=H,V=x.createContext(null),re=V;function $(He){var Be=He.columnKey,Ze=He.onColumnResize,ht=x.useRef();return x.useEffect(function(){ht.current&&Ze(Be,ht.current.offsetWidth)},[]),x.createElement(o.a,{onResize:function(Xe){var Ke=Xe.offsetWidth;Ze(Be,Ke)}},x.createElement("td",{ref:ht,style:{padding:0,border:0,height:0}},x.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function ne(He){var Be=He.data,Ze=He.getRowKey,ht=He.measureColumnWidth,Qe=He.expandedKeys,Xe=He.onRow,Ke=He.rowExpandable,Fe=He.emptyNode,Ue=He.childrenColumnName,_e=x.useContext(re),Ce=_e.onColumnResize,Ne=x.useContext(n.a),De=Ne.prefixCls,rt=Ne.getComponent,tt=x.useContext(W),xt=tt.fixHeader,Mt=tt.horizonScroll,Bt=tt.flattenColumns,It=tt.componentWidth;return x.useMemo(function(){var Dt=rt(["body","wrapper"],"tbody"),lt=rt(["body","row"],"tr"),pt=rt(["body","cell"],"td"),ut;Be.length?ut=Be.map(function(Ve,yt){var st=Ze(Ve,yt);return x.createElement(G,{key:st,rowKey:st,record:Ve,recordKey:st,index:yt,rowComponent:lt,cellComponent:pt,expandedKeys:Qe,onRow:Xe,getRowKey:Ze,rowExpandable:Ke,childrenColumnName:Ue})}):ut=x.createElement(te,{expanded:!0,className:"".concat(De,"-placeholder"),prefixCls:De,fixHeader:xt,fixColumn:Mt,horizonScroll:Mt,component:lt,componentWidth:It,cellComponent:pt,colSpan:Bt.length},Fe);var Pe=Object(m.a)(Bt);return x.createElement(Dt,{className:"".concat(De,"-tbody")},ht&&x.createElement("tr",{"aria-hidden":"true",className:"".concat(De,"-measure-row"),style:{height:0}},Pe.map(function(Ve){return x.createElement($,{key:Ve,columnKey:Ve,onColumnResize:Ce})})),ut)},[Be,De,Xe,ht,Qe,Ze,rt,It,Fe,Bt])}var he=x.memo(ne);he.displayName="Body";var pe=he,Te=F("wRmb"),we=F("xEkU"),Me=F.n(we);function Ee(He){var Be=Object(x.useRef)(He),Ze=Object(x.useState)({}),ht=Object(D.a)(Ze,2),Qe=ht[1],Xe=Object(x.useRef)(null),Ke=Object(x.useRef)([]);function Fe(Ue){Xe.current===null&&(Ke.current=[],Xe.current=Me()(function(){Ke.current.forEach(function(_e){Be.current=_e(Be.current)}),Xe.current=null,Qe({})})),Ke.current.push(Ue)}return Object(x.useEffect)(function(){return function(){Me.a.cancel(Xe.current)}},[]),[Be.current,Fe]}function xe(He){var Be=Object(x.useRef)(He),Ze=Object(x.useRef)(null);function ht(){window.clearTimeout(Ze.current)}function Qe(Ke){Be.current=Ke,ht(),Ze.current=window.setTimeout(function(){Be.current=null,Ze.current=null},100)}function Xe(){return Be.current}return Object(x.useEffect)(function(){return ht},[]),[Qe,Xe]}function Ge(He,Be,Ze){var ht=Object(x.useMemo)(function(){for(var Qe=[],Xe=[],Ke=0,Fe=0,Ue=0;Ue<Be;Ue+=1)if(Ze==="rtl"){Xe[Ue]=Fe,Fe+=He[Ue]||0;var _e=Be-Ue-1;Qe[_e]=Ke,Ke+=He[_e]||0}else{Qe[Ue]=Ke,Ke+=He[Ue]||0;var Ce=Be-Ue-1;Xe[Ce]=Fe,Fe+=He[Ce]||0}return{left:Qe,right:Xe}},[He,Be,Ze]);return ht}var je=Ge;function We(He){var Be=He.className,Ze=He.children;return x.createElement("div",{className:Be},Ze)}var ze=We,de=F("n6Qo");function le(He){var Be,Ze=He.prefixCls,ht=He.record,Qe=He.onExpand,Xe=He.expanded,Ke=He.expandable,Fe="".concat(Ze,"-row-expand-icon");if(!Ke)return x.createElement("span",{className:w()(Fe,"".concat(Ze,"-row-spaced"))});var Ue=function(Ce){Qe(ht,Ce),Ce.stopPropagation()};return x.createElement("span",{className:w()(Fe,(Be={},Object(ue.a)(Be,"".concat(Ze,"-row-expanded"),Xe),Object(ue.a)(Be,"".concat(Ze,"-row-collapsed"),!Xe),Be)),onClick:Ue})}function Oe(He,Be,Ze){var ht=[];function Qe(Xe){(Xe||[]).forEach(function(Ke,Fe){ht.push(Be(Ke,Fe)),Qe(Ke[Ze])})}return Qe(He),ht}var Ie=F("zT1h"),qe=F("y0+3"),ee=function(Be,Ze){var ht,Qe,Xe=Be.scrollBodyRef,Ke=Be.onScroll,Fe=Be.offsetScroll,Ue=x.useContext(n.a),_e=Ue.prefixCls,Ce=((ht=Xe.current)===null||ht===void 0?void 0:ht.scrollWidth)||0,Ne=((Qe=Xe.current)===null||Qe===void 0?void 0:Qe.clientWidth)||0,De=Ce&&Ne*(Ne/Ce),rt=x.useRef(),tt=Ee({scrollLeft:0,isHiddenScrollBar:!1}),xt=Object(D.a)(tt,2),Mt=xt[0],Bt=xt[1],It=x.useRef({delta:0,x:0}),Dt=x.useState(!1),lt=Object(D.a)(Dt,2),pt=lt[0],ut=lt[1],Pe=function(){ut(!1)},Ve=function(it){it.persist(),It.current.delta=it.pageX-Mt.scrollLeft,It.current.x=0,ut(!0),it.preventDefault()},yt=function(it){var mt,bt=it||((mt=window)===null||mt===void 0?void 0:mt.event),At=bt.buttons;if(!pt||At===0){pt&&ut(!1);return}var Xt=It.current.x+it.pageX-It.current.x-It.current.delta;Xt<=0&&(Xt=0),Xt+De>=Ne&&(Xt=Ne-De),Ke({scrollLeft:Xt/Ne*(Ce+2)}),It.current.x=it.pageX},st=function(){var it=Object(qe.b)(Xe.current).top,mt=it+Xe.current.offsetHeight,bt=document.documentElement.scrollTop+window.innerHeight;mt-Object(i.a)()<=bt||it>=bt-Fe?Bt(function(At){return Object(Q.a)(Object(Q.a)({},At),{},{isHiddenScrollBar:!0})}):Bt(function(At){return Object(Q.a)(Object(Q.a)({},At),{},{isHiddenScrollBar:!1})})},Nt=function(it){Bt(function(mt){return Object(Q.a)(Object(Q.a)({},mt),{},{scrollLeft:it/Ce*Ne||0})})};return x.useImperativeHandle(Ze,function(){return{setScrollLeft:Nt}}),x.useEffect(function(){var Ut=Object(Ie.a)(document.body,"mouseup",Pe,!1),it=Object(Ie.a)(document.body,"mousemove",yt,!1);return st(),function(){Ut.remove(),it.remove()}},[De,pt]),x.useEffect(function(){var Ut=Object(Ie.a)(window,"scroll",st,!1),it=Object(Ie.a)(window,"resize",st,!1);return function(){Ut.remove(),it.remove()}},[]),x.useEffect(function(){Mt.isHiddenScrollBar||Bt(function(Ut){var it,mt;return Object(Q.a)(Object(Q.a)({},Ut),{},{scrollLeft:Xe.current.scrollLeft/((it=Xe.current)===null||it===void 0?void 0:it.scrollWidth)*((mt=Xe.current)===null||mt===void 0?void 0:mt.clientWidth)})})},[Mt.isHiddenScrollBar]),Ce<=Ne||!De||Mt.isHiddenScrollBar?null:x.createElement("div",{style:{height:Object(i.a)(),width:Ne,bottom:Fe},className:"".concat(_e,"-sticky-scroll")},x.createElement("div",{onMouseDown:Ve,ref:rt,className:w()("".concat(_e,"-sticky-scroll-bar"),Object(ue.a)({},"".concat(_e,"-sticky-scroll-bar-active"),pt)),style:{width:"".concat(De,"px"),transform:"translate3d(".concat(Mt.scrollLeft,"px, 0, 0)")}}))},k=x.forwardRef(ee);function U(He,Be){return x.useMemo(function(){var Ze=!!He;return{isSticky:Ze,stickyClassName:Ze?"".concat(Be,"-sticky-header"):"",offsetHeader:Object(S.a)(He)==="object"&&He.offsetHeader||0,offsetScroll:Object(S.a)(He)==="object"&&He.offsetScroll||0}},[He,Be])}var q=[],Y={},J="rc-table-internal-hook",be=x.memo(function(He){var Be=He.children;return Be},function(He,Be){return p()(He.props,Be.props)?He.pingLeft!==Be.pingLeft||He.pingRight!==Be.pingRight:!1});function ke(He){var Be,Ze=He.prefixCls,ht=He.className,Qe=He.rowClassName,Xe=He.style,Ke=He.data,Fe=He.rowKey,Ue=He.scroll,_e=He.tableLayout,Ce=He.direction,Ne=He.title,De=He.footer,rt=He.summary,tt=He.id,xt=He.showHeader,Mt=He.components,Bt=He.emptyText,It=He.onRow,Dt=He.onHeaderRow,lt=He.internalHooks,pt=He.transformColumns,ut=He.internalRefs,Pe=He.sticky,Ve=Ke||q,yt=!!Ve.length,st=x.useState(0),Nt=Object(D.a)(st,2),Ut=Nt[0],it=Nt[1];x.useEffect(function(){it(Object(i.a)())});var mt=x.useMemo(function(){return Object(m.c)(Mt,{})},[Mt]),bt=x.useCallback(function(gt,Rt){return Object(m.b)(mt,gt)||Rt},[mt]),At=x.useMemo(function(){return typeof Fe=="function"?Fe:function(gt){var Rt=gt&>[Fe];return Rt}},[Fe]),Xt=Object(C.c)(He),Ae=Xt.expandIcon,ge=Xt.expandedRowKeys,z=Xt.defaultExpandedRowKeys,Z=Xt.defaultExpandAllRows,oe=Xt.expandedRowRender,me=Xt.onExpand,Re=Xt.onExpandedRowsChange,Je=Xt.expandRowByClick,at=Xt.rowExpandable,kt=Xt.expandIconColumnIndex,jt=Xt.expandedRowClassName,ot=Xt.childrenColumnName,wt=Xt.indentSize,Kt=Ae||le,Et=ot||"children",Qt=x.useMemo(function(){return oe?"row":He.expandable&<===J&&He.expandable.__PARENT_RENDER_ICON__||Ve.some(function(gt){return gt&&Object(S.a)(gt)==="object"&>[Et]})?"nest":!1},[!!oe,Ve]),Vt=x.useState(function(){return z||(Z?Oe(Ve,At,Et):[])}),ie=Object(D.a)(Vt,2),N=ie[0],B=ie[1],ae=x.useMemo(function(){return new Set(ge||N||[])},[ge,N]),fe=x.useCallback(function(gt){var Rt=At(gt,Ve.indexOf(gt)),Ht,mn=ae.has(Rt);mn?(ae.delete(Rt),Ht=Object(j.a)(ae)):Ht=[].concat(Object(j.a)(ae),[Rt]),B(Ht),me&&me(!mn,gt),Re&&Re(Ht)},[At,ae,Ve,me,Re]),se=x.useState(0),$e=Object(D.a)(se,2),St=$e[0],Pt=$e[1],$t=Object(Te.b)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},He),Xt),{},{expandable:!!oe,expandedKeys:ae,getRowKey:At,onTriggerExpand:fe,expandIcon:Kt,expandIconColumnIndex:kt,direction:Ce}),lt===J?pt:null),Ot=Object(D.a)($t,2),zt=Ot[0],an=Ot[1],jn=x.useMemo(function(){return{columns:zt,flattenColumns:an}},[zt,an]),Dr=x.useRef(),Cr=x.useRef(),Nn=x.useRef(),hr=x.useState(!1),mi=Object(D.a)(hr,2),Or=mi[0],yr=mi[1],pr=x.useState(!1),Yr=Object(D.a)(pr,2),Mr=Yr[0],Zr=Yr[1],wr=Ee(new Map),vi=Object(D.a)(wr,2),li=vi[0],Kr=vi[1],zr=Object(m.a)(an),xi=zr.map(function(gt){return li.get(gt)}),gi=x.useMemo(function(){return xi},[xi.join("_")]),Si=je(gi,an.length,Ce),Fn=Ue&&Object(m.d)(Ue.y),Sn=Ue&&Object(m.d)(Ue.x),_r=Sn&&an.some(function(gt){var Rt=gt.fixed;return Rt}),zn=x.useRef(),Lr=U(Pe,Ze),rr=Lr.isSticky,Ri=Lr.offsetHeader,Pr=Lr.offsetScroll,ni=Lr.stickyClassName,ji,ui,Di;Fn&&(ui={overflowY:"scroll",maxHeight:Ue.y}),Sn&&(ji={overflowX:"auto"},Fn||(ui={overflowY:"hidden"}),Di={width:Ue.x===!0?"auto":Ue.x,minWidth:"100%"});var ta=x.useCallback(function(gt,Rt){Kr(function(Ht){var mn=new Map(Ht);return mn.set(gt,Rt),mn})},[]),ci=xe(null),Fi=Object(D.a)(ci,2),Ci=Fi[0],zi=Fi[1];function qi(gt,Rt){if(!Rt)return;typeof Rt=="function"?Rt(gt):Rt.scrollLeft!==gt&&(Rt.scrollLeft=gt)}var yi=function(Rt){var Ht=Rt.currentTarget,mn=Rt.scrollLeft,fn=typeof mn=="number"?mn:Ht.scrollLeft,Ct=Ht||Y;if(!zi()||zi()===Ct){var _t;Ci(Ct),qi(fn,Cr.current),qi(fn,Nn.current),qi(fn,(_t=zn.current)===null||_t===void 0?void 0:_t.setScrollLeft)}if(Ht){var Zt=Ht.scrollWidth,Tt=Ht.clientWidth;yr(fn>0),Zr(fn<Zt-Tt)}},aa=function(){Nn.current&&yi({currentTarget:Nn.current})},ma=function(Rt){var Ht=Rt.width;aa(),Pt(Dr.current?Dr.current.offsetWidth:Ht)};x.useEffect(function(){return aa},[]),x.useEffect(function(){Sn&&aa()},[Sn]),x.useEffect(function(){lt===J&&ut&&(ut.body.current=Nn.current)});var un=bt(["table"],"table"),Cn=x.useMemo(function(){return _e||(_r?Ue.x==="max-content"?"auto":"fixed":Fn||an.some(function(gt){var Rt=gt.ellipsis;return Rt})?"fixed":"auto")},[Fn,_r,an,_e]),pn,Un={colWidths:gi,columCount:an.length,stickyOffsets:Si,onHeaderRow:Dt,fixHeader:Fn},ur=x.useMemo(function(){return yt?null:typeof Bt=="function"?Bt():Bt},[yt,Bt]),mr=x.createElement(pe,{data:Ve,measureColumnWidth:Fn||Sn||rr,expandedKeys:ae,rowExpandable:at,getRowKey:At,onRow:It,emptyNode:ur,childrenColumnName:Et}),Zn=x.createElement(_,{colWidths:an.map(function(gt){var Rt=gt.width;return Rt}),columns:an}),hn=rt&&x.createElement(de.b,null,rt(Ve)),Fr=bt(["body"]);if(Fn||rr){var Bn;typeof Fr=="function"?(Bn=Fr(Ve,{scrollbarSize:Ut,ref:Nn,onScroll:yi}),Un.colWidths=an.map(function(gt,Rt){var Ht=gt.width,mn=Rt===zt.length-1?Ht-Ut:Ht;return typeof mn=="number"&&!Number.isNaN(mn)?mn:(Object(u.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Bn=x.createElement("div",{style:Object(Q.a)(Object(Q.a)({},ji),ui),onScroll:yi,ref:Nn,className:w()("".concat(Ze,"-body"))},x.createElement(un,{style:Object(Q.a)(Object(Q.a)({},Di),{},{tableLayout:Cn})},Zn,mr,hn),rr&&x.createElement(k,{ref:zn,offsetScroll:Pr,scrollBodyRef:Nn,onScroll:yi})),pn=x.createElement(x.Fragment,null,xt!==!1&&x.createElement(P,Object.assign({noData:!Ve.length},Un,jn,{direction:Ce,offsetHeader:Ri,stickyClassName:ni,ref:Cr,onScroll:yi})),Bn)}else pn=x.createElement("div",{style:Object(Q.a)(Object(Q.a)({},ji),ui),className:w()("".concat(Ze,"-content")),onScroll:yi,ref:Nn},x.createElement(un,{style:Object(Q.a)(Object(Q.a)({},Di),{},{tableLayout:Cn})},Zn,xt!==!1&&x.createElement(y,Object.assign({},Un,jn)),mr,hn));var Bi=Object(C.b)(He),cr=x.createElement("div",Object.assign({className:w()(Ze,ht,(Be={},Object(ue.a)(Be,"".concat(Ze,"-rtl"),Ce==="rtl"),Object(ue.a)(Be,"".concat(Ze,"-ping-left"),Or),Object(ue.a)(Be,"".concat(Ze,"-ping-right"),Mr),Object(ue.a)(Be,"".concat(Ze,"-layout-fixed"),_e==="fixed"),Object(ue.a)(Be,"".concat(Ze,"-fixed-header"),Fn),Object(ue.a)(Be,"".concat(Ze,"-fixed-column"),_r),Object(ue.a)(Be,"".concat(Ze,"-scroll-horizontal"),Sn),Object(ue.a)(Be,"".concat(Ze,"-has-fix-left"),an[0]&&an[0].fixed),Object(ue.a)(Be,"".concat(Ze,"-has-fix-right"),an[an.length-1]&&an[an.length-1].fixed==="right"),Be)),style:Xe,id:tt,ref:Dr},Bi),x.createElement(be,{pingLeft:Or,pingRight:Mr,props:Object(Q.a)(Object(Q.a)({},He),{},{stickyOffsets:Si,mergedExpandedKeys:ae})},Ne&&x.createElement(ze,{className:"".concat(Ze,"-title")},Ne(Ve)),x.createElement("div",{className:"".concat(Ze,"-container")},pn),De&&x.createElement(ze,{className:"".concat(Ze,"-footer")},De(Ve))));Sn&&(cr=x.createElement(o.a,{onResize:ma},cr));var Br=x.useMemo(function(){return{prefixCls:Ze,getComponent:bt,scrollbarSize:Ut,direction:Ce,fixedInfoList:an.map(function(gt,Rt){return c(Rt,Rt,an,Si,Ce)}),isSticky:rr}},[Ze,bt,Ut,Ce,an,Si,Ce,rr]),bi=x.useMemo(function(){return Object(Q.a)(Object(Q.a)({},jn),{},{tableLayout:Cn,rowClassName:Qe,expandedRowClassName:jt,componentWidth:St,fixHeader:Fn,fixColumn:_r,horizonScroll:Sn,expandIcon:Kt,expandableType:Qt,expandRowByClick:Je,expandedRowRender:oe,onTriggerExpand:fe,expandIconColumnIndex:kt,indentSize:wt})},[jn,Cn,Qe,jt,St,Fn,_r,Sn,Kt,Qt,Je,oe,fe,kt,wt]),ft=x.useMemo(function(){return{onColumnResize:ta}},[ta]);return x.createElement(n.a.Provider,{value:Br},x.createElement(W.Provider,{value:bi},x.createElement(re.Provider,{value:ft},cr)))}ke.Column=s.a,ke.ColumnGroup=l.a,ke.Summary=de.a,ke.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var ct=Le.b=ke},wRmb:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return p});var ue=F("rePB"),Q=F("KQm4"),j=F("VTBJ"),S=F("Ff2n"),D=F("q1tI"),x=F.n(D),T=F("Kwbf"),w=F("Zm9Q"),f=F("hW8S");function p(s){return Object(w.a)(s).filter(function(h){return D.isValidElement(h)}).map(function(h){var r=h.key,t=h.props,n=t.children,c=Object(S.a)(t,["children"]),m=Object(j.a)({key:r},c);return n&&(m.children=p(n)),m})}function u(s){return s.reduce(function(h,r){var t=r.fixed,n=t===!0?"left":t,c=r.children;return c&&c.length>0?[].concat(Object(Q.a)(h),Object(Q.a)(u(c).map(function(m){return Object(j.a)({fixed:n},m)}))):[].concat(Object(Q.a)(h),[Object(j.a)(Object(j.a)({},r),{},{fixed:n})])},[])}function o(s){for(var h=!0,r=0;r<s.length;r+=1){var t=s[r];if(h&&t.fixed!=="left")h=!1;else if(!h&&t.fixed==="left"){Object(T.a)(!1,"Index ".concat(r-1," of `columns` missing `fixed='left'` prop."));break}}for(var n=!0,c=s.length-1;c>=0;c-=1){var m=s[c];if(n&&m.fixed!=="right")n=!1;else if(!n&&m.fixed==="right"){Object(T.a)(!1,"Index ".concat(c+1," of `columns` missing `fixed='right'` prop."));break}}}function i(s){return s.map(function(h){var r=h.fixed,t=Object(S.a)(h,["fixed"]),n=r;return r==="left"?n="right":r==="right"&&(n="left"),Object(j.a)({fixed:n},t)})}function l(s,h){var r=s.prefixCls,t=s.columns,n=s.children,c=s.expandable,m=s.expandedKeys,v=s.getRowKey,b=s.onTriggerExpand,E=s.expandIcon,g=s.rowExpandable,y=s.expandIconColumnIndex,C=s.direction,d=s.expandRowByClick,_=D.useMemo(function(){return t||p(n)},[t,n]),O=D.useMemo(function(){if(c){var I,W=y||0,K=_[W],te=(I={},Object(ue.a)(I,f.a,{className:"".concat(r,"-expand-icon-col")}),Object(ue.a)(I,"title",""),Object(ue.a)(I,"fixed",K?K.fixed:null),Object(ue.a)(I,"className","".concat(r,"-row-expand-icon-cell")),Object(ue.a)(I,"render",function(V,re,$){var ne=v(re,$),he=m.has(ne),pe=g?g(re):!0,Te=E({prefixCls:r,expanded:he,expandable:pe,record:re,onExpand:b});return d?D.createElement("span",{onClick:function(Me){return Me.stopPropagation()}},Te):Te}),I),H=_.slice();return W>=0&&H.splice(W,0,te),H}return _},[c,_,v,m,E,C]),A=D.useMemo(function(){var I=O;return h&&(I=h(I)),I.length||(I=[{render:function(){return null}}]),I},[h,O,C]),P=D.useMemo(function(){return C==="rtl"?i(u(A)):u(A)},[A,C]);return[A,P]}Le.b=l},wW8i:function(nt,Le,F){nt.exports={flex_box_center:"flex_box_center___3xqQI",flex_space_between:"flex_space_between___1fvHN",flex_box_vertical_center:"flex_box_vertical_center___1Gb4J",flex_box_center_end:"flex_box_center_end___8RbQi",flex_box_column:"flex_box_column___3xL78",discuss:"discuss___ybobd",reply:"reply___3EgHc",pagination:"pagination___2EiMG"}},"y0+3":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return u}),F.d(Le,"b",function(){return i});var ue=/margin|padding|width|height|max|min|offset/,Q={left:!0,top:!0},j={cssFloat:1,styleFloat:1,float:1};function S(l){return l.nodeType===1?l.ownerDocument.defaultView.getComputedStyle(l,null):{}}function D(l,s,h){if(s=s.toLowerCase(),h==="auto"){if(s==="height")return l.offsetHeight;if(s==="width")return l.offsetWidth}return s in Q||(Q[s]=ue.test(s)),Q[s]?parseFloat(h)||0:h}function x(l,s){var h=arguments.length,r=S(l);return s=j[s]?"cssFloat"in l.style?"cssFloat":"styleFloat":s,h===1?r:D(l,s,r[s]||l.style[s])}function T(l,s,h){var r=arguments.length;if(s=j[s]?"cssFloat"in l.style?"cssFloat":"styleFloat":s,r===3)return typeof h=="number"&&ue.test(s)&&(h="".concat(h,"px")),l.style[s]=h,h;for(var t in s)s.hasOwnProperty(t)&&T(l,t,s[t]);return S(l)}function w(l){return l===document.body?document.documentElement.clientWidth:l.offsetWidth}function f(l){return l===document.body?window.innerHeight||document.documentElement.clientHeight:l.offsetHeight}function p(){var l=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:l,height:s}}function u(){var l=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:l,height:s}}function o(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function i(l){var s=l.getBoundingClientRect(),h=document.documentElement;return{left:s.left+(window.pageXOffset||h.scrollLeft)-(h.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||h.scrollTop)-(h.clientTop||document.body.clientTop||0)}}},ynwM:function(nt,Le,F){var ue=F("MFOe"),Q=ue.Global;nt.exports={name:"oldFF-globalStorage",read:S,write:D,each:x,remove:T,clearAll:w};var j=Q.globalStorage;function S(f){return j[f]}function D(f,p){j[f]=p}function x(f){for(var p=j.length-1;p>=0;p--){var u=j.key(p);f(j[u],u)}}function T(f){return j.removeItem(f)}function w(){x(function(f,p){delete j[f]})}}}]);
|