|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[194,3,5,7,8,20],{"++UQ":function(rt,$e,H){},"+NIl":function(rt,$e,H){(function(de){de(H("VrN/"))})(function(de){"use strict";de.defineMode("stex",function(ee,j){"use strict";function w(u,s){u.cmdState.push(s)}function k(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function S(u){var s=u.cmdState.pop();s&&s.closeBracket()}function T(u){for(var s=u.cmdState,f=s.length-1;f>=0;f--){var i=s[f];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function C(u,s,f){return function(){this.name=u,this.bracketNo=0,this.style=s,this.styles=f,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var h={};h.importmodule=C("importmodule","tag",["string","builtin"]),h.documentclass=C("documentclass","tag",["","atom"]),h.usepackage=C("usepackage","tag",["atom"]),h.begin=C("begin","tag",["atom"]),h.end=C("end","tag",["atom"]),h.label=C("label","tag",["atom"]),h.ref=C("ref","tag",["atom"]),h.eqref=C("eqref","tag",["atom"]),h.cite=C("cite","tag",["atom"]),h.bibitem=C("bibitem","tag",["atom"]),h.Bibitem=C("Bibitem","tag",["atom"]),h.RBibitem=C("RBibitem","tag",["atom"]),h.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function p(u,s){u.f=s}function c(u,s){var f;if(u.match(/^\\[a-zA-Z@]+/)){var i=u.current().slice(1);return f=h.hasOwnProperty(i)?h[i]:h.DEFAULT,f=new f,w(s,f),p(s,a),f.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return p(s,function(t,d){return l(t,d,"\\]")}),"keyword";if(u.match("\\("))return p(s,function(t,d){return l(t,d,"\\)")}),"keyword";if(u.match("$$"))return p(s,function(t,d){return l(t,d,"$$")}),"keyword";if(u.match("$"))return p(s,function(t,d){return l(t,d,"$")}),"keyword";var n=u.next();if(n=="%")return u.skipToEnd(),"comment";if(n=="}"||n=="]"){if(f=k(s),f)f.closeBracket(n),p(s,a);else return"error";return"bracket"}else return n=="{"||n=="["?(f=h.DEFAULT,f=new f,w(s,f),"bracket"):/\d/.test(n)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),f=T(s),f.name=="begin"&&(f.argument=u.current()),f.styleIdentifier())}function l(u,s,f){if(u.eatSpace())return null;if(f&&u.match(f))return p(s,c),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=u.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(u.skipToEnd(),"comment"):"error"}function a(u,s){var f=u.peek(),i;return f=="{"||f=="["?(i=k(s),i.openBracket(f),u.eat(f),p(s,c),"bracket"):/[ \t\r]/.test(f)?(u.eat(f),null):(p(s,c),S(s),c(u,s))}return{startState:function(){var u=j.inMathMode?function(s,f){return l(s,f)}:c;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,s){return s.f(u,s)},blankLine:function(u){u.f=c,u.cmdState.length=0},lineComment:"%"}}),de.defineMIME("text/x-stex","stex"),de.defineMIME("text/x-latex","stex")})},"+QRC":function(rt,$e,H){"use strict";var de=H("E9nw"),ee={"text/plain":"Text","text/html":"Url",default:"Text"},j="Copy to clipboard: #{key}, Enter";function w(S){var T=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return S.replace(/#{\s*key\s*}/g,T)}function k(S,T){var C,h,p,c,l,a,u=!1;T||(T={}),C=T.debug||!1;try{p=de(),c=document.createRange(),l=document.getSelection(),a=document.createElement("span"),a.textContent=S,a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(f){if(f.stopPropagation(),T.format)if(f.preventDefault(),typeof f.clipboardData=="undefined"){C&&console.warn("unable to use e.clipboardData"),C&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=ee[T.format]||ee.default;window.clipboardData.setData(i,S)}else f.clipboardData.clearData(),f.clipboardData.setData(T.format,S);T.onCopy&&(f.preventDefault(),T.onCopy(f.clipboardData))}),document.body.appendChild(a),c.selectNodeContents(a),l.addRange(c);var s=document.execCommand("copy");if(!s)throw new Error("copy command was unsuccessful");u=!0}catch(f){C&&console.error("unable to copy using execCommand: ",f),C&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(T.format||"text",S),T.onCopy&&T.onCopy(window.clipboardData),u=!0}catch(i){C&&console.error("unable to copy using clipboardData: ",i),C&&console.error("falling back to prompt"),h=w("message"in T?T.message:j),window.prompt(h,S)}}finally{l&&(typeof l.removeRange=="function"?l.removeRange(c):l.removeAllRanges()),a&&document.body.removeChild(a),p()}return u}rt.exports=k},"07cG":function(rt,$e,H){rt.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":function(rt,$e){var H=arguments[3],de=arguments[4],ee=arguments[5],j=JSON.stringify;rt.exports=function(w,k){for(var S,T=Object.keys(ee),C=0,h=T.length;C<h;C++){var p=T[C],c=ee[p].exports;if(c===w||c&&c.default===w){S=p;break}}if(!S){S=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var l={},C=0,h=T.length;C<h;C++){var p=T[C];l[p]=p}de[S]=["function(require,module,exports){"+w+"(self); }",l]}var a=Math.floor(Math.pow(16,8)*Math.random()).toString(16),u={};u[S]=S,de[a]=["function(require,module,exports){var f = require("+j(S)+");(f.default ? f.default : f)(self);}",u];var s={};f(a);function f(g){s[g]=!0;for(var b in de[g][1]){var _=de[g][1][b];s[_]||f(_)}}var i="("+H+")({"+Object.keys(s).map(function(g){return j(g)+":["+de[g][0]+","+j(de[g][1])+"]"}).join(",")+"},{},["+j(a)+"])",n=window.URL||window.webkitURL||window.mozURL||window.msURL,t=new Blob([i],{type:"text/javascript"});if(k&&k.bare)return t;var d=n.createObjectURL(t),v=new Worker(d);return v.objectURL=d,v}},"19Vz":function(rt,$e,H){(function(de){de(H("VrN/"))})(function(de){de.defineOption("placeholder","",function(C,h,p){var c=p&&p!=de.Init;if(h&&!c)C.on("blur",k),C.on("change",S),C.on("swapDoc",S),de.on(C.getInputField(),"compositionupdate",C.state.placeholderCompose=function(){w(C)}),S(C);else if(!h&&c){C.off("blur",k),C.off("change",S),C.off("swapDoc",S),de.off(C.getInputField(),"compositionupdate",C.state.placeholderCompose),ee(C);var l=C.getWrapperElement();l.className=l.className.replace(" CodeMirror-empty","")}h&&!C.hasFocus()&&k(C)});function ee(C){C.state.placeholder&&(C.state.placeholder.parentNode.removeChild(C.state.placeholder),C.state.placeholder=null)}function j(C){ee(C);var h=C.state.placeholder=document.createElement("pre");h.style.cssText="height: 0; overflow: visible",h.style.direction=C.getOption("direction"),h.className="CodeMirror-placeholder CodeMirror-line-like";var p=C.getOption("placeholder");typeof p=="string"&&(p=document.createTextNode(p)),h.appendChild(p),C.display.lineSpace.insertBefore(h,C.display.lineSpace.firstChild)}function w(C){setTimeout(function(){var h=!1,p=C.getInputField();p.nodeName=="TEXTAREA"?h=!p.value:C.lineCount()==1&&(h=!/[^\u200b]/.test(p.querySelector(".CodeMirror-line").textContent)),h?j(C):ee(C)},20)}function k(C){T(C)&&j(C)}function S(C){var h=C.getWrapperElement(),p=T(C);h.className=h.className.replace(" CodeMirror-empty","")+(p?" CodeMirror-empty":""),p?j(C):ee(C)}function T(C){return C.lineCount()===1&&C.getLine(0)===""}})},"1FX+":function(rt,$e,H){rt.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(rt,$e,H){(function(de){de(H("VrN/"))})(function(de){"use strict";var ee={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};de.defineMode("xml",function(w,k){var S=w.indentUnit,T={},C=k.htmlMode?ee:j;for(var h in C)T[h]=C[h];for(var h in k)T[h]=k[h];var p,c;function l(x,A){function O(W){return A.tokenize=W,W(x,A)}var D=x.next();if(D=="<")return x.eat("!")?x.eat("[")?x.match("CDATA[")?O(s("atom","]]>")):null:x.match("--")?O(s("comment","-->")):x.match("DOCTYPE",!0,!0)?(x.eatWhile(/[\w\._\-]/),O(f(1))):null:x.eat("?")?(x.eatWhile(/[\w\._\-]/),A.tokenize=s("meta","?>"),"meta"):(p=x.eat("/")?"closeTag":"openTag",A.tokenize=a,"tag bracket");if(D=="&"){var N;return x.eat("#")?x.eat("x")?N=x.eatWhile(/[a-fA-F\d]/)&&x.eat(";"):N=x.eatWhile(/[\d]/)&&x.eat(";"):N=x.eatWhile(/[\w\.\-:]/)&&x.eat(";"),N?"atom":"error"}else return x.eatWhile(/[^&<]/),null}l.isInText=!0;function a(x,A){var O=x.next();if(O==">"||O=="/"&&x.eat(">"))return A.tokenize=l,p=O==">"?"endTag":"selfcloseTag","tag bracket";if(O=="=")return p="equals",null;if(O=="<"){A.tokenize=l,A.state=d,A.tagName=A.tagStart=null;var D=A.tokenize(x,A);return D?D+" tag error":"tag error"}else return/[\'\"]/.test(O)?(A.tokenize=u(O),A.stringStartCol=x.column(),A.tokenize(x,A)):(x.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(x){var A=function(O,D){for(;!O.eol();)if(O.next()==x){D.tokenize=a;break}return"string"};return A.isInAttribute=!0,A}function s(x,A){return function(O,D){for(;!O.eol();){if(O.match(A)){D.tokenize=l;break}O.next()}return x}}function f(x){return function(A,O){for(var D;(D=A.next())!=null;){if(D=="<")return O.tokenize=f(x+1),O.tokenize(A,O);if(D==">")if(x==1){O.tokenize=l;break}else return O.tokenize=f(x-1),O.tokenize(A,O)}return"meta"}}function i(x,A,O){this.prev=x.context,this.tagName=A,this.indent=x.indented,this.startOfLine=O,(T.doNotIndent.hasOwnProperty(A)||x.context&&x.context.noIndent)&&(this.noIndent=!0)}function n(x){x.context&&(x.context=x.context.prev)}function t(x,A){for(var O;;){if(!x.context)return;if(O=x.context.tagName,!T.contextGrabbers.hasOwnProperty(O)||!T.contextGrabbers[O].hasOwnProperty(A))return;n(x)}}function d(x,A,O){return x=="openTag"?(O.tagStart=A.column(),v):x=="closeTag"?g:d}function v(x,A,O){return x=="word"?(O.tagName=A.current(),c="tag",m):T.allowMissingTagName&&x=="endTag"?(c="tag bracket",m(x,A,O)):(c="error",v)}function g(x,A,O){if(x=="word"){var D=A.current();return O.context&&O.context.tagName!=D&&T.implicitlyClosed.hasOwnProperty(O.context.tagName)&&n(O),O.context&&O.context.tagName==D||T.matchClosing===!1?(c="tag",b):(c="tag error",_)}else return T.allowMissingTagName&&x=="endTag"?(c="tag bracket",b(x,A,O)):(c="error",_)}function b(x,A,O){return x!="endTag"?(c="error",b):(n(O),d)}function _(x,A,O){return c="error",b(x,A,O)}function m(x,A,O){if(x=="word")return c="attribute",y;if(x=="endTag"||x=="selfcloseTag"){var D=O.tagName,N=O.tagStart;return O.tagName=O.tagStart=null,x=="selfcloseTag"||T.autoSelfClosers.hasOwnProperty(D)?t(O,D):(t(O,D),O.context=new i(O,D,N==O.indented)),d}return c="error",m}function y(x,A,O){return x=="equals"?E:(T.allowMissing||(c="error"),m(x,A,O))}function E(x,A,O){return x=="string"?o:x=="word"&&T.allowUnquoted?(c="string",m):(c="error",m(x,A,O))}function o(x,A,O){return x=="string"?o:m(x,A,O)}return{startState:function(x){var A={tokenize:l,state:d,indented:x||0,tagName:null,tagStart:null,context:null};return x!=null&&(A.baseIndent=x),A},token:function(x,A){if(!A.tagName&&x.sol()&&(A.indented=x.indentation()),x.eatSpace())return null;p=null;var O=A.tokenize(x,A);return(O||p)&&O!="comment"&&(c=null,A.state=A.state(p||O,x,A),c&&(O=c=="error"?O+" error":c)),O},indent:function(x,A,O){var D=x.context;if(x.tokenize.isInAttribute)return x.tagStart==x.indented?x.stringStartCol+1:x.indented+S;if(D&&D.noIndent)return de.Pass;if(x.tokenize!=a&&x.tokenize!=l)return O?O.match(/^(\s*)/)[0].length:0;if(x.tagName)return T.multilineTagIndentPastTag!==!1?x.tagStart+x.tagName.length+2:x.tagStart+S*(T.multilineTagIndentFactor||1);if(T.alignCDATA&&/<!\[CDATA\[/.test(A))return 0;var N=A&&/^<(\/)?([\w_:\.-]*)/.exec(A);if(N&&N[1])for(;D;)if(D.tagName==N[2]){D=D.prev;break}else if(T.implicitlyClosed.hasOwnProperty(D.tagName))D=D.prev;else break;else if(N)for(;D;){var W=T.contextGrabbers[D.tagName];if(W&&W.hasOwnProperty(N[2]))D=D.prev;else break}for(;D&&D.prev&&!D.startOfLine;)D=D.prev;return D?D.indent+S:x.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:T.htmlMode?"html":"xml",helperType:T.htmlMode?"html":"xml",skipAttribute:function(x){x.state==E&&(x.state=m)},xmlCurrentTag:function(x){return x.tagName?{name:x.tagName,close:x.type=="closeTag"}:null},xmlCurrentContext:function(x){for(var A=[],O=x.context;O;O=O.prev)O.tagName&&A.push(O.tagName);return A.reverse()}}}),de.defineMIME("text/xml","xml"),de.defineMIME("application/xml","xml"),de.mimeModes.hasOwnProperty("text/html")||de.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(rt,$e,H){"use strict";H.d($e,"d",function(){return q}),H.d($e,"b",function(){return et}),H.d($e,"c",function(){return yt}),H.d($e,"a",function(){return Bt});var de=H("VTBJ"),ee=H("1OyB"),j=H("vuIU"),w=H("JX7q"),k=H("Ji7U"),S=H("LK+K"),T=H("q1tI"),C=H("I8Z2"),h=H("BGR+"),p=H("wx14"),c=H("rePB"),l=H("4IlW"),a=H("2GS6"),u=H("Gytx"),s=H.n(u),f=H("TSYQ"),i=H.n(f),n=H("U8pU"),t=H("ODXe"),d=/iPhone/i,v=/iPod/i,g=/iPad/i,b=/\bAndroid(?:.+)Mobile\b/i,_=/Android/i,m=/\bAndroid(?:.+)SD4930UR\b/i,y=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,E=/Windows Phone/i,o=/\bWindows(?:.+)ARM\b/i,x=/BlackBerry/i,A=/BB10/i,O=/Opera Mini/i,D=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i;function W(Rt,st){return Rt.test(st)}function K(Rt){var st=Rt||(typeof navigator!="undefined"?navigator.userAgent:""),mt=st.split("[FBAN");if(typeof mt[1]!="undefined"){var lt=mt,De=Object(t.a)(lt,1);st=De[0]}if(mt=st.split("Twitter"),typeof mt[1]!="undefined"){var Ke=mt,vt=Object(t.a)(Ke,1);st=vt[0]}var ot={apple:{phone:W(d,st)&&!W(E,st),ipod:W(v,st),tablet:!W(d,st)&&W(g,st)&&!W(E,st),device:(W(d,st)||W(v,st)||W(g,st))&&!W(E,st)},amazon:{phone:W(m,st),tablet:!W(m,st)&&W(y,st),device:W(m,st)||W(y,st)},android:{phone:!W(E,st)&&W(m,st)||!W(E,st)&&W(b,st),tablet:!W(E,st)&&!W(m,st)&&!W(b,st)&&(W(y,st)||W(_,st)),device:!W(E,st)&&(W(m,st)||W(y,st)||W(b,st)||W(_,st))||W(/\bokhttp\b/i,st)},windows:{phone:W(E,st),tablet:W(o,st),device:W(E,st)||W(o,st)},other:{blackberry:W(x,st),blackberry10:W(A,st),opera:W(O,st),firefox:W(N,st),chrome:W(D,st),device:W(x,st)||W(A,st)||W(O,st)||W(N,st)||W(D,st)},any:null,phone:null,tablet:null};return ot.any=ot.apple.device||ot.android.device||ot.windows.device||ot.other.device,ot.phone=ot.apple.phone||ot.android.phone||ot.windows.phone,ot.tablet=ot.apple.tablet||ot.android.tablet||ot.windows.tablet,ot}var oe=Object(de.a)(Object(de.a)({},K()),{},{isMobile:K}),B=oe;function X(){}function V(Rt,st,mt){var lt=st||"";return Rt.key||"".concat(lt,"item_").concat(mt)}function ne(Rt){return"".concat(Rt,"-menu-")}function $(Rt,st){var mt=-1;T.Children.forEach(Rt,function(lt){mt+=1,lt&<.type&<.type.isMenuItemGroup?T.Children.forEach(lt.props.children,function(De){mt+=1,st(De,mt)}):st(lt,mt)})}function Z(Rt,st,mt){if(!Rt||mt.find)return;T.Children.forEach(Rt,function(lt){if(lt){var De=lt.type;if(!De||!(De.isSubMenu||De.isMenuItem||De.isMenuItemGroup))return;st.indexOf(lt.key)!==-1?mt.find=!0:lt.props.children&&Z(lt.props.children,st,mt)}})}var ue=["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"],he=function(st){var mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,lt=st&&typeof st.getBoundingClientRect=="function"&&st.getBoundingClientRect().width;if(lt){if(mt){var De=getComputedStyle(st),Ke=De.marginLeft,vt=De.marginRight;lt+=+Ke.replace("px","")+ +vt.replace("px","")}lt=+lt.toFixed(6)}return lt||0},Oe=function(st,mt,lt){st&&Object(n.a)(st.style)==="object"&&(st.style[mt]=lt)},we=function(){return B.any},Pe=H("KQm4"),_e=H("Ff2n"),xe=H("i8i4"),Ve=H("bdgK"),Ne=H("uciX"),Be=H("8XRh"),ze={adjustX:1,adjustY:1},ye={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]}},me={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]}},We=ye,He=0,nt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},te=function(st,mt,lt){var De=ne(mt),Ke=st.getState();st.setState({defaultActiveFirst:Object(de.a)(Object(de.a)({},Ke.defaultActiveFirst),{},Object(c.a)({},De,lt))})},P=function(Rt){Object(k.a)(mt,Rt);var st=Object(S.a)(mt);function mt(lt){var De;Object(ee.a)(this,mt),De=st.call(this,lt),De.onDestroy=function(it){De.props.onDestroy(it)},De.onKeyDown=function(it){var St=it.keyCode,Wt=De.menuInstance,Kt=De.props,tn=Kt.isOpen,Re=Kt.store;if(St===l.a.ENTER)return De.onTitleClick(it),te(Re,De.props.eventKey,!0),!0;if(St===l.a.RIGHT)return tn?Wt.onKeyDown(it):(De.triggerOpenChange(!0),te(Re,De.props.eventKey,!0)),!0;if(St===l.a.LEFT){var ve;if(tn)ve=Wt.onKeyDown(it);else return;return ve||(De.triggerOpenChange(!1),ve=!0),ve}return tn&&(St===l.a.UP||St===l.a.DOWN)?Wt.onKeyDown(it):void 0},De.onOpenChange=function(it){De.props.onOpenChange(it)},De.onPopupVisibleChange=function(it){De.triggerOpenChange(it,it?"mouseenter":"mouseleave")},De.onMouseEnter=function(it){var St=De.props,Wt=St.eventKey,Kt=St.onMouseEnter,tn=St.store;te(tn,De.props.eventKey,!1),Kt({key:Wt,domEvent:it})},De.onMouseLeave=function(it){var St=De.props,Wt=St.parentMenu,Kt=St.eventKey,tn=St.onMouseLeave;Wt.subMenuInstance=Object(w.a)(De),tn({key:Kt,domEvent:it})},De.onTitleMouseEnter=function(it){var St=De.props,Wt=St.eventKey,Kt=St.onItemHover,tn=St.onTitleMouseEnter;Kt({key:Wt,hover:!0}),tn({key:Wt,domEvent:it})},De.onTitleMouseLeave=function(it){var St=De.props,Wt=St.parentMenu,Kt=St.eventKey,tn=St.onItemHover,Re=St.onTitleMouseLeave;Wt.subMenuInstance=Object(w.a)(De),tn({key:Kt,hover:!1}),Re({key:Kt,domEvent:it})},De.onTitleClick=function(it){var St=Object(w.a)(De),Wt=St.props;if(Wt.onTitleClick({key:Wt.eventKey,domEvent:it}),Wt.triggerSubMenuAction==="hover")return;De.triggerOpenChange(!Wt.isOpen,"click"),te(Wt.store,De.props.eventKey,!1)},De.onSubMenuClick=function(it){typeof De.props.onClick=="function"&&De.props.onClick(De.addKeyPath(it))},De.onSelect=function(it){De.props.onSelect(it)},De.onDeselect=function(it){De.props.onDeselect(it)},De.getPrefixCls=function(){return"".concat(De.props.rootPrefixCls,"-submenu")},De.getActiveClassName=function(){return"".concat(De.getPrefixCls(),"-active")},De.getDisabledClassName=function(){return"".concat(De.getPrefixCls(),"-disabled")},De.getSelectedClassName=function(){return"".concat(De.getPrefixCls(),"-selected")},De.getOpenClassName=function(){return"".concat(De.props.rootPrefixCls,"-submenu-open")},De.saveMenuInstance=function(it){De.menuInstance=it},De.addKeyPath=function(it){return Object(de.a)(Object(de.a)({},it),{},{keyPath:(it.keyPath||[]).concat(De.props.eventKey)})},De.triggerOpenChange=function(it,St){var Wt=De.props.eventKey,Kt=function(){De.onOpenChange({key:Wt,item:Object(w.a)(De),trigger:St,open:it})};St==="mouseenter"?De.mouseenterTimeout=setTimeout(function(){Kt()},0):Kt()},De.isChildrenSelected=function(){var it={find:!1};return Z(De.props.children,De.props.selectedKeys,it),it.find},De.isOpen=function(){return De.props.openKeys.indexOf(De.props.eventKey)!==-1},De.adjustWidth=function(){if(!De.subMenuTitle||!De.menuInstance)return;var it=xe.findDOMNode(De.menuInstance);if(it.offsetWidth>=De.subMenuTitle.offsetWidth)return;it.style.minWidth="".concat(De.subMenuTitle.offsetWidth,"px")},De.saveSubMenuTitle=function(it){De.subMenuTitle=it},De.getBaseProps=function(){var it=Object(w.a)(De),St=it.props;return{mode:St.mode==="horizontal"?"vertical":St.mode,visible:De.props.isOpen,level:St.level+1,inlineIndent:St.inlineIndent,focusable:!1,onClick:De.onSubMenuClick,onSelect:De.onSelect,onDeselect:De.onDeselect,onDestroy:De.onDestroy,selectedKeys:St.selectedKeys,eventKey:"".concat(St.eventKey,"-menu-"),openKeys:St.openKeys,motion:St.motion,onOpenChange:De.onOpenChange,subMenuOpenDelay:St.subMenuOpenDelay,parentMenu:Object(w.a)(De),subMenuCloseDelay:St.subMenuCloseDelay,forceSubMenuRender:St.forceSubMenuRender,triggerSubMenuAction:St.triggerSubMenuAction,builtinPlacements:St.builtinPlacements,defaultActiveFirst:St.store.getState().defaultActiveFirst[ne(St.eventKey)],multiple:St.multiple,prefixCls:St.rootPrefixCls,id:De.internalMenuId,manualRef:De.saveMenuInstance,itemIcon:St.itemIcon,expandIcon:St.expandIcon,direction:St.direction}},De.getMotion=function(it,St){var Wt=Object(w.a)(De),Kt=Wt.haveRendered,tn=De.props,Re=tn.motion,ve=tn.rootPrefixCls,z=Object(de.a)(Object(de.a)({},Re),{},{leavedClassName:"".concat(ve,"-hidden"),removeOnLeave:!1,motionAppear:Kt||!St||it!=="inline"});return z};var Ke=lt.store,vt=lt.eventKey,ot=Ke.getState(),Mt=ot.defaultActiveFirst;De.isRootMenu=!1;var Nt=!1;return Mt&&(Nt=Mt[vt]),te(Ke,vt,Nt),De}return Object(j.a)(mt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var De=this,Ke=this.props,vt=Ke.mode,ot=Ke.parentMenu,Mt=Ke.manualRef;if(Mt&&Mt(this),vt!=="horizontal"||!ot.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return De.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var De=this.props,Ke=De.onDestroy,vt=De.eventKey;Ke&&Ke(vt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(De){var Ke=this,vt=this.getBaseProps(),ot=this.getMotion(vt.mode,vt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||vt.visible||vt.forceSubMenuRender,!this.haveOpened)return T.createElement("div",null);var Mt=vt.direction;return T.createElement(Be.default,Object.assign({visible:vt.visible},ot),function(Nt){var it=Nt.className,St=Nt.style,Wt=i()("".concat(vt.prefixCls,"-sub"),it,Object(c.a)({},"".concat(vt.prefixCls,"-rtl"),Mt==="rtl"));return T.createElement(Fe,Object.assign({},vt,{id:Ke.internalMenuId,className:Wt,style:St}),De)})}},{key:"render",value:function(){var De,Ke=Object(de.a)({},this.props),vt=Ke.isOpen,ot=this.getPrefixCls(),Mt=Ke.mode==="inline",Nt=i()(ot,"".concat(ot,"-").concat(Ke.mode),(De={},Object(c.a)(De,Ke.className,!!Ke.className),Object(c.a)(De,this.getOpenClassName(),vt),Object(c.a)(De,this.getActiveClassName(),Ke.active||vt&&!Mt),Object(c.a)(De,this.getDisabledClassName(),Ke.disabled),Object(c.a)(De,this.getSelectedClassName(),this.isChildrenSelected()),De));this.internalMenuId||(Ke.eventKey?this.internalMenuId="".concat(Ke.eventKey,"$Menu"):(He+=1,this.internalMenuId="$__$".concat(He,"$Menu")));var it={},St={},Wt={};Ke.disabled||(it={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},St={onClick:this.onTitleClick},Wt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Kt={},tn=Ke.direction;Mt&&(tn==="rtl"?Kt.paddingRight=Ke.inlineIndent*Ke.level:Kt.paddingLeft=Ke.inlineIndent*Ke.level);var Re={};this.props.isOpen&&(Re={"aria-owns":this.internalMenuId});var ve=null;Ke.mode!=="horizontal"&&(ve=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ve=T.createElement(this.props.expandIcon,Object(de.a)({},this.props))));var z=T.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Kt,className:"".concat(ot,"-title"),role:"button"},Wt,St,{"aria-expanded":vt},Re,{"aria-haspopup":"true",title:typeof Ke.title=="string"?Ke.title:void 0}),Ke.title,ve||T.createElement("i",{className:"".concat(ot,"-arrow")})),Q=this.renderChildren(Ke.children),ae=Ke.parentMenu.isRootMenu?Ke.parentMenu.props.getPopupContainer:function(un){return un.parentNode},fe=nt[Ke.mode],Ae=Ke.popupOffset?{offset:Ke.popupOffset}:{},Je=Ke.mode==="inline"?"":Ke.popupClassName;Je+=tn==="rtl"?" ".concat(ot,"-rtl"):"";var at=Ke.disabled,Lt=Ke.triggerSubMenuAction,It=Ke.subMenuOpenDelay,ct=Ke.forceSubMenuRender,kt=Ke.subMenuCloseDelay,nn=Ke.builtinPlacements;ue.forEach(function(un){return delete Ke[un]}),delete Ke.onClick;var Ot=tn==="rtl"?Object.assign({},me,nn):Object.assign({},ye,nn);return delete Ke.direction,T.createElement("li",Object.assign({},Ke,it,{className:Nt,role:"menuitem"}),Mt&&z,Mt&&Q,!Mt&&T.createElement(Ne.a,{prefixCls:ot,popupClassName:i()("".concat(ot,"-popup"),Je),getPopupContainer:ae,builtinPlacements:Ot,popupPlacement:fe,popupVisible:vt,popupAlign:Ae,popup:Q,action:at?[]:[Lt],mouseEnterDelay:It,mouseLeaveDelay:kt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ct},z))}}]),mt}(T.Component);P.defaultProps={onMouseEnter:X,onMouseLeave:X,onTitleMouseEnter:X,onTitleMouseLeave:X,onTitleClick:X,manualRef:X,mode:"vertical",title:""};var U=Object(C.b)(function(Rt,st){var mt=Rt.openKeys,lt=Rt.activeKey,De=Rt.selectedKeys,Ke=st.eventKey,vt=st.subMenuKey;return{isOpen:mt.indexOf(Ke)>-1,active:lt[vt]===Ke,selectedKeys:De}})(P);U.isSubMenu=!0;var q=U,Y="menuitem-overflowed",J=.5,Ee=function(Rt){Object(k.a)(mt,Rt);var st=Object(S.a)(mt);function mt(){var lt;return Object(ee.a)(this,mt),lt=st.apply(this,arguments),lt.resizeObserver=null,lt.mutationObserver=null,lt.originalTotalWidth=0,lt.overflowedItems=[],lt.menuItemSizes=[],lt.cancelFrameId=null,lt.state={lastVisibleIndex:void 0},lt.getMenuItemNodes=function(){var De=lt.props.prefixCls,Ke=xe.findDOMNode(Object(w.a)(lt));return Ke?[].slice.call(Ke.children).filter(function(vt){return vt.className.split(" ").indexOf("".concat(De,"-overflowed-submenu"))<0}):[]},lt.getOverflowedSubMenuItem=function(De,Ke,vt){var ot=lt.props,Mt=ot.overflowedIndicator,Nt=ot.level,it=ot.mode,St=ot.prefixCls,Wt=ot.theme;if(Nt!==1||it!=="horizontal")return null;var Kt=lt.props.children[0],tn=Kt.props,Re=tn.children,ve=tn.title,z=tn.style,Q=Object(_e.a)(tn,["children","title","style"]),ae=Object(de.a)({},z),fe="".concat(De,"-overflowed-indicator"),Ae="".concat(De,"-overflowed-indicator");Ke.length===0&&vt!==!0?ae=Object(de.a)(Object(de.a)({},ae),{},{display:"none"}):vt&&(ae=Object(de.a)(Object(de.a)({},ae),{},{visibility:"hidden",position:"absolute"}),fe="".concat(fe,"-placeholder"),Ae="".concat(Ae,"-placeholder"));var Je=Wt?"".concat(St,"-").concat(Wt):"",at={};return ue.forEach(function(Lt){Q[Lt]!==void 0&&(at[Lt]=Q[Lt])}),T.createElement(q,Object.assign({title:Mt,className:"".concat(St,"-overflowed-submenu"),popupClassName:Je},at,{key:fe,eventKey:Ae,disabled:!1,style:ae}),Ke)},lt.setChildrenWidthAndResize=function(){if(lt.props.mode!=="horizontal")return;var De=xe.findDOMNode(Object(w.a)(lt));if(!De)return;var Ke=De.children;if(!Ke||Ke.length===0)return;var vt=De.children[Ke.length-1];Oe(vt,"display","inline-block");var ot=lt.getMenuItemNodes(),Mt=ot.filter(function(Nt){return Nt.className.split(" ").indexOf(Y)>=0});Mt.forEach(function(Nt){Oe(Nt,"display","inline-block")}),lt.menuItemSizes=ot.map(function(Nt){return he(Nt,!0)}),Mt.forEach(function(Nt){Oe(Nt,"display","none")}),lt.overflowedIndicatorWidth=he(De.children[De.children.length-1],!0),lt.originalTotalWidth=lt.menuItemSizes.reduce(function(Nt,it){return Nt+it},0),lt.handleResize(),Oe(vt,"display","none")},lt.handleResize=function(){if(lt.props.mode!=="horizontal")return;var De=xe.findDOMNode(Object(w.a)(lt));if(!De)return;var Ke=he(De);lt.overflowedItems=[];var vt=0,ot;lt.originalTotalWidth>Ke+J&&(ot=-1,lt.menuItemSizes.forEach(function(Mt){vt+=Mt,vt+lt.overflowedIndicatorWidth<=Ke&&(ot+=1)})),lt.setState({lastVisibleIndex:ot})},lt}return Object(j.a)(mt,[{key:"componentDidMount",value:function(){var De=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ke=xe.findDOMNode(this);if(!Ke)return;this.resizeObserver=new Ve.default(function(vt){vt.forEach(function(){var ot=De.cancelFrameId;cancelAnimationFrame(ot),De.cancelFrameId=requestAnimationFrame(De.setChildrenWidthAndResize)})}),[].slice.call(Ke.children).concat(Ke).forEach(function(vt){De.resizeObserver.observe(vt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){De.resizeObserver.disconnect(),[].slice.call(Ke.children).concat(Ke).forEach(function(vt){De.resizeObserver.observe(vt)}),De.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ke,{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(De){var Ke=this,vt=this.state.lastVisibleIndex;return(De||[]).reduce(function(ot,Mt,Nt){var it=Mt;if(Ke.props.mode==="horizontal"){var St=Ke.getOverflowedSubMenuItem(Mt.props.eventKey,[]);vt!==void 0&&Ke.props.className.indexOf("".concat(Ke.props.prefixCls,"-root"))!==-1&&(Nt>vt&&(it=T.cloneElement(Mt,{style:{display:"none"},eventKey:"".concat(Mt.props.eventKey,"-hidden"),className:"".concat(Y)})),Nt===vt+1&&(Ke.overflowedItems=De.slice(vt+1).map(function(Kt){return T.cloneElement(Kt,{key:Kt.props.eventKey,mode:"vertical-left"})}),St=Ke.getOverflowedSubMenuItem(Mt.props.eventKey,Ke.overflowedItems)));var Wt=[].concat(Object(Pe.a)(ot),[St,it]);return Nt===De.length-1&&Wt.push(Ke.getOverflowedSubMenuItem(Mt.props.eventKey,[],!0)),Wt}return[].concat(Object(Pe.a)(ot),[it])},[])}},{key:"render",value:function(){var De=this.props,Ke=De.visible,vt=De.prefixCls,ot=De.overflowedIndicator,Mt=De.mode,Nt=De.level,it=De.tag,St=De.children,Wt=De.theme,Kt=Object(_e.a)(De,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),tn=it;return T.createElement(tn,Object.assign({},Kt),this.renderChildren(St))}}]),mt}(T.Component);Ee.defaultProps={tag:"div",className:""};var ke=Ee;function ht(Rt){return Rt.length?Rt.every(function(st){return!!st.props.disabled}):!0}function Ue(Rt,st,mt){var lt=Rt.getState();Rt.setState({activeKey:Object(de.a)(Object(de.a)({},lt.activeKey),{},Object(c.a)({},st,mt))})}function je(Rt){return Rt.eventKey||"0-menu-"}function tt(Rt,st){var mt=st,lt=Rt.children,De=Rt.eventKey;if(mt){var Ke;if($(lt,function(vt,ot){vt&&vt.props&&!vt.props.disabled&&mt===V(vt,De,ot)&&(Ke=!0)}),Ke)return mt}return mt=null,Rt.defaultActiveFirst&&$(lt,function(vt,ot){!mt&&vt&&!vt.props.disabled&&(mt=V(vt,De,ot))}),mt}function dt(Rt){if(Rt){var st=this.instanceArray.indexOf(Rt);st!==-1?this.instanceArray[st]=Rt:this.instanceArray.push(Rt)}}var qe=function(Rt){Object(k.a)(mt,Rt);var st=Object(S.a)(mt);function mt(lt){var De;return Object(ee.a)(this,mt),De=st.call(this,lt),De.onKeyDown=function(Ke,vt){var ot=Ke.keyCode,Mt;if(De.getFlatInstanceArray().forEach(function(it){it&&it.props.active&&it.onKeyDown&&(Mt=it.onKeyDown(Ke))}),Mt)return 1;var Nt=null;return(ot===l.a.UP||ot===l.a.DOWN)&&(Nt=De.step(ot===l.a.UP?-1:1)),Nt?(Ke.preventDefault(),Ue(De.props.store,je(De.props),Nt.props.eventKey),typeof vt=="function"&&vt(Nt),1):void 0},De.onItemHover=function(Ke){var vt=Ke.key,ot=Ke.hover;Ue(De.props.store,je(De.props),ot?vt:null)},De.onDeselect=function(Ke){De.props.onDeselect(Ke)},De.onSelect=function(Ke){De.props.onSelect(Ke)},De.onClick=function(Ke){De.props.onClick(Ke)},De.onOpenChange=function(Ke){De.props.onOpenChange(Ke)},De.onDestroy=function(Ke){De.props.onDestroy(Ke)},De.getFlatInstanceArray=function(){return De.instanceArray},De.step=function(Ke){var vt=De.getFlatInstanceArray(),ot=De.props.store.getState().activeKey[je(De.props)],Mt=vt.length;if(!Mt)return null;Ke<0&&(vt=vt.concat().reverse());var Nt=-1;if(vt.every(function(Kt,tn){return Kt&&Kt.props.eventKey===ot?(Nt=tn,!1):!0}),!De.props.defaultActiveFirst&&Nt!==-1&&ht(vt.slice(Nt,Mt-1)))return;var it=(Nt+1)%Mt,St=it;do{var Wt=vt[St];if(!Wt||Wt.props.disabled)St=(St+1)%Mt;else return Wt}while(St!==it);return null},De.renderCommonMenuItem=function(Ke,vt,ot){var Mt=De.props.store.getState(),Nt=Object(w.a)(De),it=Nt.props,St=V(Ke,it.eventKey,vt),Wt=Ke.props;if(!Wt||typeof Ke.type=="string")return Ke;var Kt=St===Mt.activeKey,tn=Object(de.a)(Object(de.a)({mode:Wt.mode||it.mode,level:it.level,inlineIndent:it.inlineIndent,renderMenuItem:De.renderMenuItem,rootPrefixCls:it.prefixCls,index:vt,parentMenu:it.parentMenu,manualRef:Wt.disabled?void 0:Object(a.a)(Ke.ref,dt.bind(Object(w.a)(De))),eventKey:St,active:!Wt.disabled&&Kt,multiple:it.multiple,onClick:function(ve){(Wt.onClick||X)(ve),De.onClick(ve)},onItemHover:De.onItemHover,motion:it.motion,subMenuOpenDelay:it.subMenuOpenDelay,subMenuCloseDelay:it.subMenuCloseDelay,forceSubMenuRender:it.forceSubMenuRender,onOpenChange:De.onOpenChange,onDeselect:De.onDeselect,onSelect:De.onSelect,builtinPlacements:it.builtinPlacements,itemIcon:Wt.itemIcon||De.props.itemIcon,expandIcon:Wt.expandIcon||De.props.expandIcon},ot),{},{direction:it.direction});return(it.mode==="inline"||we())&&(tn.triggerSubMenuAction="click"),T.cloneElement(Ke,tn)},De.renderMenuItem=function(Ke,vt,ot){if(!Ke)return null;var Mt=De.props.store.getState(),Nt={openKeys:Mt.openKeys,selectedKeys:Mt.selectedKeys,triggerSubMenuAction:De.props.triggerSubMenuAction,subMenuKey:ot};return De.renderCommonMenuItem(Ke,vt,Nt)},lt.store.setState({activeKey:Object(de.a)(Object(de.a)({},lt.store.getState().activeKey),{},Object(c.a)({},lt.eventKey,tt(lt,lt.activeKey)))}),De.instanceArray=[],De}return Object(j.a)(mt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(De){return this.props.visible||De.visible||this.props.className!==De.className||!s()(this.props.style,De.style)}},{key:"componentDidUpdate",value:function(De){var Ke=this.props,vt="activeKey"in Ke?Ke.activeKey:Ke.store.getState().activeKey[je(Ke)],ot=tt(Ke,vt);if(ot!==vt)Ue(Ke.store,je(Ke),ot);else if("activeKey"in De){var Mt=tt(De,De.activeKey);ot!==Mt&&Ue(Ke.store,je(Ke),ot)}}},{key:"render",value:function(){var De=this,Ke=Object(p.a)({},this.props);this.instanceArray=[];var vt=i()(Ke.prefixCls,Ke.className,"".concat(Ke.prefixCls,"-").concat(Ke.mode)),ot={className:vt,role:Ke.role||"menu"};Ke.id&&(ot.id=Ke.id),Ke.focusable&&(ot.tabIndex=0,ot.onKeyDown=this.onKeyDown);var Mt=Ke.prefixCls,Nt=Ke.eventKey,it=Ke.visible,St=Ke.level,Wt=Ke.mode,Kt=Ke.overflowedIndicator,tn=Ke.theme;return ue.forEach(function(Re){return delete Ke[Re]}),delete Ke.onClick,T.createElement(ke,Object.assign({},Ke,{prefixCls:Mt,mode:Wt,tag:"ul",level:St,theme:tn,visible:it,overflowedIndicator:Kt},ot),T.Children.map(Ke.children,function(Re,ve){return De.renderMenuItem(Re,ve,Nt||"0-menu-")}))}}]),mt}(T.Component);qe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:X};var Ye=Object(C.b)()(qe),Fe=Ye,Ie=H("Kwbf");function Me(Rt,st,mt){var lt=Rt.prefixCls,De=Rt.motion,Ke=Rt.defaultMotions,vt=Ke===void 0?{}:Ke,ot=Rt.openAnimation,Mt=Rt.openTransitionName,Nt=st.switchingModeFromInline;if(De)return De;if(Object(n.a)(ot)==="object"&&ot)Object(Ie.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ot=="string")return{motionName:"".concat(lt,"-open-").concat(ot)};if(Mt)return{motionName:Mt};var it=vt[mt];return it||(Nt?null:vt.other)}var be=function(Rt){Object(k.a)(mt,Rt);var st=Object(S.a)(mt);function mt(lt){var De;Object(ee.a)(this,mt),De=st.call(this,lt),De.inlineOpenKeys=[],De.onSelect=function(ot){var Mt=Object(w.a)(De),Nt=Mt.props;if(Nt.selectable){var it=De.store.getState(),St=it.selectedKeys,Wt=ot.key;Nt.multiple?St=St.concat([Wt]):St=[Wt],"selectedKeys"in Nt||De.store.setState({selectedKeys:St}),Nt.onSelect(Object(de.a)(Object(de.a)({},ot),{},{selectedKeys:St}))}},De.onClick=function(ot){var Mt=De.getRealMenuMode(),Nt=Object(w.a)(De),it=Nt.store,St=Nt.props.onOpenChange;Mt!=="inline"&&!("openKeys"in De.props)&&(it.setState({openKeys:[]}),St([])),De.props.onClick(ot)},De.onKeyDown=function(ot,Mt){De.innerMenu.getWrappedInstance().onKeyDown(ot,Mt)},De.onOpenChange=function(ot){var Mt=Object(w.a)(De),Nt=Mt.props,it=De.store.getState().openKeys.concat(),St=!1,Wt=function(tn){var Re=!1;if(tn.open)Re=it.indexOf(tn.key)===-1,Re&&it.push(tn.key);else{var ve=it.indexOf(tn.key);Re=ve!==-1,Re&&it.splice(ve,1)}St=St||Re};Array.isArray(ot)?ot.forEach(Wt):Wt(ot),St&&("openKeys"in De.props||De.store.setState({openKeys:it}),Nt.onOpenChange(it))},De.onDeselect=function(ot){var Mt=Object(w.a)(De),Nt=Mt.props;if(Nt.selectable){var it=De.store.getState().selectedKeys.concat(),St=ot.key,Wt=it.indexOf(St);Wt!==-1&&it.splice(Wt,1),"selectedKeys"in Nt||De.store.setState({selectedKeys:it}),Nt.onDeselect(Object(de.a)(Object(de.a)({},ot),{},{selectedKeys:it}))}},De.onMouseEnter=function(ot){De.restoreModeVerticalFromInline();var Mt=De.props.onMouseEnter;Mt&&Mt(ot)},De.onTransitionEnd=function(ot){var Mt=ot.propertyName==="width"&&ot.target===ot.currentTarget,Nt=ot.target.className,it=Object.prototype.toString.call(Nt)==="[object SVGAnimatedString]"?Nt.animVal:Nt,St=ot.propertyName==="font-size"&&it.indexOf("anticon")>=0;(Mt||St)&&De.restoreModeVerticalFromInline()},De.setInnerMenu=function(ot){De.innerMenu=ot},De.isRootMenu=!0;var Ke=lt.defaultSelectedKeys,vt=lt.defaultOpenKeys;return"selectedKeys"in lt&&(Ke=lt.selectedKeys||[]),"openKeys"in lt&&(vt=lt.openKeys||[]),De.store=Object(C.c)({selectedKeys:Ke,openKeys:vt,activeKey:{"0-menu-":tt(lt,lt.activeKey)}}),De.state={switchingModeFromInline:!1},De}return Object(j.a)(mt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(De){this.updateOpentKeysWhenSwitchMode(De),this.updateMiniStore();var Ke=this.props,vt=Ke.siderCollapsed,ot=Ke.inlineCollapsed,Mt=Ke.onOpenChange;(!De.inlineCollapsed&&ot||!De.siderCollapsed&&vt)&&Mt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(De){var Ke=this.props,vt=this.store,ot=this.inlineOpenKeys,Mt=vt.getState(),Nt={};De.mode==="inline"&&Ke.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Ke||((Ke.inlineCollapsed&&!De.inlineCollapsed||Ke.siderCollapsed&&!De.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Mt.openKeys.concat(),Nt.openKeys=[]),(!Ke.inlineCollapsed&&De.inlineCollapsed||!Ke.siderCollapsed&&De.siderCollapsed)&&(Nt.openKeys=ot,this.inlineOpenKeys=[])),Object.keys(Nt).length&&vt.setState(Nt)}},{key:"updateMenuDisplay",value:function(){var De=this.props.collapsedWidth,Ke=this.store,vt=this.prevOpenKeys,ot=this.getInlineCollapsed()&&(De===0||De==="0"||De==="0px");ot?(this.prevOpenKeys=Ke.getState().openKeys.concat(),this.store.setState({openKeys:[]})):vt&&(this.store.setState({openKeys:vt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var De=this.props.mode,Ke=this.state.switchingModeFromInline,vt=this.getInlineCollapsed();return Ke&&vt?"inline":vt?"vertical":De}},{key:"getInlineCollapsed",value:function(){var De=this.props,Ke=De.inlineCollapsed,vt=De.siderCollapsed;return vt!==void 0?vt:Ke}},{key:"restoreModeVerticalFromInline",value:function(){var De=this.state.switchingModeFromInline;De&&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 De=Object(de.a)({},Object(h.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ke=this.getRealMenuMode();return De.className+=" ".concat(De.prefixCls,"-root"),De.direction==="rtl"&&(De.className+=" ".concat(De.prefixCls,"-rtl")),De=Object(de.a)(Object(de.a)({},De),{},{mode:Ke,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Me(this.props,this.state,Ke)}),delete De.openAnimation,delete De.openTransitionName,T.createElement(C.a,{store:this.store},T.createElement(Fe,Object.assign({},De,{ref:this.setInnerMenu}),this.props.children))}}]),mt}(T.Component);be.defaultProps={selectable:!0,onClick:X,onSelect:X,onOpenChange:X,onDeselect:X,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 Te=be,Le=function(Rt){Object(k.a)(mt,Rt);var st=Object(S.a)(mt);function mt(){var lt;return Object(ee.a)(this,mt),lt=st.apply(this,arguments),lt.onKeyDown=function(De){var Ke=De.keyCode;return Ke===l.a.ENTER?(lt.onClick(De),!0):void 0},lt.onMouseLeave=function(De){var Ke=lt.props,vt=Ke.eventKey,ot=Ke.onItemHover,Mt=Ke.onMouseLeave;ot({key:vt,hover:!1}),Mt({key:vt,domEvent:De})},lt.onMouseEnter=function(De){var Ke=lt.props,vt=Ke.eventKey,ot=Ke.onItemHover,Mt=Ke.onMouseEnter;ot({key:vt,hover:!0}),Mt({key:vt,domEvent:De})},lt.onClick=function(De){var Ke=lt.props,vt=Ke.eventKey,ot=Ke.multiple,Mt=Ke.onClick,Nt=Ke.onSelect,it=Ke.onDeselect,St=Ke.isSelected,Wt={key:vt,keyPath:[vt],item:Object(w.a)(lt),domEvent:De};Mt(Wt),ot?St?it(Wt):Nt(Wt):St||Nt(Wt)},lt.saveNode=function(De){lt.node=De},lt}return Object(j.a)(mt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var De=this.props;De.onDestroy&&De.onDestroy(De.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 De,Ke=Object(de.a)({},this.props),vt=i()(this.getPrefixCls(),Ke.className,(De={},Object(c.a)(De,this.getActiveClassName(),!Ke.disabled&&Ke.active),Object(c.a)(De,this.getSelectedClassName(),Ke.isSelected),Object(c.a)(De,this.getDisabledClassName(),Ke.disabled),De)),ot=Object(de.a)(Object(de.a)({},Ke.attribute),{},{title:typeof Ke.title=="string"?Ke.title:void 0,className:vt,role:Ke.role||"menuitem","aria-disabled":Ke.disabled});Ke.role==="option"?ot=Object(de.a)(Object(de.a)({},ot),{},{role:"option","aria-selected":Ke.isSelected}):(Ke.role===null||Ke.role==="none")&&(ot.role="none");var Mt={onClick:Ke.disabled?null:this.onClick,onMouseLeave:Ke.disabled?null:this.onMouseLeave,onMouseEnter:Ke.disabled?null:this.onMouseEnter},Nt=Object(de.a)({},Ke.style);Ke.mode==="inline"&&(Ke.direction==="rtl"?Nt.paddingRight=Ke.inlineIndent*Ke.level:Nt.paddingLeft=Ke.inlineIndent*Ke.level),ue.forEach(function(St){return delete Ke[St]}),delete Ke.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(h.default)(Ke,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ot,Mt,{style:Nt,ref:this.saveNode}),Ke.children,it)}}]),mt}(T.Component);Le.isMenuItem=!0,Le.defaultProps={onSelect:X,onMouseEnter:X,onMouseLeave:X,manualRef:X};var Ce=Object(C.b)(function(Rt,st){var mt=Rt.activeKey,lt=Rt.selectedKeys,De=st.eventKey,Ke=st.subMenuKey;return{active:mt[Ke]===De,isSelected:lt.indexOf(De)!==-1}})(Le),et=Ce,Qe=function(Rt){Object(k.a)(mt,Rt);var st=Object(S.a)(mt);function mt(){var lt;return Object(ee.a)(this,mt),lt=st.apply(this,arguments),lt.renderInnerMenuItem=function(De){var Ke=lt.props,vt=Ke.renderMenuItem,ot=Ke.index;return vt(De,ot,lt.props.subMenuKey)},lt}return Object(j.a)(mt,[{key:"render",value:function(){var De=Object(p.a)({},this.props),Ke=De.className,vt=Ke===void 0?"":Ke,ot=De.rootPrefixCls,Mt="".concat(ot,"-item-group-title"),Nt="".concat(ot,"-item-group-list"),it=De.title,St=De.children;return ue.forEach(function(Wt){return delete De[Wt]}),delete De.onClick,delete De.direction,T.createElement("li",Object.assign({},De,{className:"".concat(vt," ").concat(ot,"-item-group")}),T.createElement("div",{className:Mt,title:typeof it=="string"?it:void 0},it),T.createElement("ul",{className:Nt},T.Children.map(St,this.renderInnerMenuItem)))}}]),mt}(T.Component);Qe.isMenuItemGroup=!0,Qe.defaultProps={disabled:!0};var yt=Qe,Dt=function(st){var mt=st.className,lt=st.rootPrefixCls,De=st.style;return T.createElement("li",{className:"".concat(mt," ").concat(lt,"-item-divider"),style:De})};Dt.defaultProps={disabled:!0,className:"",style:{}};var Bt=Dt,Pt=$e.e=Te},"3tLw":function(rt,$e,H){rt.exports=H.p+"static/a.39070d50.svg"},"4xil":function(rt,$e,H){rt.exports={watermark:"watermark___2DVjg",videovideo:"videovideo___3jScv",animate__loop:"animate__loop___36IZ1",upDown:"upDown___3FGkz",container:"container___GV_Ds","video-container":"video-container___35tqx","video-controls":"video-controls___u99fM",hide:"hide___2GDit","video-progress":"video-progress___2LKQJ",seek:"seek___3b-US","seek-tooltip":"seek-tooltip___bZ9sZ","bottom-controls":"bottom-controls___74sQw","left-controls":"left-controls___2kBb3","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(rt,$e,H){"use strict";H.d($e,"a",function(){return t}),H.d($e,"b",function(){return m});var de=H("Ty5D"),ee=H("dI71"),j=H("q1tI"),w=H.n(j),k=H("YS25"),S=H("17x9"),T=H.n(S),C=H("wx14"),h=H("zLVn"),p=H("9R94"),c=function(E){Object(ee.a)(o,E);function o(){for(var A,O=arguments.length,D=new Array(O),N=0;N<O;N++)D[N]=arguments[N];return A=E.call.apply(E,[this].concat(D))||this,A.history=Object(k.a)(A.props),A}var x=o.prototype;return x.render=function(){return w.a.createElement(de.c,{history:this.history,children:this.props.children})},o}(w.a.Component),l=function(E){Object(ee.a)(o,E);function o(){for(var A,O=arguments.length,D=new Array(O),N=0;N<O;N++)D[N]=arguments[N];return A=E.call.apply(E,[this].concat(D))||this,A.history=Object(k.b)(A.props),A}var x=o.prototype;return x.render=function(){return w.a.createElement(de.c,{history:this.history,children:this.props.children})},o}(w.a.Component),a=function(o,x){return typeof o=="function"?o(x):o},u=function(o,x){return typeof o=="string"?Object(k.c)(o,null,null,x):o},s=function(o){return o},f=w.a.forwardRef;typeof f=="undefined"&&(f=s);function i(E){return!!(E.metaKey||E.altKey||E.ctrlKey||E.shiftKey)}var n=f(function(E,o){var x=E.innerRef,A=E.navigate,O=E.onClick,D=Object(h.a)(E,["innerRef","navigate","onClick"]),N=D.target,W=Object(C.a)({},D,{onClick:function(oe){try{O&&O(oe)}catch(B){throw oe.preventDefault(),B}!oe.defaultPrevented&&oe.button===0&&(!N||N==="_self")&&!i(oe)&&(oe.preventDefault(),A())}});return s!==f?W.ref=o||x:W.ref=x,w.a.createElement("a",W)}),t=f(function(E,o){var x=E.component,A=x===void 0?n:x,O=E.replace,D=E.to,N=E.innerRef,W=Object(h.a)(E,["component","replace","to","innerRef"]);return w.a.createElement(de.e.Consumer,null,function(K){K||Object(p.a)(!1);var oe=K.history,B=u(a(D,K.location),K.location),X=B?oe.createHref(B):"",V=Object(C.a)({},W,{href:X,navigate:function(){var $=a(D,K.location),Z=O?oe.replace:oe.push;Z($)}});return s!==f?V.ref=o||N:V.innerRef=N,w.a.createElement(A,V)})});if(!1)var d,v;var g=function(o){return o},b=w.a.forwardRef;typeof b=="undefined"&&(b=g);function _(){for(var E=arguments.length,o=new Array(E),x=0;x<E;x++)o[x]=arguments[x];return o.filter(function(A){return A}).join(" ")}var m=b(function(E,o){var x=E["aria-current"],A=x===void 0?"page":x,O=E.activeClassName,D=O===void 0?"active":O,N=E.activeStyle,W=E.className,K=E.exact,oe=E.isActive,B=E.location,X=E.sensitive,V=E.strict,ne=E.style,$=E.to,Z=E.innerRef,ue=Object(h.a)(E,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return w.a.createElement(de.e.Consumer,null,function(he){he||Object(p.a)(!1);var Oe=B||he.location,we=u(a($,Oe),Oe),Pe=we.pathname,_e=Pe&&Pe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),xe=_e?Object(de.f)(Oe.pathname,{path:_e,exact:K,sensitive:X,strict:V}):null,Ve=!!(oe?oe(xe,Oe):xe),Ne=Ve?_(W,D):W,Be=Ve?Object(C.a)({},ne,{},N):ne,ze=Object(C.a)({"aria-current":Ve&&A||null,className:Ne,style:Be,to:we},ue);return g!==b?ze.ref=o||Z:ze.innerRef=Z,w.a.createElement(t,ze)})});if(!1)var y},"5nXd":function(rt,$e,H){var de=H("MFOe"),ee=de.slice,j=de.pluck,w=de.each,k=de.bind,S=de.create,T=de.isList,C=de.isFunction,h=de.isObject;rt.exports={createStore:l};var p={version:"2.0.12",enabled:!1,get:function(a,u){var s=this.storage.read(this._namespacePrefix+a);return this._deserialize(s,u)},set:function(a,u){return u===void 0?this.remove(a):(this.storage.write(this._namespacePrefix+a,this._serialize(u)),u)},remove:function(a){this.storage.remove(this._namespacePrefix+a)},each:function(a){var u=this;this.storage.each(function(s,f){a.call(u,u._deserialize(s),(f||"").replace(u._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(a){return this._namespacePrefix=="__storejs_"+a+"_"},createStore:function(){return l.apply(this,arguments)},addPlugin:function(a){this._addPlugin(a)},namespace:function(a){return l(this.storage,this.plugins,a)}};function c(){var a=typeof console=="undefined"?null:console;if(!a)return;var u=a.warn?a.warn:a.log;u.apply(a,arguments)}function l(a,u,s){s||(s=""),a&&!T(a)&&(a=[a]),u&&!T(u)&&(u=[u]);var f=s?"__storejs_"+s+"_":"",i=s?new RegExp("^"+f):null,n=/^[a-zA-Z0-9_\-]*$/;if(!n.test(s))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var t={_namespacePrefix:f,_namespaceRegexp:i,_testStorage:function(v){try{var g="__storejs__test__";v.write(g,g);var b=v.read(g)===g;return v.remove(g),b}catch(_){return!1}},_assignPluginFnProp:function(v,g){var b=this[g];this[g]=function(){var m=ee(arguments,0),y=this;function E(){return b?(w(arguments,function(x,A){m[A]=x}),b.apply(y,m)):void 0}var o=[E].concat(m);return v.apply(y,o)}},_serialize:function(v){return JSON.stringify(v)},_deserialize:function(v,g){if(!v)return g;var b="";try{b=JSON.parse(v)}catch(_){b=v}return b!==void 0?b:g},_addStorage:function(v){if(this.enabled)return;this._testStorage(v)&&(this.storage=v,this.enabled=!0)},_addPlugin:function(v){var g=this;if(T(v)){w(v,function(m){g._addPlugin(m)});return}var b=j(this.plugins,function(m){return v===m});if(b)return;if(this.plugins.push(v),!C(v))throw new Error("Plugins must be function values that return objects");var _=v.call(this);if(!h(_))throw new Error("Plugins must return an object of function properties");w(_,function(m,y){if(!C(m))throw new Error("Bad plugin property: "+y+" from plugin "+v.name+". Plugins should only return functions.");g._assignPluginFnProp(m,y)})},addStorage:function(v){c("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(v)}},d=S(t,p,{plugins:[]});return d.raw={},w(d,function(v,g){C(v)&&(d.raw[g]=k(d,v))}),w(a,function(v){d._addStorage(v)}),w(u,function(v){d._addPlugin(v)}),d}},"6+eU":function(rt,$e,H){"use strict";H.d($e,"a",function(){return b});var de=H("wx14"),ee=H("rePB"),j=H("VTBJ"),w=H("1OyB"),k=H("vuIU"),S=H("Ji7U"),T=H("LK+K"),C=H("q1tI"),h=H.n(C),p=H("TSYQ"),c=H.n(p),l=function(m){var y,E="".concat(m.rootPrefixCls,"-item"),o=c()(E,"".concat(E,"-").concat(m.page),(y={},Object(ee.a)(y,"".concat(E,"-active"),m.active),Object(ee.a)(y,m.className,!!m.className),Object(ee.a)(y,"".concat(E,"-disabled"),!m.page),y)),x=function(){m.onClick(m.page)},A=function(D){m.onKeyPress(D,m.onClick,m.page)};return h.a.createElement("li",{title:m.showTitle?m.page:null,className:o,onClick:x,onKeyPress:A,tabIndex:"0"},m.itemRender(m.page,"page",h.a.createElement("a",{rel:"nofollow"},m.page)))},a=l,u={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},s=function(_){Object(S.a)(y,_);var m=Object(T.a)(y);function y(){var E;Object(w.a)(this,y);for(var o=arguments.length,x=new Array(o),A=0;A<o;A++)x[A]=arguments[A];return E=m.call.apply(m,[this].concat(x)),E.state={goInputText:""},E.buildOptionText=function(O){return"".concat(O," ").concat(E.props.locale.items_per_page)},E.changeSize=function(O){E.props.changeSize(Number(O))},E.handleChange=function(O){E.setState({goInputText:O.target.value})},E.handleBlur=function(O){var D=E.props,N=D.goButton,W=D.quickGo,K=D.rootPrefixCls,oe=E.state.goInputText;if(N||oe==="")return;if(O.relatedTarget&&(O.relatedTarget.className.indexOf("".concat(K,"-prev"))>=0||O.relatedTarget.className.indexOf("".concat(K,"-next"))>=0))return;E.setState({goInputText:""}),W(E.getValidValue())},E.go=function(O){var D=E.state.goInputText;if(D==="")return;(O.keyCode===u.ENTER||O.type==="click")&&(E.setState({goInputText:""}),E.props.quickGo(E.getValidValue()))},E}return Object(k.a)(y,[{key:"getValidValue",value:function(){var o=this.state,x=o.goInputText,A=o.current;return!x||isNaN(x)?A:Number(x)}},{key:"getPageSizeOptions",value:function(){var o=this.props,x=o.pageSize,A=o.pageSizeOptions;return A.some(function(O){return O.toString()===x.toString()})?A:A.concat([x.toString()]).sort(function(O,D){var N=isNaN(Number(O))?0:Number(O),W=isNaN(Number(D))?0:Number(D);return N-W})}},{key:"render",value:function(){var o=this,x=this.props,A=x.pageSize,O=x.locale,D=x.rootPrefixCls,N=x.changeSize,W=x.quickGo,K=x.goButton,oe=x.selectComponentClass,B=x.buildOptionText,X=x.selectPrefixCls,V=x.disabled,ne=this.state.goInputText,$="".concat(D,"-options"),Z=oe,ue=null,he=null,Oe=null;if(!N&&!W)return null;var we=this.getPageSizeOptions();if(N&&Z){var Pe=we.map(function(_e,xe){return h.a.createElement(Z.Option,{key:xe,value:_e.toString()},(B||o.buildOptionText)(_e))});ue=h.a.createElement(Z,{disabled:V,prefixCls:X,showSearch:!1,className:"".concat($,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(A||we[0]).toString(),onChange:this.changeSize,getPopupContainer:function(xe){return xe.parentNode}},Pe)}return W&&(K&&(Oe=typeof K=="boolean"?h.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:V,className:"".concat($,"-quick-jumper-button")},O.jump_to_confirm):h.a.createElement("span",{onClick:this.go,onKeyUp:this.go},K)),he=h.a.createElement("div",{className:"".concat($,"-quick-jumper")},O.jump_to,h.a.createElement("input",{disabled:V,type:"text",value:ne,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),O.page,Oe)),h.a.createElement("li",{className:"".concat($)},ue,he)}}]),y}(h.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var f=s,i=H("N2Kk");function n(){}function t(_){return typeof _=="number"&&isFinite(_)&&Math.floor(_)===_}function d(_,m,y){return y}function v(_,m,y){var E=typeof _=="undefined"?m.pageSize:_;return Math.floor((y.total-1)/E)+1}var g=function(_){Object(S.a)(y,_);var m=Object(T.a)(y);function y(E){var o;Object(w.a)(this,y),o=m.call(this,E),o.getJumpPrevPage=function(){return Math.max(1,o.state.current-(o.props.showLessItems?3:5))},o.getJumpNextPage=function(){return Math.min(v(void 0,o.state,o.props),o.state.current+(o.props.showLessItems?3:5))},o.getItemIcon=function(N,W){var K=o.props.prefixCls,oe=N||h.a.createElement("button",{type:"button","aria-label":W,className:"".concat(K,"-item-link")});return typeof N=="function"&&(oe=h.a.createElement(N,Object(j.a)({},o.props))),oe},o.savePaginationNode=function(N){o.paginationNode=N},o.isValid=function(N){return t(N)&&N!==o.state.current},o.shouldDisplayQuickJumper=function(){var N=o.props,W=N.showQuickJumper,K=N.pageSize,oe=N.total;return oe<=K?!1:W},o.handleKeyDown=function(N){(N.keyCode===u.ARROW_UP||N.keyCode===u.ARROW_DOWN)&&N.preventDefault()},o.handleKeyUp=function(N){var W=o.getValidValue(N),K=o.state.currentInputValue;W!==K&&o.setState({currentInputValue:W}),N.keyCode===u.ENTER?o.handleChange(W):N.keyCode===u.ARROW_UP?o.handleChange(W-1):N.keyCode===u.ARROW_DOWN&&o.handleChange(W+1)},o.changePageSize=function(N){var W=o.state.current,K=v(N,o.state,o.props);W=W>K?K:W,K===0&&(W=o.state.current),typeof N=="number"&&("pageSize"in o.props||o.setState({pageSize:N}),"current"in o.props||o.setState({current:W,currentInputValue:W})),o.props.onShowSizeChange(W,N),"onChange"in o.props&&o.props.onChange&&o.props.onChange(W,N)},o.handleChange=function(N){var W=o.props.disabled,K=N;if(o.isValid(K)&&!W){var oe=v(void 0,o.state,o.props);K>oe?K=oe:K<1&&(K=1),"current"in o.props||o.setState({current:K,currentInputValue:K});var B=o.state.pageSize;return o.props.onChange(K,B),K}return o.state.current},o.prev=function(){o.hasPrev()&&o.handleChange(o.state.current-1)},o.next=function(){o.hasNext()&&o.handleChange(o.state.current+1)},o.jumpPrev=function(){o.handleChange(o.getJumpPrevPage())},o.jumpNext=function(){o.handleChange(o.getJumpNextPage())},o.hasPrev=function(){return o.state.current>1},o.hasNext=function(){return o.state.current<v(void 0,o.state,o.props)},o.runIfEnter=function(N,W){if(N.key==="Enter"||N.charCode===13){for(var K=arguments.length,oe=new Array(K>2?K-2:0),B=2;B<K;B++)oe[B-2]=arguments[B];W.apply(void 0,oe)}},o.runIfEnterPrev=function(N){o.runIfEnter(N,o.prev)},o.runIfEnterNext=function(N){o.runIfEnter(N,o.next)},o.runIfEnterJumpPrev=function(N){o.runIfEnter(N,o.jumpPrev)},o.runIfEnterJumpNext=function(N){o.runIfEnter(N,o.jumpNext)},o.handleGoTO=function(N){(N.keyCode===u.ENTER||N.type==="click")&&o.handleChange(o.state.currentInputValue)};var x=E.onChange!==n,A="current"in E;A&&!x&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var O=E.defaultCurrent;"current"in E&&(O=E.current);var D=E.defaultPageSize;return"pageSize"in E&&(D=E.pageSize),O=Math.min(O,v(D,void 0,E)),o.state={current:O,currentInputValue:O,pageSize:D},o}return Object(k.a)(y,[{key:"componentDidUpdate",value:function(o,x){var A=this.props.prefixCls;if(x.current!==this.state.current&&this.paginationNode){var O=this.paginationNode.querySelector(".".concat(A,"-item-").concat(x.current));O&&document.activeElement===O&&O.blur()}}},{key:"getValidValue",value:function(o){var x=o.target.value,A=v(void 0,this.state,this.props),O=this.state.currentInputValue,D;return x===""?D=x:isNaN(Number(x))?D=O:x>=A?D=A:D=Number(x),D}},{key:"getShowSizeChanger",value:function(){var o=this.props,x=o.showSizeChanger,A=o.total,O=o.totalBoundaryShowSizeChanger;return typeof x!="undefined"?x:A>O}},{key:"renderPrev",value:function(o){var x=this.props,A=x.prevIcon,O=x.itemRender,D=O(o,"prev",this.getItemIcon(A,"prev page")),N=!this.hasPrev();return Object(C.isValidElement)(D)?Object(C.cloneElement)(D,{disabled:N}):D}},{key:"renderNext",value:function(o){var x=this.props,A=x.nextIcon,O=x.itemRender,D=O(o,"next",this.getItemIcon(A,"next page")),N=!this.hasNext();return Object(C.isValidElement)(D)?Object(C.cloneElement)(D,{disabled:N}):D}},{key:"render",value:function(){var o=this,x=this.props,A=x.prefixCls,O=x.className,D=x.style,N=x.disabled,W=x.hideOnSinglePage,K=x.total,oe=x.locale,B=x.showQuickJumper,X=x.showLessItems,V=x.showTitle,ne=x.showTotal,$=x.simple,Z=x.itemRender,ue=x.showPrevNextJumpers,he=x.jumpPrevIcon,Oe=x.jumpNextIcon,we=x.selectComponentClass,Pe=x.selectPrefixCls,_e=x.pageSizeOptions,xe=this.state,Ve=xe.current,Ne=xe.pageSize,Be=xe.currentInputValue;if(W===!0&&K<=Ne)return null;var ze=v(void 0,this.state,this.props),ye=[],me=null,We=null,He=null,nt=null,te=null,P=B&&B.goButton,U=X?1:2,q=Ve-1>0?Ve-1:0,Y=Ve+1<ze?Ve+1:ze,J=Object.keys(this.props).reduce(function(be,Te){return(Te.substr(0,5)==="data-"||Te.substr(0,5)==="aria-"||Te==="role")&&(be[Te]=o.props[Te]),be},{});if($)return P&&(typeof P=="boolean"?te=h.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},oe.jump_to_confirm):te=h.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},P),te=h.a.createElement("li",{title:V?"".concat(oe.jump_to).concat(Ve,"/").concat(ze):null,className:"".concat(A,"-simple-pager")},te)),h.a.createElement("ul",Object(de.a)({className:c()(A,"".concat(A,"-simple"),Object(ee.a)({},"".concat(A,"-disabled"),N),O),style:D,ref:this.savePaginationNode},J),h.a.createElement("li",{title:V?oe.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:c()("".concat(A,"-prev"),Object(ee.a)({},"".concat(A,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(q)),h.a.createElement("li",{title:V?"".concat(Ve,"/").concat(ze):null,className:"".concat(A,"-simple-pager")},h.a.createElement("input",{type:"text",value:Be,disabled:N,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),h.a.createElement("span",{className:"".concat(A,"-slash")},"/"),ze),h.a.createElement("li",{title:V?oe.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:c()("".concat(A,"-next"),Object(ee.a)({},"".concat(A,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Y)),te);if(ze<=3+U*2){var Ee={locale:oe,rootPrefixCls:A,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:V,itemRender:Z};ze||ye.push(h.a.createElement(a,Object(de.a)({},Ee,{key:"noPager",page:ze,className:"".concat(A,"-disabled")})));for(var ke=1;ke<=ze;ke+=1){var ht=Ve===ke;ye.push(h.a.createElement(a,Object(de.a)({},Ee,{key:ke,page:ke,active:ht})))}}else{var Ue=X?oe.prev_3:oe.prev_5,je=X?oe.next_3:oe.next_5;ue&&(me=h.a.createElement("li",{title:V?Ue:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:c()("".concat(A,"-jump-prev"),Object(ee.a)({},"".concat(A,"-jump-prev-custom-icon"),!!he))},Z(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(he,"prev page"))),We=h.a.createElement("li",{title:V?je:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:c()("".concat(A,"-jump-next"),Object(ee.a)({},"".concat(A,"-jump-next-custom-icon"),!!Oe))},Z(this.getJumpNextPage(),"jump-next",this.getItemIcon(Oe,"next page")))),nt=h.a.createElement(a,{locale:oe,last:!0,rootPrefixCls:A,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ze,page:ze,active:!1,showTitle:V,itemRender:Z}),He=h.a.createElement(a,{locale:oe,rootPrefixCls:A,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:V,itemRender:Z});var tt=Math.max(1,Ve-U),dt=Math.min(Ve+U,ze);Ve-1<=U&&(dt=1+U*2),ze-Ve<=U&&(tt=ze-U*2);for(var qe=tt;qe<=dt;qe+=1){var Ye=Ve===qe;ye.push(h.a.createElement(a,{locale:oe,rootPrefixCls:A,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:qe,page:qe,active:Ye,showTitle:V,itemRender:Z}))}Ve-1>=U*2&&Ve!==1+2&&(ye[0]=Object(C.cloneElement)(ye[0],{className:"".concat(A,"-item-after-jump-prev")}),ye.unshift(me)),ze-Ve>=U*2&&Ve!==ze-2&&(ye[ye.length-1]=Object(C.cloneElement)(ye[ye.length-1],{className:"".concat(A,"-item-before-jump-next")}),ye.push(We)),tt!==1&&ye.unshift(He),dt!==ze&&ye.push(nt)}var Fe=null;ne&&(Fe=h.a.createElement("li",{className:"".concat(A,"-total-text")},ne(K,[K===0?0:(Ve-1)*Ne+1,Ve*Ne>K?K:Ve*Ne])));var Ie=!this.hasPrev()||!ze,Me=!this.hasNext()||!ze;return h.a.createElement("ul",Object(de.a)({className:c()(A,O,Object(ee.a)({},"".concat(A,"-disabled"),N)),style:D,unselectable:"unselectable",ref:this.savePaginationNode},J),Fe,h.a.createElement("li",{title:V?oe.prev_page:null,onClick:this.prev,tabIndex:Ie?null:0,onKeyPress:this.runIfEnterPrev,className:c()("".concat(A,"-prev"),Object(ee.a)({},"".concat(A,"-disabled"),Ie)),"aria-disabled":Ie},this.renderPrev(q)),ye,h.a.createElement("li",{title:V?oe.next_page:null,onClick:this.next,tabIndex:Me?null:0,onKeyPress:this.runIfEnterNext,className:c()("".concat(A,"-next"),Object(ee.a)({},"".concat(A,"-disabled"),Me)),"aria-disabled":Me},this.renderNext(Y)),h.a.createElement(f,{disabled:N,locale:oe,rootPrefixCls:A,selectComponentClass:we,selectPrefixCls:Pe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ve,pageSize:Ne,pageSizeOptions:_e,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:P}))}}],[{key:"getDerivedStateFromProps",value:function(o,x){var A={};if("current"in o&&(A.current=o.current,o.current!==x.current&&(A.currentInputValue=A.current)),"pageSize"in o&&o.pageSize!==x.pageSize){var O=x.current,D=v(o.pageSize,x,o);O=O>D?D:O,"current"in o||(A.current=O,A.currentInputValue=O),A.pageSize=o.pageSize}return A}}]),y}(h.a.Component);g.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:n,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:n,locale:i.a,style:{},itemRender:d,totalBoundaryShowSizeChanger:50};var b=g},"6RRn":function(rt,$e,H){"use strict";var de=H("wCXF"),ee=H("n6Qo");H.d($e,"b",function(){return ee.a});var j=H("IBYe"),w=H("6eGT"),k=H("hW8S");H.d($e,"a",function(){return k.a}),$e.c=de.b},"6eGT":function(rt,$e,H){"use strict";function de(ee){return null}$e.a=de},"7+5b":function(rt,$e,H){rt.exports=H.p+"static/v.e7f297d6.svg"},"7Cbv":function(rt,$e,H){"use strict";var de=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),ee=new Uint8Array(16);function j(){if(!de)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return de(ee)}var w=/^(?:[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 k(a){return typeof a=="string"&&w.test(a)}for(var S=k,T=[],C=0;C<256;++C)T.push((C+256).toString(16).substr(1));function h(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(T[a[u+0]]+T[a[u+1]]+T[a[u+2]]+T[a[u+3]]+"-"+T[a[u+4]]+T[a[u+5]]+"-"+T[a[u+6]]+T[a[u+7]]+"-"+T[a[u+8]]+T[a[u+9]]+"-"+T[a[u+10]]+T[a[u+11]]+T[a[u+12]]+T[a[u+13]]+T[a[u+14]]+T[a[u+15]]).toLowerCase();if(!S(s))throw TypeError("Stringified UUID is invalid");return s}var p=h;function c(a,u,s){a=a||{};var f=a.random||(a.rng||j)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,u){s=s||0;for(var i=0;i<16;++i)u[s+i]=f[i];return u}return p(f)}var l=$e.a=c},"7ahc":function(rt,$e,H){"use strict";H.d($e,"a",function(){return v});var de=H("k1fw"),ee=H("0Owb"),j=H("+L6B"),w=H("2/Rp"),k=H("y8nQ"),S=H("Vl3Y"),T=H("tJVT"),C=H("OaEy"),h=H("2fM7"),p=H("q1tI"),c=H.n(p),l=H("VrN/"),a=H.n(l),u=H("p77/"),s=H.n(u),f=H("c5Ni"),i=H.n(f),n=h.a.Option,t={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};$e.b=function(g){var b=g.callback,_=g.onCancel,m=Object(p.useState)("python"),y=Object(T.a)(m,2),E=y[0],o=y[1];function x(O){o(d[O][1])}function A(O){b(O)}return c.a.createElement(S.a,Object(ee.a)({},t,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:A}),c.a.createElement(S.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},c.a.createElement(h.a,{onChange:x},Object.keys(d).map(function(O){return c.a.createElement(n,{key:O,value:O},d[O][0])}))),c.a.createElement(S.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},c.a.createElement(v,{mode:E})),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),c.a.createElement(w.a,{type:"ghost",onClick:_},"\u53D6\u6D88")))};function v(g){var b=g.value,_=g.onChange,m=g.mode,y=g.options,E=y===void 0?{}:y,o=Object(p.useRef)(),x=Object(p.useState)(),A=Object(T.a)(x,2),O=A[0],D=A[1];return Object(p.useEffect)(function(){if(O){function N(W){var K=W.getValue();_&&_(K)}return O.on("change",N),function(){O.off("change",N)}}},[O,_]),Object(p.useEffect)(function(){O&&O.setOption("mode",m)},[O,m]),Object(p.useEffect)(function(){O&&((b!==O.getValue()||b==="")&&setTimeout(function(){O.setValue(b||" ")},300))},[O,b]),Object(p.useEffect)(function(){if(o.current&&!O){var N=a.a.fromTextArea(o.current,Object(de.a)({mode:m,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));D(N)}},[o.current,O]),c.a.createElement("div",{className:"my-codemirror-container"},c.a.createElement("textarea",{ref:o}))}},"7ixt":function(rt,$e,H){"use strict";H.d($e,"a",function(){return j});var de={adjustX:1,adjustY:1},ee=[0,0],j={left:{points:["cr","cl"],overflow:de,offset:[-4,0],targetOffset:ee},right:{points:["cl","cr"],overflow:de,offset:[4,0],targetOffset:ee},top:{points:["bc","tc"],overflow:de,offset:[0,-4],targetOffset:ee},bottom:{points:["tc","bc"],overflow:de,offset:[0,4],targetOffset:ee},topLeft:{points:["bl","tl"],overflow:de,offset:[0,-4],targetOffset:ee},leftTop:{points:["tr","tl"],overflow:de,offset:[-4,0],targetOffset:ee},topRight:{points:["br","tr"],overflow:de,offset:[0,-4],targetOffset:ee},rightTop:{points:["tl","tr"],overflow:de,offset:[4,0],targetOffset:ee},bottomRight:{points:["tr","br"],overflow:de,offset:[0,4],targetOffset:ee},rightBottom:{points:["bl","br"],overflow:de,offset:[4,0],targetOffset:ee},bottomLeft:{points:["tl","bl"],overflow:de,offset:[0,4],targetOffset:ee},leftBottom:{points:["br","bl"],overflow:de,offset:[-4,0],targetOffset:ee}},w=j},"7qur":function(rt,$e,H){"use strict";H.d($e,"m",function(){return ee}),H.d($e,"s",function(){return j}),H.d($e,"h",function(){return w}),H.d($e,"o",function(){return k}),H.d($e,"n",function(){return S}),H.d($e,"l",function(){return T}),H.d($e,"b",function(){return C}),H.d($e,"q",function(){return h}),H.d($e,"t",function(){return p}),H.d($e,"v",function(){return c}),H.d($e,"w",function(){return l}),H.d($e,"u",function(){return a}),H.d($e,"p",function(){return u}),H.d($e,"f",function(){return s}),H.d($e,"a",function(){return f}),H.d($e,"j",function(){return i}),H.d($e,"k",function(){return n}),H.d($e,"d",function(){return t}),H.d($e,"g",function(){return d}),H.d($e,"c",function(){return v}),H.d($e,"e",function(){return g}),H.d($e,"i",function(){return b}),H.d($e,"r",function(){return _});var de=H("ErOA");function ee(m){return Object(de.c)("mypractices/".concat(m,".json"),{hidePopLogin:!0})}function j(m,y){return Object(de.f)("mypractices/".concat(m,"/code_submit.json"),y)}function w(m,y){return Object(de.c)("mypractices/".concat(m,"/code_debug.json"),y)}function k(m,y){return Object(de.c)("mypractices/".concat(m,"/submit_records.json"),y)}function S(m){return Object(de.c)("mypractices/record_detail.json",{id:m})}function T(m,y){return Object(de.c)("mypractices/".concat(m,"/result.json"),{mode:y})}function C(m,y){return Object(de.f)("mypractices/".concat(m,"/add_notes.json"),y)}function h(m,y){return Object(de.f)("mypractices/".concat(m,"/restore_initial_code.json"),y)}function p(m,y){return Object(de.f)("mypractices/".concat(m,"/sync_code.json"),y)}function c(m,y){return Object(de.f)("mypractices/".concat(m,"/update_code.json"),y)}function l(m){return Object(de.f)("mypractices/".concat(m,"/initial_codes.json"))}function a(m,y){return Object(de.f)("discusses/".concat(m,"/plus.json"),y)}function u(m){return Object(de.c)("practices/practices_list.json",m)}function s(m,y){return Object(de.c)("practices/".concat(m,"/question_solution_articles"),y)}function f(m,y){return Object(de.f)("practices/".concat(m,"/question_solution_articles"),y)}function i(m,y){return Object(de.g)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function n(m,y){return Object(de.c)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active,"/edit"),y)}function t(m,y){return Object(de.c)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function d(m,y){return Object(de.f)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active,"/set_authority_or_excellent"),y)}function v(m,y){return Object(de.f)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active,"/praise_or_treads"),y)}function g(m,y){return Object(de.f)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active,"/hide"))}function b(m,y){return Object(de.b)("practices/".concat(m,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function _(m,y){return Object(de.f)("mypractices/".concat(m,"/update_practice_time_sum"),y)}},"815F":function(rt,$e,H){"use strict";H.d($e,"e",function(){return T}),H.d($e,"c",function(){return h}),H.d($e,"d",function(){return p}),H.d($e,"a",function(){return l}),H.d($e,"f",function(){return a}),H.d($e,"b",function(){return u});var de=H("KQm4"),ee=H("VTBJ"),j=H("Ff2n"),w=H("Zm9Q"),k=H("Kwbf"),S=H("OZM5");function T(s,f){return s!=null?s:f}function C(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=new Map;function i(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(d){var v=d.key,g=d.children;Object(k.a)(v!=null,"Tree node must have a certain key: [".concat(t).concat(v,"]"));var b=String(v);Object(k.a)(!f.has(b)||v===null||v===void 0,"Same 'key' exist in the Tree: ".concat(b)),f.set(b,!0),i(g,"".concat(t).concat(b," > "))})}i(s)}function h(s){function f(i){var n=Object(w.a)(i);return n.map(function(t){if(!Object(S.i)(t))return Object(k.a)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var d=t.key,v=t.props,g=v.children,b=Object(j.a)(v,["children"]),_=Object(ee.a)({key:d},b),m=f(g);return m.length&&(_.children=m),_}).filter(function(t){return t})}return f(s)}function p(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(f===!0?[]:f),n=[];function t(d){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return d.map(function(g,b){var _=Object(S.h)(v?v.pos:"0",b),m=T(g.key,_),y=Object(ee.a)(Object(ee.a)({},g),{},{parent:v,pos:_,children:null,data:g,isStart:[].concat(Object(de.a)(v?v.isStart:[]),[b===0]),isEnd:[].concat(Object(de.a)(v?v.isEnd:[]),[b===d.length-1])});return n.push(y),f===!0||i.has(m)?y.children=t(g.children||[],y):y.children=[],y})}return t(s),n}function c(s,f,i){var n;i?typeof i=="string"?n=function(v){return v[i]}:typeof i=="function"&&(n=function(v){return i(v)}):n=function(v,g){return T(v.key,g)};function t(d,v,g){var b=d?d.children:s,_=d?Object(S.h)(g.pos,v):"0";if(d){var m=n(d,_),y={node:d,index:v,pos:_,key:m,parentPos:g.node?g.pos:null,level:g.level+1};f(y)}b&&b.forEach(function(E,o){t(E,o,{node:d,pos:_,level:g?g.level+1:-1})})}t(null)}function l(s){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=f.initWrapper,n=f.processEntity,t=f.onProcessFinished,d=arguments.length>2?arguments[2]:void 0,v={},g={},b={posEntities:v,keyEntities:g};return i&&(b=i(b)||b),c(s,function(_){var m=_.node,y=_.index,E=_.pos,o=_.key,x=_.parentPos,A=_.level,O={node:m,index:y,key:o,pos:E,level:A},D=T(o,E);v[E]=O,g[D]=O,O.parent=v[x],O.parent&&(O.parent.children=O.parent.children||[],O.parent.children.push(O)),n&&n(O,b)},d),t&&t(b),b}function a(s,f){var i=f.expandedKeys,n=f.selectedKeys,t=f.loadedKeys,d=f.loadingKeys,v=f.checkedKeys,g=f.halfCheckedKeys,b=f.dragOverNodeKey,_=f.dropPosition,m=f.keyEntities,y=m[s],E={eventKey:s,expanded:i.indexOf(s)!==-1,selected:n.indexOf(s)!==-1,loaded:t.indexOf(s)!==-1,loading:d.indexOf(s)!==-1,checked:v.indexOf(s)!==-1,halfChecked:g.indexOf(s)!==-1,pos:String(y?y.pos:""),dragOver:b===s&&_===0,dragOverGapTop:b===s&&_===-1,dragOverGapBottom:b===s&&_===1};return E}function u(s){var f=s.data,i=s.expanded,n=s.selected,t=s.checked,d=s.loaded,v=s.loading,g=s.halfChecked,b=s.dragOver,_=s.dragOverGapTop,m=s.dragOverGapBottom,y=s.pos,E=s.active,o=Object(ee.a)(Object(ee.a)({},f),{},{expanded:i,selected:n,checked:t,loaded:d,loading:v,halfChecked:g,dragOver:b,dragOverGapTop:_,dragOverGapBottom:m,pos:y,active:E});return"props"in o||Object.defineProperty(o,"props",{get:function(){return Object(k.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),o}},"8EBN":function(rt,$e,H){(function(de){de(H("VrN/"))})(function(de){"use strict";de.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 ee=0;ee<de.modeInfo.length;ee++){var j=de.modeInfo[ee];j.mimes&&(j.mime=j.mimes[0])}de.findModeByMIME=function(w){w=w.toLowerCase();for(var k=0;k<de.modeInfo.length;k++){var S=de.modeInfo[k];if(S.mime==w)return S;if(S.mimes){for(var T=0;T<S.mimes.length;T++)if(S.mimes[T]==w)return S}}if(/\+xml$/.test(w))return de.findModeByMIME("application/xml");if(/\+json$/.test(w))return de.findModeByMIME("application/json")},de.findModeByExtension=function(w){w=w.toLowerCase();for(var k=0;k<de.modeInfo.length;k++){var S=de.modeInfo[k];if(S.ext){for(var T=0;T<S.ext.length;T++)if(S.ext[T]==w)return S}}},de.findModeByFileName=function(w){for(var k=0;k<de.modeInfo.length;k++){var S=de.modeInfo[k];if(S.file&&S.file.test(w))return S}var T=w.lastIndexOf("."),C=T>-1&&w.substring(T+1,w.length);if(C)return de.findModeByExtension(C)},de.findModeByName=function(w){w=w.toLowerCase();for(var k=0;k<de.modeInfo.length;k++){var S=de.modeInfo[k];if(S.name.toLowerCase()==w)return S;if(S.alias){for(var T=0;T<S.alias.length;T++)if(S.alias[T].toLowerCase()==w)return S}}}})},"8hTe":function(rt,$e,H){rt.exports={button:"button___1wy9m"}},"9Bee":function(rt,$e,H){"use strict";var de=H("DYRE"),ee=H("zeV3"),j=H("+L6B"),w=H("2/Rp"),k=H("k1fw"),S=H("9og8"),T=H("tJVT"),C=H("WmNS"),h=H.n(C),p=H("q1tI"),c=H.n(p),l=H("vg9a"),a=H("DlQD"),u=H.n(a),s=H("rUJ1");function f(re,I){var F=re.match(/^(\s+)(?:```)/);if(F===null)return I;var ie=F[1];return I.split(`
|
|
|
`).map(function(ce){var se=ce.match(/^\s+/);if(se===null)return ce;var Xe=Object(T.a)(se,1),_t=Xe[0];return _t.length>=ie.length?ce.slice(ie.length):ce}).join(`
|
|
|
`)}var i=[],n=["<ul>"],t=new u.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){i.length=0,n=["<ul>"]}var g={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function b(re,I,F,ie){if(I>=re.length||re[I].level<=F)return I;var ce=re[I];ie.push("<li><a href='#"+ce.anchor+"'>"+ce.text+"</a>"),I++;var se=[];return I=b(re,I,ce.level,se),se.length>0&&(ie.push("<ul>"),se.forEach(function(Xe){ie.push(Xe)}),ie.push("</ul>")),ie.push("</li>"),I=b(re,I,F,ie),I}function _(){return b(i,0,0,n),n.push("</ul>"),n.join("")}var m={heading:function(I){var F=d.exec(I);if(F)return{type:"heading",raw:F[0],depth:F[1].length,text:F[2]}},fences:function(I){var F=this.rules.block.fences.exec(I);if(F){var ie=F[0],ce=f(ie,F[3]||""),se=F[2]?F[2].trim():F[2];if(["latex","katex","math"].indexOf(se)>=0){var Xe=o(),_t=ce;ce=Xe,x[Xe]={type:"block",expression:_t}}return{type:"code",raw:ie,lang:se,text:ce}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,o=function(){return"__special_katext_id_".concat(E++,"__")},x={};function A(){return x}function O(){E=0,x={}}function D(re){return re=re.replace(y,function(I,F){var ie=o();return x[ie]={type:"inline",expression:F},ie}),re}var N=t.listitem;t.listitem=function(re){return N(D(re))};var W=t.paragraph;t.paragraph=function(re){return W(D(re))};var K=t.tablecell;t.tablecell=function(re,I){return K(D(re),I)},t.code=function(re,I,F){var ie=(I||"").match(/\S*/)[0];return ie?["latex","katex","math"].indexOf(ie)>=0?"<p class='editormd-tex'>".concat(re,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(I,'">').concat(F?re:Object(s.escape)(re,!0),`</code></pre>
|
|
|
`):'<pre class="prettyprint linenums"><code>'+(F?re:Object(s.escape)(re,!0))+"</code></pre>"},t.heading=function(re,I,F){var ie=this.options.headerPrefix+F.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:ie,level:I,text:re}),"<h"+I+' id="'+ie+'">'+re+"</h"+I+">"},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:m,renderer:t});var oe=u.a,B=H("SJMd"),X=H("ulZh"),V=H.n(X),ne=H("m3rI"),$=H("Oy/b"),Z=H("p5ED"),ue=H("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 he=function(re,I){return(he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,ie){F.__proto__=ie}||function(F,ie){for(var ce in ie)Object.prototype.hasOwnProperty.call(ie,ce)&&(F[ce]=ie[ce])})(re,I)};function Oe(re,I){function F(){this.constructor=re}he(re,I),re.prototype=I===null?Object.create(I):(F.prototype=I.prototype,new F)}function we(re,I,F,ie){return new(F||(F=Promise))(function(ce,se){function Xe(Vt){try{At(ie.next(Vt))}catch(wt){se(wt)}}function _t(Vt){try{At(ie.throw(Vt))}catch(wt){se(wt)}}function At(Vt){var wt;Vt.done?ce(Vt.value):(wt=Vt.value,wt instanceof F?wt:new F(function(Ht){Ht(wt)})).then(Xe,_t)}At((ie=ie.apply(re,I||[])).next())})}function Pe(re,I){var F,ie,ce,se,Xe={label:0,sent:function(){if(1&ce[0])throw ce[1];return ce[1]},trys:[],ops:[]};return se={next:_t(0),throw:_t(1),return:_t(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function _t(At){return function(Vt){return function(wt){if(F)throw new TypeError("Generator is already executing.");for(;Xe;)try{if(F=1,ie&&(ce=2&wt[0]?ie.return:wt[0]?ie.throw||((ce=ie.return)&&ce.call(ie),0):ie.next)&&!(ce=ce.call(ie,wt[1])).done)return ce;switch(ie=0,ce&&(wt=[2&wt[0],ce.value]),wt[0]){case 0:case 1:ce=wt;break;case 4:return Xe.label++,{value:wt[1],done:!1};case 5:Xe.label++,ie=wt[1],wt=[0];continue;case 7:wt=Xe.ops.pop(),Xe.trys.pop();continue;default:if(!(ce=Xe.trys,(ce=ce.length>0&&ce[ce.length-1])||wt[0]!==6&&wt[0]!==2)){Xe=0;continue}if(wt[0]===3&&(!ce||wt[1]>ce[0]&&wt[1]<ce[3])){Xe.label=wt[1];break}if(wt[0]===6&&Xe.label<ce[1]){Xe.label=ce[1],ce=wt;break}if(ce&&Xe.label<ce[2]){Xe.label=ce[2],Xe.ops.push(wt);break}ce[2]&&Xe.ops.pop(),Xe.trys.pop();continue}wt=I.call(re,Xe)}catch(Ht){wt=[6,Ht],ie=0}finally{F=ce=0}if(5&wt[0])throw wt[1];return{value:wt[0]?wt[1]:void 0,done:!0}}([At,Vt])}}}function _e(){for(var re=0,I=0,F=arguments.length;I<F;I++)re+=arguments[I].length;var ie=Array(re),ce=0;for(I=0;I<F;I++)for(var se=arguments[I],Xe=0,_t=se.length;Xe<_t;Xe++,ce++)ie[ce]=se[Xe];return ie}var xe=function(){function re(){}return re.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},re.setAttributes=function(I,F){for(var ie=0,ce=F;ie<ce.length;ie++){var se=ce[ie],Xe=se[0],_t=se[1];I.setAttribute(Xe,_t)}},re.createRect=function(I,F,ie){var ce=document.createElementNS("http://www.w3.org/2000/svg","rect");return ce.setAttribute("width",I.toString()),ce.setAttribute("height",F.toString()),ie&&re.setAttributes(ce,ie),ce},re.createLine=function(I,F,ie,ce,se){var Xe=document.createElementNS("http://www.w3.org/2000/svg","line");return Xe.setAttribute("x1",I.toString()),Xe.setAttribute("y1",F.toString()),Xe.setAttribute("x2",ie.toString()),Xe.setAttribute("y2",ce.toString()),se&&re.setAttributes(Xe,se),Xe},re.createPolygon=function(I,F){var ie=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ie.setAttribute("points",I),F&&re.setAttributes(ie,F),ie},re.createCircle=function(I,F){var ie=document.createElementNS("http://www.w3.org/2000/svg","circle");return ie.setAttribute("cx",(I/2).toString()),ie.setAttribute("cy",(I/2).toString()),ie.setAttribute("r",I.toString()),F&&re.setAttributes(ie,F),ie},re.createEllipse=function(I,F,ie){var ce=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ce.setAttribute("cx",(I/2).toString()),ce.setAttribute("cy",(F/2).toString()),ce.setAttribute("rx",(I/2).toString()),ce.setAttribute("ry",(F/2).toString()),ie&&re.setAttributes(ce,ie),ce},re.createGroup=function(I){var F=document.createElementNS("http://www.w3.org/2000/svg","g");return I&&re.setAttributes(F,I),F},re.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},re.createMarker=function(I,F,ie,ce,se,Xe,_t){var At=document.createElementNS("http://www.w3.org/2000/svg","marker");return re.setAttributes(At,[["id",I],["orient",F],["markerWidth",ie.toString()],["markerHeight",ce.toString()],["refX",se.toString()],["refY",Xe.toString()]]),At.appendChild(_t),At},re.createText=function(I){var F=document.createElementNS("http://www.w3.org/2000/svg","text");return F.setAttribute("x","0"),F.setAttribute("y","0"),I&&re.setAttributes(F,I),F},re.createTSpan=function(I,F){var ie=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ie.textContent=I,F&&re.setAttributes(ie,F),ie},re.createImage=function(I){var F=document.createElementNS("http://www.w3.org/2000/svg","image");return I&&re.setAttributes(F,I),F},re.createPoint=function(I,F){var ie=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ie.x=I,ie.y=F,ie},re.createPath=function(I,F){var ie=document.createElementNS("http://www.w3.org/2000/svg","path");return ie.setAttribute("d",I),F&&re.setAttributes(ie,F),ie},re}(),Ve=function(){function re(){}return re.addKey=function(I){re.key=I},Object.defineProperty(re,"isLicensed",{get:function(){return!!re.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(re.key)},enumerable:!1,configurable:!0}),re}(),Ne=function(){function re(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return re.prototype.rasterize=function(I,F,ie){var ce=this;return new Promise(function(se){var Xe=ie!==void 0?ie:document.createElement("canvas");I===null&&(ce.markersOnly=!0,ce.naturalSize=!1);var _t=document.createElementNS("http://www.w3.org/2000/svg","svg");_t.setAttribute("xmlns","http://www.w3.org/2000/svg"),_t.setAttribute("width",F.width.baseVal.valueAsString),_t.setAttribute("height",F.height.baseVal.valueAsString),_t.setAttribute("viewBox","0 0 "+F.viewBox.baseVal.width.toString()+" "+F.viewBox.baseVal.height.toString()),_t.innerHTML=F.innerHTML,ce.naturalSize===!0?(_t.width.baseVal.value=I.naturalWidth,_t.height.baseVal.value=I.naturalHeight):ce.width!==void 0&&ce.height!==void 0&&(_t.width.baseVal.value=ce.width,_t.height.baseVal.value=ce.height),Xe.width=_t.width.baseVal.value,Xe.height=_t.height.baseVal.value;var At=_t.outerHTML,Vt=Xe.getContext("2d");ce.markersOnly!==!0&&Vt.drawImage(I,0,0,Xe.width,Xe.height);var wt=window.URL,Ht=new Image(Xe.width,Xe.height);Ht.setAttribute("crossOrigin","anonymous");var en=new Blob([At],{type:"image/svg+xml"}),jn=wt.createObjectURL(en);Ht.onload=function(){Vt.drawImage(Ht,0,0),wt.revokeObjectURL(jn);var Dr=Xe.toDataURL(ce.imageType,ce.imageQuality);se(Dr)},Ht.src=jn})},re}(),Be=function(){},ze=function(){function re(I){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+I+"_"}return Object.defineProperty(re.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(re.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(re.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),re.prototype.addClass=function(I){return this.styleSheet===void 0&&this.addStyleSheet(),I.name=""+this.classNamePrefix+I.localName,this.classes.push(I),this.styleSheet.sheet.insertRule("."+I.name+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length),I},re.prototype.addRule=function(I){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(I),this.styleSheet.sheet.insertRule(I.selector+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length)},re.prototype.addStyleSheet=function(){var I;this.styleSheet=document.createElement("style"),((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).appendChild(this.styleSheet),this.addRule(new ye("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ye("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new ye("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new me("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new me("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},re.prototype.removeStyleSheet=function(){var I;this.styleSheet&&(((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},re}(),ye=function(re,I){this.selector=re,this.style=I},me=function(re,I){this.localName=re,this.style=I},We=function(){function re(I,F,ie,ce,se){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=I,this.displayMode=F,this.markerItems=ie,this.uiStyleSettings=ce,this.styles=se,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return re.prototype.show=function(I){var F=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=I,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var ie=document.createElement("div");ie.className=this.toolbarBlockStyleClass.name,ie.style.whiteSpace="nowrap",this.uiContainer.appendChild(ie),this.addActionButton(ie,'<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(ie,'<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(ie,'<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(ie,'<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(ie,'<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(ie,'<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(ie,'<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(ie,'<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 Xe=document.createElement("div");Xe.className=""+F.toolbarButtonStyleClass.name,Xe.setAttribute("data-type-name",se.typeName),Xe.innerHTML=se.icon,Xe.addEventListener("click",function(){F.markerToolbarButtonClicked(Xe,se)}),F.buttons.push(Xe),F.markerButtons.push(Xe)}),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 ce=document.createElement("div");ce.className=this.toolbarBlockStyleClass.name,ce.style.whiteSpace="nowrap",ce.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ce),this.addActionButton(ce,'<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(ce,'<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()},re.prototype.addButtonClickListener=function(I){this.buttonClickListeners.push(I)},re.prototype.removeButtonClickListener=function(I){this.buttonClickListeners.indexOf(I)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(I),1)},re.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},re.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var I=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var F=0;F<this.markerButtons.length;F++)F<I||F===I&&this.markerButtons.length-1===I?this.markerButtonBlock.appendChild(this.markerButtons[F]):(F===I&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[F]))}},re.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")},re.prototype.resetButtonStyles=function(){var I=this;this.buttons.forEach(function(F){F.className=F.className.replace(I.uiStyleSettings.toolbarButtonStyleColorsClassName?I.uiStyleSettings.toolbarButtonStyleColorsClassName:I.toolbarButtonStyleColorsClass.name,"").trim(),F.className=F.className.replace(I.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?I.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:I.toolbarActiveButtonStyleColorsClass.name,"").trim(),F.className+=" "+(I.uiStyleSettings.toolbarButtonStyleColorsClassName?I.uiStyleSettings.toolbarButtonStyleColorsClassName:I.toolbarButtonStyleColorsClass.name)})},re.prototype.addActionButton=function(I,F,ie){var ce=this,se=document.createElement("div");switch(se.className=""+this.toolbarButtonStyleClass.name,se.innerHTML=F,se.setAttribute("data-action",ie),se.addEventListener("click",function(){ce.actionToolbarButtonClicked(se,ie)}),ie){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}I.appendChild(se),this.buttons.push(se)},re.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new me("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 me("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new me("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new me("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 me("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var I=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new me("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
|
padding: `+I+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new me("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new me("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new ye("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new ye("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},re.prototype.markerToolbarButtonClicked=function(I,F){this.setActiveButton(I),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ie){return ie("marker",F)}),this.markerButtonOverflowBlock.style.display="none"},re.prototype.actionToolbarButtonClicked=function(I,F){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ie){return ie("action",F)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},re.prototype.setActiveButton=function(I){this.resetButtonStyles(),I.className=I.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),I.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},re.prototype.setActiveMarkerButton=function(I){var F=this.markerButtons.find(function(ie){return ie.getAttribute("data-type-name")===I});F&&this.setActiveButton(F)},re.prototype.setCurrentMarker=function(I){var F=this;this.currentMarker=I,this.buttons.filter(function(ie){return/delete|notes/.test(ie.getAttribute("data-action"))}).forEach(function(ie){F.currentMarker===void 0?(ie.style.fillOpacity="0.4",ie.style.pointerEvents="none"):(ie.style.fillOpacity="1",ie.style.pointerEvents="all")})},re}(),He=function(){function re(I,F,ie,ce){this.panels=[],this.panelButtons=[],this.markerjsContainer=I,this.displayMode=F,this.uiStyleSettings=ie,this.styles=ce,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return re.prototype.addStyles=function(){var I;this.toolboxStyleClass=this.styles.addClass(new me("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 me("toolbox_colors",`
|
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
|
`));var F=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new me("toolbox-button-row",`
|
|
|
display: flex;
|
|
|
cursor: default;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new me("toolbox-button-row_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new me("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 me("toolbox-panel-row_colors",`
|
|
|
background-color: `+((I=this.uiStyleSettings.toolboxBackgroundColor)!==null&&I!==void 0?I:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new me("toolbox_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*F)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*F)+`px;
|
|
|
padding: `+F+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new me("toolbox-button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new me("toolbox-active-button_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.styles.addRule(new ye("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new ye("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`))},re.prototype.show=function(I){var F;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=I,this.uiContainer.className=this.toolboxStyleClass.name+" "+((F=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&F!==void 0?F:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},re.prototype.setPanelButtons=function(I){var F,ie,ce=this;this.panels=I,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((F=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&F!==void 0?F:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ie=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ie!==void 0?ie:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(se){var Xe;se.uiStyleSettings=ce.uiStyleSettings;var _t=document.createElement("div");_t.className=ce.toolboxButtonStyleClass.name+" "+((Xe=ce.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Xe!==void 0?Xe:ce.toolboxButtonStyleColorsClass.name),_t.innerHTML=se.icon,_t.title=se.title,_t.addEventListener("click",function(){ce.panelButtonClick(se)}),ce.panelButtons.push(_t),ce.buttonRow.appendChild(_t)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},re.prototype.panelButtonClick=function(I){var F=this,ie=-1;if(I!==this.activePanel){ie=this.panels.indexOf(I),this.panelRow.innerHTML="";var ce=I.getUi();ce.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ce),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=I}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){F.displayMode==="inline"?F.panelRow.style.display="none":F.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(se,Xe){var _t,At;se.className=F.toolboxButtonStyleClass.name+" "+(Xe===ie?""+((_t=F.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&_t!==void 0?_t:F.toolboxActiveButtonStyleColorsClass.name):""+((At=F.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&At!==void 0?At:F.toolboxButtonStyleColorsClass.name))})},re}(),nt=function(re,I){this.title=re,this.icon=I},te=function(re){function I(F,ie,ce,se){var Xe=re.call(this,F,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 Xe.colors=[],Xe.addTransparent=!1,Xe.colorBoxes=[],Xe.colors=ie,Xe.currentColor=ce,Xe.setCurrentColor=Xe.setCurrentColor.bind(Xe),Xe.getColorBox=Xe.getColorBox.bind(Xe),Xe}return Oe(I,re),I.prototype.getUi=function(){var F=this,ie=document.createElement("div");return ie.style.overflow="hidden",ie.style.whiteSpace="nowrap",this.colors.forEach(function(ce){var se=F.getColorBox(ce);ie.appendChild(se),F.colorBoxes.push(se)}),ie},I.prototype.getColorBox=function(F){var ie=this,ce=this.uiStyleSettings.toolbarHeight/4,se=this.uiStyleSettings.toolbarHeight-ce,Xe=document.createElement("div");Xe.style.display="inline-block",Xe.style.boxSizing="content-box",Xe.style.width=se-2+"px",Xe.style.height=se-2+"px",Xe.style.padding="1px",Xe.style.marginRight="2px",Xe.style.marginBottom="2px",Xe.style.borderWidth="2px",Xe.style.borderStyle="solid",Xe.style.borderRadius=(se+2)/2+"px",Xe.style.borderColor=F===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Xe.addEventListener("click",function(){ie.setCurrentColor(F,Xe)});var _t=document.createElement("div");return _t.style.display="inline-block",_t.style.width=se-2+"px",_t.style.height=se-2+"px",_t.style.backgroundColor=F,_t.style.borderRadius=se/2+"px",F==="transparent"&&(_t.style.fill=this.uiStyleSettings.toolboxAccentColor,_t.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>`),Xe.appendChild(_t),Xe},I.prototype.setCurrentColor=function(F,ie){var ce=this;this.currentColor=F,this.colorBoxes.forEach(function(se){se.style.borderColor=se===ie?ce.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(F)},I}(nt),P=function(){function re(I,F,ie){this._state="new",this._isSelected=!1,this._container=I,this._overlayContainer=F,this.globalSettings=ie,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(re.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),re.prototype.ownsTarget=function(I){return!1},Object.defineProperty(re.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),re.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},re.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},re.prototype.pointerDown=function(I,F){},re.prototype.dblClick=function(I,F){},re.prototype.manipulate=function(I){},re.prototype.pointerUp=function(I){this.stateChanged()},re.prototype.dispose=function(){},re.prototype.addMarkerVisualToContainer=function(I){this.container.childNodes.length>0?this.container.insertBefore(I,this.container.childNodes[0]):this.container.appendChild(I)},re.prototype.getState=function(){return{typeName:re.typeName,state:this.state,notes:this.notes}},re.prototype.restoreState=function(I){this._state=I.state,this.notes=I.notes},re.prototype.scale=function(I,F){},re.prototype.colorChanged=function(I){this.onColorChanged&&this.onColorChanged(I),this.stateChanged()},re.prototype.fillColorChanged=function(I){this.onFillColorChanged&&this.onFillColorChanged(I),this.stateChanged()},re.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var I=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),I.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(I)&&this.onStateChanged(this)}},re.typeName="MarkerBase",re}(),U=function(){function re(){this.findGripByVisual=this.findGripByVisual.bind(this)}return re.prototype.findGripByVisual=function(I){return this.topLeft.ownsTarget(I)?this.topLeft:this.topCenter.ownsTarget(I)?this.topCenter:this.topRight.ownsTarget(I)?this.topRight:this.centerLeft.ownsTarget(I)?this.centerLeft:this.centerRight.ownsTarget(I)?this.centerRight:this.bottomLeft.ownsTarget(I)?this.bottomLeft:this.bottomCenter.ownsTarget(I)?this.bottomCenter:this.bottomRight.ownsTarget(I)?this.bottomRight:void 0},re}(),q=function(){function re(){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 re.prototype.ownsTarget=function(I){return I===this.visual||I===this.visual.childNodes[0]||I===this.visual.childNodes[1]},re}(),Y=function(){function re(){}return re.toITransformMatrix=function(I){return{a:I.a,b:I.b,c:I.c,d:I.d,e:I.e,f:I.f}},re.toSVGMatrix=function(I,F){return I.a=F.a,I.b=F.b,I.c=F.c,I.d=F.d,I.e=F.e,I.f=F.f,I},re}(),J=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||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 Oe(I,re),Object.defineProperty(I.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"visual",{get:function(){return this._visual},set:function(F){this._visual=F;var ie=xe.createTransform();this._visual.transform.baseVal.appendItem(ie)},enumerable:!1,configurable:!0}),I.prototype.ownsTarget=function(F){return!!re.prototype.ownsTarget.call(this,F)||!!(this.controlGrips.findGripByVisual(F)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(F))},I.prototype.pointerDown=function(F,ie){re.prototype.pointerDown.call(this,F,ie),this.state==="new"&&(this.left=F.x,this.top=F.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ce=this.unrotatePoint(F);if(this.manipulationStartX=ce.x,this.manipulationStartY=ce.y,this.offsetX=ce.x-this.left,this.offsetY=ce.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ie),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ie)){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 Xe=this.container.transform.baseVal.getItem(0);Xe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Xe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},I.prototype.pointerUp=function(F){var ie=this.state;re.prototype.pointerUp.call(this,F),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(F),this._state="select",ie==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},I.prototype.moveVisual=function(F){this.visual.style.transform="translate("+F.x+"px, "+F.y+"px)"},I.prototype.manipulate=function(F){var ie=this.unrotatePoint(F);this.state==="creating"?this.resize(F):this.state==="move"?(this.left=this.manipulationStartLeft+(ie.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ie.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ie):this.state==="rotate"&&this.rotate(F)},I.prototype.resize=function(F){var ie=this.manipulationStartLeft,ce=this.manipulationStartWidth,se=this.manipulationStartTop,Xe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ie=this.manipulationStartLeft+F.x-this.manipulationStartX,ce=this.manipulationStartWidth+this.manipulationStartLeft-ie;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ce=this.manipulationStartWidth+F.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:se=this.manipulationStartTop+F.y-this.manipulationStartY,Xe=this.manipulationStartHeight+this.manipulationStartTop-se;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Xe=this.manipulationStartHeight+F.y-this.manipulationStartY}ce>=0?(this.left=ie,this.width=ce):(this.left=ie+ce,this.width=-ce),Xe>=0?(this.top=se,this.height=Xe):(this.top=se+Xe,this.height=-Xe),this.setSize()},I.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},I.prototype.rotate=function(F){if(Math.abs(F.x-this.centerX)>.1){var ie=Math.sign(F.x-this.centerX);this.rotationAngle=180*Math.atan((F.y-this.centerY)/(F.x-this.centerX))/Math.PI+90*ie,this.applyRotation()}},I.prototype.applyRotation=function(){var F=this.container.transform.baseVal.getItem(0);F.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(F,0)},I.prototype.rotatePoint=function(F){if(this.rotationAngle===0)return F;var ie=this.container.getCTM(),ce=xe.createPoint(F.x,F.y);return{x:(ce=ce.matrixTransform(ie)).x,y:ce.y}},I.prototype.unrotatePoint=function(F){if(this.rotationAngle===0)return F;var ie=this.container.getCTM();ie=ie.inverse();var ce=xe.createPoint(F.x,F.y);return{x:(ce=ce.matrixTransform(ie)).x,y:ce.y}},I.prototype.select=function(){re.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},I.prototype.deselect=function(){re.prototype.deselect.call(this),this.controlBox.style.display="none"},I.prototype.setupControlBox=function(){this.controlBox=xe.createGroup();var F=xe.createTransform();F.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(F),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"},I.prototype.adjustControlBox=function(){var F=this.controlBox.transform.baseVal.getItem(0);F.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(F,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()},I.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()},I.prototype.createGrip=function(){var F=new q;return F.visual.transform.baseVal.appendItem(xe.createTransform()),this.controlBox.appendChild(F.visual),F},I.prototype.positionGrips=function(){var F=this.controlGrips.topLeft.GRIP_SIZE,ie=-F/2,ce=ie,se=(this.width+this.CB_DISTANCE)/2-F/2,Xe=(this.height+this.CB_DISTANCE)/2-F/2,_t=this.height+this.CB_DISTANCE-F/2,At=this.width+this.CB_DISTANCE-F/2;this.positionGrip(this.controlGrips.topLeft.visual,ie,ce),this.positionGrip(this.controlGrips.topCenter.visual,se,ce),this.positionGrip(this.controlGrips.topRight.visual,At,ce),this.positionGrip(this.controlGrips.centerLeft.visual,ie,Xe),this.positionGrip(this.controlGrips.centerRight.visual,At,Xe),this.positionGrip(this.controlGrips.bottomLeft.visual,ie,_t),this.positionGrip(this.controlGrips.bottomCenter.visual,se,_t),this.positionGrip(this.controlGrips.bottomRight.visual,At,_t),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,se,ce-3*this.CB_DISTANCE)},I.prototype.positionGrip=function(F,ie,ce){var se=F.transform.baseVal.getItem(0);se.setTranslate(ie,ce),F.transform.baseVal.replaceItem(se,0)},I.prototype.hideControlBox=function(){this.controlBox.style.display="none"},I.prototype.showControlBox=function(){this.controlBox.style.display=""},I.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)},re.prototype.getState.call(this))},I.prototype.restoreState=function(F){re.prototype.restoreState.call(this,F);var ie=F;this.left=ie.left,this.top=ie.top,this.width=ie.width,this.height=ie.height,this.rotationAngle=ie.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Y.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ie.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Y.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ie.containerTransformMatrix))},I.prototype.scale=function(F,ie){re.prototype.scale.call(this,F,ie);var ce=this.rotatePoint({x:this.left,y:this.top}),se=this.unrotatePoint({x:ce.x*F,y:ce.y*ie});this.left=se.x,this.top=se.y,this.width=this.width*F,this.height=this.height*ie,this.adjustControlBox()},I}(P),Ee=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||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 Oe(I,re),I.prototype.ownsTarget=function(F){return!(!re.prototype.ownsTarget.call(this,F)&&F!==this.visual)},I.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)},I.prototype.pointerDown=function(F,ie){re.prototype.pointerDown.call(this,F,ie),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},I.prototype.manipulate=function(F){re.prototype.manipulate.call(this,F)},I.prototype.resize=function(F){re.prototype.resize.call(this,F),this.setSize()},I.prototype.setSize=function(){re.prototype.setSize.call(this),xe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},I.prototype.pointerUp=function(F){re.prototype.pointerUp.call(this,F),this.setSize()},I.prototype.setStrokeColor=function(F){this.strokeColor=F,this.visual&&xe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(F),this.stateChanged()},I.prototype.setFillColor=function(F){this.fillColor=F,this.visual&&xe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},I.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.visual&&xe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},I.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.visual&&xe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},I.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},re.prototype.getState.call(this))},I.prototype.restoreState=function(F){var ie=F;this.fillColor=ie.fillColor,this.strokeColor=ie.strokeColor,this.strokeWidth=ie.strokeWidth,this.strokeDasharray=ie.strokeDasharray,this.opacity=ie.opacity,this.createVisual(),re.prototype.restoreState.call(this,F),this.setSize()},I.prototype.scale=function(F,ie){re.prototype.scale.call(this,F,ie),this.setSize()},I.title="Rectangle marker",I}(J),ke=function(re){function I(F,ie,ce,se){var Xe=re.call(this,F,se||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Xe.widths=[],Xe.widthBoxes=[],Xe.widths=ie,Xe.currentWidth=ce,Xe.setCurrentWidth=Xe.setCurrentWidth.bind(Xe),Xe}return Oe(I,re),I.prototype.getUi=function(){var F=this,ie=document.createElement("div");return ie.style.display="flex",ie.style.overflow="hidden",ie.style.flexGrow="2",this.widths.forEach(function(ce){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=ce===F.currentWidth?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentWidth(ce,se)}),ie.appendChild(se);var Xe=document.createElement("div");Xe.innerText=ce.toString(),Xe.style.marginRight="5px",se.appendChild(Xe);var _t=document.createElement("div");_t.style.minHeight="20px",_t.style.flexGrow="2",_t.style.display="flex",_t.style.alignItems="center";var At=document.createElement("hr");At.style.minWidth="20px",At.style.border="0px",At.style.borderTop=ce+"px solid "+F.uiStyleSettings.toolboxColor,At.style.flexGrow="2",_t.appendChild(At),se.appendChild(_t),F.widthBoxes.push(se)}),ie},I.prototype.setCurrentWidth=function(F,ie){var ce=this;this.currentWidth=F,this.widthBoxes.forEach(function(se){se.style.borderColor=se===ie?ce.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},I}(nt),ht=function(re){function I(F,ie,ce,se){var Xe=re.call(this,F,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 Xe.styles=[],Xe.styleBoxes=[],Xe.styles=ie,Xe.currentStyle=ce,Xe.setCurrentStyle=Xe.setCurrentStyle.bind(Xe),Xe}return Oe(I,re),I.prototype.getUi=function(){var F=this,ie=document.createElement("div");return ie.style.display="flex",ie.style.overflow="hidden",ie.style.flexGrow="2",this.styles.forEach(function(ce){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/F.styles.length-5+"%",se.style.borderColor=ce===F.currentStyle?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentStyle(ce,se)}),ie.appendChild(se);var Xe=document.createElement("div");Xe.style.minHeight="20px",Xe.style.flexGrow="2",Xe.style.overflow="hidden";var _t=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+F.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ce!==""?'stroke-dasharray="'+ce+'"':"")+` />
|
|
|
</svg>`;Xe.innerHTML=_t,se.appendChild(Xe),F.styleBoxes.push(se)}),ie},I.prototype.setCurrentStyle=function(F,ie){var ce=this;this.currentStyle=F,this.styleBoxes.forEach(function(se){se.style.borderColor=se===ie?ce.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},I}(nt),Ue=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||this;return se.strokeColor=ce.defaultColor,se.strokeWidth=ce.defaultStrokeWidth,se.strokeDasharray=ce.defaultStrokeDasharray,se.strokePanel=new te("Line color",ce.defaultColorSet,ce.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",ce.defaultStrokeWidths,ce.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new ht("Line style",ce.defaultStrokeDasharrays,ce.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Oe(I,re),Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var F=re.prototype.getState.call(this);return F.typeName=I.typeName,F},I.typeName="FrameMarker",I.title="Frame marker",I.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',I}(Ee),je=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},tt=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||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 Oe(I,re),I.prototype.ownsTarget=function(F){return!!re.prototype.ownsTarget.call(this,F)||!(!this.grip1.ownsTarget(F)&&!this.grip2.ownsTarget(F))},I.prototype.pointerDown=function(F,ie){re.prototype.pointerDown.call(this,F,ie),this.manipulationStartX=F.x,this.manipulationStartY=F.y,this.state==="new"&&(this.x1=F.x,this.y1=F.y,this.x2=F.x,this.y2=F.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(ie)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ie)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},I.prototype.pointerUp=function(F){var ie=this.state;re.prototype.pointerUp.call(this,F),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(F),this._state="select",ie==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},I.prototype.adjustVisual=function(){},I.prototype.manipulate=function(F){this.state==="creating"?this.resize(F):this.state==="move"?(this.x1=this.manipulationStartX1+F.x-this.manipulationStartX,this.y1=this.manipulationStartY1+F.y-this.manipulationStartY,this.x2=this.manipulationStartX2+F.x-this.manipulationStartX,this.y2=this.manipulationStartY2+F.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(F)},I.prototype.resize=function(F){switch(this.activeGrip){case this.grip1:this.x1=F.x,this.y1=F.y;break;case this.grip2:case void 0:this.x2=F.x,this.y2=F.y}this.adjustVisual(),this.adjustControlBox()},I.prototype.select=function(){re.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},I.prototype.deselect=function(){re.prototype.deselect.call(this),this.controlBox.style.display="none"},I.prototype.setupControlBox=function(){this.controlBox=xe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},I.prototype.adjustControlBox=function(){this.positionGrips()},I.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},I.prototype.createGrip=function(){var F=new q;return F.visual.transform.baseVal.appendItem(xe.createTransform()),this.controlBox.appendChild(F.visual),F},I.prototype.positionGrips=function(){var F=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-F/2,this.y1-F/2),this.positionGrip(this.grip2.visual,this.x2-F/2,this.y2-F/2)},I.prototype.positionGrip=function(F,ie,ce){var se=F.transform.baseVal.getItem(0);se.setTranslate(ie,ce),F.transform.baseVal.replaceItem(se,0)},I.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},re.prototype.getState.call(this))},I.prototype.restoreState=function(F){re.prototype.restoreState.call(this,F);var ie=F;this.x1=ie.x1,this.y1=ie.y1,this.x2=ie.x2,this.y2=ie.y2},I.prototype.scale=function(F,ie){re.prototype.scale.call(this,F,ie),this.x1=this.x1*F,this.y1=this.y1*ie,this.x2=this.x2*F,this.y2=this.y2*ie,this.adjustVisual(),this.adjustControlBox()},I}(P),dt=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||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=ce.defaultColor,se.strokeWidth=ce.defaultStrokeWidth,se.strokeDasharray=ce.defaultStrokeDasharray,se.strokePanel=new te("Line color",ce.defaultColorSet,ce.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",ce.defaultStrokeWidths,ce.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new ht("Line style",ce.defaultStrokeDasharrays,ce.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Oe(I,re),I.prototype.ownsTarget=function(F){return!(!re.prototype.ownsTarget.call(this,F)&&F!==this.visual&&F!==this.selectorLine&&F!==this.visibleLine)},I.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)},I.prototype.pointerDown=function(F,ie){re.prototype.pointerDown.call(this,F,ie),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},I.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()]]))},I.prototype.setStrokeColor=function(F){this.strokeColor=F,this.adjustVisual(),this.colorChanged(F)},I.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.adjustVisual()},I.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.adjustVisual(),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var F=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},re.prototype.getState.call(this));return F.typeName=I.typeName,F},I.prototype.restoreState=function(F){re.prototype.restoreState.call(this,F);var ie=F;this.strokeColor=ie.strokeColor,this.strokeWidth=ie.strokeWidth,this.strokeDasharray=ie.strokeDasharray,this.createVisual(),this.adjustVisual()},I.typeName="LineMarker",I.title="Line marker",I.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',I}(tt),qe=function(re){function I(F,ie,ce,se){var Xe=re.call(this,F,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 Xe.fonts=[],Xe.fontBoxes=[],Xe.fonts=ie,Xe.currentFont=ce,Xe.setCurrentFont=Xe.setCurrentFont.bind(Xe),Xe}return Oe(I,re),I.prototype.getUi=function(){var F=this,ie=document.createElement("div");return ie.style.overflow="hidden",ie.style.flexGrow="2",this.fonts.forEach(function(ce){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/F.fonts.length-5+"%",se.style.borderColor=ce===F.currentFont?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentFont(ce,se)}),ie.appendChild(se);var Xe=document.createElement("div");Xe.style.display="flex",Xe.style.minHeight="20px",Xe.style.flexGrow="2",Xe.style.fontFamily=ce,Xe.style.overflow="hidden";var _t=document.createElement("div");_t.style.whiteSpace="nowrap",_t.style.overflow="hidden",_t.style.textOverflow="ellipsis",_t.innerHTML="The quick brown fox jumps over the lazy dog",Xe.appendChild(_t),se.appendChild(Xe),F.fontBoxes.push(se)}),ie},I.prototype.setCurrentFont=function(F,ie){var ce=this;this.currentFont=F,this.fontBoxes.forEach(function(se){se.style.borderColor=se===ie?ce.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},I}(nt),Ye=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||this;return se.color="transparent",se.padding=5,se.DEFAULT_TEXT="your text here",se.text=se.DEFAULT_TEXT,se.isMoved=!1,se.color=ce.defaultColor,se.fontFamily=ce.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 te("Color",ce.defaultColorSet,ce.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.fontFamilyPanel=new qe("Font",ce.defaultFontFamilies,ce.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se}return Oe(I,re),I.prototype.ownsTarget=function(F){if(re.prototype.ownsTarget.call(this,F)||F===this.visual||F===this.textElement||F===this.bgRectangle)return!0;var ie=!1;return this.textElement.childNodes.forEach(function(ce){ce===F&&(ie=!0)}),ie},I.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()},I.prototype.pointerDown=function(F,ie){re.prototype.pointerDown.call(this,F,ie),this.isMoved=!1,this.pointerDownPoint=F,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},I.prototype.renderText=function(){var F=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(ie){F.textElement.appendChild(xe.createTSpan(ie.trim()===""?" ":ie.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},I.prototype.getTextScale=function(){var F=this.textElement.getBBox(),ie=1;if(F.width>0&&F.height>0){var ce=(1*this.width-this.width*this.padding*2/100)/F.width,se=(1*this.height-this.height*this.padding*2/100)/F.height;ie=Math.min(ce,se)}return ie},I.prototype.getTextPosition=function(F){var ie=this.textElement.getBBox(),ce=0,se=0;return ie.width>0&&ie.height>0&&(ce=(this.width-ie.width*F)/2,se=this.height/2-ie.height*F/2),{x:ce,y:se}},I.prototype.sizeText=function(){var F=this.textElement.getBBox(),ie=this.getTextScale(),ce=this.getTextPosition(ie);ce.y-=F.y*ie,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ce.x+"px, "+ce.y+"px) scale("+ie+", "+ie+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ce.x,ce.y),this.textElement.transform.baseVal.getItem(1).setScale(ie,ie))},I.prototype.manipulate=function(F){re.prototype.manipulate.call(this,F),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(F.x-this.pointerDownPoint.x)>5||Math.abs(F.y-this.pointerDownPoint.y)>5)},I.prototype.resize=function(F){re.prototype.resize.call(this,F),this.isMoved=!0,this.setSize(),this.sizeText()},I.prototype.setSize=function(){re.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()]]))},I.prototype.pointerUp=function(F){var ie=this.state;ie==="creating"&&(this._suppressMarkerCreateEvent=!0),re.prototype.pointerUp.call(this,F),this.setSize(),(ie==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},I.prototype.showTextEditor=function(){var F=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(ie){ie.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ie=Number.parseFloat(F.textEditor.style.fontSize);F.textEditor.clientWidth>=Number.parseInt(F.textEditor.style.maxWidth)&&ie>.9;)ie-=.1,F.textEditor.style.fontSize=Math.max(ie,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ie){ie.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ie){if(ie.clipboardData){var ce=ie.clipboardData.getData("text"),se=window.getSelection();if(!se.rangeCount)return!1;se.deleteFromDocument(),se.getRangeAt(0).insertNode(document.createTextNode(ce)),ie.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){F.textEditDivClicked(F.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},I.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var F=this.getTextScale(),ie=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ce=this.textElement.getBBox(),se={x:ce.width*F,y:ce.height*F};ie.x-=se.x/2,ie.y-=se.y/2,this.textEditor.style.top=ie.y+"px",this.textEditor.style.left=ie.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ie.x+"px",this.textEditor.style.fontSize=Math.max(16*F,12)+"px",this.textElement.style.display="none"}},I.prototype.textEditDivClicked=function(F){this.text=F.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},I.prototype.select=function(){re.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},I.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),re.prototype.deselect.call(this)},I.prototype.dblClick=function(F,ie){re.prototype.dblClick.call(this,F,ie),this.showTextEditor()},I.prototype.setColor=function(F){this.textElement&&xe.setAttributes(this.textElement,[["fill",F]]),this.color=F,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(F)},I.prototype.setFont=function(F){this.textElement&&xe.setAttributes(this.textElement,[["font-family",F]]),this.fontFamily=F,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},I.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},I.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var F=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},re.prototype.getState.call(this));return F.typeName=I.typeName,F},I.prototype.restoreState=function(F){var ie=F;this.color=ie.color,this.fontFamily=ie.fontFamily,this.padding=ie.padding,this.text=ie.text,this.createVisual(),re.prototype.restoreState.call(this,F),this.setSize()},I.prototype.scale=function(F,ie){re.prototype.scale.call(this,F,ie),this.setSize(),this.sizeText(),this.positionTextEditor()},I.typeName="TextMarker",I.title="Text marker",I.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>',I}(J),Fe=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||this;return se.color="transparent",se.lineWidth=3,se.drawing=!1,se.pixelRatio=1,se.color=ce.defaultColor,se.lineWidth=ce.defaultStrokeWidth,se.pixelRatio=ce.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 te("Color",ce.defaultColorSet,ce.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.lineWidthPanel=new ke("Line width",ce.defaultStrokeWidths,ce.defaultStrokeWidth),se.lineWidthPanel.onWidthChanged=se.setLineWidth,se}return Oe(I,re),I.prototype.ownsTarget=function(F){return!(!re.prototype.ownsTarget.call(this,F)&&F!==this.visual&&F!==this.drawingImage)},I.prototype.createVisual=function(){this.visual=xe.createGroup(),this.drawingImage=xe.createImage(),this.visual.appendChild(this.drawingImage);var F=xe.createTransform();this.visual.transform.baseVal.appendItem(F),this.addMarkerVisualToContainer(this.visual)},I.prototype.pointerDown=function(F,ie){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(F.x,F.y),this.drawing=!0):re.prototype.pointerDown.call(this,F,ie)},I.prototype.manipulate=function(F){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(F.x,F.y),this.canvasContext.stroke()):re.prototype.manipulate.call(this,F)},I.prototype.resize=function(F){re.prototype.resize.call(this,F),xe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),xe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},I.prototype.pointerUp=function(F){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):re.prototype.pointerUp.call(this,F)},I.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)},I.prototype.select=function(){this.state==="creating"&&this.finishCreation(),re.prototype.select.call(this)},I.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),re.prototype.deselect.call(this)},I.prototype.finishCreation=function(){for(var F=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ie=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ce=ie[0],se=ie[1],Xe=ie[2],_t=ie[3],At=!1,Vt=0;Vt<this.canvasElement.height;Vt++)for(var wt=0;wt<this.canvasElement.width;wt++)F.data[Vt*this.canvasElement.width*4+4*wt+3]>0&&(At=!0,Vt<se&&(se=Vt),wt<ce&&(ce=wt),Vt>_t&&(_t=Vt),wt>Xe&&(Xe=wt));if(At){this.left=ce/this.pixelRatio,this.top=se/this.pixelRatio,this.width=(Xe-ce)/this.pixelRatio,this.height=(_t-se)/this.pixelRatio;var Ht=document.createElement("canvas");Ht.width=Xe-ce,Ht.height=_t-se,Ht.getContext("2d").putImageData(this.canvasContext.getImageData(ce,se,Xe-ce,_t-se),0,0),this.drawingImgUrl=Ht.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},I.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})},I.prototype.setColor=function(F){this.color=F,this.colorChanged(F)},I.prototype.setLineWidth=function(F){this.lineWidth=F},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var F=Object.assign({drawingImgUrl:this.drawingImgUrl},re.prototype.getState.call(this));return F.typeName=I.typeName,F},I.prototype.restoreState=function(F){this.createVisual(),re.prototype.restoreState.call(this,F),this.drawingImgUrl=F.drawingImgUrl,this.setDrawingImage()},I.prototype.scale=function(F,ie){re.prototype.scale.call(this,F,ie),this.setDrawingImage()},I.typeName="FreehandMarker",I.title="Freehand marker",I.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>',I}(J),Ie=function(re){function I(F,ie,ce){var se=re.call(this,F,ce||'<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=ie,se.setCurrentType=se.setCurrentType.bind(se),se}return Oe(I,re),I.prototype.getUi=function(){var F=this,ie=document.createElement("div");ie.style.display="flex",ie.style.overflow="hidden",ie.style.flexGrow="2";for(var ce=function(_t){var At="both";switch(_t){case 0:At="both";break;case 1:At="start";break;case 2:At="end";break;case 3:At="none"}var Vt=document.createElement("div");if(Vt.style.display="flex",Vt.style.flexGrow="2",Vt.style.alignItems="center",Vt.style.justifyContent="space-between",Vt.style.padding="5px",Vt.style.borderWidth="2px",Vt.style.borderStyle="solid",Vt.style.borderColor=At===se.currentType?se.uiStyleSettings.toolboxAccentColor:"transparent",Vt.addEventListener("click",function(){F.setCurrentType(At,Vt)}),ie.appendChild(Vt),At==="both"||At==="start"){var wt=document.createElement("div");wt.style.display="flex",wt.style.alignItems="center",wt.style.minHeight="20px",wt.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>`,wt.style.marginLeft="5px",Vt.appendChild(wt)}var Ht=document.createElement("div");Ht.style.display="flex",Ht.style.alignItems="center",Ht.style.minHeight="20px",Ht.style.flexGrow="2";var en=document.createElement("hr");if(en.style.minWidth="20px",en.style.border="0px",en.style.borderTop="3px solid "+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee"),en.style.flexGrow="2",Ht.appendChild(en),Vt.appendChild(Ht),At==="both"||At==="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",Vt.appendChild(jn)}se.typeBoxes.push(Vt)},se=this,Xe=0;Xe<4;Xe++)ce(Xe);return ie},I.prototype.setCurrentType=function(F,ie){var ce=this;this.currentType=F,this.typeBoxes.forEach(function(se){se.style.borderColor=se===ie?ce.uiStyleSettings!==void 0?ce.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},I}(nt),Me=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||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 Ie("Arrow type","end"),se.arrowTypePanel.onArrowTypeChanged=se.setArrowType,se}return Oe(I,re),I.prototype.ownsTarget=function(F){return!(!re.prototype.ownsTarget.call(this,F)&&F!==this.arrow1&&F!==this.arrow2)},I.prototype.getArrowPoints=function(F,ie){var ce=this.arrowBaseWidth+2*this.strokeWidth,se=this.arrowBaseHeight+2*this.strokeWidth;return F-ce/2+","+(ie+se/2)+" "+F+","+(ie-se/2)+" "+(F+ce/2)+","+(ie+se/2)},I.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)},I.prototype.pointerDown=function(F,ie){re.prototype.pointerDown.call(this,F,ie),this.state==="creating"&&this.createTips()},I.prototype.adjustVisual=function(){if(re.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 F=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ie=this.arrow1.transform.baseVal.getItem(0);ie.setRotate(F,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ie,0);var ce=this.arrow2.transform.baseVal.getItem(0);ce.setRotate(F+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ce,0)}},I.prototype.setArrowType=function(F){this.arrowType=F,this.adjustVisual(),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var F=Object.assign({arrowType:this.arrowType},re.prototype.getState.call(this));return F.typeName=I.typeName,F},I.prototype.restoreState=function(F){re.prototype.restoreState.call(this,F);var ie=F;this.arrowType=ie.arrowType,this.createTips(),this.adjustVisual()},I.typeName="ArrowMarker",I.title="Arrow marker",I.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',I}(dt),be=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||this;return se.fillColor=ce.defaultFillColor,se.strokeWidth=0,se.fillPanel=new te("Color",ce.defaultColorSet,ce.defaultFillColor),se.fillPanel.onColorChanged=se.setFillColor,se}return Oe(I,re),Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var F=re.prototype.getState.call(this);return F.typeName=I.typeName,F},I.typeName="CoverMarker",I.title="Cover marker",I.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',I}(Ee),Te=function(re){function I(F,ie,ce,se){var Xe=re.call(this,F,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 Xe.opacities=[],Xe.opacityBoxes=[],Xe.opacities=ie,Xe.currentOpacity=ce,Xe.setCurrentOpacity=Xe.setCurrentOpacity.bind(Xe),Xe}return Oe(I,re),I.prototype.getUi=function(){var F=this,ie=document.createElement("div");return ie.style.display="flex",ie.style.overflow="hidden",ie.style.flexGrow="2",ie.style.justifyContent="space-between",this.opacities.forEach(function(ce){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=ce===F.currentOpacity?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentOpacity(ce,se)}),ie.appendChild(se);var Xe=document.createElement("div");Xe.innerText=100*ce+"%",se.appendChild(Xe),F.opacityBoxes.push(se)}),ie},I.prototype.setCurrentOpacity=function(F,ie){var ce=this;this.currentOpacity=F,this.opacityBoxes.forEach(function(se){se.style.borderColor=se===ie?ce.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},I}(nt),Le=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||this;return se.setOpacity=se.setOpacity.bind(se),se.fillColor=ce.defaultHighlightColor,se.strokeWidth=0,se.opacity=ce.defaultHighlightOpacity,se.fillPanel=new te("Color",ce.defaultColorSet,se.fillColor),se.fillPanel.onColorChanged=se.setFillColor,se.opacityPanel=new Te("Opacity",ce.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return Oe(I,re),I.prototype.setOpacity=function(F){this.opacity=F,this.visual&&xe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var F=re.prototype.getState.call(this);return F.typeName=I.typeName,F},I.typeName="HighlightMarker",I.title="Highlight marker",I.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>',I}(be),Ce='<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>',et=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||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=ce.defaultStrokeColor,se.bgColor=ce.defaultFillColor,se.fontFamily=ce.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 te("Text color",ce.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 te("Fill color",ce.defaultColorSet,se.bgColor,Ce),se.bgColorPanel.onColorChanged=se.setBgColor,se.fontFamilyPanel=new qe("Font",ce.defaultFontFamilies,ce.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 Oe(I,re),I.prototype.ownsTarget=function(F){return re.prototype.ownsTarget.call(this,F)||this.tipGrip.ownsTarget(F)||this.tip===F},I.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)},I.prototype.pointerDown=function(F,ie){this.state==="new"&&re.prototype.pointerDown.call(this,F,ie),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ie)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):re.prototype.pointerDown.call(this,F,ie)},I.prototype.pointerUp=function(F){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,re.prototype.pointerUp.call(this,F);else{var ie=this.state==="creating";re.prototype.pointerUp.call(this,F),this.setTipPoints(ie),this.positionTip()}},I.prototype.manipulate=function(F){if(this.tipMoving){var ie=this.unrotatePoint(F);this.tipPosition={x:ie.x-this.manipulationStartLeft,y:ie.y-this.manipulationStartTop},this.positionTip()}else re.prototype.manipulate.call(this,F)},I.prototype.setBgColor=function(F){this.bgRectangle&&this.tip&&(xe.setAttributes(this.bgRectangle,[["fill",F]]),xe.setAttributes(this.tip,[["fill",F]])),this.bgColor=F,this.fillColorChanged(F)},I.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},I.prototype.setTipPoints=function(F){F===void 0&&(F=!1);var ie=Math.min(this.height/2,15),ce=this.height/5;F&&(this.tipPosition={x:ie+ce/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))?(ce=this.width/5,ie=Math.min(this.width/2,15),this.tipBase1Position={x:ie,y:0},this.tipBase2Position={x:ie+ce,y:0}):(this.tipBase1Position={x:0,y:ie},this.tipBase2Position={x:0,y:ie+ce}):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))?(ce=this.width/5,ie=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ie-ce,y:0},this.tipBase2Position={x:this.width-ie,y:0}):(this.tipBase1Position={x:this.width,y:ie},this.tipBase2Position={x:this.width,y:ie+ce}):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))?(ce=this.width/5,ie=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ie-ce,y:this.height},this.tipBase2Position={x:this.width-ie,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-ie-ce},this.tipBase2Position={x:this.width,y:this.height-ie}):se<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ce=this.width/5,ie=Math.min(this.width/2,15),this.tipBase1Position={x:ie,y:this.height},this.tipBase2Position={x:ie+ce,y:this.height}):(this.tipBase1Position={x:0,y:this.height-ie},this.tipBase2Position={x:0,y:this.height-ie-ce})},I.prototype.resize=function(F){re.prototype.resize.call(this,F),this.positionTip()},I.prototype.positionTip=function(){xe.setAttributes(this.tip,[["points",this.getTipPoints()]]);var F=this.tipGrip.visual.transform.baseVal.getItem(0);F.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(F,0)},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),I.prototype.select=function(){this.positionTip(),re.prototype.select.call(this)},I.prototype.getState=function(){var F=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},re.prototype.getState.call(this));return F.typeName=I.typeName,F},I.prototype.restoreState=function(F){var ie=F;this.bgColor=ie.bgColor,this.tipPosition=ie.tipPosition,re.prototype.restoreState.call(this,F),this.createTip(),this.setTipPoints()},I.prototype.scale=function(F,ie){re.prototype.scale.call(this,F,ie),this.tipPosition={x:this.tipPosition.x*F,y:this.tipPosition.y*ie},this.positionTip()},I.typeName="CalloutMarker",I.title="Callout marker",I.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>',I}(Ye),Qe=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||this;return se.fillColor="transparent",se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.opacity=1,se.strokeColor=ce.defaultColor,se.strokeWidth=ce.defaultStrokeWidth,se.strokeDasharray=ce.defaultStrokeDasharray,se.fillColor=ce.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 te("Line color",_e(ce.defaultColorSet,["transparent"]),ce.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.fillPanel=new te("Fill color",_e(ce.defaultColorSet,["transparent"]),se.fillColor,Ce),se.fillPanel.onColorChanged=se.setFillColor,se.strokeWidthPanel=new ke("Line width",ce.defaultStrokeWidths,ce.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new ht("Line style",ce.defaultStrokeDasharrays,ce.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se.opacityPanel=new Te("Opacity",ce.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return Oe(I,re),I.prototype.ownsTarget=function(F){return!(!re.prototype.ownsTarget.call(this,F)&&F!==this.visual)},I.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)},I.prototype.pointerDown=function(F,ie){re.prototype.pointerDown.call(this,F,ie),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},I.prototype.manipulate=function(F){re.prototype.manipulate.call(this,F)},I.prototype.resize=function(F){re.prototype.resize.call(this,F),this.setSize()},I.prototype.setSize=function(){re.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()]])},I.prototype.pointerUp=function(F){re.prototype.pointerUp.call(this,F),this.setSize()},I.prototype.setStrokeColor=function(F){this.strokeColor=F,this.visual&&xe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(F),this.stateChanged()},I.prototype.setFillColor=function(F){this.fillColor=F,this.visual&&xe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(F),this.stateChanged()},I.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.visual&&xe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},I.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.visual&&xe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},I.prototype.setOpacity=function(F){this.opacity=F,this.visual&&xe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var F=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},re.prototype.getState.call(this));return F.typeName=I.typeName,F},I.prototype.restoreState=function(F){var ie=F;this.fillColor=ie.fillColor,this.strokeColor=ie.strokeColor,this.strokeWidth=ie.strokeWidth,this.strokeDasharray=ie.strokeDasharray,this.opacity=ie.opacity,this.createVisual(),re.prototype.restoreState.call(this,F),this.setSize()},I.prototype.scale=function(F,ie){re.prototype.scale.call(this,F,ie),this.setSize()},I.typeName="EllipseMarker",I.title="Ellipse marker",I.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>',I}(J),yt=function(re){function I(F,ie,ce){return re.call(this,F,ie,ce)||this}return Oe(I,re),Object.defineProperty(I.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),I.prototype.ownsTarget=function(F){return!(!re.prototype.ownsTarget.call(this,F)&&F!==this.tip1&&F!==this.tip2)},I.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)},I.prototype.pointerDown=function(F,ie){re.prototype.pointerDown.call(this,F,ie),this.state==="creating"&&this.createTips()},I.prototype.adjustVisual=function(){if(re.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 F=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ie=this.tip1.transform.baseVal.getItem(0);ie.setRotate(F,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ie,0);var ce=this.tip2.transform.baseVal.getItem(0);ce.setRotate(F+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ce,0)}},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var F=re.prototype.getState.call(this);return F.typeName=I.typeName,F},I.prototype.restoreState=function(F){re.prototype.restoreState.call(this,F),this.createTips(),this.adjustVisual()},I.typeName="MeasurementMarker",I.title="Measurement marker",I.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>',I}(dt),Dt=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||this;return se.strokePanel.colors=ce.defaultColorSet,se.fillColor="transparent",se}return Oe(I,re),Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var F=re.prototype.getState.call(this);return F.typeName=I.typeName,F},I.typeName="EllipseFrameMarker",I.title="Ellipse frame marker",I.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>',I}(Qe),Bt=function(){function re(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(re.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),re.prototype.addUndoStep=function(I){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(I)||(this.undoStack.push(I),JSON.stringify(this.lastRedoStep)!==JSON.stringify(I)&&this.redoStack.splice(0,this.redoStack.length))},re.prototype.replaceLastUndoStep=function(I){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=I)},re.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},re.prototype.undo=function(){if(this.undoStack.length>1){var I=this.undoStack.pop();return I!==void 0&&this.redoStack.push(I),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},re.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},re}(),Pt=function(re){function I(F,ie,ce){var se=re.call(this,F,ie,ce)||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=ce.defaultColor,se.strokeWidth=ce.defaultStrokeWidth,se.strokeDasharray=ce.defaultStrokeDasharray,se.strokePanel=new te("Line color",ce.defaultColorSet,ce.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",ce.defaultStrokeWidths,ce.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new ht("Line style",ce.defaultStrokeDasharrays,ce.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Oe(I,re),I.prototype.ownsTarget=function(F){return!(!re.prototype.ownsTarget.call(this,F)&&F!==this.visual&&F!==this.selectorCurve&&F!==this.visibleCurve&&!this.curveGrip.ownsTarget(F))},I.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},I.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)},I.prototype.pointerDown=function(F,ie){re.prototype.pointerDown.call(this,F,ie),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=F.x,this.curveY=F.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ie)&&(this.activeGrip=this.curveGrip,this._state="resize")},I.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()]]))},I.prototype.setupControlBox=function(){re.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)},I.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,re.prototype.addControlGrips.call(this)},I.prototype.positionGrips=function(){re.prototype.positionGrips.call(this);var F=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-F/2,this.curveY-F/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()))},I.prototype.manipulate=function(F){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+F.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+F.y-this.manipulationStartY),re.prototype.manipulate.call(this,F)},I.prototype.resize=function(F){this.activeGrip===this.curveGrip&&(this.curveX=F.x,this.curveY=F.y),re.prototype.resize.call(this,F),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},I.prototype.setStrokeColor=function(F){this.strokeColor=F,this.adjustVisual(),this.colorChanged(F)},I.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.adjustVisual()},I.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.adjustVisual()},I.prototype.scale=function(F,ie){this.curveX=this.curveX*F,this.curveY=this.curveY*ie,re.prototype.scale.call(this,F,ie)},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var F=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},re.prototype.getState.call(this));return F.typeName=I.typeName,F},I.prototype.restoreState=function(F){re.prototype.restoreState.call(this,F);var ie=F;this.strokeColor=ie.strokeColor,this.strokeWidth=ie.strokeWidth,this.strokeDasharray=ie.strokeDasharray,this.curveX=ie.curveX,this.curveY=ie.curveY,this.createVisual(),this.adjustVisual()},I.typeName="CurveMarker",I.title="Curve marker",I.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>',I}(tt),Rt=function(){function re(I,F){F===void 0&&(F=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=I,this.cancelable=F}return Object.defineProperty(re.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),re.prototype.preventDefault=function(){this._defaultPrevented=!0},re}(),st=function(re){function I(F,ie,ce){var se=re.call(this,F,!1)||this;return se.dataUrl=ie,se.state=ce,se}return Oe(I,re),I}(Rt),mt=function(re){function I(F,ie,ce){ce===void 0&&(ce=!1);var se=re.call(this,F,ce)||this;return se.marker=ie,se}return Oe(I,re),I}(Rt),lt=function(){function re(){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 re.prototype.addEventListener=function(I,F){this[I].push(F)},re.prototype.removeEventListener=function(I,F){var ie=this[I].indexOf(F);ie>-1&&this[I].splice(ie,1)},re}(),De=function(){function re(I){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new je,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 lt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=re.instanceCounter++,this.styles=new ze(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=I,this.targetRoot=document.body,this.width=I.clientWidth,this.height=I.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(re.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ue,Fe,Me,Ye,Dt,Qe,Le,et,yt,be,dt,Pt]},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ue,Fe,Me,Ye,Qe,Le,et]},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ue,Fe,Me,Ye,Le]},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(I){var F=this;this._availableMarkerTypes.splice(0),I.forEach(function(ie){if(typeof ie=="string"){var ce=F.ALL_MARKER_TYPES.find(function(se){return se.typeName===ie});ce!==void 0&&F._availableMarkerTypes.push(ce)}else F._availableMarkerTypes.push(ie)})},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(I){this._zoomLevel=I,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(re.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),re.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ve.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},re.prototype.show=function(){var I=this;this.styles.styleSheetRoot===void 0&&Be.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Be.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(F){return F(new Rt(I))})},re.prototype.render=function(){return we(this,void 0,void 0,function(){var I;return Pe(this,function(F){switch(F.label){case 0:return this.setCurrentMarker(),(I=new Ne).naturalSize=this.renderAtNaturalSize,I.imageType=this.renderImageType,I.imageQuality=this.renderImageQuality,I.markersOnly=this.renderMarkersOnly,I.width=this.renderWidth,I.height=this.renderHeight,[4,I.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return F.sent(),[4,I.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,F.sent()]}})})},re.prototype.close=function(I){var F=this;if(I===void 0&&(I=!1),this.isOpen){var ie=!1;I||this.eventListeners.beforeclose.forEach(function(ce){var se=new Rt(F,!0);ce(se),se.defaultPrevented&&(ie=!0)}),ie||(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(ce){return ce(new Rt(F))}),this.detachEvents(),this._isOpen=!1)}},re.prototype.addMarkersToToolbar=function(){for(var I,F=[],ie=0;ie<arguments.length;ie++)F[ie]=arguments[ie];(I=this._availableMarkerTypes).push.apply(I,F)},re.prototype.addRenderEventListener=function(I){this.addEventListener("render",function(F){I(F.dataUrl,F.state)})},re.prototype.removeRenderEventListener=function(I){},re.prototype.addCloseEventListener=function(I){this.addEventListener("close",function(){I()})},re.prototype.removeCloseEventListener=function(I){},re.prototype.setupResizeObserver=function(){var I=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){I.resize(I.target.clientWidth,I.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return I.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},re.prototype.onPopupTargetResize=function(){var I=1*this.target.clientWidth/this.target.clientHeight,F=this.editorCanvas.clientWidth/I>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*I:this.editorCanvas.clientWidth,ie=F<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/I;this.resize(F,ie)},re.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},re.prototype.resize=function(I,F){this._isResizing=!0;var ie=I/this.imageWidth,ce=F/this.imageHeight;this.imageWidth=Math.round(I),this.imageHeight=Math.round(F),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(ie,ce),this._isResizing=!1},re.prototype.scaleMarkers=function(I,F){var ie,ce=this;this._currentMarker&&this._currentMarker instanceof Ye?this._currentMarker.scale(I,F):(ie=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(se){se!==ce._currentMarker&&se.scale(I,F)}),ie!==void 0&&this.setCurrentMarker(ie)},re.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"},re.prototype.setTopLeft=function(){var I=this.editingTarget.getBoundingClientRect(),F=this.editorCanvas.getBoundingClientRect();this.left=I.left-F.left,this.top=I.top-F.top},re.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)},re.prototype.addDefs=function(){for(var I,F=[],ie=0;ie<arguments.length;ie++)F[ie]=arguments[ie];this.defs=xe.createDefs(),this.addDefsToImage(),(I=this.defs).append.apply(I,F)},re.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},re.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)},re.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},re.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},re.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)},re.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},re.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)},re.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 I=document.createElement("a");I.href="https://markerjs.com/",I.target="_blank",I.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>',I.title="Powered by marker.js",I.style.display="grid",I.style.alignItems="center",I.style.justifyItems="center",I.style.padding="3px",I.style.width="20px",I.style.height="20px",this.logoUI.appendChild(I),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},re.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")},re.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"},re.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},re.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 I=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=I+"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 We(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 He(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},re.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},re.prototype.removeMarker=function(I){this.markerImage.removeChild(I.container),this.markers.indexOf(I)>-1&&this.markers.splice(this.markers.indexOf(I),1),I.dispose()},re.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())},re.prototype.toolbarButtonClicked=function(I,F){if(I==="marker"&&F!==void 0)this.createNewMarker(F);else if(I==="action")switch(F){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()}},re.prototype.deleteSelectedMarker=function(){var I=this;if(this._currentMarker!==void 0){var F=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ce){var se=new mt(I,I._currentMarker,!0);ce(se),se.defaultPrevented&&(F=!0)}),!F){var ie=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(ce){return ce(new mt(I,ie))})}}},re.prototype.clear=function(){var I=this,F=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Xe){var _t=new mt(I,void 0,!0);Xe(_t),_t.defaultPrevented&&(F=!0)}),!F)){this.setCurrentMarker();for(var ie=function(Xe){var _t=ce.markers[Xe];ce.setCurrentMarker(ce.markers[Xe]),ce._currentMarker.dispose(),ce.markerImage.removeChild(ce._currentMarker.container),ce.markers.splice(ce.markers.indexOf(ce._currentMarker),1),ce.eventListeners.markerdelete.forEach(function(At){return At(new mt(I,_t))})},ce=this,se=this.markers.length-1;se>=0;se--)ie(se);this.addUndoStep()}},Object.defineProperty(re.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),re.prototype.showNotesEditor=function(){var I;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=(I=this._currentMarker.notes)!==null&&I!==void 0?I:"",this.overlayContainer.appendChild(this.notesArea))},re.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)},re.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},re.prototype.addUndoStep=function(){var I=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var F=this.getState(),ie=this.undoRedoManager.getLastUndoStep();if(!ie||ie.width===F.width&&ie.height===F.height){var ce=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(F),ce<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(se){return se(new Rt(I))})}else this.undoRedoManager.replaceLastUndoStep(F),this.eventListeners.statechange.forEach(function(se){return se(new Rt(I))})}},re.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},re.prototype.undoStep=function(){var I=this,F=this.undoRedoManager.undo();F!==void 0&&(this.restoreState(F),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ie){return ie(new Rt(I))}))},re.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},re.prototype.redoStep=function(){var I=this,F=this.undoRedoManager.redo();F!==void 0&&(this.restoreState(F),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ie){return ie(new Rt(I))}))},re.prototype.stepZoom=function(){var I=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=I<this.zoomSteps.length-1?this.zoomSteps[I+1]:this.zoomSteps[0]},re.prototype.panTo=function(I){this.contentDiv.scrollBy({left:this.prevPanPoint.x-I.x,top:this.prevPanPoint.y-I.y}),this.prevPanPoint=I},re.prototype.startRenderAndClose=function(){return we(this,void 0,void 0,function(){var I,F,ie=this;return Pe(this,function(ce){switch(ce.label){case 0:return[4,this.render()];case 1:return I=ce.sent(),F=this.getState(),this.eventListeners.render.forEach(function(se){return se(new st(ie,I,F))}),this.close(!0),[2]}})})},re.prototype.getState=function(I){I===!0&&this.setCurrentMarker();var F={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(ie){return F.markers.push(ie.getState())}),F},re.prototype.restoreState=function(I){var F=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);I.markers.forEach(function(ie){var ce=F._availableMarkerTypes.find(function(Xe){return Xe.typeName===ie.typeName});if(ce!==void 0){var se=F.addNewMarker(ce);se.restoreState(ie),F.markers.push(se)}}),I.width&&I.height&&(I.width!==this.imageWidth||I.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/I.width,this.imageHeight/I.height),this.eventListeners.restorestate.forEach(function(ie){return ie(new Rt(F))})},re.prototype.addNewMarker=function(I){var F=xe.createGroup();return this.markerImage.appendChild(F),new I(F,this.overlayContainer,this.settings)},re.prototype.createNewMarker=function(I){var F,ie=this;(F=typeof I=="string"?this._availableMarkerTypes.find(function(ce){return ce.typeName===I}):I)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(F),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(F.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ce){return ce(new mt(ie,ie._currentMarker))}))},re.prototype.markerCreated=function(I){var F=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(I),this.setCurrentMarker(I),I instanceof Fe&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Fe):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(ie){return ie(new mt(F,F._currentMarker))})},re.prototype.colorChanged=function(I){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=I,this.settings.defaultStrokeColor=I)},re.prototype.fillColorChanged=function(I){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=I)},re.prototype.markerStateChanged=function(I){var F=this;this.eventListeners.markerchange.forEach(function(ie){return ie(new mt(F,I))})},re.prototype.setCurrentMarker=function(I){var F=this;this._currentMarker!==I&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(ie){return ie(new mt(F,F._currentMarker))})),this._currentMarker=I,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(ie){return ie(new mt(F,F._currentMarker))}))},re.prototype.onPointerDown=function(I){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||I.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var F=this.markers.find(function(ie){return ie.ownsTarget(I.target)});F!==void 0?(this.setCurrentMarker(F),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(I.clientX,I.clientY),I.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:I.clientX,y:I.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(I.clientX,I.clientY))},re.prototype.onDblClick=function(I){if(this._isFocused||this.focus(),this.mode==="select"){var F=this.markers.find(function(ie){return ie.ownsTarget(I.target)});F!==void 0&&F!==this._currentMarker&&this.setCurrentMarker(F),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(I.clientX,I.clientY),I.target):this.setCurrentMarker()}},re.prototype.onPointerMove=function(I){this.touchPoints!==1&&I.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||I.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(I.clientX,I.clientY)):this.zoomLevel>1&&this.panTo({x:I.clientX,y:I.clientY}))},re.prototype.onPointerUp=function(I){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(I.clientX,I.clientY)),this.isDragging=!1,this.addUndoStep()},re.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},re.prototype.onKeyUp=function(I){this._currentMarker===void 0||this.notesArea!==void 0||I.key!=="Delete"&&I.key!=="Backspace"||this.deleteSelectedMarker()},re.prototype.clientToLocalCoordinates=function(I,F){var ie=this.markerImage.getBoundingClientRect();return{x:(I-ie.left)/this.zoomLevel,y:(F-ie.top)/this.zoomLevel}},re.prototype.onWindowResize=function(){this.positionUI()},re.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var I=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=I+"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()},re.prototype.addLicenseKey=function(I){Ve.addKey(I)},re.prototype.addEventListener=function(I,F){this.eventListeners.addEventListener(I,F)},re.prototype.removeEventListener=function(I,F){this.eventListeners.removeEventListener(I,F)},re.prototype.renderState=function(I){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(I),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(re.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),re.prototype.focus=function(){var I=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(F){return F(new Rt(I))}))},re.prototype.blur=function(){var I=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(F){return F(new Rt(I))}))},re.instanceCounter=0,re}();/* **********************************
|
|
|
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 Ke=function(re,I){return(Ke=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,ie){F.__proto__=ie}||function(F,ie){for(var ce in ie)Object.prototype.hasOwnProperty.call(ie,ce)&&(F[ce]=ie[ce])})(re,I)};function vt(re,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function F(){this.constructor=re}Ke(re,I),re.prototype=I===null?Object.create(I):(F.prototype=I.prototype,new F)}function ot(re,I,F,ie){return new(F||(F=Promise))(function(ce,se){function Xe(Vt){try{At(ie.next(Vt))}catch(wt){se(wt)}}function _t(Vt){try{At(ie.throw(Vt))}catch(wt){se(wt)}}function At(Vt){var wt;Vt.done?ce(Vt.value):(wt=Vt.value,wt instanceof F?wt:new F(function(Ht){Ht(wt)})).then(Xe,_t)}At((ie=ie.apply(re,I||[])).next())})}function Mt(re,I){var F,ie,ce,se,Xe={label:0,sent:function(){if(1&ce[0])throw ce[1];return ce[1]},trys:[],ops:[]};return se={next:_t(0),throw:_t(1),return:_t(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function _t(At){return function(Vt){return function(wt){if(F)throw new TypeError("Generator is already executing.");for(;Xe;)try{if(F=1,ie&&(ce=2&wt[0]?ie.return:wt[0]?ie.throw||((ce=ie.return)&&ce.call(ie),0):ie.next)&&!(ce=ce.call(ie,wt[1])).done)return ce;switch(ie=0,ce&&(wt=[2&wt[0],ce.value]),wt[0]){case 0:case 1:ce=wt;break;case 4:return Xe.label++,{value:wt[1],done:!1};case 5:Xe.label++,ie=wt[1],wt=[0];continue;case 7:wt=Xe.ops.pop(),Xe.trys.pop();continue;default:if(!(ce=Xe.trys,(ce=ce.length>0&&ce[ce.length-1])||wt[0]!==6&&wt[0]!==2)){Xe=0;continue}if(wt[0]===3&&(!ce||wt[1]>ce[0]&&wt[1]<ce[3])){Xe.label=wt[1];break}if(wt[0]===6&&Xe.label<ce[1]){Xe.label=ce[1],ce=wt;break}if(ce&&Xe.label<ce[2]){Xe.label=ce[2],Xe.ops.push(wt);break}ce[2]&&Xe.ops.pop(),Xe.trys.pop();continue}wt=I.call(re,Xe)}catch(Ht){wt=[6,Ht],ie=0}finally{F=ce=0}if(5&wt[0])throw wt[1];return{value:wt[0]?wt[1]:void 0,done:!0}}([At,Vt])}}}var Nt=function(){function re(){}return re.addKey=function(I){re.key=I},Object.defineProperty(re,"isLicensed",{get:function(){return!!re.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(re.key)},enumerable:!1,configurable:!0}),re}(),it=function(){function re(){}return re.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},re.setAttributes=function(I,F){for(var ie=0,ce=F;ie<ce.length;ie++){var se=ce[ie],Xe=se[0],_t=se[1];I.setAttribute(Xe,_t)}},re.createRect=function(I,F,ie){var ce=document.createElementNS("http://www.w3.org/2000/svg","rect");return ce.setAttribute("width",I.toString()),ce.setAttribute("height",F.toString()),ie&&re.setAttributes(ce,ie),ce},re.createLine=function(I,F,ie,ce,se){var Xe=document.createElementNS("http://www.w3.org/2000/svg","line");return Xe.setAttribute("x1",I.toString()),Xe.setAttribute("y1",F.toString()),Xe.setAttribute("x2",ie.toString()),Xe.setAttribute("y2",ce.toString()),se&&re.setAttributes(Xe,se),Xe},re.createPolygon=function(I,F){var ie=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ie.setAttribute("points",I),F&&re.setAttributes(ie,F),ie},re.createCircle=function(I,F){var ie=document.createElementNS("http://www.w3.org/2000/svg","circle");return ie.setAttribute("cx",(I/2).toString()),ie.setAttribute("cy",(I/2).toString()),ie.setAttribute("r",I.toString()),F&&re.setAttributes(ie,F),ie},re.createEllipse=function(I,F,ie){var ce=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ce.setAttribute("cx",(I/2).toString()),ce.setAttribute("cy",(F/2).toString()),ce.setAttribute("rx",(I/2).toString()),ce.setAttribute("ry",(F/2).toString()),ie&&re.setAttributes(ce,ie),ce},re.createGroup=function(I){var F=document.createElementNS("http://www.w3.org/2000/svg","g");return I&&re.setAttributes(F,I),F},re.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},re.createMarker=function(I,F,ie,ce,se,Xe,_t){var At=document.createElementNS("http://www.w3.org/2000/svg","marker");return re.setAttributes(At,[["id",I],["orient",F],["markerWidth",ie.toString()],["markerHeight",ce.toString()],["refX",se.toString()],["refY",Xe.toString()]]),At.appendChild(_t),At},re.createText=function(I){var F=document.createElementNS("http://www.w3.org/2000/svg","text");return F.setAttribute("x","0"),F.setAttribute("y","0"),I&&re.setAttributes(F,I),F},re.createTSpan=function(I,F){var ie=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ie.textContent=I,F&&re.setAttributes(ie,F),ie},re.createImage=function(I){var F=document.createElementNS("http://www.w3.org/2000/svg","image");return I&&re.setAttributes(F,I),F},re.createPoint=function(I,F){var ie=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ie.x=I,ie.y=F,ie},re.createPath=function(I,F){var ie=document.createElementNS("http://www.w3.org/2000/svg","path");return ie.setAttribute("d",I),F&&re.setAttributes(ie,F),ie},re.createElement=function(I,F){var ie=document.createElementNS("http://www.w3.org/2000/svg",I);return F&&re.setAttributes(ie,F),ie},re.getHollowRectanglePath=function(I,F,ie,ce,se,Xe,_t,At){return"M"+I+","+F+"V"+(F+ce)+"H"+(I+ie)+"V"+F+"H"+se+"V"+Xe+"H"+(se+_t)+"V"+(Xe+At)+"H"+se+"V"+F+"Z"},re}(),St=function(){function re(I){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+I+"_"}return Object.defineProperty(re.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(re.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(re.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),re.prototype.addClass=function(I){return this.styleSheet===void 0&&this.addStyleSheet(),I.name=""+this.classNamePrefix+I.localName,this.classes.push(I),this.styleSheet.sheet.insertRule("."+I.name+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length),I},re.prototype.addRule=function(I){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(I),this.styleSheet.sheet.insertRule(I.selector+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length)},re.prototype.addStyleSheet=function(){var I;this.styleSheet=document.createElement("style"),((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).appendChild(this.styleSheet),this.addRule(new Wt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Wt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new Wt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new Kt("_fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new Kt("_fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},re.prototype.removeStyleSheet=function(){var I;this.styleSheet&&(((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},re}(),Wt=function(re,I){this.selector=re,this.style=I},Kt=function(re,I){this.localName=re,this.style=I},tn=function(){function re(){this.blocks=[],this.display=""}return re.prototype.addButtonBlock=function(I){I.className=this.blockClassName,I.buttonClassName=this.buttonClassName,I.buttonColorsClassName=this.buttonColorsClassName,I.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(I)},re.prototype.addElementBlock=function(I){I.className===void 0&&(I.className=this.blockClassName),this.blocks.push(I)},re.prototype.getUI=function(){var I=document.createElement("div");return I.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,I.style.display=this.display,this.blocks.forEach(function(F){return I.appendChild(F.getUI())}),I},re}(),Re=function(){function re(){}return re.prototype.getUI=function(){var I=document.createElement("div");if(I.className=this.className,this.minWidth!==void 0&&(I.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":I.style.justifyContent="flex-start";break;case"center":I.style.justifyContent="center";break;case"end":I.style.justifyContent="flex-end"}return I.style.whiteSpace="nowrap",I},re}(),ve=function(re){function I(){var F=re!==null&&re.apply(this,arguments)||this;return F.buttons=[],F}return vt(I,re),I.prototype.addButton=function(F){F.className=this.buttonClassName,F.colorsClassName=this.buttonColorsClassName,F.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(F)},I.prototype.getUI=function(){var F=re.prototype.getUI.call(this);return this.buttons.forEach(function(ie){return F.appendChild(ie.getUI())}),F},I}(Re),z=function(){function re(I,F){this._isActive=!1,this._isHidden=!1,this._icon=I,this.title=F,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(re.prototype,"icon",{get:function(){return this._icon},set:function(I){this._icon=I,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"isActive",{get:function(){return this._isActive},set:function(I){this._isActive=I,this.adjustClassName()},enumerable:!1,configurable:!0}),re.prototype.getUI=function(){var I=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 I.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},re.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,"")))},re.prototype.hide=function(){this._isHidden=!0},re}(),Q=function(re){function I(){var F=re!==null&&re.apply(this,arguments)||this;return F.elements=[],F}return vt(I,re),I.prototype.addElement=function(F){this.elements.push(F)},I.prototype.getUI=function(){var F=re.prototype.getUI.call(this);return this.elements.forEach(function(ie){return F.appendChild(ie)}),F},I}(Re),ae=function(){function re(I,F){this.horizontal=I,this.vertical=F}return Object.defineProperty(re.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),re.prototype.getVerticalLength=function(I){return I/this.ratio},re.prototype.getHorizontalLength=function(I){return I*this.ratio},re}(),fe=function(){function re(){}return re.getIcon=function(I,F){if(I>0&&F>0){var ie=new ae(I,F),ce=ie.ratio>=1?20:ie.getHorizontalLength(20),se=ie.ratio<1?20:ie.getVerticalLength(20),Xe=document.createElementNS("http://www.w3.org/2000/svg","svg");Xe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Xe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Xe);var _t=it.createDefs();Xe.appendChild(_t);var At=it.createElement("clipPath",[["id","text-bg-clip"]]);_t.appendChild(At);var Vt=it.createPath(it.getHollowRectanglePath((24-ce)/2,(24-se)/2,ce,se,(24-ce)/2+2,(24-se)/2+2,ce-4,se-4));Xe.appendChild(Vt);var wt=it.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);wt.appendChild(it.createTSpan(I+":"+F)),Xe.appendChild(wt);var Ht=wt.getBBox();it.setAttributes(wt,[["x",((24-Ht.width)/2).toString()],["y",((24-Ht.height)/2-Ht.y).toString()]]);var en=it.createPath(it.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ht.width))/2,(24-Math.ceil(Ht.height))/2,Math.ceil(Ht.width),Math.ceil(Ht.height)));return At.appendChild(en),it.setAttributes(Vt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Xe),Xe.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>'},re}(),Ae=function(re){function I(F,ie,ce){var se=re.call(this,F,ie)||this;return se.isDropdownOpen=!1,se.onClick=se.dropdownButtonClicked,se.dropdownButtons=ce,se}return vt(I,re),I.prototype.setupDropdown=function(){var F=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ie){ie.className=F.className,ie.colorsClassName=F.colorsClassName,F.dropdownBlock.appendChild(ie.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},I.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},I.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},I.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},I.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},I.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},I}(z),Je=function(){function re(I,F){this.GRIP_SIZE=10,this.color=I,this.fillColor=F,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 re.prototype.ownsTarget=function(I){return I===this.visual||I===this.visual.childNodes[0]||I===this.visual.childNodes[1]},re.prototype.setCenter=function(I,F){this.visual.childNodes.forEach(function(ie){return it.setAttributes(ie,[["cx",I.toString()],["cy",F.toString()]])})},re}(),at=function(){function re(I,F,ie,ce){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=I,this.canvasHeight=F,this.margin=ie,this.container=ce,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(re.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(I){this._aspectRatio=I,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(I){this._isGridVisible=I,this.gridContainer&&it.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(I){this._zoomFactor=I,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),re.prototype.open=function(){var I=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 F=0;F<this.numberOfGridLines;F++)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(ie){return I.gridContainer.appendChild(ie)}),this.verticalGridLines.forEach(function(ie){return I.gridContainer.appendChild(ie)}),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()},re.prototype.setCropRectangle=function(I){this.cropRect=I;var F=Object.assign({},this.cropRect);this.zoomFactor!==1&&(F.width=this.cropRect.width*this.zoomFactor,F.height=this.cropRect.height*this.zoomFactor,F.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-F.width/2,F.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-F.height/2),it.setAttributes(this.cropRectElement,[["x",F.x.toString()],["y",F.y.toString()],["width",F.width.toString()],["height",F.height.toString()]]);var ie=F.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(se,Xe){var _t=F.y+ie*(Xe+1);it.setAttributes(se,[["x1",""+F.x],["y1",""+_t],["x2",""+(F.x+F.width)],["y2",""+_t]])});var ce=F.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(se,Xe){var _t=F.x+ce*(Xe+1);it.setAttributes(se,[["x1",""+_t],["y1",""+F.y],["x2",""+_t],["y2",""+(F.y+F.height)]])}),it.setAttributes(this.cropShadeElement,[["d",it.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,F.x,F.y,F.width,F.height)]]),this.topLeftGrip.setCenter(F.x,F.y),this.topRightGrip.setCenter(F.x+F.width,F.y),this.bottomLeftGrip.setCenter(F.x,F.y+F.height),this.bottomRightGrip.setCenter(F.x+F.width,F.y+F.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},re.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)},re.prototype.clientToLocalCoordinates=function(I,F){var ie=this.container.getBoundingClientRect();return{x:I-ie.left+this.margin,y:F-ie.top+this.margin}},re.prototype.onPointerDown=function(I){this.container.setPointerCapture(I.pointerId),this.previousPoint=this.clientToLocalCoordinates(I.clientX,I.clientY),this.cropRectElement===I.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(I.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(I.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(I.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(I.target)&&(this.activeGrip=this.bottomRightGrip)},re.prototype.onPointerMove=function(I){if(this.isMoving)this.move(this.clientToLocalCoordinates(I.clientX,I.clientY));else if(this.activeGrip){var F=this.clientToLocalCoordinates(I.clientX,I.clientY);this.resize(F)}I.preventDefault()},re.prototype.onPointerUp=function(I){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(I.pointerId)},re.prototype.move=function(I){var F=I.x-this.previousPoint.x,ie=I.y-this.previousPoint.y;this.zoomFactor!==1&&(F=-F/this.zoomFactor,ie=-ie/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+F),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ie),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=I},re.prototype.resize=function(I){var F=Object.assign({},this.cropRect),ie=I.x-this.previousPoint.x,ce=I.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:F.x+ie<this.margin&&(ie=this.margin-F.x),F.x+=ie,F.width=this.cropRect.x+this.cropRect.width-F.x;break;case this.bottomRightGrip:case this.topRightGrip:F.width+ie>this.canvasWidth*this.zoomFactor&&(ie=this.canvasWidth*this.zoomFactor-F.width),F.width+=ie}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(F.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ie),F.height=this.aspectRatio.getVerticalLength(F.width)):(F.y+=ce,F.height=this.cropRect.y+this.cropRect.height-F.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?F.height=this.aspectRatio.getVerticalLength(F.width):F.height+=ce}F.width<10&&(F.x=this.cropRect.x,F.width=10),F.height<10&&(F.y=this.cropRect.y,F.height=10),this.previousPoint=I,F.x>=this.margin&&F.y>=this.margin&&F.x-this.margin+F.width<=this.canvasWidth&&F.y-this.margin+F.height<=this.canvasHeight&&(this.cropRect=F,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},re.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var I=this.cropRect.x+this.cropRect.width/2,F=this.cropRect.y+this.cropRect.height/2,ie=this.aspectRatio.getHorizontalLength(this.cropRect.height),ce=this.aspectRatio.getVerticalLength(this.cropRect.width);ie/this.canvasWidth<ce/this.canvasHeight?this.cropRect.width=ie:this.cropRect.height=ce,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=I-this.cropRect.width/2,this.cropRect.y=F-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)}},re.prototype.getRescaledRect=function(I,F,ie,ce,se,Xe){var _t=ie/I,At=ce/F;return{x:(se.x-Xe)*_t+Xe,y:(se.y-Xe)*At+Xe,width:se.width*_t,height:se.height*At}},re.prototype.scaleCanvas=function(I,F){var ie=this.getRescaledRect(this.canvasWidth,this.canvasHeight,I,F,this.cropRect,this.margin);this.canvasWidth=I,this.canvasHeight=F,this.onCropChange&&this.onCropChange(ie),this.setCropRectangle(ie)},re}(),Lt=function(){function re(I){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=I,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(re.prototype,"angle",{get:function(){return this._angle},set:function(I){this._angle=I,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),re.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},re.prototype.onPointerDown=function(I){this.controlContainer.setPointerCapture(I.pointerId),this.isDragging=!0,this.previousPoint={x:I.clientX,y:I.clientY}},re.prototype.onPointerMove=function(I){this.isDragging&&(this.onAngleChange&&this.onAngleChange((I.clientX-this.previousPoint.x)/5),this.previousPoint.x=I.clientX)},re.prototype.onPointerUp=function(I){this.isDragging&&this.onAngleChange&&this.onAngleChange((I.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(I.pointerId)},re.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var I=this.angleLabelText.getBBox();it.setAttributes(this.angleLabelElement,[["x",((this.width-I.width)/2).toString()],["y",(this.height/2).toString()]])}},re.prototype.positionScaleShape=function(){if(this.scaleShape){var I=this.scaleShape.transform.baseVal.getItem(0);I.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(I,0)}},re.prototype.getVisual=function(){var I=document.createElementNS("http://www.w3.org/2000/svg","svg");I.setAttribute("xmlns","http://www.w3.org/2000/svg"),I.setAttribute("width",this.width+"px"),I.setAttribute("height",this.height+"px"),I.setAttribute("viewBox","0 0 "+this.width+" "+this.height),I.style.flexShrink="0",document.body.appendChild(I);for(var F="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ie=1;ie<=this.width/5+10;ie++){var ce=ie%5==0?this.height/3:this.height/6;F+="h4v"+-ce+"h1v"+ce}F+="v1H0Z",this.scaleShape=it.createPath(F);var se=it.createTransform();this.scaleShape.transform.baseVal.appendItem(se),I.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 Xe=it.createTSpan("");return Xe.innerHTML="°",this.angleLabelElement.appendChild(Xe),I.appendChild(this.angleLabelElement),document.body.removeChild(I),I},re}(),It=function(){function re(){this.naturalSize=!1,this.imageType="image/png"}return re.prototype.rasterize=function(I,F,ie,ce,se,Xe,_t){var At=this;return new Promise(function(Vt){var wt=document.createElement("canvas");wt.width=I.width.baseVal.value-2*ce,wt.height=I.height.baseVal.value-2*ce;var Ht=1,en=1;At.naturalSize===!0?(Ht=F.naturalWidth/(I.width.baseVal.value-2*ce)/Xe,en=F.naturalHeight/(I.height.baseVal.value-2*ce)/_t,wt.width=F.naturalWidth/Xe,wt.height=F.naturalHeight/_t):At.width!==void 0&&At.height!==void 0&&(Ht=At.width/ie.width,en=At.height/ie.height,wt.width*=Ht,wt.height*=en);var jn=wt.getContext("2d");jn.translate(wt.width/2,wt.height/2),jn.rotate(se*Math.PI/180),jn.scale(Xe,_t),jn.translate(-wt.width/2,-wt.height/2),jn.drawImage(F,0,0,wt.width,wt.height);var Dr=document.createElement("canvas");Dr.width=ie.width*Ht,Dr.height=ie.height*en,Dr.getContext("2d").putImageData(jn.getImageData((ie.x-ce)*Ht,(ie.y-ce)*en,ie.width*Ht,ie.height*en),0,0),Vt(Dr.toDataURL(At.imageType,At.imageQuality))})},re}(),ct=function(){function re(I){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=re.instanceCounter++,this.styles=new St(this.instanceNo),this.target=I,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(re.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(I){this._zoomToCropEnabled=I,I?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(I){this._isGridVisible=I,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"gridLines",{get:function(){return this._gridLines},set:function(I){this._gridLines=I,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(I){this._rotationAngle=I,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(re.prototype,"aspectRatio",{get:function(){var I;return(I=this._aspectRatio)!==null&&I!==void 0?I:this.aspectRatios[0]},set:function(I){this._aspectRatio=I},enumerable:!1,configurable:!0}),re.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},re.prototype.show=function(){this.showUI(),this.open()},re.prototype.close=function(I){I===void 0&&(I=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),I||this.closeEventListeners.forEach(function(F){return F()}),this._isOpen=!1)},re.prototype.addRenderEventListener=function(I){this.renderEventListeners.push(I)},re.prototype.removeRenderEventListener=function(I){this.renderEventListeners.indexOf(I)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(I),1)},re.prototype.addCloseEventListener=function(I){this.closeEventListeners.push(I)},re.prototype.removeCloseEventListener=function(I){this.closeEventListeners.indexOf(I)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(I),1)},re.prototype.setupResizeObserver=function(){var I=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){I.resize(I.target.clientWidth,I.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))},re.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var I=1*this.target.clientWidth/this.target.clientHeight,F=this.contentDiv.clientWidth/I>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*I:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ie=F+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/I;this.resize(F,ie)}},re.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},re.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"},re.prototype.resize=function(I,F){this.imageWidth=Math.round(I),this.imageHeight=Math.round(F),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()},re.prototype.setEditingTarget=function(){var I=document.createElement("canvas");I.width=this.target.naturalWidth,I.height=this.target.naturalHeight,I.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var F=I.toDataURL();it.setAttributes(this.editingTarget,[["href",F]]),this.setEditingTargetSize()},re.prototype.setTopLeft=function(){var I=this.target.getBoundingClientRect(),F=this.editorCanvas.getBoundingClientRect();this.left=I.left-F.left-this.CANVAS_MARGIN,this.top=I.top-F.top-this.CANVAS_MARGIN},re.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 I=it.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(I);var F=it.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(F),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)},re.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},re.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()},re.prototype.zoomToCrop=function(){if(this.cropRect){var I=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,F=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=I+"px "+F+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-I+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-F+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},re.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)},re.prototype.cropRectChanged=function(I){this.cropRect=I,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},re.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},re.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"},re.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},re.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 I=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,F=this.target.offsetTop>I+this.CANVAS_MARGIN?this.target.offsetTop-(I+this.CANVAS_MARGIN):0;this.coverDiv.style.top=F+"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},re.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},re.prototype.addTopToolbar=function(){var I=this;this.topToolbar=new tn,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 F=new ve;F.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(F);var ie=[];this.aspectRatios.forEach(function(en){var jn=new z(fe.getIcon(en.horizontal,en.vertical),en.horizontal===0&&en.vertical===0?"FREE":en.horizontal+":"+en.vertical);jn.onClick=function(){return I.ratioButtonClicked(en)},ie.push(jn)}),this.aspectRatioButton=new Ae(fe.getIcon(0,0),"Aspect ratio",ie),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,F.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ce=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");ce.isActive=this.isGridVisible,ce.onClick=function(){I.isGridVisible=!I.isGridVisible,ce.isActive=I.isGridVisible},F.addButton(ce);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(){I.zoomToCropEnabled=!I.zoomToCropEnabled,se.isActive=I.zoomToCropEnabled},F.addButton(se),!Nt.isLicensed){var Xe=new Q;this.topToolbar.addElementBlock(Xe);var _t=document.createElement("div");_t.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var At=document.createElement("a");At.style.color="currentColor",At.href="https://markerjs.com/products/cropro",At.target="_blank",At.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>',_t.appendChild(At),Xe.addElement(_t)}var Vt=new ve;Vt.minWidth=3*this.toolbarHeight+"px",Vt.contentAlign="end",this.topToolbar.addButtonBlock(Vt);var wt=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");wt.onClick=this.startRenderAndClose,Vt.addButton(wt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(wt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ht=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");Ht.onClick=this.close,Vt.addButton(Ht),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ht.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},re.prototype.addBottomToolbar=function(){var I=this;this.bottomToolbar=new tn,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 F=new ve;F.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(F);var ie=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");ie.onClick=this.rotateLeftButtonClicked,F.addButton(ie);var ce=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");ce.onClick=this.rotateRightButtonClicked,F.addButton(ce);var se=new Q;se.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(se),this.straightener=new Lt("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(Vt){I.rotateBy(Vt),I.straightener.angle=I.rotationAngle},se.addElement(this.straightener.getUI());var Xe=new ve;Xe.minWidth=2*this.toolbarHeight+"px",Xe.contentAlign="end",this.bottomToolbar.addButtonBlock(Xe);var _t=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");_t.onClick=this.flipHorizontallyButtonClicked,Xe.addButton(_t);var At=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");At.onClick=this.flipVerticallyButtonClicked,Xe.addButton(At)},re.prototype.ratioButtonClicked=function(I){this.aspectRatio=I,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},re.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=fe.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},re.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new ae(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},re.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},re.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},re.prototype.restoreState=function(I){if(I){var F=this.cropLayer.getRescaledRect(I.width,I.height,this.imageWidth,this.imageHeight,I.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(F),this.cropRectChanged(F),this.flippedHorizontally=I.flippedHorizontally,this.flippedVertically=I.flippedVertically,this.applyFlip(),this.rotationAngle=I.rotationAngle,this.applyRotation()}},re.prototype.clientToLocalCoordinates=function(I,F){var ie=this.cropImage.getBoundingClientRect();return{x:I-ie.left,y:F-ie.top}},re.prototype.onWindowResize=function(){this.positionUI()},re.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var I=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=I+"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()},re.prototype.rotateLeftButtonClicked=function(){var I=this.rotationAngle-90;this.rotationAngle%90!=0&&(I+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(I)},re.prototype.rotateRightButtonClicked=function(){var I=this.rotationAngle+90;this.rotationAngle%90!=0&&(I-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(I)},re.prototype.rotateTo=function(I){I=(I=I>180?I-360:I)<=-180?I+360:I,this.rotationAngle=I,this.applyRotation()},re.prototype.rotateBy=function(I){this.rotateTo((this.rotationAngle+I)%360)},re.prototype.applyRotation=function(){var I=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var F=this.editingTargetRotationContainer.transform.baseVal.getItem(0);F.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(F,0);var ie=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ie.width,this.imageHeight/ie.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=I},re.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},re.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},re.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},re.prototype.startRenderAndClose=function(){return ot(this,void 0,void 0,function(){var I,F;return Mt(this,function(ie){switch(ie.label){case 0:return[4,this.render()];case 1:return I=ie.sent(),F=this.getState(),this.renderEventListeners.forEach(function(ce){return ce(I,F)}),this.close(!0),[2]}})})},re.prototype.render=function(){return ot(this,void 0,void 0,function(){var I;return Mt(this,function(F){switch(F.label){case 0:return(I=new It).naturalSize=this.renderAtNaturalSize,I.imageType=this.renderImageType,I.imageQuality=this.renderImageQuality,I.width=this.renderWidth,I.height=this.renderHeight,this.unzoomFromCrop(),it.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,I.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 F.sent(),[4,I.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,F.sent()]}})})},re.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Kt("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 Kt("toolbar_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Kt("toolbar-block",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
box-sizing: content-box;
|
|
|
`));var I=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Kt("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.toolbarHeight-2*I)+`px;
|
|
|
height: `+(this.toolbarHeight-2*I)+`px;
|
|
|
padding: `+I+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Kt("toolbar_button_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Kt("toolbar_active_button",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
|
`)),this.styles.addRule(new Wt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new Wt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Kt("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 Kt("toolbar_dropdown_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Kt("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 Kt("toolbar_straightener",`
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
|
justify-content: center;
|
|
|
height: `+(this.toolbarHeight-2*I)+`px;
|
|
|
padding: `+I+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Kt("toolbar_straightener_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`))},re.instanceCounter=0,re}(),kt=H("8hTe"),nn=H.n(kt),Ot=/<pre[^>]*>/g;function un(re){var I=document.createElement("div");return I.innerHTML=re,I.childNodes.length===0?"":I.childNodes[0].nodeValue}var an=$e.a=function(re){var I=re.value,F=I===void 0?"":I,ie=re.edit,ce=ie===void 0?!1:ie,se=re.className,Xe=re.showTextOnly,_t=re.showLines,At=re.replaces,Vt=re.zoomImg,wt=re.hasMask,Ht=re.style,en=Ht===void 0?{}:Ht,jn=re.stylesPrev,Dr=jn===void 0?{}:jn,wr=String(F),Nn=Object(p.useRef)(),hr=Object(p.useRef)(),mi=Object(p.useState)(""),Ar=Object(T.a)(mi,2),yr=Ar[0],pr=Ar[1],Yr=Object(p.useState)("office"),Mr=Object(T.a)(Yr,2),Zr=Mr[0],Cr=Mr[1],gi=function(){var Sn=new ct(hr.current);Sn.displayMode="popup",Sn.addRenderEventListener(function(){var Er=Object(S.a)(h.a.mark(function Kn(Lr){var rr;return h.a.wrap(function(kr){for(;;)switch(kr.prev=kr.next){case 0:return Nn.current.style.display="none",kr.next=3,Object(ue.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Lr}});case 3:rr=kr.sent,rr!=null&&rr.id&&At(hr.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(rr==null?void 0:rr.id,"?type=").concat(rr.content_type));case 5:case"end":return kr.stop()}},Kn)}));return function(Kn){return Er.apply(this,arguments)}}()),Sn.show()},li=function(){var Sn=new De(hr.current);Sn.settings.displayMode="popup",Sn.addEventListener("render",function(){var Er=Object(S.a)(h.a.mark(function Kn(Lr){var rr;return h.a.wrap(function(kr){for(;;)switch(kr.prev=kr.next){case 0:if(Nn.current.style.display="none",!hr.current){kr.next=6;break}return kr.next=4,Object(ue.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Lr.dataUrl}});case 4:rr=kr.sent,rr!=null&&rr.id&&At(hr.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(rr==null?void 0:rr.id,"?type=").concat(rr.content_type));case 6:case"end":return kr.stop()}},Kn)}));return function(Kn){return Er.apply(this,arguments)}}()),Sn.show(),window.markerArea=Sn},zr=Object(p.useMemo)(function(){try{var Fn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Sn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Er=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;wr=wr.replace(Fn,"("+ne.a.API_SERVER+"/api/attachments/").replace(Sn,'"'+ne.a.API_SERVER+"/api/attachments/").replace(Er,'"'+ne.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,`
|
|
|
`),wr=wr.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
|
`)}catch(Ri){}var Kn=oe(wr),Lr=A();if(wr.match(/\[TOC\]/)&&(Kn=Kn.replace("<p>[TOC]</p>",_()),v()),Kn=Kn.replace(/(__special_katext_id_\d+__)/g,function(Ri,kr){var ni=Lr[kr],ji=ni.type,ui=ni.expression;return Object($.renderToString)(un(ui)||"",{displayMode:ji==="block",throwOnError:!1,output:"html"})}),Kn=Kn.replace(/▁/g,"\u2581\u2581\u2581"),O(),Xe){var rr=document.createElement("div");return rr.innerHTML=Kn,rr.innerText}return setTimeout(function(){return vi()},500),Kn},[wr]),Kr=Object(p.useRef)();g.WebkitLineClamp=_t,_t&&(en=Object(k.a)(Object(k.a)({},en),g));function xi(Fn){var Sn=Fn.target;if(Sn.tagName.toUpperCase()==="IMG"){if(Vt){var Er=Sn.getAttribute("src");pr(Er),Cr("image")}}else if(Sn.tagName.toUpperCase()==="A"){var Kn=Sn.getAttribute("href");if(Kn.indexOf("office")>-1)Fn.preventDefault(),pr(Kn),Cr("office");else if(Kn.indexOf("application/pdf")>-1)Fn.preventDefault(),pr(Kn),Cr("pdf");else if(Kn.indexOf("type=text")>-1)Fn.preventDefault(),pr(Kn),Cr("html");else if(Kn.startsWith("#")){Fn.preventDefault();var Lr=document.getElementById(Kn.replace("#",""));Lr&&Lr.scrollIntoView(!0)}}}var vi=function(){var Sn,Er=(Sn=Kr.current)===null||Sn===void 0?void 0:Sn.querySelectorAll("video");Er==null||Er.forEach(function(Kn){if(Kn.oncontextmenu=function(){return!1},Kn.src.indexOf(".m3u8")>-1&&!Kn.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var Lr=new V.a;Lr.loadSource(Kn.src),Lr.attachMedia(Kn)}}})};Object(p.useEffect)(function(){if(Kr.current&&zr&&(zr.match(Ot)&&window.PR.prettyPrint()),Kr.current)return Kr.current.addEventListener("click",xi),function(){Kr.current.removeEventListener("click",xi),O(),v()}},[zr,Kr.current,xi]);var Si=function(Sn){if(!ce)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 c.a.createElement("div",{style:{position:"relative"}},c.a.createElement("div",{ref:Kr,style:Object(k.a)({},en),className:"".concat(se||""," markdown-body ").concat(nn.a.mdBody),onMouseOver:Si,dangerouslySetInnerHTML:{__html:zr}}),c.a.createElement("div",{ref:Nn,className:nn.a.button},c.a.createElement(ee.a,null,c.a.createElement(w.a,{onClick:function(){return gi()}},"\u88C1\u526A"),c.a.createElement(w.a,{onClick:function(){return li()}},"\u7F16\u8F91"))),c.a.createElement("img",{ref:hr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),c.a.createElement(Z.a,{close:!0,data:yr,hasMask:wt,type:yr!=null&&yr.length?Zr:"",style:Object(k.a)({},Dr),onClose:function(){return pr("")}}))}},"9VGf":function(rt,$e,H){"use strict";H.d($e,"a",function(){return j});var de=H("q1tI"),ee=H.n(de);function j(w,k){var S=Object(de.useRef)();Object(de.useEffect)(function(){S.current=w}),Object(de.useEffect)(function(){function T(){S.current()}if(k!==null){var C=setInterval(T,k);return function(){return clearInterval(C)}}},[k])}},AMnG:function(rt,$e,H){"use strict";var de=H("miYZ"),ee=H("tsqr"),j=H("tJVT"),w=H("q1tI"),k=H.n(w),S=H("nWbc"),T=H.n(S),C=H("Ot1p");$e.a=function(h){var p=h.id,c=h.activeDiscussIndex,l=h.onReplyDiscuss,a=Object(w.useState)(""),u=Object(j.a)(a,2),s=u[0],f=u[1];function i(t){f(t)}function n(){if(!s){ee.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}l(p,s),f("")}return k.a.createElement("div",{key:p,className:"discuss-item-editor",style:{display:c===p?"block":"none",width:"100%"}},k.a.createElement(C.a,{miniToolbar:!0,startInit:c===p,defaultValue:s,id:p,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:i}),k.a.createElement("a",{onClick:n,className:"btn-send"},"\u53D1\u9001"))}},Aky1:function(rt,$e,H){"use strict";H.d($e,"a",function(){return h});var de=H("ErOA"),ee=H("ppsT"),j=H.n(ee),w="",k,S="";function T(p){C(p)}function C(p){k=new j.a.Vod({timeout:6e4,partSize:1048576,parallel:5,retryCount:3,retryDuration:2,region:"ap-southeast-1",userId:1829848226361863,enableUploadProgress:!1,addFileSuccess:function(l){console.log("addFileSuccess: "+l.file.name),p.addFileSuccess&&p.addFileSuccess(l),k.startUpload()},onUploadstarted:function(l){var a=l.file.name;if(l.videoId){var f="/api/users/".concat(w,"/video_auths.json");Object(de.a)(f,{method:"put",body:{video_id:l.videoId,title:a,file_name:a,virtual_classroom_id:S}}).then(function(i){if(i.status==-1){p.onUploadError&&p.onUploadError(l);return}var n=i.data,t=n.UploadAuth,d=n.UploadAddress,v=n.VideoId;k.setUploadAuthAndAddress(l,t,d)}).catch(function(i){k.deleteFile(k._curIndex),k.nextUpload(),console.log(i)})}else{var u="/api/users/".concat(w,"/video_auths.json"),s="";Object(de.a)(u,{method:"Post",body:{title:s+a,file_name:s+a,virtual_classroom_id:S}}).then(function(i){if(i){var n=i.data,t=n.UploadAuth,d=n.UploadAddress,v=n.VideoId;k.setUploadAuthAndAddress(l,t,d,v)}}).catch(function(i){k.deleteFile(k._curIndex),k.nextUpload(),console.log(i)}),console.log("\u6587\u4EF6\u5F00\u59CB\u4E0A\u4F20...")}},onUploadSucceed:function(l){p.onUploadSucceed&&p.onUploadSucceed(l),console.log("\u6587\u4EF6\u4E0A\u4F20\u6210\u529F!")},onUploadFailed:function(l,a,u){p.onUploadFailed&&p.onUploadFailed(l),console.log("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25!")},onUploadCanceled:function(l,a,u){console.log("\u6587\u4EF6\u4E0A\u4F20\u5DF2\u6682\u505C!")},onUploadProgress:function(l,a,u){p.onUploadProgress&&p.onUploadProgress(l,a,u);var s=Math.ceil(u*100);console.log("\u6587\u4EF6\u4E0A\u4F20\u4E2D...")},onUploadTokenExpired:function(l){console.log("\u6587\u4EF6\u4E0A\u4F20\u8D85\u65F6!");var a="/api/users/".concat(w,"/video_auths.json");Object(de.a)(a,{method:"put",body:{video_id:l.videoId}}).then(function(u){var s=u.data,f=s.UploadAuth;k.resumeUploadWithAuth(f)}).catch(function(u){console.log(u)})},onUploadEnd:function(l){p.onUploadEnd&&p.onUploadEnd(l),console.log("onUploadEnd: uploaded all the files")}}),p.gotUploader&&p.gotUploader(k)}function h(p,c,l){p&&(w=p),c&&(S=c),T(l)}},BU3w:function(rt,$e,H){"use strict";H.d($e,"a",function(){return S});var de=H("MNnm"),ee="rc-util-key";function j(T){if(T.attachTo)return T.attachTo;var C=document.querySelector("head");return C||document.body}function w(T){var C,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(de.a)())return null;var p=document.createElement("style");if((C=h.csp)===null||C===void 0?void 0:C.nonce){var c;p.nonce=(c=h.csp)===null||c===void 0?void 0:c.nonce}p.innerHTML=T;var l=j(h),a=l.firstChild;return h.prepend&&l.prepend?l.prepend(p):h.prepend&&a?l.insertBefore(p,a):l.appendChild(p),p}var k=new Map;function S(T,C){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=j(h);if(!k.has(p)){var c=w("",h),l=c.parentNode;k.set(p,l),l.removeChild(c)}var a=Array.from(k.get(p).children).find(function(n){return n.tagName==="STYLE"&&n[ee]===C});if(a){var u,s;if(((u=h.csp)===null||u===void 0?void 0:u.nonce)&&a.nonce!==((s=h.csp)===null||s===void 0?void 0:s.nonce)){var f;a.nonce=(f=h.csp)===null||f===void 0?void 0:f.nonce}return a.innerHTML!==T&&(a.innerHTML=T),a}var i=w(T,h);return i[ee]=C,i}},Bd2K:function(rt,$e,H){(function(de){de(H("VrN/"),H("osHv"))})(function(de){de.defineOption("autoCloseTags",!1,function(h,p,c){if(c!=de.Init&&c&&h.removeKeyMap("autoCloseTags"),!p)return;var l={name:"autoCloseTags"};(typeof p!="object"||p.whenClosing!==!1)&&(l["'/'"]=function(a){return S(a)}),(typeof p!="object"||p.whenOpening!==!1)&&(l["'>'"]=function(a){return w(a)}),h.addKeyMap(l)});var ee=["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 w(h){if(h.getOption("disableInput"))return de.Pass;for(var p=h.listSelections(),c=[],l=h.getOption("autoCloseTags"),a=0;a<p.length;a++){if(!p[a].empty())return de.Pass;var u=p[a].head,s=h.getTokenAt(u),f=de.innerMode(h.getMode(),s.state),i=f.state,n=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(i),t=n&&n.name;if(!t)return de.Pass;var d=f.mode.configuration=="html",v=typeof l=="object"&&l.dontCloseTags||d&&ee,g=typeof l=="object"&&l.indentTags||d&&j;s.end>u.ch&&(t=t.slice(0,t.length-s.end+u.ch));var b=t.toLowerCase();if(!t||s.type=="string"&&(s.end!=u.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&n.close||s.string.indexOf("/")==u.ch-s.start-1||v&&T(v,b)>-1||C(h,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(i)||[],t,u,!0))return de.Pass;var _=typeof l=="object"&&l.emptyTags;if(_&&T(_,t)>-1){c[a]={text:"/>",newPos:de.Pos(u.line,u.ch+2)};continue}var m=g&&T(g,b)>-1;c[a]={indent:m,text:">"+(m?`
|
|
|
|
|
|
`:"")+"</"+t+">",newPos:m?de.Pos(u.line+1,0):de.Pos(u.line,u.ch+1)}}for(var y=typeof l=="object"&&l.dontIndentOnAutoClose,a=p.length-1;a>=0;a--){var E=c[a];h.replaceRange(E.text,p[a].head,p[a].anchor,"+insert");var o=h.listSelections().slice(0);o[a]={head:E.newPos,anchor:E.newPos},h.setSelections(o),!y&&E.indent&&(h.indentLine(E.newPos.line,null,!0),h.indentLine(E.newPos.line+1,null,!0))}}function k(h,p){for(var c=h.listSelections(),l=[],a=p?"/":"</",u=h.getOption("autoCloseTags"),s=typeof u=="object"&&u.dontIndentOnSlash,f=0;f<c.length;f++){if(!c[f].empty())return de.Pass;var i=c[f].head,n=h.getTokenAt(i),t=de.innerMode(h.getMode(),n.state),d=t.state;if(p&&(n.type=="string"||n.string.charAt(0)!="<"||n.start!=i.ch-1))return de.Pass;var v,g=t.mode.name!="xml"&&h.getMode().name=="htmlmixed";if(g&&t.mode.name=="javascript")v=a+"script";else if(g&&t.mode.name=="css")v=a+"style";else{var b=t.mode.xmlCurrentContext&&t.mode.xmlCurrentContext(d);if(!b||b.length&&C(h,b,b[b.length-1],i))return de.Pass;v=a+b[b.length-1]}h.getLine(i.line).charAt(n.end)!=">"&&(v+=">"),l[f]=v}if(h.replaceSelections(l),c=h.listSelections(),!s)for(var f=0;f<c.length;f++)(f==c.length-1||c[f].head.line<c[f+1].head.line)&&h.indentLine(c[f].head.line)}function S(h){return h.getOption("disableInput")?de.Pass:k(h,!0)}de.commands.closeTag=function(h){return k(h)};function T(h,p){if(h.indexOf)return h.indexOf(p);for(var c=0,l=h.length;c<l;++c)if(h[c]==p)return c;return-1}function C(h,p,c,l,a){if(!de.scanForClosingTag)return!1;var u=Math.min(h.lastLine()+1,l.line+500),s=de.scanForClosingTag(h,l,null,u);if(!s||s.tag!=c)return!1;for(var f=a?1:0,i=p.length-1;i>=0&&p[i]==c;i--)++f;l=s.to;for(var i=1;i<f;i++){var n=de.scanForClosingTag(h,l,null,u);if(!n||n.tag!=c)return!1;l=n.to}return!0}})},BdwD:function(rt,$e,H){"use strict";var de=H("+L6B"),ee=H("2/Rp"),j=H("0Owb"),w=H("k1fw"),k=H("q1tI"),S=H.n(k),T=H("FOrL"),C=H.n(T),h=function(c){var l=c.buttonProps,a=l===void 0?{}:l,u=c.styles,s=u===void 0?{}:u,f=c.customText,i=c.ButtonText,n=c.ButtonClick,t=c.Buttonclass,d=c.ButtonTwo;return S.a.createElement("section",{className:"tc animated fadeIn",style:Object(w.a)(Object(w.a)({},{color:"#999",margin:"200px auto"}),s)},S.a.createElement("img",{src:C.a}),S.a.createElement("p",{className:"mt20 font14"},f||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),i&&S.a.createElement(ee.a,Object(j.a)({className:t,onClick:n},a),i),d&&d)};$e.a=h},BjJ7:function(rt,$e,H){"use strict";H.d($e,"d",function(){return ee}),H.d($e,"c",function(){return j}),H.d($e,"e",function(){return w}),H.d($e,"b",function(){return k}),H.d($e,"a",function(){return T});var de=H("m3rI");function ee(C){var h=!0;if(C.length>0){for(var p=0;p<C.length;p++)if(C[p].compile_success==0||!C[p].compile_success){h=!1;break}}else h=!1;return h}function j(C){for(var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",p=[],c=0;c<C.length;c++){var l=C[c],a=h?"".concat(h,"/").concat(l.name):"".concat(l.name);p.push({title:l.name,isLeaf:!(l.type==="tree"),key:a})}return p}function w(C,h,p){for(var c=0;c<C.length;c++){var l=C[c];if(l.key===h){l.children=p;break}l.children&&w(l.children,h,p)}return C}function k(C,h,p){var c;return function(){var l=this,a=arguments,u=function(){c=null,p||C.apply(l,a)},s=p&&!c;clearTimeout(c),c=setTimeout(u,h),s&&C.apply(l,a)}}var S=!0,T=de.a.API_SERVER},"C+DQ":function(rt,$e,H){},CNDd:function(rt,$e,H){rt.exports=H.p+"static/c1.7850f139.svg"},CaVn:function(rt,$e,H){rt.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"}},CrYA:function(rt,$e,H){var de=H("MFOe"),ee=de.Global;rt.exports={name:"sessionStorage",read:w,write:k,each:S,remove:T,clearAll:C};function j(){return ee.sessionStorage}function w(h){return j().getItem(h)}function k(h,p){return j().setItem(h,p)}function S(h){for(var p=j().length-1;p>=0;p--){var c=j().key(p);h(w(c),c)}}function T(h){return j().removeItem(h)}function C(){return j().clear()}},DlQD:function(rt,$e,H){(function(de,ee){rt.exports=ee()})(this,function(){"use strict";function de(Fe,Ie){for(var Me=0;Me<Ie.length;Me++){var be=Ie[Me];be.enumerable=be.enumerable||!1,be.configurable=!0,"value"in be&&(be.writable=!0),Object.defineProperty(Fe,be.key,be)}}function ee(Fe,Ie,Me){return Ie&&de(Fe.prototype,Ie),Me&&de(Fe,Me),Fe}function j(Fe,Ie){if(!Fe)return;if(typeof Fe=="string")return w(Fe,Ie);var Me=Object.prototype.toString.call(Fe).slice(8,-1);if(Me==="Object"&&Fe.constructor&&(Me=Fe.constructor.name),Me==="Map"||Me==="Set")return Array.from(Fe);if(Me==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Me))return w(Fe,Ie)}function w(Fe,Ie){(Ie==null||Ie>Fe.length)&&(Ie=Fe.length);for(var Me=0,be=new Array(Ie);Me<Ie;Me++)be[Me]=Fe[Me];return be}function k(Fe,Ie){var Me;if(typeof Symbol=="undefined"||Fe[Symbol.iterator]==null){if(Array.isArray(Fe)||(Me=j(Fe))||Ie&&Fe&&typeof Fe.length=="number"){Me&&(Fe=Me);var be=0;return function(){return be>=Fe.length?{done:!0}:{done:!1,value:Fe[be++]}}}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 Me=Fe[Symbol.iterator](),Me.next.bind(Me)}function S(Fe,Ie){return Ie={exports:{}},Fe(Ie,Ie.exports),Ie.exports}var T=S(function(Fe){function Ie(){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 Me(be){Fe.exports.defaults=be}Fe.exports={defaults:Ie(),getDefaults:Ie,changeDefaults:Me}}),C=T.defaults,h=T.getDefaults,p=T.changeDefaults,c=/[&<>"']/,l=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(Ie){return s[Ie]};function i(Fe,Ie){if(Ie){if(c.test(Fe))return Fe.replace(l,f)}else if(a.test(Fe))return Fe.replace(u,f);return Fe}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function t(Fe){return Fe.replace(n,function(Ie,Me){return Me=Me.toLowerCase(),Me==="colon"?":":Me.charAt(0)==="#"?Me.charAt(1)==="x"?String.fromCharCode(parseInt(Me.substring(2),16)):String.fromCharCode(+Me.substring(1)):""})}var d=/(^|[^\[])\^/g;function v(Fe,Ie){Fe=Fe.source||Fe,Ie=Ie||"";var Me={replace:function(Te,Le){return Le=Le.source||Le,Le=Le.replace(d,"$1"),Fe=Fe.replace(Te,Le),Me},getRegex:function(){return new RegExp(Fe,Ie)}};return Me}var g=/[^\w:]/g,b=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _(Fe,Ie,Me){if(Fe){var be;try{be=decodeURIComponent(t(Me)).replace(g,"").toLowerCase()}catch(Te){return null}if(be.indexOf("javascript:")===0||be.indexOf("vbscript:")===0||be.indexOf("data:")===0)return null}Ie&&!b.test(Me)&&(Me=x(Ie,Me));try{Me=encodeURI(Me).replace(/%25/g,"%")}catch(Te){return null}return Me}var m={},y=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function x(Fe,Ie){m[" "+Fe]||(y.test(Fe)?m[" "+Fe]=Fe+"/":m[" "+Fe]=N(Fe,"/",!0)),Fe=m[" "+Fe];var Me=Fe.indexOf(":")===-1;return Ie.substring(0,2)==="//"?Me?Ie:Fe.replace(E,"$1")+Ie:Ie.charAt(0)==="/"?Me?Ie:Fe.replace(o,"$1")+Ie:Fe+Ie}var A={exec:function(){}};function O(Fe){for(var Ie=1,Me,be;Ie<arguments.length;Ie++){Me=arguments[Ie];for(be in Me)Object.prototype.hasOwnProperty.call(Me,be)&&(Fe[be]=Me[be])}return Fe}function D(Fe,Ie){var Me=Fe.replace(/\|/g,function(Le,Ce,et){for(var Qe=!1,yt=Ce;--yt>=0&&et[yt]==="\\";)Qe=!Qe;return Qe?"|":" |"}),be=Me.split(/ \|/),Te=0;if(be.length>Ie)be.splice(Ie);else for(;be.length<Ie;)be.push("");for(;Te<be.length;Te++)be[Te]=be[Te].trim().replace(/\\\|/g,"|");return be}function N(Fe,Ie,Me){var be=Fe.length;if(be===0)return"";for(var Te=0;Te<be;){var Le=Fe.charAt(be-Te-1);if(Le===Ie&&!Me)Te++;else if(Le!==Ie&&Me)Te++;else break}return Fe.substr(0,be-Te)}function W(Fe,Ie){if(Fe.indexOf(Ie[1])===-1)return-1;for(var Me=Fe.length,be=0,Te=0;Te<Me;Te++)if(Fe[Te]==="\\")Te++;else if(Fe[Te]===Ie[0])be++;else if(Fe[Te]===Ie[1]&&(be--,be<0))return Te;return-1}function K(Fe){Fe&&Fe.sanitize&&!Fe.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 oe={escape:i,unescape:t,edit:v,cleanUrl:_,resolveUrl:x,noopTest:A,merge:O,splitCells:D,rtrim:N,findClosingBracket:W,checkSanitizeDeprecation:K},B=T.defaults,X=oe.rtrim,V=oe.splitCells,ne=oe.escape,$=oe.findClosingBracket;function Z(Fe,Ie,Me){var be=Ie.href,Te=Ie.title?ne(Ie.title):null,Le=Fe[1].replace(/\\([\[\]])/g,"$1");return Fe[0].charAt(0)!=="!"?{type:"link",raw:Me,href:be,title:Te,text:Le}:{type:"image",raw:Me,href:be,title:Te,text:ne(Le)}}function ue(Fe,Ie){var Me=Fe.match(/^(\s+)(?:```)/);if(Me===null)return Ie;var be=Me[1];return Ie.split(`
|
|
|
`).map(function(Te){var Le=Te.match(/^\s+/);if(Le===null)return Te;var Ce=Le[0];return Ce.length>=be.length?Te.slice(be.length):Te}).join(`
|
|
|
`)}var he=function(){function Fe(Me){this.options=Me||B}var Ie=Fe.prototype;return Ie.space=function(be){var Te=this.rules.block.newline.exec(be);if(Te)return Te[0].length>1?{type:"space",raw:Te[0]}:{raw:`
|
|
|
`}},Ie.code=function(be,Te){var Le=this.rules.block.code.exec(be);if(Le){var Ce=Te[Te.length-1];if(Ce&&Ce.type==="paragraph")return{raw:Le[0],text:Le[0].trimRight()};var et=Le[0].replace(/^ {4}/gm,"");return{type:"code",raw:Le[0],codeBlockStyle:"indented",text:this.options.pedantic?et:X(et,`
|
|
|
`)}}},Ie.fences=function(be){var Te=this.rules.block.fences.exec(be);if(Te){var Le=Te[0],Ce=ue(Le,Te[3]||"");return{type:"code",raw:Le,lang:Te[2]?Te[2].trim():Te[2],text:Ce}}},Ie.heading=function(be){var Te=this.rules.block.heading.exec(be);if(Te)return{type:"heading",raw:Te[0],depth:Te[1].length,text:Te[2]}},Ie.nptable=function(be){var Te=this.rules.block.nptable.exec(be);if(Te){var Le={type:"table",header:V(Te[1].replace(/^ *| *\| *$/g,"")),align:Te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Te[3]?Te[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:Te[0]};if(Le.header.length===Le.align.length){var Ce=Le.align.length,et;for(et=0;et<Ce;et++)/^ *-+: *$/.test(Le.align[et])?Le.align[et]="right":/^ *:-+: *$/.test(Le.align[et])?Le.align[et]="center":/^ *:-+ *$/.test(Le.align[et])?Le.align[et]="left":Le.align[et]=null;for(Ce=Le.cells.length,et=0;et<Ce;et++)Le.cells[et]=V(Le.cells[et],Le.header.length);return Le}}},Ie.hr=function(be){var Te=this.rules.block.hr.exec(be);if(Te)return{type:"hr",raw:Te[0]}},Ie.blockquote=function(be){var Te=this.rules.block.blockquote.exec(be);if(Te){var Le=Te[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Te[0],text:Le}}},Ie.list=function(be){var Te=this.rules.block.list.exec(be);if(Te){for(var Le=Te[0],Ce=Te[2],et=Ce.length>1,Qe=Ce[Ce.length-1]===")",yt={type:"list",raw:Le,ordered:et,start:et?+Ce.slice(0,-1):"",loose:!1,items:[]},Dt=Te[0].match(this.rules.block.item),Bt=!1,Pt,Rt,st,mt,lt,De,Ke,vt=Dt.length,ot=0;ot<vt;ot++)Pt=Dt[ot],Le=Pt,Rt=Pt.length,Pt=Pt.replace(/^ *([*+-]|\d+[.)]) */,""),~Pt.indexOf(`
|
|
|
`)&&(Rt-=Pt.length,Pt=this.options.pedantic?Pt.replace(/^ {1,4}/gm,""):Pt.replace(new RegExp("^ {1,"+Rt+"}","gm"),"")),ot!==vt-1&&(st=this.rules.block.bullet.exec(Dt[ot+1])[0],(et?st.length===1||!Qe&&st[st.length-1]===")":st.length>1||this.options.smartLists&&st!==Ce)&&(mt=Dt.slice(ot+1).join(`
|
|
|
`),yt.raw=yt.raw.substring(0,yt.raw.length-mt.length),ot=vt-1)),lt=Bt||/\n\n(?!\s*$)/.test(Pt),ot!==vt-1&&(Bt=Pt.charAt(Pt.length-1)===`
|
|
|
`,lt||(lt=Bt)),lt&&(yt.loose=!0),De=/^\[[ xX]\] /.test(Pt),Ke=void 0,De&&(Ke=Pt[1]!==" ",Pt=Pt.replace(/^\[[ xX]\] +/,"")),yt.items.push({type:"list_item",raw:Le,task:De,checked:Ke,loose:lt,text:Pt});return yt}},Ie.html=function(be){var Te=this.rules.block.html.exec(be);if(Te)return{type:this.options.sanitize?"paragraph":"html",raw:Te[0],pre:!this.options.sanitizer&&(Te[1]==="pre"||Te[1]==="script"||Te[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Te[0]):ne(Te[0]):Te[0]}},Ie.def=function(be){var Te=this.rules.block.def.exec(be);if(Te){Te[3]&&(Te[3]=Te[3].substring(1,Te[3].length-1));var Le=Te[1].toLowerCase().replace(/\s+/g," ");return{tag:Le,raw:Te[0],href:Te[2],title:Te[3]}}},Ie.table=function(be){var Te=this.rules.block.table.exec(be);if(Te){var Le={type:"table",header:V(Te[1].replace(/^ *| *\| *$/g,"")),align:Te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Te[3]?Te[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(Le.header.length===Le.align.length){Le.raw=Te[0];var Ce=Le.align.length,et;for(et=0;et<Ce;et++)/^ *-+: *$/.test(Le.align[et])?Le.align[et]="right":/^ *:-+: *$/.test(Le.align[et])?Le.align[et]="center":/^ *:-+ *$/.test(Le.align[et])?Le.align[et]="left":Le.align[et]=null;for(Ce=Le.cells.length,et=0;et<Ce;et++)Le.cells[et]=V(Le.cells[et].replace(/^ *\| *| *\| *$/g,""),Le.header.length);return Le}}},Ie.lheading=function(be){var Te=this.rules.block.lheading.exec(be);if(Te)return{type:"heading",raw:Te[0],depth:Te[2].charAt(0)==="="?1:2,text:Te[1]}},Ie.paragraph=function(be){var Te=this.rules.block.paragraph.exec(be);if(Te)return{type:"paragraph",raw:Te[0],text:Te[1].charAt(Te[1].length-1)===`
|
|
|
`?Te[1].slice(0,-1):Te[1]}},Ie.text=function(be,Te){var Le=this.rules.block.text.exec(be);if(Le){var Ce=Te[Te.length-1];return Ce&&Ce.type==="text"?{raw:Le[0],text:Le[0]}:{type:"text",raw:Le[0],text:Le[0]}}},Ie.escape=function(be){var Te=this.rules.inline.escape.exec(be);if(Te)return{type:"escape",raw:Te[0],text:ne(Te[1])}},Ie.tag=function(be,Te,Le){var Ce=this.rules.inline.tag.exec(be);if(Ce)return!Te&&/^<a /i.test(Ce[0])?Te=!0:Te&&/^<\/a>/i.test(Ce[0])&&(Te=!1),!Le&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ce[0])?Le=!0:Le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ce[0])&&(Le=!1),{type:this.options.sanitize?"text":"html",raw:Ce[0],inLink:Te,inRawBlock:Le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ce[0]):ne(Ce[0]):Ce[0]}},Ie.link=function(be){var Te=this.rules.inline.link.exec(be);if(Te){var Le=$(Te[2],"()");if(Le>-1){var Ce=Te[0].indexOf("!")===0?5:4,et=Ce+Te[1].length+Le;Te[2]=Te[2].substring(0,Le),Te[0]=Te[0].substring(0,et).trim(),Te[3]=""}var Qe=Te[2],yt="";if(this.options.pedantic){var Dt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Qe);Dt?(Qe=Dt[1],yt=Dt[3]):yt=""}else yt=Te[3]?Te[3].slice(1,-1):"";Qe=Qe.trim().replace(/^<([\s\S]*)>$/,"$1");var Bt=Z(Te,{href:Qe&&Qe.replace(this.rules.inline._escapes,"$1"),title:yt&&yt.replace(this.rules.inline._escapes,"$1")},Te[0]);return Bt}},Ie.reflink=function(be,Te){var Le;if((Le=this.rules.inline.reflink.exec(be))||(Le=this.rules.inline.nolink.exec(be))){var Ce=(Le[2]||Le[1]).replace(/\s+/g," ");if(Ce=Te[Ce.toLowerCase()],!Ce||!Ce.href){var et=Le[0].charAt(0);return{type:"text",raw:et,text:et}}var Qe=Z(Le,Ce,Le[0]);return Qe}},Ie.strong=function(be,Te,Le){Le===void 0&&(Le="");var Ce=this.rules.inline.strong.start.exec(be);if(Ce&&(!Ce[1]||Ce[1]&&(Le===""||this.rules.inline.punctuation.exec(Le)))){Te=Te.slice(-1*be.length);var et=Ce[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;et.lastIndex=0;for(var Qe;(Ce=et.exec(Te))!=null;)if(Qe=this.rules.inline.strong.middle.exec(Te.slice(0,Ce.index+3)),Qe)return{type:"strong",raw:be.slice(0,Qe[0].length),text:be.slice(2,Qe[0].length-2)}}},Ie.em=function(be,Te,Le){Le===void 0&&(Le="");var Ce=this.rules.inline.em.start.exec(be);if(Ce&&(!Ce[1]||Ce[1]&&(Le===""||this.rules.inline.punctuation.exec(Le)))){Te=Te.slice(-1*be.length);var et=Ce[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;et.lastIndex=0;for(var Qe;(Ce=et.exec(Te))!=null;)if(Qe=this.rules.inline.em.middle.exec(Te.slice(0,Ce.index+2)),Qe)return{type:"em",raw:be.slice(0,Qe[0].length),text:be.slice(1,Qe[0].length-1)}}},Ie.codespan=function(be){var Te=this.rules.inline.code.exec(be);if(Te){var Le=Te[2].replace(/\n/g," "),Ce=/[^ ]/.test(Le),et=Le.startsWith(" ")&&Le.endsWith(" ");return Ce&&et&&(Le=Le.substring(1,Le.length-1)),Le=ne(Le,!0),{type:"codespan",raw:Te[0],text:Le}}},Ie.br=function(be){var Te=this.rules.inline.br.exec(be);if(Te)return{type:"br",raw:Te[0]}},Ie.del=function(be){var Te=this.rules.inline.del.exec(be);if(Te)return{type:"del",raw:Te[0],text:Te[1]}},Ie.autolink=function(be,Te){var Le=this.rules.inline.autolink.exec(be);if(Le){var Ce,et;return Le[2]==="@"?(Ce=ne(this.options.mangle?Te(Le[1]):Le[1]),et="mailto:"+Ce):(Ce=ne(Le[1]),et=Ce),{type:"link",raw:Le[0],text:Ce,href:et,tokens:[{type:"text",raw:Ce,text:Ce}]}}},Ie.url=function(be,Te){var Le;if(Le=this.rules.inline.url.exec(be)){var Ce,et;if(Le[2]==="@")Ce=ne(this.options.mangle?Te(Le[0]):Le[0]),et="mailto:"+Ce;else{var Qe;do Qe=Le[0],Le[0]=this.rules.inline._backpedal.exec(Le[0])[0];while(Qe!==Le[0]);Ce=ne(Le[0]),Le[1]==="www."?et="http://"+Ce:et=Ce}return{type:"link",raw:Le[0],text:Ce,href:et,tokens:[{type:"text",raw:Ce,text:Ce}]}}},Ie.inlineText=function(be,Te,Le){var Ce=this.rules.inline.text.exec(be);if(Ce){var et;return Te?et=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ce[0]):ne(Ce[0]):Ce[0]:et=ne(this.options.smartypants?Le(Ce[0]):Ce[0]),{type:"text",raw:Ce[0],text:et}}},Fe}(),Oe=oe.noopTest,we=oe.edit,Pe=oe.merge,_e={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:Oe,table:Oe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};_e._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_e._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,_e.def=we(_e.def).replace("label",_e._label).replace("title",_e._title).getRegex(),_e.bullet=/(?:[*+-]|\d{1,9}[.)])/,_e.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,_e.item=we(_e.item,"gm").replace(/bull/g,_e.bullet).getRegex(),_e.list=we(_e.list).replace(/bull/g,_e.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+_e.def.source+")").getRegex(),_e._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",_e._comment=/<!--(?!-?>)[\s\S]*?-->/,_e.html=we(_e.html,"i").replace("comment",_e._comment).replace("tag",_e._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_e.paragraph=we(_e._paragraph).replace("hr",_e.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",_e._tag).getRegex(),_e.blockquote=we(_e.blockquote).replace("paragraph",_e.paragraph).getRegex(),_e.normal=Pe({},_e),_e.gfm=Pe({},_e.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*|$)"}),_e.gfm.nptable=we(_e.gfm.nptable).replace("hr",_e.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",_e._tag).getRegex(),_e.gfm.table=we(_e.gfm.table).replace("hr",_e.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",_e._tag).getRegex(),_e.pedantic=Pe({},_e.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_e._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:Oe,paragraph:we(_e.normal._paragraph).replace("hr",_e.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",_e.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var xe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Oe,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:Oe,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",_e._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=Pe({},xe),xe.pedantic=Pe({},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=Pe({},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=Pe({},xe.gfm,{br:we(xe.br).replace("{2,}","*").getRegex(),text:we(xe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ve={block:_e,inline:xe},Ne=T.defaults,Be=Ve.block,ze=Ve.inline;function ye(Fe){return Fe.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 me(Fe){var Ie="",Me,be,Te=Fe.length;for(Me=0;Me<Te;Me++)be=Fe.charCodeAt(Me),Math.random()>.5&&(be="x"+be.toString(16)),Ie+="&#"+be+";";return Ie}var We=function(){function Fe(Me){this.tokens=[],this.tokens.links=Object.create(null),this.options=Me||Ne,this.options.tokenizer=this.options.tokenizer||new he,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var be={block:Be.normal,inline:ze.normal};this.options.pedantic?(be.block=Be.pedantic,be.inline=ze.pedantic):this.options.gfm&&(be.block=Be.gfm,this.options.breaks?be.inline=ze.breaks:be.inline=ze.gfm),this.tokenizer.rules=be}Fe.lex=function(be,Te){var Le=new Fe(Te);return Le.lex(be)};var Ie=Fe.prototype;return Ie.lex=function(be){return be=be.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(be,this.tokens,!0),this.inline(this.tokens),this.tokens},Ie.blockTokens=function(be,Te,Le){Te===void 0&&(Te=[]),Le===void 0&&(Le=!0),be=be.replace(/^ +$/gm,"");for(var Ce,et,Qe,yt;be;){if(Ce=this.tokenizer.space(be)){be=be.substring(Ce.raw.length),Ce.type&&Te.push(Ce);continue}if(Ce=this.tokenizer.code(be,Te)){be=be.substring(Ce.raw.length),Ce.type?Te.push(Ce):(yt=Te[Te.length-1],yt.raw+=`
|
|
|
`+Ce.raw,yt.text+=`
|
|
|
`+Ce.text);continue}if(Ce=this.tokenizer.fences(be)){be=be.substring(Ce.raw.length),Te.push(Ce);continue}if(Ce=this.tokenizer.heading(be)){be=be.substring(Ce.raw.length),Te.push(Ce);continue}if(Ce=this.tokenizer.nptable(be)){be=be.substring(Ce.raw.length),Te.push(Ce);continue}if(Ce=this.tokenizer.hr(be)){be=be.substring(Ce.raw.length),Te.push(Ce);continue}if(Ce=this.tokenizer.blockquote(be)){be=be.substring(Ce.raw.length),Ce.tokens=this.blockTokens(Ce.text,[],Le),Te.push(Ce);continue}if(Ce=this.tokenizer.list(be)){for(be=be.substring(Ce.raw.length),Qe=Ce.items.length,et=0;et<Qe;et++)Ce.items[et].tokens=this.blockTokens(Ce.items[et].text,[],!1);Te.push(Ce);continue}if(Ce=this.tokenizer.html(be)){be=be.substring(Ce.raw.length),Te.push(Ce);continue}if(Le&&(Ce=this.tokenizer.def(be))){be=be.substring(Ce.raw.length),this.tokens.links[Ce.tag]||(this.tokens.links[Ce.tag]={href:Ce.href,title:Ce.title});continue}if(Ce=this.tokenizer.table(be)){be=be.substring(Ce.raw.length),Te.push(Ce);continue}if(Ce=this.tokenizer.lheading(be)){be=be.substring(Ce.raw.length),Te.push(Ce);continue}if(Le&&(Ce=this.tokenizer.paragraph(be))){be=be.substring(Ce.raw.length),Te.push(Ce);continue}if(Ce=this.tokenizer.text(be,Te)){be=be.substring(Ce.raw.length),Ce.type?Te.push(Ce):(yt=Te[Te.length-1],yt.raw+=`
|
|
|
`+Ce.raw,yt.text+=`
|
|
|
`+Ce.text);continue}if(be){var Dt="Infinite loop on byte: "+be.charCodeAt(0);if(this.options.silent){console.error(Dt);break}else throw new Error(Dt)}}return Te},Ie.inline=function(be){var Te,Le,Ce,et,Qe,yt,Dt=be.length;for(Te=0;Te<Dt;Te++){yt=be[Te];switch(yt.type){case"paragraph":case"text":case"heading":{yt.tokens=[],this.inlineTokens(yt.text,yt.tokens);break}case"table":{for(yt.tokens={header:[],cells:[]},et=yt.header.length,Le=0;Le<et;Le++)yt.tokens.header[Le]=[],this.inlineTokens(yt.header[Le],yt.tokens.header[Le]);for(et=yt.cells.length,Le=0;Le<et;Le++)for(Qe=yt.cells[Le],yt.tokens.cells[Le]=[],Ce=0;Ce<Qe.length;Ce++)yt.tokens.cells[Le][Ce]=[],this.inlineTokens(Qe[Ce],yt.tokens.cells[Le][Ce]);break}case"blockquote":{this.inline(yt.tokens);break}case"list":{for(et=yt.items.length,Le=0;Le<et;Le++)this.inline(yt.items[Le].tokens);break}}}return be},Ie.inlineTokens=function(be,Te,Le,Ce,et){Te===void 0&&(Te=[]),Le===void 0&&(Le=!1),Ce===void 0&&(Ce=!1),et===void 0&&(et="");var Qe,yt=be,Dt;if(this.tokens.links){var Bt=Object.keys(this.tokens.links);if(Bt.length>0)for(;(Dt=this.tokenizer.rules.inline.reflinkSearch.exec(yt))!=null;)Bt.includes(Dt[0].slice(Dt[0].lastIndexOf("[")+1,-1))&&(yt=yt.slice(0,Dt.index)+"["+"a".repeat(Dt[0].length-2)+"]"+yt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Dt=this.tokenizer.rules.inline.blockSkip.exec(yt))!=null;)yt=yt.slice(0,Dt.index)+"["+"a".repeat(Dt[0].length-2)+"]"+yt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;be;){if(Qe=this.tokenizer.escape(be)){be=be.substring(Qe.raw.length),Te.push(Qe);continue}if(Qe=this.tokenizer.tag(be,Le,Ce)){be=be.substring(Qe.raw.length),Le=Qe.inLink,Ce=Qe.inRawBlock,Te.push(Qe);continue}if(Qe=this.tokenizer.link(be)){be=be.substring(Qe.raw.length),Qe.type==="link"&&(Qe.tokens=this.inlineTokens(Qe.text,[],!0,Ce)),Te.push(Qe);continue}if(Qe=this.tokenizer.reflink(be,this.tokens.links)){be=be.substring(Qe.raw.length),Qe.type==="link"&&(Qe.tokens=this.inlineTokens(Qe.text,[],!0,Ce)),Te.push(Qe);continue}if(Qe=this.tokenizer.strong(be,yt,et)){be=be.substring(Qe.raw.length),Qe.tokens=this.inlineTokens(Qe.text,[],Le,Ce),Te.push(Qe);continue}if(Qe=this.tokenizer.em(be,yt,et)){be=be.substring(Qe.raw.length),Qe.tokens=this.inlineTokens(Qe.text,[],Le,Ce),Te.push(Qe);continue}if(Qe=this.tokenizer.codespan(be)){be=be.substring(Qe.raw.length),Te.push(Qe);continue}if(Qe=this.tokenizer.br(be)){be=be.substring(Qe.raw.length),Te.push(Qe);continue}if(Qe=this.tokenizer.del(be)){be=be.substring(Qe.raw.length),Qe.tokens=this.inlineTokens(Qe.text,[],Le,Ce),Te.push(Qe);continue}if(Qe=this.tokenizer.autolink(be,me)){be=be.substring(Qe.raw.length),Te.push(Qe);continue}if(!Le&&(Qe=this.tokenizer.url(be,me))){be=be.substring(Qe.raw.length),Te.push(Qe);continue}if(Qe=this.tokenizer.inlineText(be,Ce,ye)){be=be.substring(Qe.raw.length),et=Qe.raw.slice(-1),Te.push(Qe);continue}if(be){var Pt="Infinite loop on byte: "+be.charCodeAt(0);if(this.options.silent){console.error(Pt);break}else throw new Error(Pt)}}return Te},ee(Fe,null,[{key:"rules",get:function(){return{block:Be,inline:ze}}}]),Fe}(),He=T.defaults,nt=oe.cleanUrl,te=oe.escape,P=function(){function Fe(Me){this.options=Me||He}var Ie=Fe.prototype;return Ie.code=function(be,Te,Le){var Ce=(Te||"").match(/\S*/)[0];if(this.options.highlight){var et=this.options.highlight(be,Ce);et!=null&&et!==be&&(Le=!0,be=et)}return Ce?'<pre><code class="'+this.options.langPrefix+te(Ce,!0)+'">'+(Le?be:te(be,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(Le?be:te(be,!0))+`</code></pre>
|
|
|
`},Ie.blockquote=function(be){return`<blockquote>
|
|
|
`+be+`</blockquote>
|
|
|
`},Ie.html=function(be){return be},Ie.heading=function(be,Te,Le,Ce){return this.options.headerIds?"<h"+Te+' id="'+this.options.headerPrefix+Ce.slug(Le)+'">'+be+"</h"+Te+`>
|
|
|
`:"<h"+Te+">"+be+"</h"+Te+`>
|
|
|
`},Ie.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},Ie.list=function(be,Te,Le){var Ce=Te?"ol":"ul",et=Te&&Le!==1?' start="'+Le+'"':"";return"<"+Ce+et+`>
|
|
|
`+be+"</"+Ce+`>
|
|
|
`},Ie.listitem=function(be){return"<li>"+be+`</li>
|
|
|
`},Ie.checkbox=function(be){return"<input "+(be?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Ie.paragraph=function(be){return"<p>"+be+`</p>
|
|
|
`},Ie.table=function(be,Te){return Te&&(Te="<tbody>"+Te+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+be+`</thead>
|
|
|
`+Te+`</table>
|
|
|
`},Ie.tablerow=function(be){return`<tr>
|
|
|
`+be+`</tr>
|
|
|
`},Ie.tablecell=function(be,Te){var Le=Te.header?"th":"td",Ce=Te.align?"<"+Le+' align="'+Te.align+'">':"<"+Le+">";return Ce+be+"</"+Le+`>
|
|
|
`},Ie.strong=function(be){return"<strong>"+be+"</strong>"},Ie.em=function(be){return"<em>"+be+"</em>"},Ie.codespan=function(be){return"<code>"+be+"</code>"},Ie.br=function(){return this.options.xhtml?"<br/>":"<br>"},Ie.del=function(be){return"<del>"+be+"</del>"},Ie.link=function(be,Te,Le){if(be=nt(this.options.sanitize,this.options.baseUrl,be),be===null)return Le;var Ce='<a href="'+te(be)+'"';return Te&&(Ce+=' title="'+Te+'"'),Ce+=">"+Le+"</a>",Ce},Ie.image=function(be,Te,Le){if(be=nt(this.options.sanitize,this.options.baseUrl,be),be===null)return Le;var Ce='<img src="'+be+'" alt="'+Le+'"';return Te&&(Ce+=' title="'+Te+'"'),Ce+=this.options.xhtml?"/>":">",Ce},Ie.text=function(be){return be},Fe}(),U=function(){function Fe(){}var Ie=Fe.prototype;return Ie.strong=function(be){return be},Ie.em=function(be){return be},Ie.codespan=function(be){return be},Ie.del=function(be){return be},Ie.html=function(be){return be},Ie.text=function(be){return be},Ie.link=function(be,Te,Le){return""+Le},Ie.image=function(be,Te,Le){return""+Le},Ie.br=function(){return""},Fe}(),q=function(){function Fe(){this.seen={}}var Ie=Fe.prototype;return Ie.slug=function(be){var Te=be.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Te)){var Le=Te;do this.seen[Le]++,Te=Le+"-"+this.seen[Le];while(this.seen.hasOwnProperty(Te))}return this.seen[Te]=0,Te},Fe}(),Y=T.defaults,J=oe.unescape,Ee=function(){function Fe(Me){this.options=Me||Y,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new U,this.slugger=new q}Fe.parse=function(be,Te){var Le=new Fe(Te);return Le.parse(be)};var Ie=Fe.prototype;return Ie.parse=function(be,Te){Te===void 0&&(Te=!0);var Le="",Ce,et,Qe,yt,Dt,Bt,Pt,Rt,st,mt,lt,De,Ke,vt,ot,Mt,Nt,it,St=be.length;for(Ce=0;Ce<St;Ce++){mt=be[Ce];switch(mt.type){case"space":continue;case"hr":{Le+=this.renderer.hr();continue}case"heading":{Le+=this.renderer.heading(this.parseInline(mt.tokens),mt.depth,J(this.parseInline(mt.tokens,this.textRenderer)),this.slugger);continue}case"code":{Le+=this.renderer.code(mt.text,mt.lang,mt.escaped);continue}case"table":{for(Rt="",Pt="",yt=mt.header.length,et=0;et<yt;et++)Pt+=this.renderer.tablecell(this.parseInline(mt.tokens.header[et]),{header:!0,align:mt.align[et]});for(Rt+=this.renderer.tablerow(Pt),st="",yt=mt.cells.length,et=0;et<yt;et++){for(Bt=mt.tokens.cells[et],Pt="",Dt=Bt.length,Qe=0;Qe<Dt;Qe++)Pt+=this.renderer.tablecell(this.parseInline(Bt[Qe]),{header:!1,align:mt.align[Qe]});st+=this.renderer.tablerow(Pt)}Le+=this.renderer.table(Rt,st);continue}case"blockquote":{st=this.parse(mt.tokens),Le+=this.renderer.blockquote(st);continue}case"list":{for(lt=mt.ordered,De=mt.start,Ke=mt.loose,yt=mt.items.length,st="",et=0;et<yt;et++)ot=mt.items[et],Mt=ot.checked,Nt=ot.task,vt="",ot.task&&(it=this.renderer.checkbox(Mt),Ke?ot.tokens.length>0&&ot.tokens[0].type==="text"?(ot.tokens[0].text=it+" "+ot.tokens[0].text,ot.tokens[0].tokens&&ot.tokens[0].tokens.length>0&&ot.tokens[0].tokens[0].type==="text"&&(ot.tokens[0].tokens[0].text=it+" "+ot.tokens[0].tokens[0].text)):ot.tokens.unshift({type:"text",text:it}):vt+=it),vt+=this.parse(ot.tokens,Ke),st+=this.renderer.listitem(vt,Nt,Mt);Le+=this.renderer.list(st,lt,De);continue}case"html":{Le+=this.renderer.html(mt.text);continue}case"paragraph":{Le+=this.renderer.paragraph(this.parseInline(mt.tokens));continue}case"text":{for(st=mt.tokens?this.parseInline(mt.tokens):mt.text;Ce+1<St&&be[Ce+1].type==="text";)mt=be[++Ce],st+=`
|
|
|
`+(mt.tokens?this.parseInline(mt.tokens):mt.text);Le+=Te?this.renderer.paragraph(st):st;continue}default:{var Wt='Token with "'+mt.type+'" type was not found.';if(this.options.silent){console.error(Wt);return}else throw new Error(Wt)}}}return Le},Ie.parseInline=function(be,Te){Te=Te||this.renderer;var Le="",Ce,et,Qe=be.length;for(Ce=0;Ce<Qe;Ce++){et=be[Ce];switch(et.type){case"escape":{Le+=Te.text(et.text);break}case"html":{Le+=Te.html(et.text);break}case"link":{Le+=Te.link(et.href,et.title,this.parseInline(et.tokens,Te));break}case"image":{Le+=Te.image(et.href,et.title,et.text);break}case"strong":{Le+=Te.strong(this.parseInline(et.tokens,Te));break}case"em":{Le+=Te.em(this.parseInline(et.tokens,Te));break}case"codespan":{Le+=Te.codespan(et.text);break}case"br":{Le+=Te.br();break}case"del":{Le+=Te.del(this.parseInline(et.tokens,Te));break}case"text":{Le+=Te.text(et.text);break}default:{var yt='Token with "'+et.type+'" type was not found.';if(this.options.silent){console.error(yt);return}else throw new Error(yt)}}}return Le},Fe}(),ke=oe.merge,ht=oe.checkSanitizeDeprecation,Ue=oe.escape,je=T.getDefaults,tt=T.changeDefaults,dt=T.defaults;function qe(Fe,Ie,Me){if(typeof Fe=="undefined"||Fe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Fe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Fe)+", string expected");if(typeof Ie=="function"&&(Me=Ie,Ie=null),Ie=ke({},qe.defaults,Ie||{}),ht(Ie),Me){var be=Ie.highlight,Te;try{Te=We.lex(Fe,Ie)}catch(Qe){return Me(Qe)}var Le=function(yt){var Dt;if(!yt)try{Dt=Ee.parse(Te,Ie)}catch(Bt){yt=Bt}return Ie.highlight=be,yt?Me(yt):Me(null,Dt)};if(!be||be.length<3)return Le();if(delete Ie.highlight,!Te.length)return Le();var Ce=0;qe.walkTokens(Te,function(Qe){Qe.type==="code"&&(Ce++,setTimeout(function(){be(Qe.text,Qe.lang,function(yt,Dt){if(yt)return Le(yt);Dt!=null&&Dt!==Qe.text&&(Qe.text=Dt,Qe.escaped=!0),Ce--,Ce===0&&Le()})},0))}),Ce===0&&Le();return}try{var et=We.lex(Fe,Ie);return Ie.walkTokens&&qe.walkTokens(et,Ie.walkTokens),Ee.parse(et,Ie)}catch(Qe){if(Qe.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,Ie.silent)return"<p>An error occurred:</p><pre>"+Ue(Qe.message+"",!0)+"</pre>";throw Qe}}qe.options=qe.setOptions=function(Fe){return ke(qe.defaults,Fe),tt(qe.defaults),qe},qe.getDefaults=je,qe.defaults=dt,qe.use=function(Fe){var Ie=ke({},Fe);if(Fe.renderer&&function(){var be=qe.defaults.renderer||new P,Te=function(et){var Qe=be[et];be[et]=function(){for(var yt=arguments.length,Dt=new Array(yt),Bt=0;Bt<yt;Bt++)Dt[Bt]=arguments[Bt];var Pt=Fe.renderer[et].apply(be,Dt);return Pt===!1&&(Pt=Qe.apply(be,Dt)),Pt}};for(var Le in Fe.renderer)Te(Le);Ie.renderer=be}(),Fe.tokenizer&&function(){var be=qe.defaults.tokenizer||new he,Te=function(et){var Qe=be[et];be[et]=function(){for(var yt=arguments.length,Dt=new Array(yt),Bt=0;Bt<yt;Bt++)Dt[Bt]=arguments[Bt];var Pt=Fe.tokenizer[et].apply(be,Dt);return Pt===!1&&(Pt=Qe.apply(be,Dt)),Pt}};for(var Le in Fe.tokenizer)Te(Le);Ie.tokenizer=be}(),Fe.walkTokens){var Me=qe.defaults.walkTokens;Ie.walkTokens=function(be){Fe.walkTokens(be),Me&&Me(be)}}qe.setOptions(Ie)},qe.walkTokens=function(Fe,Ie){for(var Me=k(Fe),be;!(be=Me()).done;){var Te=be.value;Ie(Te);switch(Te.type){case"table":{for(var Le=k(Te.tokens.header),Ce;!(Ce=Le()).done;){var et=Ce.value;qe.walkTokens(et,Ie)}for(var Qe=k(Te.tokens.cells),yt;!(yt=Qe()).done;)for(var Dt=yt.value,Bt=k(Dt),Pt;!(Pt=Bt()).done;){var Rt=Pt.value;qe.walkTokens(Rt,Ie)}break}case"list":{qe.walkTokens(Te.items,Ie);break}default:Te.tokens&&qe.walkTokens(Te.tokens,Ie)}}},qe.Parser=Ee,qe.parser=Ee.parse,qe.Renderer=P,qe.TextRenderer=U,qe.Lexer=We,qe.lexer=We.lex,qe.Tokenizer=he,qe.Slugger=q,qe.parse=qe;var Ye=qe;return Ye})},"DlR+":function(rt,$e,H){var de=H("MFOe"),ee=de.Global,j=de.trim;rt.exports={name:"cookieStorage",read:k,write:T,each:S,remove:C,clearAll:h};var w=ee.document;function k(c){if(!c||!p(c))return null;var l="(?:^|.*;\\s*)"+escape(c).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(w.cookie.replace(new RegExp(l),"$1"))}function S(c){for(var l=w.cookie.split(/; ?/g),a=l.length-1;a>=0;a--){if(!j(l[a]))continue;var u=l[a].split("="),s=unescape(u[0]),f=unescape(u[1]);c(f,s)}}function T(c,l){if(!c)return;w.cookie=escape(c)+"="+escape(l)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function C(c){if(!c||!p(c))return;w.cookie=escape(c)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function h(){S(function(c,l){C(l)})}function p(c){return new RegExp("(?:^|;\\s*)"+escape(c).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(w.cookie)}},E2g8:function(rt,$e,H){(function(de,ee){/*!
|
|
|
* @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,w){rt.exports=w()})(this,function(){"use strict";function j(P){var U=typeof P;return P!==null&&(U==="object"||U==="function")}function w(P){return typeof P=="function"}var k=void 0;Array.isArray?k=Array.isArray:k=function(P){return Object.prototype.toString.call(P)==="[object Array]"};var S=k,T=0,C=void 0,h=void 0,p=function(U,q){b[T]=U,b[T+1]=q,T+=2,T===2&&(h?h(_):y())};function c(P){h=P}function l(P){p=P}var a=typeof window!="undefined"?window:void 0,u=a||{},s=u.MutationObserver||u.WebKitMutationObserver,f=typeof self=="undefined"&&typeof de!="undefined"&&{}.toString.call(de)==="[object process]",i=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function n(){return function(){return de.nextTick(_)}}function t(){return typeof C!="undefined"?function(){C(_)}:g()}function d(){var P=0,U=new s(_),q=document.createTextNode("");return U.observe(q,{characterData:!0}),function(){q.data=P=++P%2}}function v(){var P=new MessageChannel;return P.port1.onmessage=_,function(){return P.port2.postMessage(0)}}function g(){var P=setTimeout;return function(){return P(_,1)}}var b=new Array(1e3);function _(){for(var P=0;P<T;P+=2){var U=b[P],q=b[P+1];U(q),b[P]=void 0,b[P+1]=void 0}T=0}function m(){try{var P=Function("return this")().require("vertx");return C=P.runOnLoop||P.runOnContext,t()}catch(U){return g()}}var y=void 0;f?y=n():s?y=d():i?y=v():a===void 0&&!0?y=m():y=g();function E(P,U){var q=this,Y=new this.constructor(A);Y[x]===void 0&&Ve(Y);var J=q._state;if(J){var Ee=arguments[J-1];p(function(){return we(J,Y,Ee,q._result)})}else he(q,Y,P,U);return Y}function o(P){var U=this;if(P&&typeof P=="object"&&P.constructor===U)return P;var q=new U(A);return ne(q,P),q}var x=Math.random().toString(36).substring(2);function A(){}var O=void 0,D=1,N=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 oe(P,U,q,Y){try{P.call(U,q,Y)}catch(J){return J}}function B(P,U,q){p(function(Y){var J=!1,Ee=oe(q,U,function(ke){if(J)return;J=!0,U!==ke?ne(Y,ke):Z(Y,ke)},function(ke){if(J)return;J=!0,ue(Y,ke)},"Settle: "+(Y._label||" unknown promise"));!J&&Ee&&(J=!0,ue(Y,Ee))},P)}function X(P,U){U._state===D?Z(P,U._result):U._state===N?ue(P,U._result):he(U,void 0,function(q){return ne(P,q)},function(q){return ue(P,q)})}function V(P,U,q){U.constructor===P.constructor&&q===E&&U.constructor.resolve===o?X(P,U):q===void 0?Z(P,U):w(q)?B(P,U,q):Z(P,U)}function ne(P,U){if(P===U)ue(P,W());else if(j(U)){var q=void 0;try{q=U.then}catch(Y){ue(P,Y);return}V(P,U,q)}else Z(P,U)}function $(P){P._onerror&&P._onerror(P._result),Oe(P)}function Z(P,U){if(P._state!==O)return;P._result=U,P._state=D,P._subscribers.length!==0&&p(Oe,P)}function ue(P,U){if(P._state!==O)return;P._state=N,P._result=U,p($,P)}function he(P,U,q,Y){var J=P._subscribers,Ee=J.length;P._onerror=null,J[Ee]=U,J[Ee+D]=q,J[Ee+N]=Y,Ee===0&&P._state&&p(Oe,P)}function Oe(P){var U=P._subscribers,q=P._state;if(U.length===0)return;for(var Y=void 0,J=void 0,Ee=P._result,ke=0;ke<U.length;ke+=3)Y=U[ke],J=U[ke+q],Y?we(q,Y,J,Ee):J(Ee);P._subscribers.length=0}function we(P,U,q,Y){var J=w(q),Ee=void 0,ke=void 0,ht=!0;if(J){try{Ee=q(Y)}catch(Ue){ht=!1,ke=Ue}if(U===Ee){ue(U,K());return}}else Ee=Y;U._state!==O||(J&&ht?ne(U,Ee):ht===!1?ue(U,ke):P===D?Z(U,Ee):P===N&&ue(U,Ee))}function Pe(P,U){try{U(function(Y){ne(P,Y)},function(Y){ue(P,Y)})}catch(q){ue(P,q)}}var _e=0;function xe(){return _e++}function Ve(P){P[x]=_e++,P._state=void 0,P._result=void 0,P._subscribers=[]}function Ne(){return new Error("Array Methods must be provided an Array")}var Be=function(){function P(U,q){this._instanceConstructor=U,this.promise=new U(A),this.promise[x]||Ve(this.promise),S(q)?(this.length=q.length,this._remaining=q.length,this._result=new Array(this.length),this.length===0?Z(this.promise,this._result):(this.length=this.length||0,this._enumerate(q),this._remaining===0&&Z(this.promise,this._result))):ue(this.promise,Ne())}return P.prototype._enumerate=function(q){for(var Y=0;this._state===O&&Y<q.length;Y++)this._eachEntry(q[Y],Y)},P.prototype._eachEntry=function(q,Y){var J=this._instanceConstructor,Ee=J.resolve;if(Ee===o){var ke=void 0,ht=void 0,Ue=!1;try{ke=q.then}catch(tt){Ue=!0,ht=tt}if(ke===E&&q._state!==O)this._settledAt(q._state,Y,q._result);else if(typeof ke!="function")this._remaining--,this._result[Y]=q;else if(J===nt){var je=new J(A);Ue?ue(je,ht):V(je,q,ke),this._willSettleAt(je,Y)}else this._willSettleAt(new J(function(tt){return tt(q)}),Y)}else this._willSettleAt(Ee(q),Y)},P.prototype._settledAt=function(q,Y,J){var Ee=this.promise;Ee._state===O&&(this._remaining--,q===N?ue(Ee,J):this._result[Y]=J),this._remaining===0&&Z(Ee,this._result)},P.prototype._willSettleAt=function(q,Y){var J=this;he(q,void 0,function(Ee){return J._settledAt(D,Y,Ee)},function(Ee){return J._settledAt(N,Y,Ee)})},P}();function ze(P){return new Be(this,P).promise}function ye(P){var U=this;return S(P)?new U(function(q,Y){for(var J=P.length,Ee=0;Ee<J;Ee++)U.resolve(P[Ee]).then(q,Y)}):new U(function(q,Y){return Y(new TypeError("You must pass an array to race."))})}function me(P){var U=this,q=new U(A);return ue(q,P),q}function We(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function He(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var nt=function(){function P(U){this[x]=xe(),this._result=this._state=void 0,this._subscribers=[],A!==U&&(typeof U!="function"&&We(),this instanceof P?Pe(this,U):He())}return P.prototype.catch=function(q){return this.then(null,q)},P.prototype.finally=function(q){var Y=this,J=Y.constructor;return w(q)?Y.then(function(Ee){return J.resolve(q()).then(function(){return Ee})},function(Ee){return J.resolve(q()).then(function(){throw Ee})}):Y.then(q,q)},P}();nt.prototype.then=E,nt.all=ze,nt.race=ye,nt.resolve=o,nt.reject=me,nt._setScheduler=c,nt._setAsap=l,nt._asap=p;function te(){var P=void 0;if(typeof ee!="undefined")P=ee;else if(typeof self!="undefined")P=self;else try{P=Function("return this")()}catch(Y){throw new Error("polyfill failed because global object is unavailable in this environment")}var U=P.Promise;if(U){var q=null;try{q=Object.prototype.toString.call(U.resolve())}catch(Y){}if(q==="[object Promise]"&&!U.cast)return}P.Promise=nt}return nt.polyfill=te,nt.Promise=nt,nt})}).call(this,H("Q2Ig"),H("IyRk"))},E9nw:function(rt,$e){rt.exports=function(){var H=document.getSelection();if(!H.rangeCount)return function(){};for(var de=document.activeElement,ee=[],j=0;j<H.rangeCount;j++)ee.push(H.getRangeAt(j));switch(de.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":de.blur();break;default:de=null;break}return H.removeAllRanges(),function(){H.type==="Caret"&&H.removeAllRanges(),H.rangeCount||ee.forEach(function(w){H.addRange(w)}),de&&de.focus()}}},EHPI:function(rt,$e,H){"use strict";var de=H("bbsP"),ee=H("/wGt"),j=H("tJVT"),w=H("k1fw"),k=H("q1tI"),S=H.n(k),T=H("ZW9T"),C=H("ZD9Y"),h=H("M8RZ"),p=H("bCnd"),c=H("fcyK"),l=H.n(c),a={theme:Object(p.a)("cmCodeMode","vs-dark"),fontSize:Object(p.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(p.a)("cmTabToSpace",!0)},u;(function(i){i[i.set_font_size=0]="set_font_size",i[i.set_theme=1]="set_theme",i[i.on_tab_to_space=2]="on_tab_to_space",i[i.set_show_editor_setting=3]="set_show_editor_setting"})(u||(u={}));function s(i,n){switch(n.type){case u.set_show_editor_setting:return Object(w.a)(Object(w.a)({},i),{},{showEditorSetting:n.payload});case u.set_theme:return Object(w.a)(Object(w.a)({},i),{},{theme:n.payload});case u.set_font_size:return Object(w.a)(Object(w.a)({},i),{},{fontSize:n.payload});case u.on_tab_to_space:return Object(w.a)(Object(w.a)({},i),{},{tabToSpace:n.payload});default:throw new Error}}$e.a=function(i){var n=i.value,t=i.onChange,d=i.language,v=i.ActionBarRender,g=v===void 0?function(K){return S.a.createElement(f,{onShowCodeSetting:K})}:v,b=Object(k.useReducer)(s,a),_=Object(j.a)(b,2),m=_[0],y=_[1],E=m.theme,o=m.fontSize,x=m.showEditorSetting,A=m.tabToSpace,O={onFontSizeChange:function(oe){y({type:u.set_font_size,payload:oe}),Object(p.b)("cmFontSize",oe)},tabToSpace:A,cmFontSize:o,className:"oj",cmCodeMode:E,onTabToSpace:function(oe){y({type:u.on_tab_to_space,payload:oe}),Object(p.b)("cmTabToSpace",oe)},onCodeModeChange:function(oe){y({type:u.set_theme,payload:oe}),Object(p.b)("cmCodeMode",oe)}};function D(){y({type:u.set_show_editor_setting,payload:!1})}function N(){y({type:u.set_show_editor_setting,payload:!0})}var W={value:n,language:d,onChange:t,theme:E,height:"calc(100% - 56px)",options:{fontSize:o,insertSpaces:A}};return S.a.createElement(k.Fragment,null,S.a.createElement("div",{className:"code-panel-container"},g(N),S.a.createElement(T.b,W)),S.a.createElement(h.a,null,S.a.createElement(ee.a,{className:"oj",title:null,placement:"right",closable:!1,visible:x,onClose:D},S.a.createElement(C.a,O))))};function f(i){var n=i.onShowCodeSetting;return S.a.createElement("div",{className:"action-bar"},S.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),S.a.createElement("a",{onClick:n},S.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(rt,$e,H){(function(de){de(H("VrN/"))})(function(de){var ee={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},j=de.Pos;de.defineOption("autoCloseBrackets",!1,function(s,f,i){i&&i!=de.Init&&(s.removeKeyMap(k),s.state.closeBrackets=null),f&&(S(w(f,"pairs")),s.state.closeBrackets=f,s.addKeyMap(k))});function w(s,f){return f=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[f]!=null?s[f]:ee[f]}var k={Backspace:h,Enter:p};function S(s){for(var f=0;f<s.length;f++){var i=s.charAt(f),n="'"+i+"'";k[n]||(k[n]=T(i))}}S(ee.pairs+"`");function T(s){return function(f){return l(f,s)}}function C(s){var f=s.state.closeBrackets;if(!f||f.override)return f;var i=s.getModeAt(s.getCursor());return i.closeBrackets||f}function h(s){var f=C(s);if(!f||s.getOption("disableInput"))return de.Pass;for(var i=w(f,"pairs"),n=s.listSelections(),t=0;t<n.length;t++){if(!n[t].empty())return de.Pass;var d=a(s,n[t].head);if(!d||i.indexOf(d)%2!=0)return de.Pass}for(var t=n.length-1;t>=0;t--){var v=n[t].head;s.replaceRange("",j(v.line,v.ch-1),j(v.line,v.ch+1),"+delete")}}function p(s){var f=C(s),i=f&&w(f,"explode");if(!i||s.getOption("disableInput"))return de.Pass;for(var n=s.listSelections(),t=0;t<n.length;t++){if(!n[t].empty())return de.Pass;var d=a(s,n[t].head);if(!d||i.indexOf(d)%2!=0)return de.Pass}s.operation(function(){var v=s.lineSeparator()||`
|
|
|
`;s.replaceSelection(v+v,null),s.execCommand("goCharLeft"),n=s.listSelections();for(var g=0;g<n.length;g++){var b=n[g].head.line;s.indentLine(b,null,!0),s.indentLine(b+1,null,!0)}})}function c(s){var f=de.cmpPos(s.anchor,s.head)>0;return{anchor:new j(s.anchor.line,s.anchor.ch+(f?-1:1)),head:new j(s.head.line,s.head.ch+(f?1:-1))}}function l(s,f){var i=C(s);if(!i||s.getOption("disableInput"))return de.Pass;var n=w(i,"pairs"),t=n.indexOf(f);if(t==-1)return de.Pass;for(var d=w(i,"closeBefore"),v=w(i,"triples"),g=n.charAt(t+1)==f,b=s.listSelections(),_=t%2==0,m,y=0;y<b.length;y++){var E=b[y],o=E.head,x,A=s.getRange(o,j(o.line,o.ch+1));if(_&&!E.empty())x="surround";else if((g||!_)&&A==f)g&&u(s,o)?x="both":v.indexOf(f)>=0&&s.getRange(o,j(o.line,o.ch+3))==f+f+f?x="skipThree":x="skip";else if(g&&o.ch>1&&v.indexOf(f)>=0&&s.getRange(j(o.line,o.ch-2),o)==f+f){if(o.ch>2&&/\bstring/.test(s.getTokenTypeAt(j(o.line,o.ch-2))))return de.Pass;x="addFour"}else if(g){var O=o.ch==0?" ":s.getRange(j(o.line,o.ch-1),o);if(!de.isWordChar(A)&&O!=f&&!de.isWordChar(O))x="both";else return de.Pass}else if(_&&(A.length===0||/\s/.test(A)||d.indexOf(A)>-1))x="both";else return de.Pass;if(!m)m=x;else if(m!=x)return de.Pass}var D=t%2?n.charAt(t-1):f,N=t%2?f:n.charAt(t+1);s.operation(function(){if(m=="skip")s.execCommand("goCharRight");else if(m=="skipThree")for(var W=0;W<3;W++)s.execCommand("goCharRight");else if(m=="surround"){for(var K=s.getSelections(),W=0;W<K.length;W++)K[W]=D+K[W]+N;s.replaceSelections(K,"around"),K=s.listSelections().slice();for(var W=0;W<K.length;W++)K[W]=c(K[W]);s.setSelections(K)}else m=="both"?(s.replaceSelection(D+N,null),s.triggerElectric(D+N),s.execCommand("goCharLeft")):m=="addFour"&&(s.replaceSelection(D+D+D+D,"before"),s.execCommand("goCharRight"))})}function a(s,f){var i=s.getRange(j(f.line,f.ch-1),j(f.line,f.ch+1));return i.length==2?i:null}function u(s,f){var i=s.getTokenAt(j(f.line,f.ch+1));return/\bstring/.test(i.type)&&i.start==f.ch&&(f.ch==0||!/\bstring/.test(s.getTokenTypeAt(f)))}})},FOrL:function(rt,$e,H){rt.exports=H.p+"static/nodata.a6b3f948.png"},GUcZ:function(rt,$e,H){"use strict";var de=H("fWQN"),ee=H("mtLc"),j=function(){function Re(){Object(de.a)(this,Re)}return Object(ee.a)(Re,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(z,Q){return z.__proto__=Q,z},Object.assign=Object.assign||function(z){if(z==null)throw new TypeError("Cannot convert undefined or null to object");for(var Q=Object(z),ae=1;ae<arguments.length;ae++){var fe=arguments[ae];if(fe!=null)for(var Ae in fe)fe.hasOwnProperty(Ae)&&(Q[Ae]=fe[Ae])}return Q},typeof self.Promise!="function"&&H("E2g8").polyfill()}}]),Re}();j.install();var w=j,k=H("+qE3"),S=H.n(k),T=function(){function Re(){Object(de.a)(this,Re)}return Object(ee.a)(Re,null,[{key:"e",value:function(z,Q){(!z||Re.FORCE_GLOBAL_TAG)&&(z=Re.GLOBAL_TAG);var ae="[".concat(z,"] > ").concat(Q);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","error",ae),!Re.ENABLE_ERROR)return;console.error?console.error(ae):console.warn?console.warn(ae):console.log(ae)}},{key:"i",value:function(z,Q){(!z||Re.FORCE_GLOBAL_TAG)&&(z=Re.GLOBAL_TAG);var ae="[".concat(z,"] > ").concat(Q);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","info",ae),!Re.ENABLE_INFO)return;console.info?console.info(ae):console.log(ae)}},{key:"w",value:function(z,Q){(!z||Re.FORCE_GLOBAL_TAG)&&(z=Re.GLOBAL_TAG);var ae="[".concat(z,"] > ").concat(Q);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","warn",ae),!Re.ENABLE_WARN)return;console.warn?console.warn(ae):console.log(ae)}},{key:"d",value:function(z,Q){(!z||Re.FORCE_GLOBAL_TAG)&&(z=Re.GLOBAL_TAG);var ae="[".concat(z,"] > ").concat(Q);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","debug",ae),!Re.ENABLE_DEBUG)return;console.debug?console.debug(ae):console.log(ae)}},{key:"v",value:function(z,Q){(!z||Re.FORCE_GLOBAL_TAG)&&(z=Re.GLOBAL_TAG);var ae="[".concat(z,"] > ").concat(Q);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","verbose",ae),!Re.ENABLE_VERBOSE)return;console.log(ae)}}]),Re}();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 S.a;var C=T,h=function(){function Re(){Object(de.a)(this,Re),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(ee.a)(Re,[{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}}]),Re}(),p=h,c=H("yKVA"),l=H("879j"),a=function(){function Re(ve){Object(de.a)(this,Re),this._message=ve}return Object(ee.a)(Re,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),Re}(),u=function(Re){Object(c.a)(z,Re);var ve=Object(l.a)(z);function z(Q){return Object(de.a)(this,z),ve.call(this,Q)}return Object(ee.a)(z,[{key:"name",get:function(){return"IllegalStateException"}}]),z}(a),s=function(Re){Object(c.a)(z,Re);var ve=Object(l.a)(z);function z(Q){return Object(de.a)(this,z),ve.call(this,Q)}return Object(ee.a)(z,[{key:"name",get:function(){return"InvalidArgumentException"}}]),z}(a),f=function(Re){Object(c.a)(z,Re);var ve=Object(l.a)(z);function z(Q){return Object(de.a)(this,z),ve.call(this,Q)}return Object(ee.a)(z,[{key:"name",get:function(){return"NotImplementedException"}}]),z}(a),i={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},n={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},t=function(){function Re(ve){Object(de.a)(this,Re),this._type=ve||"undefined",this._status=i.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(ee.a)(Re,[{key:"destroy",value:function(){this._status=i.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===i.kConnecting||this._status===i.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,Q){throw new f("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new f("Unimplemented abstract function!")}}]),Re}(),d=H("oZsa");function v(Re,ve){for(;!Object.prototype.hasOwnProperty.call(Re,ve)&&!(Re=Object(d.a)(Re),Re===null););return Re}function g(Re,ve,z){return typeof Reflect!="undefined"&&Reflect.get?g=Reflect.get:g=function(ae,fe,Ae){var Je=v(ae,fe);if(!Je)return;var at=Object.getOwnPropertyDescriptor(Je,fe);return at.get?at.get.call(Ae):at.value},g(Re,ve,z||Re)}var b={};function _(){var Re=self.navigator.userAgent.toLowerCase(),ve=/(edge)\/([\w.]+)/.exec(Re)||/(opr)[\/]([\w.]+)/.exec(Re)||/(chrome)[ \/]([\w.]+)/.exec(Re)||/(iemobile)[\/]([\w.]+)/.exec(Re)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Re)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Re)||/(webkit)[ \/]([\w.]+)/.exec(Re)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(Re)||/(msie) ([\w.]+)/.exec(Re)||Re.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(Re)||Re.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(Re)||[],z=/(ipad)/.exec(Re)||/(ipod)/.exec(Re)||/(windows phone)/.exec(Re)||/(iphone)/.exec(Re)||/(kindle)/.exec(Re)||/(android)/.exec(Re)||/(windows)/.exec(Re)||/(mac)/.exec(Re)||/(linux)/.exec(Re)||/(cros)/.exec(Re)||[],Q={browser:ve[5]||ve[3]||ve[1]||"",version:ve[2]||ve[4]||"0",majorVersion:ve[4]||ve[2]||"0",platform:z[0]||""},ae={};if(Q.browser){ae[Q.browser]=!0;var fe=Q.majorVersion.split(".");ae.version={major:parseInt(Q.majorVersion,10),string:Q.version},fe.length>1&&(ae.version.minor=parseInt(fe[1],10)),fe.length>2&&(ae.version.build=parseInt(fe[2],10))}if(Q.platform&&(ae[Q.platform]=!0),(ae.chrome||ae.opr||ae.safari)&&(ae.webkit=!0),ae.rv||ae.iemobile){ae.rv&&delete ae.rv;var Ae="msie";Q.browser=Ae,ae[Ae]=!0}if(ae.edge){delete ae.edge;var Je="msedge";Q.browser=Je,ae[Je]=!0}if(ae.opr){var at="opera";Q.browser=at,ae[at]=!0}if(ae.safari&&ae.android){var Lt="android";Q.browser=Lt,ae[Lt]=!0}ae.name=Q.browser,ae.platform=Q.platform;for(var It in b)b.hasOwnProperty(It)&&delete b[It];Object.assign(b,ae)}_();var m=b,y=function(Re){Object(c.a)(z,Re);var ve=Object(l.a)(z);function z(Q,ae){var fe;return Object(de.a)(this,z),fe=ve.call(this,"fetch-stream-loader"),fe.TAG="FetchStreamLoader",fe._seekHandler=Q,fe._config=ae,fe._needStash=!0,fe._requestAbort=!1,fe._contentLength=null,fe._receivedLength=0,fe}return Object(ee.a)(z,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),g(Object(d.a)(z.prototype),"destroy",this).call(this)}},{key:"open",value:function(ae,fe){var Ae=this;this._dataSource=ae,this._range=fe;var Je=ae.url;this._config.reuseRedirectedURL&&ae.redirectedURL!=null&&(Je=ae.redirectedURL);var at=this._seekHandler.getConfig(Je,fe),Lt=new self.Headers;if(typeof at.headers=="object"){var It=at.headers;for(var ct in It)It.hasOwnProperty(ct)&&Lt.append(ct,It[ct])}var kt={method:"GET",headers:Lt,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var nn in this._config.headers)Lt.append(nn,this._config.headers[nn]);ae.cors===!1&&(kt.mode="same-origin"),ae.withCredentials&&(kt.credentials="include"),ae.referrerPolicy&&(kt.referrerPolicy=ae.referrerPolicy),this._status=i.kConnecting,self.fetch(at.url,kt).then(function(Ot){if(Ae._requestAbort){Ae._requestAbort=!1,Ae._status=i.kIdle;return}if(Ot.ok&&Ot.status>=200&&Ot.status<=299){if(Ot.url!==at.url&&Ae._onURLRedirect){var un=Ae._seekHandler.removeURLParameters(Ot.url);Ae._onURLRedirect(un)}var an=Ot.headers.get("Content-Length");return an!=null&&(Ae._contentLength=parseInt(an),Ae._contentLength!==0&&(Ae._onContentLengthKnown&&Ae._onContentLengthKnown(Ae._contentLength))),Ae._pump.call(Ae,Ot.body.getReader())}else if(Ae._status=i.kError,Ae._onError)Ae._onError(n.HTTP_STATUS_CODE_INVALID,{code:Ot.status,msg:Ot.statusText});else throw new a("FetchStreamLoader: Http code invalid, "+Ot.status+" "+Ot.statusText)}).catch(function(Ot){if(Ae._status=i.kError,Ae._onError)Ae._onError(n.EXCEPTION,{code:-1,msg:Ot.message});else throw Ot})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(ae){var fe=this;return ae.read().then(function(Ae){if(Ae.done)if(fe._contentLength!==null&&fe._receivedLength<fe._contentLength){fe._status=i.kError;var Je=n.EARLY_EOF,at={code:-1,msg:"Fetch stream meet Early-EOF"};if(fe._onError)fe._onError(Je,at);else throw new a(at.msg)}else fe._status=i.kComplete,fe._onComplete&&fe._onComplete(fe._range.from,fe._range.from+fe._receivedLength-1);else{if(fe._requestAbort===!0)return fe._requestAbort=!1,fe._status=i.kComplete,ae.cancel();fe._status=i.kBuffering;var Lt=Ae.value.buffer,It=fe._range.from+fe._receivedLength;fe._receivedLength+=Lt.byteLength,fe._onDataArrival&&fe._onDataArrival(Lt,It,fe._receivedLength),fe._pump(ae)}}).catch(function(Ae){if(Ae.code===11&&m.msedge)return;fe._status=i.kError;var Je=0,at=null;if((Ae.code===19||Ae.message==="network error")&&(fe._contentLength===null||fe._contentLength!==null&&fe._receivedLength<fe._contentLength)?(Je=n.EARLY_EOF,at={code:Ae.code,msg:"Fetch stream meet Early-EOF"}):(Je=n.EXCEPTION,at={code:Ae.code,msg:Ae.message}),fe._onError)fe._onError(Je,at);else throw new a(at.msg)})}}],[{key:"isSupported",value:function(){try{var ae=m.msedge&&m.version.minor>=15048,fe=m.msedge?ae:!0;return self.fetch&&self.ReadableStream&&fe}catch(Ae){return!1}}}]),z}(t),E=y,o=function(Re){Object(c.a)(z,Re);var ve=Object(l.a)(z);function z(Q,ae){var fe;return Object(de.a)(this,z),fe=ve.call(this,"xhr-moz-chunked-loader"),fe.TAG="MozChunkedLoader",fe._seekHandler=Q,fe._config=ae,fe._needStash=!0,fe._xhr=null,fe._requestAbort=!1,fe._contentLength=null,fe._receivedLength=0,fe}return Object(ee.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),g(Object(d.a)(z.prototype),"destroy",this).call(this)}},{key:"open",value:function(ae,fe){this._dataSource=ae,this._range=fe;var Ae=ae.url;this._config.reuseRedirectedURL&&ae.redirectedURL!=null&&(Ae=ae.redirectedURL);var Je=this._seekHandler.getConfig(Ae,fe);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),ae.withCredentials&&(at.withCredentials=!0),typeof Je.headers=="object"){var Lt=Je.headers;for(var It in Lt)Lt.hasOwnProperty(It)&&at.setRequestHeader(It,Lt[It])}if(typeof this._config.headers=="object"){var ct=this._config.headers;for(var kt in ct)ct.hasOwnProperty(kt)&&at.setRequestHeader(kt,ct[kt])}this._status=i.kConnecting,at.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=i.kComplete}},{key:"_onReadyStateChange",value:function(ae){var fe=ae.target;if(fe.readyState===2){if(fe.responseURL!=null&&fe.responseURL!==this._requestURL&&this._onURLRedirect){var Ae=this._seekHandler.removeURLParameters(fe.responseURL);this._onURLRedirect(Ae)}if(fe.status!==0&&(fe.status<200||fe.status>299))if(this._status=i.kError,this._onError)this._onError(n.HTTP_STATUS_CODE_INVALID,{code:fe.status,msg:fe.statusText});else throw new a("MozChunkedLoader: Http code invalid, "+fe.status+" "+fe.statusText);else this._status=i.kBuffering}}},{key:"_onProgress",value:function(ae){if(this._status===i.kError)return;this._contentLength===null&&(ae.total!==null&&ae.total!==0&&(this._contentLength=ae.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var fe=ae.target.response,Ae=this._range.from+this._receivedLength;this._receivedLength+=fe.byteLength,this._onDataArrival&&this._onDataArrival(fe,Ae,this._receivedLength)}},{key:"_onLoadEnd",value:function(ae){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===i.kError)return;this._status=i.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function(ae){this._status=i.kError;var fe=0,Ae=null;if(this._contentLength&&ae.loaded<this._contentLength?(fe=n.EARLY_EOF,Ae={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(fe=n.EXCEPTION,Ae={code:-1,msg:ae.constructor.name+" "+ae.type}),this._onError)this._onError(fe,Ae);else throw new a(Ae.msg)}}],[{key:"isSupported",value:function(){try{var ae=new XMLHttpRequest;return ae.open("GET","https://example.com",!0),ae.responseType="moz-chunked-arraybuffer",ae.responseType==="moz-chunked-arraybuffer"}catch(fe){return C.w("MozChunkedLoader",fe.message),!1}}}]),z}(t),x=o,A=function(Re){Object(c.a)(z,Re);var ve=Object(l.a)(z);function z(Q,ae){var fe;return Object(de.a)(this,z),fe=ve.call(this,"xhr-msstream-loader"),fe.TAG="MSStreamLoader",fe._seekHandler=Q,fe._config=ae,fe._needStash=!0,fe._xhr=null,fe._reader=null,fe._totalRange=null,fe._currentRange=null,fe._currentRequestURL=null,fe._currentRedirectedURL=null,fe._contentLength=null,fe._receivedLength=0,fe._bufferLimit=16*1024*1024,fe._lastTimeBufferSize=0,fe._isReconnecting=!1,fe}return Object(ee.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),g(Object(d.a)(z.prototype),"destroy",this).call(this)}},{key:"open",value:function(ae,fe){this._internalOpen(ae,fe,!1)}},{key:"_internalOpen",value:function(ae,fe,Ae){this._dataSource=ae,Ae?this._currentRange=fe:this._totalRange=fe;var Je=ae.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Je=this._currentRedirectedURL:ae.redirectedURL!=null&&(Je=ae.redirectedURL));var at=this._seekHandler.getConfig(Je,fe);this._currentRequestURL=at.url;var Lt=this._reader=new self.MSStreamReader;Lt.onprogress=this._msrOnProgress.bind(this),Lt.onload=this._msrOnLoad.bind(this),Lt.onerror=this._msrOnError.bind(this);var It=this._xhr=new XMLHttpRequest;if(It.open("GET",at.url,!0),It.responseType="ms-stream",It.onreadystatechange=this._xhrOnReadyStateChange.bind(this),It.onerror=this._xhrOnError.bind(this),ae.withCredentials&&(It.withCredentials=!0),typeof at.headers=="object"){var ct=at.headers;for(var kt in ct)ct.hasOwnProperty(kt)&&It.setRequestHeader(kt,ct[kt])}if(typeof this._config.headers=="object"){var nn=this._config.headers;for(var Ot in nn)nn.hasOwnProperty(Ot)&&It.setRequestHeader(Ot,nn[Ot])}this._isReconnecting?this._isReconnecting=!1:this._status=i.kConnecting,It.send()}},{key:"abort",value:function(){this._internalAbort(),this._status=i.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(ae){var fe=ae.target;if(fe.readyState===2)if(fe.status>=200&&fe.status<=299){if(this._status=i.kBuffering,fe.responseURL!=null){var Ae=this._seekHandler.removeURLParameters(fe.responseURL);fe.responseURL!==this._currentRequestURL&&Ae!==this._currentRedirectedURL&&(this._currentRedirectedURL=Ae,this._onURLRedirect&&this._onURLRedirect(Ae))}var Je=fe.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=i.kError,this._onError)this._onError(n.HTTP_STATUS_CODE_INVALID,{code:fe.status,msg:fe.statusText});else throw new a("MSStreamLoader: Http code invalid, "+fe.status+" "+fe.statusText);else if(fe.readyState===3&&(fe.status>=200&&fe.status<=299)){this._status=i.kBuffering;var Lt=fe.response;this._reader.readAsArrayBuffer(Lt)}}},{key:"_xhrOnError",value:function(ae){this._status=i.kError;var fe=n.EXCEPTION,Ae={code:-1,msg:ae.constructor.name+" "+ae.type};if(this._onError)this._onError(fe,Ae);else throw new a(Ae.msg)}},{key:"_msrOnProgress",value:function(ae){var fe=ae.target,Ae=fe.result;if(Ae==null){this._doReconnectIfNeeded();return}var Je=Ae.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=Ae.byteLength;var at=this._totalRange.from+this._receivedLength;this._receivedLength+=Je.byteLength,this._onDataArrival&&this._onDataArrival(Je,at,this._receivedLength),Ae.byteLength>=this._bufferLimit&&(C.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 ae={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,ae,!0)}}},{key:"_msrOnLoad",value:function(ae){this._status=i.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}},{key:"_msrOnError",value:function(ae){this._status=i.kError;var fe=0,Ae=null;if(this._contentLength&&this._receivedLength<this._contentLength?(fe=n.EARLY_EOF,Ae={code:-1,msg:"MSStream meet Early-Eof"}):(fe=n.EARLY_EOF,Ae={code:-1,msg:ae.constructor.name+" "+ae.type}),this._onError)this._onError(fe,Ae);else throw new a(Ae.msg)}}],[{key:"isSupported",value:function(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;var ae=new XMLHttpRequest;return ae.open("GET","https://example.com",!0),ae.responseType="ms-stream",ae.responseType==="ms-stream"}catch(fe){return C.w("MSStreamLoader",fe.message),!1}}}]),z}(t),O=A,D=function(Re){Object(c.a)(z,Re);var ve=Object(l.a)(z);function z(Q,ae){var fe;return Object(de.a)(this,z),fe=ve.call(this,"xhr-range-loader"),fe.TAG="RangeLoader",fe._seekHandler=Q,fe._config=ae,fe._needStash=!1,fe._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],fe._currentChunkSizeKB=384,fe._currentSpeedNormalized=0,fe._zeroSpeedChunkCount=0,fe._xhr=null,fe._speedSampler=new p,fe._requestAbort=!1,fe._waitForTotalLength=!1,fe._totalLengthReceived=!1,fe._currentRequestURL=null,fe._currentRedirectedURL=null,fe._currentRequestRange=null,fe._totalLength=null,fe._contentLength=null,fe._receivedLength=0,fe._lastTimeLoaded=0,fe}return Object(ee.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),g(Object(d.a)(z.prototype),"destroy",this).call(this)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}},{key:"open",value:function(ae,fe){this._dataSource=ae,this._range=fe,this._status=i.kConnecting;var Ae=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(Ae=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!Ae?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}},{key:"_openSubRange",value:function(){var ae=this._currentChunkSizeKB*1024,fe=this._range.from+this._receivedLength,Ae=fe+ae;this._contentLength!=null&&(Ae-this._range.from>=this._contentLength&&(Ae=this._range.from+this._contentLength-1)),this._currentRequestRange={from:fe,to:Ae},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(ae,fe){this._lastTimeLoaded=0;var Ae=ae.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Ae=this._currentRedirectedURL:ae.redirectedURL!=null&&(Ae=ae.redirectedURL));var Je=this._seekHandler.getConfig(Ae,fe);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),ae.withCredentials&&(at.withCredentials=!0),typeof Je.headers=="object"){var Lt=Je.headers;for(var It in Lt)Lt.hasOwnProperty(It)&&at.setRequestHeader(It,Lt[It])}if(typeof this._config.headers=="object"){var ct=this._config.headers;for(var kt in ct)ct.hasOwnProperty(kt)&&at.setRequestHeader(kt,ct[kt])}at.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=i.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(ae){var fe=ae.target;if(fe.readyState===2){if(fe.responseURL!=null){var Ae=this._seekHandler.removeURLParameters(fe.responseURL);fe.responseURL!==this._currentRequestURL&&Ae!==this._currentRedirectedURL&&(this._currentRedirectedURL=Ae,this._onURLRedirect&&this._onURLRedirect(Ae))}if(fe.status>=200&&fe.status<=299){if(this._waitForTotalLength)return;this._status=i.kBuffering}else if(this._status=i.kError,this._onError)this._onError(n.HTTP_STATUS_CODE_INVALID,{code:fe.status,msg:fe.statusText});else throw new a("RangeLoader: Http code invalid, "+fe.status+" "+fe.statusText)}}},{key:"_onProgress",value:function(ae){if(this._status===i.kError)return;if(this._contentLength===null){var fe=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,fe=!0;var Ae=ae.total;this._internalAbort(),Ae!=null&Ae!==0&&(this._totalLength=Ae)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,fe){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Je=ae.loaded-this._lastTimeLoaded;this._lastTimeLoaded=ae.loaded,this._speedSampler.addBytes(Je)}},{key:"_normalizeSpeed",value:function(ae){var fe=this._chunkSizeKBList,Ae=fe.length-1,Je=0,at=0,Lt=Ae;if(ae<fe[0])return fe[0];for(;at<=Lt;){if(Je=at+Math.floor((Lt-at)/2),Je===Ae||ae>=fe[Je]&&ae<fe[Je+1])return fe[Je];fe[Je]<ae?at=Je+1:Lt=Je-1}}},{key:"_onLoad",value:function(ae){if(this._status===i.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var fe=this._speedSampler.lastSecondKBps;if(fe===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(fe=this._speedSampler.currentKBps)),fe!==0){var Ae=this._normalizeSpeed(fe);this._currentSpeedNormalized!==Ae&&(this._currentSpeedNormalized=Ae,this._currentChunkSizeKB=Ae)}var Je=ae.target.response,at=this._range.from+this._receivedLength;this._receivedLength+=Je.byteLength;var Lt=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():Lt=!0,this._onDataArrival&&this._onDataArrival(Je,at,this._receivedLength),Lt&&(this._status=i.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},{key:"_onXhrError",value:function(ae){this._status=i.kError;var fe=0,Ae=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(fe=n.EARLY_EOF,Ae={code:-1,msg:"RangeLoader meet Early-Eof"}):(fe=n.EXCEPTION,Ae={code:-1,msg:ae.constructor.name+" "+ae.type}),this._onError)this._onError(fe,Ae);else throw new a(Ae.msg)}}],[{key:"isSupported",value:function(){try{var ae=new XMLHttpRequest;return ae.open("GET","https://example.com",!0),ae.responseType="arraybuffer",ae.responseType==="arraybuffer"}catch(fe){return C.w("RangeLoader",fe.message),!1}}}]),z}(t),N=D,W=function(Re){Object(c.a)(z,Re);var ve=Object(l.a)(z);function z(){var Q;return Object(de.a)(this,z),Q=ve.call(this,"websocket-loader"),Q.TAG="WebSocketLoader",Q._needStash=!0,Q._ws=null,Q._requestAbort=!1,Q._receivedLength=0,Q}return Object(ee.a)(z,[{key:"destroy",value:function(){this._ws&&this.abort(),g(Object(d.a)(z.prototype),"destroy",this).call(this)}},{key:"open",value:function(ae){try{var fe=this._ws=new self.WebSocket(ae.url);fe.binaryType="arraybuffer",fe.onopen=this._onWebSocketOpen.bind(this),fe.onclose=this._onWebSocketClose.bind(this),fe.onmessage=this._onWebSocketMessage.bind(this),fe.onerror=this._onWebSocketError.bind(this),this._status=i.kConnecting}catch(Je){this._status=i.kError;var Ae={code:Je.code,msg:Je.message};if(this._onError)this._onError(n.EXCEPTION,Ae);else throw new a(Ae.msg)}}},{key:"abort",value:function(){var ae=this._ws;ae&&(ae.readyState===0||ae.readyState===1)&&(this._requestAbort=!0,ae.close()),this._ws=null,this._status=i.kComplete}},{key:"_onWebSocketOpen",value:function(ae){this._status=i.kBuffering}},{key:"_onWebSocketClose",value:function(ae){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=i.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}},{key:"_onWebSocketMessage",value:function(ae){var fe=this;if(ae.data instanceof ArrayBuffer)this._dispatchArrayBuffer(ae.data);else if(ae.data instanceof Blob){var Ae=new FileReader;Ae.onload=function(){fe._dispatchArrayBuffer(Ae.result)},Ae.readAsArrayBuffer(ae.data)}else{this._status=i.kError;var Je={code:-1,msg:"Unsupported WebSocket message type: "+ae.data.constructor.name};if(this._onError)this._onError(n.EXCEPTION,Je);else throw new a(Je.msg)}}},{key:"_dispatchArrayBuffer",value:function(ae){var fe=ae,Ae=this._receivedLength;this._receivedLength+=fe.byteLength,this._onDataArrival&&this._onDataArrival(fe,Ae,this._receivedLength)}},{key:"_onWebSocketError",value:function(ae){this._status=i.kError;var fe={code:ae.code,msg:ae.message};if(this._onError)this._onError(n.EXCEPTION,fe);else throw new a(fe.msg)}}],[{key:"isSupported",value:function(){try{return typeof self.WebSocket!="undefined"}catch(ae){return!1}}}]),z}(t),K=W,oe=function(){function Re(ve){Object(de.a)(this,Re),this._zeroStart=ve||!1}return Object(ee.a)(Re,[{key:"getConfig",value:function(z,Q){var ae={};if(Q.from!==0||Q.to!==-1){var fe;Q.to!==-1?fe="bytes=".concat(Q.from.toString(),"-").concat(Q.to.toString()):fe="bytes=".concat(Q.from.toString(),"-"),ae.Range=fe}else this._zeroStart&&(ae.Range="bytes=0-");return{url:z,headers:ae}}},{key:"removeURLParameters",value:function(z){return z}}]),Re}(),B=oe,X=function(){function Re(ve,z){Object(de.a)(this,Re),this._startName=ve,this._endName=z}return Object(ee.a)(Re,[{key:"getConfig",value:function(z,Q){var ae=z;if(Q.from!==0||Q.to!==-1){var fe=!0;ae.indexOf("?")===-1&&(ae+="?",fe=!1),fe&&(ae+="&"),ae+="".concat(this._startName,"=").concat(Q.from.toString()),Q.to!==-1&&(ae+="&".concat(this._endName,"=").concat(Q.to.toString()))}return{url:ae,headers:{}}}},{key:"removeURLParameters",value:function(z){var Q=z.split("?")[0],ae=void 0,fe=z.indexOf("?");fe!==-1&&(ae=z.substring(fe+1));var Ae="";if(ae!=null&&ae.length>0)for(var Je=ae.split("&"),at=0;at<Je.length;at++){var Lt=Je[at].split("="),It=at>0;Lt[0]!==this._startName&&Lt[0]!==this._endName&&(It&&(Ae+="&"),Ae+=Je[at])}return Ae.length===0?Q:Q+"?"+Ae}}]),Re}(),V=X,ne=function(){function Re(ve,z,Q){Object(de.a)(this,Re),this.TAG="IOController",this._config=z,this._extraData=Q,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=ve,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(ve.url),this._refTotalLength=ve.filesize?ve.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(ee.a)(Re,[{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===N?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 B(this._config.rangeLoadZeroStart);else if(z.seekType==="param"){var Q=z.seekParamStart||"bstart",ae=z.seekParamEnd||"bend";this._seekHandler=new V(Q,ae)}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(E.isSupported())this._loaderClass=E;else if(x.isSupported())this._loaderClass=x;else if(N.isSupported())this._loaderClass=N;else throw new a("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,Q){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(Q),this._loader.destroy(),this._loader=null;var ae={from:z,to:-1};this._currentRange={from:ae.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,ae),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 Q=this._stashSize;Q+1024*1024*1<z;)Q*=2;if(Q+=1024*1024*1,Q===this._bufferSize)return;var ae=new ArrayBuffer(Q);if(this._stashUsed>0){var fe=new Uint8Array(this._stashBuffer,0,this._stashUsed),Ae=new Uint8Array(ae,0,Q);Ae.set(fe,0)}this._stashBuffer=ae,this._bufferSize=Q}},{key:"_normalizeSpeed",value:function(z){var Q=this._speedNormalizeList,ae=Q.length-1,fe=0,Ae=0,Je=ae;if(z<Q[0])return Q[0];for(;Ae<=Je;){if(fe=Ae+Math.floor((Je-Ae)/2),fe===ae||z>=Q[fe]&&z<Q[fe+1])return Q[fe];Q[fe]<z?Ae=fe+1:Je=fe-1}}},{key:"_adjustStashSize",value:function(z){var Q=0;this._config.isLive||z<512?Q=z:z>=512&&z<=1024?Q=Math.floor(z*1.5):Q=z*2,Q>8192&&(Q=8192);var ae=Q*1024+1024*1024*1;this._bufferSize<ae&&this._expandBuffer(ae),this._stashSize=Q*1024}},{key:"_dispatchChunks",value:function(z,Q){return this._currentRange.to=Q+z.byteLength-1,this._onDataArrival(z,Q)}},{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,Q,ae){if(!this._onDataArrival)throw new u("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 fe=this._speedSampler.lastSecondKBps;if(fe!==0){var Ae=this._normalizeSpeed(fe);this._speedNormalized!==Ae&&(this._speedNormalized=Ae,this._adjustStashSize(Ae))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=Q),this._stashUsed+z.byteLength<=this._stashSize){var nn=new Uint8Array(this._stashBuffer,0,this._stashSize);nn.set(new Uint8Array(z),this._stashUsed),this._stashUsed+=z.byteLength}else{var Ot=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var un=this._stashBuffer.slice(0,this._stashUsed),an=this._dispatchChunks(un,this._stashByteStart);if(an<un.byteLength){if(an>0){var re=new Uint8Array(un,an);Ot.set(re,0),this._stashUsed=re.byteLength,this._stashByteStart+=an}}else this._stashUsed=0,this._stashByteStart+=an;this._stashUsed+z.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+z.byteLength),Ot=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ot.set(new Uint8Array(z),this._stashUsed),this._stashUsed+=z.byteLength}else{var I=this._dispatchChunks(z,Q);if(I<z.byteLength){var F=z.byteLength-I;F>this._bufferSize&&(this._expandBuffer(F),Ot=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ot.set(new Uint8Array(z,I),0),this._stashUsed+=F,this._stashByteStart=Q+I}}}else if(this._stashUsed===0){var Je=this._dispatchChunks(z,Q);if(Je<z.byteLength){var at=z.byteLength-Je;at>this._bufferSize&&this._expandBuffer(at);var Lt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Lt.set(new Uint8Array(z,Je),0),this._stashUsed+=at,this._stashByteStart=Q+Je}}else{this._stashUsed+z.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+z.byteLength);var It=new Uint8Array(this._stashBuffer,0,this._bufferSize);It.set(new Uint8Array(z),this._stashUsed),this._stashUsed+=z.byteLength;var ct=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(ct<this._stashUsed&&ct>0){var kt=new Uint8Array(this._stashBuffer,ct);It.set(kt,0)}this._stashUsed-=ct,this._stashByteStart+=ct}}},{key:"_flushStashBuffer",value:function(z){if(this._stashUsed>0){var Q=this._stashBuffer.slice(0,this._stashUsed),ae=this._dispatchChunks(Q,this._stashByteStart),fe=Q.byteLength-ae;if(ae<Q.byteLength)if(z)C.w(this.TAG,"".concat(fe," bytes unconsumed data remain when flush buffer, dropped"));else{if(ae>0){var Ae=new Uint8Array(this._stashBuffer,0,this._bufferSize),Je=new Uint8Array(Q,ae);Ae.set(Je,0),this._stashUsed=Je.byteLength,this._stashByteStart+=ae}return 0}return this._stashUsed=0,this._stashByteStart=0,fe}return 0}},{key:"_onLoaderComplete",value:function(z,Q){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(z,Q){C.e(this.TAG,"Loader error, code = ".concat(Q.code,", msg = ").concat(Q.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,z=n.UNRECOVERABLE_EARLY_EOF);switch(z){case n.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var ae=this._currentRange.to+1;ae<this._totalLength&&(C.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(ae,!1));return}z=n.UNRECOVERABLE_EARLY_EOF;break}case n.UNRECOVERABLE_EARLY_EOF:case n.CONNECTING_TIMEOUT:case n.HTTP_STATUS_CODE_INVALID:case n.EXCEPTION:break}if(this._onError)this._onError(z,Q);else throw new a("IOException: "+Q.msg)}}]),Re}(),$=ne,Z={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function ue(){return Object.assign({},Z)}var he=function(){function Re(){Object(de.a)(this,Re)}return Object(ee.a)(Re,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 $({},ue()),Q=z.loaderType;return z.destroy(),Q=="fetch-stream-loader"||Q=="xhr-moz-chunked-loader"}},{key:"getNetworkLoaderTypeName",value:function(){var z=new $({},ue()),Q=z.loaderType;return z.destroy(),Q}},{key:"supportNativeMediaPlayback",value:function(z){Re.videoElement==null&&(Re.videoElement=window.document.createElement("video"));var Q=Re.videoElement.canPlayType(z);return Q==="probably"||Q=="maybe"}},{key:"getFeatureList",value:function(){var z={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return z.mseFlvPlayback=Re.supportMSEH264Playback(),z.networkStreamIO=Re.supportNetworkStreamIO(),z.networkLoaderName=Re.getNetworkLoaderTypeName(),z.mseLiveFlvPlayback=z.mseFlvPlayback&&z.networkStreamIO,z.nativeMP4H264Playback=Re.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),z.nativeWebmVP8Playback=Re.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),z.nativeWebmVP9Playback=Re.supportNativeMediaPlayback('video/webm; codecs="vp9"'),z}}]),Re}(),Oe=he,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"},Pe=we,_e=function(){function Re(){Object(de.a)(this,Re)}return Object(ee.a)(Re,null,[{key:"forceGlobalTag",get:function(){return C.FORCE_GLOBAL_TAG},set:function(z){C.FORCE_GLOBAL_TAG=z,Re._notifyChange()}},{key:"globalTag",get:function(){return C.GLOBAL_TAG},set:function(z){C.GLOBAL_TAG=z,Re._notifyChange()}},{key:"enableAll",get:function(){return C.ENABLE_VERBOSE&&C.ENABLE_DEBUG&&C.ENABLE_INFO&&C.ENABLE_WARN&&C.ENABLE_ERROR},set:function(z){C.ENABLE_VERBOSE=z,C.ENABLE_DEBUG=z,C.ENABLE_INFO=z,C.ENABLE_WARN=z,C.ENABLE_ERROR=z,Re._notifyChange()}},{key:"enableDebug",get:function(){return C.ENABLE_DEBUG},set:function(z){C.ENABLE_DEBUG=z,Re._notifyChange()}},{key:"enableVerbose",get:function(){return C.ENABLE_VERBOSE},set:function(z){C.ENABLE_VERBOSE=z,Re._notifyChange()}},{key:"enableInfo",get:function(){return C.ENABLE_INFO},set:function(z){C.ENABLE_INFO=z,Re._notifyChange()}},{key:"enableWarn",get:function(){return C.ENABLE_WARN},set:function(z){C.ENABLE_WARN=z,Re._notifyChange()}},{key:"enableError",get:function(){return C.ENABLE_ERROR},set:function(z){C.ENABLE_ERROR=z,Re._notifyChange()}},{key:"getConfig",value:function(){return{globalTag:C.GLOBAL_TAG,forceGlobalTag:C.FORCE_GLOBAL_TAG,enableVerbose:C.ENABLE_VERBOSE,enableDebug:C.ENABLE_DEBUG,enableInfo:C.ENABLE_INFO,enableWarn:C.ENABLE_WARN,enableError:C.ENABLE_ERROR,enableCallback:C.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(z){C.GLOBAL_TAG=z.globalTag,C.FORCE_GLOBAL_TAG=z.forceGlobalTag,C.ENABLE_VERBOSE=z.enableVerbose,C.ENABLE_DEBUG=z.enableDebug,C.ENABLE_INFO=z.enableInfo,C.ENABLE_WARN=z.enableWarn,C.ENABLE_ERROR=z.enableError,C.ENABLE_CALLBACK=z.enableCallback}},{key:"_notifyChange",value:function(){var z=Re.emitter;if(z.listenerCount("change")>0){var Q=Re.getConfig();z.emit("change",Q)}}},{key:"registerListener",value:function(z){Re.emitter.addListener("change",z)}},{key:"removeListener",value:function(z){Re.emitter.removeListener("change",z)}},{key:"addLogListener",value:function(z){C.emitter.addListener("log",z),C.emitter.listenerCount("log")>0&&(C.ENABLE_CALLBACK=!0,Re._notifyChange())}},{key:"removeLogListener",value:function(z){C.emitter.removeListener("log",z),C.emitter.listenerCount("log")===0&&(C.ENABLE_CALLBACK=!1,Re._notifyChange())}}]),Re}();_e.emitter=new S.a;var xe=_e,Ve=function(){function Re(){Object(de.a)(this,Re),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(ee.a)(Re,[{key:"isComplete",value:function(){var z=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,Q=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&&Q}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(z){if(this.keyframesIndex==null)return null;var Q=this.keyframesIndex,ae=this._search(Q.times,z);return{index:ae,milliseconds:Q.times[ae],fileposition:Q.filepositions[ae]}}},{key:"_search",value:function(z,Q){var ae=0,fe=z.length-1,Ae=0,Je=0,at=fe;for(Q<z[0]&&(ae=0,Je=at+1);Je<=at;)if(Ae=Je+Math.floor((at-Je)/2),Ae===fe||Q>=z[Ae]&&Q<z[Ae+1]){ae=Ae;break}else z[Ae]<Q?Je=Ae+1:at=Ae-1;return ae}}]),Re}(),Ne=Ve;function Be(Re,ve,z){var Q=Re;if(ve+z<Q.length){for(;z--;)if((Q[++ve]&192)!==128)return!1;return!0}else return!1}function ze(Re){for(var ve=[],z=Re,Q=0,ae=Re.length;Q<ae;){if(z[Q]<128){ve.push(String.fromCharCode(z[Q])),++Q;continue}else if(!(z[Q]<192)){if(z[Q]<224){if(Be(z,Q,1)){var fe=(z[Q]&31)<<6|z[Q+1]&63;if(fe>=128){ve.push(String.fromCharCode(fe&65535)),Q+=2;continue}}}else if(z[Q]<240){if(Be(z,Q,2)){var Ae=(z[Q]&15)<<12|(z[Q+1]&63)<<6|z[Q+2]&63;if(Ae>=2048&&(Ae&63488)!==55296){ve.push(String.fromCharCode(Ae&65535)),Q+=3;continue}}}else if(z[Q]<248&&Be(z,Q,3)){var Je=(z[Q]&7)<<18|(z[Q+1]&63)<<12|(z[Q+2]&63)<<6|z[Q+3]&63;if(Je>65536&&Je<1114112){Je-=65536,ve.push(String.fromCharCode(Je>>>10|55296)),ve.push(String.fromCharCode(Je&1023|56320)),Q+=4;continue}}}ve.push(String.fromCharCode(65533)),++Q}return ve.join("")}var ye=ze,me=function(){var Re=new ArrayBuffer(2);return new DataView(Re).setInt16(0,256,!0),new Int16Array(Re)[0]===256}(),We=function(){function Re(){Object(de.a)(this,Re)}return Object(ee.a)(Re,null,[{key:"parseScriptData",value:function(z,Q,ae){var fe={};try{var Ae=Re.parseValue(z,Q,ae),Je=Re.parseValue(z,Q+Ae.size,ae-Ae.size);fe[Ae.data]=Je.data}catch(at){C.e("AMF",at.toString())}return fe}},{key:"parseObject",value:function(z,Q,ae){if(ae<3)throw new u("Data not enough when parse ScriptDataObject");var fe=Re.parseString(z,Q,ae),Ae=Re.parseValue(z,Q+fe.size,ae-fe.size),Je=Ae.objectEnd;return{data:{name:fe.data,value:Ae.data},size:fe.size+Ae.size,objectEnd:Je}}},{key:"parseVariable",value:function(z,Q,ae){return Re.parseObject(z,Q,ae)}},{key:"parseString",value:function(z,Q,ae){if(ae<2)throw new u("Data not enough when parse String");var fe=new DataView(z,Q,ae),Ae=fe.getUint16(0,!me),Je;return Ae>0?Je=ye(new Uint8Array(z,Q+2,Ae)):Je="",{data:Je,size:2+Ae}}},{key:"parseLongString",value:function(z,Q,ae){if(ae<4)throw new u("Data not enough when parse LongString");var fe=new DataView(z,Q,ae),Ae=fe.getUint32(0,!me),Je;return Ae>0?Je=ye(new Uint8Array(z,Q+4,Ae)):Je="",{data:Je,size:4+Ae}}},{key:"parseDate",value:function(z,Q,ae){if(ae<10)throw new u("Data size invalid when parse Date");var fe=new DataView(z,Q,ae),Ae=fe.getFloat64(0,!me),Je=fe.getInt16(8,!me);return Ae+=Je*60*1e3,{data:new Date(Ae),size:8+2}}},{key:"parseValue",value:function(z,Q,ae){if(ae<1)throw new u("Data not enough when parse Value");var fe=new DataView(z,Q,ae),Ae=1,Je=fe.getUint8(0),at,Lt=!1;try{switch(Je){case 0:at=fe.getFloat64(1,!me),Ae+=8;break;case 1:{var It=fe.getUint8(1);at=!!It,Ae+=1;break}case 2:{var ct=Re.parseString(z,Q+1,ae-1);at=ct.data,Ae+=ct.size;break}case 3:{at={};var kt=0;for((fe.getUint32(ae-4,!me)&16777215)===9&&(kt=3);Ae<ae-4;){var nn=Re.parseObject(z,Q+Ae,ae-Ae-kt);if(nn.objectEnd)break;at[nn.data.name]=nn.data.value,Ae+=nn.size}if(Ae<=ae-3){var Ot=fe.getUint32(Ae-1,!me)&16777215;Ot===9&&(Ae+=3)}break}case 8:{at={},Ae+=4;var un=0;for((fe.getUint32(ae-4,!me)&16777215)===9&&(un=3);Ae<ae-8;){var an=Re.parseVariable(z,Q+Ae,ae-Ae-un);if(an.objectEnd)break;at[an.data.name]=an.data.value,Ae+=an.size}if(Ae<=ae-3){var re=fe.getUint32(Ae-1,!me)&16777215;re===9&&(Ae+=3)}break}case 9:at=void 0,Ae=1,Lt=!0;break;case 10:{at=[];var I=fe.getUint32(1,!me);Ae+=4;for(var F=0;F<I;F++){var ie=Re.parseValue(z,Q+Ae,ae-Ae);at.push(ie.data),Ae+=ie.size}break}case 11:{var ce=Re.parseDate(z,Q+1,ae-1);at=ce.data,Ae+=ce.size;break}case 12:{var se=Re.parseString(z,Q+1,ae-1);at=se.data,Ae+=se.size;break}default:Ae=ae,C.w("AMF","Unsupported AMF value type "+Je)}}catch(Xe){C.e("AMF",Xe.toString())}return{data:at,size:Ae,objectEnd:Lt}}}]),Re}(),He=We,nt=function(){function Re(ve){Object(de.a)(this,Re),this.TAG="ExpGolomb",this._buffer=ve,this._buffer_index=0,this._total_bytes=ve.byteLength,this._total_bits=ve.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return Object(ee.a)(Re,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var z=this._total_bytes-this._buffer_index;if(z<=0)throw new u("ExpGolomb: _fillCurrentWord() but no bytes available");var Q=Math.min(4,z),ae=new Uint8Array(4);ae.set(this._buffer.subarray(this._buffer_index,this._buffer_index+Q)),this._current_word=new DataView(ae.buffer).getUint32(0,!1),this._buffer_index+=Q,this._current_word_bits_left=Q*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 Q=this._current_word>>>32-z;return this._current_word<<=z,this._current_word_bits_left-=z,Q}var ae=this._current_word_bits_left?this._current_word:0;ae=ae>>>32-this._current_word_bits_left;var fe=z-this._current_word_bits_left;this._fillCurrentWord();var Ae=Math.min(fe,this._current_word_bits_left),Je=this._current_word>>>32-Ae;return this._current_word<<=Ae,this._current_word_bits_left-=Ae,ae=ae<<Ae|Je,ae}},{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)}}]),Re}(),te=nt,P=function(){function Re(){Object(de.a)(this,Re)}return Object(ee.a)(Re,null,[{key:"_ebsp2rbsp",value:function(z){for(var Q=z,ae=Q.byteLength,fe=new Uint8Array(ae),Ae=0,Je=0;Je<ae;Je++){if(Je>=2&&(Q[Je]===3&&Q[Je-1]===0&&Q[Je-2]===0))continue;fe[Ae]=Q[Je],Ae++}return new Uint8Array(fe.buffer,0,Ae)}},{key:"parseSPS",value:function(z){var Q=Re._ebsp2rbsp(z),ae=new te(Q);ae.readByte();var fe=ae.readByte();ae.readByte();var Ae=ae.readByte();ae.readUEG();var Je=Re.getProfileString(fe),at=Re.getLevelString(Ae),Lt=1,It=420,ct=[0,420,422,444],kt=8;if((fe===100||fe===110||fe===122||fe===244||fe===44||fe===83||fe===86||fe===118||fe===128||fe===138||fe===144)&&(Lt=ae.readUEG(),Lt===3&&ae.readBits(1),Lt<=3&&(It=ct[Lt]),kt=ae.readUEG()+8,ae.readUEG(),ae.readBits(1),ae.readBool()))for(var nn=Lt!==3?8:12,Ot=0;Ot<nn;Ot++)ae.readBool()&&(Ot<6?Re._skipScalingList(ae,16):Re._skipScalingList(ae,64));ae.readUEG();var un=ae.readUEG();if(un===0)ae.readUEG();else if(un===1){ae.readBits(1),ae.readSEG(),ae.readSEG();for(var an=ae.readUEG(),re=0;re<an;re++)ae.readSEG()}var I=ae.readUEG();ae.readBits(1);var F=ae.readUEG(),ie=ae.readUEG(),ce=ae.readBits(1);ce===0&&ae.readBits(1),ae.readBits(1);var se=0,Xe=0,_t=0,At=0,Vt=ae.readBool();Vt&&(se=ae.readUEG(),Xe=ae.readUEG(),_t=ae.readUEG(),At=ae.readUEG());var wt=1,Ht=1,en=0,jn=!0,Dr=0,wr=0,Nn=ae.readBool();if(Nn){if(ae.readBool()){var hr=ae.readByte(),mi=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Ar=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];hr>0&&hr<16?(wt=mi[hr-1],Ht=Ar[hr-1]):hr===255&&(wt=ae.readByte()<<8|ae.readByte(),Ht=ae.readByte()<<8|ae.readByte())}if(ae.readBool()&&ae.readBool(),ae.readBool()&&(ae.readBits(4),ae.readBool()&&ae.readBits(24)),ae.readBool()&&(ae.readUEG(),ae.readUEG()),ae.readBool()){var yr=ae.readBits(32),pr=ae.readBits(32);jn=ae.readBool(),Dr=pr,wr=yr*2,en=Dr/wr}}var Yr=1;(wt!==1||Ht!==1)&&(Yr=wt/Ht);var Mr=0,Zr=0;if(Lt===0)Mr=1,Zr=2-ce;else{var Cr=Lt===3?1:2,gi=Lt===1?2:1;Mr=Cr,Zr=gi*(2-ce)}var li=(F+1)*16,zr=(2-ce)*((ie+1)*16);li-=(se+Xe)*Mr,zr-=(_t+At)*Zr;var Kr=Math.ceil(li*Yr);return ae.destroy(),ae=null,{profile_string:Je,level_string:at,bit_depth:kt,ref_frames:I,chroma_format:It,chroma_format_string:Re.getChromaFormatString(It),frame_rate:{fixed:jn,fps:en,fps_den:wr,fps_num:Dr},sar_ratio:{width:wt,height:Ht},codec_size:{width:li,height:zr},present_size:{width:Kr,height:zr}}}},{key:"_skipScalingList",value:function(z,Q){for(var ae=8,fe=8,Ae=0,Je=0;Je<Q;Je++)fe!==0&&(Ae=z.readSEG(),fe=(ae+Ae+256)%256),ae=fe===0?ae:fe}},{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"}}}]),Re}(),U=P,q={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"},Y=q;function J(Re){return Re>>>8&255|(Re&255)<<8}function Ee(Re){return(Re&4278190080)>>>24|(Re&16711680)>>>8|(Re&65280)<<8|(Re&255)<<24}function ke(Re,ve){return Re[ve]<<24|Re[ve+1]<<16|Re[ve+2]<<8|Re[ve+3]}var ht=function(){function Re(ve,z){Object(de.a)(this,Re),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=ve.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=ve.hasAudioTrack,this._hasVideo=ve.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new Ne,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 Q=new ArrayBuffer(2);return new DataView(Q).setInt16(0,256,!0),new Int16Array(Q)[0]===256}()}return Object(ee.a)(Re,[{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 Ne}},{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,Q){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new u("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var ae=0,fe=this._littleEndian;if(Q===0)if(z.byteLength>13){var Ae=Re.probe(z);ae=Ae.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,Q+ae!==this._dataOffset&&C.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Je=new DataView(z,ae),at=Je.getUint32(0,!fe);at!==0&&C.w(this.TAG,"PrevTagSize0 !== 0 !!!"),ae+=4}for(;ae<z.byteLength;){this._dispatch=!0;var Lt=new DataView(z,ae);if(ae+11+4>z.byteLength)break;var It=Lt.getUint8(0),ct=Lt.getUint32(0,!fe)&16777215;if(ae+11+ct+4>z.byteLength)break;if(It!==8&&It!==9&&It!==18){C.w(this.TAG,"Unsupported tag type ".concat(It,", skipped")),ae+=11+ct+4;continue}var kt=Lt.getUint8(4),nn=Lt.getUint8(5),Ot=Lt.getUint8(6),un=Lt.getUint8(7),an=Ot|nn<<8|kt<<16|un<<24,re=Lt.getUint32(7,!fe)&16777215;re!==0&&C.w(this.TAG,"Meet tag which has StreamID != 0!");var I=ae+11;switch(It){case 8:this._parseAudioData(z,I,ct,an);break;case 9:this._parseVideoData(z,I,ct,an,Q+ae);break;case 18:this._parseScriptData(z,I,ct);break}var F=Lt.getUint32(11+ct,!fe);F!==11+ct&&C.w(this.TAG,"Invalid PrevTagSize ".concat(F)),ae+=11+ct+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),ae}},{key:"_parseScriptData",value:function(z,Q,ae){var fe=He.parseScriptData(z,Q,ae);if(fe.hasOwnProperty("onMetaData")){if(fe.onMetaData==null||typeof fe.onMetaData!="object"){C.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&C.w(this.TAG,"Found another onMetaData tag!"),this._metadata=fe;var Ae=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},Ae)),typeof Ae.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=Ae.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof Ae.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=Ae.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof Ae.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=Ae.audiodatarate),typeof Ae.videodatarate=="number"&&(this._mediaInfo.videoDataRate=Ae.videodatarate),typeof Ae.width=="number"&&(this._mediaInfo.width=Ae.width),typeof Ae.height=="number"&&(this._mediaInfo.height=Ae.height),typeof Ae.duration=="number"){if(!this._durationOverrided){var Je=Math.floor(Ae.duration*this._timescale);this._duration=Je,this._mediaInfo.duration=Je}}else this._mediaInfo.duration=0;if(typeof Ae.framerate=="number"){var at=Math.floor(Ae.framerate*1e3);if(at>0){var Lt=at/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Lt,this._referenceFrameRate.fps_num=at,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Lt}}if(typeof Ae.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var It=Ae.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(It),Ae.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=Ae,C.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(fe).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},fe)))}},{key:"_parseKeyframesIndex",value:function(z){for(var Q=[],ae=[],fe=1;fe<z.times.length;fe++){var Ae=this._timestampBase+Math.floor(z.times[fe]*1e3);Q.push(Ae),ae.push(z.filepositions[fe])}return{times:Q,filepositions:ae}}},{key:"_parseAudioData",value:function(z,Q,ae,fe){if(ae<=1){C.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;var Ae=this._littleEndian,Je=new DataView(z,Q,ae),at=Je.getUint8(0),Lt=at>>>4;if(Lt!==2&&Lt!==10){this._onError(Y.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+Lt);return}var It=0,ct=(at&12)>>>2;if(ct>=0&&ct<=4)It=this._flvSoundRateTable[ct];else{this._onError(Y.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+ct);return}var kt=(at&2)>>>1,nn=at&1,Ot=this._audioMetadata,un=this._audioTrack;if(Ot||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),Ot=this._audioMetadata={},Ot.type="audio",Ot.id=un.id,Ot.timescale=this._timescale,Ot.duration=this._duration,Ot.audioSampleRate=It,Ot.channelCount=nn===0?1:2),Lt===10){var an=this._parseAACAudioData(z,Q+1,ae-1);if(an==null)return;if(an.packetType===0){Ot.config&&C.w(this.TAG,"Found another AudioSpecificConfig!");var re=an.data;Ot.audioSampleRate=re.samplingRate,Ot.channelCount=re.channelCount,Ot.codec=re.codec,Ot.originalCodec=re.originalCodec,Ot.config=re.config,Ot.refSampleDuration=1024/Ot.audioSampleRate*Ot.timescale,C.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",Ot);var I=this._mediaInfo;I.audioCodec=Ot.originalCodec,I.audioSampleRate=Ot.audioSampleRate,I.audioChannelCount=Ot.channelCount,I.hasVideo?I.videoCodec!=null&&(I.mimeType='video/x-flv; codecs="'+I.videoCodec+","+I.audioCodec+'"'):I.mimeType='video/x-flv; codecs="'+I.audioCodec+'"',I.isComplete()&&this._onMediaInfo(I)}else if(an.packetType===1){var F=this._timestampBase+fe,ie={unit:an.data,length:an.data.byteLength,dts:F,pts:F};un.samples.push(ie),un.length+=an.data.length}else C.e(this.TAG,"Flv: Unsupported AAC data type ".concat(an.packetType))}else if(Lt===2){if(!Ot.codec){var ce=this._parseMP3AudioData(z,Q+1,ae-1,!0);if(ce==null)return;Ot.audioSampleRate=ce.samplingRate,Ot.channelCount=ce.channelCount,Ot.codec=ce.codec,Ot.originalCodec=ce.originalCodec,Ot.refSampleDuration=1152/Ot.audioSampleRate*Ot.timescale,C.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",Ot);var se=this._mediaInfo;se.audioCodec=Ot.codec,se.audioSampleRate=Ot.audioSampleRate,se.audioChannelCount=Ot.channelCount,se.audioDataRate=ce.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 Xe=this._parseMP3AudioData(z,Q+1,ae-1,!1);if(Xe==null)return;var _t=this._timestampBase+fe,At={unit:Xe,length:Xe.byteLength,dts:_t,pts:_t};un.samples.push(At),un.length+=Xe.length}}},{key:"_parseAACAudioData",value:function(z,Q,ae){if(ae<=1){C.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var fe={},Ae=new Uint8Array(z,Q,ae);return fe.packetType=Ae[0],Ae[0]===0?fe.data=this._parseAACAudioSpecificConfig(z,Q+1,ae-1):fe.data=Ae.subarray(1),fe}},{key:"_parseAACAudioSpecificConfig",value:function(z,Q,ae){var fe=new Uint8Array(z,Q,ae),Ae=null,Je=0,at=0,Lt=null,It=0,ct=null;if(Je=at=fe[0]>>>3,It=(fe[0]&7)<<1|fe[1]>>>7,It<0||It>=this._mpegSamplingRates.length){this._onError(Y.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var kt=this._mpegSamplingRates[It],nn=(fe[1]&120)>>>3;if(nn<0||nn>=8){this._onError(Y.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Je===5&&(ct=(fe[1]&7)<<1|fe[2]>>>7,Lt=(fe[2]&124)>>>2);var Ot=self.navigator.userAgent.toLowerCase();return Ot.indexOf("firefox")!==-1?It>=6?(Je=5,Ae=new Array(4),ct=It-3):(Je=2,Ae=new Array(2),ct=It):Ot.indexOf("android")!==-1?(Je=2,Ae=new Array(2),ct=It):(Je=5,ct=It,Ae=new Array(4),It>=6?ct=It-3:nn===1&&(Je=2,Ae=new Array(2),ct=It)),Ae[0]=Je<<3,Ae[0]|=(It&15)>>>1,Ae[1]=(It&15)<<7,Ae[1]|=(nn&15)<<3,Je===5&&(Ae[1]|=(ct&15)>>>1,Ae[2]=(ct&1)<<7,Ae[2]|=2<<2,Ae[3]=0),{config:Ae,samplingRate:kt,channelCount:nn,codec:"mp4a.40."+Je,originalCodec:"mp4a.40."+at}}},{key:"_parseMP3AudioData",value:function(z,Q,ae,fe){if(ae<4){C.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var Ae=this._littleEndian,Je=new Uint8Array(z,Q,ae),at=null;if(fe){if(Je[0]!==255)return;var Lt=Je[1]>>>3&3,It=(Je[1]&6)>>1,ct=(Je[2]&240)>>>4,kt=(Je[2]&12)>>>2,nn=Je[3]>>>6&3,Ot=nn!==3?2:1,un=0,an=0,re=34,I="mp3";switch(Lt){case 0:un=this._mpegAudioV25SampleRateTable[kt];break;case 2:un=this._mpegAudioV20SampleRateTable[kt];break;case 3:un=this._mpegAudioV10SampleRateTable[kt];break}switch(It){case 1:re=34,ct<this._mpegAudioL3BitRateTable.length&&(an=this._mpegAudioL3BitRateTable[ct]);break;case 2:re=33,ct<this._mpegAudioL2BitRateTable.length&&(an=this._mpegAudioL2BitRateTable[ct]);break;case 3:re=32,ct<this._mpegAudioL1BitRateTable.length&&(an=this._mpegAudioL1BitRateTable[ct]);break}at={bitRate:an,samplingRate:un,channelCount:Ot,codec:I,originalCodec:I}}else at=Je;return at}},{key:"_parseVideoData",value:function(z,Q,ae,fe,Ae){if(ae<=1){C.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;var Je=new Uint8Array(z,Q,ae)[0],at=(Je&240)>>>4,Lt=Je&15;if(Lt!==7){this._onError(Y.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(Lt));return}this._parseAVCVideoPacket(z,Q+1,ae-1,fe,Ae,at)}},{key:"_parseAVCVideoPacket",value:function(z,Q,ae,fe,Ae,Je){if(ae<4){C.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var at=this._littleEndian,Lt=new DataView(z,Q,ae),It=Lt.getUint8(0),ct=Lt.getUint32(0,!at)&16777215,kt=ct<<8>>8;if(It===0)this._parseAVCDecoderConfigurationRecord(z,Q+4,ae-4);else if(It===1)this._parseAVCVideoData(z,Q+4,ae-4,fe,Ae,Je,kt);else if(!(It===2)){this._onError(Y.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(It));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(z,Q,ae){if(ae<7){C.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var fe=this._videoMetadata,Ae=this._videoTrack,Je=this._littleEndian,at=new DataView(z,Q,ae);fe?typeof fe.avcc!="undefined"&&C.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),fe=this._videoMetadata={},fe.type="video",fe.id=Ae.id,fe.timescale=this._timescale,fe.duration=this._duration);var Lt=at.getUint8(0),It=at.getUint8(1),ct=at.getUint8(2),kt=at.getUint8(3);if(Lt!==1||It===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 nn=at.getUint8(5)&31;if(nn===0){this._onError(Y.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else nn>1&&C.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(nn));for(var Ot=6,un=0;un<nn;un++){var an=at.getUint16(Ot,!Je);if(Ot+=2,an===0)continue;var re=new Uint8Array(z,Q+Ot,an);Ot+=an;var I=U.parseSPS(re);if(un!==0)continue;fe.codecWidth=I.codec_size.width,fe.codecHeight=I.codec_size.height,fe.presentWidth=I.present_size.width,fe.presentHeight=I.present_size.height,fe.profile=I.profile_string,fe.level=I.level_string,fe.bitDepth=I.bit_depth,fe.chromaFormat=I.chroma_format,fe.sarRatio=I.sar_ratio,fe.frameRate=I.frame_rate,(I.frame_rate.fixed===!1||I.frame_rate.fps_num===0||I.frame_rate.fps_den===0)&&(fe.frameRate=this._referenceFrameRate);var F=fe.frameRate.fps_den,ie=fe.frameRate.fps_num;fe.refSampleDuration=fe.timescale*(F/ie);for(var ce=re.subarray(1,4),se="avc1.",Xe=0;Xe<3;Xe++){var _t=ce[Xe].toString(16);_t.length<2&&(_t="0"+_t),se+=_t}fe.codec=se;var At=this._mediaInfo;At.width=fe.codecWidth,At.height=fe.codecHeight,At.fps=fe.frameRate.fps,At.profile=fe.profile,At.level=fe.level,At.refFrames=I.ref_frames,At.chromaFormat=I.chroma_format_string,At.sarNum=fe.sarRatio.width,At.sarDen=fe.sarRatio.height,At.videoCodec=se,At.hasAudio?At.audioCodec!=null&&(At.mimeType='video/x-flv; codecs="'+At.videoCodec+","+At.audioCodec+'"'):At.mimeType='video/x-flv; codecs="'+At.videoCodec+'"',At.isComplete()&&this._onMediaInfo(At)}var Vt=at.getUint8(Ot);if(Vt===0){this._onError(Y.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else Vt>1&&C.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(Vt));Ot++;for(var wt=0;wt<Vt;wt++){var Ht=at.getUint16(Ot,!Je);if(Ot+=2,Ht===0)continue;Ot+=Ht}fe.avcc=new Uint8Array(ae),fe.avcc.set(new Uint8Array(z,Q,ae),0),C.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",fe)}},{key:"_parseAVCVideoData",value:function(z,Q,ae,fe,Ae,Je,at){for(var Lt=this._littleEndian,It=new DataView(z,Q,ae),ct=[],kt=0,nn=0,Ot=this._naluLengthSize,un=this._timestampBase+fe,an=Je===1;nn<ae;){if(nn+4>=ae){C.w(this.TAG,"Malformed Nalu near timestamp ".concat(un,", offset = ").concat(nn,", dataSize = ").concat(ae));break}var re=It.getUint32(nn,!Lt);if(Ot===3&&(re>>>=8),re>ae-Ot){C.w(this.TAG,"Malformed Nalus near timestamp ".concat(un,", NaluSize > DataSize!"));return}var I=It.getUint8(nn+Ot)&31;I===5&&(an=!0);var F=new Uint8Array(z,Q+nn,Ot+re),ie={type:I,data:F};ct.push(ie),kt+=F.byteLength,nn+=Ot+re}if(ct.length){var ce=this._videoTrack,se={units:ct,length:kt,isKeyframe:an,dts:un,cts:at,pts:un+at};an&&(se.fileposition=Ae),ce.samples.push(se),ce.length+=kt}}}],[{key:"probe",value:function(z){var Q=new Uint8Array(z),ae={match:!1};if(Q[0]!==70||Q[1]!==76||Q[2]!==86||Q[3]!==1)return ae;var fe=(Q[4]&4)>>>2!==0,Ae=(Q[4]&1)!==0,Je=ke(Q,5);return Je<9?ae:{match:!0,consumed:Je,dataOffset:Je,hasAudioTrack:fe,hasVideoTrack:Ae}}}]),Re}(),Ue=ht,je=function(){function Re(){Object(de.a)(this,Re)}return Object(ee.a)(Re,null,[{key:"init",value:function(){Re.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 Re.types)Re.types.hasOwnProperty(z)&&(Re.types[z]=[z.charCodeAt(0),z.charCodeAt(1),z.charCodeAt(2),z.charCodeAt(3)]);var Q=Re.constants={};Q.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),Q.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),Q.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),Q.STSC=Q.STCO=Q.STTS,Q.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Q.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]),Q.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]),Q.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Q.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Q.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(z){for(var Q=8,ae=null,fe=Array.prototype.slice.call(arguments,1),Ae=fe.length,Je=0;Je<Ae;Je++)Q+=fe[Je].byteLength;ae=new Uint8Array(Q),ae[0]=Q>>>24&255,ae[1]=Q>>>16&255,ae[2]=Q>>>8&255,ae[3]=Q&255,ae.set(z,4);for(var at=8,Lt=0;Lt<Ae;Lt++)ae.set(fe[Lt],at),at+=fe[Lt].byteLength;return ae}},{key:"generateInitSegment",value:function(z){var Q=Re.box(Re.types.ftyp,Re.constants.FTYP),ae=Re.moov(z),fe=new Uint8Array(Q.byteLength+ae.byteLength);return fe.set(Q,0),fe.set(ae,Q.byteLength),fe}},{key:"moov",value:function(z){var Q=Re.mvhd(z.timescale,z.duration),ae=Re.trak(z),fe=Re.mvex(z);return Re.box(Re.types.moov,Q,ae,fe)}},{key:"mvhd",value:function(z,Q){return Re.box(Re.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,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&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 Re.box(Re.types.trak,Re.tkhd(z),Re.mdia(z))}},{key:"tkhd",value:function(z){var Q=z.id,ae=z.duration,fe=z.presentWidth,Ae=z.presentHeight;return Re.box(Re.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&255,0,0,0,0,ae>>>24&255,ae>>>16&255,ae>>>8&255,ae&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,fe>>>8&255,fe&255,0,0,Ae>>>8&255,Ae&255,0,0]))}},{key:"mdia",value:function(z){return Re.box(Re.types.mdia,Re.mdhd(z),Re.hdlr(z),Re.minf(z))}},{key:"mdhd",value:function(z){var Q=z.timescale,ae=z.duration;return Re.box(Re.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&255,ae>>>24&255,ae>>>16&255,ae>>>8&255,ae&255,85,196,0,0]))}},{key:"hdlr",value:function(z){var Q=null;return z.type==="audio"?Q=Re.constants.HDLR_AUDIO:Q=Re.constants.HDLR_VIDEO,Re.box(Re.types.hdlr,Q)}},{key:"minf",value:function(z){var Q=null;return z.type==="audio"?Q=Re.box(Re.types.smhd,Re.constants.SMHD):Q=Re.box(Re.types.vmhd,Re.constants.VMHD),Re.box(Re.types.minf,Q,Re.dinf(),Re.stbl(z))}},{key:"dinf",value:function(){var z=Re.box(Re.types.dinf,Re.box(Re.types.dref,Re.constants.DREF));return z}},{key:"stbl",value:function(z){var Q=Re.box(Re.types.stbl,Re.stsd(z),Re.box(Re.types.stts,Re.constants.STTS),Re.box(Re.types.stsc,Re.constants.STSC),Re.box(Re.types.stsz,Re.constants.STSZ),Re.box(Re.types.stco,Re.constants.STCO));return Q}},{key:"stsd",value:function(z){return z.type==="audio"?z.codec==="mp3"?Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.mp3(z)):Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.mp4a(z)):Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.avc1(z))}},{key:"mp3",value:function(z){var Q=z.channelCount,ae=z.audioSampleRate,fe=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Q,0,16,0,0,0,0,ae>>>8&255,ae&255,0,0]);return Re.box(Re.types[".mp3"],fe)}},{key:"mp4a",value:function(z){var Q=z.channelCount,ae=z.audioSampleRate,fe=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Q,0,16,0,0,0,0,ae>>>8&255,ae&255,0,0]);return Re.box(Re.types.mp4a,fe,Re.esds(z))}},{key:"esds",value:function(z){var Q=z.config||[],ae=Q.length,fe=new Uint8Array([0,0,0,0,3,23+ae,0,1,0,4,15+ae,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([ae]).concat(Q).concat([6,1,2]));return Re.box(Re.types.esds,fe)}},{key:"avc1",value:function(z){var Q=z.avcc,ae=z.codecWidth,fe=z.codecHeight,Ae=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,ae>>>8&255,ae&255,fe>>>8&255,fe&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 Re.box(Re.types.avc1,Ae,Re.box(Re.types.avcC,Q))}},{key:"mvex",value:function(z){return Re.box(Re.types.mvex,Re.trex(z))}},{key:"trex",value:function(z){var Q=z.id,ae=new Uint8Array([0,0,0,0,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return Re.box(Re.types.trex,ae)}},{key:"moof",value:function(z,Q){return Re.box(Re.types.moof,Re.mfhd(z.sequenceNumber),Re.traf(z,Q))}},{key:"mfhd",value:function(z){var Q=new Uint8Array([0,0,0,0,z>>>24&255,z>>>16&255,z>>>8&255,z&255]);return Re.box(Re.types.mfhd,Q)}},{key:"traf",value:function(z,Q){var ae=z.id,fe=Re.box(Re.types.tfhd,new Uint8Array([0,0,0,0,ae>>>24&255,ae>>>16&255,ae>>>8&255,ae&255])),Ae=Re.box(Re.types.tfdt,new Uint8Array([0,0,0,0,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&255])),Je=Re.sdtp(z),at=Re.trun(z,Je.byteLength+16+16+8+16+8+8);return Re.box(Re.types.traf,fe,Ae,at,Je)}},{key:"sdtp",value:function(z){for(var Q=z.samples||[],ae=Q.length,fe=new Uint8Array(4+ae),Ae=0;Ae<ae;Ae++){var Je=Q[Ae].flags;fe[Ae+4]=Je.isLeading<<6|Je.dependsOn<<4|Je.isDependedOn<<2|Je.hasRedundancy}return Re.box(Re.types.sdtp,fe)}},{key:"trun",value:function(z,Q){var ae=z.samples||[],fe=ae.length,Ae=12+16*fe,Je=new Uint8Array(Ae);Q+=8+Ae,Je.set([0,0,15,1,fe>>>24&255,fe>>>16&255,fe>>>8&255,fe&255,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&255],0);for(var at=0;at<fe;at++){var Lt=ae[at].duration,It=ae[at].size,ct=ae[at].flags,kt=ae[at].cts;Je.set([Lt>>>24&255,Lt>>>16&255,Lt>>>8&255,Lt&255,It>>>24&255,It>>>16&255,It>>>8&255,It&255,ct.isLeading<<2|ct.dependsOn,ct.isDependedOn<<6|ct.hasRedundancy<<4|ct.isNonSync,0,0,kt>>>24&255,kt>>>16&255,kt>>>8&255,kt&255],12+16*at)}return Re.box(Re.types.trun,Je)}},{key:"mdat",value:function(z){return Re.box(Re.types.mdat,z)}}]),Re}();je.init();var tt=je,dt=function(){function Re(){Object(de.a)(this,Re)}return Object(ee.a)(Re,null,[{key:"getSilentFrame",value:function(z,Q){if(z==="mp4a.40.2"){if(Q===1)return new Uint8Array([0,200,0,128,35,128]);if(Q===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(Q===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(Q===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(Q===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(Q===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(Q===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(Q===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(Q===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}}]),Re}(),qe=dt,Ye=function Re(ve,z,Q,ae,fe){Object(de.a)(this,Re),this.dts=ve,this.pts=z,this.duration=Q,this.originalDts=ae,this.isSyncPoint=fe,this.fileposition=null},Fe=function(){function Re(){Object(de.a)(this,Re),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(ee.a)(Re,[{key:"appendSyncPoint",value:function(z){z.isSyncPoint=!0,this.syncPoints.push(z)}}]),Re}(),Ie=function(){function Re(){Object(de.a)(this,Re),this._list=[]}return Object(ee.a)(Re,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(z){var Q=this._list;if(z.length===0)return;Q.length>0&&z[0].originalDts<Q[Q.length-1].originalDts&&this.clear(),Array.prototype.push.apply(Q,z)}},{key:"getLastSyncPointBeforeDts",value:function(z){if(this._list.length==0)return null;var Q=this._list,ae=0,fe=Q.length-1,Ae=0,Je=0,at=fe;for(z<Q[0].dts&&(ae=0,Je=at+1);Je<=at;)if(Ae=Je+Math.floor((at-Je)/2),Ae===fe||z>=Q[Ae].dts&&z<Q[Ae+1].dts){ae=Ae;break}else Q[Ae].dts<z?Je=Ae+1:at=Ae-1;return this._list[ae]}}]),Re}(),Me=function(){function Re(ve){Object(de.a)(this,Re),this._type=ve,this._list=[],this._lastAppendLocation=-1}return Object(ee.a)(Re,[{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 Q=this._list;if(Q.length===0)return-2;var ae=Q.length-1,fe=0,Ae=0,Je=ae,at=0;if(z<Q[0].originalBeginDts)return at=-1,at;for(;Ae<=Je;)if(fe=Ae+Math.floor((Je-Ae)/2),fe===ae||z>Q[fe].lastSample.originalDts&&z<Q[fe+1].originalBeginDts){at=fe;break}else Q[fe].originalBeginDts<z?Ae=fe+1:Je=fe-1;return at}},{key:"_searchNearestSegmentAfter",value:function(z){return this._searchNearestSegmentBefore(z)+1}},{key:"append",value:function(z){var Q=this._list,ae=z,fe=this._lastAppendLocation,Ae=0;fe!==-1&&fe<Q.length&&ae.originalBeginDts>=Q[fe].lastSample.originalDts&&(fe===Q.length-1||fe<Q.length-1&&ae.originalBeginDts<Q[fe+1].originalBeginDts)?Ae=fe+1:Q.length>0&&(Ae=this._searchNearestSegmentBefore(ae.originalBeginDts)+1),this._lastAppendLocation=Ae,this._list.splice(Ae,0,ae)}},{key:"getLastSegmentBefore",value:function(z){var Q=this._searchNearestSegmentBefore(z);return Q>=0?this._list[Q]:null}},{key:"getLastSampleBefore",value:function(z){var Q=this.getLastSegmentBefore(z);return Q!=null?Q.lastSample:null}},{key:"getLastSyncPointBefore",value:function(z){for(var Q=this._searchNearestSegmentBefore(z),ae=this._list[Q].syncPoints;ae.length===0&&Q>0;)Q--,ae=this._list[Q].syncPoints;return ae.length>0?ae[ae.length-1]:null}}]),Re}(),be=function(){function Re(ve){Object(de.a)(this,Re),this.TAG="MP4Remuxer",this._config=ve,this._isLive=ve.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 Me("audio"),this._videoSegmentInfoList=new Me("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(m.chrome&&(m.version.major<50||m.version.major===50&&m.version.build<2661)),this._fillSilentAfterSeek=m.msedge||m.msie,this._mp3UseMpegAudio=!m.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(ee.a)(Re,[{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,Q){if(!this._onMediaSegment)throw new u("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(z,Q),this._remuxVideo(Q),this._remuxAudio(z)}},{key:"_onTrackMetadataReceived",value:function(z,Q){var ae=null,fe="mp4",Ae=Q.codec;if(z==="audio")this._audioMeta=Q,Q.codec==="mp3"&&this._mp3UseMpegAudio?(fe="mpeg",Ae="",ae=new Uint8Array):ae=tt.generateInitSegment(Q);else if(z==="video")this._videoMeta=Q,ae=tt.generateInitSegment(Q);else return;if(!this._onInitSegment)throw new u("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(z,{type:z,data:ae.buffer,codec:Ae,container:"".concat(z,"/").concat(fe),mediaDuration:Q.duration})}},{key:"_calculateDtsBase",value:function(z,Q){if(this._dtsBaseInited)return;z.samples&&z.samples.length&&(this._audioDtsBase=z.samples[0].dts),Q.samples&&Q.samples.length&&(this._videoDtsBase=Q.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var z=this._videoStashedLastSample,Q=this._audioStashedLastSample,ae={type:"video",id:1,sequenceNumber:0,samples:[],length:0};z!=null&&(ae.samples.push(z),ae.length=z.length);var fe={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};Q!=null&&(fe.samples.push(Q),fe.length=Q.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(ae,!0),this._remuxAudio(fe,!0)}},{key:"_remuxAudio",value:function(z,Q){if(this._audioMeta==null)return;var ae=z,fe=ae.samples,Ae=void 0,Je=-1,at=-1,Lt=-1,It=this._audioMeta.refSampleDuration,ct=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,kt=this._dtsBaseInited&&this._audioNextDts===void 0,nn=!1;if(!fe||fe.length===0)return;if(fe.length===1&&!Q)return;var Ot=0,un=null,an=0;ct?(Ot=0,an=ae.length):(Ot=8,an=8+ae.length);var re=null;if(fe.length>1&&(re=fe.pop(),an-=re.length),this._audioStashedLastSample!=null){var I=this._audioStashedLastSample;this._audioStashedLastSample=null,fe.unshift(I),an+=I.length}re!=null&&(this._audioStashedLastSample=re);var F=fe[0].dts-this._dtsBase;if(this._audioNextDts)Ae=F-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())Ae=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(nn=!0));else{var ie=this._audioSegmentInfoList.getLastSampleBefore(F);if(ie!=null){var ce=F-(ie.originalDts+ie.duration);ce<=3&&(ce=0);var se=ie.dts+ie.duration+ce;Ae=F-se}else Ae=0}if(nn){var Xe=F-Ae,_t=this._videoSegmentInfoList.getLastSegmentBefore(F);if(_t!=null&&_t.beginDts<Xe){var At=qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(At){var Vt=_t.beginDts,wt=Xe-_t.beginDts;C.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(Vt,", duration: ").concat(wt)),fe.unshift({unit:At,dts:Vt,pts:Vt}),an+=At.byteLength}}else nn=!1}for(var Ht=[],en=0;en<fe.length;en++){var jn=fe[en],Dr=jn.unit,wr=jn.dts-this._dtsBase,Nn=wr-Ae;Je===-1&&(Je=Nn);var hr=0;if(en!==fe.length-1){var mi=fe[en+1].dts-this._dtsBase-Ae;hr=mi-Nn}else if(re!=null){var Ar=re.dts-this._dtsBase-Ae;hr=Ar-Nn}else Ht.length>=1?hr=Ht[Ht.length-1].duration:hr=Math.floor(It);var yr=!1,pr=null;if(hr>It*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!m.safari){yr=!0;var Yr=Math.abs(hr-It),Mr=Math.ceil(Yr/It),Zr=Nn+It;C.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(It)," ms, ")+"delta: ".concat(Math.round(Yr)," ms, generate: ").concat(Mr," frames"));var Cr=qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Cr==null&&(C.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),Cr=Dr),pr=[];for(var gi=0;gi<Mr;gi++){var li=Math.round(Zr);if(pr.length>0){var zr=pr[pr.length-1];zr.duration=li-zr.dts}var Kr={dts:li,pts:li,cts:0,unit:Cr,size:Cr.byteLength,duration:0,originalDts:wr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};pr.push(Kr),an+=Kr.size,Zr+=It}var xi=pr[pr.length-1];xi.duration=Nn+hr-xi.dts,hr=Math.round(It)}Ht.push({dts:Nn,pts:Nn,cts:0,unit:jn.unit,size:jn.unit.byteLength,duration:hr,originalDts:wr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),yr&&Ht.push.apply(Ht,pr)}ct?un=new Uint8Array(an):(un=new Uint8Array(an),un[0]=an>>>24&255,un[1]=an>>>16&255,un[2]=an>>>8&255,un[3]=an&255,un.set(tt.types.mdat,4));for(var vi=0;vi<Ht.length;vi++){var Si=Ht[vi].unit;un.set(Si,Ot),Ot+=Si.byteLength}var Fn=Ht[Ht.length-1];at=Fn.dts+Fn.duration,this._audioNextDts=at;var Sn=new Fe;Sn.beginDts=Je,Sn.endDts=at,Sn.beginPts=Je,Sn.endPts=at,Sn.originalBeginDts=Ht[0].originalDts,Sn.originalEndDts=Fn.originalDts+Fn.duration,Sn.firstSample=new Ye(Ht[0].dts,Ht[0].pts,Ht[0].duration,Ht[0].originalDts,!1),Sn.lastSample=new Ye(Fn.dts,Fn.pts,Fn.duration,Fn.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(Sn),ae.samples=Ht,ae.sequenceNumber++;var Er=null;ct?Er=new Uint8Array:Er=tt.moof(ae,Je),ae.samples=[],ae.length=0;var Kn={type:"audio",data:this._mergeBoxes(Er,un).buffer,sampleCount:Ht.length,info:Sn};ct&&kt&&(Kn.timestampOffset=Je),this._onMediaSegment("audio",Kn)}},{key:"_remuxVideo",value:function(z,Q){if(this._videoMeta==null)return;var ae=z,fe=ae.samples,Ae=void 0,Je=-1,at=-1,Lt=-1,It=-1;if(!fe||fe.length===0)return;if(fe.length===1&&!Q)return;var ct=8,kt=null,nn=8+z.length,Ot=null;if(fe.length>1&&(Ot=fe.pop(),nn-=Ot.length),this._videoStashedLastSample!=null){var un=this._videoStashedLastSample;this._videoStashedLastSample=null,fe.unshift(un),nn+=un.length}Ot!=null&&(this._videoStashedLastSample=Ot);var an=fe[0].dts-this._dtsBase;if(this._videoNextDts)Ae=an-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())Ae=0;else{var re=this._videoSegmentInfoList.getLastSampleBefore(an);if(re!=null){var I=an-(re.originalDts+re.duration);I<=3&&(I=0);var F=re.dts+re.duration+I;Ae=an-F}else Ae=0}for(var ie=new Fe,ce=[],se=0;se<fe.length;se++){var Xe=fe[se],_t=Xe.dts-this._dtsBase,At=Xe.isKeyframe,Vt=_t-Ae,wt=Xe.cts,Ht=Vt+wt;Je===-1&&(Je=Vt,Lt=Ht);var en=0;if(se!==fe.length-1){var jn=fe[se+1].dts-this._dtsBase-Ae;en=jn-Vt}else if(Ot!=null){var Dr=Ot.dts-this._dtsBase-Ae;en=Dr-Vt}else ce.length>=1?en=ce[ce.length-1].duration:en=Math.floor(this._videoMeta.refSampleDuration);if(At){var wr=new Ye(Vt,Ht,en,Xe.dts,!0);wr.fileposition=Xe.fileposition,ie.appendSyncPoint(wr)}ce.push({dts:Vt,pts:Ht,cts:wt,units:Xe.units,size:Xe.length,isKeyframe:At,duration:en,originalDts:_t,flags:{isLeading:0,dependsOn:At?2:1,isDependedOn:At?1:0,hasRedundancy:0,isNonSync:At?0:1}})}kt=new Uint8Array(nn),kt[0]=nn>>>24&255,kt[1]=nn>>>16&255,kt[2]=nn>>>8&255,kt[3]=nn&255,kt.set(tt.types.mdat,4);for(var Nn=0;Nn<ce.length;Nn++)for(var hr=ce[Nn].units;hr.length;){var mi=hr.shift(),Ar=mi.data;kt.set(Ar,ct),ct+=Ar.byteLength}var yr=ce[ce.length-1];if(at=yr.dts+yr.duration,It=yr.pts+yr.duration,this._videoNextDts=at,ie.beginDts=Je,ie.endDts=at,ie.beginPts=Lt,ie.endPts=It,ie.originalBeginDts=ce[0].originalDts,ie.originalEndDts=yr.originalDts+yr.duration,ie.firstSample=new Ye(ce[0].dts,ce[0].pts,ce[0].duration,ce[0].originalDts,ce[0].isKeyframe),ie.lastSample=new Ye(yr.dts,yr.pts,yr.duration,yr.originalDts,yr.isKeyframe),this._isLive||this._videoSegmentInfoList.append(ie),ae.samples=ce,ae.sequenceNumber++,this._forceFirstIDR){var pr=ce[0].flags;pr.dependsOn=2,pr.isNonSync=0}var Yr=tt.moof(ae,Je);ae.samples=[],ae.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Yr,kt).buffer,sampleCount:ce.length,info:ie})}},{key:"_mergeBoxes",value:function(z,Q){var ae=new Uint8Array(z.byteLength+Q.byteLength);return ae.set(z,0),ae.set(Q,z.byteLength),ae}}]),Re}(),Te=be,Le={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"},Ce=Le,et=function(){function Re(ve,z){Object(de.a)(this,Re),this.TAG="TransmuxingController",this._emitter=new S.a,this._config=z,ve.segments||(ve.segments=[{duration:ve.duration,filesize:ve.filesize,url:ve.url}]),typeof ve.cors!="boolean"&&(ve.cors=!0),typeof ve.withCredentials!="boolean"&&(ve.withCredentials=!1),this._mediaDataSource=ve,this._currentSegmentIndex=0;var Q=0;this._mediaDataSource.segments.forEach(function(ae){ae.timestampBase=Q,Q+=ae.duration,ae.cors=ve.cors,ae.withCredentials=ve.withCredentials,z.referrerPolicy&&(ae.referrerPolicy=z.referrerPolicy)}),!isNaN(Q)&&this._mediaDataSource.duration!==Q&&(this._mediaDataSource.duration=Q),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return Object(ee.a)(Re,[{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,Q){this._emitter.addListener(z,Q)}},{key:"off",value:function(z,Q){this._emitter.removeListener(z,Q)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(z,Q){this._currentSegmentIndex=z;var ae=this._mediaDataSource.segments[z],fe=this._ioctl=new $(ae,this._config,z);fe.onError=this._onIOException.bind(this),fe.onSeeked=this._onIOSeeked.bind(this),fe.onComplete=this._onIOComplete.bind(this),fe.onRedirect=this._onIORedirect.bind(this),fe.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),Q?this._demuxer.bindDataSource(this._ioctl):fe.onDataArrival=this._onInitChunkArrival.bind(this),fe.open(Q)}},{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 Q=this._searchSegmentIndexContains(z);if(Q===this._currentSegmentIndex){var ae=this._mediaInfo.segments[Q];if(ae==null)this._pendingSeekTime=z;else{var fe=ae.getNearestKeyframe(z);this._remuxer.seek(fe.milliseconds),this._ioctl.seek(fe.fileposition),this._pendingResolveSeekPoint=fe.milliseconds}}else{var Ae=this._mediaInfo.segments[Q];if(Ae==null)this._pendingSeekTime=z,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(Q);else{var Je=Ae.getNearestKeyframe(z);this._internalAbort(),this._remuxer.seek(z),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[Q].timestampBase,this._loadSegment(Q,Je.fileposition),this._pendingResolveSeekPoint=Je.milliseconds,this._reportSegmentMediaInfo(Q)}}this._enableStatisticsReporter()}},{key:"_searchSegmentIndexContains",value:function(z){for(var Q=this._mediaDataSource.segments,ae=Q.length-1,fe=0;fe<Q.length;fe++)if(z<Q[fe].timestampBase){ae=fe-1;break}return ae}},{key:"_onInitChunkArrival",value:function(z,Q){var ae=this,fe=null,Ae=0;if(Q>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,Ae=this._demuxer.parseChunks(z,Q);else if((fe=Ue.probe(z)).match){this._demuxer=new Ue(fe,this._config),this._remuxer||(this._remuxer=new Te(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),Ae=this._demuxer.parseChunks(z,Q)}else fe=null,C.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){ae._internalAbort()}),this._emitter.emit(Ce.DEMUX_ERROR,Y.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),Ae=0;return Ae}},{key:"_onMediaInfo",value:function(z){var Q=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,Ne.prototype));var ae=Object.assign({},z);Object.setPrototypeOf(ae,Ne.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=ae,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var fe=Q._pendingSeekTime;Q._pendingSeekTime=null,Q.seek(fe)})}},{key:"_onMetaDataArrived",value:function(z){this._emitter.emit(Ce.METADATA_ARRIVED,z)}},{key:"_onScriptDataArrived",value:function(z){this._emitter.emit(Ce.SCRIPTDATA_ARRIVED,z)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(z){var Q=z,ae=Q+1;ae<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(ae)):(this._remuxer.flushStashedSamples(),this._emitter.emit(Ce.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(z){var Q=this._ioctl.extraData;this._mediaDataSource.segments[Q].redirectedURL=z}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(Ce.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(z,Q){C.e(this.TAG,"IOException: type = ".concat(z,", code = ").concat(Q.code,", msg = ").concat(Q.msg)),this._emitter.emit(Ce.IO_ERROR,z,Q),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(z,Q){C.e(this.TAG,"DemuxException: type = ".concat(z,", info = ").concat(Q)),this._emitter.emit(Ce.DEMUX_ERROR,z,Q)}},{key:"_onRemuxerInitSegmentArrival",value:function(z,Q){this._emitter.emit(Ce.INIT_SEGMENT,z,Q)}},{key:"_onRemuxerMediaSegmentArrival",value:function(z,Q){if(this._pendingSeekTime!=null)return;if(this._emitter.emit(Ce.MEDIA_SEGMENT,z,Q),this._pendingResolveSeekPoint!=null&&z==="video"){var ae=Q.info.syncPoints,fe=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,m.safari&&ae.length>0&&ae[0].originalDts===fe&&(fe=ae[0].pts),this._emitter.emit(Ce.RECOMMEND_SEEKPOINT,fe)}}},{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 Q=this._mediaInfo.segments[z],ae=Object.assign({},Q);ae.duration=this._mediaInfo.duration,ae.segmentCount=this._mediaInfo.segmentCount,delete ae.segments,delete ae.keyframesIndex,this._emitter.emit(Ce.MEDIA_INFO,ae)}},{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(Ce.STATISTICS_INFO,z)}}]),Re}(),Qe=et,yt=function(ve){var z="TransmuxingWorker",Q=null,ae=an.bind(this);w.install(),ve.addEventListener("message",function(re){switch(re.data.cmd){case"init":Q=new Qe(re.data.param[0],re.data.param[1]),Q.on(Ce.IO_ERROR,nn.bind(this)),Q.on(Ce.DEMUX_ERROR,Ot.bind(this)),Q.on(Ce.INIT_SEGMENT,fe.bind(this)),Q.on(Ce.MEDIA_SEGMENT,Ae.bind(this)),Q.on(Ce.LOADING_COMPLETE,Je.bind(this)),Q.on(Ce.RECOVERED_EARLY_EOF,at.bind(this)),Q.on(Ce.MEDIA_INFO,Lt.bind(this)),Q.on(Ce.METADATA_ARRIVED,It.bind(this)),Q.on(Ce.SCRIPTDATA_ARRIVED,ct.bind(this)),Q.on(Ce.STATISTICS_INFO,kt.bind(this)),Q.on(Ce.RECOMMEND_SEEKPOINT,un.bind(this));break;case"destroy":Q&&(Q.destroy(),Q=null),ve.postMessage({msg:"destroyed"});break;case"start":Q.start();break;case"stop":Q.stop();break;case"seek":Q.seek(re.data.param);break;case"pause":Q.pause();break;case"resume":Q.resume();break;case"logging_config":{var I=re.data.param;xe.applyConfig(I),I.enableCallback===!0?xe.addLogListener(ae):xe.removeLogListener(ae);break}}});function fe(re,I){var F={msg:Ce.INIT_SEGMENT,data:{type:re,data:I}};ve.postMessage(F,[I.data])}function Ae(re,I){var F={msg:Ce.MEDIA_SEGMENT,data:{type:re,data:I}};ve.postMessage(F,[I.data])}function Je(){var re={msg:Ce.LOADING_COMPLETE};ve.postMessage(re)}function at(){var re={msg:Ce.RECOVERED_EARLY_EOF};ve.postMessage(re)}function Lt(re){var I={msg:Ce.MEDIA_INFO,data:re};ve.postMessage(I)}function It(re){var I={msg:Ce.METADATA_ARRIVED,data:re};ve.postMessage(I)}function ct(re){var I={msg:Ce.SCRIPTDATA_ARRIVED,data:re};ve.postMessage(I)}function kt(re){var I={msg:Ce.STATISTICS_INFO,data:re};ve.postMessage(I)}function nn(re,I){ve.postMessage({msg:Ce.IO_ERROR,data:{type:re,info:I}})}function Ot(re,I){ve.postMessage({msg:Ce.DEMUX_ERROR,data:{type:re,info:I}})}function un(re){ve.postMessage({msg:Ce.RECOMMEND_SEEKPOINT,data:re})}function an(re,I){ve.postMessage({msg:"logcat_callback",data:{type:re,logcat:I}})}},Dt=yt,Bt=function(){function Re(ve,z){if(Object(de.a)(this,Re),this.TAG="Transmuxer",this._emitter=new S.a,z.enableWorker&&typeof Worker!="undefined")try{var Q=H("0r65");this._worker=Q(Dt),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[ve,z]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},xe.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:xe.getConfig()})}catch(fe){C.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Qe(ve,z)}else this._controller=new Qe(ve,z);if(this._controller){var ae=this._controller;ae.on(Ce.IO_ERROR,this._onIOError.bind(this)),ae.on(Ce.DEMUX_ERROR,this._onDemuxError.bind(this)),ae.on(Ce.INIT_SEGMENT,this._onInitSegment.bind(this)),ae.on(Ce.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),ae.on(Ce.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),ae.on(Ce.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),ae.on(Ce.MEDIA_INFO,this._onMediaInfo.bind(this)),ae.on(Ce.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),ae.on(Ce.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),ae.on(Ce.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),ae.on(Ce.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(ee.a)(Re,[{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,Q){this._emitter.addListener(z,Q)}},{key:"off",value:function(z,Q){this._emitter.removeListener(z,Q)}},{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,Q){var ae=this;Promise.resolve().then(function(){ae._emitter.emit(Ce.INIT_SEGMENT,z,Q)})}},{key:"_onMediaSegment",value:function(z,Q){var ae=this;Promise.resolve().then(function(){ae._emitter.emit(Ce.MEDIA_SEGMENT,z,Q)})}},{key:"_onLoadingComplete",value:function(){var z=this;Promise.resolve().then(function(){z._emitter.emit(Ce.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var z=this;Promise.resolve().then(function(){z._emitter.emit(Ce.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(z){var Q=this;Promise.resolve().then(function(){Q._emitter.emit(Ce.MEDIA_INFO,z)})}},{key:"_onMetaDataArrived",value:function(z){var Q=this;Promise.resolve().then(function(){Q._emitter.emit(Ce.METADATA_ARRIVED,z)})}},{key:"_onScriptDataArrived",value:function(z){var Q=this;Promise.resolve().then(function(){Q._emitter.emit(Ce.SCRIPTDATA_ARRIVED,z)})}},{key:"_onStatisticsInfo",value:function(z){var Q=this;Promise.resolve().then(function(){Q._emitter.emit(Ce.STATISTICS_INFO,z)})}},{key:"_onIOError",value:function(z,Q){var ae=this;Promise.resolve().then(function(){ae._emitter.emit(Ce.IO_ERROR,z,Q)})}},{key:"_onDemuxError",value:function(z,Q){var ae=this;Promise.resolve().then(function(){ae._emitter.emit(Ce.DEMUX_ERROR,z,Q)})}},{key:"_onRecommendSeekpoint",value:function(z){var Q=this;Promise.resolve().then(function(){Q._emitter.emit(Ce.RECOMMEND_SEEKPOINT,z)})}},{key:"_onLoggingConfigChanged",value:function(z){this._worker&&this._worker.postMessage({cmd:"logging_config",param:z})}},{key:"_onWorkerMessage",value:function(z){var Q=z.data,ae=Q.data;if(Q.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(Q.msg){case Ce.INIT_SEGMENT:case Ce.MEDIA_SEGMENT:this._emitter.emit(Q.msg,ae.type,ae.data);break;case Ce.LOADING_COMPLETE:case Ce.RECOVERED_EARLY_EOF:this._emitter.emit(Q.msg);break;case Ce.MEDIA_INFO:Object.setPrototypeOf(ae,Ne.prototype),this._emitter.emit(Q.msg,ae);break;case Ce.METADATA_ARRIVED:case Ce.SCRIPTDATA_ARRIVED:case Ce.STATISTICS_INFO:this._emitter.emit(Q.msg,ae);break;case Ce.IO_ERROR:case Ce.DEMUX_ERROR:this._emitter.emit(Q.msg,ae.type,ae.info);break;case Ce.RECOMMEND_SEEKPOINT:this._emitter.emit(Q.msg,ae);break;case"logcat_callback":C.emitter.emit("log",ae.type,ae.logcat);break;default:break}}}]),Re}(),Pt=Bt,Rt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},st=Rt,mt=function(){function Re(ve){Object(de.a)(this,Re),this.TAG="MSEController",this._config=ve,this._emitter=new S.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 Ie}return Object(ee.a)(Re,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(z,Q){this._emitter.addListener(z,Q)}},{key:"off",value:function(z,Q){this._emitter.removeListener(z,Q)}},{key:"attachMediaElement",value:function(z){if(this._mediaSource)throw new u("MediaSource has been attached to an HTMLMediaElement!");var Q=this._mediaSource=new window.MediaSource;Q.addEventListener("sourceopen",this.e.onSourceOpen),Q.addEventListener("sourceended",this.e.onSourceEnded),Q.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 Q in this._sourceBuffers){var ae=this._pendingSegments[Q];ae.splice(0,ae.length),this._pendingSegments[Q]=null,this._pendingRemoveRanges[Q]=null,this._lastInitSegments[Q]=null;var fe=this._sourceBuffers[Q];if(fe){if(z.readyState!=="closed"){try{z.removeSourceBuffer(fe)}catch(Ae){C.e(this.TAG,Ae.message)}fe.removeEventListener("error",this.e.onSourceBufferError),fe.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[Q]=null,this._sourceBuffers[Q]=null}}if(z.readyState==="open")try{z.endOfStream()}catch(Ae){C.e(this.TAG,Ae.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,Q){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(z),this._pendingSegments[z.type].push(z);return}var ae=z,fe="".concat(ae.container);ae.codec&&ae.codec.length>0&&(fe+=";codecs=".concat(ae.codec));var Ae=!1;if(C.v(this.TAG,"Received Initialization Segment, mimeType: "+fe),this._lastInitSegments[ae.type]=ae,fe!==this._mimeTypes[ae.type]){if(this._mimeTypes[ae.type])C.v(this.TAG,"Notice: ".concat(ae.type," mimeType changed, origin: ").concat(this._mimeTypes[ae.type],", target: ").concat(fe));else{Ae=!0;try{var Je=this._sourceBuffers[ae.type]=this._mediaSource.addSourceBuffer(fe);Je.addEventListener("error",this.e.onSourceBufferError),Je.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(at){C.e(this.TAG,at.message),this._emitter.emit(st.ERROR,{code:at.code,msg:at.message});return}}this._mimeTypes[ae.type]=fe}Q||this._pendingSegments[ae.type].push(ae),Ae||this._sourceBuffers[ae.type]&&!this._sourceBuffers[ae.type].updating&&this._doAppendSegments(),m.safari&&ae.container==="audio/mpeg"&&ae.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=ae.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(z){var Q=z;this._pendingSegments[Q.type].push(Q),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var ae=this._sourceBuffers[Q.type];ae&&!ae.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(z){for(var Q in this._sourceBuffers){if(!this._sourceBuffers[Q])continue;var ae=this._sourceBuffers[Q];if(this._mediaSource.readyState==="open")try{ae.abort()}catch(It){C.e(this.TAG,It.message)}this._idrList.clear();var fe=this._pendingSegments[Q];if(fe.splice(0,fe.length),this._mediaSource.readyState==="closed")continue;for(var Ae=0;Ae<ae.buffered.length;Ae++){var Je=ae.buffered.start(Ae),at=ae.buffered.end(Ae);this._pendingRemoveRanges[Q].push({start:Je,end:at})}if(ae.updating||this._doRemoveRanges(),m.safari){var Lt=this._lastInitSegments[Q];Lt&&(this._pendingSegments[Q].push(Lt),ae.updating||this._doAppendSegments())}}}},{key:"endOfStream",value:function(){var z=this._mediaSource,Q=this._sourceBuffers;if(!z||z.readyState!=="open"){z&&z.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}Q.video&&Q.video.updating||Q.audio&&Q.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 Q in this._sourceBuffers){var ae=this._sourceBuffers[Q];if(ae){var fe=ae.buffered;if(fe.length>=1&&z-fe.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var z=this._mediaElement.currentTime;for(var Q in this._sourceBuffers){var ae=this._sourceBuffers[Q];if(ae){for(var fe=ae.buffered,Ae=!1,Je=0;Je<fe.length;Je++){var at=fe.start(Je),Lt=fe.end(Je);if(at<=z&&z<Lt+3){if(z-at>=this._config.autoCleanupMaxBackwardDuration){Ae=!0;var It=z-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[Q].push({start:at,end:It})}}else Lt<z&&(Ae=!0,this._pendingRemoveRanges[Q].push({start:at,end:Lt}))}Ae&&!ae.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 Q=this._mediaSource.duration,ae=this._pendingMediaDuration;ae>0&&(isNaN(Q)||ae>Q)&&(C.v(this.TAG,"Update MediaSource duration from ".concat(Q," to ").concat(ae)),this._mediaSource.duration=ae),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 Q=this._sourceBuffers[z],ae=this._pendingRemoveRanges[z];ae.length&&!Q.updating;){var fe=ae.shift();Q.remove(fe.start,fe.end)}}}},{key:"_doAppendSegments",value:function(){var z=this._pendingSegments;for(var Q in z){if(!this._sourceBuffers[Q]||this._sourceBuffers[Q].updating)continue;if(z[Q].length>0){var ae=z[Q].shift();if(ae.timestampOffset){var fe=this._sourceBuffers[Q].timestampOffset,Ae=ae.timestampOffset/1e3,Je=Math.abs(fe-Ae);Je>.1&&(C.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(fe," to ").concat(Ae)),this._sourceBuffers[Q].timestampOffset=Ae),delete ae.timestampOffset}if(!ae.data||ae.data.byteLength===0)continue;try{this._sourceBuffers[Q].appendBuffer(ae.data),this._isBufferFull=!1,Q==="video"&&ae.hasOwnProperty("info")&&this._idrList.appendArray(ae.info.syncPoints)}catch(at){this._pendingSegments[Q].unshift(ae),at.code===22?(this._isBufferFull||this._emitter.emit(st.BUFFER_FULL),this._isBufferFull=!0):(C.e(this.TAG,at.message),this._emitter.emit(st.ERROR,{code:at.code,msg:at.message}))}}}}},{key:"_onSourceOpen",value:function(){if(C.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var z=this._pendingSourceBufferInit;z.length;){var Q=z.shift();this.appendInitSegment(Q,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(st.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){C.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){C.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(st.UPDATE_END)}},{key:"_onSourceBufferError",value:function(z){C.e(this.TAG,"SourceBuffer Error: ".concat(z))}}]),Re}(),lt=mt,De={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Ke={NETWORK_EXCEPTION:n.EXCEPTION,NETWORK_STATUS_CODE_INVALID:n.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:n.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:n.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},vt=function(){function Re(ve,z){if(Object(de.a)(this,Re),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new S.a,this._config=ue(),typeof z=="object"&&Object.assign(this._config,z),ve.type.toLowerCase()!=="flv")throw new s("FlvPlayer requires an flv MediaDataSource input!");ve.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=ve,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 Q=m.chrome&&(m.version.major<50||m.version.major===50&&m.version.build<2661);this._alwaysSeekKeyframe=!!(Q||m.msedge||m.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(ee.a)(Re,[{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,Q){var ae=this;z===Pe.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){ae._emitter.emit(Pe.MEDIA_INFO,ae.mediaInfo)}):z===Pe.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){ae._emitter.emit(Pe.STATISTICS_INFO,ae.statisticsInfo)})),this._emitter.addListener(z,Q)}},{key:"off",value:function(z,Q){this._emitter.removeListener(z,Q)}},{key:"attachMediaElement",value:function(z){var Q=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 lt(this._config),this._msectl.on(st.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(st.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(st.SOURCE_OPEN,function(){Q._mseSourceOpened=!0,Q._hasPendingLoad&&(Q._hasPendingLoad=!1,Q.load())}),this._msectl.on(st.ERROR,function(ae){Q._emitter.emit(Pe.ERROR,De.MEDIA_ERROR,Ke.MEDIA_MSE_ERROR,ae)}),this._msectl.attachMediaElement(z),this._pendingSeekTime!=null)try{z.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(ae){}}},{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 u("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new u("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 Pt(this._mediaDataSource,this._config),this._transmuxer.on(Ce.INIT_SEGMENT,function(Q,ae){z._msectl.appendInitSegment(ae)}),this._transmuxer.on(Ce.MEDIA_SEGMENT,function(Q,ae){if(z._msectl.appendMediaSegment(ae),z._config.lazyLoad&&!z._config.isLive){var fe=z._mediaElement.currentTime;ae.info.endDts>=(fe+z._config.lazyLoadMaxDuration)*1e3&&(z._progressChecker==null&&(C.v(z.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),z._suspendTransmuxer()))}}),this._transmuxer.on(Ce.LOADING_COMPLETE,function(){z._msectl.endOfStream(),z._emitter.emit(Pe.LOADING_COMPLETE)}),this._transmuxer.on(Ce.RECOVERED_EARLY_EOF,function(){z._emitter.emit(Pe.RECOVERED_EARLY_EOF)}),this._transmuxer.on(Ce.IO_ERROR,function(Q,ae){z._emitter.emit(Pe.ERROR,De.NETWORK_ERROR,Q,ae)}),this._transmuxer.on(Ce.DEMUX_ERROR,function(Q,ae){z._emitter.emit(Pe.ERROR,De.MEDIA_ERROR,Q,{code:-1,msg:ae})}),this._transmuxer.on(Ce.MEDIA_INFO,function(Q){z._mediaInfo=Q,z._emitter.emit(Pe.MEDIA_INFO,Object.assign({},Q))}),this._transmuxer.on(Ce.METADATA_ARRIVED,function(Q){z._emitter.emit(Pe.METADATA_ARRIVED,Q)}),this._transmuxer.on(Ce.SCRIPTDATA_ARRIVED,function(Q){z._emitter.emit(Pe.SCRIPTDATA_ARRIVED,Q)}),this._transmuxer.on(Ce.STATISTICS_INFO,function(Q){z._statisticsInfo=z._fillStatisticsInfo(Q),z._emitter.emit(Pe.STATISTICS_INFO,Object.assign({},z._statisticsInfo))}),this._transmuxer.on(Ce.RECOMMEND_SEEKPOINT,function(Q){z._mediaElement&&!z._config.accurateSeek&&(z._requestSetTime=!0,z._mediaElement.currentTime=Q/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 Q=!0,ae=0,fe=0;if(this._mediaElement.getVideoPlaybackQuality){var Ae=this._mediaElement.getVideoPlaybackQuality();ae=Ae.totalVideoFrames,fe=Ae.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(ae=this._mediaElement.webkitDecodedFrameCount,fe=this._mediaElement.webkitDroppedFrameCount):Q=!1;return Q&&(z.decodedFrames=ae,z.droppedFrames=fe),z}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var z=this._mediaElement.buffered,Q=this._mediaElement.currentTime,ae=0,fe=0,Ae=0;Ae<z.length;Ae++){var Je=z.start(Ae),at=z.end(Ae);if(Je<=Q&&Q<at){ae=Je,fe=at;break}}fe>=Q+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(C.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){C.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,Q=this._mediaElement.buffered,ae=!1,fe=0;fe<Q.length;fe++){var Ae=Q.start(fe),Je=Q.end(fe);if(z>=Ae&&z<Je){z>=Je-this._config.lazyLoadRecoverDuration&&(ae=!0);break}}ae&&(window.clearInterval(this._progressChecker),this._progressChecker=null,ae&&(C.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(z){for(var Q=this._mediaElement.buffered,ae=0;ae<Q.length;ae++){var fe=Q.start(ae),Ae=Q.end(ae);if(z>=fe&&z<Ae)return!0}return!1}},{key:"_internalSeek",value:function(z){var Q=this._isTimepointBuffered(z),ae=!1,fe=0;if(z<1&&this._mediaElement.buffered.length>0){var Ae=this._mediaElement.buffered.start(0);(Ae<1&&z<Ae||m.safari)&&(ae=!0,fe=m.safari?.1:Ae)}if(ae)this._requestSetTime=!0,this._mediaElement.currentTime=fe;else if(Q){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 Q=this._mediaElement;if(z||!this._receivedCanPlay||Q.readyState<2){var ae=Q.buffered;ae.length>0&&Q.currentTime<ae.start(0)&&(C.w(this.TAG,"Playback seems stuck at ".concat(Q.currentTime,", seek to ").concat(ae.start(0))),this._requestSetTime=!0,this._mediaElement.currentTime=ae.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 Q=this._mediaElement.currentTime,ae=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(Q<1&&ae.length>0){var fe=ae.start(0);if(fe<1&&Q<fe||m.safari){this._requestSetTime=!0,this._mediaElement.currentTime=m.safari?.1:fe;return}}if(this._isTimepointBuffered(Q)){if(this._alwaysSeekKeyframe){var Ae=this._msectl.getNearestKeyframe(Math.floor(Q*1e3));Ae!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=Ae.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:Q,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()}}]),Re}(),ot=vt,Mt=function(){function Re(ve,z){if(Object(de.a)(this,Re),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new S.a,this._config=ue(),typeof z=="object"&&Object.assign(this._config,z),ve.type.toLowerCase()==="flv")throw new s("NativePlayer does't support flv MediaDataSource input!");if(ve.hasOwnProperty("segments"))throw new s("NativePlayer(".concat(ve.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=ve,this._mediaElement=null}return Object(ee.a)(Re,[{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,Q){var ae=this;z===Pe.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){ae._emitter.emit(Pe.MEDIA_INFO,ae.mediaInfo)}):z===Pe.STATISTICS_INFO&&(this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){ae._emitter.emit(Pe.STATISTICS_INFO,ae.statisticsInfo)})),this._emitter.addListener(z,Q)}},{key:"off",value:function(z,Q){this._emitter.removeListener(z,Q)}},{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(Q){}}},{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 u("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/",Q={mimeType:z+this._mediaDataSource.type};return this._mediaElement&&(Q.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(Q.width=this._mediaElement.videoWidth,Q.height=this._mediaElement.videoHeight)),Q}},{key:"statisticsInfo",get:function(){var z={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return z;var Q=!0,ae=0,fe=0;if(this._mediaElement.getVideoPlaybackQuality){var Ae=this._mediaElement.getVideoPlaybackQuality();ae=Ae.totalVideoFrames,fe=Ae.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(ae=this._mediaElement.webkitDecodedFrameCount,fe=this._mediaElement.webkitDroppedFrameCount):Q=!1;return Q&&(z.decodedFrames=ae,z.droppedFrames=fe),z}},{key:"_onvLoadedMetadata",value:function(z){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(Pe.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(Pe.STATISTICS_INFO,this.statisticsInfo)}}]),Re}(),Nt=Mt;w.install();function it(Re,ve){var z=Re;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 ot(z,ve);default:return new Nt(z,ve)}}function St(){return Oe.supportMSEH264Playback()}function Wt(){return Oe.getFeatureList()}var Kt={};Kt.createPlayer=it,Kt.isSupported=St,Kt.getFeatureList=Wt,Kt.BaseLoader=t,Kt.LoaderStatus=i,Kt.LoaderErrors=n,Kt.Events=Pe,Kt.ErrorTypes=De,Kt.ErrorDetails=Ke,Kt.FlvPlayer=ot,Kt.NativePlayer=Nt,Kt.LoggingControl=xe,Object.defineProperty(Kt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var tn=$e.a=Kt},GgEA:function(rt,$e,H){},Gytx:function(rt,$e){rt.exports=function(de,ee,j,w){var k=j?j.call(w,de,ee):void 0;if(k!==void 0)return!!k;if(de===ee)return!0;if(typeof de!="object"||!de||typeof ee!="object"||!ee)return!1;var S=Object.keys(de),T=Object.keys(ee);if(S.length!==T.length)return!1;for(var C=Object.prototype.hasOwnProperty.bind(ee),h=0;h<S.length;h++){var p=S[h];if(!C(p))return!1;var c=de[p],l=ee[p];if(k=j?j.call(w,c,l,p):void 0,k===!1||k===void 0&&c!==l)return!1}return!0}},HmJG:function(rt,$e,H){},Hw79:function(rt,$e,H){rt.exports={pagination:"pagination___2VQzP",info:"info___1saw2"}},I8Z2:function(rt,$e,H){"use strict";H.d($e,"a",function(){return w}),H.d($e,"b",function(){return a}),H.d($e,"c",function(){return s});var de=H("q1tI"),ee=function(){var f=function(i,n){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,d){t.__proto__=d}||function(t,d){for(var v in d)d.hasOwnProperty(v)&&(t[v]=d[v])},f(i,n)};return function(i,n){f(i,n);function t(){this.constructor=i}i.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}}(),j=de.createContext(null),w=function(f){ee(i,f);function i(){return f!==null&&f.apply(this,arguments)||this}return i.prototype.render=function(){return de.createElement(j.Provider,{value:this.props.store},this.props.children)},i}(de.Component),k=H("Gytx"),S=H.n(k),T=H("2mql"),C=H.n(T),h=function(){var f=function(i,n){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,d){t.__proto__=d}||function(t,d){for(var v in d)d.hasOwnProperty(v)&&(t[v]=d[v])},f(i,n)};return function(i,n){f(i,n);function t(){this.constructor=i}i.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}}(),p=function(){return p=Object.assign||function(f){for(var i,n=1,t=arguments.length;n<t;n++){i=arguments[n];for(var d in i)Object.prototype.hasOwnProperty.call(i,d)&&(f[d]=i[d])}return f},p.apply(this,arguments)};function c(f){return f.displayName||f.name||"Component"}var l=function(){return{}};function a(f,i){i===void 0&&(i={});var n=!!f,t=f||l;return function(v){var g=function(_){h(m,_);function m(y,E){var o=_.call(this,y,E)||this;return o.unsubscribe=null,o.handleChange=function(){if(!o.unsubscribe)return;var x=t(o.store.getState(),o.props);o.setState({subscribed:x})},o.store=o.context,o.state={subscribed:t(o.store.getState(),y),store:o.store,props:y},o}return m.getDerivedStateFromProps=function(y,E){return f&&f.length===2&&y!==E.props?{subscribed:t(E.store.getState(),y),props:y}:{props:y}},m.prototype.componentDidMount=function(){this.trySubscribe()},m.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},m.prototype.shouldComponentUpdate=function(y,E){return!S()(this.props,y)||!S()(this.state.subscribed,E.subscribed)},m.prototype.trySubscribe=function(){n&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},m.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},m.prototype.render=function(){var y=p(p(p({},this.props),this.state.subscribed),{store:this.store});return de.createElement(v,p({},y,{ref:this.props.miniStoreForwardedRef}))},m.displayName="Connect("+c(v)+")",m.contextType=j,m}(de.Component);if(i.forwardRef){var b=de.forwardRef(function(_,m){return de.createElement(g,p({},_,{miniStoreForwardedRef:m}))});return C()(b,v)}return C()(g,v)}}var u=function(){return u=Object.assign||function(f){for(var i,n=1,t=arguments.length;n<t;n++){i=arguments[n];for(var d in i)Object.prototype.hasOwnProperty.call(i,d)&&(f[d]=i[d])}return f},u.apply(this,arguments)};function s(f){var i=f,n=[];function t(g){i=u(u({},i),g);for(var b=0;b<n.length;b++)n[b]()}function d(){return i}function v(g){return n.push(g),function(){var _=n.indexOf(g);n.splice(_,1)}}return{setState:t,getState:d,subscribe:v}}},IBYe:function(rt,$e,H){"use strict";function de(ee){return null}$e.a=de},IxHN:function(rt,$e,H){"use strict";var de=H("q1tI"),ee=H.n(de),j=H("07cG"),w=H.n(j);$e.a=function(k){var S=k.message,T=k.className,C=k.children,h=k.style,p=h===void 0?{}:h;return ee.a.createElement("div",{className:"".concat(w.a.idsRingWrapper," ").concat(T)},ee.a.createElement("div",{className:w.a.ldsRing},ee.a.createElement("div",null),ee.a.createElement("div",null),ee.a.createElement("div",null),ee.a.createElement("div",null)),S?ee.a.createElement("p",{style:p},S):null,C)}},J66h:function(rt,$e,H){(function(de){var ee,j;(function(w,k){rt.exports=k(w)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof de!="undefined"?de:this,function(w){"use strict";w=w||{};var k=w.Base64,S="2.6.4",T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C=function(D){for(var N={},W=0,K=D.length;W<K;W++)N[D.charAt(W)]=W;return N}(T),h=String.fromCharCode,p=function(D){if(D.length<2){var N=D.charCodeAt(0);return N<128?D:N<2048?h(192|N>>>6)+h(128|N&63):h(224|N>>>12&15)+h(128|N>>>6&63)+h(128|N&63)}else{var N=65536+(D.charCodeAt(0)-55296)*1024+(D.charCodeAt(1)-56320);return h(240|N>>>18&7)+h(128|N>>>12&63)+h(128|N>>>6&63)+h(128|N&63)}},c=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,l=function(D){return D.replace(c,p)},a=function(D){var N=[0,2,1][D.length%3],W=D.charCodeAt(0)<<16|(D.length>1?D.charCodeAt(1):0)<<8|(D.length>2?D.charCodeAt(2):0),K=[T.charAt(W>>>18),T.charAt(W>>>12&63),N>=2?"=":T.charAt(W>>>6&63),N>=1?"=":T.charAt(W&63)];return K.join("")},u=w.btoa&&typeof w.btoa=="function"?function(D){return w.btoa(D)}:function(D){if(D.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return D.replace(/[\s\S]{1,3}/g,a)},s=function(D){return u(l(String(D)))},f=function(D){return D.replace(/[+\/]/g,function(N){return N=="+"?"-":"_"}).replace(/=/g,"")},i=function(D,N){return N?f(s(D)):s(D)},n=function(D){return i(D,!0)},t;w.Uint8Array&&(t=function(D,N){for(var W="",K=0,oe=D.length;K<oe;K+=3){var B=D[K],X=D[K+1],V=D[K+2],ne=B<<16|X<<8|V;W+=T.charAt(ne>>>18)+T.charAt(ne>>>12&63)+(typeof X!="undefined"?T.charAt(ne>>>6&63):"=")+(typeof V!="undefined"?T.charAt(ne&63):"=")}return N?f(W):W});var d=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(D){switch(D.length){case 4:var N=(7&D.charCodeAt(0))<<18|(63&D.charCodeAt(1))<<12|(63&D.charCodeAt(2))<<6|63&D.charCodeAt(3),W=N-65536;return h((W>>>10)+55296)+h((W&1023)+56320);case 3:return h((15&D.charCodeAt(0))<<12|(63&D.charCodeAt(1))<<6|63&D.charCodeAt(2));default:return h((31&D.charCodeAt(0))<<6|63&D.charCodeAt(1))}},g=function(D){return D.replace(d,v)},b=function(D){var N=D.length,W=N%4,K=(N>0?C[D.charAt(0)]<<18:0)|(N>1?C[D.charAt(1)]<<12:0)|(N>2?C[D.charAt(2)]<<6:0)|(N>3?C[D.charAt(3)]:0),oe=[h(K>>>16),h(K>>>8&255),h(K&255)];return oe.length-=[0,0,2,1][W],oe.join("")},_=w.atob&&typeof w.atob=="function"?function(D){return w.atob(D)}:function(D){return D.replace(/\S{1,4}/g,b)},m=function(D){return _(String(D).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(D){return g(_(D))},E=function(D){return String(D).replace(/[-_]/g,function(N){return N=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},o=function(D){return y(E(D))},x;w.Uint8Array&&(x=function(D){return Uint8Array.from(m(E(D)),function(N){return N.charCodeAt(0)})});var A=function(){var D=w.Base64;return w.Base64=k,D};if(w.Base64={VERSION:S,atob:m,btoa:u,fromBase64:o,toBase64:i,utob:l,encode:i,encodeURI:n,btou:g,decode:o,noConflict:A,fromUint8Array:t,toUint8Array:x},typeof Object.defineProperty=="function"){var O=function(D){return{value:D,enumerable:!1,writable:!0,configurable:!0}};w.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",O(function(){return o(this)})),Object.defineProperty(String.prototype,"toBase64",O(function(D){return i(this,D)})),Object.defineProperty(String.prototype,"toBase64URI",O(function(){return i(this,!0)}))}}return w.Meteor&&(Base64=w.Base64),rt.exports?rt.exports.Base64=w.Base64:!(ee=[],j=function(){return w.Base64}.apply($e,ee),j!==void 0&&(rt.exports=j)),{Base64:w.Base64}})}).call(this,H("IyRk"))},JOrW:function(rt,$e,H){rt.exports=H.p+"static/gf.09d89ab3.svg"},LdHM:function(rt,$e,H){"use strict";H.d($e,"b",function(){return d}),H.d($e,"a",function(){return g});var de=H("1OyB"),ee=H("vuIU"),j=H("Ji7U"),w=H("LK+K"),k=H("q1tI"),S=H("rePB"),T=H("Ff2n"),C=H("ODXe"),h=H("4IlW"),p=H("bX4T"),c=H("YrtM"),l=H("TSYQ"),a=H.n(l),u=H("+nKL"),s=H("8OUc"),f=function(V,ne){var $=V.prefixCls,Z=V.id,ue=V.flattenOptions,he=V.childrenAsData,Oe=V.values,we=V.searchValue,Pe=V.multiple,_e=V.defaultActiveFirstOption,xe=V.height,Ve=V.itemHeight,Ne=V.notFoundContent,Be=V.open,ze=V.menuItemSelectedIcon,ye=V.virtual,me=V.onSelect,We=V.onToggleOpen,He=V.onActiveValue,nt=V.onScroll,te=V.onMouseEnter,P="".concat($,"-item"),U=Object(c.a)(function(){return ue},[Be,ue],function(Ye,Fe){return Fe[0]&&Ye[1]!==Fe[1]}),q=k.useRef(null),Y=function(Fe){Fe.preventDefault()},J=function(Fe){q.current&&q.current.scrollTo({index:Fe})},Ee=function(Fe){for(var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Me=U.length,be=0;be<Me;be+=1){var Te=(Fe+be*Ie+Me)%Me,Le=U[Te],Ce=Le.group,et=Le.data;if(!Ce&&!et.disabled)return Te}return-1},ke=k.useState(function(){return Ee(0)}),ht=Object(C.a)(ke,2),Ue=ht[0],je=ht[1],tt=function(Fe){je(Fe);var Ie=U[Fe];if(!Ie){He(null,-1);return}He(Ie.data.value,Fe)};k.useEffect(function(){tt(_e!==!1?Ee(0):-1)},[U.length,we]),k.useEffect(function(){var Ye=setTimeout(function(){if(!Pe&&Be&&Oe.size===1){var Fe=Array.from(Oe)[0],Ie=U.findIndex(function(Me){var be=Me.data;return be.value===Fe});tt(Ie),J(Ie)}});return function(){return clearTimeout(Ye)}},[Be]);var dt=function(Fe){Fe!==void 0&&me(Fe,{selected:!Oe.has(Fe)}),Pe||We(!1)};if(k.useImperativeHandle(ne,function(){return{onKeyDown:function(Fe){var Ie=Fe.which;switch(Ie){case h.a.UP:case h.a.DOWN:{var Me=0;if(Ie===h.a.UP?Me=-1:Ie===h.a.DOWN&&(Me=1),Me!==0){var be=Ee(Ue+Me,Me);J(be),tt(be)}break}case h.a.ENTER:{var Te=U[Ue];Te&&!Te.data.disabled?dt(Te.data.value):dt(void 0),Be&&Fe.preventDefault();break}case h.a.ESC:We(!1)}},onKeyUp:function(){},scrollTo:function(Fe){J(Fe)}}}),U.length===0)return k.createElement("div",{role:"listbox",id:"".concat(Z,"_list"),className:"".concat(P,"-empty"),onMouseDown:Y},Ne);function qe(Ye){var Fe=U[Ye];if(!Fe)return null;var Ie=Fe.data||{},Me=Ie.value,be=Ie.label,Te=Ie.children,Le=Object(p.a)(Ie,!0),Ce=he?Te:be;return Fe?k.createElement("div",Object.assign({"aria-label":typeof Ce=="string"?Ce:null},Le,{key:Ye,role:"option",id:"".concat(Z,"_list_").concat(Ye),"aria-selected":Oe.has(Me)}),Me):null}return k.createElement(k.Fragment,null,k.createElement("div",{role:"listbox",id:"".concat(Z,"_list"),style:{height:0,width:0,overflow:"hidden"}},qe(Ue-1),qe(Ue),qe(Ue+1)),k.createElement(u.a,{itemKey:"key",ref:q,data:U,height:xe,itemHeight:Ve,fullHeight:!1,onMouseDown:Y,onScroll:nt,virtual:ye,onMouseEnter:te},function(Ye,Fe){var Ie,Me=Ye.group,be=Ye.groupOption,Te=Ye.data,Le=Te.label,Ce=Te.key;if(Me)return k.createElement("div",{className:a()(P,"".concat(P,"-group"))},Le!==void 0?Le:Ce);var et=Te.disabled,Qe=Te.value,yt=Te.title,Dt=Te.children,Bt=Te.style,Pt=Te.className,Rt=Object(T.a)(Te,["disabled","value","title","children","style","className"]),st=Oe.has(Qe),mt="".concat(P,"-option"),lt=a()(P,mt,Pt,(Ie={},Object(S.a)(Ie,"".concat(mt,"-grouped"),be),Object(S.a)(Ie,"".concat(mt,"-active"),Ue===Fe&&!et),Object(S.a)(Ie,"".concat(mt,"-disabled"),et),Object(S.a)(Ie,"".concat(mt,"-selected"),st),Ie)),De=he?Dt:Le,Ke=!ze||typeof ze=="function"||st;return k.createElement("div",Object.assign({},Rt,{"aria-selected":st,className:lt,title:yt,onMouseMove:function(){if(Ue===Fe||et)return;tt(Fe)},onClick:function(){et||dt(Qe)},style:Bt}),k.createElement("div",{className:"".concat(mt,"-content")},De||Qe),k.isValidElement(ze)||st,Ke&&k.createElement(s.a,{className:"".concat(P,"-option-state"),customizeIcon:ze,customizeIconProps:{isSelected:st}},st?"\u2713":null))}))},i=k.forwardRef(f);i.displayName="OptionList";var n=i,t=function(){return null};t.isSelectOption=!0;var d=t,v=function(){return null};v.isSelectOptGroup=!0;var g=v,b=H("VTBJ"),_=H("Zm9Q");function m(X){var V=X.key,ne=X.props,$=ne.children,Z=ne.value,ue=Object(T.a)(ne,["children","value"]);return Object(b.a)({key:V,value:Z!==void 0?Z:V,children:$},ue)}function y(X){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(_.a)(X).map(function(ne,$){if(!k.isValidElement(ne)||!ne.type)return null;var Z=ne.type.isSelectOptGroup,ue=ne.key,he=ne.props,Oe=he.children,we=Object(T.a)(he,["children"]);return V||!Z?m(ne):Object(b.a)(Object(b.a)({key:"__RC_SELECT_GRP__".concat(ue===null?$:ue,"__"),label:ue},we),{},{options:y(Oe)})}).filter(function(ne){return ne})}var E=H("2Qr1"),o=H("qNPg"),x=H("U8pU"),A=H("Kwbf"),O=H("WKfj");function D(X){var V=X.mode,ne=X.options,$=X.children,Z=X.backfill,ue=X.allowClear,he=X.placeholder,Oe=X.getInputElement,we=X.showSearch,Pe=X.onSearch,_e=X.defaultOpen,xe=X.autoFocus,Ve=X.labelInValue,Ne=X.value,Be=X.inputValue,ze=X.optionLabelProp,ye=V==="multiple"||V==="tags",me=we!==void 0?we:ye||V==="combobox",We=ne||y($);if(Object(A.a)(V!=="tags"||We.every(function(P){return!P.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var He=We.some(function(P){return P.options?P.options.some(function(U){return typeof("value"in U?U.value:U.key)=="number"}):typeof("value"in P?P.value:P.key)=="number"});Object(A.a)(!He,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(A.a)(V!=="combobox"||!ze,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(A.a)(V==="combobox"||!Z,"`backfill` only works with `combobox` mode."),Object(A.a)(V==="combobox"||!Oe,"`getInputElement` only work with `combobox` mode."),Object(A.b)(V!=="combobox"||!Oe||!ue||!he,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Pe&&!me&&V!=="combobox"&&V!=="tags"&&Object(A.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(A.b)(!_e||xe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ne!=null){var nt=Object(O.d)(Ne);Object(A.a)(!Ve||nt.every(function(P){return Object(x.a)(P)==="object"&&("key"in P||"value"in P)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(A.a)(!ye||Array.isArray(Ne),"`value` should be array when `mode` is `multiple` or `tags`")}if($){var te=null;Object(_.a)($).some(function(P){if(!k.isValidElement(P)||!P.type)return!1;var U=P.type;if(U.isSelectOption)return!1;if(U.isSelectOptGroup){var q=Object(_.a)(P.props.children).every(function(Y){return!k.isValidElement(Y)||!P.type||Y.type.isSelectOption?!0:(te=Y.type,!1)});return!q}return te=U,!0}),te&&Object(A.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(te.displayName||te.name||te,"`.")),Object(A.a)(Be===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=D,W=Object(o.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:y,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:N,fillOptionsWithMissingValue:E.a}),K=function(X){Object(j.a)(ne,X);var V=Object(w.a)(ne);function ne(){var $;return Object(de.a)(this,ne),$=V.apply(this,arguments),$.selectRef=k.createRef(),$.focus=function(){$.selectRef.current.focus()},$.blur=function(){$.selectRef.current.blur()},$}return Object(ee.a)(ne,[{key:"render",value:function(){return k.createElement(W,Object.assign({ref:this.selectRef},this.props))}}]),ne}(k.Component);K.Option=d,K.OptGroup=g;var oe=K,B=$e.c=oe},M8RZ:function(rt,$e,H){"use strict";H.d($e,"a",function(){return h});var de=H("fWQN"),ee=H("mtLc"),j=H("yKVA"),w=H("879j"),k=H("q1tI"),S=H.n(k),T=H("i8i4"),C=H.n(T),h=function(p){Object(j.a)(l,p);var c=Object(w.a)(l);function l(a){var u;Object(de.a)(this,l),u=c.call(this,a);var s=window.document;return u.node=s.createElement("div"),s.body.appendChild(u.node),u}return Object(ee.a)(l,[{key:"render",value:function(){var u=this.props.children;return Object(T.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),l}(S.a.Component)},MFOe:function(rt,$e,H){(function(de){var ee=S(),j=T(),w=C(),k=typeof window!="undefined"?window:de;rt.exports={assign:ee,create:j,trim:w,bind:h,slice:p,each:c,map:l,pluck:a,isList:u,isFunction:s,isObject:f,Global:k};function S(){return Object.assign?Object.assign:function(n,t,d,v){for(var g=1;g<arguments.length;g++)c(Object(arguments[g]),function(b,_){n[_]=b});return n}}function T(){if(Object.create)return function(t,d,v,g){var b=p(arguments,1);return ee.apply(this,[Object.create(t)].concat(b))};{function i(){}return function(t,d,v,g){var b=p(arguments,1);return i.prototype=t,ee.apply(this,[new i].concat(b))}}}function C(){return String.prototype.trim?function(n){return String.prototype.trim.call(n)}:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function h(i,n){return function(){return n.apply(i,Array.prototype.slice.call(arguments,0))}}function p(i,n){return Array.prototype.slice.call(i,n||0)}function c(i,n){a(i,function(t,d){return n(t,d),!1})}function l(i,n){var t=u(i)?[]:{};return a(i,function(d,v){return t[v]=n(d,v),!1}),t}function a(i,n){if(u(i)){for(var t=0;t<i.length;t++)if(n(i[t],t))return i[t]}else for(var d in i)if(i.hasOwnProperty(d)&&n(i[d],d))return i[d]}function u(i){return i!=null&&typeof i!="function"&&typeof i.length=="number"}function s(i){return i&&{}.toString.call(i)==="[object Function]"}function f(i){return i&&{}.toString.call(i)==="[object Object]"}}).call(this,H("IyRk"))},MVJL:function(rt,$e,H){rt.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"}},NvD2:function(rt,$e,H){"use strict";H.d($e,"a",function(){return S});var de=H("Kwbf");function ee(T,C){var h=new Set;return T.forEach(function(p){C.has(p)||h.add(p)}),h}function j(T){var C=T||{},h=C.disabled,p=C.disableCheckbox,c=C.checkable;return!!(h||p)||c===!1}function w(T,C,h,p){for(var c=new Set(T),l=new Set,a=0;a<=h;a+=1){var u=C.get(a)||new Set;u.forEach(function(n){var t=n.key,d=n.node,v=n.children,g=v===void 0?[]:v;c.has(t)&&!p(d)&&g.filter(function(b){return!p(b.node)}).forEach(function(b){c.add(b.key)})})}for(var s=new Set,f=h;f>=0;f-=1){var i=C.get(f)||new Set;i.forEach(function(n){var t=n.parent,d=n.node;if(p(d)||!n.parent||s.has(n.parent.key))return;if(p(n.parent.node)){s.add(t.key);return}var v=!0,g=!1;(t.children||[]).filter(function(b){return!p(b.node)}).forEach(function(b){var _=b.key,m=c.has(_);v&&!m&&(v=!1),!g&&(m||l.has(_))&&(g=!0)}),v&&c.add(t.key),g&&l.add(t.key),s.add(t.key)})}return{checkedKeys:Array.from(c),halfCheckedKeys:Array.from(ee(l,c))}}function k(T,C,h,p,c){for(var l=new Set(T),a=new Set(C),u=0;u<=p;u+=1){var s=h.get(u)||new Set;s.forEach(function(t){var d=t.key,v=t.node,g=t.children,b=g===void 0?[]:g;!l.has(d)&&!a.has(d)&&!c(v)&&b.filter(function(_){return!c(_.node)}).forEach(function(_){l.delete(_.key)})})}a=new Set;for(var f=new Set,i=p;i>=0;i-=1){var n=h.get(i)||new Set;n.forEach(function(t){var d=t.parent,v=t.node;if(c(v)||!t.parent||f.has(t.parent.key))return;if(c(t.parent.node)){f.add(d.key);return}var g=!0,b=!1;(d.children||[]).filter(function(_){return!c(_.node)}).forEach(function(_){var m=_.key,y=l.has(m);g&&!y&&(g=!1),!b&&(y||a.has(m))&&(b=!0)}),g||l.delete(d.key),b&&a.add(d.key),f.add(d.key)})}return{checkedKeys:Array.from(l),halfCheckedKeys:Array.from(ee(a,l))}}function S(T,C,h,p){var c=[],l;p?l=p:l=j;var a=new Set(T.filter(function(i){var n=!!h[i];return n||c.push(i),n})),u=new Map,s=0;Object.keys(h).forEach(function(i){var n=h[i],t=n.level,d=u.get(t);d||(d=new Set,u.set(t,d)),d.add(n),s=Math.max(s,t)}),Object(de.a)(!c.length,"Tree missing follow keys: ".concat(c.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var f;return C===!0?f=w(a,u,s,l):f=k(a,C.halfCheckedKeys,u,s,l),f}},OLES:function(rt,$e,H){"use strict";var de=H("U8pU"),ee=H("VTBJ"),j=H("Ff2n"),w=H("q1tI"),k=H("uciX"),S=H("7ixt"),T=function(a){var u=a.overlay,s=a.prefixCls,f=a.id,i=a.overlayInnerStyle;return w.createElement("div",{className:"".concat(s,"-inner"),id:f,role:"tooltip",style:i},typeof u=="function"?u():u)},C=T,h=function(a,u){var s=a.overlayClassName,f=a.trigger,i=f===void 0?["hover"]:f,n=a.mouseEnterDelay,t=n===void 0?0:n,d=a.mouseLeaveDelay,v=d===void 0?.1:d,g=a.overlayStyle,b=a.prefixCls,_=b===void 0?"rc-tooltip":b,m=a.children,y=a.onVisibleChange,E=a.afterVisibleChange,o=a.transitionName,x=a.animation,A=a.placement,O=A===void 0?"right":A,D=a.align,N=D===void 0?{}:D,W=a.destroyTooltipOnHide,K=W===void 0?!1:W,oe=a.defaultVisible,B=a.getTooltipContainer,X=a.overlayInnerStyle,V=Object(j.a)(a,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ne=Object(w.useRef)(null);Object(w.useImperativeHandle)(u,function(){return ne.current});var $=Object(ee.a)({},V);"visible"in a&&($.popupVisible=a.visible);var Z=function(){var Pe=a.arrowContent,_e=Pe===void 0?null:Pe,xe=a.overlay,Ve=a.id;return[w.createElement("div",{className:"".concat(_,"-arrow"),key:"arrow"},_e),w.createElement(C,{key:"content",prefixCls:_,id:Ve,overlay:xe,overlayInnerStyle:X})]},ue=!1,he=!1;if(typeof K=="boolean")ue=K;else if(K&&Object(de.a)(K)==="object"){var Oe=K.keepParent;ue=Oe===!0,he=Oe===!1}return w.createElement(k.a,Object.assign({popupClassName:s,prefixCls:_,popup:Z,action:i,builtinPlacements:S.a,popupPlacement:O,ref:ne,popupAlign:N,getPopupContainer:B,onPopupVisibleChange:y,afterPopupVisibleChange:E,popupTransitionName:o,popupAnimation:x,defaultPopupVisible:oe,destroyPopupOnHide:ue,autoDestroy:he,mouseLeaveDelay:v,popupStyle:g,mouseEnterDelay:t},$),m)},p=Object(w.forwardRef)(h),c=$e.a=p},OZM5:function(rt,$e,H){"use strict";H.d($e,"b",function(){return p}),H.d($e,"a",function(){return c}),H.d($e,"k",function(){return l}),H.d($e,"h",function(){return a}),H.d($e,"i",function(){return u}),H.d($e,"g",function(){return s}),H.d($e,"c",function(){return f}),H.d($e,"d",function(){return i}),H.d($e,"j",function(){return d}),H.d($e,"e",function(){return v}),H.d($e,"f",function(){return g});var de=H("KQm4"),ee=H("U8pU"),j=H("Ff2n"),w=H("q1tI"),k=H.n(w),S=H("Kwbf"),T=H("WaYH"),C=.25,h=2;function p(b,_){var m=b.slice(),y=m.indexOf(_);return y>=0&&m.splice(y,1),m}function c(b,_){var m=b.slice();return m.indexOf(_)===-1&&m.push(_),m}function l(b){return b.split("-")}function a(b,_){return"".concat(b,"-").concat(_)}function u(b){return b&&b.type&&b.type.isTreeNode}function s(b,_){var m=[b],y=_[b];function E(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];o.forEach(function(x){var A=x.key,O=x.children;m.push(A),E(O)})}return E(y.children),m}function f(b,_){var m=b.clientY,y=_.selectHandle.getBoundingClientRect(),E=y.top,o=y.bottom,x=y.height,A=Math.max(x*C,h);return m<=E+A?-1:m>=o-A?1:0}function i(b,_){if(!b)return;var m=_.multiple;return m?b.slice():b.length?[b[0]]:b}var n=function(_){return _};function t(b,_){if(!b)return[];var m=_||{},y=m.processProps,E=y===void 0?n:y,o=Array.isArray(b)?b:[b];return o.map(function(x){var A=x.children,O=Object(j.a)(x,["children"]),D=t(A,_);return k.a.createElement(T.a,Object.assign({},E(O)),D)})}function d(b){if(!b)return null;var _;if(Array.isArray(b))_={checkedKeys:b,halfCheckedKeys:void 0};else if(Object(ee.a)(b)==="object")_={checkedKeys:b.checked||void 0,halfCheckedKeys:b.halfChecked||void 0};else return Object(S.a)(!1,"`checkedKeys` is not an array or an object"),null;return _}function v(b,_){var m=new Set;function y(E){if(m.has(E))return;var o=_[E];if(!o)return;m.add(E);var x=o.parent,A=o.node;if(A.disabled)return;x&&y(x.key)}return(b||[]).forEach(function(E){y(E)}),Object(de.a)(m)}function g(b){var _={};return Object.keys(b).forEach(function(m){(m.startsWith("data-")||m.startsWith("aria-"))&&(_[m]=b[m])}),_}},"OkW/":function(rt,$e,H){},Ot1p:function(rt,$e,H){"use strict";var de=H("2qtc"),ee=H("kLXV"),j=H("rAM+"),w=H("miYZ"),k=H("tsqr"),S=H("9og8"),T=H("tJVT"),C=H("jrin"),h=H("WmNS"),p=H.n(h),c=H("q1tI"),l=H.n(c),a=H("VrN/"),u=H.n(a),s=H("bdgK"),f=H("p77/"),i=H("Bd2K"),n=H("ELLl"),t=H("19Vz"),d=H("lZu9"),v=H("+NIl"),g=H("kSUc"),b=H("9Bee"),_=function(Qe){var yt=Qe.value,Dt=yt===void 0?"":yt,Bt=Qe.className,Pt=Qe.showTextOnly,Rt=Qe.showLines,st=Qe.style,mt=st===void 0?{}:st,lt=Object(c.useMemo)(function(){return""},[Dt]);return l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{dangerouslySetInnerHTML:{__html:lt}}))},m=H("0Owb"),y=H("dejd"),E=H("C+DQ"),o=H("1vsH"),x=H("m3rI"),A=[{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 O(Qe){var yt=Qe.onActionCallback,Dt=Qe.title,Bt=Qe.icon,Pt=Qe.actionName,Rt=Qe.className,st=Rt===void 0?"":Rt,mt=Qe.children;function lt(){yt(Pt)}return l.a.createElement("a",{title:Dt,className:st,onClick:lt},l.a.createElement("i",{className:"md-iconfont ".concat(Bt)}),mt)}var D=function(Qe){var yt=Qe.watch,Dt=Qe.showNullButton,Bt=Qe.onActionCallback,Pt=Qe.fullScreen,Rt=Qe.insertTemp,st=Qe.hidetoolBar,mt=Qe.uuid,lt=Qe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(o.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(o.E)("_educoder_session"),"&key=").concat(mt,"&api=").concat(encodeURIComponent(x.a.PROXY_SERVER)));var De=[].concat(A,[{title:"".concat(yt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(yt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return l.a.createElement("ul",{className:"markdown-toolbar-container"},!st&&De.map(function(Ke,vt){return l.a.createElement("li",{key:vt},Ke.actionName?l.a.createElement(O,Object(m.a)({},Ke,{onActionCallback:Bt})):l.a.createElement("span",{className:"v-line"}))}),Dt?l.a.createElement("li",null,l.a.createElement(O,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Bt},l.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Rt&&l.a.createElement("li",null,l.a.createElement(O,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Rt),onActionCallback:Bt},l.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),l.a.createElement("li",{className:"btn-full-screen"},l.a.createElement(O,{icon:"".concat(Pt?"icon-shrink":"icon-enlarge"),title:Pt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Bt})))},N=H("M8RZ"),W=H("+L6B"),K=H("2/Rp"),oe=H("y8nQ"),B=H("Vl3Y"),X=H("5NDa"),V=H("5rEg"),ne={labelCol:{span:4},wrapperCol:{span:20}},$=function(Qe){var yt=Qe.callback,Dt=Qe.onCancel;function Bt(Pt){yt(Pt)}return l.a.createElement(B.a,Object(m.a)({},ne,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Bt}),l.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},l.a.createElement(V.a,null)),l.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},l.a.createElement(V.a,null)),l.a.createElement("div",{className:"flex-container flex-end"},l.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),l.a.createElement(K.a,{type:"ghost",onClick:Dt},"\u53D6\u6D88")))},Z=H("7ahc"),ue=H("k1fw"),he=H("HmJG"),Oe=H("BjJ7"),we=B.a.useForm,Pe={width:280,marginRight:10},_e={labelCol:{span:5},wrapperCol:{span:19}},xe=function(Qe){var yt=Qe.callback,Dt=Qe.onCancel,Bt=we(),Pt=Object(T.a)(Bt,1),Rt=Pt[0],st=Object(c.useRef)();function mt(Ke){yt(Object(ue.a)(Object(ue.a)({},Ke),{},{name:st.current}))}function lt(Ke,vt){Rt.setFieldsValue({src:"/api/attachments/".concat(Ke.id,"?type=").concat(Ke.content_type),type:vt.type})}function De(Ke){var vt=Ke.target.files[0];st.current=vt.name,Ne(vt,lt)}return l.a.createElement(B.a,Object(m.a)({form:Rt},_e,{className:"upload-image-panel",onFinish:mt}),l.a.createElement(B.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},l.a.createElement("div",{className:"flex-container"},l.a.createElement(B.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},l.a.createElement(V.a,{style:Pe})),l.a.createElement(Ve,{onFileChange:De}))),l.a.createElement(B.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},l.a.createElement(V.a,{style:{width:264}})),l.a.createElement(B.a.Item,{style:{textAlign:"right"}},l.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),l.a.createElement(K.a,{type:"ghost",onClick:Dt},"\u53D6\u6D88")))};function Ve(Qe){var yt=Qe.onFileChange;return l.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",l.a.createElement("input",{type:"file",onChange:yt}))}function Ne(Qe,yt){if(!Qe)throw new String("\u6CA1\u6709\u6587\u4EF6");var Dt=new FormData;Dt.append("editormd-image-file",Qe),Dt.append("file_param_name","editormd-image-file"),Dt.append("byxhr","true");var Bt=new window.XMLHttpRequest;Bt.withCredentials=!0,Bt.addEventListener("load",function(Pt){yt(JSON.parse(Pt.target.responseText),Qe)},!1),Bt.addEventListener("error",function(Pt){console.error(Pt)},!1),Bt.open("POST","".concat(Oe.a,"/api/attachments.json")),Bt.send(Dt)}var Be=H("giR+"),ze=H("fyUT"),ye=H("7Kak"),me=H("9yH6"),We=me.a.Group,He={margin:"0 8px"},nt=function(Qe){var yt=Qe.callback,Dt=Qe.onCancel;function Bt(Pt){yt(Pt)}return l.a.createElement(B.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Bt},l.a.createElement("div",{className:"flex-container"},l.a.createElement("span",{style:He},"\u5355\u5143\u683C\u6570\uFF1A"),l.a.createElement("span",{style:He},"\u884C\u6570"),l.a.createElement(B.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},l.a.createElement(ze.a,null)),l.a.createElement("span",{style:He},"\u5217\u6570"),l.a.createElement(B.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},l.a.createElement(ze.a,null))),l.a.createElement("div",{className:"flex-container",style:{marginTop:12}},l.a.createElement("span",{style:He},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),l.a.createElement(B.a.Item,{name:"align"},l.a.createElement(We,null,l.a.createElement(me.a,{value:"default"},l.a.createElement("i",{className:"fa fa-align-justify"})),l.a.createElement(me.a,{value:"left"},l.a.createElement("i",{className:"fa fa-align-left"})),l.a.createElement(me.a,{value:"center"},l.a.createElement("i",{className:"fa fa-align-center"})),l.a.createElement(me.a,{value:"right"},l.a.createElement("i",{className:"fa fa-align-right"}))))),l.a.createElement("div",{className:"flex-container flex-end"},l.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),l.a.createElement(K.a,{type:"ghost",onClick:Dt},"\u53D6\u6D88")))},te=H("ErOA"),P=H("7Cbv"),U="link",q="upload-image",Y="code-block",J="add-table",Ee="------------",ke={default:Ee,left:":".concat(Ee),center:":".concat(Ee,":"),right:"".concat(Ee,":")},ht=H("9VGf"),Ue,je;function tt(){}var dt=0,qe=1e4,Ye="\u2581",Fe=`
|
|
|
**\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 Ie(Qe){return/^\d+$/.test(Qe)?"".concat(Qe,"px"):Qe}var Me=navigator.platform.toUpperCase().indexOf("MAC")>=0,be=Me?"Cmd":"Ctrl",Te=["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"],Le=(Ue={},Object(C.a)(Ue,be+"-B","bold"),Object(C.a)(Ue,be+"-I","italic"),Ue),Ce=(je={},Object(C.a)(je,U,"\u6DFB\u52A0\u94FE\u63A5"),Object(C.a)(je,Y,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(C.a)(je,q,"\u6DFB\u52A0\u6587\u4EF6"),Object(C.a)(je,J,"\u6DFB\u52A0\u8868\u683C"),je),et=$e.a=function(Qe){var yt=Qe.defaultValue,Dt=yt===void 0?"":yt,Bt=Qe.onChange,Pt=Qe.width,Rt=Pt===void 0?"100%":Pt,st=Qe.height,mt=st===void 0?400:st,lt=Qe.miniToolbar,De=lt===void 0?!1:lt,Ke=Qe.isFocus,vt=Ke===void 0?!1:Ke,ot=Qe.watch,Mt=Qe.insertTemp,Nt=Qe.mode,it=Nt===void 0?"markdown":Nt,St=Qe.id,Wt=St===void 0?"markdown-editor-id":St,Kt=Qe.showResizeBar,tn=Kt===void 0?!1:Kt,Re=Qe.noStorage,ve=Re===void 0?!1:Re,z=Qe.showNullButton,Q=z===void 0?!1:z,ae=Qe.hidetoolBar,fe=ae===void 0?!1:ae,Ae=Qe.fullScreen,Je=Ae===void 0?!1:Ae,at=Qe.onBlur,Lt=Qe.onCMBeforeChange,It=Qe.onFullScreen,ct=Qe.className,kt=ct===void 0?"":ct,nn=Qe.disablePaste,Ot=nn===void 0?!1:nn,un=Qe.placeholder,an=un===void 0?"":un,re=Qe.values,I=re===void 0?"":re,F=Object(c.useState)(null),ie=Object(T.a)(F,2),ce=ie[0],se=ie[1],Xe=Object(c.useState)(Dt),_t=Object(T.a)(Xe,2),At=_t[0],Vt=_t[1],wt=Object(c.useState)(ot),Ht=Object(T.a)(wt,2),en=Ht[0],jn=Ht[1],Dr=Object(c.useState)(Je),wr=Object(T.a)(Dr,2),Nn=wr[0],hr=wr[1],mi=Object(c.useState)(""),Ar=Object(T.a)(mi,2),yr=Ar[0],pr=Ar[1],Yr=Object(c.useState)(0),Mr=Object(T.a)(Yr,2),Zr=Mr[0],Cr=Mr[1],gi=Object(c.useState)(mt),li=Object(T.a)(gi,2),zr=li[0],Kr=li[1],xi=Object(c.useState)(!1),vi=Object(T.a)(xi,2),Si=vi[0],Fn=vi[1],Sn=Object(c.useRef)(Object(P.a)()),Er=Object(c.useRef)(!1),Kn=Object(c.useRef)(),Lr=Object(c.useRef)(),rr=Object(c.useRef)(),Ri=Object(c.useRef)(),kr=Object(c.useRef)(),ni=function(){var ln=Object(S.a)(p.a.mark(function wn(){var pn,Un;return p.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return mr.next=2,Object(te.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:",ce,Lr),Un.attachments.map(function(Zn){Zn.content_type.indexOf("image")>-1?ce.replaceSelection(".concat(Zn.content_type,")")):Zn.content_type.indexOf("video")>-1?ce.replaceSelection('<video width="100%" controls src="'.concat(x.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Zn.content_type.indexOf("pdf")>-1?ce.replaceSelection('<a href="'.concat(x.a.API_SERVER,"/api/attachments/").concat(Zn.id,"?type=").concat(Zn.content_type,'&disposition=inline" target="_blank">').concat(Zn.name,"</a>")):ce.replaceSelection("[".concat(Zn.name,"](").concat(x.a.API_SERVER,"/api/attachments/").concat(Zn.id,"?type=").concat(Zn.content_type,")"))}));case 4:case"end":return mr.stop()}},wn)}));return function(){return ln.apply(this,arguments)}}();Object(c.useEffect)(function(){Vt(I),ce==null||ce.setValue(I)},[I]),Object(c.useEffect)(function(){It==null||It(Nn)},[Nn]),Object(c.useEffect)(function(){if(Lr.current){var ln=u.a.fromTextArea(Lr.current,{mode:it,lineNumbers:!De,lineWrapping:!0,value:Dt,autoCloseTags:!0,autoCloseBrackets:!0});vt&&ln.focus();function wn(pn,Un){if(Ot){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();Ne(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?ln.replaceSelection(".concat(cr.content_type,")")):(Bn==null||((bi=Bn.type)===null||bi===void 0)?void 0:bi.indexOf("video"))>-1?ln.replaceSelection('<video width="100%" controls src="'.concat(x.a.API_SERVER,"/api/attachments/").concat(cr.id,'"></video>')):(Bn==null||((ft=Bn.type)===null||ft===void 0)?void 0:ft.indexOf("pdf"))>-1?ln.replaceSelection('<a href="'.concat(x.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(Bn.type,'&disposition=inline" target="_blank">').concat(Bn.name,"</a>")):Te.includes(Bi)?ln.replaceSelection('<a href="'.concat(x.a.API_SERVER,"/api/attachments/").concat(cr.id,'?type=office&disposition=inline" target="_blank">').concat(Bn.name,"</a>")):ln.replaceSelection("[".concat(Bn.name,"](").concat(x.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){k.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ln.on("paste",wn),ln.on("dragleave",function(pn,Un){rr.current.classList.remove("mouse-hover-md")}),ln.on("dragover",function(pn,Un){rr.current.classList.add("mouse-hover-md")}),ln.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();Ne(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?ln.replaceSelection(".concat(cr.content_type,")")):(Bn==null||((bi=Bn.type)===null||bi===void 0)?void 0:bi.indexOf("video"))>-1?ln.replaceSelection('<video width="100%" controls src="'.concat(x.a.API_SERVER,"/api/attachments/").concat(cr.id,'"></video>')):(Bn==null||((ft=Bn.type)===null||ft===void 0)?void 0:ft.indexOf("pdf"))>-1?ln.replaceSelection('<a href="'.concat(x.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(Bn.type,'&disposition=inline" target="_blank">').concat(Bn.name,"</a>")):Te.includes(Bi)?ln.replaceSelection('<a href="'.concat(x.a.API_SERVER,"/api/attachments/").concat(cr.id,'?type=office&disposition=inline" target="_blank">').concat(Bn.name,"</a>")):ln.replaceSelection("[".concat(Bn.name,"](").concat(x.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(ln),function(){ln.off("paste",wn)}}},[]);var ji=Object(c.useCallback)(function(){if(rr.current)try{}catch(ln){console.log(ln,"---- to set md editor body height")}},[zr,rr,Nn]);Object(c.useEffect)(function(){function ln(){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(),ce.setSize("100%","100%"),ce.refresh())}}catch(hn){ur.e(hn)}finally{ur.f()}});return pn.observe(Lr.current.parentElement),pn}if(ce){var wn=ln();return function(){wn.unobserve(Lr.current.parentElement)}}},[ce,ji]),Object(c.useEffect)(function(){if(ce){for(var ln=[],wn=function(){var Zn=Un[pn];ur=Object(T.a)(Zn,2);var hn=ur[0],Fr=ur[1],Bn=Object(C.a)({},hn,function(){ui(Fr)});ln.push(Bn),ce.addKeyMap(Bn)},pn=0,Un=Object.entries(Le);pn<Un.length;pn++){var ur;wn()}return Kn.current=setInterval(function(){Er.current&&ni()},4e3),function(){clearInterval(Kn.current);var mr=Object(j.a)(ln),Zn;try{for(mr.s();!(Zn=mr.n()).done;){var hn=Zn.value;ce.removeKeyMap(hn)}}catch(Fr){mr.e(Fr)}finally{mr.f()}}}},[ce]),Object(c.useEffect)(function(){Je!==Nn&&hr(Je)},[Je]),Object(ht.a)(function(){if(!ve&&Zr>0){var ln=new Date().getTime(),wn=window.sessionStorage.getItem(Wt);ln>=Zr+qe&&(!wn||wn!==At)&&(window.sessionStorage.setItem(Wt,At),Fn(!0))}},qe),Object(c.useEffect)(function(){jn(ot)},[ce,ot]),Object(c.useEffect)(function(){ce&&(vt&&ce.focus())},[ce,vt]),Object(c.useEffect)(function(){if(en&&ce){var ln=ce.getScrollerElement();function wn(pn){var Un=pn.target;if(kr.current){var ur=Un.scrollTop/Un.scrollHeight;kr.current.scrollTop=kr.current.scrollHeight*ur}}return ln.addEventListener("scroll",wn),function(){ln.removeEventListener("scroll",wn)}}},[ce,en]),Object(c.useEffect)(function(){if(ce&&Lt){function ln(wn,pn){Lt(wn,pn)}return ce.on("beforeChange",ln),function(){ce.off("beforeChange",ln)}}},[ce,Lt]),Object(c.useEffect)(function(){if(ce&&at){function ln(){at(ce.getValue())}return ce.on("blur",ln),function(){ce.off("blur",ln)}}},[ce,at]),Object(c.useEffect)(function(){if(ce){function ln(wn){var pn=wn.getValue();Vt(pn),Cr(new Date().getTime()),wn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Bt&&Bt(pn)}return ce.on("change",ln),function(){ce.off("change",ln)}}},[ce,Bt]),Object(c.useEffect)(function(){ce&&(Dt==null?(ce.setValue(""),Vt("")):Dt!==ce.getValue()&&(ce.setValue(Dt),Vt(Dt),ce.setCursor(ce.lineCount(),0)))},[ce,Dt]);var ui=Object(c.useCallback)(function(ln){var wn=ce.getCursor(),pn=ce.getSelection(),Un=pn.split(`
|
|
|
`);switch(ln){case"bold":return ce.replaceSelection("**"+pn+"**"),pn===""&&ce.setCursor(wn.line,wn.ch+2),ce.focus();case"italic":return ce.replaceSelection("*"+pn+"*"),pn===""&&ce.setCursor(wn.line,wn.ch+1),ce.focus();case"code":return ce.replaceSelection("`"+pn+"`"),pn===""&&ce.setCursor(wn.line,wn.ch+1),ce.focus();case"inline-latex":return ce.replaceSelection("`$$"+pn+"$$`"),pn===""&&ce.setCursor(wn.line,wn.ch+3),ce.focus();case"latex":return ce.replaceSelection("```latex\n"+pn+"\n```"),ce.setCursor(wn.line+1,pn.length+1),ce.focus();case"line-break":return ce.replaceSelection(`<br/>
|
|
|
`),ce.focus();case"list-ul":return pn===""?ce.replaceSelection("- "+pn):ce.replaceSelection(Un.map(function(ur){return ur===""?"":"- ".concat(ur)}).join(`
|
|
|
`)),ce.focus();case"list-ol":return pn===""?ce.replaceSelection("1. "+pn):ce.replaceSelection(Un.map(function(ur,mr){return ur===""?"":"".concat(mr+1,". ").concat(ur)}).join(`
|
|
|
`)),ce.focus();case"add-null-ch":return pn===""&&ce.setCursor(wn.line,wn.ch+1),ce.replaceSelection(Ye),ce.focus();case"inster-template-1":return pn===""&&ce.setCursor(wn.line,wn.ch),ce.replaceSelection(Fe),ce.focus();case"eraser":return ce.setValue(""),ce.focus();case"trigger-watch":return jn(!en),ce.focus();case"trigger-full-screen":return hr(!Nn),ce.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}},[ce,en,Nn]),Di=Object(c.useCallback)(function(ln){pr("");switch(yr){case U:var wn=ln.title,pn=ln.link;return ce.replaceSelection("[".concat(wn,"](").concat(pn,")")),ce.focus();case Y:var Un=ln.language,ur=ln.content;return ce.replaceSelection(["```"+Un,ur,"```"].join(`
|
|
|
`)),ce.focus();case q:var mr=ln.src,Zn=ln.alt,hn=ln.name;return mr.indexOf("type=image")>-1?ce.replaceSelection(".concat(mr,' "').concat(Zn||"",'" )')):mr.indexOf("type=application/pdf")>-1?ce.replaceSelection('<a href="'.concat(mr,'&disposition=inline" target="_blank">').concat(hn,"</a>")):ce.replaceSelection('<a href="'.concat(mr,'" target="_blank">').concat(hn,"</a>")),ce.focus();case J:for(var Fr=ln.row,Bn=ln.col,Bi=ln.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 ce.replaceSelection(cr+`
|
|
|
`),ce.focus();default:throw new Error}},[ce,yr]),ta=Object(c.useMemo)(function(){switch(yr){case U:return l.a.createElement($,{callback:Di,onCancel:ci});case Y:return l.a.createElement(Z.b,{callback:Di,onCancel:ci});case q:return l.a.createElement(xe,{callback:Di,onCancel:ci});case J:return l.a.createElement(nt,{callback:Di,onCancel:ci});default:return null}},[yr]);function ci(){pr("")}Object(c.useEffect)(function(){if(Ri.current){var ln=Ri.current,wn=!1,pn=0;function Un(Zn){wn=!0,pn=Zn.pageY}function ur(){wn=!1}function mr(Zn){if(wn){var hn=Zn.pageY-pn;hn<0&&(hn=0),hn>300&&(hn=300);var Fr=mt+hn+"px";Kr(Fr)}}return ln.addEventListener("mousedown",Un),document.addEventListener("mousemove",mr),document.addEventListener("mouseup",ur),function(){ln.removeEventListener("mousedown",Un),document.removeEventListener("mousemove",mr),document.removeEventListener("mouseup",ur)}}},[ce,Ri]),Object(c.useEffect)(function(){Kr(mt)},[mt]);var Fi=Ie(Rt),wi=Ie(zr),Ki={width:Fi,height:wi},Qi=Object(c.useMemo)(function(){if(Zr){var ln=new Date(Zr),wn=ln.getHours(),pn=ln.getMinutes(),Un=ln.getSeconds();return wn=wn<10?"0"+wn:wn,pn=pn<10?"0"+pn:pn,Un=Un<10?"0"+Un:Un,"".concat(wn,":").concat(pn,":").concat(Un)}return 0},[Zr]);function yi(){window.sessionStorage.removeItem(Wt),Fn(!1),Cr(0)}function aa(){Fn(!1),Cr(0),ce.setValue(window.sessionStorage.getItem(Wt))}function ma(ln,wn){var pn=ce.getValue();pn=pn.replace(ln,wn),Vt(pn),ce==null||ce.setValue(pn)}return l.a.createElement(c.Fragment,null,l.a.createElement("div",{className:"markdown-editor-wrapper",ref:rr},l.a.createElement("div",{className:"markdown-editor-container ".concat(kt," ").concat(en?"on-preview":""," ").concat(De?"mini":""," ").concat(Nn?"full-screen":""),style:Ki},l.a.createElement(D,{insertTemp:Mt,watch:en,fullScreen:Nn,showNullButton:Q,onActionCallback:ui,hidetoolBar:fe,uuid:Sn.current,setOpenPhones:function(){Er.current=!0}}),l.a.createElement("div",{className:"markdown-editor-body"},l.a.createElement("div",{className:"codemirror-container"},l.a.createElement("textarea",{ref:Lr,placeholder:an})),en?l.a.createElement("div",{ref:kr,className:"preview-container"},it==="stex"&&l.a.createElement(_,{value:At}),it!=="stex"&&l.a.createElement(b.a,{edit:!0,value:At,replaces:ma})):null))),tn?l.a.createElement("a",{ref:Ri,className:"editor-resize"}):null,l.a.createElement(N.a,null,Ce[yr]?l.a.createElement(ee.a,{centered:!0,title:Ce[yr],visible:!0,onCancel:ci,footer:null},ta):null))}},P5Jw:function(rt,$e,H){"use strict";var de=H("rHrb"),ee=de.CopyToClipboard;ee.CopyToClipboard=ee,rt.exports=ee},PD8m:function(rt,$e){rt.exports={name:"memoryStorage",read:de,write:ee,each:j,remove:w,clearAll:k};var H={};function de(S){return H[S]}function ee(S,T){H[S]=T}function j(S){for(var T in H)H.hasOwnProperty(T)&&S(H[T],T)}function w(S){delete H[S]}function k(S){H={}}},RELg:function(rt,$e,H){var de=H("MFOe"),ee=de.Global;rt.exports={name:"oldIE-userDataStorage",write:T,read:C,each:h,remove:p,clearAll:c};var j="storejs",w=ee.document,k=u(),S=(ee.navigator?ee.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function T(s,f){if(S)return;var i=a(s);k(function(n){n.setAttribute(i,f),n.save(j)})}function C(s){if(S)return;var f=a(s),i=null;return k(function(n){i=n.getAttribute(f)}),i}function h(s){k(function(f){for(var i=f.XMLDocument.documentElement.attributes,n=i.length-1;n>=0;n--){var t=i[n];s(f.getAttribute(t.name),t.name)}})}function p(s){var f=a(s);k(function(i){i.removeAttribute(f),i.save(j)})}function c(){k(function(s){var f=s.XMLDocument.documentElement.attributes;s.load(j);for(var i=f.length-1;i>=0;i--)s.removeAttribute(f[i].name);s.save(j)})}var l=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function a(s){return s.replace(/^\d/,"___$&").replace(l,"___")}function u(){if(!w||!w.documentElement||!w.documentElement.addBehavior)return null;var s="script",f,i,n;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+s+">document.w=window</"+s+'><iframe src="/favicon.ico"></iframe>'),i.close(),f=i.w.frames[0].document,n=f.createElement("div")}catch(t){n=w.createElement("div"),f=w.body}return function(t){var d=[].slice.call(arguments,0);d.unshift(n),f.appendChild(n),n.addBehavior("#default#userData"),n.load(j),t.apply(this,d),f.removeChild(n);return}}},RpDr:function(rt,$e,H){"use strict";H.d($e,"a",function(){return b}),H.d($e,"c",function(){return y});var de=H("+L6B"),ee=H("2/Rp"),j=H("tJVT"),w=H("k1fw"),k=H("jrin"),S=H("5NDa"),T=H("5rEg"),C=H("q1tI"),h=H.n(C),p=H("8Skl"),c=H("y3Kf"),l=H("bdLU"),a=H("J66h"),u=H.n(a),s=H("++UQ"),f=H.n(s),i=H("IxHN"),n=H("9Bee"),t=H("1vsH"),d,v=T.a.TextArea,g={visible:!1,tabIndex:"0"},b=(d={},Object(k.a)(d,l.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(k.a)(d,l.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(k.a)(d,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(k.a)(d,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(k.a)(d,4,"\u7F16\u8BD1\u5931\u8D25"),Object(k.a)(d,5,"\u6267\u884C\u5931\u8D25"),d),_;(function(o){o[o.SET_VISIBLE=0]="SET_VISIBLE",o[o.SET_TABINDEX=1]="SET_TABINDEX"})(_||(_={}));function m(o,x){switch(x.type){case _.SET_VISIBLE:return Object(w.a)(Object(w.a)({},o),{},{visible:x.payload});case _.SET_TABINDEX:return Object(w.a)(Object(w.a)({},o),{},{tabIndex:x.payload});default:throw new Error}}function y(o){var x=o.status,A=o.error_msg,O=o.output,D=o.input,N=o.expected_output,W=o.is_file,K=o.input_file_url,oe=o.output_file_url,B=o.expected_output_file_url,X=null,V={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(x){case l.a.NOMATCH:X=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!W&&h.a.createElement(n.a,{value:D,style:V}),W&&h.a.createElement("div",{style:V},h.a.createElement("a",{onClick:function(){return Object(t.w)(K,D)}},D)),h.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!W&&h.a.createElement(n.a,{value:O&&a.Base64.decode(O)||"",style:V}),W&&h.a.createElement("div",{style:V},h.a.createElement("a",{onClick:function(){return Object(t.w)(oe,O)}},O)),h.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!W&&h.a.createElement(n.a,{value:N&&a.Base64.decode(N)||"",style:V}),W&&h.a.createElement("div",{style:V},h.a.createElement("a",{onClick:function(){return Object(t.w)(B,N)}},N)));break;case l.a.EXECUTEFAILURE:X=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!W&&h.a.createElement(n.a,{value:D,style:V}),W&&h.a.createElement("div",{style:V},h.a.createElement("a",{onClick:function(){return Object(t.w)(K,D)}},D)),h.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),h.a.createElement("pre",{className:"error"},a.Base64.decode(A)));break;case l.a.COMPILEFAILURE:X=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!W&&h.a.createElement(n.a,{value:D,style:V}),W&&h.a.createElement("div",{style:V},h.a.createElement("a",{onClick:function(){return Object(t.w)(K,D)}},D)),h.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),h.a.createElement("pre",{className:"error"},a.Base64.decode(A)));break;case l.a.PODFAILURE:X=h.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case l.a.TIMEOUT:X=h.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return h.a.createElement(h.a.Fragment,null," ",X," ")}function E(o){var x=o.status,A=o.error_msg,O=o.execute_time,D=o.output,N=o.input,W=o.expected_output,K=o.is_file,oe=o.input_file_url,B=o.output_file_url,X=o.expected_output_file_url,V=null;switch(x){case l.a.OK:V=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",O),h.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),h.a.createElement("pre",null,a.Base64.decode(D)));break;case l.a.NOMATCH:V=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u8F93\u5165\uFF1A",h.a.createElement("pre",null,N)),h.a.createElement("p",null,"\u8F93\u51FA\uFF1A",D&&a.Base64.decode(D)),h.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",W&&a.Base64.decode(W)));break;case l.a.EXECUTEFAILURE:V=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",h.a.createElement("pre",null,N)),h.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),h.a.createElement("pre",{className:"error"},a.Base64.decode(A)));break;case l.a.COMPILEFAILURE:V=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",h.a.createElement("pre",null,N)),h.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),h.a.createElement("pre",{className:"error"},a.Base64.decode(A)));break;case l.a.PODFAILURE:V=h.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case l.a.TIMEOUT:V=h.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return h.a.createElement(h.a.Fragment,null," ",V," ")}$e.b=function(o){var x=o.id,A=o.input,O=o.debuging,D=o.submitting,N=o.executingMessage,W=o.debugResult,K=o.onChangeInput,oe=o.onDebugCode,B=o.onSubmitCode,X=Object(C.useReducer)(m,g),V=Object(j.a)(X,2),ne=V[0],$=V[1],Z=ne.visible,ue=ne.tabIndex;Object(C.useEffect)(function(){$({type:_.SET_VISIBLE,payload:!1})},[x]);function he(_e){var xe=_e.target.id;$({type:_.SET_TABINDEX,payload:xe})}function Oe(){$({type:_.SET_VISIBLE,payload:!Z})}var we=Object(C.useMemo)(function(){if(W){var _e=W.status;return h.a.createElement(h.a.Fragment,null,E(W))}return null},[W]);function Pe(){$({type:_.SET_VISIBLE,payload:!0}),$({type:_.SET_TABINDEX,payload:"1"}),oe()}return h.a.createElement("div",{className:"test-case-panel"},h.a.createElement("div",{className:"test-case-panel-body ".concat(Z?"active":"")},h.a.createElement("ul",{className:"s-navs"},h.a.createElement("li",null,h.a.createElement("a",{className:ue==="0"?"active":"",id:"0",onClick:he},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),h.a.createElement("li",null,h.a.createElement("a",{className:ue==="1"?"active":"",id:"1",onClick:he},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),h.a.createElement("div",{className:"tab-panel-body ".concat(ue==="0"?"":"hide")},h.a.createElement(v,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:A,onChange:K})),h.a.createElement("div",{className:"tab-panel-body ".concat(ue==="1"?"":"hide")},O?h.a.createElement(i.a,{message:N}):W?h.a.createElement("section",{style:{height:200}}," ",we," "):h.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"))),h.a.createElement("a",{className:"btn-collapse ".concat(Z?"up":""),onClick:Oe},Z?h.a.createElement(p.a,null):h.a.createElement(c.a,null)),h.a.createElement("footer",{className:"footer"},h.a.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),h.a.createElement("div",{className:"flex-container"},h.a.createElement(ee.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),h.a.createElement(ee.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),h.a.createElement(ee.a,{className:"btn-green",type:"ghost",loading:O,onClick:Pe},"\u8C03\u8BD5\u4EE3\u7801"),h.a.createElement(ee.a,{type:"primary",loading:D,disabled:D,onClick:function(){$({type:_.SET_VISIBLE,payload:!1}),B()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(rt,$e,H){rt.exports=H.p+"static/time.a3dc82f3.svg"},"SA+Z":function(rt,$e,H){var de=H("wTVA"),ee=H("EbDI"),j=H("ZhPi"),w=H("wkBT");function k(S){return de(S)||ee(S)||j(S)||w()}rt.exports=k,rt.exports.__esModule=!0,rt.exports.default=rt.exports},SJMd:function(rt,$e){/**
|
|
|
* @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 H,de,ee,j=!1,w,k;window.PR_SHOULD_USE_CONTINUATION=!0;var S,T;(function(){var C=window,h=["break,continue,do,else,for,if,return,while"],p=[h,"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"],c=[p,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],l=[c,"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"],a=[c,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[c,"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",f=[c,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="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",n=[h,"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"],t=[h,"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"],d=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[l,u,a,f,i,n,t,d],g=/^(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",_="kwd",m="com",y="typ",E="lit",o="pun",x="pln",A="tag",O="dec",D="src",N="atn",W="atv",K="nocode",oe="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(me){for(var We=0,He=!1,nt=!1,te=0,P=me.length;te<P;++te){var U=me[te];if(U.ignoreCase)nt=!0;else if(/[a-z]/i.test(U.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){He=!0,nt=!1;break}}var q={b:8,t:9,n:10,v:11,f:12,r:13};function Y(Ue){var je=Ue.charCodeAt(0);if(je!==92)return je;var tt=Ue.charAt(1);return je=q[tt],je||("0"<=tt&&tt<="7"?parseInt(Ue.substring(1),8):tt==="u"||tt==="x"?parseInt(Ue.substring(2),16):Ue.charCodeAt(1))}function J(Ue){if(Ue<32)return(Ue<16?"\\x0":"\\x")+Ue.toString(16);var je=String.fromCharCode(Ue);return je==="\\"||je==="-"||je==="]"||je==="^"?"\\"+je:je}function Ee(Ue){var je=Ue.substring(1,Ue.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")),tt=[],dt=je[0]==="^",qe=["["];dt&&qe.push("^");for(var Ye=dt?1:0,Fe=je.length;Ye<Fe;++Ye){var Ie=je[Ye];if(/\\[bdsw]/i.test(Ie))qe.push(Ie);else{var Me=Y(Ie),be;Ye+2<Fe&&je[Ye+1]==="-"?(be=Y(je[Ye+2]),Ye+=2):be=Me,tt.push([Me,be]),be<65||Me>122||(be<65||Me>90||tt.push([Math.max(65,Me)|32,Math.min(be,90)|32]),be<97||Me>122||tt.push([Math.max(97,Me)&~32,Math.min(be,122)&~32]))}}tt.sort(function(et,Qe){return et[0]-Qe[0]||Qe[1]-et[1]});for(var Te=[],Le=[],Ye=0;Ye<tt.length;++Ye){var Ce=tt[Ye];Ce[0]<=Le[1]+1?Le[1]=Math.max(Le[1],Ce[1]):Te.push(Le=Ce)}for(var Ye=0;Ye<Te.length;++Ye){var Ce=Te[Ye];qe.push(J(Ce[0])),Ce[1]>Ce[0]&&(Ce[1]+1>Ce[0]&&qe.push("-"),qe.push(J(Ce[1])))}return qe.push("]"),qe.join("")}function ke(Ue){for(var je=Ue.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")),tt=je.length,dt=[],qe=0,Ye=0;qe<tt;++qe){var Fe=je[qe];if(Fe==="(")++Ye;else if(Fe.charAt(0)==="\\"){var Ie=+Fe.substring(1);Ie&&(Ie<=Ye?dt[Ie]=-1:je[qe]=J(Ie))}}for(var qe=1;qe<dt.length;++qe)dt[qe]===-1&&(dt[qe]=++We);for(var qe=0,Ye=0;qe<tt;++qe){var Fe=je[qe];if(Fe==="(")++Ye,dt[Ye]||(je[qe]="(?:");else if(Fe.charAt(0)==="\\"){var Ie=+Fe.substring(1);Ie&&Ie<=Ye&&(je[qe]="\\"+dt[Ie])}}for(var qe=0;qe<tt;++qe)je[qe]==="^"&&je[qe+1]!=="^"&&(je[qe]="");if(Ue.ignoreCase&&He)for(var qe=0;qe<tt;++qe){var Fe=je[qe],Me=Fe.charAt(0);Fe.length>=2&&Me==="["?je[qe]=Ee(Fe):Me!=="\\"&&(je[qe]=Fe.replace(/[a-zA-Z]/g,function(Le){var Ce=Le.charCodeAt(0);return"["+String.fromCharCode(Ce&~32,Ce|32)+"]"}))}return je.join("")}for(var ht=[],te=0,P=me.length;te<P;++te){var U=me[te];if(U.global||U.multiline)throw new Error(""+U);ht.push("(?:"+ke(U)+")")}return new RegExp(ht.join("|"),nt?"gi":"g")}function X(me,We){var He=/(?:^|\s)nocode(?:\s|$)/,nt=[],te=0,P=[],U=0;function q(Y){var J=Y.nodeType;if(J==1){if(He.test(Y.className))return;for(var Ee=Y.firstChild;Ee;Ee=Ee.nextSibling)q(Ee);var ke=Y.nodeName.toLowerCase();(ke==="br"||ke==="li")&&(nt[U]=`
|
|
|
`,P[U<<1]=te++,P[U++<<1|1]=Y)}else if(J==3||J==4){var ht=Y.nodeValue;ht.length&&(We?ht=ht.replace(/\r\n?/g,`
|
|
|
`):ht=ht.replace(/[ \t\r\n]+/g," "),nt[U]=ht,P[U<<1]=te,te+=ht.length,P[U++<<1|1]=Y)}}return q(me),{sourceCode:nt.join("").replace(/\n$/,""),spans:P}}function V(me,We,He,nt,te){if(!He)return;var P={sourceNode:me,pre:1,langExtension:null,numberLines:null,sourceCode:He,spans:null,basePos:We,decorations:null};nt(P),te.push.apply(te,P.decorations)}var ne=/\S/;function $(me){for(var We=void 0,He=me.firstChild;He;He=He.nextSibling){var nt=He.nodeType;We=nt===1?We?me:He:nt===3&&ne.test(He.nodeValue)?me:We}return We===me?void 0:We}function Z(me,We){var He={},nt;(function(){for(var U=me.concat(We),q=[],Y={},J=0,Ee=U.length;J<Ee;++J){var ke=U[J],ht=ke[3];if(ht)for(var Ue=ht.length;--Ue>=0;)He[ht.charAt(Ue)]=ke;var je=ke[1],tt=""+je;Y.hasOwnProperty(tt)||(q.push(je),Y[tt]=null)}q.push(/[\0-\uffff]/),nt=B(q)})();var te=We.length,P=function(U){for(var q=U.sourceCode,Y=U.basePos,J=U.sourceNode,Ee=[Y,x],ke=0,ht=q.match(nt)||[],Ue={},je=0,tt=ht.length;je<tt;++je){var dt=ht[je],qe=Ue[dt],Ye=void 0,Fe;if(typeof qe=="string")Fe=!1;else{var Ie=He[dt.charAt(0)];if(Ie)Ye=dt.match(Ie[1]),qe=Ie[0];else{for(var Me=0;Me<te;++Me)if(Ie=We[Me],Ye=dt.match(Ie[1]),Ye){qe=Ie[0];break}Ye||(qe=x)}Fe=qe.length>=5&&qe.substring(0,5)==="lang-",Fe&&!(Ye&&typeof Ye[1]=="string")&&(Fe=!1,qe=D),Fe||(Ue[dt]=qe)}var be=ke;if(ke+=dt.length,!Fe)Ee.push(Y+be,qe);else{var Te=Ye[1],Le=dt.indexOf(Te),Ce=Le+Te.length;Ye[2]&&(Ce=dt.length-Ye[2].length,Le=Ce-Te.length);var et=qe.substring(5);V(J,Y+be,dt.substring(0,Le),P,Ee),V(J,Y+be+Le,Te,xe(et,Te),Ee),V(J,Y+be+Ce,dt.substring(Ce),P,Ee)}}U.decorations=Ee};return P}function ue(me){var We=[],He=[];me.tripleQuotedStrings?We.push([b,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):me.multiLineStrings?We.push([b,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):We.push([b,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),me.verbatimStrings&&He.push([b,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var nt=me.hashComments;nt&&(me.cStyleComments?(nt>1?We.push([m,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):We.push([m,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),He.push([b,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):We.push([m,/^#[^\r\n]*/,null,"#"])),me.cStyleComments&&(He.push([m,/^\/\/[^\r\n]*/,null]),He.push([m,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var te=me.regexLiterals;if(te){var P=te>1?"":`
|
|
|
\r`,U=P?".":"[\\S\\s]",q="/(?=[^/*"+P+"])(?:[^/\\x5B\\x5C"+P+"]|\\x5C"+U+"|\\x5B(?:[^\\x5C\\x5D"+P+"]|\\x5C"+U+")*(?:\\x5D|$))+/";He.push(["lang-regex",RegExp("^"+oe+"("+q+")")])}var Y=me.types;Y&&He.push([y,Y]);var J=(""+me.keywords).replace(/^ | $/g,"");J.length&&He.push([_,new RegExp("^(?:"+J.replace(/[\s,]+/g,"|")+")\\b"),null]),We.push([x,/^\s+/,null,` \r
|
|
|
\xA0`]);var Ee="^.[^\\s\\w.$@'\"`/\\\\]*";return me.regexLiterals&&(Ee+="(?!s*/)"),He.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[x,/^[a-z_$][a-z_$@0-9]*/i,null],[E,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[x,/^\\[\s\S]?/,null],[o,new RegExp(Ee),null]),Z(We,He)}var he=ue({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Oe(me,We,He){for(var nt=/(?:^|\s)nocode(?:\s|$)/,te=/\r\n?|\n/,P=me.ownerDocument,U=P.createElement("li");me.firstChild;)U.appendChild(me.firstChild);var q=[U];function Y(je){var tt=je.nodeType;if(tt==1&&!nt.test(je.className))if(je.nodeName==="br")J(je),je.parentNode&&je.parentNode.removeChild(je);else for(var dt=je.firstChild;dt;dt=dt.nextSibling)Y(dt);else if((tt==3||tt==4)&&He){var qe=je.nodeValue,Ye=qe.match(te);if(Ye){var Fe=qe.substring(0,Ye.index);je.nodeValue=Fe;var Ie=qe.substring(Ye.index+Ye[0].length);if(Ie){var Me=je.parentNode;Me.insertBefore(P.createTextNode(Ie),je.nextSibling)}J(je),Fe||je.parentNode.removeChild(je)}}}function J(je){for(;!je.nextSibling;)if(je=je.parentNode,!je)return;function tt(Ye,Fe){var Ie=Fe?Ye.cloneNode(!1):Ye,Me=Ye.parentNode;if(Me){var be=tt(Me,1),Te=Ye.nextSibling;be.appendChild(Ie);for(var Le=Te;Le;Le=Te)Te=Le.nextSibling,be.appendChild(Le)}return Ie}for(var dt=tt(je.nextSibling,0),qe;(qe=dt.parentNode)&&qe.nodeType===1;)dt=qe;q.push(dt)}for(var Ee=0;Ee<q.length;++Ee)Y(q[Ee]);We===(We|0)&&q[0].setAttribute("value",We);var ke=P.createElement("ol");ke.className="linenums";for(var ht=Math.max(0,We-1|0)||0,Ee=0,Ue=q.length;Ee<Ue;++Ee)U=q[Ee],U.className="L"+(Ee+ht)%10,U.firstChild||U.appendChild(P.createTextNode("\xA0")),ke.appendChild(U);me.appendChild(ke)}function we(me){var We=/\bMSIE\s(\d+)/.exec(navigator.userAgent);We=We&&+We[1]<=8;var He=/\n/g,nt=me.sourceCode,te=nt.length,P=0,U=me.spans,q=U.length,Y=0,J=me.decorations,Ee=J.length,ke=0;J[Ee]=te;var ht,Ue;for(Ue=ht=0;Ue<Ee;)J[Ue]!==J[Ue+2]?(J[ht++]=J[Ue++],J[ht++]=J[Ue++]):Ue+=2;for(Ee=ht,Ue=ht=0;Ue<Ee;){for(var je=J[Ue],tt=J[Ue+1],dt=Ue+2;dt+2<=Ee&&J[dt+1]===tt;)dt+=2;J[ht++]=je,J[ht++]=tt,Ue=dt}Ee=J.length=ht;var qe=me.sourceNode,Ye="";qe&&(Ye=qe.style.display,qe.style.display="none");try{for(var Fe=null;Y<q;){var Ie=U[Y],Me=U[Y+2]||te,be=J[ke+2]||te,dt=Math.min(Me,be),Te=U[Y+1],Le;if(Te.nodeType!==1&&(Le=nt.substring(P,dt))){We&&(Le=Le.replace(He,"\r")),Te.nodeValue=Le;var Ce=Te.ownerDocument,et=Ce.createElement("span");et.className=J[ke+1];var Qe=Te.parentNode;Qe.replaceChild(et,Te),et.appendChild(Te),P<Me&&(U[Y+1]=Te=Ce.createTextNode(nt.substring(dt,Me)),Qe.insertBefore(Te,et.nextSibling))}P=dt,P>=Me&&(Y+=2),P>=be&&(ke+=2)}}finally{qe&&(qe.style.display=Ye)}}var Pe={};function _e(me,We){for(var He=We.length;--He>=0;){var nt=We[He];Pe.hasOwnProperty(nt)?C.console&&console.warn("cannot override language handler %s",nt):Pe[nt]=me}}function xe(me,We){return me&&Pe.hasOwnProperty(me)||(me=/^\s*</.test(We)?"default-markup":"default-code"),Pe[me]}_e(he,["default-code"]),_e(Z([],[[x,/^[^<?]+/],[O,/^<!\w[^>]*(?:>|$)/],[m,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[o,/^(?:<[%?]|[%?]>)/],["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"]),_e(Z([[x,/^[\s]+/,null,` \r
|
|
|
`],[W,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[A,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[o,/^[=<>\/]+/],["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"]),_e(Z([],[[W,/^[\s\S]+/]]),["uq.val"]),_e(ue({keywords:l,hashComments:!0,cStyleComments:!0,types:g}),["c","cc","cpp","cxx","cyc","m"]),_e(ue({keywords:"null,true,false"}),["json"]),_e(ue({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:g}),["cs"]),_e(ue({keywords:a,cStyleComments:!0}),["java"]),_e(ue({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),_e(ue({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),_e(ue({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),_e(ue({keywords:t,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),_e(ue({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),_e(ue({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),_e(Z([],[[b,/^[\s\S]+/]]),["regex"]);function Ve(me){var We=me.langExtension;try{var He=X(me.sourceNode,me.pre),nt=He.sourceCode;me.sourceCode=nt,me.spans=He.spans,me.basePos=0,xe(We,nt)(me),we(me)}catch(te){C.console&&console.log(te&&te.stack||te)}}function Ne(me,We,He){var nt=He||!1,te=We||null,P=document.createElement("div");P.innerHTML="<pre>"+me+"</pre>",P=P.firstChild,nt&&Oe(P,nt,!0);var U={langExtension:te,numberLines:nt,sourceNode:P,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ve(U),P.innerHTML}function Be(me,We){var He=We||document.body,nt=He.ownerDocument||document;function te(Ie){return He.getElementsByTagName(Ie)}for(var P=[te("pre"),te("code"),te("xmp")],U=[],q=0;q<P.length;++q)for(var Y=0,J=P[q].length;Y<J;++Y)U.push(P[q][Y]);P=null;var Ee=Date;Ee.now||(Ee={now:function(){return+new Date}});var ke=0,ht=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ue=/\bprettyprint\b/,je=/\bprettyprinted\b/,tt=/pre|xmp/i,dt=/^code$/i,qe=/^(?:pre|code|xmp)$/i,Ye={};function Fe(){for(var Ie=C.PR_SHOULD_USE_CONTINUATION?Ee.now()+250:Infinity;ke<U.length&&Ee.now()<Ie;ke++){for(var Me=U[ke],be=Ye,Te=Me;Te=Te.previousSibling;){var Le=Te.nodeType,Ce=(Le===7||Le===8)&&Te.nodeValue;if(Ce?!/^\??prettify\b/.test(Ce):Le!==3||/\S/.test(Te.nodeValue))break;if(Ce){be={},Ce.replace(/\b(\w+)=([\w:.%+-]+)/g,function(vt,ot,Mt){be[ot]=Mt});break}}var et=Me.className;if((be!==Ye||Ue.test(et))&&!je.test(et)){for(var Qe=!1,yt=Me.parentNode;yt;yt=yt.parentNode){var Dt=yt.tagName;if(qe.test(Dt)&&yt.className&&Ue.test(yt.className)){Qe=!0;break}}if(!Qe){Me.className+=" prettyprinted";var Bt=be.lang;if(!Bt){Bt=et.match(ht);var Pt;!Bt&&(Pt=$(Me))&&dt.test(Pt.tagName)&&(Bt=Pt.className.match(ht)),Bt&&(Bt=Bt[1])}var Rt;if(tt.test(Me.tagName))Rt=1;else{var st=Me.currentStyle,mt=nt.defaultView,lt=st?st.whiteSpace:mt&&mt.getComputedStyle?mt.getComputedStyle(Me,null).getPropertyValue("white-space"):0;Rt=lt&<.substring(0,3)==="pre"}var De=be.linenums;(De=De==="true"||+De)||(De=et.match(/\blinenums\b(?::(\d+))?/),De=De?De[1]&&De[1].length?+De[1]:!0:!1),De&&Oe(Me,De,Rt);var Ke={langExtension:Bt,sourceNode:Me,numberLines:De,pre:Rt,sourceCode:null,basePos:null,spans:null,decorations:null};Ve(Ke)}}}ke<U.length?C.setTimeout(Fe,250):typeof me=="function"&&me()}Fe()}var ze=C.PR={createSimpleLexer:Z,registerLangHandler:_e,sourceDecorator:ue,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:W,PR_COMMENT:m,PR_DECLARATION:O,PR_KEYWORD:_,PR_LITERAL:E,PR_NOCODE:K,PR_PLAIN:x,PR_PUNCTUATION:o,PR_SOURCE:D,PR_STRING:b,PR_TAG:A,PR_TYPE:y,prettyPrintOne:j?C.prettyPrintOne=Ne:S=Ne,prettyPrint:T=j?C.prettyPrint=Be:T=Be},ye=C.define;typeof ye=="function"&&ye.amd&&ye("google-code-prettify",[],function(){return ze})})()},TcMa:function(rt,$e,H){rt.exports={desc:"desc___qlRMF",info:"info___JEaKq","commit-info":"commit-info___3-4e0"}},UZu5:function(rt,$e,H){},VEzc:function(rt,$e,H){rt.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(rt,$e,H){(function(de,ee){rt.exports=ee()})(this,function(){"use strict";var de=navigator.userAgent,ee=navigator.platform,j=/gecko\/\d/i.test(de),w=/MSIE \d/.test(de),k=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(de),S=/Edge\/(\d+)/.exec(de),T=w||k||S,C=T&&(w?document.documentMode||6:+(S||k)[1]),h=!S&&/WebKit\//.test(de),p=h&&/Qt\/\d+\.\d+/.test(de),c=!S&&/Chrome\//.test(de),l=/Opera\//.test(de),a=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(de),s=/PhantomJS/.test(de),f=!S&&/AppleWebKit/.test(de)&&/Mobile\/\w+/.test(de),i=/Android/.test(de),n=f||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(de),t=f||/Mac/.test(ee),d=/\bCrOS\b/.test(de),v=/win/i.test(ee),g=l&&de.match(/Version\/(\d*\.\d*)/);g&&(g=Number(g[1])),g&&g>=15&&(l=!1,h=!0);var b=t&&(p||l&&(g==null||g<12.11)),_=j||T&&C>=9;function m(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var y=function(e,r){var R=e.className,L=m(r).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 E(e){for(var r=e.childNodes.length;r>0;--r)e.removeChild(e.firstChild);return e}function o(e,r){return E(e).appendChild(r)}function x(e,r,R,L){var M=document.createElement(e);if(R&&(M.className=R),L&&(M.style.cssText=L),typeof r=="string")M.appendChild(document.createTextNode(r));else if(r)for(var G=0;G<r.length;++G)M.appendChild(r[G]);return M}function A(e,r,R,L){var M=x(e,r,R,L);return M.setAttribute("role","presentation"),M}var O;document.createRange?O=function(e,r,R,L){var M=document.createRange();return M.setEnd(L||e,R),M.setStart(e,r),M}:O=function(e,r,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",r),L};function D(e,r){if(r.nodeType==3&&(r=r.parentNode),e.contains)return e.contains(r);do if(r.nodeType==11&&(r=r.host),r==e)return!0;while(r=r.parentNode)}function N(){var e;try{e=document.activeElement}catch(r){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function W(e,r){var R=e.className;m(r).test(R)||(e.className+=(R?" ":"")+r)}function K(e,r){for(var R=e.split(" "),L=0;L<R.length;L++)R[L]&&!m(R[L]).test(r)&&(r+=" "+R[L]);return r}var oe=function(e){e.select()};f?oe=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:T&&(oe=function(e){try{e.select()}catch(r){}});function B(e){var r=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,r)}}function X(e,r,R){r||(r={});for(var L in e)e.hasOwnProperty(L)&&(R!==!1||!r.hasOwnProperty(L))&&(r[L]=e[L]);return r}function V(e,r,R,L,M){r==null&&(r=e.search(/[^\s\u00a0]/),r==-1&&(r=e.length));for(var G=L||0,le=M||0;;){var pe=e.indexOf(" ",G);if(pe<0||pe>=r)return le+(r-G);le+=pe-G,le+=R-le%R,G=pe+1}}var ne=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};ne.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ne.prototype.set=function(e,r){this.f=r;var R=+new Date+e;(!this.id||R<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=R)};function $(e,r){for(var R=0;R<e.length;++R)if(e[R]==r)return R;return-1}var Z=50,ue={toString:function(){return"CodeMirror.Pass"}},he={scroll:!1},Oe={origin:"*mouse"},we={origin:"+move"};function Pe(e,r,R){for(var L=0,M=0;;){var G=e.indexOf(" ",L);G==-1&&(G=e.length);var le=G-L;if(G==e.length||M+le>=r)return L+Math.min(le,r-M);if(M+=G-L,M+=R-M%R,L=G+1,M>=r)return L}}var _e=[""];function xe(e){for(;_e.length<=e;)_e.push(Ve(_e)+" ");return _e[e]}function Ve(e){return e[e.length-1]}function Ne(e,r){for(var R=[],L=0;L<e.length;L++)R[L]=r(e[L],L);return R}function Be(e,r,R){for(var L=0,M=R(r);L<e.length&&R(e[L])<=M;)L++;e.splice(L,0,r)}function ze(){}function ye(e,r){var R;return Object.create?R=Object.create(e):(ze.prototype=e,R=new ze),r&&X(r,R),R}var me=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function We(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||me.test(e))}function He(e,r){return r?r.source.indexOf("\\w")>-1&&We(e)?!0:r.test(e):We(e)}function nt(e){for(var r in e)if(e.hasOwnProperty(r)&&e[r])return!1;return!0}var te=/[\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 P(e){return e.charCodeAt(0)>=768&&te.test(e)}function U(e,r,R){for(;(R<0?r>0:r<e.length)&&P(e.charAt(r));)r+=R;return r}function q(e,r,R){for(var L=r>R?-1:1;;){if(r==R)return r;var M=(r+R)/2,G=L<0?Math.ceil(M):Math.floor(M);if(G==r)return e(G)?r:R;e(G)?R=G:r=G+L}}function Y(e,r,R,L){if(!e)return L(r,R,"ltr",0);for(var M=!1,G=0;G<e.length;++G){var le=e[G];(le.from<R&&le.to>r||r==R&&le.to==r)&&(L(Math.max(le.from,r),Math.min(le.to,R),le.level==1?"rtl":"ltr",G),M=!0)}M||L(r,R,"ltr")}var J=null;function Ee(e,r,R){var L;J=null;for(var M=0;M<e.length;++M){var G=e[M];if(G.from<r&&G.to>r)return M;G.to==r&&(G.from!=G.to&&R=="before"?L=M:J=M),G.from==r&&(G.from!=G.to&&R!="before"?L=M:J=M)}return L!=null?L:J}var ke=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function R(Se){return Se<=247?e.charAt(Se):1424<=Se&&Se<=1524?"R":1536<=Se&&Se<=1785?r.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]/,G=/[LRr]/,le=/[Lb1n]/,pe=/[1n]/;function ge(Se,Ge,Ze){this.level=Se,this.from=Ge,this.to=Ze}return function(Se,Ge){var Ze=Ge=="ltr"?"L":"R";if(Se.length==0||Ge=="ltr"&&!L.test(Se))return!1;for(var pt=Se.length,ut=[],Ct=0;Ct<pt;++Ct)ut.push(R(Se.charCodeAt(Ct)));for(var Ut=0,zt=Ze;Ut<pt;++Ut){var Jt=ut[Ut];Jt=="m"?ut[Ut]=zt:zt=Jt}for(var rn=0,qt=Ze;rn<pt;++rn){var sn=ut[rn];sn=="1"&&qt=="r"?ut[rn]="n":G.test(sn)&&(qt=sn,sn=="r"&&(ut[rn]="R"))}for(var An=1,_n=ut[0];An<pt-1;++An){var Qn=ut[An];Qn=="+"&&_n=="1"&&ut[An+1]=="1"?ut[An]="1":Qn==","&&_n==ut[An+1]&&(_n=="1"||_n=="n")&&(ut[An]=_n),_n=Qn}for(var Rr=0;Rr<pt;++Rr){var oi=ut[Rr];if(oi==",")ut[Rr]="N";else if(oi=="%"){var jr=void 0;for(jr=Rr+1;jr<pt&&ut[jr]=="%";++jr);for(var Pi=Rr&&ut[Rr-1]=="!"||jr<pt&&ut[jr]=="1"?"1":"N",Oi=Rr;Oi<jr;++Oi)ut[Oi]=Pi;Rr=jr-1}}for(var qr=0,Ai=Ze;qr<pt;++qr){var hi=ut[qr];Ai=="L"&&hi=="1"?ut[qr]="L":G.test(hi)&&(Ai=hi)}for(var ti=0;ti<pt;++ti)if(M.test(ut[ti])){var Qr=void 0;for(Qr=ti+1;Qr<pt&&M.test(ut[Qr]);++Qr);for(var Hr=(ti?ut[ti-1]:Ze)=="L",Li=(Qr<pt?ut[Qr]:Ze)=="L",Pa=Hr==Li?Hr?"L":"R":Ze,pa=ti;pa<Qr;++pa)ut[pa]=Pa;ti=Qr-1}for(var pi=[],ea,si=0;si<pt;)if(le.test(ut[si])){var Fo=si;for(++si;si<pt&&le.test(ut[si]);++si);pi.push(new ge(0,Fo,si))}else{var ia=si,Ea=pi.length,xa=Ge=="rtl"?1:0;for(++si;si<pt&&ut[si]!="L";++si);for(var Ei=ia;Ei<si;)if(pe.test(ut[Ei])){ia<Ei&&(pi.splice(Ea,0,new ge(1,ia,Ei)),Ea+=xa);var Ma=Ei;for(++Ei;Ei<si&&pe.test(ut[Ei]);++Ei);pi.splice(Ea,0,new ge(2,Ma,Ei)),Ea+=xa,ia=Ei}else++Ei;ia<si&&pi.splice(Ea,0,new ge(1,ia,si))}return Ge=="ltr"&&(pi[0].level==1&&(ea=Se.match(/^\s+/))&&(pi[0].from=ea[0].length,pi.unshift(new ge(0,0,ea[0].length))),Ve(pi).level==1&&(ea=Se.match(/\s+$/))&&(Ve(pi).to-=ea[0].length,pi.push(new ge(0,pt-ea[0].length,pt)))),Ge=="rtl"?pi.reverse():pi}}();function ht(e,r){var R=e.order;return R==null&&(R=e.order=ke(e.text,r)),R}var Ue=[],je=function(e,r,R){if(e.addEventListener)e.addEventListener(r,R,!1);else if(e.attachEvent)e.attachEvent("on"+r,R);else{var L=e._handlers||(e._handlers={});L[r]=(L[r]||Ue).concat(R)}};function tt(e,r){return e._handlers&&e._handlers[r]||Ue}function dt(e,r,R){if(e.removeEventListener)e.removeEventListener(r,R,!1);else if(e.detachEvent)e.detachEvent("on"+r,R);else{var L=e._handlers,M=L&&L[r];if(M){var G=$(M,R);G>-1&&(L[r]=M.slice(0,G).concat(M.slice(G+1)))}}}function qe(e,r){var R=tt(e,r);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 Ye(e,r,R){return typeof r=="string"&&(r={type:r,preventDefault:function(){this.defaultPrevented=!0}}),qe(e,R||r.type,e,r),Le(r)||r.codemirrorIgnore}function Fe(e){var r=e._handlers&&e._handlers.cursorActivity;if(!r)return;for(var R=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),L=0;L<r.length;++L)$(R,r[L])==-1&&R.push(r[L])}function Ie(e,r){return tt(e,r).length>0}function Me(e){e.prototype.on=function(r,R){je(this,r,R)},e.prototype.off=function(r,R){dt(this,r,R)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Te(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Le(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Ce(e){be(e),Te(e)}function et(e){return e.target||e.srcElement}function Qe(e){var r=e.which;return r==null&&(e.button&1?r=1:e.button&2?r=3:e.button&4&&(r=2)),t&&e.ctrlKey&&r==1&&(r=3),r}var yt=function(){if(T&&C<9)return!1;var e=x("div");return"draggable"in e||"dragDrop"in e}(),Dt;function Bt(e){if(Dt==null){var r=x("span","\u200B");o(e,x("span",[r,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Dt=r.offsetWidth<=1&&r.offsetHeight>2&&!(T&&C<8))}var R=Dt?x("span","\u200B"):x("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return R.setAttribute("cm-text",""),R}var Pt;function Rt(e){if(Pt!=null)return Pt;var r=o(e,document.createTextNode("A\u062EA")),R=O(r,0,1).getBoundingClientRect(),L=O(r,1,2).getBoundingClientRect();return E(e),!R||R.left==R.right?!1:Pt=L.right-R.right<3}var st=`
|
|
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var r=0,R=[],L=e.length;r<=L;){var M=e.indexOf(`
|
|
|
`,r);M==-1&&(M=e.length);var G=e.slice(r,e.charAt(M-1)=="\r"?M-1:M),le=G.indexOf("\r");le!=-1?(R.push(G.slice(0,le)),r+=le+1):(R.push(G),r=M+1)}return R}:function(e){return e.split(/\r\n?|\n/)},mt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(r){return!1}}:function(e){var r;try{r=e.ownerDocument.selection.createRange()}catch(R){}return!r||r.parentElement()!=e?!1:r.compareEndPoints("StartToEnd",r)!=0},lt=function(){var e=x("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),De=null;function Ke(e){if(De!=null)return De;var r=o(e,x("span","x")),R=r.getBoundingClientRect(),L=O(r,0,1).getBoundingClientRect();return De=Math.abs(R.left-L.left)>1}var vt={},ot={};function Mt(e,r){arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),vt[e]=r}function Nt(e,r){ot[e]=r}function it(e){if(typeof e=="string"&&ot.hasOwnProperty(e))e=ot[e];else if(e&&typeof e.name=="string"&&ot.hasOwnProperty(e.name)){var r=ot[e.name];typeof r=="string"&&(r={name:r}),e=ye(r,e),e.name=r.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 St(e,r){r=it(r);var R=vt[r.name];if(!R)return St(e,"text/plain");var L=R(e,r);if(Wt.hasOwnProperty(r.name)){var M=Wt[r.name];for(var G in M){if(!M.hasOwnProperty(G))continue;L.hasOwnProperty(G)&&(L["_"+G]=L[G]),L[G]=M[G]}}if(L.name=r.name,r.helperType&&(L.helperType=r.helperType),r.modeProps)for(var le in r.modeProps)L[le]=r.modeProps[le];return L}var Wt={};function Kt(e,r){var R=Wt.hasOwnProperty(e)?Wt[e]:Wt[e]={};X(r,R)}function tn(e,r){if(r===!0)return r;if(e.copyState)return e.copyState(r);var R={};for(var L in r){var M=r[L];M instanceof Array&&(M=M.concat([])),R[L]=M}return R}function Re(e,r){for(var R;e.innerMode&&!(R=e.innerMode(r),!R||R.mode==e);)r=R.state,e=R.mode;return R||{mode:e,state:r}}function ve(e,r,R){return e.startState?e.startState(r,R):!0}var z=function(e,r,R){this.pos=this.start=0,this.string=e,this.tabSize=r||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 r=this.string.charAt(this.pos),R;if(typeof e=="string"?R=r==e:R=r&&(e.test?e.test(r):e(r)),R)return++this.pos,r},z.prototype.eatWhile=function(e){for(var r=this.pos;this.eat(e););return this.pos>r},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 r=this.string.indexOf(e,this.pos);if(r>-1)return this.pos=r,!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,r,R){if(typeof e=="string"){var L=function(le){return R?le.toLowerCase():le},M=this.string.substr(this.pos,e.length);if(L(M)==L(e))return r!==!1&&(this.pos+=e.length),!0}else{var G=this.string.slice(this.pos).match(e);return G&&G.index>0?null:(G&&r!==!1&&(this.pos+=G[0].length),G)}},z.prototype.current=function(){return this.string.slice(this.start,this.pos)},z.prototype.hideFirstChars=function(e,r){this.lineStart+=e;try{return r()}finally{this.lineStart-=e}},z.prototype.lookAhead=function(e){var r=this.lineOracle;return r&&r.lookAhead(e)},z.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Q(e,r){if(r-=e.first,r<0||r>=e.size)throw new Error("There is no line "+(r+e.first)+" in the document.");for(var R=e;!R.lines;)for(var L=0;;++L){var M=R.children[L],G=M.chunkSize();if(r<G){R=M;break}r-=G}return R.lines[r]}function ae(e,r,R){var L=[],M=r.line;return e.iter(r.line,R.line+1,function(G){var le=G.text;M==R.line&&(le=le.slice(0,R.ch)),M==r.line&&(le=le.slice(r.ch)),L.push(le),++M}),L}function fe(e,r,R){var L=[];return e.iter(r,R,function(M){L.push(M.text)}),L}function Ae(e,r){var R=r-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 r=e.parent,R=$(r.lines,e),L=r.parent;L;r=L,L=L.parent)for(var M=0;!(L.children[M]==r);++M)R+=L.children[M].chunkSize();return R+r.first}function at(e,r){var R=e.first;e:do{for(var L=0;L<e.children.length;++L){var M=e.children[L],G=M.height;if(r<G){e=M;continue e}r-=G,R+=M.chunkSize()}return R}while(!e.lines);for(var le=0;le<e.lines.length;++le){var pe=e.lines[le],ge=pe.height;if(r<ge)break;r-=ge}return R+le}function Lt(e,r){return r>=e.first&&r<e.first+e.size}function It(e,r){return String(e.lineNumberFormatter(r+e.firstLineNumber))}function ct(e,r,R){if(R===void 0&&(R=null),!(this instanceof ct))return new ct(e,r,R);this.line=e,this.ch=r,this.sticky=R}function kt(e,r){return e.line-r.line||e.ch-r.ch}function nn(e,r){return e.sticky==r.sticky&&kt(e,r)==0}function Ot(e){return ct(e.line,e.ch)}function un(e,r){return kt(e,r)<0?r:e}function an(e,r){return kt(e,r)<0?e:r}function re(e,r){return Math.max(e.first,Math.min(r,e.first+e.size-1))}function I(e,r){if(r.line<e.first)return ct(e.first,0);var R=e.first+e.size-1;return r.line>R?ct(R,Q(e,R).text.length):F(r,Q(e,r.line).text.length)}function F(e,r){var R=e.ch;return R==null||R>r?ct(e.line,r):R<0?ct(e.line,0):e}function ie(e,r){for(var R=[],L=0;L<r.length;L++)R[L]=I(e,r[L]);return R}var ce=function(e,r){this.state=e,this.lookAhead=r},se=function(e,r,R,L){this.state=r,this.doc=e,this.line=R,this.maxLookAhead=L||0,this.baseTokens=null,this.baseTokenPos=1};se.prototype.lookAhead=function(e){var r=this.doc.getLine(this.line+e);return r!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),r},se.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var r=this.baseTokens[this.baseTokenPos+1];return{type:r&&r.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},se.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},se.fromSaved=function(e,r,R){return r instanceof ce?new se(e,tn(e.mode,r.state),R,r.lookAhead):new se(e,tn(e.mode,r),R)},se.prototype.save=function(e){var r=e!==!1?tn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ce(r,this.maxLookAhead):r};function Xe(e,r,R,L){var M=[e.state.modeGen],G={};wr(e,r.text,e.doc.mode,R,function(Se,Ge){return M.push(Se,Ge)},G,L);for(var le=R.state,pe=function(Se){R.baseTokens=M;var Ge=e.state.overlays[Se],Ze=1,pt=0;R.state=!0,wr(e,r.text,Ge.mode,R,function(ut,Ct){for(var Ut=Ze;pt<ut;){var zt=M[Ze];zt>ut&&M.splice(Ze,1,ut,M[Ze+1],zt),Ze+=2,pt=Math.min(ut,zt)}if(!Ct)return;if(Ge.opaque)M.splice(Ut,Ze-Ut,ut,"overlay "+Ct),Ze=Ut+2;else for(;Ut<Ze;Ut+=2){var Jt=M[Ut+1];M[Ut+1]=(Jt?Jt+" ":"")+"overlay "+Ct}},G),R.state=le,R.baseTokens=null,R.baseTokenPos=1},ge=0;ge<e.state.overlays.length;++ge)pe(ge);return{styles:M,classes:G.bgClass||G.textClass?G:null}}function _t(e,r,R){if(!r.styles||r.styles[0]!=e.state.modeGen){var L=At(e,Je(r)),M=r.text.length>e.options.maxHighlightLength&&tn(e.doc.mode,L.state),G=Xe(e,r,L);M&&(L.state=M),r.stateAfter=L.save(!M),r.styles=G.styles,G.classes?r.styleClasses=G.classes:r.styleClasses&&(r.styleClasses=null),R===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return r.styles}function At(e,r,R){var L=e.doc,M=e.display;if(!L.mode.startState)return new se(L,!0,r);var G=Nn(e,r,R),le=G>L.first&&Q(L,G-1).stateAfter,pe=le?se.fromSaved(L,le,G):new se(L,ve(L.mode),G);return L.iter(G,r,function(ge){Vt(e,ge.text,pe);var Se=pe.line;ge.stateAfter=Se==r-1||Se%5==0||Se>=M.viewFrom&&Se<M.viewTo?pe.save():null,pe.nextLine()}),R&&(L.modeFrontier=pe.line),pe}function Vt(e,r,R,L){var M=e.doc.mode,G=new z(r,e.options.tabSize,R);for(G.start=G.pos=L||0,r==""&&wt(M,R.state);!G.eol();)Ht(M,G,R.state),G.start=G.pos}function wt(e,r){if(e.blankLine)return e.blankLine(r);if(!e.innerMode)return;var R=Re(e,r);if(R.mode.blankLine)return R.mode.blankLine(R.state)}function Ht(e,r,R,L){for(var M=0;M<10;M++){L&&(L[0]=Re(e,R).mode);var G=e.token(r,R);if(r.pos>r.start)return G}throw new Error("Mode "+e.name+" failed to advance stream.")}var en=function(e,r,R){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=r||null,this.state=R};function jn(e,r,R,L){var M=e.doc,G=M.mode,le;r=I(M,r);var pe=Q(M,r.line),ge=At(e,r.line,R),Se=new z(pe.text,e.options.tabSize,ge),Ge;for(L&&(Ge=[]);(L||Se.pos<r.ch)&&!Se.eol();)Se.start=Se.pos,le=Ht(G,Se,ge.state),L&&Ge.push(new en(Se,le,tn(M.mode,ge.state)));return L?Ge:new en(Se,le,ge.state)}function Dr(e,r){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";r[L]==null?r[L]=R[2]:new RegExp("(?:^|\\s)"+R[2]+"(?:$|\\s)").test(r[L])||(r[L]+=" "+R[2])}return e}function wr(e,r,R,L,M,G,le){var pe=R.flattenSpans;pe==null&&(pe=e.options.flattenSpans);var ge=0,Se=null,Ge=new z(r,e.options.tabSize,L),Ze,pt=e.options.addModeClass&&[null];for(r==""&&Dr(wt(R,L.state),G);!Ge.eol();){if(Ge.pos>e.options.maxHighlightLength?(pe=!1,le&&Vt(e,r,L,Ge.pos),Ge.pos=r.length,Ze=null):Ze=Dr(Ht(R,Ge,L.state,pt),G),pt){var ut=pt[0].name;ut&&(Ze="m-"+(Ze?ut+" "+Ze:ut))}if(!pe||Se!=Ze){for(;ge<Ge.start;)ge=Math.min(Ge.start,ge+5e3),M(ge,Se);Se=Ze}Ge.start=Ge.pos}for(;ge<Ge.pos;){var Ct=Math.min(Ge.pos,ge+5e3);M(Ct,Se),ge=Ct}}function Nn(e,r,R){for(var L,M,G=e.doc,le=R?-1:r-(e.doc.mode.innerMode?1e3:100),pe=r;pe>le;--pe){if(pe<=G.first)return G.first;var ge=Q(G,pe-1),Se=ge.stateAfter;if(Se&&(!R||pe+(Se instanceof ce?Se.lookAhead:0)<=G.modeFrontier))return pe;var Ge=V(ge.text,null,e.options.tabSize);(M==null||L>Ge)&&(M=pe-1,L=Ge)}return M}function hr(e,r){if(e.modeFrontier=Math.min(e.modeFrontier,r),e.highlightFrontier<r-10)return;for(var R=e.first,L=r-1;L>R;L--){var M=Q(e,L).stateAfter;if(M&&(!(M instanceof ce)||L+M.lookAhead<r)){R=L+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,R)}var mi=!1,Ar=!1;function yr(){mi=!0}function pr(){Ar=!0}function Yr(e,r,R){this.marker=e,this.from=r,this.to=R}function Mr(e,r){if(e)for(var R=0;R<e.length;++R){var L=e[R];if(L.marker==r)return L}}function Zr(e,r){for(var R,L=0;L<e.length;++L)e[L]!=r&&(R||(R=[])).push(e[L]);return R}function Cr(e,r){e.markedSpans=e.markedSpans?e.markedSpans.concat([r]):[r],r.marker.attachLine(e)}function gi(e,r,R){var L;if(e)for(var M=0;M<e.length;++M){var G=e[M],le=G.marker,pe=G.from==null||(le.inclusiveLeft?G.from<=r:G.from<r);if(pe||G.from==r&&le.type=="bookmark"&&(!R||!G.marker.insertLeft)){var ge=G.to==null||(le.inclusiveRight?G.to>=r:G.to>r);(L||(L=[])).push(new Yr(le,G.from,ge?null:G.to))}}return L}function li(e,r,R){var L;if(e)for(var M=0;M<e.length;++M){var G=e[M],le=G.marker,pe=G.to==null||(le.inclusiveRight?G.to>=r:G.to>r);if(pe||G.from==r&&le.type=="bookmark"&&(!R||G.marker.insertLeft)){var ge=G.from==null||(le.inclusiveLeft?G.from<=r:G.from<r);(L||(L=[])).push(new Yr(le,ge?null:G.from-r,G.to==null?null:G.to-r))}}return L}function zr(e,r){if(r.full)return null;var R=Lt(e,r.from.line)&&Q(e,r.from.line).markedSpans,L=Lt(e,r.to.line)&&Q(e,r.to.line).markedSpans;if(!R&&!L)return null;var M=r.from.ch,G=r.to.ch,le=kt(r.from,r.to)==0,pe=gi(R,M,le),ge=li(L,G,le),Se=r.text.length==1,Ge=Ve(r.text).length+(Se?M:0);if(pe)for(var Ze=0;Ze<pe.length;++Ze){var pt=pe[Ze];if(pt.to==null){var ut=Mr(ge,pt.marker);ut?Se&&(pt.to=ut.to==null?null:ut.to+Ge):pt.to=M}}if(ge)for(var Ct=0;Ct<ge.length;++Ct){var Ut=ge[Ct];if(Ut.to!=null&&(Ut.to+=Ge),Ut.from==null){var zt=Mr(pe,Ut.marker);zt||(Ut.from=Ge,Se&&(pe||(pe=[])).push(Ut))}else Ut.from+=Ge,Se&&(pe||(pe=[])).push(Ut)}pe&&(pe=Kr(pe)),ge&&ge!=pe&&(ge=Kr(ge));var Jt=[pe];if(!Se){var rn=r.text.length-2,qt;if(rn>0&&pe)for(var sn=0;sn<pe.length;++sn)pe[sn].to==null&&(qt||(qt=[])).push(new Yr(pe[sn].marker,null,null));for(var An=0;An<rn;++An)Jt.push(qt);Jt.push(ge)}return Jt}function Kr(e){for(var r=0;r<e.length;++r){var R=e[r];R.from!=null&&R.from==R.to&&R.marker.clearWhenEmpty!==!1&&e.splice(r--,1)}return e.length?e:null}function xi(e,r,R){var L=null;if(e.iter(r.line,R.line+1,function(ut){if(ut.markedSpans)for(var Ct=0;Ct<ut.markedSpans.length;++Ct){var Ut=ut.markedSpans[Ct].marker;Ut.readOnly&&(!L||$(L,Ut)==-1)&&(L||(L=[])).push(Ut)}}),!L)return null;for(var M=[{from:r,to:R}],G=0;G<L.length;++G)for(var le=L[G],pe=le.find(0),ge=0;ge<M.length;++ge){var Se=M[ge];if(kt(Se.to,pe.from)<0||kt(Se.from,pe.to)>0)continue;var Ge=[ge,1],Ze=kt(Se.from,pe.from),pt=kt(Se.to,pe.to);(Ze<0||!le.inclusiveLeft&&!Ze)&&Ge.push({from:Se.from,to:pe.from}),(pt>0||!le.inclusiveRight&&!pt)&&Ge.push({from:pe.to,to:Se.to}),M.splice.apply(M,Ge),ge+=Ge.length-3}return M}function vi(e){var r=e.markedSpans;if(!r)return;for(var R=0;R<r.length;++R)r[R].marker.detachLine(e);e.markedSpans=null}function Si(e,r){if(!r)return;for(var R=0;R<r.length;++R)r[R].marker.attachLine(e);e.markedSpans=r}function Fn(e){return e.inclusiveLeft?-1:0}function Sn(e){return e.inclusiveRight?1:0}function Er(e,r){var R=e.lines.length-r.lines.length;if(R!=0)return R;var L=e.find(),M=r.find(),G=kt(L.from,M.from)||Fn(e)-Fn(r);if(G)return-G;var le=kt(L.to,M.to)||Sn(e)-Sn(r);return le||r.id-e.id}function Kn(e,r){var R=Ar&&e.markedSpans,L;if(R)for(var M=void 0,G=0;G<R.length;++G)M=R[G],M.marker.collapsed&&(r?M.from:M.to)==null&&(!L||Er(L,M.marker)<0)&&(L=M.marker);return L}function Lr(e){return Kn(e,!0)}function rr(e){return Kn(e,!1)}function Ri(e,r){var R=Ar&&e.markedSpans,L;if(R)for(var M=0;M<R.length;++M){var G=R[M];G.marker.collapsed&&(G.from==null||G.from<r)&&(G.to==null||G.to>r)&&(!L||Er(L,G.marker)<0)&&(L=G.marker)}return L}function kr(e,r,R,L,M){var G=Q(e,r),le=Ar&&G.markedSpans;if(le)for(var pe=0;pe<le.length;++pe){var ge=le[pe];if(!ge.marker.collapsed)continue;var Se=ge.marker.find(0),Ge=kt(Se.from,R)||Fn(ge.marker)-Fn(M),Ze=kt(Se.to,L)||Sn(ge.marker)-Sn(M);if(Ge>=0&&Ze<=0||Ge<=0&&Ze>=0)continue;if(Ge<=0&&(ge.marker.inclusiveRight&&M.inclusiveLeft?kt(Se.to,R)>=0:kt(Se.to,R)>0)||Ge>=0&&(ge.marker.inclusiveRight&&M.inclusiveLeft?kt(Se.from,L)<=0:kt(Se.from,L)<0))return!0}}function ni(e){for(var r;r=Lr(e);)e=r.find(-1,!0).line;return e}function ji(e){for(var r;r=rr(e);)e=r.find(1,!0).line;return e}function ui(e){for(var r,R;r=rr(e);)e=r.find(1,!0).line,(R||(R=[])).push(e);return R}function Di(e,r){var R=Q(e,r),L=ni(R);return R==L?r:Je(L)}function ta(e,r){if(r>e.lastLine())return r;var R=Q(e,r),L;if(!ci(e,R))return r;for(;L=rr(R);)R=L.find(1,!0).line;return Je(R)+1}function ci(e,r){var R=Ar&&r.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,r,L))return!0}}function Fi(e,r,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==r.text.length)return!0;for(var M=void 0,G=0;G<r.markedSpans.length;++G)if(M=r.markedSpans[G],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,r,M))return!0}function wi(e){e=ni(e);for(var r=0,R=e.parent,L=0;L<R.lines.length;++L){var M=R.lines[L];if(M==e)break;r+=M.height}for(var G=R.parent;G;R=G,G=R.parent)for(var le=0;le<G.children.length;++le){var pe=G.children[le];if(pe==R)break;r+=pe.height}return r}function Ki(e){if(e.height==0)return 0;for(var r=e.text.length,R,L=e;R=Lr(L);){var M=R.find(0,!0);L=M.from.line,r+=M.from.ch-M.to.ch}for(L=e;R=rr(L);){var G=R.find(0,!0);r-=L.text.length-G.from.ch,L=G.to.line,r+=L.text.length-G.to.ch}return r}function Qi(e){var r=e.display,R=e.doc;r.maxLine=Q(R,R.first),r.maxLineLength=Ki(r.maxLine),r.maxLineChanged=!0,R.iter(function(L){var M=Ki(L);M>r.maxLineLength&&(r.maxLineLength=M,r.maxLine=L)})}var yi=function(e,r,R){this.text=e,Si(this,r),this.height=R?R(this):1};yi.prototype.lineNo=function(){return Je(this)},Me(yi);function aa(e,r,R,L){e.text=r,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),vi(e),Si(e,R);var M=L?L(e):1;M!=e.height&&Ae(e,M)}function ma(e){e.parent=null,vi(e)}var ln={},wn={};function pn(e,r){if(!e||/^\s*$/.test(e))return null;var R=r.addModeClass?wn:ln;return R[e]||(R[e]=e.replace(/\S+/g,"cm-$&"))}function Un(e,r){var R=A("span",null,null,h?"padding-right: .1px":null),L={pre:A("pre",[R],"CodeMirror-line"),content:R,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};r.measure={};for(var M=0;M<=(r.rest?r.rest.length:0);M++){var G=M?r.rest[M-1]:r.line,le=void 0;L.pos=0,L.addToken=mr,Rt(e.display.measure)&&(le=ht(G,e.doc.direction))&&(L.addToken=hn(L.addToken,le)),L.map=[];var pe=r!=e.display.externalMeasured&&Je(G);Bn(G,L,_t(e,G,pe)),G.styleClasses&&(G.styleClasses.bgClass&&(L.bgClass=K(G.styleClasses.bgClass,L.bgClass||"")),G.styleClasses.textClass&&(L.textClass=K(G.styleClasses.textClass,L.textClass||""))),L.map.length==0&&L.map.push(0,0,L.content.appendChild(Bt(e.display.measure))),M==0?(r.measure.map=L.map,r.measure.cache={}):((r.measure.maps||(r.measure.maps=[])).push(L.map),(r.measure.caches||(r.measure.caches=[])).push({}))}if(h){var ge=L.content.lastChild;(/\bcm-tab\b/.test(ge.className)||ge.querySelector&&ge.querySelector(".cm-tab"))&&(L.content.className="cm-tab-wrap-hack")}return qe(e,"renderLine",e,r.line,L.pre),L.pre.className&&(L.textClass=K(L.pre.className,L.textClass||"")),L}function ur(e){var r=x("span","\u2022","cm-invalidchar");return r.title="\\u"+e.charCodeAt(0).toString(16),r.setAttribute("aria-label",r.title),r}function mr(e,r,R,L,M,G,le){if(!r)return;var pe=e.splitSpaces?Zn(r,e.trailingSpace):r,ge=e.cm.state.specialChars,Se=!1,Ge;if(!ge.test(r))e.col+=r.length,Ge=document.createTextNode(pe),e.map.push(e.pos,e.pos+r.length,Ge),T&&C<9&&(Se=!0),e.pos+=r.length;else{Ge=document.createDocumentFragment();for(var Ze=0;;){ge.lastIndex=Ze;var pt=ge.exec(r),ut=pt?pt.index-Ze:r.length-Ze;if(ut){var Ct=document.createTextNode(pe.slice(Ze,Ze+ut));T&&C<9?Ge.appendChild(x("span",[Ct])):Ge.appendChild(Ct),e.map.push(e.pos,e.pos+ut,Ct),e.col+=ut,e.pos+=ut}if(!pt)break;Ze+=ut+1;var Ut=void 0;if(pt[0]==" "){var zt=e.cm.options.tabSize,Jt=zt-e.col%zt;Ut=Ge.appendChild(x("span",xe(Jt),"cm-tab")),Ut.setAttribute("role","presentation"),Ut.setAttribute("cm-text"," "),e.col+=Jt}else pt[0]=="\r"||pt[0]==`
|
|
|
`?(Ut=Ge.appendChild(x("span",pt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ut.setAttribute("cm-text",pt[0]),e.col+=1):(Ut=e.cm.options.specialCharPlaceholder(pt[0]),Ut.setAttribute("cm-text",pt[0]),T&&C<9?Ge.appendChild(x("span",[Ut])):Ge.appendChild(Ut),e.col+=1);e.map.push(e.pos,e.pos+1,Ut),e.pos++}}if(e.trailingSpace=pe.charCodeAt(r.length-1)==32,R||L||M||Se||G||le){var rn=R||"";L&&(rn+=L),M&&(rn+=M);var qt=x("span",[Ge],rn,G);if(le)for(var sn in le)le.hasOwnProperty(sn)&&sn!="style"&&sn!="class"&&qt.setAttribute(sn,le[sn]);return e.content.appendChild(qt)}e.content.appendChild(Ge)}function Zn(e,r){if(e.length>1&&!/ /.test(e))return e;for(var R=r,L="",M=0;M<e.length;M++){var G=e.charAt(M);G==" "&&R&&(M==e.length-1||e.charCodeAt(M+1)==32)&&(G="\xA0"),L+=G,R=G==" "}return L}function hn(e,r){return function(R,L,M,G,le,pe,ge){M=M?M+" cm-force-border":"cm-force-border";for(var Se=R.pos,Ge=Se+L.length;;){for(var Ze=void 0,pt=0;pt<r.length&&!(Ze=r[pt],Ze.to>Se&&Ze.from<=Se);pt++);if(Ze.to>=Ge)return e(R,L,M,G,le,pe,ge);e(R,L.slice(0,Ze.to-Se),M,G,null,pe,ge),G=null,L=L.slice(Ze.to-Se),Se=Ze.to}}}function Fr(e,r,R,L){var M=!L&&R.widgetNode;M&&e.map.push(e.pos,e.pos+r,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+=r,e.trailingSpace=!1}function Bn(e,r,R){var L=e.markedSpans,M=e.text,G=0;if(!L){for(var le=1;le<R.length;le+=2)r.addToken(r,M.slice(G,G=R[le]),pn(R[le+1],r.cm.options));return}for(var pe=M.length,ge=0,Se=1,Ge="",Ze,pt,ut=0,Ct,Ut,zt,Jt,rn;;){if(ut==ge){Ct=Ut=zt=pt="",rn=null,Jt=null,ut=Infinity;for(var qt=[],sn=void 0,An=0;An<L.length;++An){var _n=L[An],Qn=_n.marker;if(Qn.type=="bookmark"&&_n.from==ge&&Qn.widgetNode)qt.push(Qn);else if(_n.from<=ge&&(_n.to==null||_n.to>ge||Qn.collapsed&&_n.to==ge&&_n.from==ge)){if(_n.to!=null&&_n.to!=ge&&ut>_n.to&&(ut=_n.to,Ut=""),Qn.className&&(Ct+=" "+Qn.className),Qn.css&&(pt=(pt?pt+";":"")+Qn.css),Qn.startStyle&&_n.from==ge&&(zt+=" "+Qn.startStyle),Qn.endStyle&&_n.to==ut&&(sn||(sn=[])).push(Qn.endStyle,_n.to),Qn.title&&((rn||(rn={})).title=Qn.title),Qn.attributes)for(var Rr in Qn.attributes)(rn||(rn={}))[Rr]=Qn.attributes[Rr];Qn.collapsed&&(!Jt||Er(Jt.marker,Qn)<0)&&(Jt=_n)}else _n.from>ge&&ut>_n.from&&(ut=_n.from)}if(sn)for(var oi=0;oi<sn.length;oi+=2)sn[oi+1]==ut&&(Ut+=" "+sn[oi]);if(!Jt||Jt.from==ge)for(var jr=0;jr<qt.length;++jr)Fr(r,0,qt[jr]);if(Jt&&(Jt.from||0)==ge){if(Fr(r,(Jt.to==null?pe+1:Jt.to)-ge,Jt.marker,Jt.from==null),Jt.to==null)return;Jt.to==ge&&(Jt=!1)}}if(ge>=pe)break;for(var Pi=Math.min(pe,ut);;){if(Ge){var Oi=ge+Ge.length;if(!Jt){var qr=Oi>Pi?Ge.slice(0,Pi-ge):Ge;r.addToken(r,qr,Ze?Ze+Ct:Ct,zt,ge+qr.length==ut?Ut:"",pt,rn)}if(Oi>=Pi){Ge=Ge.slice(Pi-ge),ge=Pi;break}ge=Oi,zt=""}Ge=M.slice(G,G=R[Se++]),Ze=pn(R[Se++],r.cm.options)}}}function Bi(e,r,R){this.line=r,this.rest=ui(r),this.size=this.rest?Je(Ve(this.rest))-R+1:1,this.node=this.text=null,this.hidden=ci(e,r)}function cr(e,r,R){for(var L=[],M,G=r;G<R;G=M){var le=new Bi(e.doc,Q(e.doc,G),G);M=G+le.size,L.push(le)}return L}var Br=null;function bi(e){Br?Br.ops.push(e):e.ownsGroup=Br={ops:[e],delayedCallbacks:[]}}function ft(e){var r=e.delayedCallbacks,R=0;do{for(;R<r.length;R++)r[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<r.length)}function gt(e,r){var R=e.ownsGroup;if(!R)return;try{ft(R)}finally{Br=null,r(R)}}var Tt=null;function Ft(e,r){var R=tt(e,r);if(!R.length)return;var L=Array.prototype.slice.call(arguments,2),M;Br?M=Br.delayedCallbacks:Tt?M=Tt:(M=Tt=[],setTimeout(mn,0));for(var G=function(pe){M.push(function(){return R[pe].apply(null,L)})},le=0;le<R.length;++le)G(le)}function mn(){var e=Tt;Tt=null;for(var r=0;r<e.length;++r)e[r]()}function fn(e,r,R,L){for(var M=0;M<r.changes.length;M++){var G=r.changes[M];G=="text"?xt(e,r):G=="gutter"?jt(e,r,R,L):G=="class"?on(e,r):G=="widget"&&dn(e,r,L)}r.changes=null}function Et(e){return e.node==e.text&&(e.node=x("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),T&&C<8&&(e.node.style.zIndex=2)),e.node}function bt(e,r){var R=r.bgClass?r.bgClass+" "+(r.line.bgClass||""):r.line.bgClass;if(R&&(R+=" CodeMirror-linebackground"),r.background)R?r.background.className=R:(r.background.parentNode.removeChild(r.background),r.background=null);else if(R){var L=Et(r);r.background=L.insertBefore(x("div",null,R),L.firstChild),e.display.input.setUneditable(r.background)}}function $t(e,r){var R=e.display.externalMeasured;return R&&R.line==r.line?(e.display.externalMeasured=null,r.measure=R.measure,R.built):Un(e,r)}function xt(e,r){var R=r.text.className,L=$t(e,r);r.text==r.node&&(r.node=L.pre),r.text.parentNode.replaceChild(L.pre,r.text),r.text=L.pre,L.bgClass!=r.bgClass||L.textClass!=r.textClass?(r.bgClass=L.bgClass,r.textClass=L.textClass,on(e,r)):R&&(r.text.className=R)}function on(e,r){bt(e,r),r.line.wrapClass?Et(r).className=r.line.wrapClass:r.node!=r.text&&(r.node.className="");var R=r.textClass?r.textClass+" "+(r.line.textClass||""):r.line.textClass;r.text.className=R||""}function jt(e,r,R,L){if(r.gutter&&(r.node.removeChild(r.gutter),r.gutter=null),r.gutterBackground&&(r.node.removeChild(r.gutterBackground),r.gutterBackground=null),r.line.gutterClass){var M=Et(r);r.gutterBackground=x("div",null,"CodeMirror-gutter-background "+r.line.gutterClass,"left: "+(e.options.fixedGutter?L.fixedPos:-L.gutterTotalWidth)+"px; width: "+L.gutterTotalWidth+"px"),e.display.input.setUneditable(r.gutterBackground),M.insertBefore(r.gutterBackground,r.text)}var G=r.line.gutterMarkers;if(e.options.lineNumbers||G){var le=Et(r),pe=r.gutter=x("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?L.fixedPos:-L.gutterTotalWidth)+"px");if(e.display.input.setUneditable(pe),le.insertBefore(pe,r.text),r.line.gutterClass&&(pe.className+=" "+r.line.gutterClass),e.options.lineNumbers&&(!G||!G["CodeMirror-linenumbers"])&&(r.lineNumber=pe.appendChild(x("div",It(e.options,R),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+L.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),G)for(var ge=0;ge<e.display.gutterSpecs.length;++ge){var Se=e.display.gutterSpecs[ge].className,Ge=G.hasOwnProperty(Se)&&G[Se];Ge&&pe.appendChild(x("div",[Ge],"CodeMirror-gutter-elt","left: "+L.gutterLeft[Se]+"px; width: "+L.gutterWidth[Se]+"px"))}}}function dn(e,r,R){r.alignable&&(r.alignable=null);for(var L=m("CodeMirror-linewidget"),M=r.node.firstChild,G=void 0;M;M=G)G=M.nextSibling,L.test(M.className)&&r.node.removeChild(M);Dn(e,r,R)}function $n(e,r,R,L){var M=$t(e,r);return r.text=r.node=M.pre,M.bgClass&&(r.bgClass=M.bgClass),M.textClass&&(r.textClass=M.textClass),on(e,r),jt(e,r,R,L),Dn(e,r,L),r.node}function Dn(e,r,R){if(En(e,r.line,r,R,!0),r.rest)for(var L=0;L<r.rest.length;L++)En(e,r.rest[L],r,R,!1)}function En(e,r,R,L,M){if(!r.widgets)return;for(var G=Et(R),le=0,pe=r.widgets;le<pe.length;++le){var ge=pe[le],Se=x("div",[ge.node],"CodeMirror-linewidget"+(ge.className?" "+ge.className:""));ge.handleMouseEvents||Se.setAttribute("cm-ignore-events","true"),er(ge,Se,R,L),e.display.input.setUneditable(Se),M&&ge.above?G.insertBefore(Se,R.gutter||R.text):G.appendChild(Se),Ft(ge,"redraw")}}function er(e,r,R,L){if(e.noHScroll){(R.alignable||(R.alignable=[])).push(r);var M=L.wrapperWidth;r.style.left=L.fixedPos+"px",e.coverGutter||(M-=L.gutterTotalWidth,r.style.paddingLeft=L.gutterTotalWidth+"px"),r.style.width=M+"px"}e.coverGutter&&(r.style.zIndex=5,r.style.position="relative",e.noHScroll||(r.style.marginLeft=-L.gutterTotalWidth+"px"))}function Rn(e){if(e.height!=null)return e.height;var r=e.doc.cm;if(!r)return 0;if(!D(document.body,e.node)){var R="position: relative;";e.coverGutter&&(R+="margin-left: -"+r.display.gutters.offsetWidth+"px;"),e.noHScroll&&(R+="width: "+r.display.wrapper.clientWidth+"px;"),o(r.display.measure,x("div",[e.node],null,R))}return e.height=e.node.parentNode.offsetHeight}function kn(e,r){for(var R=et(r);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 r=o(e.measure,x("pre","x","CodeMirror-line-like")),R=window.getComputedStyle?window.getComputedStyle(r):r.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 Z-e.display.nativeBarWidth}function gr(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,r,R){var L=e.options.lineWrapping,M=L&&gr(e);if(!r.measure.heights||L&&r.measure.width!=M){var G=r.measure.heights=[];if(L){r.measure.width=M;for(var le=r.text.firstChild.getClientRects(),pe=0;pe<le.length-1;pe++){var ge=le[pe],Se=le[pe+1];Math.abs(ge.bottom-Se.bottom)>2&&G.push((ge.bottom+Se.top)/2-R.top)}}G.push(R.bottom-R.top)}}function fr(e,r,R){if(e.line==r)return{map:e.measure.map,cache:e.measure.cache};for(var L=0;L<e.rest.length;L++)if(e.rest[L]==r)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,r){r=ni(r);var R=Je(r),L=e.display.externalMeasured=new Bi(e.doc,r,R);L.lineN=R;var M=L.built=Un(e,L);return L.text=M.pre,o(e.display.lineMeasure,M.pre),L}function Xt(e,r,R,L){return or(e,tr(e,r),R,L)}function vn(e,r){if(r>=e.display.viewFrom&&r<e.display.viewTo)return e.display.view[ri(e,r)];var R=e.display.externalMeasured;if(R&&r>=R.lineN&&r<R.lineN+R.size)return R}function tr(e,r){var R=Je(r),L=vn(e,R);L&&!L.text?L=null:L&&L.changes&&(fn(e,L,R,On(e)),e.curOp.forceUpdate=!0),L||(L=Wn(e,r));var M=fr(L,r,R);return{line:r,view:L,rect:null,map:M.map,cache:M.cache,before:M.before,hasHeights:!1}}function or(e,r,R,L,M){r.before&&(R=-1);var G=R+(L||""),le;return r.cache.hasOwnProperty(G)?le=r.cache[G]:(r.rect||(r.rect=r.view.text.getBoundingClientRect()),r.hasHeights||(ar(e,r.view,r.rect),r.hasHeights=!0),le=yn(e,r,R,L),le.bogus||(r.cache[G]=le)),{left:le.left,right:le.right,top:M?le.rtop:le.top,bottom:M?le.rbottom:le.bottom}}var vr={left:0,right:0,top:0,bottom:0};function Jn(e,r,R){for(var L,M,G,le,pe,ge,Se=0;Se<e.length;Se+=3)if(pe=e[Se],ge=e[Se+1],r<pe?(M=0,G=1,le="left"):r<ge?(M=r-pe,G=M+1):(Se==e.length-3||r==ge&&e[Se+3]>r)&&(G=ge-pe,M=G-1,r>=ge&&(le="right")),M!=null){if(L=e[Se+2],pe==ge&&R==(L.insertLeft?"left":"right")&&(le=R),R=="left"&&M==0)for(;Se&&e[Se-2]==e[Se-3]&&e[Se-1].insertLeft;)L=e[(Se-=3)+2],le="left";if(R=="right"&&M==ge-pe)for(;Se<e.length-3&&e[Se+3]==e[Se+4]&&!e[Se+5].insertLeft;)L=e[(Se+=3)+2],le="right";break}return{node:L,start:M,end:G,collapse:le,coverStart:pe,coverEnd:ge}}function qn(e,r){var R=vr;if(r=="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,r,R,L){var M=Jn(r.map,R,L),G=M.node,le=M.start,pe=M.end,ge=M.collapse,Se;if(G.nodeType==3){for(var Ge=0;Ge<4;Ge++){for(;le&&P(r.line.text.charAt(M.coverStart+le));)--le;for(;M.coverStart+pe<M.coverEnd&&P(r.line.text.charAt(M.coverStart+pe));)++pe;if(T&&C<9&&le==0&&pe==M.coverEnd-M.coverStart?Se=G.parentNode.getBoundingClientRect():Se=qn(O(G,le,pe).getClientRects(),L),Se.left||Se.right||le==0)break;pe=le,le=le-1,ge="right"}T&&C<11&&(Se=Ln(e.display.measure,Se))}else{le>0&&(ge=L="right");var Ze;e.options.lineWrapping&&(Ze=G.getClientRects()).length>1?Se=Ze[L=="right"?Ze.length-1:0]:Se=G.getBoundingClientRect()}if(T&&C<9&&!le&&(!Se||!Se.left&&!Se.right)){var pt=G.parentNode.getClientRects()[0];pt?Se={left:pt.left,right:pt.left+Xn(e.display),top:pt.top,bottom:pt.bottom}:Se=vr}for(var ut=Se.top-r.rect.top,Ct=Se.bottom-r.rect.top,Ut=(ut+Ct)/2,zt=r.view.measure.heights,Jt=0;Jt<zt.length-1&&!(Ut<zt[Jt]);Jt++);var rn=Jt?zt[Jt-1]:0,qt=zt[Jt],sn={left:(ge=="right"?Se.right:Se.left)-r.rect.left,right:(ge=="left"?Se.left:Se.right)-r.rect.left,top:rn,bottom:qt};return!Se.left&&!Se.right&&(sn.bogus=!0),e.options.singleCursorHeightPerLine||(sn.rtop=ut,sn.rbottom=Ct),sn}function Ln(e,r){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ke(e))return r;var R=screen.logicalXDPI/screen.deviceXDPI,L=screen.logicalYDPI/screen.deviceYDPI;return{left:r.left*R,right:r.right*R,top:r.top*L,bottom:r.bottom*L}}function Gt(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var r=0;r<e.rest.length;r++)e.measure.caches[r]={}}function Yt(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var r=0;r<e.display.view.length;r++)Gt(e.display.view[r])}function Qt(e){Yt(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 c&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function cn(){return c&&i?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Hn(e){var r=0;if(e.widgets)for(var R=0;R<e.widgets.length;++R)e.widgets[R].above&&(r+=Rn(e.widgets[R]));return r}function bn(e,r,R,L,M){if(!M){var G=Hn(r);R.top+=G,R.bottom+=G}if(L=="line")return R;L||(L="local");var le=wi(r);if(L=="local"?le+=Gn(e.display):le-=e.display.viewOffset,L=="page"||L=="window"){var pe=e.display.lineSpace.getBoundingClientRect();le+=pe.top+(L=="window"?0:cn());var ge=pe.left+(L=="window"?0:xn());R.left+=ge,R.right+=ge}return R.top+=le,R.bottom+=le,R}function Mn(e,r,R){if(R=="div")return r;var L=r.left,M=r.top;if(R=="page")L-=xn(),M-=cn();else if(R=="local"||!R){var G=e.display.sizer.getBoundingClientRect();L+=G.left,M+=G.top}var le=e.display.lineSpace.getBoundingClientRect();return{left:L-le.left,top:M-le.top}}function Tn(e,r,R,L,M){return L||(L=Q(e.doc,r.line)),bn(e,L,Xt(e,L,r.ch,M),R)}function Vn(e,r,R,L,M,G){L=L||Q(e.doc,r.line),M||(M=tr(e,L));function le(Ct,Ut){var zt=or(e,M,Ct,Ut?"right":"left",G);return Ut?zt.left=zt.right:zt.right=zt.left,bn(e,L,zt,R)}var pe=ht(L,e.doc.direction),ge=r.ch,Se=r.sticky;if(ge>=L.text.length?(ge=L.text.length,Se="before"):ge<=0&&(ge=0,Se="after"),!pe)return le(Se=="before"?ge-1:ge,Se=="before");function Ge(Ct,Ut,zt){var Jt=pe[Ut],rn=Jt.level==1;return le(zt?Ct-1:Ct,rn!=zt)}var Ze=Ee(pe,ge,Se),pt=J,ut=Ge(ge,Ze,Se=="before");return pt!=null&&(ut.other=Ge(ge,pt,Se!="before")),ut}function sr(e,r){var R=0;r=I(e.doc,r),e.options.lineWrapping||(R=Xn(e.display)*r.ch);var L=Q(e.doc,r.line),M=wi(L)+Gn(e.display);return{left:R,right:R,top:M,bottom:M+L.height}}function br(e,r,R,L,M){var G=ct(e,r,R);return G.xRel=M,L&&(G.outside=L),G}function Pr(e,r,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),G=L.first+L.size-1;if(M>G)return br(L.first+L.size-1,Q(L,G).text.length,null,1,1);r<0&&(r=0);for(var le=Q(L,M);;){var pe=Wi(e,le,M,r,R),ge=Ri(le,pe.ch+(pe.xRel>0||pe.outside>0?1:0));if(!ge)return pe;var Se=ge.find(1);if(Se.line==M)return Se;le=Q(L,M=Se.line)}}function ei(e,r,R,L){L-=Hn(r);var M=r.text.length,G=q(function(le){return or(e,R,le-1).bottom<=L},M,0);return M=q(function(le){return or(e,R,le).top>L},G,M),{begin:G,end:M}}function Mi(e,r,R,L){R||(R=tr(e,r));var M=bn(e,r,or(e,R,L),"line").top;return ei(e,r,R,M)}function $r(e,r,R,L){return e.bottom<=R?!1:e.top>R?!0:(L?e.left:e.right)>r}function Wi(e,r,R,L,M){M-=wi(r);var G=tr(e,r),le=Hn(r),pe=0,ge=r.text.length,Se=!0,Ge=ht(r,e.doc.direction);if(Ge){var Ze=(e.options.lineWrapping?Gi:na)(e,r,R,G,Ge,L,M);Se=Ze.level!=1,pe=Se?Ze.from:Ze.to-1,ge=Se?Ze.to:Ze.from-1}var pt=null,ut=null,Ct=q(function(An){var _n=or(e,G,An);return _n.top+=le,_n.bottom+=le,$r(_n,L,M,!1)?(_n.top<=M&&_n.left<=L&&(pt=An,ut=_n),!0):!1},pe,ge),Ut,zt,Jt=!1;if(ut){var rn=L-ut.left<ut.right-L,qt=rn==Se;Ct=pt+(qt?0:1),zt=qt?"after":"before",Ut=rn?ut.left:ut.right}else{!Se&&(Ct==ge||Ct==pe)&&Ct++,zt=Ct==0?"after":Ct==r.text.length?"before":or(e,G,Ct-(Se?1:0)).bottom+le<=M==Se?"after":"before";var sn=Vn(e,ct(R,Ct,zt),"line",r,G);Ut=sn.left,Jt=M<sn.top?-1:M>=sn.bottom?1:0}return Ct=U(r.text,Ct,1),br(R,Ct,zt,Jt,L-Ut)}function na(e,r,R,L,M,G,le){var pe=q(function(Ze){var pt=M[Ze],ut=pt.level!=1;return $r(Vn(e,ct(R,ut?pt.to:pt.from,ut?"before":"after"),"line",r,L),G,le,!0)},0,M.length-1),ge=M[pe];if(pe>0){var Se=ge.level!=1,Ge=Vn(e,ct(R,Se?ge.from:ge.to,Se?"after":"before"),"line",r,L);$r(Ge,G,le,!0)&&Ge.top>le&&(ge=M[pe-1])}return ge}function Gi(e,r,R,L,M,G,le){var pe=ei(e,r,L,le),ge=pe.begin,Se=pe.end;/\s/.test(r.text.charAt(Se-1))&&Se--;for(var Ge=null,Ze=null,pt=0;pt<M.length;pt++){var ut=M[pt];if(ut.from>=Se||ut.to<=ge)continue;var Ct=ut.level!=1,Ut=or(e,L,Ct?Math.min(Se,ut.to)-1:Math.max(ge,ut.from)).right,zt=Ut<G?G-Ut+1e9:Ut-G;(!Ge||Ze>zt)&&(Ge=ut,Ze=zt)}return Ge||(Ge=M[M.length-1]),Ge.from<ge&&(Ge={from:ge,to:Ge.to,level:Ge.level}),Ge.to>Se&&(Ge={from:Ge.from,to:Se,level:Ge.level}),Ge}var di;function Vi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(di==null){di=x("pre",null,"CodeMirror-line-like");for(var r=0;r<49;++r)di.appendChild(document.createTextNode("x")),di.appendChild(x("br"));di.appendChild(document.createTextNode("x"))}o(e.measure,di);var R=di.offsetHeight/50;return R>3&&(e.cachedTextHeight=R),E(e.measure),R||1}function Xn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var r=x("span","xxxxxxxxxx"),R=x("pre",[r],"CodeMirror-line-like");o(e.measure,R);var L=r.getBoundingClientRect(),M=(L.right-L.left)/10;return M>2&&(e.cachedCharWidth=M),M||10}function On(e){for(var r=e.display,R={},L={},M=r.gutters.clientLeft,G=r.gutters.firstChild,le=0;G;G=G.nextSibling,++le){var pe=e.display.gutterSpecs[le].className;R[pe]=G.offsetLeft+G.clientLeft+M,L[pe]=G.clientWidth}return{fixedPos:nr(r),gutterTotalWidth:r.gutters.offsetWidth,gutterLeft:R,gutterWidth:L,wrapperWidth:r.wrapper.clientWidth}}function nr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function lr(e){var r=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 G=0;if(M.widgets)for(var le=0;le<M.widgets.length;le++)M.widgets[le].height&&(G+=M.widgets[le].height);return R?G+(Math.ceil(M.text.length/L)||1)*r:G+r}}function Wr(e){var r=e.doc,R=lr(e);r.iter(function(L){var M=R(L);M!=L.height&&Ae(L,M)})}function In(e,r,R,L){var M=e.display;if(!R&&et(r).getAttribute("cm-not-content")=="true")return null;var G,le,pe=M.lineSpace.getBoundingClientRect();try{G=r.clientX-pe.left,le=r.clientY-pe.top}catch(Ze){return null}var ge=Pr(e,G,le),Se;if(L&&ge.xRel>0&&(Se=Q(e.doc,ge.line).text).length==ge.ch){var Ge=V(Se,Se.length,e.options.tabSize)-Se.length;ge=ct(ge.line,Math.max(0,Math.round((G-ir(e.display).left)/Xn(e.display))-Ge))}return ge}function ri(e,r){if(r>=e.display.viewTo)return null;if(r-=e.display.viewFrom,r<0)return null;for(var R=e.display.view,L=0;L<R.length;L++)if(r-=R[L].size,r<0)return L}function Ur(e,r,R,L){r==null&&(r=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>r)&&(M.updateLineNumbers=r),e.curOp.viewChanged=!0,r>=M.viewTo)Ar&&Di(e.doc,r)<M.viewTo&&Ci(e);else if(R<=M.viewFrom)Ar&&ta(e.doc,R+L)>M.viewFrom?Ci(e):(M.viewFrom+=L,M.viewTo+=L);else if(r<=M.viewFrom&&R>=M.viewTo)Ci(e);else if(r<=M.viewFrom){var G=Ii(e,R,R+L,1);G?(M.view=M.view.slice(G.index),M.viewFrom=G.lineN,M.viewTo+=L):Ci(e)}else if(R>=M.viewTo){var le=Ii(e,r,r,-1);le?(M.view=M.view.slice(0,le.index),M.viewTo=le.lineN):Ci(e)}else{var pe=Ii(e,r,r,-1),ge=Ii(e,R,R+L,1);pe&&ge?(M.view=M.view.slice(0,pe.index).concat(cr(e,pe.lineN,ge.lineN)).concat(M.view.slice(ge.index)),M.viewTo+=L):Ci(e)}var Se=M.externalMeasured;Se&&(R<Se.lineN?Se.lineN+=L:r<Se.lineN+Se.size&&(M.externalMeasured=null))}function Jr(e,r,R){e.curOp.viewChanged=!0;var L=e.display,M=e.display.externalMeasured;if(M&&r>=M.lineN&&r<M.lineN+M.size&&(L.externalMeasured=null),r<L.viewFrom||r>=L.viewTo)return;var G=L.view[ri(e,r)];if(G.node==null)return;var le=G.changes||(G.changes=[]);$(le,R)==-1&&le.push(R)}function Ci(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ii(e,r,R,L){var M=ri(e,r),G,le=e.display.view;if(!Ar||R==e.doc.first+e.doc.size)return{index:M,lineN:R};for(var pe=e.display.viewFrom,ge=0;ge<M;ge++)pe+=le[ge].size;if(pe!=r){if(L>0){if(M==le.length-1)return null;G=pe+le[M].size-r,M++}else G=pe-r;r+=G,R+=G}for(;Di(e.doc,R)!=R;){if(M==(L<0?0:le.length-1))return null;R+=L*le[M-(L<0?1:0)].size,M+=L}return{index:M,lineN:R}}function Xi(e,r,R){var L=e.display,M=L.view;M.length==0||r>=L.viewTo||R<=L.viewFrom?(L.view=cr(e,r,R),L.viewFrom=r):(L.viewFrom>r?L.view=cr(e,r,L.viewFrom).concat(L.view):L.viewFrom<r&&(L.view=L.view.slice(ri(e,r))),L.viewFrom=r,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 zn(e){for(var r=e.display.view,R=0,L=0;L<r.length;L++){var M=r[L];!M.hidden&&(!M.node||M.changes)&&++R}return R}function Cn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Yn(e,r){r===void 0&&(r=!0);for(var R=e.doc,L={},M=L.cursors=document.createDocumentFragment(),G=L.selection=document.createDocumentFragment(),le=0;le<R.sel.ranges.length;le++){if(!r&&le==R.sel.primIndex)continue;var pe=R.sel.ranges[le];if(pe.from().line>=e.display.viewTo||pe.to().line<e.display.viewFrom)continue;var ge=pe.empty();(ge||e.options.showCursorWhenSelecting)&&Zt(e,pe.head,M),ge||Or(e,pe,G)}return L}function Zt(e,r,R){var L=Vn(e,r,"div",null,null,!e.options.singleCursorHeightPerLine),M=R.appendChild(x("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 G=R.appendChild(x("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));G.style.display="",G.style.left=L.other.left+"px",G.style.top=L.other.top+"px",G.style.height=(L.other.bottom-L.other.top)*.85+"px"}}function Pn(e,r){return e.top-r.top||e.left-r.left}function Or(e,r,R){var L=e.display,M=e.doc,G=document.createDocumentFragment(),le=ir(e.display),pe=le.left,ge=Math.max(L.sizerWidth,gr(e)-L.sizer.offsetLeft)-le.right,Se=M.direction=="ltr";function Ge(qt,sn,An,_n){sn<0&&(sn=0),sn=Math.round(sn),_n=Math.round(_n),G.appendChild(x("div",null,"CodeMirror-selected","position: absolute; left: "+qt+`px;
|
|
|
top: `+sn+"px; width: "+(An==null?ge-qt:An)+`px;
|
|
|
height: `+(_n-sn)+"px"))}function Ze(qt,sn,An){var _n=Q(M,qt),Qn=_n.text.length,Rr,oi;function jr(qr,Ai){return Tn(e,ct(qt,qr),"div",_n,Ai)}function Pi(qr,Ai,hi){var ti=Mi(e,_n,null,qr),Qr=Ai=="ltr"==(hi=="after")?"left":"right",Hr=hi=="after"?ti.begin:ti.end-(/\s/.test(_n.text.charAt(ti.end-1))?2:1);return jr(Hr,Qr)[Qr]}var Oi=ht(_n,M.direction);return Y(Oi,sn||0,An==null?Qn:An,function(qr,Ai,hi,ti){var Qr=hi=="ltr",Hr=jr(qr,Qr?"left":"right"),Li=jr(Ai-1,Qr?"right":"left"),Pa=sn==null&&qr==0,pa=An==null&&Ai==Qn,pi=ti==0,ea=!Oi||ti==Oi.length-1;if(Li.top-Hr.top<=3){var si=(Se?Pa:pa)&&pi,Fo=(Se?pa:Pa)&&ea,ia=si?pe:(Qr?Hr:Li).left,Ea=Fo?ge:(Qr?Li:Hr).right;Ge(ia,Hr.top,Ea-ia,Hr.bottom)}else{var xa,Ei,Ma,Bo;Qr?(xa=Se&&Pa&&pi?pe:Hr.left,Ei=Se?ge:Pi(qr,hi,"before"),Ma=Se?pe:Pi(Ai,hi,"after"),Bo=Se&&pa&&ea?ge:Li.right):(xa=Se?Pi(qr,hi,"before"):pe,Ei=!Se&&Pa&&pi?ge:Hr.right,Ma=!Se&&pa&&ea?pe:Li.left,Bo=Se?Pi(Ai,hi,"after"):ge),Ge(xa,Hr.top,Ei-xa,Hr.bottom),Hr.bottom<Li.top&&Ge(pe,Hr.bottom,null,Li.top),Ge(Ma,Li.top,Bo-Ma,Li.bottom)}(!Rr||Pn(Hr,Rr)<0)&&(Rr=Hr),Pn(Li,Rr)<0&&(Rr=Li),(!oi||Pn(Hr,oi)<0)&&(oi=Hr),Pn(Li,oi)<0&&(oi=Li)}),{start:Rr,end:oi}}var pt=r.from(),ut=r.to();if(pt.line==ut.line)Ze(pt.line,pt.ch,ut.ch);else{var Ct=Q(M,pt.line),Ut=Q(M,ut.line),zt=ni(Ct)==ni(Ut),Jt=Ze(pt.line,pt.ch,zt?Ct.text.length+1:null).end,rn=Ze(ut.line,zt?0:null,ut.ch).start;zt&&(Jt.top<rn.top-2?(Ge(Jt.right,Jt.top,null,Jt.bottom),Ge(pe,rn.top,rn.left,rn.bottom)):Ge(Jt.right,Jt.top,rn.left-Jt.right,Jt.bottom)),Jt.bottom<rn.top&&Ge(pe,Jt.bottom,null,rn.top)}R.appendChild(G)}function Gr(e){if(!e.state.focused)return;var r=e.display;clearInterval(r.blinker);var R=!0;r.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?r.blinker=setInterval(function(){e.hasFocus()||Hi(e),r.cursorDiv.style.visibility=(R=!R)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(r.cursorDiv.style.visibility="hidden")}function Vr(e){e.state.focused||(e.display.input.focus(),gn(e))}function ga(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Hi(e))},100)}function gn(e,r){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(qe(e,"focus",e,r),e.state.focused=!0,W(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),h&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Gr(e)}function Hi(e,r){if(e.state.delayingBlurEvent)return;e.state.focused&&(qe(e,"blur",e,r),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 r=e.display,R=r.lineDiv.offsetTop,L=0;L<r.view.length;L++){var M=r.view[L],G=e.options.lineWrapping,le=void 0,pe=0;if(M.hidden)continue;if(T&&C<8){var ge=M.node.offsetTop+M.node.offsetHeight;le=ge-R,R=ge}else{var Se=M.node.getBoundingClientRect();le=Se.bottom-Se.top,!G&&M.text.firstChild&&(pe=M.text.firstChild.getBoundingClientRect().right-Se.left-1)}var Ge=M.line.height-le;if((Ge>.005||Ge<-.005)&&(Ae(M.line,le),Yi(M.line),M.rest))for(var Ze=0;Ze<M.rest.length;Ze++)Yi(M.rest[Ze]);if(pe>e.display.sizerWidth){var pt=Math.ceil(pe/Xn(e.display));pt>e.display.maxLineLength&&(e.display.maxLineLength=pt,e.display.maxLine=M.line,e.display.maxLineChanged=!0)}}}function Yi(e){if(e.widgets)for(var r=0;r<e.widgets.length;++r){var R=e.widgets[r],L=R.node.parentNode;L&&(R.height=L.offsetHeight)}}function zi(e,r,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,G=at(r,L),le=at(r,M);if(R&&R.ensure){var pe=R.ensure.from.line,ge=R.ensure.to.line;pe<G?(G=pe,le=at(r,wi(Q(r,pe))+e.wrapper.clientHeight)):Math.min(ge,r.lastLine())>=le&&(G=at(r,wi(Q(r,ge))-e.wrapper.clientHeight),le=ge)}return{from:G,to:Math.max(le,G+1)}}function $i(e,r){if(Ye(e,"scrollCursorIntoView"))return;var R=e.display,L=R.sizer.getBoundingClientRect(),M=null;if(r.top+L.top<0?M=!0:r.bottom+L.top>(window.innerHeight||document.documentElement.clientHeight)&&(M=!1),M!=null&&!s){var G=x("div","\u200B",null,`position: absolute;
|
|
|
top: `+(r.top-R.viewOffset-Gn(e.display))+`px;
|
|
|
height: `+(r.bottom-r.top+dr(e)+R.barHeight)+`px;
|
|
|
left: `+r.left+"px; width: "+Math.max(2,r.right-r.left)+"px;");e.display.lineSpace.appendChild(G),G.scrollIntoView(M),e.display.lineSpace.removeChild(G)}}function sa(e,r,R,L){L==null&&(L=0);var M;!e.options.lineWrapping&&r==R&&(r=r.ch?ct(r.line,r.sticky=="before"?r.ch-1:r.ch,"after"):r,R=r.sticky=="before"?ct(r.line,r.ch+1,"before"):r);for(var G=0;G<5;G++){var le=!1,pe=Vn(e,r),ge=!R||R==r?pe:Vn(e,R);M={left:Math.min(pe.left,ge.left),top:Math.min(pe.top,ge.top)-L,right:Math.max(pe.left,ge.left),bottom:Math.max(pe.bottom,ge.bottom)+L};var Se=Zi(e,M),Ge=e.doc.scrollTop,Ze=e.doc.scrollLeft;if(Se.scrollTop!=null&&(Ua(e,Se.scrollTop),Math.abs(e.doc.scrollTop-Ge)>1&&(le=!0)),Se.scrollLeft!=null&&(va(e,Se.scrollLeft),Math.abs(e.doc.scrollLeft-Ze)>1&&(le=!0)),!le)break}return M}function la(e,r){var R=Zi(e,r);R.scrollTop!=null&&Ua(e,R.scrollTop),R.scrollLeft!=null&&va(e,R.scrollLeft)}function Zi(e,r){var R=e.display,L=Vi(e.display);r.top<0&&(r.top=0);var M=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:R.scroller.scrollTop,G=xr(e),le={};r.bottom-r.top>G&&(r.bottom=r.top+G);var pe=e.doc.height+Tr(R),ge=r.top<L,Se=r.bottom>pe-L;if(r.top<M)le.scrollTop=ge?0:r.top;else if(r.bottom>M+G){var Ge=Math.min(r.top,(Se?pe:r.bottom)-G);Ge!=M&&(le.scrollTop=Ge)}var Ze=e.options.fixedGutter?0:R.gutters.offsetWidth,pt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:R.scroller.scrollLeft-Ze,ut=gr(e)-R.gutters.offsetWidth,Ct=r.right-r.left>ut;return Ct&&(r.right=r.left+ut),r.left<10?le.scrollLeft=0:r.left<pt?le.scrollLeft=Math.max(0,r.left+Ze-(Ct?0:10)):r.right>ut+pt-3&&(le.scrollLeft=r.right+(Ct?0:10)-ut),le}function Ia(e,r){if(r==null)return;no(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+r}function Ir(e){no(e);var r=e.getCursor();e.curOp.scrollToPos={from:r,to:r,margin:e.options.cursorScrollMargin}}function Na(e,r,R){(r!=null||R!=null)&&no(e),r!=null&&(e.curOp.scrollLeft=r),R!=null&&(e.curOp.scrollTop=R)}function Qs(e,r){no(e),e.curOp.scrollToPos=r}function no(e){var r=e.curOp.scrollToPos;if(r){e.curOp.scrollToPos=null;var R=sr(e,r.from),L=sr(e,r.to);Wo(e,R,L,r.margin)}}function Wo(e,r,R,L){var M=Zi(e,{left:Math.min(r.left,R.left),top:Math.min(r.top,R.top)-L,right:Math.max(r.right,R.right),bottom:Math.max(r.bottom,R.bottom)+L});Na(e,M.scrollLeft,M.scrollTop)}function Ua(e,r){if(Math.abs(e.doc.scrollTop-r)<2)return;j||_o(e,{top:r}),Ho(e,r,!0),j&&_o(e),Ba(e,100)}function Ho(e,r,R){if(r=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,r)),e.display.scroller.scrollTop==r&&!R)return;e.doc.scrollTop=r,e.display.scrollbars.setScrollTop(r),e.display.scroller.scrollTop!=r&&(e.display.scroller.scrollTop=r)}function va(e,r,R,L){if(r=Math.max(0,Math.min(r,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(R?r==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-r)<2)&&!L)return;e.doc.scrollLeft=r,Xo(e),e.display.scroller.scrollLeft!=r&&(e.display.scroller.scrollLeft=r),e.display.scrollbars.setScrollLeft(r)}function ja(e){var r=e.display,R=r.gutters.offsetWidth,L=Math.round(e.doc.height+Tr(e.display));return{clientHeight:r.scroller.clientHeight,viewHeight:r.wrapper.clientHeight,scrollWidth:r.scroller.scrollWidth,clientWidth:r.scroller.clientWidth,viewWidth:r.wrapper.clientWidth,barLeft:e.options.fixedGutter?R:0,docHeight:L,scrollHeight:L+dr(e)+r.barHeight,nativeBarWidth:r.nativeBarWidth,gutterWidth:R}}var ya=function(e,r,R){this.cm=R;var L=this.vert=x("div",[x("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),M=this.horiz=x("div",[x("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");L.tabIndex=M.tabIndex=-1,e(L),e(M),je(L,"scroll",function(){L.clientHeight&&r(L.scrollTop,"vertical")}),je(M,"scroll",function(){M.clientWidth&&r(M.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,T&&C<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ya.prototype.update=function(e){var r=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=r?L+"px":"0";var M=e.viewHeight-(r?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(r){this.horiz.style.display="block",this.horiz.style.right=R?L+"px":"0",this.horiz.style.left=e.barLeft+"px";var G=e.viewWidth-e.barLeft-(R?L:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+G)+"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:r?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=t&&!u?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ne,this.disableVert=new ne},ya.prototype.enableZeroWidthBar=function(e,r,R){e.style.pointerEvents="auto";function L(){var M=e.getBoundingClientRect(),G=R=="vert"?document.elementFromPoint(M.right-1,(M.top+M.bottom)/2):document.elementFromPoint((M.right+M.left)/2,M.bottom-1);G!=e?e.style.pointerEvents="none":r.set(1e3,L)}r.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,r){r||(r=ja(e));var R=e.display.barWidth,L=e.display.barHeight;zo(e,r);for(var M=0;M<4&&R!=e.display.barWidth||L!=e.display.barHeight;M++)R!=e.display.barWidth&&e.options.lineWrapping&&oa(e),zo(e,ja(e)),R=e.display.barWidth,L=e.display.barHeight}function zo(e,r){var R=e.display,L=R.scrollbars.update(r);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=r.gutterWidth+"px"):R.gutterFiller.style.display=""}var Ko={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 Ko[e.options.scrollbarStyle](function(r){e.display.wrapper.insertBefore(r,e.display.scrollbarFiller),je(r,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),r.setAttribute("cm-not-content","true")},function(r,R){R=="horizontal"?va(e,r):Ua(e,r)},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 _a(e){var r=e.curOp;r&>(r,function(R){for(var L=0;L<R.ops.length;L++)R.ops[L].cm.curOp=null;el(R)})}function el(e){for(var r=e.ops,R=0;R<r.length;R++)tl(r[R]);for(var L=0;L<r.length;L++)nl(r[L]);for(var M=0;M<r.length;M++)rl(r[M]);for(var G=0;G<r.length;G++)il(r[G]);for(var le=0;le<r.length;le++)al(r[le])}function tl(e){var r=e.cm,R=r.display;sl(r),e.updateMaxLine&&Qi(r),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&&r.options.lineWrapping,e.update=e.mustUpdate&&new ro(r,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 r=e.cm,R=r.display;e.updatedDisplay&&oa(r),e.barMeasure=ja(r),R.maxLineChanged&&!r.options.lineWrapping&&(e.adjustWidthTo=Xt(r,R.maxLine,R.maxLine.text.length).left+3,r.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(R.scroller.clientWidth,R.sizer.offsetLeft+e.adjustWidthTo+dr(r)+r.display.barWidth),e.maxScrollLeft=Math.max(0,R.sizer.offsetLeft+e.adjustWidthTo-gr(r))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=R.input.prepareSelection())}function il(e){var r=e.cm;e.adjustWidthTo!=null&&(r.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<r.doc.scrollLeft&&va(r,Math.min(r.display.scroller.scrollLeft,e.maxScrollLeft),!0),r.display.maxLineChanged=!1);var R=e.focus&&e.focus==N();e.preparedSelection&&r.display.input.showSelection(e.preparedSelection,R),(e.updatedDisplay||e.startHeight!=r.doc.height)&&Sa(r,e.barMeasure),e.updatedDisplay&&xo(r,e.barMeasure),e.selectionChanged&&Gr(r),r.state.focused&&e.updateInput&&r.display.input.reset(e.typing),R&&Vr(e.cm)}function al(e){var r=e.cm,R=r.display,L=r.doc;if(e.updatedDisplay&&Vo(r,e.update),R.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(R.wheelStartX=R.wheelStartY=null),e.scrollTop!=null&&Ho(r,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&va(r,e.scrollLeft,!0,!0),e.scrollToPos){var M=sa(r,I(L,e.scrollToPos.from),I(L,e.scrollToPos.to),e.scrollToPos.margin);$i(r,M)}var G=e.maybeHiddenMarkers,le=e.maybeUnhiddenMarkers;if(G)for(var pe=0;pe<G.length;++pe)G[pe].lines.length||qe(G[pe],"hide");if(le)for(var ge=0;ge<le.length;++ge)le[ge].lines.length&&qe(le[ge],"unhide");R.wrapper.offsetHeight&&(L.scrollTop=r.display.scroller.scrollTop),e.changeObjs&&qe(r,"changes",r,e.changeObjs),e.update&&e.update.finish()}function ki(e,r){if(e.curOp)return r();ba(e);try{return r()}finally{_a(e)}}function ii(e,r){return function(){if(e.curOp)return r.apply(e,arguments);ba(e);try{return r.apply(e,arguments)}finally{_a(e)}}}function _i(e){return function(){if(this.curOp)return e.apply(this,arguments);ba(this);try{return e.apply(this,arguments)}finally{_a(this)}}}function ai(e){return function(){var r=this.cm;if(!r||r.curOp)return e.apply(this,arguments);ba(r);try{return e.apply(this,arguments)}finally{_a(r)}}}function Ba(e,r){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(r,B(ol,e))}function ol(e){var r=e.doc;if(r.highlightFrontier>=e.display.viewTo)return;var R=+new Date+e.options.workTime,L=At(e,r.highlightFrontier),M=[];r.iter(L.line,Math.min(r.first+r.size,e.display.viewTo+500),function(G){if(L.line>=e.display.viewFrom){var le=G.styles,pe=G.text.length>e.options.maxHighlightLength?tn(r.mode,L.state):null,ge=Xe(e,G,L,!0);pe&&(L.state=pe),G.styles=ge.styles;var Se=G.styleClasses,Ge=ge.classes;Ge?G.styleClasses=Ge:Se&&(G.styleClasses=null);for(var Ze=!le||le.length!=G.styles.length||Se!=Ge&&(!Se||!Ge||Se.bgClass!=Ge.bgClass||Se.textClass!=Ge.textClass),pt=0;!Ze&&pt<le.length;++pt)Ze=le[pt]!=G.styles[pt];Ze&&M.push(L.line),G.stateAfter=L.save(),L.nextLine()}else G.text.length<=e.options.maxHighlightLength&&Vt(e,G.text,L),G.stateAfter=L.line%5==0?L.save():null,L.nextLine();if(+new Date>R)return Ba(e,e.options.workDelay),!0}),r.highlightFrontier=L.line,r.modeFrontier=Math.max(r.modeFrontier,L.line),M.length&&ki(e,function(){for(var G=0;G<M.length;G++)Jr(e,M[G],"text")})}var ro=function(e,r,R){var L=e.display;this.viewport=r,this.visible=zi(L,e.doc,r),this.editorIsHidden=!L.wrapper.offsetWidth,this.wrapperHeight=L.wrapper.clientHeight,this.wrapperWidth=L.wrapper.clientWidth,this.oldDisplayWidth=gr(e),this.force=R,this.dims=On(e),this.events=[]};ro.prototype.signal=function(e,r){Ie(e,r)&&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 r=e.display;!r.scrollbarsClipped&&r.scroller.offsetWidth&&(r.nativeBarWidth=r.scroller.offsetWidth-r.scroller.clientWidth,r.heightForcer.style.height=dr(e)+"px",r.sizer.style.marginBottom=-r.nativeBarWidth+"px",r.sizer.style.borderRightWidth=dr(e)+"px",r.scrollbarsClipped=!0)}function ll(e){if(e.hasFocus())return null;var r=N();if(!r||!D(e.display.lineDiv,r))return null;var R={activeElt:r};if(window.getSelection){var L=window.getSelection();L.anchorNode&&L.extend&&D(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==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode)){var r=window.getSelection(),R=document.createRange();R.setEnd(e.anchorNode,e.anchorOffset),R.collapse(!1),r.removeAllRanges(),r.addRange(R),r.extend(e.focusNode,e.focusOffset)}}function bo(e,r){var R=e.display,L=e.doc;if(r.editorIsHidden)return Ci(e),!1;if(!r.force&&r.visible.from>=R.viewFrom&&r.visible.to<=R.viewTo&&(R.updateLineNumbers==null||R.updateLineNumbers>=R.viewTo)&&R.renderedView==R.view&&zn(e)==0)return!1;Yo(e)&&(Ci(e),r.dims=On(e));var M=L.first+L.size,G=Math.max(r.visible.from-e.options.viewportMargin,L.first),le=Math.min(M,r.visible.to+e.options.viewportMargin);R.viewFrom<G&&G-R.viewFrom<20&&(G=Math.max(L.first,R.viewFrom)),R.viewTo>le&&R.viewTo-le<20&&(le=Math.min(M,R.viewTo)),Ar&&(G=Di(e.doc,G),le=ta(e.doc,le));var pe=G!=R.viewFrom||le!=R.viewTo||R.lastWrapHeight!=r.wrapperHeight||R.lastWrapWidth!=r.wrapperWidth;Xi(e,G,le),R.viewOffset=wi(Q(e.doc,R.viewFrom)),e.display.mover.style.top=R.viewOffset+"px";var ge=zn(e);if(!pe&&ge==0&&!r.force&&R.renderedView==R.view&&(R.updateLineNumbers==null||R.updateLineNumbers>=R.viewTo))return!1;var Se=ll(e);return ge>4&&(R.lineDiv.style.display="none"),cl(e,R.updateLineNumbers,r.dims),ge>4&&(R.lineDiv.style.display=""),R.renderedView=R.view,ul(Se),E(R.cursorDiv),E(R.selectionDiv),R.gutters.style.height=R.sizer.style.minHeight=0,pe&&(R.lastWrapHeight=r.wrapperHeight,R.lastWrapWidth=r.wrapperWidth,Ba(e,400)),R.updateLineNumbers=null,!0}function Vo(e,r){for(var R=r.viewport,L=!0;;L=!1){if(!L||!e.options.lineWrapping||r.oldDisplayWidth==gr(e)){if(R&&R.top!=null&&(R={top:Math.min(e.doc.height+Tr(e.display)-xr(e),R.top)}),r.visible=zi(e.display,e.doc,R),r.visible.from>=e.display.viewFrom&&r.visible.to<=e.display.viewTo)break}else L&&(r.visible=zi(e.display,e.doc,R));if(!bo(e,r))break;oa(e);var M=ja(e);Cn(e),Sa(e,M),xo(e,M),r.force=!1}r.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(r.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function _o(e,r){var R=new ro(e,r);if(bo(e,R)){oa(e),Vo(e,R);var L=ja(e);Cn(e),Sa(e,L),xo(e,L),R.finish()}}function cl(e,r,R){var L=e.display,M=e.options.lineNumbers,G=L.lineDiv,le=G.firstChild;function pe(Ct){var Ut=Ct.nextSibling;return h&&t&&e.display.currentWheelTarget==Ct?Ct.style.display="none":Ct.parentNode.removeChild(Ct),Ut}for(var ge=L.view,Se=L.viewFrom,Ge=0;Ge<ge.length;Ge++){var Ze=ge[Ge];if(!Ze.hidden)if(!Ze.node||Ze.node.parentNode!=G){var pt=$n(e,Ze,Se,R);G.insertBefore(pt,le)}else{for(;le!=Ze.node;)le=pe(le);var ut=M&&r!=null&&r<=Se&&Ze.lineNumber;Ze.changes&&($(Ze.changes,"gutter")>-1&&(ut=!1),fn(e,Ze,Se,R)),ut&&(E(Ze.lineNumber),Ze.lineNumber.appendChild(document.createTextNode(It(e.options,Se)))),le=Ze.node.nextSibling}Se+=Ze.size}for(;le;)le=pe(le)}function Eo(e){var r=e.gutters.offsetWidth;e.sizer.style.marginLeft=r+"px"}function xo(e,r){e.display.sizer.style.minHeight=r.docHeight+"px",e.display.heightForcer.style.top=r.docHeight+"px",e.display.gutters.style.height=r.docHeight+e.display.barHeight+dr(e)+"px"}function Xo(e){var r=e.display,R=r.view;if(!r.alignWidgets&&(!r.gutters.firstChild||!e.options.fixedGutter))return;for(var L=nr(r)-r.scroller.scrollLeft+e.doc.scrollLeft,M=r.gutters.offsetWidth,G=L+"px",le=0;le<R.length;le++)if(!R[le].hidden){e.options.fixedGutter&&(R[le].gutter&&(R[le].gutter.style.left=G),R[le].gutterBackground&&(R[le].gutterBackground.style.left=G));var pe=R[le].alignable;if(pe)for(var ge=0;ge<pe.length;ge++)pe[ge].style.left=G}e.options.fixedGutter&&(r.gutters.style.left=L+M+"px")}function Yo(e){if(!e.options.lineNumbers)return!1;var r=e.doc,R=It(e.options,r.first+r.size-1),L=e.display;if(R.length!=L.lineNumChars){var M=L.measure.appendChild(x("div",[x("div",R)],"CodeMirror-linenumber CodeMirror-gutter-elt")),G=M.firstChild.offsetWidth,le=M.offsetWidth-G;return L.lineGutter.style.width="",L.lineNumInnerWidth=Math.max(G,L.lineGutter.offsetWidth-le)+1,L.lineNumWidth=L.lineNumInnerWidth+le,L.lineNumChars=L.lineNumInnerWidth?R.length:-1,L.lineGutter.style.width=L.lineNumWidth+"px",Eo(e.display),!0}return!1}function So(e,r){for(var R=[],L=!1,M=0;M<e.length;M++){var G=e[M],le=null;if(typeof G!="string"&&(le=G.style,G=G.className),G=="CodeMirror-linenumbers")if(r)L=!0;else continue;R.push({className:G,style:le})}return r&&!L&&R.push({className:"CodeMirror-linenumbers",style:null}),R}function $o(e){var r=e.gutters,R=e.gutterSpecs;E(r),e.lineGutter=null;for(var L=0;L<R.length;++L){var M=R[L],G=M.className,le=M.style,pe=r.appendChild(x("div",null,"CodeMirror-gutter "+G));le&&(pe.style.cssText=le),G=="CodeMirror-linenumbers"&&(e.lineGutter=pe,pe.style.width=(e.lineNumWidth||1)+"px")}r.style.display=R.length?"":"none",Eo(e)}function Wa(e){$o(e.display),Ur(e),Xo(e)}function dl(e,r,R,L){var M=this;this.input=R,M.scrollbarFiller=x("div",null,"CodeMirror-scrollbar-filler"),M.scrollbarFiller.setAttribute("cm-not-content","true"),M.gutterFiller=x("div",null,"CodeMirror-gutter-filler"),M.gutterFiller.setAttribute("cm-not-content","true"),M.lineDiv=A("div",null,"CodeMirror-code"),M.selectionDiv=x("div",null,null,"position: relative; z-index: 1"),M.cursorDiv=x("div",null,"CodeMirror-cursors"),M.measure=x("div",null,"CodeMirror-measure"),M.lineMeasure=x("div",null,"CodeMirror-measure"),M.lineSpace=A("div",[M.measure,M.lineMeasure,M.selectionDiv,M.cursorDiv,M.lineDiv],null,"position: relative; outline: none");var G=A("div",[M.lineSpace],"CodeMirror-lines");M.mover=x("div",[G],null,"position: relative"),M.sizer=x("div",[M.mover],"CodeMirror-sizer"),M.sizerWidth=null,M.heightForcer=x("div",null,null,"position: absolute; height: "+Z+"px; width: 1px;"),M.gutters=x("div",null,"CodeMirror-gutters"),M.lineGutter=null,M.scroller=x("div",[M.sizer,M.heightForcer,M.gutters],"CodeMirror-scroll"),M.scroller.setAttribute("tabIndex","-1"),M.wrapper=x("div",[M.scrollbarFiller,M.gutterFiller,M.scroller],"CodeMirror"),T&&C<8&&(M.gutters.style.zIndex=-1,M.scroller.style.paddingRight=0),!h&&!(j&&n)&&(M.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(M.wrapper):e(M.wrapper)),M.viewFrom=M.viewTo=r.first,M.reportedViewFrom=M.reportedViewTo=r.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:c?Ni=-.7:a&&(Ni=-1/3);function Jo(e){var r=e.wheelDeltaX,R=e.wheelDeltaY;return r==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(r=e.detail),R==null&&e.detail&&e.axis==e.VERTICAL_AXIS?R=e.detail:R==null&&(R=e.wheelDelta),{x:r,y:R}}function hl(e){var r=Jo(e);return r.x*=Ni,r.y*=Ni,r}function qo(e,r){var R=Jo(r),L=R.x,M=R.y,G=e.display,le=G.scroller,pe=le.scrollWidth>le.clientWidth,ge=le.scrollHeight>le.clientHeight;if(!(L&&pe||M&&ge))return;if(M&&t&&h){e:for(var Se=r.target,Ge=G.view;Se!=le;Se=Se.parentNode)for(var Ze=0;Ze<Ge.length;Ze++)if(Ge[Ze].node==Se){e.display.currentWheelTarget=Se;break e}}if(L&&!j&&!l&&Ni!=null){M&&ge&&Ua(e,Math.max(0,le.scrollTop+M*Ni)),va(e,Math.max(0,le.scrollLeft+L*Ni)),(!M||M&&ge)&&be(r),G.wheelStartX=null;return}if(M&&Ni!=null){var pt=M*Ni,ut=e.doc.scrollTop,Ct=ut+G.wrapper.clientHeight;pt<0?ut=Math.max(0,ut+pt-50):Ct=Math.min(e.doc.height,Ct+pt+50),_o(e,{top:ut,bottom:Ct})}io<20&&(G.wheelStartX==null?(G.wheelStartX=le.scrollLeft,G.wheelStartY=le.scrollTop,G.wheelDX=L,G.wheelDY=M,setTimeout(function(){if(G.wheelStartX==null)return;var Ut=le.scrollLeft-G.wheelStartX,zt=le.scrollTop-G.wheelStartY,Jt=zt&&G.wheelDY&&zt/G.wheelDY||Ut&&G.wheelDX&&Ut/G.wheelDX;if(G.wheelStartX=G.wheelStartY=null,!Jt)return;Ni=(Ni*io+Jt)/(io+1),++io},200)):(G.wheelDX+=L,G.wheelDY+=M))}var Ui=function(e,r){this.ranges=e,this.primIndex=r};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 r=0;r<this.ranges.length;r++){var R=this.ranges[r],L=e.ranges[r];if(!nn(R.anchor,L.anchor)||!nn(R.head,L.head))return!1}return!0},Ui.prototype.deepCopy=function(){for(var e=[],r=0;r<this.ranges.length;r++)e[r]=new _r(Ot(this.ranges[r].anchor),Ot(this.ranges[r].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,r){r||(r=e);for(var R=0;R<this.ranges.length;R++){var L=this.ranges[R];if(kt(r,L.from())>=0&&kt(e,L.to())<=0)return R}return-1};var _r=function(e,r){this.anchor=e,this.head=r};_r.prototype.from=function(){return an(this.anchor,this.head)},_r.prototype.to=function(){return un(this.anchor,this.head)},_r.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ji(e,r,R){var L=e&&e.options.selectionsMayTouch,M=r[R];r.sort(function(pt,ut){return kt(pt.from(),ut.from())}),R=$(r,M);for(var G=1;G<r.length;G++){var le=r[G],pe=r[G-1],ge=kt(pe.to(),le.from());if(L&&!le.empty()?ge>0:ge>=0){var Se=an(pe.from(),le.from()),Ge=un(pe.to(),le.to()),Ze=pe.empty()?le.from()==le.head:pe.from()==pe.head;G<=R&&--R,r.splice(--G,2,new _r(Ze?Ge:Se,Ze?Se:Ge))}}return new Ui(r,R)}function ua(e,r){return new Ui([new _r(e,r||e)],0)}function ca(e){return e.text?ct(e.from.line+e.text.length-1,Ve(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Qo(e,r){if(kt(e,r.from)<0)return e;if(kt(e,r.to)<=0)return ca(r);var R=e.line+r.text.length-(r.to.line-r.from.line)-1,L=e.ch;return e.line==r.to.line&&(L+=ca(r).ch-r.to.ch),ct(R,L)}function wo(e,r){for(var R=[],L=0;L<e.sel.ranges.length;L++){var M=e.sel.ranges[L];R.push(new _r(Qo(M.anchor,r),Qo(M.head,r)))}return Ji(e.cm,R,e.sel.primIndex)}function Zo(e,r,R){return e.line==r.line?ct(R.line,e.ch-r.ch+R.ch):ct(R.line+(e.line-r.line),e.ch)}function fl(e,r,R){for(var L=[],M=ct(e.first,0),G=M,le=0;le<r.length;le++){var pe=r[le],ge=Zo(pe.from,M,G),Se=Zo(ca(pe),M,G);if(M=pe.to,G=Se,R=="around"){var Ge=e.sel.ranges[le],Ze=kt(Ge.head,Ge.anchor)<0;L[le]=new _r(Ze?Se:ge,Ze?ge:Se)}else L[le]=new _r(ge,ge)}return new Ui(L,e.sel.primIndex)}function Co(e){e.doc.mode=St(e.options,e.doc.modeOption),Ha(e)}function Ha(e){e.doc.iter(function(r){r.stateAfter&&(r.stateAfter=null),r.styles&&(r.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ba(e,100),e.state.modeGen++,e.curOp&&Ur(e)}function es(e,r){return r.from.ch==0&&r.to.ch==0&&Ve(r.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function To(e,r,R,L){function M(rn){return R?R[rn]:null}function G(rn,qt,sn){aa(rn,qt,sn,L),Ft(rn,"change",rn,r)}function le(rn,qt){for(var sn=[],An=rn;An<qt;++An)sn.push(new yi(Se[An],M(An),L));return sn}var pe=r.from,ge=r.to,Se=r.text,Ge=Q(e,pe.line),Ze=Q(e,ge.line),pt=Ve(Se),ut=M(Se.length-1),Ct=ge.line-pe.line;if(r.full)e.insert(0,le(0,Se.length)),e.remove(Se.length,e.size-Se.length);else if(es(e,r)){var Ut=le(0,Se.length-1);G(Ze,Ze.text,ut),Ct&&e.remove(pe.line,Ct),Ut.length&&e.insert(pe.line,Ut)}else if(Ge==Ze)if(Se.length==1)G(Ge,Ge.text.slice(0,pe.ch)+pt+Ge.text.slice(ge.ch),ut);else{var zt=le(1,Se.length-1);zt.push(new yi(pt+Ge.text.slice(ge.ch),ut,L)),G(Ge,Ge.text.slice(0,pe.ch)+Se[0],M(0)),e.insert(pe.line+1,zt)}else if(Se.length==1)G(Ge,Ge.text.slice(0,pe.ch)+Se[0]+Ze.text.slice(ge.ch),M(0)),e.remove(pe.line+1,Ct);else{G(Ge,Ge.text.slice(0,pe.ch)+Se[0],M(0)),G(Ze,pt+Ze.text.slice(ge.ch),ut);var Jt=le(1,Se.length-1);Ct>1&&e.remove(pe.line+1,Ct-1),e.insert(pe.line+1,Jt)}Ft(e,"change",e,r)}function da(e,r,R){function L(M,G,le){if(M.linked)for(var pe=0;pe<M.linked.length;++pe){var ge=M.linked[pe];if(ge.doc==G)continue;var Se=le&&ge.sharedHist;if(R&&!Se)continue;r(ge.doc,Se),L(ge.doc,M,Se)}}L(e,null,!0)}function ts(e,r){if(r.cm)throw new Error("This document is already in use.");e.doc=r,r.cm=e,Wr(e),Co(e),ns(e),e.options.lineWrapping||Qi(e),e.options.mode=r.modeOption,Ur(e)}function ns(e){(e.doc.direction=="rtl"?W:y)(e.display.lineDiv,"CodeMirror-rtl")}function pl(e){ki(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 Oo(e,r){var R={from:Ot(r.from),to:ca(r),text:ae(e,r.from,r.to)};return as(e,R,r.from.line,r.to.line+1),da(e,function(L){return as(L,R,r.from.line,r.to.line+1)},!0),R}function rs(e){for(;e.length;){var r=Ve(e);if(r.ranges)e.pop();else break}}function ml(e,r){if(r)return rs(e.done),Ve(e.done);if(e.done.length&&!Ve(e.done).ranges)return Ve(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ve(e.done)}function is(e,r,R,L){var M=e.history;M.undone.length=0;var G=+new Date,le,pe;if((M.lastOp==L||M.lastOrigin==r.origin&&r.origin&&(r.origin.charAt(0)=="+"&&M.lastModTime>G-(e.cm?e.cm.options.historyEventDelay:500)||r.origin.charAt(0)=="*"))&&(le=ml(M,M.lastOp==L)))pe=Ve(le.changes),kt(r.from,r.to)==0&&kt(r.from,pe.to)==0?pe.to=ca(r):le.changes.push(Oo(e,r));else{var ge=Ve(M.done);for((!ge||!ge.ranges)&&oo(e.sel,M.done),le={changes:[Oo(e,r)],generation:M.generation},M.done.push(le);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=G,M.lastOp=M.lastSelOp=L,M.lastOrigin=M.lastSelOrigin=r.origin,pe||qe(e,"historyAdded")}function gl(e,r,R,L){var M=r.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 vl(e,r,R,L){var M=e.history,G=L&&L.origin;R==M.lastSelOp||G&&M.lastSelOrigin==G&&(M.lastModTime==M.lastSelTime&&M.lastOrigin==G||gl(e,G,Ve(M.done),r))?M.done[M.done.length-1]=r:oo(r,M.done),M.lastSelTime=+new Date,M.lastSelOrigin=G,M.lastSelOp=R,L&&L.clearRedo!==!1&&rs(M.undone)}function oo(e,r){var R=Ve(r);R&&R.ranges&&R.equals(e)||r.push(e)}function as(e,r,R,L){var M=r["spans_"+e.id],G=0;e.iter(Math.max(e.first,R),Math.min(e.first+e.size,L),function(le){le.markedSpans&&((M||(M=r["spans_"+e.id]={}))[G]=le.markedSpans),++G})}function yl(e){if(!e)return null;for(var r,R=0;R<e.length;++R)e[R].marker.explicitlyCleared?r||(r=e.slice(0,R)):r&&r.push(e[R]);return r?r.length?r:null:e}function bl(e,r){var R=r["spans_"+e.id];if(!R)return null;for(var L=[],M=0;M<r.text.length;++M)L.push(yl(R[M]));return L}function os(e,r){var R=bl(e,r),L=zr(e,r);if(!R)return L;if(!L)return R;for(var M=0;M<R.length;++M){var G=R[M],le=L[M];if(G&&le){e:for(var pe=0;pe<le.length;++pe){for(var ge=le[pe],Se=0;Se<G.length;++Se)if(G[Se].marker==ge.marker)continue e;G.push(ge)}}else le&&(R[M]=le)}return R}function wa(e,r,R){for(var L=[],M=0;M<e.length;++M){var G=e[M];if(G.ranges){L.push(R?Ui.prototype.deepCopy.call(G):G);continue}var le=G.changes,pe=[];L.push({changes:pe});for(var ge=0;ge<le.length;++ge){var Se=le[ge],Ge=void 0;if(pe.push({from:Se.from,to:Se.to,text:Se.text}),r)for(var Ze in Se)(Ge=Ze.match(/^spans_(\d+)$/))&&($(r,Number(Ge[1]))>-1&&(Ve(pe)[Ze]=Se[Ze],delete Se[Ze]))}}return L}function Ao(e,r,R,L){if(L){var M=e.anchor;if(R){var G=kt(r,M)<0;G!=kt(R,M)<0?(M=r,r=R):G!=kt(r,R)<0&&(r=R)}return new _r(M,r)}else return new _r(R||r,r)}function so(e,r,R,L,M){M==null&&(M=e.cm&&(e.cm.display.shift||e.extend)),fi(e,new Ui([Ao(e.sel.primary(),r,R,M)],0),L)}function ss(e,r,R){for(var L=[],M=e.cm&&(e.cm.display.shift||e.extend),G=0;G<e.sel.ranges.length;G++)L[G]=Ao(e.sel.ranges[G],r[G],null,M);var le=Ji(e.cm,L,e.sel.primIndex);fi(e,le,R)}function Lo(e,r,R,L){var M=e.sel.ranges.slice(0);M[r]=R,fi(e,Ji(e.cm,M,e.sel.primIndex),L)}function ls(e,r,R,L){fi(e,ua(r,R),L)}function _l(e,r,R){var L={ranges:r.ranges,update:function(M){this.ranges=[];for(var G=0;G<M.length;G++)this.ranges[G]=new _r(I(e,M[G].anchor),I(e,M[G].head))},origin:R&&R.origin};return qe(e,"beforeSelectionChange",e,L),e.cm&&qe(e.cm,"beforeSelectionChange",e.cm,L),L.ranges!=r.ranges?Ji(e.cm,L.ranges,L.ranges.length-1):r}function us(e,r,R){var L=e.history.done,M=Ve(L);M&&M.ranges?(L[L.length-1]=r,lo(e,r,R)):fi(e,r,R)}function fi(e,r,R){lo(e,r,R),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,R)}function lo(e,r,R){(Ie(e,"beforeSelectionChange")||e.cm&&Ie(e.cm,"beforeSelectionChange"))&&(r=_l(e,r,R));var L=R&&R.bias||(kt(r.primary().head,e.sel.primary().head)<0?-1:1);cs(e,hs(e,r,L,!0)),!(R&&R.scroll===!1)&&e.cm&&Ir(e.cm)}function cs(e,r){if(r.equals(e.sel))return;e.sel=r,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Fe(e.cm)),Ft(e,"cursorActivity",e)}function ds(e){cs(e,hs(e,e.sel,null,!1))}function hs(e,r,R,L){for(var M,G=0;G<r.ranges.length;G++){var le=r.ranges[G],pe=r.ranges.length==e.sel.ranges.length&&e.sel.ranges[G],ge=uo(e,le.anchor,pe&&pe.anchor,R,L),Se=uo(e,le.head,pe&&pe.head,R,L);(M||ge!=le.anchor||Se!=le.head)&&(M||(M=r.ranges.slice(0,G)),M[G]=new _r(ge,Se))}return M?Ji(e.cm,M,r.primIndex):r}function Ca(e,r,R,L,M){var G=Q(e,r.line);if(G.markedSpans)for(var le=0;le<G.markedSpans.length;++le){var pe=G.markedSpans[le],ge=pe.marker,Se="selectLeft"in ge?!ge.selectLeft:ge.inclusiveLeft,Ge="selectRight"in ge?!ge.selectRight:ge.inclusiveRight;if((pe.from==null||(Se?pe.from<=r.ch:pe.from<r.ch))&&(pe.to==null||(Ge?pe.to>=r.ch:pe.to>r.ch))){if(M&&(qe(ge,"beforeCursorEnter"),ge.explicitlyCleared))if(G.markedSpans){--le;continue}else break;if(!ge.atomic)continue;if(R){var Ze=ge.find(L<0?1:-1),pt=void 0;if((L<0?Ge:Se)&&(Ze=fs(e,Ze,-L,Ze&&Ze.line==r.line?G:null)),Ze&&Ze.line==r.line&&(pt=kt(Ze,R))&&(L<0?pt<0:pt>0))return Ca(e,Ze,r,L,M)}var ut=ge.find(L<0?-1:1);return(L<0?Se:Ge)&&(ut=fs(e,ut,L,ut.line==r.line?G:null)),ut?Ca(e,ut,r,L,M):null}}return r}function uo(e,r,R,L,M){var G=L||1,le=Ca(e,r,R,G,M)||!M&&Ca(e,r,R,G,!0)||Ca(e,r,R,-G,M)||!M&&Ca(e,r,R,-G,!0);return le||(e.cantEdit=!0,ct(e.first,0))}function fs(e,r,R,L){return R<0&&r.ch==0?r.line>e.first?I(e,ct(r.line-1)):null:R>0&&r.ch==(L||Q(e,r.line)).text.length?r.line<e.first+e.size-1?ct(r.line+1,0):null:new ct(r.line,r.ch+R)}function ps(e){e.setSelection(ct(e.firstLine(),0),ct(e.lastLine()),he)}function ms(e,r,R){var L={canceled:!1,from:r.from,to:r.to,text:r.text,origin:r.origin,cancel:function(){return L.canceled=!0}};return R&&(L.update=function(M,G,le,pe){M&&(L.from=I(e,M)),G&&(L.to=I(e,G)),le&&(L.text=le),pe!==void 0&&(L.origin=pe)}),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,r,R){if(e.cm){if(!e.cm.curOp)return ii(e.cm,Ta)(e,r,R);if(e.cm.state.suppressEdits)return}if((Ie(e,"beforeChange")||e.cm&&Ie(e.cm,"beforeChange"))&&(r=ms(e,r,!0),!r))return;var L=mi&&!R&&xi(e,r.from,r.to);if(L)for(var M=L.length-1;M>=0;--M)gs(e,{from:L[M].from,to:L[M].to,text:M?[""]:r.text,origin:r.origin});else gs(e,r)}function gs(e,r){if(r.text.length==1&&r.text[0]==""&&kt(r.from,r.to)==0)return;var R=wo(e,r);is(e,r,R,e.cm?e.cm.curOp.id:NaN),za(e,r,R,zr(e,r));var L=[];da(e,function(M,G){!G&&$(L,M.history)==-1&&(_s(M.history,r),L.push(M.history)),za(M,r,null,zr(M,r))})}function co(e,r,R){var L=e.cm&&e.cm.state.suppressEdits;if(L&&!R)return;for(var M=e.history,G,le=e.sel,pe=r=="undo"?M.done:M.undone,ge=r=="undo"?M.undone:M.done,Se=0;Se<pe.length&&!(G=pe[Se],R?G.ranges&&!G.equals(e.sel):!G.ranges);Se++);if(Se==pe.length)return;for(M.lastOrigin=M.lastSelOrigin=null;;)if(G=pe.pop(),G.ranges){if(oo(G,ge),R&&!G.equals(e.sel)){fi(e,G,{clearRedo:!1});return}le=G}else if(L){pe.push(G);return}else break;var Ge=[];oo(le,ge),ge.push({changes:Ge,generation:M.generation}),M.generation=G.generation||++M.maxGeneration;for(var Ze=Ie(e,"beforeChange")||e.cm&&Ie(e.cm,"beforeChange"),pt=function(Ut){var zt=G.changes[Ut];if(zt.origin=r,Ze&&!ms(e,zt,!1))return pe.length=0,{};Ge.push(Oo(e,zt));var Jt=Ut?wo(e,zt):Ve(pe);za(e,zt,Jt,os(e,zt)),!Ut&&e.cm&&e.cm.scrollIntoView({from:zt.from,to:ca(zt)});var rn=[];da(e,function(qt,sn){!sn&&$(rn,qt.history)==-1&&(_s(qt.history,zt),rn.push(qt.history)),za(qt,zt,null,os(qt,zt))})},ut=G.changes.length-1;ut>=0;--ut){var Ct=pt(ut);if(Ct)return Ct.v}}function vs(e,r){if(r==0)return;if(e.first+=r,e.sel=new Ui(Ne(e.sel.ranges,function(M){return new _r(ct(M.anchor.line+r,M.anchor.ch),ct(M.head.line+r,M.head.ch))}),e.sel.primIndex),e.cm){Ur(e.cm,e.first,e.first-r,r);for(var R=e.cm.display,L=R.viewFrom;L<R.viewTo;L++)Jr(e.cm,L,"gutter")}}function za(e,r,R,L){if(e.cm&&!e.cm.curOp)return ii(e.cm,za)(e,r,R,L);if(r.to.line<e.first){vs(e,r.text.length-1-(r.to.line-r.from.line));return}if(r.from.line>e.lastLine())return;if(r.from.line<e.first){var M=r.text.length-1-(e.first-r.from.line);vs(e,M),r={from:ct(e.first,0),to:ct(r.to.line+M,r.to.ch),text:[Ve(r.text)],origin:r.origin}}var G=e.lastLine();r.to.line>G&&(r={from:r.from,to:ct(G,Q(e,G).text.length),text:[r.text[0]],origin:r.origin}),r.removed=ae(e,r.from,r.to),R||(R=wo(e,r)),e.cm?El(e.cm,r,L):To(e,r,L),lo(e,R,he),e.cantEdit&&uo(e,ct(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,r,R){var L=e.doc,M=e.display,G=r.from,le=r.to,pe=!1,ge=G.line;e.options.lineWrapping||(ge=Je(ni(Q(L,G.line))),L.iter(ge,le.line+1,function(ut){if(ut==M.maxLine)return pe=!0,!0})),L.sel.contains(r.from,r.to)>-1&&Fe(e),To(L,r,R,lr(e)),e.options.lineWrapping||(L.iter(ge,G.line+r.text.length,function(ut){var Ct=Ki(ut);Ct>M.maxLineLength&&(M.maxLine=ut,M.maxLineLength=Ct,M.maxLineChanged=!0,pe=!1)}),pe&&(e.curOp.updateMaxLine=!0)),hr(L,G.line),Ba(e,400);var Se=r.text.length-(le.line-G.line)-1;r.full?Ur(e):G.line==le.line&&r.text.length==1&&!es(e.doc,r)?Jr(e,G.line,"text"):Ur(e,G.line,le.line+1,Se);var Ge=Ie(e,"changes"),Ze=Ie(e,"change");if(Ze||Ge){var pt={from:G,to:le,text:r.text,removed:r.removed,origin:r.origin};Ze&&Ft(e,"change",e,pt),Ge&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(pt)}e.display.selForContextMenu=null}function Oa(e,r,R,L,M){var G;L||(L=R),kt(L,R)<0&&(G=[L,R],R=G[0],L=G[1]),typeof r=="string"&&(r=e.splitLines(r)),Ta(e,{from:R,to:L,text:r,origin:M})}function ys(e,r,R,L){R<e.line?e.line+=L:r<e.line&&(e.line=r,e.ch=0)}function bs(e,r,R,L){for(var M=0;M<e.length;++M){var G=e[M],le=!0;if(G.ranges){G.copied||(G=e[M]=G.deepCopy(),G.copied=!0);for(var pe=0;pe<G.ranges.length;pe++)ys(G.ranges[pe].anchor,r,R,L),ys(G.ranges[pe].head,r,R,L);continue}for(var ge=0;ge<G.changes.length;++ge){var Se=G.changes[ge];if(R<Se.from.line)Se.from=ct(Se.from.line+L,Se.from.ch),Se.to=ct(Se.to.line+L,Se.to.ch);else if(r<=Se.to.line){le=!1;break}}le||(e.splice(0,M+1),M=0)}}function _s(e,r){var R=r.from.line,L=r.to.line,M=r.text.length-(L-R)-1;bs(e.done,R,L,M),bs(e.undone,R,L,M)}function Ka(e,r,R,L){var M=r,G=r;return typeof r=="number"?G=Q(e,re(e,r)):M=Je(r),M==null?null:(L(G,M)&&e.cm&&Jr(e.cm,M,R),G)}function Ga(e){this.lines=e,this.parent=null;for(var r=0,R=0;R<e.length;++R)e[R].parent=this,r+=e[R].height;this.height=r}Ga.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,r){for(var R=e,L=e+r;R<L;++R){var M=this.lines[R];this.height-=M.height,ma(M),Ft(M,"delete")}this.lines.splice(e,r)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,r,R){this.height+=R,this.lines=this.lines.slice(0,e).concat(r).concat(this.lines.slice(e));for(var L=0;L<r.length;++L)r[L].parent=this},iterN:function(e,r,R){for(var L=e+r;e<L;++e)if(R(this.lines[e]))return!0}};function Va(e){this.children=e;for(var r=0,R=0,L=0;L<e.length;++L){var M=e[L];r+=M.chunkSize(),R+=M.height,M.parent=this}this.size=r,this.height=R,this.parent=null}Va.prototype={chunkSize:function(){return this.size},removeInner:function(e,r){this.size-=r;for(var R=0;R<this.children.length;++R){var L=this.children[R],M=L.chunkSize();if(e<M){var G=Math.min(r,M-e),le=L.height;if(L.removeInner(e,G),this.height-=le-L.height,M==G&&(this.children.splice(R--,1),L.parent=null),(r-=G)==0)break;e=0}else e-=M}if(this.size-r<25&&(this.children.length>1||!(this.children[0]instanceof Ga))){var pe=[];this.collapse(pe),this.children=[new Ga(pe)],this.children[0].parent=this}},collapse:function(e){for(var r=0;r<this.children.length;++r)this.children[r].collapse(e)},insertInner:function(e,r,R){this.size+=r.length,this.height+=R;for(var L=0;L<this.children.length;++L){var M=this.children[L],G=M.chunkSize();if(e<=G){if(M.insertInner(e,r,R),M.lines&&M.lines.length>50){for(var le=M.lines.length%25+25,pe=le;pe<M.lines.length;){var ge=new Ga(M.lines.slice(pe,pe+=25));M.height-=ge.height,this.children.splice(++L,0,ge),ge.parent=this}M.lines=M.lines.slice(0,le),this.maybeSpill()}break}e-=G}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var r=e.children.splice(e.children.length-5,5),R=new Va(r);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,r,R){for(var L=0;L<this.children.length;++L){var M=this.children[L],G=M.chunkSize();if(e<G){var le=Math.min(r,G-e);if(M.iterN(e,le,R))return!0;if((r-=le)==0)break;e=0}else e-=G}}};var Xa=function(e,r,R){if(R)for(var L in R)R.hasOwnProperty(L)&&(this[L]=R[L]);this.doc=e,this.node=r};Xa.prototype.clear=function(){var e=this.doc.cm,r=this.line.widgets,R=this.line,L=Je(R);if(L==null||!r)return;for(var M=0;M<r.length;++M)r[M]==this&&r.splice(M--,1);r.length||(R.widgets=null);var G=Rn(this);Ae(R,Math.max(0,R.height-G)),e&&(ki(e,function(){Es(e,R,-G),Jr(e,L,"widget")}),Ft(e,"lineWidgetCleared",e,this,L))},Xa.prototype.changed=function(){var e=this,r=this.height,R=this.doc.cm,L=this.line;this.height=null;var M=Rn(this)-r;if(!M)return;ci(this.doc,L)||Ae(L,L.height+M),R&&ki(R,function(){R.curOp.forceUpdate=!0,Es(R,L,M),Ft(R,"lineWidgetChanged",R,e,Je(L))})},Me(Xa);function Es(e,r,R){wi(r)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ia(e,R)}function xl(e,r,R,L){var M=new Xa(e,R,L),G=e.cm;return G&&M.noHScroll&&(G.display.alignWidgets=!0),Ka(e,r,"widget",function(le){var pe=le.widgets||(le.widgets=[]);if(M.insertAt==null?pe.push(M):pe.splice(Math.min(pe.length-1,Math.max(0,M.insertAt)),0,M),M.line=le,G&&!ci(e,le)){var ge=wi(le)<e.scrollTop;Ae(le,le.height+Rn(M)),ge&&Ia(G,M.height),G.curOp.forceUpdate=!0}return!0}),G&&Ft(G,"lineWidgetAdded",G,M,typeof r=="number"?r:Je(r)),M}var xs=0,ha=function(e,r){this.lines=[],this.type=r,this.doc=e,this.id=++xs};ha.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,r=e&&!e.curOp;if(r&&ba(e),Ie(this,"clear")){var R=this.find();R&&Ft(this,"clear",R.from,R.to)}for(var L=null,M=null,G=0;G<this.lines.length;++G){var le=this.lines[G],pe=Mr(le.markedSpans,this);e&&!this.collapsed?Jr(e,Je(le),"text"):e&&(pe.to!=null&&(M=Je(le)),pe.from!=null&&(L=Je(le))),le.markedSpans=Zr(le.markedSpans,pe),pe.from==null&&this.collapsed&&!ci(this.doc,le)&&e&&Ae(le,Vi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ge=0;ge<this.lines.length;++ge){var Se=ni(this.lines[ge]),Ge=Ki(Se);Ge>e.display.maxLineLength&&(e.display.maxLine=Se,e.display.maxLineLength=Ge,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&&Ft(e,"markerCleared",e,this,L,M),r&&_a(e),this.parent&&this.parent.clear()},ha.prototype.find=function(e,r){e==null&&this.type=="bookmark"&&(e=1);for(var R,L,M=0;M<this.lines.length;++M){var G=this.lines[M],le=Mr(G.markedSpans,this);if(le.from!=null&&(R=ct(r?G:Je(G),le.from),e==-1))return R;if(le.to!=null&&(L=ct(r?G:Je(G),le.to),e==1))return L}return R&&{from:R,to:L}},ha.prototype.changed=function(){var e=this,r=this.find(-1,!0),R=this,L=this.doc.cm;if(!r||!L)return;ki(L,function(){var M=r.line,G=Je(r.line),le=vn(L,G);if(le&&(Gt(le),L.curOp.selectionChanged=L.curOp.forceUpdate=!0),L.curOp.updateMaxLine=!0,!ci(R.doc,M)&&R.height!=null){var pe=R.height;R.height=null;var ge=Rn(R)-pe;ge&&Ae(M,M.height+ge)}Ft(L,"markerChanged",L,e)})},ha.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var r=this.doc.cm.curOp;(!r.maybeHiddenMarkers||$(r.maybeHiddenMarkers,this)==-1)&&(r.maybeUnhiddenMarkers||(r.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 r=this.doc.cm.curOp;(r.maybeHiddenMarkers||(r.maybeHiddenMarkers=[])).push(this)}},Me(ha);function Aa(e,r,R,L,M){if(L&&L.shared)return Sl(e,r,R,L,M);if(e.cm&&!e.cm.curOp)return ii(e.cm,Aa)(e,r,R,L,M);var G=new ha(e,M),le=kt(r,R);if(L&&X(L,G,!1),le>0||le==0&&G.clearWhenEmpty!==!1)return G;if(G.replacedWith&&(G.collapsed=!0,G.widgetNode=A("span",[G.replacedWith],"CodeMirror-widget"),L.handleMouseEvents||G.widgetNode.setAttribute("cm-ignore-events","true"),L.insertLeft&&(G.widgetNode.insertLeft=!0)),G.collapsed){if(kr(e,r.line,r,R,G)||r.line!=R.line&&kr(e,R.line,r,R,G))throw new Error("Inserting collapsed marker partially overlapping an existing one");pr()}G.addToHistory&&is(e,{from:r,to:R,origin:"markText"},e.sel,NaN);var pe=r.line,ge=e.cm,Se;if(e.iter(pe,R.line+1,function(Ze){ge&&G.collapsed&&!ge.options.lineWrapping&&ni(Ze)==ge.display.maxLine&&(Se=!0),G.collapsed&&pe!=r.line&&Ae(Ze,0),Cr(Ze,new Yr(G,pe==r.line?r.ch:null,pe==R.line?R.ch:null)),++pe}),G.collapsed&&e.iter(r.line,R.line+1,function(Ze){ci(e,Ze)&&Ae(Ze,0)}),G.clearOnEnter&&je(G,"beforeCursorEnter",function(){return G.clear()}),G.readOnly&&(yr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),G.collapsed&&(G.id=++xs,G.atomic=!0),ge){if(Se&&(ge.curOp.updateMaxLine=!0),G.collapsed)Ur(ge,r.line,R.line+1);else if(G.className||G.startStyle||G.endStyle||G.css||G.attributes||G.title)for(var Ge=r.line;Ge<=R.line;Ge++)Jr(ge,Ge,"text");G.atomic&&ds(ge.doc),Ft(ge,"markerAdded",ge,G)}return G}var Ya=function(e,r){this.markers=e,this.primary=r;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();Ft(this,"clear")},Ya.prototype.find=function(e,r){return this.primary.find(e,r)},Me(Ya);function Sl(e,r,R,L,M){L=X(L),L.shared=!1;var G=[Aa(e,r,R,L,M)],le=G[0],pe=L.widgetNode;return da(e,function(ge){pe&&(L.widgetNode=pe.cloneNode(!0)),G.push(Aa(ge,I(ge,r),I(ge,R),L,M));for(var Se=0;Se<ge.linked.length;++Se)if(ge.linked[Se].isParent)return;le=Ve(G)}),new Ya(G,le)}function Ss(e){return e.findMarks(ct(e.first,0),e.clipPos(ct(e.lastLine())),function(r){return r.parent})}function wl(e,r){for(var R=0;R<r.length;R++){var L=r[R],M=L.find(),G=e.clipPos(M.from),le=e.clipPos(M.to);if(kt(G,le)){var pe=Aa(e,G,le,L.primary,L.primary.type);L.markers.push(pe),pe.parent=L}}}function Cl(e){for(var r=function(L){var M=e[L],G=[M.primary.doc];da(M.primary.doc,function(ge){return G.push(ge)});for(var le=0;le<M.markers.length;le++){var pe=M.markers[le];$(G,pe.doc)==-1&&(pe.parent=null,M.markers.splice(le--,1))}},R=0;R<e.length;R++)r(R)}var Tl=0,Ti=function(e,r,R,L,M){if(!(this instanceof Ti))return new Ti(e,r,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 G=ct(R,0);this.sel=ua(G),this.history=new ao(null),this.id=++Tl,this.modeOption=r,this.lineSep=L,this.direction=M=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),To(this,{from:G,to:G,text:e}),fi(this,ua(G),he)};Ti.prototype=ye(Va.prototype,{constructor:Ti,iter:function(e,r,R){R?this.iterN(e-this.first,r-e,R):this.iterN(this.first,this.first+this.size,e)},insert:function(e,r){for(var R=0,L=0;L<r.length;++L)R+=r[L].height;this.insertInner(e-this.first,r,R)},remove:function(e,r){this.removeInner(e-this.first,r)},getValue:function(e){var r=fe(this,this.first,this.first+this.size);return e===!1?r:r.join(e||this.lineSeparator())},setValue:ai(function(e){var r=ct(this.first,0),R=this.first+this.size-1;Ta(this,{from:r,to:ct(R,Q(this,R).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Na(this.cm,0,0),fi(this,ua(r),he)}),replaceRange:function(e,r,R,L){r=I(this,r),R=R?I(this,R):r,Oa(this,e,r,R,L)},getRange:function(e,r,R){var L=ae(this,I(this,e),I(this,r));return R===!1?L:L.join(R||this.lineSeparator())},getLine:function(e){var r=this.getLineHandle(e);return r&&r.text},getLineHandle:function(e){if(Lt(this,e))return Q(this,e)},getLineNumber:function(e){return Je(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Q(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 I(this,e)},getCursor:function(e){var r=this.sel.primary(),R;return e==null||e=="head"?R=r.head:e=="anchor"?R=r.anchor:e=="end"||e=="to"||e===!1?R=r.to():R=r.from(),R},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ai(function(e,r,R){ls(this,I(this,typeof e=="number"?ct(e,r||0):e),null,R)}),setSelection:ai(function(e,r,R){ls(this,I(this,e),I(this,r||e),R)}),extendSelection:ai(function(e,r,R){so(this,I(this,e),r&&I(this,r),R)}),extendSelections:ai(function(e,r){ss(this,ie(this,e),r)}),extendSelectionsBy:ai(function(e,r){var R=Ne(this.sel.ranges,e);ss(this,ie(this,R),r)}),setSelections:ai(function(e,r,R){if(!e.length)return;for(var L=[],M=0;M<e.length;M++)L[M]=new _r(I(this,e[M].anchor),I(this,e[M].head));r==null&&(r=Math.min(e.length-1,this.sel.primIndex)),fi(this,Ji(this.cm,L,r),R)}),addSelection:ai(function(e,r,R){var L=this.sel.ranges.slice(0);L.push(new _r(I(this,e),I(this,r||e))),fi(this,Ji(this.cm,L,L.length-1),R)}),getSelection:function(e){for(var r=this.sel.ranges,R,L=0;L<r.length;L++){var M=ae(this,r[L].from(),r[L].to());R=R?R.concat(M):M}return e===!1?R:R.join(e||this.lineSeparator())},getSelections:function(e){for(var r=[],R=this.sel.ranges,L=0;L<R.length;L++){var M=ae(this,R[L].from(),R[L].to());e!==!1&&(M=M.join(e||this.lineSeparator())),r[L]=M}return r},replaceSelection:function(e,r,R){for(var L=[],M=0;M<this.sel.ranges.length;M++)L[M]=e;this.replaceSelections(L,r,R||"+input")},replaceSelections:ai(function(e,r,R){for(var L=[],M=this.sel,G=0;G<M.ranges.length;G++){var le=M.ranges[G];L[G]={from:le.from(),to:le.to(),text:this.splitLines(e[G]),origin:R}}for(var pe=r&&r!="end"&&fl(this,L,r),ge=L.length-1;ge>=0;ge--)Ta(this,L[ge]);pe?us(this,pe):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,r=0,R=0,L=0;L<e.done.length;L++)e.done[L].ranges||++r;for(var M=0;M<e.undone.length;M++)e.undone[M].ranges||++R;return{undo:r,redo:R}},clearHistory:function(){var e=this;this.history=new ao(this.history.maxGeneration),da(this,function(r){return r.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:wa(this.history.done),undone:wa(this.history.undone)}},setHistory:function(e){var r=this.history=new ao(this.history.maxGeneration);r.done=wa(e.done.slice(0),null,!0),r.undone=wa(e.undone.slice(0),null,!0)},setGutterMarker:ai(function(e,r,R){return Ka(this,e,"gutter",function(L){var M=L.gutterMarkers||(L.gutterMarkers={});return M[r]=R,!R&&nt(M)&&(L.gutterMarkers=null),!0})}),clearGutter:ai(function(e){var r=this;this.iter(function(R){R.gutterMarkers&&R.gutterMarkers[e]&&Ka(r,R,"gutter",function(){return R.gutterMarkers[e]=null,nt(R.gutterMarkers)&&(R.gutterMarkers=null),!0})})}),lineInfo:function(e){var r;if(typeof e=="number"){if(!Lt(this,e))return null;if(r=e,e=Q(this,e),!e)return null}else if(r=Je(e),r==null)return null;return{line:r,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ai(function(e,r,R){return Ka(this,e,r=="gutter"?"gutter":"class",function(L){var M=r=="text"?"textClass":r=="background"?"bgClass":r=="gutter"?"gutterClass":"wrapClass";if(!L[M])L[M]=R;else{if(m(R).test(L[M]))return!1;L[M]+=" "+R}return!0})}),removeLineClass:ai(function(e,r,R){return Ka(this,e,r=="gutter"?"gutter":"class",function(L){var M=r=="text"?"textClass":r=="background"?"bgClass":r=="gutter"?"gutterClass":"wrapClass",G=L[M];if(G)if(R==null)L[M]=null;else{var le=G.match(m(R));if(!le)return!1;var pe=le.index+le[0].length;L[M]=G.slice(0,le.index)+(!le.index||pe==G.length?"":" ")+G.slice(pe)||null}else return!1;return!0})}),addLineWidget:ai(function(e,r,R){return xl(this,e,r,R)}),removeLineWidget:function(e){e.clear()},markText:function(e,r,R){return Aa(this,I(this,e),I(this,r),R,R&&R.type||"range")},setBookmark:function(e,r){var R={replacedWith:r&&(r.nodeType==null?r.widget:r),insertLeft:r&&r.insertLeft,clearWhenEmpty:!1,shared:r&&r.shared,handleMouseEvents:r&&r.handleMouseEvents};return e=I(this,e),Aa(this,e,e,R,"bookmark")},findMarksAt:function(e){e=I(this,e);var r=[],R=Q(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)&&r.push(M.marker.parent||M.marker)}return r},findMarks:function(e,r,R){e=I(this,e),r=I(this,r);var L=[],M=e.line;return this.iter(e.line,r.line+1,function(G){var le=G.markedSpans;if(le)for(var pe=0;pe<le.length;pe++){var ge=le[pe];!(ge.to!=null&&M==e.line&&e.ch>=ge.to||ge.from==null&&M!=e.line||ge.from!=null&&M==r.line&&ge.from>=r.ch)&&(!R||R(ge.marker))&&L.push(ge.marker.parent||ge.marker)}++M}),L},getAllMarks:function(){var e=[];return this.iter(function(r){var R=r.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 r,R=this.first,L=this.lineSeparator().length;return this.iter(function(M){var G=M.text.length+L;if(G>e)return r=e,!0;e-=G,++R}),I(this,ct(R,r))},indexFromPos:function(e){e=I(this,e);var r=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){r+=L.text.length+R}),r},copy:function(e){var r=new Ti(fe(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return r.scrollTop=this.scrollTop,r.scrollLeft=this.scrollLeft,r.sel=this.sel,r.extend=!1,e&&(r.history.undoDepth=this.history.undoDepth,r.setHistory(this.getHistory())),r},linkedDoc:function(e){e||(e={});var r=this.first,R=this.first+this.size;e.from!=null&&e.from>r&&(r=e.from),e.to!=null&&e.to<R&&(R=e.to);var L=new Ti(fe(this,r,R),e.mode||this.modeOption,r,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}],wl(L,Ss(this)),L},unlinkDoc:function(e){if(e instanceof Nr&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r){var R=this.linked[r];if(R.doc!=e)continue;this.linked.splice(r,1),e.unlinkDoc(this),Cl(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=wa(this.history.done,L),e.history.undone=wa(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):st(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(r){return r.order=null}),this.cm&&pl(this.cm)})}),Ti.prototype.eachLine=Ti.prototype.iter;var ws=0;function Ol(e){var r=this;if(Cs(r),Ye(r,e)||kn(r.display,e))return;be(e),T&&(ws=+new Date);var R=In(r,e,!0),L=e.dataTransfer.files;if(!R||r.isReadOnly())return;if(L&&L.length&&window.FileReader&&window.File)for(var M=L.length,G=Array(M),le=0,pe=function(){++le==M&&ii(r,function(){R=I(r.doc,R);var ut={from:R,to:R,text:r.doc.splitLines(G.filter(function(Ct){return Ct!=null}).join(r.doc.lineSeparator())),origin:"paste"};Ta(r.doc,ut),us(r.doc,ua(I(r.doc,R),I(r.doc,ca(ut))))})()},ge=function(ut,Ct){if(r.options.allowDropFileTypes&&$(r.options.allowDropFileTypes,ut.type)==-1){pe();return}var Ut=new FileReader;Ut.onerror=function(){return pe()},Ut.onload=function(){var zt=Ut.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(zt)){pe();return}G[Ct]=zt,pe()},Ut.readAsText(ut)},Se=0;Se<L.length;Se++)ge(L[Se],Se);else{if(r.state.draggingText&&r.doc.sel.contains(R)>-1){r.state.draggingText(e),setTimeout(function(){return r.display.input.focus()},20);return}try{var Ge=e.dataTransfer.getData("Text");if(Ge){var Ze;if(r.state.draggingText&&!r.state.draggingText.copy&&(Ze=r.listSelections()),lo(r.doc,ua(R,R)),Ze)for(var pt=0;pt<Ze.length;++pt)Oa(r.doc,"",Ze[pt].anchor,Ze[pt].head,"drag");r.replaceSelection(Ge,"around","paste"),r.display.input.focus()}}catch(ut){}}}function Al(e,r){if(T&&(!e.state.draggingText||+new Date-ws<100)){Ce(r);return}if(Ye(e,r)||kn(e.display,r))return;if(r.dataTransfer.setData("Text",e.getSelection()),r.dataTransfer.effectAllowed="copyMove",r.dataTransfer.setDragImage&&!a){var R=x("img",null,null,"position: fixed; left: 0; top: 0;");R.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",l&&(R.width=R.height=1,e.display.wrapper.appendChild(R),R._top=R.offsetTop),r.dataTransfer.setDragImage(R,0,0),l&&R.parentNode.removeChild(R)}}function Ll(e,r){var R=In(e,r);if(!R)return;var L=document.createDocumentFragment();Zt(e,R,L),e.display.dragCursor||(e.display.dragCursor=x("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),o(e.display.dragCursor,L)}function Cs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ts(e){if(!document.getElementsByClassName)return;for(var r=document.getElementsByClassName("CodeMirror"),R=[],L=0;L<r.length;L++){var M=r[L].CodeMirror;M&&R.push(M)}R.length&&R[0].operation(function(){for(var G=0;G<R.length;G++)e(R[G])})}var Os=!1;function Rl(){if(Os)return;Dl(),Os=!0}function Dl(){var e;je(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ts(kl)},100))}),je(window,"blur",function(){return Ts(Hi)})}function kl(e){var r=e.display;r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.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=t?ra.macDefault:ra.pcDefault;function Pl(e){var r=e.split(/-(?!$)/);e=r[r.length-1];for(var R,L,M,G,le=0;le<r.length-1;le++){var pe=r[le];if(/^(cmd|meta|m)$/i.test(pe))G=!0;else if(/^a(lt)?$/i.test(pe))R=!0;else if(/^(c|ctrl|control)$/i.test(pe))L=!0;else if(/^s(hift)?$/i.test(pe))M=!0;else throw new Error("Unrecognized modifier name: "+pe)}return R&&(e="Alt-"+e),L&&(e="Ctrl-"+e),G&&(e="Cmd-"+e),M&&(e="Shift-"+e),e}function Ml(e){var r={};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=Ne(R.split(" "),Pl),G=0;G<M.length;G++){var le=void 0,pe=void 0;G==M.length-1?(pe=M.join(" "),le=L):(pe=M.slice(0,G+1).join(" "),le="...");var ge=r[pe];if(!ge)r[pe]=le;else if(ge!=le)throw new Error("Inconsistent bindings for "+pe)}delete e[R]}for(var Se in r)e[Se]=r[Se];return e}function La(e,r,R,L){r=fo(r);var M=r.call?r.call(e,L):r[e];if(M===!1)return"nothing";if(M==="...")return"multi";if(M!=null&&R(M))return"handled";if(r.fallthrough){if(Object.prototype.toString.call(r.fallthrough)!="[object Array]")return La(e,r.fallthrough,R,L);for(var G=0;G<r.fallthrough.length;G++){var le=La(e,r.fallthrough[G],R,L);if(le)return le}}}function As(e){var r=typeof e=="string"?e:fa[e.keyCode];return r=="Ctrl"||r=="Alt"||r=="Shift"||r=="Mod"}function Ls(e,r,R){var L=e;return r.altKey&&L!="Alt"&&(e="Alt-"+e),(b?r.metaKey:r.ctrlKey)&&L!="Ctrl"&&(e="Ctrl-"+e),(b?r.ctrlKey:r.metaKey)&&L!="Mod"&&(e="Cmd-"+e),!R&&r.shiftKey&&L!="Shift"&&(e="Shift-"+e),e}function Rs(e,r){if(l&&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,r))}function fo(e){return typeof e=="string"?ra[e]:e}function Ra(e,r){for(var R=e.doc.sel.ranges,L=[],M=0;M<R.length;M++){for(var G=r(R[M]);L.length&&kt(G.from,Ve(L).to)<=0;){var le=L.pop();if(kt(le.from,G.from)<0){G.from=le.from;break}}L.push(G)}ki(e,function(){for(var pe=L.length-1;pe>=0;pe--)Oa(e.doc,"",L[pe].from,L[pe].to,"+delete");Ir(e)})}function Ro(e,r,R){var L=U(e.text,r+R,R);return L<0||L>e.text.length?null:L}function Do(e,r,R){var L=Ro(e,r.ch,R);return L==null?null:new ct(r.line,L,R<0?"after":"before")}function ko(e,r,R,L,M){if(e){r.doc.direction=="rtl"&&(M=-M);var G=ht(R,r.doc.direction);if(G){var le=M<0?Ve(G):G[0],pe=M<0==(le.level==1),ge=pe?"after":"before",Se;if(le.level>0||r.doc.direction=="rtl"){var Ge=tr(r,R);Se=M<0?R.text.length-1:0;var Ze=or(r,Ge,Se).top;Se=q(function(pt){return or(r,Ge,pt).top==Ze},M<0==(le.level==1)?le.from:le.to-1,Se),ge=="before"&&(Se=Ro(R,Se,1))}else Se=M<0?le.to:le.from;return new ct(L,Se,ge)}}return new ct(L,M<0?R.text.length:0,M<0?"before":"after")}function Il(e,r,R,L){var M=ht(r,e.doc.direction);if(!M)return Do(r,R,L);R.ch>=r.text.length?(R.ch=r.text.length,R.sticky="before"):R.ch<=0&&(R.ch=0,R.sticky="after");var G=Ee(M,R.ch,R.sticky),le=M[G];if(e.doc.direction=="ltr"&&le.level%2==0&&(L>0?le.to>R.ch:le.from<R.ch))return Do(r,R,L);var pe=function(Jt,rn){return Ro(r,Jt instanceof ct?Jt.ch:Jt,rn)},ge,Se=function(Jt){return e.options.lineWrapping?(ge=ge||tr(e,r),Mi(e,r,ge,Jt)):{begin:0,end:r.text.length}},Ge=Se(R.sticky=="before"?pe(R,-1):R.ch);if(e.doc.direction=="rtl"||le.level==1){var Ze=le.level==1==L<0,pt=pe(R,Ze?1:-1);if(pt!=null&&(Ze?pt<=le.to&&pt<=Ge.end:pt>=le.from&&pt>=Ge.begin)){var ut=Ze?"before":"after";return new ct(R.line,pt,ut)}}var Ct=function(Jt,rn,qt){for(var sn=function(Rr,oi){return oi?new ct(R.line,pe(Rr,1),"before"):new ct(R.line,Rr,"after")};Jt>=0&&Jt<M.length;Jt+=rn){var An=M[Jt],_n=rn>0==(An.level!=1),Qn=_n?qt.begin:pe(qt.end,-1);if(An.from<=Qn&&Qn<An.to)return sn(Qn,_n);if(Qn=_n?An.from:pe(An.to,-1),qt.begin<=Qn&&Qn<qt.end)return sn(Qn,_n)}},Ut=Ct(G+L,L,Ge);if(Ut)return Ut;var zt=L>0?Ge.end:pe(Ge.begin,-1);return zt!=null&&!(L>0&&zt==r.text.length)&&(Ut=Ct(L>0?0:M.length-1,L,Se(zt)),Ut)?Ut:null}var qa={selectAll:ps,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),he)},killLine:function(e){return Ra(e,function(r){if(r.empty()){var R=Q(e.doc,r.head.line).text.length;return r.head.ch==R&&r.head.line<e.lastLine()?{from:r.head,to:ct(r.head.line+1,0)}:{from:r.head,to:ct(r.head.line,R)}}else return{from:r.from(),to:r.to()}})},deleteLine:function(e){return Ra(e,function(r){return{from:ct(r.from().line,0),to:I(e.doc,ct(r.to().line+1,0))}})},delLineLeft:function(e){return Ra(e,function(r){return{from:ct(r.from().line,0),to:r.from()}})},delWrappedLineLeft:function(e){return Ra(e,function(r){var R=e.charCoords(r.head,"div").top+5,L=e.coordsChar({left:0,top:R},"div");return{from:L,to:r.from()}})},delWrappedLineRight:function(e){return Ra(e,function(r){var R=e.charCoords(r.head,"div").top+5,L=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:R},"div");return{from:r.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(ct(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ct(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(r){return Ds(e,r.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(r){return ks(e,r.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(r){return Nl(e,r.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(r){var R=e.cursorCoords(r.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:R},"div")},we)},goLineLeft:function(e){return e.extendSelectionsBy(function(r){var R=e.cursorCoords(r.head,"div").top+5;return e.coordsChar({left:0,top:R},"div")},we)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(r){var R=e.cursorCoords(r.head,"div").top+5,L=e.coordsChar({left:0,top:R},"div");return L.ch<e.getLine(L.line).search(/\S/)?ks(e,r.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 r=[],R=e.listSelections(),L=e.options.tabSize,M=0;M<R.length;M++){var G=R[M].from(),le=V(e.getLine(G.line),G.ch,L);r.push(xe(L-le%L))}e.replaceSelections(r)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ki(e,function(){for(var r=e.listSelections(),R=[],L=0;L<r.length;L++){if(!r[L].empty())continue;var M=r[L].head,G=Q(e.doc,M.line).text;if(G){if(M.ch==G.length&&(M=new ct(M.line,M.ch-1)),M.ch>0)M=new ct(M.line,M.ch+1),e.replaceRange(G.charAt(M.ch-1)+G.charAt(M.ch-2),ct(M.line,M.ch-2),M,"+transpose");else if(M.line>e.doc.first){var le=Q(e.doc,M.line-1).text;le&&(M=new ct(M.line,1),e.replaceRange(G.charAt(0)+e.doc.lineSeparator()+le.charAt(le.length-1),ct(M.line-1,le.length-1),M,"+transpose"))}}R.push(new _r(M,M))}e.setSelections(R)})},newlineAndIndent:function(e){return ki(e,function(){for(var r=e.listSelections(),R=r.length-1;R>=0;R--)e.replaceRange(e.doc.lineSeparator(),r[R].anchor,r[R].head,"+input");r=e.listSelections();for(var L=0;L<r.length;L++)e.indentLine(r[L].from().line,null,!0);Ir(e)})},openLine:function(e){return e.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ds(e,r){var R=Q(e.doc,r),L=ni(R);return L!=R&&(r=Je(L)),ko(!0,e,L,r,1)}function Nl(e,r){var R=Q(e.doc,r),L=ji(R);return L!=R&&(r=Je(L)),ko(!0,e,R,r,-1)}function ks(e,r){var R=Ds(e,r.line),L=Q(e.doc,R.line),M=ht(L,e.doc.direction);if(!M||M[0].level==0){var G=Math.max(R.ch,L.text.search(/\S/)),le=r.line==R.line&&r.ch<=G&&r.ch;return ct(R.line,le?0:G,R.sticky)}return R}function po(e,r,R){if(typeof r=="string"&&(r=qa[r],!r))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=r(e)!=ue}finally{e.display.shift=L,e.state.suppressEdits=!1}return M}function Ul(e,r,R){for(var L=0;L<e.state.keyMaps.length;L++){var M=La(r,e.state.keyMaps[L],R,e);if(M)return M}return e.options.extraKeys&&La(r,e.options.extraKeys,R,e)||La(r,e.options.keyMap,R,e)}var jl=new ne;function Qa(e,r,R,L){var M=e.state.keySeq;if(M){if(As(r))return"handled";if(/\'$/.test(r)?e.state.keySeq=null:jl.set(50,function(){e.state.keySeq==M&&(e.state.keySeq=null,e.display.input.reset())}),Ps(e,M+" "+r,R,L))return!0}return Ps(e,r,R,L)}function Ps(e,r,R,L){var M=Ul(e,r,L);return M=="multi"&&(e.state.keySeq=r),M=="handled"&&Ft(e,"keyHandled",e,r,R),(M=="handled"||M=="multi")&&(be(R),Gr(e)),!!M}function Ms(e,r){var R=Rs(r,!0);return R?r.shiftKey&&!e.state.keySeq?Qa(e,"Shift-"+R,r,function(L){return po(e,L,!0)})||Qa(e,R,r,function(L){if(typeof L=="string"?/^go[A-Z]/.test(L):L.motion)return po(e,L)}):Qa(e,R,r,function(L){return po(e,L)}):!1}function Fl(e,r,R){return Qa(e,"'"+R+"'",r,function(L){return po(e,L,!0)})}var Po=null;function Is(e){var r=this;if(e.target&&e.target!=r.display.input.getField())return;if(r.curOp.focus=N(),Ye(r,e))return;T&&C<11&&e.keyCode==27&&(e.returnValue=!1);var R=e.keyCode;r.display.shift=R==16||e.shiftKey;var L=Ms(r,e);l&&(Po=L?R:null,!L&&R==88&&!lt&&(t?e.metaKey:e.ctrlKey)&&r.replaceSelection("",null,"cut")),j&&!t&&!L&&R==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),R==18&&!/\bCodeMirror-crosshair\b/.test(r.display.lineDiv.className)&&Bl(r)}function Bl(e){var r=e.display.lineDiv;W(r,"CodeMirror-crosshair");function R(L){(L.keyCode==18||!L.altKey)&&(y(r,"CodeMirror-crosshair"),dt(document,"keyup",R),dt(document,"mouseover",R))}je(document,"keyup",R),je(document,"mouseover",R)}function Ns(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ye(this,e)}function Us(e){var r=this;if(e.target&&e.target!=r.display.input.getField())return;if(kn(r.display,e)||Ye(r,e)||e.ctrlKey&&!e.altKey||t&&e.metaKey)return;var R=e.keyCode,L=e.charCode;if(l&&R==Po){Po=null,be(e);return}if(l&&(!e.which||e.which<10)&&Ms(r,e))return;var M=String.fromCharCode(L==null?R:L);if(M=="\b")return;if(Fl(r,e,M))return;r.display.input.onKeyPress(e)}var Wl=400,Mo=function(e,r,R){this.time=e,this.pos=r,this.button=R};Mo.prototype.compare=function(e,r,R){return this.time+Wl>e&&kt(r,this.pos)==0&&R==this.button};var Za,eo;function Hl(e,r){var R=+new Date;return eo&&eo.compare(R,e,r)?(Za=eo=null,"triple"):Za&&Za.compare(R,e,r)?(eo=new Mo(R,e,r),Za=null,"double"):(Za=new Mo(R,e,r),eo=null,"single")}function js(e){var r=this,R=r.display;if(Ye(r,e)||R.activeTouch&&R.input.supportsTouch())return;if(R.input.ensurePolled(),R.shift=e.shiftKey,kn(R,e)){h||(R.scroller.draggable=!1,setTimeout(function(){return R.scroller.draggable=!0},100));return}if(Io(r,e))return;var L=In(r,e),M=Qe(e),G=L?Hl(L,M):"single";if(window.focus(),M==1&&r.state.selectingText&&r.state.selectingText(e),L&&zl(r,M,L,G,e))return;M==1?L?Gl(r,L,G,e):et(e)==R.scroller&&be(e):M==2?(L&&so(r.doc,L),setTimeout(function(){return R.input.focus()},20)):M==3&&(_?r.display.input.onContextMenu(e):ga(r))}function zl(e,r,R,L,M){var G="Click";return L=="double"?G="Double"+G:L=="triple"&&(G="Triple"+G),G=(r==1?"Left":r==2?"Middle":"Right")+G,Qa(e,Ls(G,M),M,function(le){if(typeof le=="string"&&(le=qa[le]),!le)return!1;var pe=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),pe=le(e,R)!=ue}finally{e.state.suppressEdits=!1}return pe})}function Kl(e,r,R){var L=e.getOption("configureMouse"),M=L?L(e,r,R):{};if(M.unit==null){var G=d?R.shiftKey&&R.metaKey:R.altKey;M.unit=G?"rectangle":r=="single"?"char":r=="double"?"word":"line"}return(M.extend==null||e.doc.extend)&&(M.extend=e.doc.extend||R.shiftKey),M.addNew==null&&(M.addNew=t?R.metaKey:R.ctrlKey),M.moveOnDrag==null&&(M.moveOnDrag=!(t?R.altKey:R.ctrlKey)),M}function Gl(e,r,R,L){T?setTimeout(B(Vr,e),0):e.curOp.focus=N();var M=Kl(e,R,L),G=e.doc.sel,le;e.options.dragDrop&&yt&&!e.isReadOnly()&&R=="single"&&(le=G.contains(r))>-1&&(kt((le=G.ranges[le]).from(),r)<0||r.xRel>0)&&(kt(le.to(),r)>0||r.xRel<0)?Vl(e,L,r,M):Xl(e,L,r,M)}function Vl(e,r,R,L){var M=e.display,G=!1,le=ii(e,function(Se){h&&(M.scroller.draggable=!1),e.state.draggingText=!1,dt(M.wrapper.ownerDocument,"mouseup",le),dt(M.wrapper.ownerDocument,"mousemove",pe),dt(M.scroller,"dragstart",ge),dt(M.scroller,"drop",le),G||(be(Se),L.addNew||so(e.doc,R,null,null,L.extend),h&&!a||T&&C==9?setTimeout(function(){M.wrapper.ownerDocument.body.focus({preventScroll:!0}),M.input.focus()},20):M.input.focus())}),pe=function(Se){G=G||Math.abs(r.clientX-Se.clientX)+Math.abs(r.clientY-Se.clientY)>=10},ge=function(){return G=!0};h&&(M.scroller.draggable=!0),e.state.draggingText=le,le.copy=!L.moveOnDrag,M.scroller.dragDrop&&M.scroller.dragDrop(),je(M.wrapper.ownerDocument,"mouseup",le),je(M.wrapper.ownerDocument,"mousemove",pe),je(M.scroller,"dragstart",ge),je(M.scroller,"drop",le),ga(e),setTimeout(function(){return M.input.focus()},20)}function Fs(e,r,R){if(R=="char")return new _r(r,r);if(R=="word")return e.findWordAt(r);if(R=="line")return new _r(ct(r.line,0),I(e.doc,ct(r.line+1,0)));var L=R(e,r);return new _r(L.from,L.to)}function Xl(e,r,R,L){var M=e.display,G=e.doc;be(r);var le,pe,ge=G.sel,Se=ge.ranges;if(L.addNew&&!L.extend?(pe=G.sel.contains(R),pe>-1?le=Se[pe]:le=new _r(R,R)):(le=G.sel.primary(),pe=G.sel.primIndex),L.unit=="rectangle")L.addNew||(le=new _r(R,R)),R=In(e,r,!0,!0),pe=-1;else{var Ge=Fs(e,R,L.unit);L.extend?le=Ao(le,Ge.anchor,Ge.head,L.extend):le=Ge}L.addNew?pe==-1?(pe=Se.length,fi(G,Ji(e,Se.concat([le]),pe),{scroll:!1,origin:"*mouse"})):Se.length>1&&Se[pe].empty()&&L.unit=="char"&&!L.extend?(fi(G,Ji(e,Se.slice(0,pe).concat(Se.slice(pe+1)),0),{scroll:!1,origin:"*mouse"}),ge=G.sel):Lo(G,pe,le,Oe):(pe=0,fi(G,new Ui([le],0),Oe),ge=G.sel);var Ze=R;function pt(qt){if(kt(Ze,qt)==0)return;if(Ze=qt,L.unit=="rectangle"){for(var sn=[],An=e.options.tabSize,_n=V(Q(G,R.line).text,R.ch,An),Qn=V(Q(G,qt.line).text,qt.ch,An),Rr=Math.min(_n,Qn),oi=Math.max(_n,Qn),jr=Math.min(R.line,qt.line),Pi=Math.min(e.lastLine(),Math.max(R.line,qt.line));jr<=Pi;jr++){var Oi=Q(G,jr).text,qr=Pe(Oi,Rr,An);Rr==oi?sn.push(new _r(ct(jr,qr),ct(jr,qr))):Oi.length>qr&&sn.push(new _r(ct(jr,qr),ct(jr,Pe(Oi,oi,An))))}sn.length||sn.push(new _r(R,R)),fi(G,Ji(e,ge.ranges.slice(0,pe).concat(sn),pe),{origin:"*mouse",scroll:!1}),e.scrollIntoView(qt)}else{var Ai=le,hi=Fs(e,qt,L.unit),ti=Ai.anchor,Qr;kt(hi.anchor,ti)>0?(Qr=hi.head,ti=an(Ai.from(),hi.anchor)):(Qr=hi.anchor,ti=un(Ai.to(),hi.head));var Hr=ge.ranges.slice(0);Hr[pe]=Yl(e,new _r(I(G,ti),Qr)),fi(G,Ji(e,Hr,pe),Oe)}}var ut=M.wrapper.getBoundingClientRect(),Ct=0;function Ut(qt){var sn=++Ct,An=In(e,qt,!0,L.unit=="rectangle");if(!An)return;if(kt(An,Ze)!=0){e.curOp.focus=N(),pt(An);var _n=zi(M,G);(An.line>=_n.to||An.line<_n.from)&&setTimeout(ii(e,function(){Ct==sn&&Ut(qt)}),150)}else{var Qn=qt.clientY<ut.top?-20:qt.clientY>ut.bottom?20:0;Qn&&setTimeout(ii(e,function(){if(Ct!=sn)return;M.scroller.scrollTop+=Qn,Ut(qt)}),50)}}function zt(qt){e.state.selectingText=!1,Ct=Infinity,qt&&(be(qt),M.input.focus()),dt(M.wrapper.ownerDocument,"mousemove",Jt),dt(M.wrapper.ownerDocument,"mouseup",rn),G.history.lastSelOrigin=null}var Jt=ii(e,function(qt){qt.buttons===0||!Qe(qt)?zt(qt):Ut(qt)}),rn=ii(e,zt);e.state.selectingText=rn,je(M.wrapper.ownerDocument,"mousemove",Jt),je(M.wrapper.ownerDocument,"mouseup",rn)}function Yl(e,r){var R=r.anchor,L=r.head,M=Q(e.doc,R.line);if(kt(R,L)==0&&R.sticky==L.sticky)return r;var G=ht(M);if(!G)return r;var le=Ee(G,R.ch,R.sticky),pe=G[le];if(pe.from!=R.ch&&pe.to!=R.ch)return r;var ge=le+(pe.from==R.ch==(pe.level!=1)?0:1);if(ge==0||ge==G.length)return r;var Se;if(L.line!=R.line)Se=(L.line-R.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ge=Ee(G,L.ch,L.sticky),Ze=Ge-le||(L.ch-R.ch)*(pe.level==1?-1:1);Ge==ge-1||Ge==ge?Se=Ze<0:Se=Ze>0}var pt=G[ge+(Se?-1:0)],ut=Se==(pt.level==1),Ct=ut?pt.from:pt.to,Ut=ut?"after":"before";return R.ch==Ct&&R.sticky==Ut?r:new _r(new ct(R.line,Ct,Ut),L)}function Bs(e,r,R,L){var M,G;if(r.touches)M=r.touches[0].clientX,G=r.touches[0].clientY;else try{M=r.clientX,G=r.clientY}catch(pt){return!1}if(M>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;L&&be(r);var le=e.display,pe=le.lineDiv.getBoundingClientRect();if(G>pe.bottom||!Ie(e,R))return Le(r);G-=pe.top-le.viewOffset;for(var ge=0;ge<e.display.gutterSpecs.length;++ge){var Se=le.gutters.childNodes[ge];if(Se&&Se.getBoundingClientRect().right>=M){var Ge=at(e.doc,G),Ze=e.display.gutterSpecs[ge];return qe(e,R,e,Ge,Ze.className,r),Le(r)}}}function Io(e,r){return Bs(e,r,"gutterClick",!0)}function Ws(e,r){if(kn(e.display,r)||$l(e,r))return;if(Ye(e,r,"contextmenu"))return;_||e.display.input.onContextMenu(r)}function $l(e,r){return Ie(e,"gutterContextMenu")?Bs(e,r,"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-"),Qt(e)}var Da={toString:function(){return"CodeMirror.Init"}},zs={},mo={};function Jl(e){var r=e.optionHandlers;function R(L,M,G,le){e.defaults[L]=M,G&&(r[L]=le?function(pe,ge,Se){Se!=Da&&G(pe,ge,Se)}:G)}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,Co(L)},!0),R("indentUnit",2,Co,!0),R("indentWithTabs",!1),R("smartIndent",!0),R("tabSize",4,function(L){Ha(L),Qt(L),Ur(L)},!0),R("lineSeparator",null,function(L,M){if(L.doc.lineSep=M,!M)return;var G=[],le=L.doc.first;L.doc.iter(function(ge){for(var Se=0;;){var Ge=ge.text.indexOf(M,Se);if(Ge==-1)break;Se=Ge+M.length,G.push(ct(le,Ge))}le++});for(var pe=G.length-1;pe>=0;pe--)Oa(L.doc,M,G[pe],ct(G[pe].line,G[pe].ch+M.length))}),R("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(L,M,G){L.state.specialChars=new RegExp(M.source+(M.test(" ")?"":"| "),"g"),G!=Da&&L.refresh()}),R("specialCharPlaceholder",ur,function(L){return L.refresh()},!0),R("electricChars",!0),R("inputStyle",n?"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",!v),R("wholeLineUpdateBefore",!0),R("theme","default",function(L){Hs(L),Wa(L)},!0),R("keyMap","default",function(L,M,G){var le=fo(M),pe=G!=Da&&fo(G);pe&&pe.detach&&pe.detach(L,le),le.attach&&le.attach(L,pe||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,Cn,!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,Cn,!0),R("singleCursorHeightPerLine",!0,Cn,!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,r,R){var L=R&&R!=Da;if(!r!=!L){var M=e.display.dragFunctions,G=r?je:dt;G(e.display.scroller,"dragstart",M.start),G(e.display.scroller,"dragenter",M.enter),G(e.display.scroller,"dragover",M.over),G(e.display.scroller,"dragleave",M.leave),G(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),Qt(e),setTimeout(function(){return Sa(e)},100)}function Nr(e,r){var R=this;if(!(this instanceof Nr))return new Nr(e,r);this.options=r=r?X(r):{},X(zs,r,!1);var L=r.value;typeof L=="string"?L=new Ti(L,r.mode,null,r.lineSeparator,r.direction):r.mode&&(L.modeOption=r.mode),this.doc=L;var M=new Nr.inputStyles[r.inputStyle](this),G=this.display=new dl(e,L,M,r);G.wrapper.CodeMirror=this,Hs(this),r.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 ne,keySeq:null,specialChars:null},r.autofocus&&!n&&G.input.focus(),T&&C<11&&setTimeout(function(){return R.display.input.reset(!0)},20),Zl(this),Rl(),ba(this),this.curOp.forceUpdate=!0,ts(this,L),r.autofocus&&!n||this.hasFocus()?setTimeout(function(){R.hasFocus()&&!R.state.focused&&gn(R)},20):Hi(this);for(var le in mo)mo.hasOwnProperty(le)&&mo[le](this,r[le],Da);Yo(this),r.finishInit&&r.finishInit(this);for(var pe=0;pe<No.length;++pe)No[pe](this);_a(this),h&&r.lineWrapping&&getComputedStyle(G.lineDiv).textRendering=="optimizelegibility"&&(G.lineDiv.style.textRendering="auto")}Nr.defaults=zs,Nr.optionHandlers=mo;function Zl(e){var r=e.display;je(r.scroller,"mousedown",ii(e,js)),T&&C<11?je(r.scroller,"dblclick",ii(e,function(ge){if(Ye(e,ge))return;var Se=In(e,ge);if(!Se||Io(e,ge)||kn(e.display,ge))return;be(ge);var Ge=e.findWordAt(Se);so(e.doc,Ge.anchor,Ge.head)})):je(r.scroller,"dblclick",function(ge){return Ye(e,ge)||be(ge)}),je(r.scroller,"contextmenu",function(ge){return Ws(e,ge)}),je(r.input.getField(),"contextmenu",function(ge){r.scroller.contains(ge.target)||Ws(e,ge)});var R,L={end:0};function M(){r.activeTouch&&(R=setTimeout(function(){return r.activeTouch=null},1e3),L=r.activeTouch,L.end=+new Date)}function G(ge){if(ge.touches.length!=1)return!1;var Se=ge.touches[0];return Se.radiusX<=1&&Se.radiusY<=1}function le(ge,Se){if(Se.left==null)return!0;var Ge=Se.left-ge.left,Ze=Se.top-ge.top;return Ge*Ge+Ze*Ze>20*20}je(r.scroller,"touchstart",function(ge){if(!Ye(e,ge)&&!G(ge)&&!Io(e,ge)){r.input.ensurePolled(),clearTimeout(R);var Se=+new Date;r.activeTouch={start:Se,moved:!1,prev:Se-L.end<=300?L:null},ge.touches.length==1&&(r.activeTouch.left=ge.touches[0].pageX,r.activeTouch.top=ge.touches[0].pageY)}}),je(r.scroller,"touchmove",function(){r.activeTouch&&(r.activeTouch.moved=!0)}),je(r.scroller,"touchend",function(ge){var Se=r.activeTouch;if(Se&&!kn(r,ge)&&Se.left!=null&&!Se.moved&&new Date-Se.start<300){var Ge=e.coordsChar(r.activeTouch,"page"),Ze;!Se.prev||le(Se,Se.prev)?Ze=new _r(Ge,Ge):!Se.prev.prev||le(Se,Se.prev.prev)?Ze=e.findWordAt(Ge):Ze=new _r(ct(Ge.line,0),I(e.doc,ct(Ge.line+1,0))),e.setSelection(Ze.anchor,Ze.head),e.focus(),be(ge)}M()}),je(r.scroller,"touchcancel",M),je(r.scroller,"scroll",function(){r.scroller.clientHeight&&(Ua(e,r.scroller.scrollTop),va(e,r.scroller.scrollLeft,!0),qe(e,"scroll",e))}),je(r.scroller,"mousewheel",function(ge){return qo(e,ge)}),je(r.scroller,"DOMMouseScroll",function(ge){return qo(e,ge)}),je(r.wrapper,"scroll",function(){return r.wrapper.scrollTop=r.wrapper.scrollLeft=0}),r.dragFunctions={enter:function(ge){Ye(e,ge)||Ce(ge)},over:function(ge){Ye(e,ge)||(Ll(e,ge),Ce(ge))},start:function(ge){return Al(e,ge)},drop:ii(e,Ol),leave:function(ge){Ye(e,ge)||Cs(e)}};var pe=r.input.getField();je(pe,"keyup",function(ge){return Ns.call(e,ge)}),je(pe,"keydown",ii(e,Is)),je(pe,"keypress",ii(e,Us)),je(pe,"focus",function(ge){return gn(e,ge)}),je(pe,"blur",function(ge){return Hi(e,ge)})}var No=[];Nr.defineInitHook=function(e){return No.push(e)};function to(e,r,R,L){var M=e.doc,G;R==null&&(R="add"),R=="smart"&&(M.mode.indent?G=At(e,r).state:R="prev");var le=e.options.tabSize,pe=Q(M,r),ge=V(pe.text,null,le);pe.stateAfter&&(pe.stateAfter=null);var Se=pe.text.match(/^\s*/)[0],Ge;if(!L&&!/\S/.test(pe.text))Ge=0,R="not";else if(R=="smart"&&(Ge=M.mode.indent(G,pe.text.slice(Se.length),pe.text),Ge==ue||Ge>150)){if(!L)return;R="prev"}R=="prev"?r>M.first?Ge=V(Q(M,r-1).text,null,le):Ge=0:R=="add"?Ge=ge+e.options.indentUnit:R=="subtract"?Ge=ge-e.options.indentUnit:typeof R=="number"&&(Ge=ge+R),Ge=Math.max(0,Ge);var Ze="",pt=0;if(e.options.indentWithTabs)for(var ut=Math.floor(Ge/le);ut;--ut)pt+=le,Ze+=" ";if(pt<Ge&&(Ze+=xe(Ge-pt)),Ze!=Se)return Oa(M,Ze,ct(r,0),ct(r,Se.length),"+input"),pe.stateAfter=null,!0;for(var Ct=0;Ct<M.sel.ranges.length;Ct++){var Ut=M.sel.ranges[Ct];if(Ut.head.line==r&&Ut.head.ch<Se.length){var zt=ct(r,Se.length);Lo(M,Ct,new _r(zt,zt));break}}}var qi=null;function go(e){qi=e}function Uo(e,r,R,L,M){var G=e.doc;e.display.shift=!1,L||(L=G.sel);var le=+new Date-200,pe=M=="paste"||e.state.pasteIncoming>le,ge=st(r),Se=null;if(pe&&L.ranges.length>1)if(qi&&qi.text.join(`
|
|
|
`)==r){if(L.ranges.length%qi.text.length==0){Se=[];for(var Ge=0;Ge<qi.text.length;Ge++)Se.push(G.splitLines(qi.text[Ge]))}}else ge.length==L.ranges.length&&e.options.pasteLinesPerSelection&&(Se=Ne(ge,function(Jt){return[Jt]}));for(var Ze=e.curOp.updateInput,pt=L.ranges.length-1;pt>=0;pt--){var ut=L.ranges[pt],Ct=ut.from(),Ut=ut.to();ut.empty()&&(R&&R>0?Ct=ct(Ct.line,Ct.ch-R):e.state.overwrite&&!pe?Ut=ct(Ut.line,Math.min(Q(G,Ut.line).text.length,Ut.ch+Ve(ge).length)):pe&&qi&&qi.lineWise&&qi.text.join(`
|
|
|
`)==ge.join(`
|
|
|
`)&&(Ct=Ut=ct(Ct.line,0)));var zt={from:Ct,to:Ut,text:Se?Se[pt%Se.length]:ge,origin:M||(pe?"paste":e.state.cutIncoming>le?"cut":"+input")};Ta(e.doc,zt),Ft(e,"inputRead",e,zt)}r&&!pe&&Gs(e,r),Ir(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ze),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ks(e,r){var R=e.clipboardData&&e.clipboardData.getData("Text");if(R)return e.preventDefault(),!r.isReadOnly()&&!r.options.disableInput&&ki(r,function(){return Uo(r,R,0,null,"paste")}),!0}function Gs(e,r){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 G=e.getModeAt(M.head),le=!1;if(G.electricChars){for(var pe=0;pe<G.electricChars.length;pe++)if(r.indexOf(G.electricChars.charAt(pe))>-1){le=to(e,M.head.line,"smart");break}}else G.electricInput&&(G.electricInput.test(Q(e.doc,M.head.line).text.slice(0,M.head.ch))&&(le=to(e,M.head.line,"smart")));le&&Ft(e,"electricInput",e,M.head.line)}}function Vs(e){for(var r=[],R=[],L=0;L<e.doc.sel.ranges.length;L++){var M=e.doc.sel.ranges[L].head.line,G={anchor:ct(M,0),head:ct(M+1,0)};R.push(G),r.push(e.getRange(G.anchor,G.head))}return{text:r,ranges:R}}function Xs(e,r,R,L){e.setAttribute("autocorrect",R?"":"off"),e.setAttribute("autocapitalize",L?"":"off"),e.setAttribute("spellcheck",!!r)}function Ys(){var e=x("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),r=x("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return h?e.style.width="1000px":e.setAttribute("wrap","off"),f&&(e.style.border="1px solid black"),Xs(e),r}function eu(e){var r=e.optionHandlers,R=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(L,M){var G=this.options,le=G[L];if(G[L]==M&&L!="mode")return;G[L]=M,r.hasOwnProperty(L)&&ii(this,r[L])(this,M,le),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,G=0;G<M.length;++G)if(M[G]==L||M[G].name==L)return M.splice(G,1),!0},addOverlay:_i(function(L,M){var G=L.token?L:e.getMode(this.options,L);if(G.startState)throw new Error("Overlays may not be stateful.");Be(this.state.overlays,{mode:G,modeSpec:L,opaque:M&&M.opaque,priority:M&&M.priority||0},function(le){return le.priority}),this.state.modeGen++,Ur(this)}),removeOverlay:_i(function(L){for(var M=this.state.overlays,G=0;G<M.length;++G){var le=M[G].modeSpec;if(le==L||typeof L=="string"&&le.name==L){M.splice(G,1),this.state.modeGen++,Ur(this);return}}}),indentLine:_i(function(L,M,G){typeof M!="string"&&typeof M!="number"&&(M==null?M=this.options.smartIndent?"smart":"prev":M=M?"add":"subtract"),Lt(this.doc,L)&&to(this,L,M,G)}),indentSelection:_i(function(L){for(var M=this.doc.sel.ranges,G=-1,le=0;le<M.length;le++){var pe=M[le];if(pe.empty())pe.head.line>G&&(to(this,pe.head.line,L,!0),G=pe.head.line,le==this.doc.sel.primIndex&&Ir(this));else{var ge=pe.from(),Se=pe.to(),Ge=Math.max(G,ge.line);G=Math.min(this.lastLine(),Se.line-(Se.ch?0:1))+1;for(var Ze=Ge;Ze<G;++Ze)to(this,Ze,L);var pt=this.doc.sel.ranges;ge.ch==0&&M.length==pt.length&&pt[le].from().ch>0&&Lo(this.doc,le,new _r(ge,pt[le].to()),he)}}}),getTokenAt:function(L,M){return jn(this,L,M)},getLineTokens:function(L,M){return jn(this,ct(L),M,!0)},getTokenTypeAt:function(L){L=I(this.doc,L);var M=_t(this,Q(this.doc,L.line)),G=0,le=(M.length-1)/2,pe=L.ch,ge;if(pe==0)ge=M[2];else for(;;){var Se=G+le>>1;if((Se?M[Se*2-1]:0)>=pe)le=Se;else if(M[Se*2+1]<pe)G=Se+1;else{ge=M[Se*2+2];break}}var Ge=ge?ge.indexOf("overlay "):-1;return Ge<0?ge:Ge==0?null:ge.slice(0,Ge-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 G=[];if(!R.hasOwnProperty(M))return G;var le=R[M],pe=this.getModeAt(L);if(typeof pe[M]=="string")le[pe[M]]&&G.push(le[pe[M]]);else if(pe[M])for(var ge=0;ge<pe[M].length;ge++){var Se=le[pe[M][ge]];Se&&G.push(Se)}else pe.helperType&&le[pe.helperType]?G.push(le[pe.helperType]):le[pe.name]&&G.push(le[pe.name]);for(var Ge=0;Ge<le._global.length;Ge++){var Ze=le._global[Ge];Ze.pred(pe,this)&&$(G,Ze.val)==-1&&G.push(Ze.val)}return G},getStateAfter:function(L,M){var G=this.doc;return L=re(G,L==null?G.first+G.size-1:L),At(this,L+1,M).state},cursorCoords:function(L,M){var G,le=this.doc.sel.primary();return L==null?G=le.head:typeof L=="object"?G=I(this.doc,L):G=L?le.from():le.to(),Vn(this,G,M||"page")},charCoords:function(L,M){return Tn(this,I(this.doc,L),M||"page")},coordsChar:function(L,M){return L=Mn(this,L,M||"page"),Pr(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,G){var le=!1,pe;if(typeof L=="number"){var ge=this.doc.first+this.doc.size-1;L<this.doc.first?L=this.doc.first:L>ge&&(L=ge,le=!0),pe=Q(this.doc,L)}else pe=L;return bn(this,pe,{top:0,left:0},M||"page",G||le).top+(le?this.doc.height-wi(pe):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,G,le,pe){var ge=this.display;L=Vn(this,I(this.doc,L));var Se=L.bottom,Ge=L.left;if(M.style.position="absolute",M.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(M),ge.sizer.appendChild(M),le=="over")Se=L.top;else if(le=="above"||le=="near"){var Ze=Math.max(ge.wrapper.clientHeight,this.doc.height),pt=Math.max(ge.sizer.clientWidth,ge.lineSpace.clientWidth);(le=="above"||L.bottom+M.offsetHeight>Ze)&&L.top>M.offsetHeight?Se=L.top-M.offsetHeight:L.bottom+M.offsetHeight<=Ze&&(Se=L.bottom),Ge+M.offsetWidth>pt&&(Ge=pt-M.offsetWidth)}M.style.top=Se+"px",M.style.left=M.style.right="",pe=="right"?(Ge=ge.sizer.clientWidth-M.offsetWidth,M.style.right="0px"):(pe=="left"?Ge=0:pe=="middle"&&(Ge=(ge.sizer.clientWidth-M.offsetWidth)/2),M.style.left=Ge+"px"),G&&la(this,{left:Ge,top:Se,right:Ge+M.offsetWidth,bottom:Se+M.offsetHeight})},triggerOnKeyDown:_i(Is),triggerOnKeyPress:_i(Us),triggerOnKeyUp:Ns,triggerOnMouseDown:_i(js),execCommand:function(L){if(qa.hasOwnProperty(L))return qa[L].call(null,this)},triggerElectric:_i(function(L){Gs(this,L)}),findPosH:function(L,M,G,le){var pe=1;M<0&&(pe=-1,M=-M);for(var ge=I(this.doc,L),Se=0;Se<M&&!(ge=jo(this.doc,ge,pe,G,le),ge.hitSide);++Se);return ge},moveH:_i(function(L,M){var G=this;this.extendSelectionsBy(function(le){return G.display.shift||G.doc.extend||le.empty()?jo(G.doc,le.head,L,M,G.options.rtlMoveVisually):L<0?le.from():le.to()},we)}),deleteH:_i(function(L,M){var G=this.doc.sel,le=this.doc;G.somethingSelected()?le.replaceSelection("",null,"+delete"):Ra(this,function(pe){var ge=jo(le,pe.head,L,M,!1);return L<0?{from:ge,to:pe.head}:{from:pe.head,to:ge}})}),findPosV:function(L,M,G,le){var pe=1,ge=le;M<0&&(pe=-1,M=-M);for(var Se=I(this.doc,L),Ge=0;Ge<M;++Ge){var Ze=Vn(this,Se,"div");if(ge==null?ge=Ze.left:Ze.left=ge,Se=$s(this,Ze,pe,G),Se.hitSide)break}return Se},moveV:_i(function(L,M){var G=this,le=this.doc,pe=[],ge=!this.display.shift&&!le.extend&&le.sel.somethingSelected();if(le.extendSelectionsBy(function(Ge){if(ge)return L<0?Ge.from():Ge.to();var Ze=Vn(G,Ge.head,"div");Ge.goalColumn!=null&&(Ze.left=Ge.goalColumn),pe.push(Ze.left);var pt=$s(G,Ze,L,M);return M=="page"&&Ge==le.sel.primary()&&Ia(G,Tn(G,pt,"div").top-Ze.top),pt},we),pe.length)for(var Se=0;Se<le.sel.ranges.length;Se++)le.sel.ranges[Se].goalColumn=pe[Se]}),findWordAt:function(L){var M=this.doc,G=Q(M,L.line).text,le=L.ch,pe=L.ch;if(G){var ge=this.getHelper(L,"wordChars");(L.sticky=="before"||pe==G.length)&&le?--le:++pe;for(var Se=G.charAt(le),Ge=He(Se,ge)?function(Ze){return He(Ze,ge)}:/\s/.test(Se)?function(Ze){return/\s/.test(Ze)}:function(Ze){return!/\s/.test(Ze)&&!He(Ze)};le>0&&Ge(G.charAt(le-1));)--le;for(;pe<G.length&&Ge(G.charAt(pe));)++pe}return new _r(ct(L.line,le),ct(L.line,pe))},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()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:_i(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:gr(this)}},scrollIntoView:_i(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:ct(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:_i(function(L,M){var G=this,le=function(ge){return typeof ge=="number"||/^\d+$/.test(String(ge))?ge+"px":ge};L!=null&&(this.display.wrapper.style.width=le(L)),M!=null&&(this.display.wrapper.style.height=le(M)),this.options.lineWrapping&&Yt(this);var pe=this.display.viewFrom;this.doc.iter(pe,this.display.viewTo,function(ge){if(ge.widgets){for(var Se=0;Se<ge.widgets.length;Se++)if(ge.widgets[Se].noHScroll){Jr(G,pe,"widget");break}}++pe}),this.curOp.forceUpdate=!0,qe(this,"refresh",this)}),operation:function(L){return ki(this,L)},startOperation:function(){return ba(this)},endOperation:function(){return _a(this)},refresh:_i(function(){var L=this.display.cachedTextHeight;Ur(this),this.curOp.forceUpdate=!0,Qt(this),Na(this,this.doc.scrollLeft,this.doc.scrollTop),Eo(this.display),(L==null||Math.abs(L-Vi(this.display))>.5||this.options.lineWrapping)&&Wr(this),qe(this,"refresh",this)}),swapDoc:_i(function(L){var M=this.doc;return M.cm=null,this.state.selectingText&&this.state.selectingText(),ts(this,L),Qt(this),this.display.input.reset(),Na(this,L.scrollLeft,L.scrollTop),this.curOp.forceScroll=!0,Ft(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}},Me(e),e.registerHelper=function(L,M,G){R.hasOwnProperty(L)||(R[L]=e[L]={_global:[]}),R[L][M]=G},e.registerGlobalHelper=function(L,M,G,le){e.registerHelper(L,M,le),R[L]._global.push({pred:G,val:le})}}function jo(e,r,R,L,M){var G=r,le=R,pe=Q(e,r.line),ge=M&&e.direction=="rtl"?-R:R;function Se(){var rn=r.line+ge;return rn<e.first||rn>=e.first+e.size?!1:(r=new ct(rn,r.ch,r.sticky),pe=Q(e,rn))}function Ge(rn){var qt;if(L=="codepoint"){var sn=pe.text.charCodeAt(r.ch+(L>0?0:-1));isNaN(sn)?qt=null:qt=new ct(r.line,Math.max(0,Math.min(pe.text.length,r.ch+R*(sn>=55296&&sn<56320?2:1))),-R)}else M?qt=Il(e.cm,pe,r,R):qt=Do(pe,r,R);if(qt==null)if(!rn&&Se())r=ko(M,e.cm,pe,r.line,ge);else return!1;else r=qt;return!0}if(L=="char"||L=="codepoint")Ge();else if(L=="column")Ge(!0);else if(L=="word"||L=="group")for(var Ze=null,pt=L=="group",ut=e.cm&&e.cm.getHelper(r,"wordChars"),Ct=!0;!(R<0&&!Ge(!Ct));Ct=!1){var Ut=pe.text.charAt(r.ch)||`
|
|
|
`,zt=He(Ut,ut)?"w":pt&&Ut==`
|
|
|
`?"n":!pt||/\s/.test(Ut)?null:"p";if(pt&&!Ct&&!zt&&(zt="s"),Ze&&Ze!=zt){R<0&&(R=1,Ge(),r.sticky="after");break}if(zt&&(Ze=zt),R>0&&!Ge(!Ct))break}var Jt=uo(e,r,G,le,!0);return nn(G,Jt)&&(Jt.hitSide=!0),Jt}function $s(e,r,R,L){var M=e.doc,G=r.left,le;if(L=="page"){var pe=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ge=Math.max(pe-.5*Vi(e.display),3);le=(R>0?r.bottom:r.top)+R*ge}else L=="line"&&(le=R>0?r.bottom+3:r.top-3);for(var Se;!(Se=Pr(e,G,le),!Se.outside);){if(R<0?le<=0:le>=M.height){Se.hitSide=!0;break}le+=R*5}return Se}var Sr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ne,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Sr.prototype.init=function(e){var r=this,R=this,L=R.cm,M=R.div=e.lineDiv;Xs(M,L.options.spellcheck,L.options.autocorrect,L.options.autocapitalize);function G(pe){for(var ge=pe.target;ge;ge=ge.parentNode){if(ge==M)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ge.className))break}return!1}je(M,"paste",function(pe){if(!G(pe)||Ye(L,pe)||Ks(pe,L))return;C<=11&&setTimeout(ii(L,function(){return r.updateFromDOM()}),20)}),je(M,"compositionstart",function(pe){r.composing={data:pe.data,done:!1}}),je(M,"compositionupdate",function(pe){r.composing||(r.composing={data:pe.data,done:!1})}),je(M,"compositionend",function(pe){r.composing&&(pe.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),je(M,"touchstart",function(){return R.forceCompositionEnd()}),je(M,"input",function(){r.composing||r.readFromDOMSoon()});function le(pe){if(!G(pe)||Ye(L,pe))return;if(L.somethingSelected())go({lineWise:!1,text:L.getSelections()}),pe.type=="cut"&&L.replaceSelection("",null,"cut");else if(L.options.lineWiseCopyCut){var ge=Vs(L);go({lineWise:!0,text:ge.text}),pe.type=="cut"&&L.operation(function(){L.setSelections(ge.ranges,0,he),L.replaceSelection("",null,"cut")})}else return;if(pe.clipboardData){pe.clipboardData.clearData();var Se=qi.text.join(`
|
|
|
`);if(pe.clipboardData.setData("Text",Se),pe.clipboardData.getData("Text")==Se){pe.preventDefault();return}}var Ge=Ys(),Ze=Ge.firstChild;L.display.lineSpace.insertBefore(Ge,L.display.lineSpace.firstChild),Ze.value=qi.text.join(`
|
|
|
`);var pt=document.activeElement;oe(Ze),setTimeout(function(){L.display.lineSpace.removeChild(Ge),pt.focus(),pt==M&&R.showPrimarySelection()},50)}je(M,"copy",le),je(M,"cut",le)},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,r){if(!e||!this.cm.display.view.length)return;(e.focus||r)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Sr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Sr.prototype.showPrimarySelection=function(){var e=this.getSelection(),r=this.cm,R=r.doc.sel.primary(),L=R.from(),M=R.to();if(r.display.viewTo==r.display.viewFrom||L.line>=r.display.viewTo||M.line<r.display.viewFrom){e.removeAllRanges();return}var G=vo(r,e.anchorNode,e.anchorOffset),le=vo(r,e.focusNode,e.focusOffset);if(G&&!G.bad&&le&&!le.bad&&kt(an(G,le),L)==0&&kt(un(G,le),M)==0)return;var pe=r.display.view,ge=L.line>=r.display.viewFrom&&Js(r,L)||{node:pe[0].measure.map[2],offset:0},Se=M.line<r.display.viewTo&&Js(r,M);if(!Se){var Ge=pe[pe.length-1].measure,Ze=Ge.maps?Ge.maps[Ge.maps.length-1]:Ge.map;Se={node:Ze[Ze.length-1],offset:Ze[Ze.length-2]-Ze[Ze.length-3]}}if(!ge||!Se){e.removeAllRanges();return}var pt=e.rangeCount&&e.getRangeAt(0),ut;try{ut=O(ge.node,ge.offset,Se.offset,Se.node)}catch(Ct){}ut&&(!j&&r.state.focused?(e.collapse(ge.node,ge.offset),ut.collapsed||(e.removeAllRanges(),e.addRange(ut))):(e.removeAllRanges(),e.addRange(ut)),pt&&e.anchorNode==null?e.addRange(pt):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){o(this.cm.display.cursorDiv,e.cursors),o(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 r=e.getRangeAt(0).commonAncestorContainer;return D(this.div,r)},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():ki(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function r(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,r))}this.polling.set(this.cm.options.pollInterval,r)},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(),r=this.cm;if(i&&c&&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=vo(r,e.anchorNode,e.anchorOffset),L=vo(r,e.focusNode,e.focusOffset);R&&L&&ki(r,function(){fi(r.doc,ua(R,L),he),(R.bad||L.bad)&&(r.curOp.selectionChanged=!0)})},Sr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,r=e.display,R=e.doc.sel.primary(),L=R.from(),M=R.to();if(L.ch==0&&L.line>e.firstLine()&&(L=ct(L.line-1,Q(e.doc,L.line-1).length)),M.ch==Q(e.doc,M.line).text.length&&M.line<e.lastLine()&&(M=ct(M.line+1,0)),L.line<r.viewFrom||M.line>r.viewTo-1)return!1;var G,le,pe;L.line==r.viewFrom||(G=ri(e,L.line))==0?(le=Je(r.view[0].line),pe=r.view[0].node):(le=Je(r.view[G].line),pe=r.view[G-1].node.nextSibling);var ge=ri(e,M.line),Se,Ge;if(ge==r.view.length-1?(Se=r.viewTo-1,Ge=r.lineDiv.lastChild):(Se=Je(r.view[ge+1].line)-1,Ge=r.view[ge+1].node.previousSibling),!pe)return!1;for(var Ze=e.doc.splitLines(nu(e,pe,Ge,le,Se)),pt=ae(e.doc,ct(le,0),ct(Se,Q(e.doc,Se).text.length));Ze.length>1&&pt.length>1;)if(Ve(Ze)==Ve(pt))Ze.pop(),pt.pop(),Se--;else if(Ze[0]==pt[0])Ze.shift(),pt.shift(),le++;else break;for(var ut=0,Ct=0,Ut=Ze[0],zt=pt[0],Jt=Math.min(Ut.length,zt.length);ut<Jt&&Ut.charCodeAt(ut)==zt.charCodeAt(ut);)++ut;for(var rn=Ve(Ze),qt=Ve(pt),sn=Math.min(rn.length-(Ze.length==1?ut:0),qt.length-(pt.length==1?ut:0));Ct<sn&&rn.charCodeAt(rn.length-Ct-1)==qt.charCodeAt(qt.length-Ct-1);)++Ct;if(Ze.length==1&&pt.length==1&&le==L.line)for(;ut&&ut>L.ch&&rn.charCodeAt(rn.length-Ct-1)==qt.charCodeAt(qt.length-Ct-1);)ut--,Ct++;Ze[Ze.length-1]=rn.slice(0,rn.length-Ct).replace(/^\u200b+/,""),Ze[0]=Ze[0].slice(ut).replace(/\u200b+$/,"");var An=ct(le,ut),_n=ct(Se,pt.length?Ve(pt).length-Ct:0);if(Ze.length>1||Ze[0]||kt(An,_n))return Oa(e.doc,Ze,An,_n,"+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())&&ki(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,r){var R=vn(e,r.line);if(!R||R.hidden)return null;var L=Q(e.doc,r.line),M=fr(R,L,r.line),G=ht(L,e.doc.direction),le="left";if(G){var pe=Ee(G,r.ch);le=pe%2?"right":"left"}var ge=Jn(M.map,r.ch,le);return ge.offset=ge.collapse=="right"?ge.end:ge.start,ge}function tu(e){for(var r=e;r;r=r.parentNode)if(/CodeMirror-gutter-wrapper/.test(r.className))return!0;return!1}function ka(e,r){return r&&(e.bad=!0),e}function nu(e,r,R,L,M){var G="",le=!1,pe=e.doc.lineSeparator(),ge=!1;function Se(ut){return function(Ct){return Ct.id==ut}}function Ge(){le&&(G+=pe,ge&&(G+=pe),le=ge=!1)}function Ze(ut){ut&&(Ge(),G+=ut)}function pt(ut){if(ut.nodeType==1){var Ct=ut.getAttribute("cm-text");if(Ct){Ze(Ct);return}var Ut=ut.getAttribute("cm-marker"),zt;if(Ut){var Jt=e.findMarks(ct(L,0),ct(M+1,0),Se(+Ut));Jt.length&&(zt=Jt[0].find(0))&&Ze(ae(e.doc,zt.from,zt.to).join(pe));return}if(ut.getAttribute("contenteditable")=="false")return;var rn=/^(pre|div|p|li|table|br)$/i.test(ut.nodeName);if(!/^br$/i.test(ut.nodeName)&&ut.textContent.length==0)return;rn&&Ge();for(var qt=0;qt<ut.childNodes.length;qt++)pt(ut.childNodes[qt]);/^(pre|p)$/i.test(ut.nodeName)&&(ge=!0),rn&&(le=!0)}else ut.nodeType==3&&Ze(ut.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(pt(r),r==R);)r=r.nextSibling,ge=!1;return G}function vo(e,r,R){var L;if(r==e.display.lineDiv){if(L=e.display.lineDiv.childNodes[R],!L)return ka(e.clipPos(ct(e.display.viewTo-1)),!0);r=null,R=0}else for(L=r;;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 G=e.display.view[M];if(G.node==L)return ru(G,r,R)}}function ru(e,r,R){var L=e.text.firstChild,M=!1;if(!r||!D(L,r))return ka(ct(Je(e.line),0),!0);if(r==L&&(M=!0,r=L.childNodes[R],R=0,!r)){var G=e.rest?Ve(e.rest):e.line;return ka(ct(Je(G),G.text.length),M)}var le=r.nodeType==3?r:null,pe=r;for(!le&&r.childNodes.length==1&&r.firstChild.nodeType==3&&(le=r.firstChild,R&&(R=le.nodeValue.length));pe.parentNode!=L;)pe=pe.parentNode;var ge=e.measure,Se=ge.maps;function Ge(zt,Jt,rn){for(var qt=-1;qt<(Se?Se.length:0);qt++)for(var sn=qt<0?ge.map:Se[qt],An=0;An<sn.length;An+=3){var _n=sn[An+2];if(_n==zt||_n==Jt){var Qn=Je(qt<0?e.line:e.rest[qt]),Rr=sn[An]+rn;return(rn<0||_n!=zt)&&(Rr=sn[An+(rn?1:0)]),ct(Qn,Rr)}}}var Ze=Ge(le,pe,R);if(Ze)return ka(Ze,M);for(var pt=pe.nextSibling,ut=le?le.nodeValue.length-R:0;pt;pt=pt.nextSibling){if(Ze=Ge(pt,pt.firstChild,0),Ze)return ka(ct(Ze.line,Ze.ch-ut),M);ut+=pt.textContent.length}for(var Ct=pe.previousSibling,Ut=R;Ct;Ct=Ct.previousSibling){if(Ze=Ge(Ct,Ct.firstChild,-1),Ze)return ka(ct(Ze.line,Ze.ch+Ut),M);Ut+=Ct.textContent.length}}var Xr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ne,this.hasSelection=!1,this.composing=null};Xr.prototype.init=function(e){var r=this,R=this,L=this.cm;this.createField(e);var M=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(M.style.width="0px"),je(M,"input",function(){T&&C>=9&&r.hasSelection&&(r.hasSelection=null),R.poll()}),je(M,"paste",function(le){if(Ye(L,le)||Ks(le,L))return;L.state.pasteIncoming=+new Date,R.fastPoll()});function G(le){if(Ye(L,le))return;if(L.somethingSelected())go({lineWise:!1,text:L.getSelections()});else if(L.options.lineWiseCopyCut){var pe=Vs(L);go({lineWise:!0,text:pe.text}),le.type=="cut"?L.setSelections(pe.ranges,null,he):(R.prevInput="",M.value=pe.text.join(`
|
|
|
`),oe(M))}else return;le.type=="cut"&&(L.state.cutIncoming=+new Date)}je(M,"cut",G),je(M,"copy",G),je(e.scroller,"paste",function(le){if(kn(e,le)||Ye(L,le))return;if(!M.dispatchEvent){L.state.pasteIncoming=+new Date,R.focus();return}var pe=new Event("paste");pe.clipboardData=le.clipboardData,M.dispatchEvent(pe)}),je(e.lineSpace,"selectstart",function(le){kn(e,le)||be(le)}),je(M,"compositionstart",function(){var le=L.getCursor("from");R.composing&&R.composing.range.clear(),R.composing={start:le,range:L.markText(le,L.getCursor("to"),{className:"CodeMirror-composing"})}}),je(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,r=e.display,R=e.doc,L=Yn(e);if(e.options.moveInputWithCursor){var M=Vn(e,R.sel.primary().head,"div"),G=r.wrapper.getBoundingClientRect(),le=r.lineDiv.getBoundingClientRect();L.teTop=Math.max(0,Math.min(r.wrapper.clientHeight-10,M.top+le.top-G.top)),L.teLeft=Math.max(0,Math.min(r.wrapper.clientWidth-10,M.left+le.left-G.left))}return L},Xr.prototype.showSelection=function(e){var r=this.cm,R=r.display;o(R.cursorDiv,e.cursors),o(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 r=this.cm;if(r.somethingSelected()){this.prevInput="";var R=r.getSelection();this.textarea.value=R,r.state.focused&&oe(this.textarea),T&&C>=9&&(this.hasSelection=R)}else e||(this.prevInput=this.textarea.value="",T&&C>=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"&&(!n||N()!=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,r=this;r.pollingFast=!0;function R(){var L=r.poll();!L&&!e?(e=!0,r.polling.set(60,R)):(r.pollingFast=!1,r.slowPoll())}r.polling.set(20,R)},Xr.prototype.poll=function(){var e=this,r=this.cm,R=this.textarea,L=this.prevInput;if(this.contextMenuPending||!r.state.focused||mt(R)&&!L&&!this.composing||r.isReadOnly()||r.options.disableInput||r.state.keySeq)return!1;var M=R.value;if(M==L&&!r.somethingSelected())return!1;if(T&&C>=9&&this.hasSelection===M||t&&/[\uf700-\uf7ff]/.test(M))return r.display.input.reset(),!1;if(r.doc.sel==r.display.selForContextMenu){var G=M.charCodeAt(0);if(G==8203&&!L&&(L="\u200B"),G==8666)return this.reset(),this.cm.execCommand("undo")}for(var le=0,pe=Math.min(L.length,M.length);le<pe&&L.charCodeAt(le)==M.charCodeAt(le);)++le;return ki(r,function(){Uo(r,M.slice(le),L.length-le,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=r.markText(e.composing.start,r.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Xr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Xr.prototype.onKeyPress=function(){T&&C>=9&&(this.hasSelection=null),this.fastPoll()},Xr.prototype.onContextMenu=function(e){var r=this,R=r.cm,L=R.display,M=r.textarea;r.contextMenuPending&&r.contextMenuPending();var G=In(R,e),le=L.scroller.scrollTop;if(!G||l)return;var pe=R.options.resetSelectionOnContextMenu;pe&&R.doc.sel.contains(G)==-1&&ii(R,fi)(R.doc,ua(G),he);var ge=M.style.cssText,Se=r.wrapper.style.cssText,Ge=r.wrapper.offsetParent.getBoundingClientRect();r.wrapper.style.cssText="position: static",M.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
top: `+(e.clientY-Ge.top-5)+"px; left: "+(e.clientX-Ge.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 Ze;h&&(Ze=window.scrollY),L.input.focus(),h&&window.scrollTo(null,Ze),L.input.reset(),R.somethingSelected()||(M.value=r.prevInput=" "),r.contextMenuPending=ut,L.selForContextMenu=R.doc.sel,clearTimeout(L.detectingSelectAll);function pt(){if(M.selectionStart!=null){var Ut=R.somethingSelected(),zt="\u200B"+(Ut?M.value:"");M.value="\u21DA",M.value=zt,r.prevInput=Ut?"":"\u200B",M.selectionStart=1,M.selectionEnd=zt.length,L.selForContextMenu=R.doc.sel}}function ut(){if(r.contextMenuPending!=ut)return;if(r.contextMenuPending=!1,r.wrapper.style.cssText=Se,M.style.cssText=ge,T&&C<9&&L.scrollbars.setScrollTop(L.scroller.scrollTop=le),M.selectionStart!=null){(!T||T&&C<9)&&pt();var Ut=0,zt=function(){L.selForContextMenu==R.doc.sel&&M.selectionStart==0&&M.selectionEnd>0&&r.prevInput=="\u200B"?ii(R,ps)(R):Ut++<10?L.detectingSelectAll=setTimeout(zt,500):(L.selForContextMenu=null,L.input.reset())};L.detectingSelectAll=setTimeout(zt,200)}}if(T&&C>=9&&pt(),_){Ce(e);var Ct=function(){dt(window,"mouseup",Ct),setTimeout(ut,20)};je(window,"mouseup",Ct)}else setTimeout(ut,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,r){if(r=r?X(r):{},r.value=e.value,!r.tabindex&&e.tabIndex&&(r.tabindex=e.tabIndex),!r.placeholder&&e.placeholder&&(r.placeholder=e.placeholder),r.autofocus==null){var R=N();r.autofocus=R==e||e.getAttribute("autofocus")!=null&&R==document.body}function L(){e.value=pe.getValue()}var M;if(e.form&&(je(e.form,"submit",L),!r.leaveSubmitMethodAlone)){var G=e.form;M=G.submit;try{var le=G.submit=function(){L(),G.submit=M,G.submit(),G.submit=le}}catch(ge){}}r.finishInit=function(ge){ge.save=L,ge.getTextArea=function(){return e},ge.toTextArea=function(){ge.toTextArea=isNaN,L(),e.parentNode.removeChild(ge.getWrapperElement()),e.style.display="",e.form&&(dt(e.form,"submit",L),!r.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=M))}},e.style.display="none";var pe=Nr(function(ge){return e.parentNode.insertBefore(ge,e.nextSibling)},r);return pe}function au(e){e.off=dt,e.on=je,e.wheelEventPixels=hl,e.Doc=Ti,e.splitLines=st,e.countColumn=V,e.findColumn=Pe,e.isWordChar=We,e.Pass=ue,e.signal=qe,e.Line=yi,e.changeEnd=ca,e.scrollbarModel=Ko,e.Pos=ct,e.cmpPos=kt,e.modes=vt,e.mimeModes=ot,e.resolveMode=it,e.getMode=St,e.modeExtensions=Wt,e.extendMode=Kt,e.copyState=tn,e.startState=ve,e.innerMode=Re,e.commands=qa,e.keyMap=ra,e.keyName=Rs,e.isModifierKey=As,e.lookupKey=La,e.normalizeKeyMap=Ml,e.StringStream=z,e.SharedTextMarker=Ya,e.TextMarker=ha,e.LineWidget=Xa,e.e_preventDefault=be,e.e_stopPropagation=Te,e.e_stop=Ce,e.addClass=W,e.contains=D,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 Me(Ti),Nr.inputStyles={textarea:Xr,contenteditable:Sr},Nr.defineMode=function(e){!Nr.defaults.mode&&e!="null"&&(Nr.defaults.mode=e),Mt.apply(this,arguments)},Nr.defineMIME=Nt,Nr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Nr.defineMIME("text/plain","null"),Nr.defineExtension=function(e,r){Nr.prototype[e]=r},Nr.defineDocExtension=function(e,r){Ti.prototype[e]=r},Nr.fromTextArea=iu,au(Nr),Nr.version="5.58.2",Nr})},W7jJ:function(rt,$e,H){"use strict";H.r($e);var de=H("0Owb"),ee=H("PpiC"),j=H("OaEy"),w=H("2fM7"),k=H("T2oS"),S=H("W9HT"),T=H("miYZ"),C=H("tsqr"),h=H("2qtc"),p=H("kLXV"),c=H("9og8"),l=H("tJVT"),a=H("k1fw"),u=H("aHsQ"),s=H("sGsY"),f=H("WmNS"),i=H.n(f),n=H("q1tI"),t=H.n(n),d=H("Fvcw"),v=H("GIiI"),g=H("Ty5D"),b=H("9kvl"),_=H("55Ip"),m=H("7qur"),y=H("cDPC"),E=H("m3rI"),o=H("RCxd"),x=H("EHPI"),A=H("J66h"),O=H("uMZB"),D=H.n(O),N=H("sNtx"),W=H("RpDr"),K=H("+L6B"),oe=H("2/Rp"),B=H("y8nQ"),X=H("Vl3Y"),V=H("5NDa"),ne=H("5rEg"),$=ne.a.TextArea,Z=5e3,ue=function(ft){var gt=ft.callback,Tt=ft.onCancel,Ft=ft.notes;function mn(fn){gt(fn)}return t.a.createElement(X.a,{className:"note-form-panel",onFinish:mn,initialValues:{notes:Ft}},t.a.createElement(X.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:Z,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(Z)}]},t.a.createElement($,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),t.a.createElement(X.a.Item,{style:{textAlign:"right"}},t.a.createElement(oe.a,{type:"ghost",onClick:Tt,style:{marginRight:10}}," \u53D6\u6D88 "),t.a.createElement(oe.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},he=H("ZsLC"),Oe=H.n(he),we=H("DjyN"),Pe=H("NUBc"),_e=H("g9YV"),xe=H("wCAj"),Ve=H("Hw79"),Ne=H.n(Ve),Be=H("ye1Q"),ze=H("lfch"),ye=H("bdLU"),me=H("1vsH"),We=H("wd/R"),He=H.n(We),nt=xe.a.Column,te=function(ft){var gt=ft.submitResult,Tt=ft.submitting,Ft=ft.submitRecords,mn=ft.page,fn=ft.onPageChange,Et=ft.topicId,bt=gt||{},$t=bt.status,xt=bt.id,on=bt.input,jt=bt.output,dn=bt.expected_output,$n=bt.is_file,Dn=bt.input_file_url,En=bt.output_file_url,er=bt.expected_output_file_url,Rn=bt.error_msg,kn=Ft||{},Gn=kn.records,Tr=kn.records_count,ir=Object(g.i)();function dr(){$n?navigator.clipboard.writeText(A.Base64.decode(Rn)).then(function(){C.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(A.Base64.decode(jt)).then(function(){C.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return t.a.createElement(S.a,{spinning:Tt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:t.a.createElement(Be.a,{style:{fontSize:24},spin:!0})},xt?t.a.createElement(t.a.Fragment,null,t.a.createElement("ul",{className:Ne.a.info},t.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",t.a.createElement("span",{className:$t===ye.a.OK?"c-green":"c-red"},W.a[$t])),t.a.createElement("li",{className:Ne.a.error},t.a.createElement("a",{onClick:dr},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",t.a.createElement(ze.a,null)," ")),t.a.createElement("li",null,t.a.createElement(_.a,{to:"/problems/".concat(Et,"/record-detail/").concat(xt,"?backId=").concat(ir==null?void 0:ir.save_identifier)},"\u663E\u793A\u8BE6\u60C5 > "))),$t!==ye.a.OK?t.a.createElement(t.a.Fragment,null,t.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),t.a.createElement("pre",null,!$n&&on,$n&&t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(me.w)(Dn,on)}},on)),t.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),t.a.createElement("pre",null,($t===4||$t===5)&&A.Base64.decode(Rn),$t!=4&&$t!=5&&($n?t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(me.w)(En,jt)}},jt):A.Base64.decode(jt))),t.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),t.a.createElement("pre",null,!$n&&A.Base64.decode(dn),$n&&t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(me.w)(er,dn)}},dn))):null):null,(Gn==null?void 0:Gn.length)>0?t.a.createElement(xe.a,{dataSource:Gn,rowKey:"id",pagination:!1},t.a.createElement(nt,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(xr,ar){return t.a.createElement("span",null," ",He()(xr).format("YYYY-MM-DD HH:mm:ss"))}}),t.a.createElement(nt,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(xr,ar){var fr;return t.a.createElement(_.a,{className:xr===0?"c-green":"c-red",to:"/problems/".concat(Et,"/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"))}}),t.a.createElement(nt,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),t.a.createElement(nt,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),t.a.createElement(nt,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,Tr>15?t.a.createElement(Pe.a,{className:Ne.a.pagination,current:mn,pageSize:15,total:Tr,onChange:fn}):null)},P=H("BdwD"),U=H("DYRE"),q=H("zeV3"),Y=H("+BJd"),J=H("mr32"),Ee=H("TcMa"),ke=H.n(Ee),ht=H("9Bee"),Ue={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},je=function(ft){var gt=ft.hack,Tt=ft.onTriggerPraise,Ft=ft.toDiscuss,mn=gt.language,fn=gt.difficulty,Et=gt.time_limit,bt=gt.username,$t=gt.user_path,xt=gt.user_praise,on=gt.comments_count,jt=gt.praises_count,dn=gt.description,$n=gt.pass_count,Dn=gt.submit_count,En=Object(g.h)();console.log(gt.language,"language");var er=Ue[fn];return t.a.createElement(t.a.Fragment,null,t.a.createElement("ul",{className:ke.a.info},t.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",t.a.createElement(J.a,{color:er.color},er.name)),t.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",t.a.createElement("b",null,Et,"\u79D2"))),t.a.createElement(ht.a,{value:dn,className:ke.a.desc}),t.a.createElement("ul",{className:ke.a["commit-info"]},t.a.createElement("li",null,t.a.createElement(q.a,{size:4},t.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",t.a.createElement("b",null,$n))),t.a.createElement("li",null,t.a.createElement(q.a,{size:4},t.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",t.a.createElement("b",null,Dn))," "),t.a.createElement("li",{style:{flex:"1 0 0"}}),t.a.createElement("li",null,t.a.createElement(q.a,{size:4},t.a.createElement("i",{className:"iconfont icon-huifu1",onClick:Ft})," ",t.a.createElement("b",null,on))," ")))},tt=H("dhSg"),dt=H("ps8w"),qe=H.n(dt),Ye=H("oBTY"),Fe=H("M8RZ"),Ie=H("OkW/"),Me=H("ErOA");function be(ft){return Object(Me.c)("comments.json",ft)}function Te(ft){return Object(Me.f)("/discusses/".concat(ft,"/plus.json"),{container_type:"Discuss",type:1})}function Le(ft){return Object(Me.f)("comments/reply.json",ft)}function Ce(ft){return Object(Me.f)("comments.json",ft)}function et(ft){return Object(Me.f)("comments/".concat(ft==null?void 0:ft.id,"/hidden.json"),ft)}function Qe(ft){return Object(Me.b)("comments/".concat(ft==null?void 0:ft.id,".json"))}var yt=H("GgEA"),Dt=H("AMnG"),Bt=H("xKgJ");function Pt(ft){var gt=ft.author;return t.a.createElement("a",{href:"/users/".concat(gt.login),target:"_blank"},t.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(E.a.IMG_SERVER,"/images/").concat(gt.image_url),width:"50"}))}function Rt(ft){var gt=ft.data,Tt=ft.index,Ft=ft.parentDiscussIndex,mn=ft.user,fn=ft.onSetActionType,Et=gt.author,bt=gt.can_delete,$t=gt.content,xt=gt.id,on=gt.time;function jt(){fn({id:xt,index:Tt,type:"delete-discuss",parentDiscussIndex:Ft,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var dn=mn.admin||bt||Et.user_id===mn.user_id;return t.a.createElement("div",{className:"discuss-item-container second-discuss "},t.a.createElement(Pt,{author:Et}),t.a.createElement("section",null,t.a.createElement("div",{className:"discuss-info"},t.a.createElement("a",{href:"/users/".concat(Et.login),target:"_blank"},Et.name),t.a.createElement("span",{className:"grey"},on),t.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},dn?t.a.createElement("a",{onClick:jt,title:"\u5220\u9664"},t.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),t.a.createElement(ht.a,{className:"discuss-content",value:$t})))}var st=function(ft){var gt=ft.user,Tt=ft.data,Ft=ft.index,mn=ft.onPlusDiscuss,fn=ft.onSetActionType,Et=ft.activeDiscussIndex,bt=ft.onReplyDiscuss,$t=ft.onSetActiveDiscussIndex,xt=Tt.content,on=Tt.children,jt=Tt.hidden,dn=Tt.id,$n=Tt.praise_count,Dn=Tt.time,En=Tt.user_praise,er=Tt.can_delete,Rn=Tt.author;console.log(er&&(!on||on.length==0),"children22");function kn(){$t(dn)}function Gn(){mn(dn,!En,Ft)}function Tr(){fn({id:dn,index:Ft,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function ir(){fn({id:dn,index:Ft,params:{hidden:jt?"0":"1"},type:"hidden-discuss",message:jt?"\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 t.a.createElement("div",{className:"discuss-item-container",key:dn},t.a.createElement(Pt,{author:Rn}),t.a.createElement("section",null,t.a.createElement("div",{className:"discuss-info"},t.a.createElement("a",{href:"/users/".concat(Rn.login),target:"_blank"}," ",Rn.name," "),t.a.createElement("span",{className:"grey"},Dn)),t.a.createElement(ht.a,{className:"discuss-content",value:xt}),on&&on.length>0?t.a.createElement("div",{className:"reply-discuss-container"},on.map(function(gr,xr){return t.a.createElement(Rt,{key:gr.id,data:gr,index:xr,user:gt,onSetActionType:fn,parentDiscussIndex:Ft})})):null,t.a.createElement("div",{className:"btn-group"},Object(Bt.v)()?t.a.createElement("a",{onClick:ir,title:jt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},t.a.createElement("i",{className:jt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,er&&(!on||on.length==0)?t.a.createElement("a",{onClick:Tr,title:"\u5220\u9664"},t.a.createElement("i",{className:"iconfont icon-shanchu"})):null,t.a.createElement("a",{onClick:kn,title:"\u56DE\u590D"}," ",t.a.createElement("i",{className:"iconfont icon-huifu1"})," "),t.a.createElement("a",{onClick:Gn,className:En?"c-orange":""},t.a.createElement("i",{className:En?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),t.a.createElement("span",null,$n||""))),t.a.createElement(Dt.a,{id:dn,activeDiscussIndex:Et,onReplyDiscuss:bt})))},mt=H("kaH+"),lt=H("Wx9E"),De=H("Ot1p"),Ke=function(ft){var gt=ft.user_praise,Tt=ft.praise_count,Ft=ft.praisePlus,mn=ft.onCreateDiscuss,fn=ft.discuss_count,Et=Object(n.useState)(!1),bt=Object(l.a)(Et,2),$t=bt[0],xt=bt[1],on=Object(n.useState)(""),jt=Object(l.a)(on,2),dn=jt[0],$n=jt[1];function Dn(Gn){$n(Gn)}function En(){xt(!0)}function er(){xt(!1)}function Rn(){return kn.apply(this,arguments)}function kn(){return kn=Object(c.a)(i.a.mark(function Gn(){return i.a.wrap(function(ir){for(;;)switch(ir.prev=ir.next){case 0:mn(dn),$n(""),xt(!1);case 3:case"end":return ir.stop()}},Gn)})),kn.apply(this,arguments)}return t.a.createElement("div",{className:"dis-input-editor-container ".concat($t?"active":""," ")},t.a.createElement("div",{className:$t?"text-area hide":"text-area"},t.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:En}),t.a.createElement("a",{style:{alignItems:"center"}}," ",t.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",fn," "),t.a.createElement("a",{className:"c-light-black",onClick:Ft,style:{alignItems:"center"},title:gt?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},t.a.createElement("i",{className:"mr3 ".concat(gt?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Tt?t.a.createElement("span",null,Tt):"")),$t?t.a.createElement("div",{className:"input-mask",onClick:er}):null,t.a.createElement("div",{className:$t?"md-container":"md-container hide"},t.a.createElement(De.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:dn,height:240,onChange:Dn}),t.a.createElement("div",{className:"tip-container",onClick:er},t.a.createElement("a",{className:"btn-send",onClick:Rn}," \u53D1\u9001 "))))},vt={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},ot;(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"})(ot||(ot={}));function Mt(ft,gt){switch(gt.type){case ot.SHOW_DISCUSSES_LOADING:return Object(a.a)(Object(a.a)({},ft),{},{loading:!0});case ot.GET_DISCUSSES:return Object(a.a)(Object(a.a)({},ft),gt.payload);case ot.TOP_OR_DOWN_DISCUSS:return Object(a.a)(Object(a.a)({},ft),gt.payload);case ot.SET_ACTION_TYPE:return Object(a.a)(Object(a.a)({},ft),gt.payload);case ot.PLUS_DISCUSS:return Object(a.a)(Object(a.a)({},ft),gt.payload);case ot.SET_PAGE:return Object(a.a)(Object(a.a)({},ft),{},{page:gt.payload});case ot.ACTIVE_DISCUSS_INDEX:return Object(a.a)(Object(a.a)({},ft),gt.payload);default:throw new Error}}var Nt=function(ft){var gt=ft.user,Tt=ft.identifier,Ft=ft.hack,mn=ft.onTriggerPraise,fn=ft.setDiscussTotal,Et=Object(n.useReducer)(Mt,vt),bt=Object(l.a)(Et,2),$t=bt[0],xt=bt[1],on=$t.loading,jt=$t.page,dn=$t.data,$n=$t.count,Dn=$t.actionType,En=$t.activeDiscussIndex,er=Object(n.useCallback)(Object(c.a)(i.a.mark(function vn(){var tr,or,vr;return i.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:return xt({type:ot.SHOW_DISCUSSES_LOADING}),qn.next=3,be({container_type:"Practice",container_identifier:Tt,limit:10,page:jt});case 3:tr=qn.sent,or=tr.comments,vr=tr.disscuss_count,xt({type:ot.GET_DISCUSSES,payload:{data:or,count:vr,loading:!1}}),fn(vr);case 7:case"end":return qn.stop()}},vn)})),[jt,Tt]);Object(n.useEffect)(function(){er()},[Tt,jt]);function Rn(vn){xt({type:ot.SET_PAGE,page:vn})}function kn(vn){xt({type:ot.SET_ACTION_TYPE,payload:{actionType:vn}})}function Gn(vn){En===vn?xt({type:ot.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):xt({type:ot.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:vn}})}function Tr(vn,tr,or){return ir.apply(this,arguments)}function ir(){return ir=Object(c.a)(i.a.mark(function vn(tr,or,vr){var Jn;return i.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:return yn.prev=0,yn.next=3,Te(tr);case 3:Jn=yn.sent,dn[vr].user_praise=or,dn[vr].praise_count=Jn.praise_count,xt({type:ot.PLUS_DISCUSS,payload:{data:Object(Ye.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()}},vn,null,[[0,9]])})),ir.apply(this,arguments)}function dr(){return gr.apply(this,arguments)}function gr(){return gr=Object(c.a)(i.a.mark(function vn(){var tr,or,vr,Jn,qn;return i.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:if(tr=Dn.id,or=Dn.params,vr=Dn.type,Jn=Dn.index,qn=Dn.parentDiscussIndex,!(vr==="hidden-discuss")){Ln.next=7;break}return console.log(or,"params"),Ln.next=5,et(Object(a.a)({id:tr,container_type:"Practice",container_identifier:Tt},or));case 5:qn?dn[qn].children[Jn].hidden=or.hidden==1:dn[Jn].hidden=or.hidden==1,xt({type:ot.SET_ACTION_TYPE,payload:{actionType:null,data:Object(Ye.a)(dn)}});case 7:if(!(vr==="delete-discuss")){Ln.next=13;break}return Ln.next=10,Qe({id:tr,container_type:"Practice",container_identifier:Tt});case 10:return xt({type:ot.SET_ACTION_TYPE,payload:{actionType:null}}),Ln.next=13,er();case 13:case"end":return Ln.stop()}},vn)})),gr.apply(this,arguments)}function xr(){xt({type:ot.SET_ACTION_TYPE,payload:{actionType:null}})}function ar(vn,tr){return fr.apply(this,arguments)}function fr(){return fr=Object(c.a)(i.a.mark(function vn(tr,or){return i.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return Jn.prev=0,Jn.next=3,Le({container_type:"Practice",container_identifier:Tt,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()}},vn,null,[[0,6]])})),fr.apply(this,arguments)}function Wn(vn){return Xt.apply(this,arguments)}function Xt(){return Xt=Object(c.a)(i.a.mark(function vn(tr){return i.a.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:return xt({type:ot.SHOW_DISCUSSES_LOADING}),vr.next=3,Ce({comments:{content:tr},container_type:"Practice",container_identifier:Tt});case 3:er();case 4:case"end":return vr.stop()}},vn)})),Xt.apply(this,arguments)}return t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:"discuss-panel"},dn.length===0?t.a.createElement(P.a,null):dn.map(function(vn,tr){return t.a.createElement(st,{onReplyDiscuss:ar,onPlusDiscuss:Tr,onSetActiveDiscussIndex:Gn,onSetActionType:kn,data:vn,index:tr,user:gt,activeDiscussIndex:En})}),$n>10?t.a.createElement("div",{className:"pagination-container"},t.a.createElement(Pe.a,{showQuickJumper:!0,onChange:Rn,current:jt,total:$n})):null),t.a.createElement(Ke,{user_praise:Ft.user_praise,praise_count:Ft.praises_count,praisePlus:mn,discuss_count:Ft.comments_count,onCreateDiscuss:Wn}),t.a.createElement(Fe.a,null,t.a.createElement(p.a,{centered:!0,title:"\u63D0\u793A",visible:!!Dn,onOk:dr,onCancel:xr},t.a.createElement("p",null,Dn?Dn.message:"")),t.a.createElement(mt.a,null)))},it=H("1FX+"),St=H.n(it),Wt=H("pYxM"),Kt=H.n(Wt),tn=H("sB/4"),Re=H.n(tn),ve=H("Wtmd"),z=H.n(ve),Q=H("CNDd"),ae=H.n(Q),fe=H("nCk5"),Ae=H.n(fe),Je=H("kovY"),at=H.n(Je),Lt=function(gt){var Tt=gt.style,Ft=Tt===void 0?{}:Tt,mn=gt.onClick,fn=gt.onAssist,Et=gt.onHide,bt=gt.data,$t=gt.active,xt=gt.showLine;return t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:$t===(bt==null?void 0:bt.id)?"".concat(Kt.a.list," ").concat(Kt.a.active):Kt.a.list,style:Ft,onClick:function(){return mn(bt)}},(bt==null?void 0:bt.video)&&t.a.createElement("div",{className:Kt.a.left},t.a.createElement("img",{src:bt==null?void 0:bt.video_cover}),t.a.createElement("div",null,t.a.createElement("img",{src:Re.a}),t.a.createElement("span",null,bt==null?void 0:bt.video_duration)),t.a.createElement("div",{className:Kt.a.mask})),t.a.createElement("div",{className:Kt.a.right},t.a.createElement("div",{className:Kt.a.name},t.a.createElement("img",{src:E.a.IMG_SERVER+"/images/"+(bt==null?void 0:bt.image_url),width:30,height:30}),t.a.createElement("div",{title:bt==null?void 0:bt.name,className:Kt.a.title},bt==null?void 0:bt.name),(bt==null?void 0:bt.is_authority)&&t.a.createElement("div",{className:Kt.a.b},"\u5B98\u65B9"),(bt==null?void 0:bt.is_excellent)&&t.a.createElement("div",{className:Kt.a.a},"\u7CBE\u9009")),t.a.createElement("div",{className:Kt.a.des},t.a.createElement(ht.a,{showLines:2,showTextOnly:!0,value:(bt==null?void 0:bt.content)||"\u6682\u65E0\u5185\u5BB9"})),t.a.createElement("div",{className:Kt.a.tag},t.a.createElement("span",{className:"current",onClick:function(jt){jt.stopPropagation(),fn(bt)}},t.a.createElement("img",{src:bt!=null&&bt.user_liker?ae.a:z.a}),t.a.createElement("span",{style:{color:bt!=null&&bt.user_liker?"#0152d9":"#656f87"}},bt==null?void 0:bt.praises_count)),t.a.createElement("span",null,t.a.createElement("img",{src:Ae.a}),t.a.createElement("span",null,bt==null?void 0:bt.discusses_count)),t.a.createElement("span",null,t.a.createElement("img",{src:at.a}),t.a.createElement("span",null,bt==null?void 0:bt.viewed_count)),Object(Bt.v)()&&t.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(jt){jt.stopPropagation(),Et(bt)}},bt!=null&&bt.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),xt&&t.a.createElement("div",{className:Kt.a.line}))},It=Lt,ct=H("5Dmo"),kt=H("3S7+"),nn=H("Z8dc"),Ot=H.n(nn),un=H("Aky1"),an=H("7+5b"),re=H.n(an),I=H("twBr"),F=H.n(I),ie=H("oE5q"),ce=H.n(ie),se=function(gt,Tt){var Ft,mn,fn,Et=Tt.payload.uploadInfo,bt=Et===void 0?{}:Et;switch(Tt.type){case"addVideo":return{videoList:[].concat(Object(Ye.a)(gt.videoList),[{name:bt.file.name,size:bt.file.size,type:bt.file.type,fileHash:bt.fileHash,state:bt.state,video_id:bt.videoId,attachment_id:"",article_id:-1,loaded:0,title:""}])};case"removeVideo":return{videoList:gt.videoList.filter(function($t){return $t.name!==Tt.payload.name})};case"replaceVideo":return{videoList:Tt.payload};case"removeAll":return[];case"updateProgress":return{videoList:gt.videoList.map(function($t){return $t.name===Tt.payload.uploadInfo.file.name?Object(a.a)(Object(a.a)({},$t),{loaded:Tt.payload.progressPercent,video_id:bt.videoId,fileHash:bt.fileHash}):$t})};case"updateTitle":return{videoList:(Ft=gt.videoList)===null||Ft===void 0?void 0:Ft.map(function($t){return $t.name===Tt.payload.item.name?Object(a.a)(Object(a.a)({},$t),{title:Tt.payload.title}):$t})};case"updateImg":return{videoList:(mn=gt.videoList)===null||mn===void 0?void 0:mn.map(function($t){return $t.name===Tt.payload.item.name?Object(a.a)(Object(a.a)({},$t),{attachment_id:Tt.payload.attachment_id}):$t})};case"updateImg":return{videoList:(fn=gt.videoList)===null||fn===void 0?void 0:fn.map(function($t){return $t.name===Tt.payload.item.name?Object(a.a)(Object(a.a)({},$t),{attachment_id:Tt.payload.attachment_id}):$t})};default:return[]}},Xe=function(gt){var Tt,Ft,mn=gt.onClose,fn=gt.onOk,Et=gt.identifier,bt=gt.active,$t=X.a.useForm(),xt=Object(l.a)($t,1),on=xt[0],jt=Object(n.useState)({}),dn=Object(l.a)(jt,2),$n=dn[0],Dn=dn[1],En=Object(n.useState)(!1),er=Object(l.a)(En,2),Rn=er[0],kn=er[1],Gn=Object(n.useState)(!1),Tr=Object(l.a)(Gn,2),ir=Tr[0],dr=Tr[1],gr=Object(n.useReducer)(se,{videoList:[]}),xr=Object(l.a)(gr,2),ar=xr[0],fr=xr[1],Wn=Object(Bt.x)(),Xt=Object(g.i)(),vn=Object(n.useRef)();Object(n.useEffect)(function(){bt&&tr()},[bt]);var tr=function(){var bn=Object(c.a)(i.a.mark(function Mn(){var Tn,Vn,sr,br,Pr,ei,Mi,$r,Wi,na,Gi,di;return i.a.wrap(function(Xn){for(;;)switch(Xn.prev=Xn.next){case 0:return Xn.next=2,Object(m.k)(Et,{active:bt});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},on.setFieldsValue(ei),Dn(ei),Tn!=null&&(br=Tn.data)!==null&&br!==void 0&&(Pr=br.videos)!==null&&Pr!==void 0&&Pr[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(a.a)({},Tn))},vr=function(){var bn=Object(c.a)(i.a.mark(function Mn(Tn){var Vn,sr,br,Pr,ei;return i.a.wrap(function($r){for(;;)switch($r.prev=$r.next){case 0:if(sr={videos:ar.videoList,articles:Tn},dr(!0),!bt){$r.next=9;break}return sr.active=bt,$r.next=6,Object(m.j)(Et,sr);case 6:br=$r.sent,$r.next=12;break;case 9:return $r.next=11,Object(m.a)(Et,sr);case 11:br=$r.sent;case 12:((Vn=br)===null||Vn===void 0?void 0:Vn.status)===0&&(console.log(bt||((Pr=br)===null||Pr===void 0?void 0:Pr.id),44),fn(bt||((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(kn(!0),vn.current){vn.current.addFile(Mn,null,null,null,Tn);return}Object(un.a)(Wn==null?void 0:Wn.login,"",{create:!vn,addFileSuccess:function(sr){fr({type:"addVideo",payload:{uploadInfo:sr}})},onUploadProgress:function(sr,br,Pr){var ei=Math.ceil(Pr*100);fr({type:"updateProgress",payload:{uploadInfo:sr,progressPercent:ei}}),Jn()},onUploadFailed:function(sr){C.b.info("\u89C6\u9891\u4E91\u670D\u52A1\u51FA\u73B0\u5F02\u5E38\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u3002")},onUploadEnd:function(sr){kn(!1)},onUploadSucceed:function(sr){kn(!1)},onUploadError:function(sr){kn(!1)},gotUploader:function(sr){sr.addFile(Mn,null,null,null,Tn),vn.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){C.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),Jn();return}if(sr.size>Vn*1024*1024){C.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(Vn,"M")),Jn();return}if((Tn=ar.videoList)!==null&&Tn!==void 0&&Tn.find(function(Pr){return Pr.name===sr.name})){C.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:t.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}})}})},Gt=function(){return t.a.createElement("label",{htmlFor:"fileUpload",className:Ot.a.main},t.a.createElement("img",{src:re.a,alt:""}),t.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891"))},Yt=function(Mn){return t.a.createElement("div",{className:Ot.a.mainLoading},t.a.createElement("div",{className:Ot.a.proWarp},t.a.createElement("div",{className:Ot.a.pro},t.a.createElement("div",{style:{width:Mn}})),t.a.createElement("span",null,Mn||0,"%")),t.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),t.a.createElement("div",{className:Ot.a.tip},t.a.createElement(kt.a,{getPopupContainer:function(Vn){return Vn.parentNode},title:t.a.createElement("div",null,t.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",t.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"),t.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),t.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},t.a.createElement("img",{src:ce.a,alt:""}))))},Qt=function(Mn){return t.a.createElement("div",{className:Ot.a.mainSucceed},t.a.createElement("img",{src:F.a,alt:""}),t.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),t.a.createElement("div",{className:Ot.a.tip},t.a.createElement(kt.a,{getPopupContainer:function(Vn){return Vn.parentNode},title:t.a.createElement("div",null,t.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",t.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"),t.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),t.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},t.a.createElement("img",{src:ce.a,alt:""}))),t.a.createElement("div",{className:Ot.a.del,onClick:function(){return Ln(Mn.name,Mn.loaded==100)}},t.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},xn=function(){var Mn;return t.a.createElement(t.a.Fragment,null,(Mn=ar.videoList)===null||Mn===void 0?void 0:Mn.map(function(Tn,Vn){return t.a.createElement(t.a.Fragment,{key:Vn},Tn.loaded==100?Qt(Tn):Yt(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=(Tt=ar.videoList)===null||Tt===void 0?void 0:Tt.length;return t.a.createElement("div",{className:Ot.a.listForm},t.a.createElement("header",null,bt?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),t.a.createElement("section",{className:Ot.a.scroll,id:"sss"},t.a.createElement("div",{className:Ot.a.formWrap}," ",t.a.createElement(X.a,{form:on,scrollToFirstError:!0,layout:"vertical",onValuesChange:or,onFinish:vr},t.a.createElement(X.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"}]},t.a.createElement(ne.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Ft=$n.name)===null||Ft===void 0?void 0:Ft.length)||0,"/60")})),t.a.createElement(X.a.Item,{name:"content",label:"\u5185\u5BB9:"},t.a.createElement(De.a,{defaultValue:$n.content||"",watch:!0})))),t.a.createElement("div",{className:Ot.a.upload},Hn?xn():Gt(),t.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/*"}))),t.a.createElement("div",{className:Ot.a.btns},t.a.createElement(oe.a,{onClick:cn,type:"primary",ghost:!0},"\u5173\u95ED"),t.a.createElement(oe.a,{loading:ir,disabled:Rn,onClick:function(){return on.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},_t=Xe,At=H("cWXX"),Vt=H("/ezw"),wt=H("CaVn"),Ht=H.n(wt),en=H("s8/Y"),jn=H.n(en),Dr=H("JOrW"),wr=H.n(Dr),Nn=H("gqXR"),hr=H.n(Nn),mi=H("14J3"),Ar=H("BMrR"),yr=H("jCWc"),pr=H("kPKH"),Yr=H("wW8i"),Mr=H.n(Yr),Zr=H("MVJL"),Cr=H.n(Zr),gi=function(gt){var Tt=gt.id,Ft=gt.cb,mn=Object(n.useState)(""),fn=Object(l.a)(mn,2),Et=fn[0],bt=fn[1];return t.a.createElement("aside",{className:"mt10"},t.a.createElement(De.a,{defaultValue:Et,id:"writeForumsReviewId",onChange:function(xt){bt(xt)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),t.a.createElement(Ar.a,null,t.a.createElement(pr.a,{flex:"1"}),t.a.createElement(pr.a,null,t.a.createElement(oe.a,{type:"primary",size:"large",onClick:Object(c.a)(i.a.mark(function $t(){return i.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:Et===""?C.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):Ft(Tt,Et);case 1:case"end":return on.stop()}},$t)}))},"\u53D1\u9001"))))},li=function(gt){var Tt,Ft=gt.data;return t.a.createElement("div",{className:Cr.a.thirdlyLevelDiscuss},t.a.createElement("span",{className:"c-grey-333"},t.a.createElement("span",{className:"font 14 c-light-primary"},Ft==null||((Tt=Ft.author)===null||Tt===void 0)?void 0:Tt.name),"@",t.a.createElement("span",{className:"font 14 c-light-primary"},Ft==null?void 0:Ft.parent_name),":"),t.a.createElement(ht.a,{value:Ft==null?void 0:Ft.content}))},zr=function(gt){var Tt,Ft,mn,fn,Et=gt.data,bt=gt.onReplyDiscuss,$t=gt.thirdlyReply,xt=gt.setThirdlyReply,on=Object(Bt.x)();return console.log(on,"user"),t.a.createElement("div",{className:Cr.a.list},t.a.createElement("img",{src:E.a.IMG_SERVER+"/images/"+(Et==null||((Tt=Et.author)===null||Tt===void 0)?void 0:Tt.image_url)}),t.a.createElement("div",{className:Cr.a.wrap},t.a.createElement("div",{className:"font14",style:{marginBottom:6}},t.a.createElement("span",{className:"c-grey-333"},Et==null||((Ft=Et.author)===null||Ft===void 0)?void 0:Ft.name),(on==null?void 0:on.login)!==(Et==null||((mn=Et.author)===null||mn===void 0)?void 0:mn.login)&&t.a.createElement("span",{onClick:function(){return xt(Et==null?void 0:Et.id)},className:"c-grey-999 current",style:{float:"right"}},t.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),t.a.createElement("span",null,"\u56DE\u590D"))),t.a.createElement(ht.a,{value:Et==null?void 0:Et.content}),Et==null||((fn=Et.children)===null||fn===void 0)?void 0:fn.map(function(jt){return t.a.createElement(li,{key:jt.id,data:jt})}),$t===(Et==null?void 0:Et.id)&&t.a.createElement("div",null,t.a.createElement(gi,{id:Et==null?void 0:Et.id,cb:bt}),t.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return xt(null)},className:"c-light-primary current"},t.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"\u6536\u8D77\u56DE\u590D")),t.a.createElement("div",{className:Cr.a.line})))},Kr=function(gt){var Tt,Ft,mn,fn,Et=gt.data,bt=gt.onReplyDiscuss,$t=gt.secondReply,xt=gt.setSecondReply,on=gt.thirdlyReply,jt=gt.setThirdlyReply,dn=gt.onPlusDiscuss,$n=Object(n.useState)(!1),Dn=Object(l.a)($n,2),En=Dn[0],er=Dn[1];return console.log(Et,"data"),t.a.createElement("div",{className:Cr.a.discussItem},t.a.createElement("div",{className:Cr.a.list},t.a.createElement("img",{src:E.a.IMG_SERVER+"/images/"+(Et==null||((Tt=Et.author)===null||Tt===void 0)?void 0:Tt.image_url)}),t.a.createElement("div",{className:Cr.a.wrap},t.a.createElement("div",{className:"font14",style:{marginBottom:6}},t.a.createElement("span",{className:"c-grey-333 mr30"},Et==null||((Ft=Et.author)===null||Ft===void 0)?void 0:Ft.name),t.a.createElement("span",{className:"c-grey-999"},Et==null?void 0:Et.time)),t.a.createElement(ht.a,{value:Et==null?void 0:Et.content}),t.a.createElement("div",{className:Cr.a.btns},t.a.createElement("div",{onClick:function(){return dn(Et==null?void 0:Et.id)},className:Et!=null&&Et.user_praise?"c-light-primary":"c-grey-999"},t.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),t.a.createElement("span",null,Et==null?void 0:Et.praise_count)),t.a.createElement("div",{onClick:function(){var kn;if((Et==null||((kn=Et.children)===null||kn===void 0)?void 0:kn.length)===0)return;xt(null),er(!En)},style:{color:En?"#0152d9":"#999999"}},t.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),t.a.createElement("span",null,En?"\u6536\u8D77\u8BC4\u8BBA":Et==null||((mn=Et.children)===null||mn===void 0)?void 0:mn.length)),t.a.createElement("div",{onClick:function(){er(!1),xt($t===(Et==null?void 0:Et.id)?null:Et==null?void 0:Et.id)},style:{color:$t===(Et==null?void 0:Et.id)?"#0152d9":"#999999"}},t.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),t.a.createElement("span",null,$t===(Et==null?void 0:Et.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),$t===(Et==null?void 0:Et.id)&&t.a.createElement(gi,{id:Et==null?void 0:Et.id,cb:function(kn,Gn){bt(kn,Gn),er(!0)}}),En&&t.a.createElement("div",{className:Cr.a.secondLevelDiscuss},Et==null||((fn=Et.children)===null||fn===void 0)?void 0:fn.map(function(Rn){return t.a.createElement(zr,{thirdlyReply:on,setThirdlyReply:jt,key:Rn.id,data:Rn,onReplyDiscuss:bt})})))))},xi=Kr,vi=function(gt){var Tt=gt.identifier,Ft=gt.active,mn=gt.onOk,fn=Object(n.useState)(""),Et=Object(l.a)(fn,2),bt=Et[0],$t=Et[1],xt=Object(n.useState)(1),on=Object(l.a)(xt,2),jt=on[0],dn=on[1],$n=Object(n.useState)([]),Dn=Object(l.a)($n,2),En=Dn[0],er=Dn[1],Rn=Object(n.useState)(0),kn=Object(l.a)(Rn,2),Gn=kn[0],Tr=kn[1],ir=Object(n.useState)(null),dr=Object(l.a)(ir,2),gr=dr[0],xr=dr[1],ar=Object(n.useState)(null),fr=Object(l.a)(ar,2),Wn=fr[0],Xt=fr[1];Object(n.useEffect)(function(){vn(1),dn(1)},[Ft]);var vn=function(){var qn=Object(c.a)(i.a.mark(function yn(Ln){var Gt;return i.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,be({container_type:"QuestionSolutionArticle",container_identifier:Ft,limit:5,page:Ln});case 2:Gt=Qt.sent,Gt!=null&&Gt.comments&&(er((Gt==null?void 0:Gt.comments)||[]),dn(Ln),Tr(Gt==null?void 0:Gt.disscuss_count));case 4:case"end":return Qt.stop()}},yn)}));return function(Ln){return qn.apply(this,arguments)}}(),tr=function(){var qn=Object(c.a)(i.a.mark(function yn(){var Ln;return i.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(!(bt==="")){Yt.next=3;break}return C.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Yt.abrupt("return");case 3:return Yt.next=5,Ce({comments:{content:bt},container_type:"QuestionSolutionArticle",container_identifier:Ft});case 5:Ln=Yt.sent,Ln!=null&&Ln.discuss&&($t(""),vn(jt),mn());case 7:case"end":return Yt.stop()}},yn)}));return function(){return qn.apply(this,arguments)}}(),or=function(){var qn=Object(c.a)(i.a.mark(function yn(Ln,Gt,Yt){var Qt;return i.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return cn.next=2,Le({container_type:"QuestionSolutionArticle",container_identifier:Ft,comments:{content:Gt,parent_id:Ln}});case 2:Qt=cn.sent,xr(null),Xt(null),vn(jt);case 6:case"end":return cn.stop()}},yn)}));return function(Ln,Gt,Yt){return qn.apply(this,arguments)}}(),vr=function(){var qn=Object(c.a)(i.a.mark(function yn(Ln){var Gt;return i.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,Te(Ln);case 2:Gt=Qt.sent,vn(jt);case 4:case"end":return Qt.stop()}},yn)}));return function(Ln){return qn.apply(this,arguments)}}(),Jn=function(yn){dn(yn),vn(yn)};return t.a.createElement("div",{className:Mr.a.discuss},t.a.createElement("aside",{className:Mr.a.reply,style:{borderWidth:Gn?1:0}},t.a.createElement(De.a,{defaultValue:bt,id:"writeForumsReviewId",onChange:function(yn){$t(yn)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),t.a.createElement(Ar.a,null,t.a.createElement(pr.a,{flex:"1"}),t.a.createElement(pr.a,null,t.a.createElement(oe.a,{type:"primary",size:"large",onClick:function(){return tr()}},"\u53D1\u9001")))),En==null?void 0:En.map(function(qn){return t.a.createElement(xi,{secondReply:gr,setSecondReply:xr,thirdlyReply:Wn,setThirdlyReply:Xt,key:qn.id,data:qn,onReplyDiscuss:or,onPlusDiscuss:vr})}),t.a.createElement(Pe.a,{className:Mr.a.pagination,showTotal:function(yn){return t.a.createElement("span",{style:{color:"#656F87"}},"\u5171",t.a.createElement("span",{className:"c-light-primary"},yn),"\u6761\u6570\u636E")},current:jt,onChange:Jn,total:Gn,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},Si=vi,Fn=H("hgre"),Sn=function(gt){var Tt,Ft,mn,fn,Et,bt,$t,xt,on,jt,dn=gt.active,$n=gt.identifier,Dn=gt.onAssist,En=gt.onEdit,er=gt.onArticlesSkip,Rn=gt.onClose,kn=gt.onOk,Gn=gt.onDelete,Tr=gt.detailsIndex,ir=gt.btnShowStatus,dr=Object(n.useState)(!0),gr=Object(l.a)(dr,2),xr=gr[0],ar=gr[1],fr=Object(n.useState)({}),Wn=Object(l.a)(fr,2),Xt=Wn[0],vn=Wn[1];Object(n.useEffect)(function(){dn&&tr()},[dn,Tr]);var tr=function(){var yn=Object(c.a)(i.a.mark(function Ln(){var Gt,Yt,Qt=arguments;return i.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return Gt=Qt.length>0&&Qt[0]!==void 0?Qt[0]:!0,Gt&&ar(!0),cn.next=4,Object(m.d)($n,{active:dn});case 4:Yt=cn.sent,(Yt==null?void 0:Yt.status)===0&&vn((Yt==null?void 0:Yt.data)||{}),ar(!1);case 7:case"end":return cn.stop()}},Ln)}));return function(){return yn.apply(this,arguments)}}(),or=function(){var yn=Object(c.a)(i.a.mark(function Ln(Gt){var Yt;return i.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return xn.next=2,Object(m.g)($n,Object(a.a)({active:dn},Gt));case 2:Yt=xn.sent,(Yt==null?void 0:Yt.status)===0&&(tr(!1),kn());case 4:case"end":return xn.stop()}},Ln)}));return function(Gt){return yn.apply(this,arguments)}}(),vr=function(){var yn=Object(c.a)(i.a.mark(function Ln(Gt){var Yt;return i.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return xn.next=2,Object(m.c)($n,{active:Gt==null?void 0:Gt.id});case 2:Yt=xn.sent,Yt.status===0&&(tr(!1),kn());case 4:case"end":return xn.stop()}},Ln)}));return function(Gt){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),kn()};return t.a.createElement("div",{className:Ht.a.listDetails},t.a.createElement(Vt.a,{className:"pt20 pl20 pr20",loading:xr,active:!0,paragraph:{rows:5}},t.a.createElement("div",{className:Ht.a.head},t.a.createElement("div",{className:Ht.a.name},t.a.createElement("div",{title:Xt==null?void 0:Xt.name,className:Ht.a.title},Xt==null?void 0:Xt.name),(Xt==null?void 0:Xt.is_authority)&&t.a.createElement("div",{className:Ht.a.b},"\u5B98\u65B9"),(Xt==null?void 0:Xt.is_excellent)&&t.a.createElement("div",{className:Ht.a.a},"\u7CBE\u9009")),t.a.createElement("div",{className:Ht.a.tag},t.a.createElement("img",{src:E.a.IMG_SERVER+"/images/"+(Xt==null?void 0:Xt.image_url)}),t.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},Xt==null?void 0:Xt.username),t.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",He()(Xt==null?void 0:Xt.created_at).format("YYYY-MM-DD")),t.a.createElement("span",null,t.a.createElement("img",{src:z.a}),t.a.createElement("span",null,Xt==null?void 0:Xt.praises_count)),t.a.createElement("span",null,t.a.createElement("img",{src:Ae.a}),t.a.createElement("span",null,Xt==null?void 0:Xt.discusses_count)),t.a.createElement("span",null,t.a.createElement("img",{src:at.a}),t.a.createElement("span",null,Xt==null?void 0:Xt.viewed_count)),t.a.createElement("div",{className:Ht.a.btn},(Object(Bt.v)()||(Xt==null?void 0:Xt.is_self))&&t.a.createElement(t.a.Fragment,null,t.a.createElement(oe.a,{onClick:function(){return Jn(Xt)},type:"primary",ghost:!0},"\u5220\u9664"),t.a.createElement(oe.a,{onClick:function(){return En(Xt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(Bt.v)()&&t.a.createElement(oe.a,{onClick:function(){return or({is_authority:!(Xt!=null&&Xt.is_authority)})},type:"primary"},t.a.createElement("img",{src:wr.a}),Xt!=null&&Xt.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(Bt.v)()&&t.a.createElement(oe.a,{onClick:function(){return or({is_excellent:!(Xt!=null&&Xt.is_excellent)})},type:"primary"},t.a.createElement("img",{src:jn.a}),Xt!=null&&Xt.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),t.a.createElement("div",{className:Ht.a.scroll},(Xt==null||((Tt=Xt.videos)===null||Tt===void 0||((Ft=Tt[0])===null||Ft===void 0))?void 0:Ft.id)&&t.a.createElement("div",{className:Ht.a.video},t.a.createElement(S.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(Xt!=null&&(mn=Xt.videos)!==null&&mn!==void 0&&(fn=mn[0])!==null&&fn!==void 0&&fn.transcoded)},t.a.createElement(Fn.a,{poster:Xt==null||((Et=Xt.videos)===null||Et===void 0||((bt=Et[0])===null||bt===void 0))?void 0:bt.cover_url,src:(Xt==null||(($t=Xt.videos)===null||$t===void 0||((xt=$t[0])===null||xt===void 0))?void 0:xt.play_url)||"",videoId:Xt==null||((on=Xt.videos)===null||on===void 0||((jt=on[0])===null||jt===void 0))?void 0:jt.id,logWatchHistory:function(){}}))),t.a.createElement(ht.a,{className:Ht.a.html,value:(Xt==null?void 0:Xt.content)||""}),t.a.createElement("div",{onClick:function(){return vr(Xt)},className:Ht.a.g},t.a.createElement("img",{className:"mr10",src:(Xt!=null&&Xt.user_liker,hr.a)}),t.a.createElement("span",null,Xt==null?void 0:Xt.praises_count)),t.a.createElement(Si,{onOk:qn,active:dn,identifier:$n})),t.a.createElement("div",{className:Ht.a.btns},t.a.createElement(oe.a,{onClick:function(){return Rn()},type:"primary",ghost:!0},"\u5173\u95ED"),ir[0]&&t.a.createElement(oe.a,{onClick:function(Ln){return er(Ln,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),ir[1]&&t.a.createElement(oe.a,{onClick:function(Ln){return er(Ln,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},Er=Sn,Kn=H("3tLw"),Lr=H.n(Kn),rr=H("ek7X"),Ri=H("0NbB"),kr=function(gt){var Tt=gt.identifier,Ft=gt.tabStatus,mn=gt.setFilterListTotal,fn=gt.setListStatus,Et={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},bt=Object(n.useState)(Object(a.a)({},Et)),$t=Object(l.a)(bt,2),xt=$t[0],on=$t[1],jt=Object(n.useState)(!1),dn=Object(l.a)(jt,2),$n=dn[0],Dn=dn[1],En=Object(n.useState)(0),er=Object(l.a)(En,2),Rn=er[0],kn=er[1],Gn=Object(n.useState)(1),Tr=Object(l.a)(Gn,2),ir=Tr[0],dr=Tr[1],gr=Object(n.useState)(null),xr=Object(l.a)(gr,2),ar=xr[0],fr=xr[1],Wn=Object(n.useState)([]),Xt=Object(l.a)(Wn,2),vn=Xt[0],tr=Xt[1],or=Object(n.useState)([!0,!0]),vr=Object(l.a)(or,2),Jn=vr[0],qn=vr[1],yn=Object(n.useState)(0),Ln=Object(l.a)(yn,2),Gt=Ln[0],Yt=Ln[1],Qt=Object(n.useRef)(null);Object(n.useEffect)(function(){Pr()},[Ft]),Object(n.useEffect)(function(){xn()},[ar]),Object(n.useEffect)(function(){Hn(Object(a.a)({},Et)),Pr()},[Tt]),Object(n.useEffect)(function(){return window.addEventListener("resize",cn),fn(Gt),function(){window.removeEventListener("resize",cn)}},[Gt]);var xn=function(){var Xn=Object(c.a)(i.a.mark(function On(){var nr,lr;return i.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=vn==null?void 0:vn.findIndex(function(ri){return ri.id===ar}),lr===0&&xt.page===1&&(nr[0]=!1),(xt.page-1)*xt.limit+(lr+1)===xt.total&&(nr[1]=!1),qn(nr);case 8:case"end":return In.stop()}},On)}));return function(){return Xn.apply(this,arguments)}}(),cn=function(){if(Gt){var On,nr=window.innerWidth-((On=Qt.current)===null||On===void 0?void 0:On.clientWidth);kn(nr)}},Hn=function(){var Xn=Object(c.a)(i.a.mark(function On(nr){var lr,Wr,In,ri;return i.a.wrap(function(Jr){for(;;)switch(Jr.prev=Jr.next){case 0:return Dn(!0),Jr.next=3,Object(m.f)(Tt,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)||[]),on(Object(a.a)(Object(a.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()}},On)}));return function(nr){return Xn.apply(this,arguments)}}(),bn=function(){(xt==null?void 0:xt.sort_direction)===null?xt.sort_direction="asc":(xt==null?void 0:xt.sort_direction)==="asc"?xt.sort_direction="desc":(xt==null?void 0:xt.sort_direction)==="desc"&&(xt.sort_direction=null),xt.page=1,Pr(),on(Object(a.a)({},xt)),Hn(xt)},Mn=function(){xt.page=1,xt.search=xt==null?void 0:xt.save_search,Pr(),on(Object(a.a)({},xt)),Hn(xt)},Tn=function(){var On,nr=document.getElementsByClassName("btn-resize");nr[0].style.visibility="hidden";var lr=window.innerWidth-((On=Qt.current)===null||On===void 0?void 0:On.clientWidth);kn(lr)},Vn=function(){Tn(),Yt(1)},sr=function(On){Tn(),fr(On==null?void 0:On.id),Yt(3)},br=function(On){Tn(),fr(On==null?void 0:On.id),Yt(2)},Pr=function(){var On=document.getElementsByClassName("btn-resize");On[0].style.visibility="visible",kn(0),Yt(0),fr(null)},ei=function(On){Yt(3),fr(On),xt.page=1,on(Object(a.a)({},xt)),Hn(xt)},Mi=function(On){Yt(3),fr(On),on(Object(a.a)({},xt)),Hn(xt)},$r=function(On){on(Object(a.a)({},xt)),Hn(xt)},Wi=function(){var Xn=Object(c.a)(i.a.mark(function On(nr){var lr;return i.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(m.c)(Tt,{active:nr==null?void 0:nr.id});case 2:lr=In.sent,lr.status===0&&(Hn(xt),dr(ir+1));case 4:case"end":return In.stop()}},On)}));return function(nr){return Xn.apply(this,arguments)}}(),na=function(){var Xn=Object(c.a)(i.a.mark(function On(nr){var lr;return i.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(m.e)(Tt,{active:nr==null?void 0:nr.id});case 2:lr=In.sent,lr.status===0&&(Hn(xt),dr(ir+1));case 4:case"end":return In.stop()}},On)}));return function(nr){return Xn.apply(this,arguments)}}(),Gi=function(){var Xn=Object(c.a)(i.a.mark(function On(nr){var lr;return i.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(m.i)(Tt,{active:nr==null?void 0:nr.id});case 2:lr=In.sent,lr.status===0&&(Pr(),Hn(xt));case 4:case"end":return In.stop()}},On)}));return function(nr){return Xn.apply(this,arguments)}}(),di=function(On){xt.page=On,on(Object(a.a)({},xt)),Hn(xt)},Vi=function(){var Xn=Object(c.a)(i.a.mark(function On(nr,lr){var Wr,In,ri,Ur,Jr,Ci,Ii,Xi,zn,Cn,Yn;return i.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(Wr=vn==null?void 0:vn.findIndex(function(Or){return Or.id===ar}),console.log(Wr,lr,22),!(lr==="prev")){Pn.next=21;break}if(!(Wr===void 0)){Pn.next=6;break}return C.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Pn.abrupt("return");case 6:if(!(Wr===0)){Pn.next=19;break}if(!(xt.page===1)){Pn.next=10;break}return C.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Pn.abrupt("return");case 10:if(!(xt.page!==1)){Pn.next=17;break}return xt.page=xt.page-1,on(Object(a.a)({},xt)),Pn.next=15,Hn(xt);case 15:In=Pn.sent,(In==null?void 0:In.status)===0&&(Ci=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(Ci==null?void 0:Ci.id),console.log(nr.target,555));case 17:Pn.next=21;break;case 19:Ii=vn[Wr-1],fr(Ii==null?void 0:Ii.id);case 21:if(!(lr==="next")){Pn.next=39;break}if(!(Wr===void 0)){Pn.next=25;break}return C.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Pn.abrupt("return");case 25:if(!((xt.page-1)*xt.limit+(Wr+1)===xt.total)){Pn.next=28;break}return C.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Pn.abrupt("return");case 28:if(!(Wr+1===xt.limit)){Pn.next=37;break}return xt.page=xt.page+1,on(Object(a.a)({},xt)),Pn.next=33,Hn(xt);case 33:Xi=Pn.sent,(Xi==null?void 0:Xi.status)===0&&(Cn=Xi==null||((zn=Xi.data)===null||zn===void 0)?void 0:zn.articles[0],fr(Cn==null?void 0:Cn.id)),Pn.next=39;break;case 37:Yn=vn[Wr+1],fr(Yn==null?void 0:Yn.id);case 39:case"end":return Pn.stop()}},On)}));return function(nr,lr){return Xn.apply(this,arguments)}}();return t.a.createElement("div",{className:St.a.wrap,ref:Qt},t.a.createElement("div",{className:St.a.head},t.a.createElement("div",{className:St.a.sort,onClick:bn},t.a.createElement("span",null,"\u6700\u65B0"),t.a.createElement("aside",null,t.a.createElement(rr.a,{style:{color:(xt==null?void 0:xt.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),t.a.createElement(Ri.a,{style:{color:(xt==null?void 0:xt.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),t.a.createElement(ne.a.Search,{value:xt.save_search,className:St.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(On){xt.save_search=On.target.value,on(Object(a.a)({},xt))},onSearch:Mn}),t.a.createElement("div",{onClick:Vn,className:St.a.btn},t.a.createElement("img",{src:Lr.a}),"\u5199\u9898\u89E3")),t.a.createElement("div",{className:St.a.listWarp},t.a.createElement(S.a,{spinning:$n,className:"mt20"},vn==null?void 0:vn.map(function(Xn,On){var nr=!0;return On+1===vn.length&&On!==0&&(nr=!1),t.a.createElement(It,{active:ar,key:Xn.id,data:Xn,showLine:nr,onClick:sr,onAssist:Wi,onHide:na})}),(vn==null?void 0:vn.length)===0&&t.a.createElement(P.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),t.a.createElement(Pe.a,{className:St.a.pagination,showTotal:function(On){return t.a.createElement("span",{style:{color:"#656F87"}},"\u5171",t.a.createElement("span",{className:"c-light-primary"},On),"\u6761\u6570\u636E")},total:xt.total,showSizeChanger:!1,current:xt==null?void 0:xt.page,onChange:di,hideOnSinglePage:!0,showQuickJumper:!0}),Gt>0&&t.a.createElement("div",{className:St.a.fixedRight,style:{width:Rn}},Gt===1&&t.a.createElement(_t,{identifier:Tt,onClose:Pr,onOk:ei}),Gt===2&&t.a.createElement(_t,{active:ar,identifier:Tt,onClose:Pr,onOk:Mi}),Gt===3&&t.a.createElement(Er,{btnShowStatus:Jn,onArticlesSkip:Vi,detailsIndex:ir,active:ar,identifier:Tt,onClose:Pr,onOk:$r,onEdit:br,onAssist:Wi,onDelete:Gi})))},ni=kr,ji=H("VEzc"),ui=H.n(ji),Di=function(gt){var Tt,Ft=gt.visible,mn=gt.onVisible,fn=gt.value,Et=gt.onChange,bt=gt.setIndex,$t={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},xt=Object(n.useState)($t),on=Object(l.a)(xt,2),jt=on[0],dn=on[1],$n=Object(n.useState)([]),Dn=Object(l.a)($n,2),En=Dn[0],er=Dn[1],Rn=Object(n.useState)([]),kn=Object(l.a)(Rn,2),Gn=kn[0],Tr=kn[1],ir=Object(n.useState)(!1),dr=Object(l.a)(ir,2),gr=dr[0],xr=dr[1],ar=Object(n.useRef)([]),fr=Object(n.useRef)(null),Wn=Object(g.i)();Object(n.useEffect)(function(){return Wn!=null&&Wn.id&&(fr.current=setInterval(function(){Xt(30)},3e4)),function(){clearInterval(fr.current)}},[]);var Xt=function(){var Gt=Object(c.a)(i.a.mark(function Yt(Qt){var xn;return i.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:return Hn.next=2,Object(m.r)(Wn==null?void 0:Wn.id,{practice_time:Qt});case 2:xn=Hn.sent;case 3:case"end":return Hn.stop()}},Yt)}));return function(Qt){return Gt.apply(this,arguments)}}();Object(n.useEffect)(function(){qn(jt),vr()},[]),Object(n.useEffect)(function(){return window.addEventListener("click",tr),function(){window.removeEventListener("click",tr)}},[Wn==null?void 0:Wn.save_identifier,Ft]),Object(n.useEffect)(function(){var Gt=ar.current.findIndex(function(Hn){return Hn.identifier===(Wn==null?void 0:Wn.save_identifier)}),Yt=ar.current[Gt-1],Qt=ar.current[Gt+1],xn=document.getElementById("oj-prev"),cn=document.getElementById("oj-next");Yt?xn.style.display="block":xn.style.display="none",Qt?cn.style.display="block":cn.style.display="none"},[Wn==null?void 0:Wn.save_identifier,ar.current]);var vn=function(Yt,Qt){if(Yt.id===Qt)return Yt;for(var xn=0,cn=Yt;cn=cn.parentNode;xn++){if(cn.id===Qt)return cn;if(cn==document.documentElement)return!1}},tr=function(){var Gt=Object(c.a)(i.a.mark(function Yt(Qt){var xn,cn,Hn;return i.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:if(!vn(Qt.target,"oj-drawer")&&Ft&&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],!(Qt.target.id==="oj-prev")){Mn.next=14;break}if(!(!cn||xn===-1)){Mn.next=8;break}return C.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),Mn.abrupt("return");case 8:return Qt.target.style.pointerEvents="none",Qt.target.style.cursor="not-allowed",Mn.next=12,yn(cn==null?void 0:cn.identifier);case 12:bt("0"),setTimeout(function(){Qt.target.style.pointerEvents="auto",Qt.target.style.cursor="pointer"},400);case 14:if(!(Qt.target.id==="oj-next"||Qt.target.id==="oj-modal-next")){Mn.next=24;break}if(!(!Hn||xn===-1)){Mn.next=18;break}return C.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),Mn.abrupt("return");case 18:return Qt.target.style.pointerEvents="none",Qt.target.style.cursor="not-allowed",Mn.next=22,yn(Hn==null?void 0:Hn.identifier);case 22:bt("0"),setTimeout(function(){Qt.target.style.pointerEvents="auto",Qt.target.style.cursor="pointer"},400);case 24:case"end":return Mn.stop()}},Yt)}));return function(Qt){return Gt.apply(this,arguments)}}();Object(n.useEffect)(function(){Et(Wn==null?void 0:Wn.save_identifier);var Gt=Gn.findIndex(function(Yt){return Yt.some(function(Qt){return Qt.identifier===(Wn==null?void 0:Wn.save_identifier)})});Gt===-1?dn(Object(a.a)(Object(a.a)({},jt),{},{page:1})):dn(Object(a.a)(Object(a.a)({},jt),{},{page:Gt+1}))},[Wn==null?void 0:Wn.save_identifier,Gn]);var or=function(Yt){jt.page=1,jt.tag_discipline_id=Yt,dn(Object(a.a)({},jt)),qn(jt)},vr=function(){var Gt=Object(c.a)(i.a.mark(function Yt(){var Qt;return i.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return cn.next=2,Object(Me.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:Qt=cn.sent,er(Qt.tag_disciplines||[]);case 4:case"end":return cn.stop()}},Yt)}));return function(){return Gt.apply(this,arguments)}}(),Jn=function(Yt){jt.page=1,jt.difficulty=typeof Yt=="number"?Yt:null,dn(Object(a.a)({},jt)),qn(jt)},qn=function(){var Gt=Object(c.a)(i.a.mark(function Yt(Qt){var xn,cn,Hn,bn,Mn,Tn;return i.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:return xr(!0),sr.next=3,Object(m.p)(Qt);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+=jt==null?void 0:jt.per_page)bn.push(xn==null||((Tn=xn.practices_list)===null||Tn===void 0)?void 0:Tn.slice(Mn,Mn+(jt==null?void 0:jt.per_page)));dn(Object(a.a)(Object(a.a)({},jt),{},{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()}},Yt)}));return function(Qt){return Gt.apply(this,arguments)}}(),yn=function(){var Gt=Object(c.a)(i.a.mark(function Yt(Qt,xn){var cn;return i.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(Me.a)("/api/practices/".concat(Qt,"/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(Qt));case 4:case"end":return bn.stop()}},Yt)}));return function(Qt,xn){return Gt.apply(this,arguments)}}(),Ln=function(Yt){jt.page=Yt,dn(Object(a.a)({},jt))};return t.a.createElement("div",{className:ui.a.wrap,id:"oj-drawer",style:{left:Ft?0:-700}},t.a.createElement("div",{className:ui.a.head},t.a.createElement("div",{className:ui.a.title},"\u9898\u76EE\u5217\u8868"),t.a.createElement(ne.a.Search,{value:jt==null?void 0:jt.save_search,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22",style:{width:178,marginLeft:"auto",marginRight:10},onChange:function(Yt){jt.save_search=Yt.target.value,dn(Object(a.a)({},jt))},onSearch:function(){jt.page=1,jt.search=jt.save_search,dn(Object(a.a)({},jt)),qn(jt)}}),t.a.createElement(w.a,{value:jt==null?void 0:jt.tag_discipline_id,style:{width:210},mode:"multiple",placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,showArrow:!0,getPopupContainer:function(Yt){return Yt.parentNode},maxTagTextLength:2,maxTagCount:2,onChange:or},En.map(function(Gt){return t.a.createElement(w.a.Option,{key:Gt.id,value:Gt.id},Gt.name)})),t.a.createElement(w.a,{style:{width:70,marginLeft:10},allowClear:!0,placeholder:"\u96BE\u5EA6",getPopupContainer:function(Yt){return Yt.parentNode},value:jt==null?void 0:jt.difficulty,onChange:Jn},t.a.createElement(w.a.Option,{value:1},"\u7B80\u5355"),t.a.createElement(w.a.Option,{value:2},"\u9002\u4E2D"),t.a.createElement(w.a.Option,{value:3},"\u56F0\u96BE"))),t.a.createElement("div",{className:ui.a.content},t.a.createElement(S.a,{spinning:gr},Gn==null||((Tt=Gn[jt.page-1])===null||Tt===void 0)?void 0:Tt.map(function(Gt){return t.a.createElement("div",{key:Gt.identifier,className:ui.a.list,onClick:function(Qt){return yn(Gt.identifier,Qt)}},t.a.createElement("i",{style:{visibility:fn===Gt.identifier?"visible":"hidden"},className:"iconfont icon-wancheng1 c-green-29b"}),t.a.createElement("span",{style:{fontWeight:fn===Gt.identifier?"bold":400,color:fn===Gt.identifier?"#ffffff":"#bac4cd"},title:Gt==null?void 0:Gt.name},Gt.name),(Gt==null?void 0:Gt.difficulty)===1&&t.a.createElement("b",{style:{color:"#2FA34F"}},"\u7B80\u5355"),(Gt==null?void 0:Gt.difficulty)===2&&t.a.createElement("b",{style:{color:"#0152d9"}},"\u9002\u4E2D"),(Gt==null?void 0:Gt.difficulty)===3&&t.a.createElement("b",{style:{color:"#FA6400"}},"\u56F0\u96BE"))}))),t.a.createElement("div",{className:ui.a.footer},t.a.createElement(Pe.a,{showTotal:function(Yt){return t.a.createElement("span",{style:{color:"#656F87"}},"\u5171",t.a.createElement("span",{className:"c-light-primary"},Yt),"\u6761\u6570\u636E")},total:jt.total,pageSize:jt==null?void 0:jt.per_page,current:jt==null?void 0:jt.page,showSizeChanger:!1,onChange:Ln,showQuickJumper:!0,hideOnSinglePage:!0})))},ta=Di,ci=function(ft){var gt,Tt=ft.hack,Ft=ft.onTriggerPraise,mn=ft.topicId,fn=ft.page,Et=ft.onPageChange,bt=ft.user,$t=ft.submitRecords,xt=ft.submitting,on=ft.submitResult,jt=Object(g.h)(),dn=Object(n.useState)((jt==null||((gt=jt.query)===null||gt===void 0)?void 0:gt.tab)||"0"),$n=Object(l.a)(dn,2),Dn=$n[0],En=$n[1],er=Object(n.useState)(0),Rn=Object(l.a)(er,2),kn=Rn[0],Gn=Rn[1],Tr=Object(n.useState)(0),ir=Object(l.a)(Tr,2),dr=ir[0],gr=ir[1],xr=Object(n.useState)(0),ar=Object(l.a)(xr,2),fr=ar[0],Wn=ar[1],Xt=Object(n.useState)(),vn=Object(l.a)(Xt,2),tr=vn[0],or=vn[1],vr=Object(n.useState)(!1),Jn=Object(l.a)(vr,2),qn=Jn[0],yn=Jn[1];function Ln(Yt){var Qt=Yt.target.id;if(Dn==="3"&&Qt!==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(){En(Qt)}});return}En(Qt)}Object(n.useEffect)(function(){var Yt=tt.a.subscribe("to-commit-info",function(){En("1")});return Yt},[]);function Gt(){En("2")}return t.a.createElement("div",{className:Oe.a["left-panel"]},t.a.createElement("ul",{className:"".concat(Oe.a["s-navs"]," ").concat(Oe.a["bg-white"]," ").concat(Oe.a.b1)},t.a.createElement("li",{className:"mr40 current"},t.a.createElement("img",{onClick:function(){return yn(!0)},src:qe.a})),t.a.createElement("li",{className:Oe.a["oj-mr"]},t.a.createElement("a",{className:Dn==="0"?Oe.a.active:"",id:"0",onClick:Ln},"\u4EFB\u52A1\u63CF\u8FF0")),t.a.createElement("li",{className:Oe.a["oj-mr"]},t.a.createElement("a",{className:Dn==="3"?Oe.a.active:"",id:"3",onClick:Ln},"\u9898\u89E3",fr?"(".concat(fr,")"):"")),t.a.createElement("li",{className:Oe.a["oj-mr"]},t.a.createElement("a",{className:Dn==="2"?Oe.a.active:"",id:"2",onClick:Ln},"\u8BC4\u8BBA",kn?"(".concat(kn,")"):"")),t.a.createElement("li",null,t.a.createElement("a",{className:Dn==="1"?Oe.a.active:"",id:"1",onClick:Ln},"\u63D0\u4EA4\u8BB0\u5F55"))),t.a.createElement("div",{className:"".concat(Oe.a["tab-panel-body"]," ").concat(Dn==="0"?"":"hide"),style:{padding:"0 0 0 16px"}},t.a.createElement(je,{hack:Tt,onTriggerPraise:Ft,toDiscuss:Gt})),t.a.createElement("div",{className:"".concat(Oe.a["tab-panel-body"]," ").concat(Dn==="1"?"":"hide")},$t!=null&&$t.records_count?t.a.createElement(te,{page:fn,onPageChange:Et,topicId:mn,submitting:xt,submitRecords:$t,submitResult:on}):t.a.createElement(P.a,null)),t.a.createElement("div",{className:"".concat(Oe.a["tab-panel-body"]," ").concat(Dn==="2"?"":"hide"),style:{padding:0}},t.a.createElement(Nt,{setDiscussTotal:Gn,user:bt,identifier:Tt.identifier,hack:Tt,onTriggerPraise:Ft})),t.a.createElement("div",{className:"".concat(Oe.a["tab-panel-body"]," ").concat(Dn==="3"?"":"hide"),style:{padding:0}},t.a.createElement(ni,{setListStatus:gr,setFilterListTotal:Wn,tabStatus:Dn,identifier:Tt.identifier})),t.a.createElement(ta,{visible:qn,setIndex:En,onVisible:function(Qt){return yn(Qt)},value:tr,onChange:function(Qt){return or(Qt)}}))},Fi=function(gt){return String(gt).length===1?"0".concat(gt):gt},wi=function(gt){var Tt=gt.className,Ft=Tt===void 0?"":Tt,mn=gt.onChange,fn=Object(n.useState)(0),Et=Object(l.a)(fn,2),bt=Et[0],$t=Et[1];Object(n.useEffect)(function(){var dn=setTimeout(function(){$t(bt+1e3)},1e3);return mn(bt+1e3),function(){clearInterval(dn)}},[bt]);var xt=parseInt(bt/(60*6e4))||"00",on=parseInt(bt%(60*6e4)/6e4)||"00",jt=parseInt(bt%6e4/1e3)||"00";return t.a.createElement("div",{className:Ft},Fi(xt),":",Fi(on),":",Fi(jt))},Ki=wi,Qi=H("oFv4"),yi=H.n(Qi),aa=H("S/kP"),ma=H.n(aa),ln=H("t/PP"),wn=H.n(ln),pn=H("LvDl"),Un=H.n(pn),ur=H("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(a.a)(Object(a.a)({},ft),gt.payload);case hn.SET_DATA:return Object(a.a)(Object(a.a)({},ft),{},{data:gt.payload});case hn.SET_LOADING:return Object(a.a)(Object(a.a)({},ft),{},{loading:gt.payload});case hn.GET_LANGUAGE:return Object(a.a)(Object(a.a)({},ft),{},{languageList:gt.payload});case hn.GET_DRAWER:return Object(a.a)(Object(a.a)({},ft),{},{drawerData:gt.payload});case hn.SET_SHOW_NOTE:return Object(a.a)(Object(a.a)({},ft),{},{showNote:gt.payload});case hn.SET_DEBUGING:return Object(a.a)(Object(a.a)({},ft),{},{debuging:gt.payload});case hn.SET_SUBMITING:return Object(a.a)(Object(a.a)({},ft),{},{submitting:gt.payload});case hn.GET_SUBMIT_RECORDS:return Object(a.a)(Object(a.a)({},ft),{},{submitRecords:gt.payload});case hn.SET_PAGE:return Object(a.a)(Object(a.a)({},ft),{},{submitRecordPage:gt.payload});case hn.SET_EXECUTE_MESSAGE:return Object(a.a)(Object(a.a)({},ft),{},{executingMessage:gt.payload});case hn.SET_EXECUTE_RESULT:return Object(a.a)(Object(a.a)({},ft),gt.payload);case hn.SET_SUBMIT_RESULT:return Object(a.a)(Object(a.a)({},ft),gt.payload);default:throw new Error}}var cr=$e.default=function(ft){var gt,Tt,Ft=ft.children,mn=Object(n.useReducer)(Bi,Bn),fn=Object(l.a)(mn,2),Et=fn[0],bt=fn[1],$t=Object(g.i)(),xt=$t.id,on=Object(g.g)(),jt=Object(g.h)(),dn=Et.languageValue,$n=Et.languageList,Dn=Et.loading,En=Et.data,er=Et.debugResult,Rn=Et.submitResult,kn=Et.submitRecords,Gn=Et.submitRecordPage,Tr=Et.showNote,ir=Et.debuging,dr=Et.submitting,gr=Et.executingMessage,xr=Object(n.useState)("#FFF"),ar=Object(l.a)(xr,2),fr=ar[0],Wn=ar[1],Xt=Object(n.useState)(null),vn=Object(l.a)(Xt,2),tr=vn[0],or=vn[1],vr=Object(n.useState)({}),Jn=Object(l.a)(vr,2),qn=Jn[0],yn=Jn[1],Ln=Object(n.useState)(!1),Gt=Object(l.a)(Ln,2),Yt=Gt[0],Qt=Gt[1],xn=Object(n.useRef)(null),cn=Object(n.useRef)(null),Hn=En==null?void 0:En.user,bn=En==null?void 0:En.hack;Object(n.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(n.useEffect)(function(){setTimeout(function(){document.title="\u5728\u7EBF\u5237\u9898"},400)}),Object(n.useEffect)(function(){if(Yt){var zn,Cn=document.getElementById("oj-next"),Yn=document.getElementById("oj-modal-next");(Cn==null||((zn=Cn.style)===null||zn===void 0)?void 0:zn.display)==="none"?Yn.style.display="none":Yn.style.display="block"}},[Yt]),Object(n.useEffect)(function(){function zn(){return Cn.apply(this,arguments)}function Cn(){return Cn=Object(c.a)(i.a.mark(function Yn(){var Zt,Pn,Or,Gr,Vr;return i.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return gn.next=2,Object(m.m)(xt);case 2:Zt=gn.sent,Zt.status===401?document.location.href="/user/login":(Zt.hack=Zt.practice,Zt.hack.code=A.Base64.decode(Zt==null||((Pn=Zt.hack)===null||Pn===void 0)?void 0:Pn.code),Vr="".concat(Hn==null?void 0:Hn.login,"-language"),localStorage.getItem(Vr)&&(Zt.hack.language=localStorage.getItem(Vr)),cn.current=Un.a.cloneDeep(Zt),cn.current.language=Zt==null||((Or=Zt.hack)===null||Or===void 0)?void 0:Or.language,bt({type:hn.GET_DATA,payload:{loading:!1,data:Zt}}),bt({type:hn.SET_SUBMIT_RESULT,payload:{languageValue:Zt==null||((Gr=Zt.hack)===null||Gr===void 0)?void 0:Gr.language}}));case 4:case"end":return gn.stop()}},Yn)})),Cn.apply(this,arguments)}xt&&zn()},[xt]),Object(n.useEffect)(function(){bt({type:hn.SET_SUBMIT_RESULT,payload:{debugResult:void 0}}),sr(),Qt(!1)},[xt]),Object(n.useEffect)(function(){clearTimeout(xn.current)},[xt]),Object(n.useEffect)(function(){Tn()},[xt,Gn]);var Mn=function(){window.parent.postMessage("backExercise","*")};function Tn(){return Vn.apply(this,arguments)}function Vn(){return Vn=Object(c.a)(i.a.mark(function zn(){var Cn;return i.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.prev=0,Zt.next=3,Object(m.o)(xt,{limit:15,page:Gn});case 3:Cn=Zt.sent,bt({type:hn.GET_SUBMIT_RECORDS,payload:Cn}),Zt.next=10;break;case 7:Zt.prev=7,Zt.t0=Zt.catch(0),console.log(Zt.t0);case 10:case"end":return Zt.stop()}},zn,null,[[0,7]])})),Vn.apply(this,arguments)}function sr(){return br.apply(this,arguments)}function br(){return br=Object(c.a)(i.a.mark(function zn(){var Cn;return i.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.prev=0,Zt.next=3,Object(m.w)(xt);case 3:Cn=Zt.sent,bt({type:hn.GET_LANGUAGE,payload:Cn==null?void 0:Cn.data}),Zt.next=10;break;case 7:Zt.prev=7,Zt.t0=Zt.catch(0),console.log(Zt.t0);case 10:case"end":return Zt.stop()}},zn,null,[[0,7]])})),br.apply(this,arguments)}function Pr(zn){bt({type:hn.SET_PAGE,payload:zn})}function ei(zn){return Mi.apply(this,arguments)}function Mi(){return Mi=Object(c.a)(i.a.mark(function zn(Cn){var Yn,Zt,Pn,Or,Gr,Vr;return i.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return Gr=((Yn=window)===null||Yn===void 0||((Zt=Yn.location)===null||Zt===void 0||((Pn=Zt.pathname)===null||Pn===void 0||((Or=Pn.split("/"))===null||Or===void 0)))?void 0:Or[2])||xt,gn.next=3,Object(m.v)(Gr,Cn||{code:A.Base64.encode(bn.code),language:dn});case 3:return Vr=gn.sent,gn.abrupt("return",Vr);case 5:case"end":return gn.stop()}},zn)})),Mi.apply(this,arguments)}function $r(){return Wi.apply(this,arguments)}function Wi(){return Wi=Object(c.a)(i.a.mark(function zn(){var Cn,Yn,Zt,Pn,Or,Gr,Vr;return i.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:if(!dr){gn.next=2;break}return gn.abrupt("return");case 2:return bt({type:hn.SET_SUBMITING,payload:!0}),gn.prev=3,tt.a.publish("to-commit-info"),gn.next=7,ei();case 7:if(Cn=gn.sent,!(Cn.status===0)){gn.next=21;break}return Vr=function(){return Vr=Object(c.a)(i.a.mark(function oa(){var Yi,zi,$i,sa,la,Zi;return i.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:return Ir.next=2,Object(m.l)(xt,"submit");case 2:if(Yi=Ir.sent,zi=Yi.status,$i=Yi.data,sa=Fr(),la=sa-Or>(Pn+3)*1e3,zi!==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"}),bt({type:hn.SET_SUBMITING,payload:!1}),Ir.abrupt("return");case 12:if(!(zi===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(m.o)(xt,{limit:15,page:Gn});case 16:Zi=Ir.sent,bt({type:hn.SET_SUBMIT_RESULT,payload:Object(a.a)(Object(a.a)({},Et),{},{submitResult:$i,submitting:!1,submitRecords:Zi})}),($i==null?void 0:$i.status)===0&&Qt(!0);case 19:case"end":return Ir.stop()}},oa)})),Vr.apply(this,arguments)},Gr=function(){return Vr.apply(this,arguments)},Yn={},gn.next=14,Object(m.s)(xt,Yn);case 14:if(Zt=gn.sent,!(Zt.status===-1)){gn.next=18;break}return window.parent.location.href="/classrooms/".concat(jt.query.coursesId,"/exercise/").concat(jt.query.exercisesId,"/detail"),gn.abrupt("return");case 18:Pn=bn.time_limit,Or=Fr(),Gr();case 21:gn.next=26;break;case 23:gn.prev=23,gn.t0=gn.catch(3),bt({type:hn.SET_SUBMITING,payload:!1});case 26:case"end":return gn.stop()}},zn,null,[[3,23]])})),Wi.apply(this,arguments)}function na(){return Gi.apply(this,arguments)}function Gi(){return Gi=Object(c.a)(i.a.mark(function zn(){var Cn,Yn,Zt,Pn,Or,Gr,Vr;return i.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return Et.debuging=!0,bt({type:hn.SET_DEBUGING,payload:!0}),gn.prev=2,gn.next=5,ei();case 5:if(Cn=gn.sent,!(Cn.status===0)){gn.next=21;break}return Vr=function(){return Vr=Object(c.a)(i.a.mark(function oa(){var Yi,zi,$i,sa,la,Zi;return i.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:return Ir.next=2,Object(m.l)(xt,"debug");case 2:if(Yi=Ir.sent,zi=Yi.status,$i=Yi.message,sa=Yi.data,la=Fr(),Zi=la-Or>(Yn+3)*1e3,zi!==0&&!Zi&&(bt({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"}),bt({type:hn.SET_DEBUGING,payload:!1}),Ir.abrupt("return");case 13:zi===0&&(bt({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"}),bt({type:hn.SET_EXECUTE_RESULT,payload:Object(a.a)(Object(a.a)({},Et),{},{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,Zt={input:encodeURIComponent(En.test_case.input)},gn.next=13,Object(m.h)(xt,Zt);case 13:if(Pn=gn.sent,!(Pn.status===-1)){gn.next=17;break}return window.parent.location.href="/classrooms/".concat(jt.query.coursesId,"/exercise/").concat(jt.query.exercisesId,"/detail"),gn.abrupt("return");case 17:Or=Fr(),Gr(),gn.next=22;break;case 21:bt({type:hn.SET_DEBUGING,payload:!1});case 22:gn.next=27;break;case 24:gn.prev=24,gn.t0=gn.catch(2),console.log(gn.t0);case 27:return gn.prev=27,gn.finish(27);case 29:case"end":return gn.stop()}},zn,null,[[2,24,27,29]])})),Gi.apply(this,arguments)}function di(zn){var Cn;clearTimeout(xn.current),xn.current=setTimeout(function(){var Yn;ei({code:A.Base64.encode(zn),language:cn==null||((Yn=cn.current)===null||Yn===void 0)?void 0:Yn.language})},2e3),bt({type:hn.SET_DATA,payload:Object(a.a)(Object(a.a)({},cn==null?void 0:cn.current),{},{hack:Object(a.a)(Object(a.a)({},cn==null||((Cn=cn.current)===null||Cn===void 0)?void 0:Cn.hack),{},{code:zn})})})}function Vi(zn){var Cn=zn.target.value;bt({type:hn.SET_DATA,payload:Object(a.a)(Object(a.a)({},En),{},{test_case:{input:Cn}})})}var Xn=function(){var zn=Object(c.a)(i.a.mark(function Cn(Yn){var Zt,Pn,Or,Gr,Vr;return i.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return bt({type:hn.SET_LOADING,payload:!0}),gn.next=3,ei();case 3:if(Zt=gn.sent,!(Zt.status===0)){gn.next=14;break}return bt({type:hn.SET_SUBMIT_RESULT,payload:{languageValue:Yn}}),cn.current.language=Yn,Pn="".concat(Hn==null?void 0:Hn.login,"-language"),localStorage.setItem(Pn,Yn),gn.next=11,Object(m.w)(xt);case 11:Or=gn.sent,Or.status===0&&(Vr=Or==null||((Gr=Or.data)===null||Gr===void 0)?void 0:Gr.find(function(Hi){return Hi.language===Yn}),di(A.Base64.decode(Vr.code))),setTimeout(function(){bt({type:hn.SET_LOADING,payload:!1})},300);case 14:case"end":return gn.stop()}},Cn)}));return function(Yn){return zn.apply(this,arguments)}}();function On(){return nr.apply(this,arguments)}function nr(){return nr=Object(c.a)(i.a.mark(function zn(){var Cn;return i.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.prev=0,Zt.next=3,Object(m.q)(xt,{language:dn});case 3:Cn=Zt.sent,Cn.status===401?on.replace("/login",{from:jt.pathname}):(di(A.Base64.decode(Cn.code)),sr()),Zt.next=10;break;case 7:Zt.prev=7,Zt.t0=Zt.catch(0),console.log(Zt.t0);case 10:case"end":return Zt.stop()}},zn,null,[[0,7]])})),nr.apply(this,arguments)}function lr(){p.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:t.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",t.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(c.a)(i.a.mark(function Cn(){var Yn;return i.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Pn.next=2,Object(m.t)(xt,{language:dn});case 2:Yn=Pn.sent,Yn.status===401?on.replace("/login",{from:jt.pathname}):di(A.Base64.decode(Yn.code));case 4:case"end":return Pn.stop()}},Cn)}))()}})}function Wr(){bt({type:hn.SET_SHOW_NOTE,payload:!0})}function In(){bt({type:hn.SET_SHOW_NOTE,payload:!1})}function ri(zn){return Ur.apply(this,arguments)}function Ur(){return Ur=Object(c.a)(i.a.mark(function zn(Cn){return i.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(m.b)(xt,Cn);case 2:bt({type:hn.GET_DATA,payload:{showNote:!1,data:Object(a.a)(Object(a.a)({},En),{},{hack:Object(a.a)(Object(a.a)({},bn),{},{notes:Cn.notes})})}});case 3:case"end":return Zt.stop()}},zn)})),Ur.apply(this,arguments)}var Jr={input:En==null||((gt=En.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:gr,id:xt,languageValue:dn,languageList:$n,onChangeLanguage:Xn,onCancelNote:In,onAddNote:ri,showNote:Tr,onShowNote:Wr,onSubmitCode:$r,onChangeCode:di,onChangeInput:Vi,onDebugCode:na,onResetCode:On,onSyncCode:lr,onUpdateCode:ei};function Ci(){return Ii.apply(this,arguments)}function Ii(){return Ii=Object(c.a)(i.a.mark(function zn(){var Cn,Yn,Zt;return i.a.wrap(function(Or){for(;;)switch(Or.prev=Or.next){case 0:return Or.next=2,Object(m.u)(bn.id,{container_type:"Hack",type:1});case 2:Cn=Or.sent,Yn=Cn.praise_count,Zt=Object(a.a)(Object(a.a)({},En),{},{hack:Object(a.a)(Object(a.a)({},bn),{},{praises_count:Yn,user_praise:!bn.user_praise})}),bt({type:hn.SET_DATA,payload:Zt});case 6:case"end":return Or.stop()}},zn)})),Ii.apply(this,arguments)}var Xi={topicId:xt,submitResult:Rn,submitRecords:kn,submitting:dr,page:Gn,onPageChange:Pr,hack:bn,user:En==null?void 0:En.user,onTriggerPraise:Ci};return console.log(En,cn==null?void 0:cn.current,"data--------"),t.a.createElement(t.a.Fragment,null,t.a.createElement(S.a,{className:"oj-custom-large-spin",size:"large",spinning:Dn},En?t.a.createElement("div",{className:"oj-custom-warp"},t.a.createElement("header",{className:D.a.header,style:{minWidth:1200}},t.a.createElement("div",null,t.a.createElement("img",{src:"".concat(E.a.IMG_SERVER,"/images/").concat(Hn.image_url),alt:"user",width:30}),t.a.createElement("span",null,Hn.name)),t.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},t.a.createElement("div",null,bn.name),t.a.createElement(Ki,{onChange:function(Cn){},className:"font12 c-grey-999"})),t.a.createElement(ur.CopyToClipboard,{text:"".concat((Tt=window.location)===null||Tt===void 0?void 0:Tt.origin,"/problems/").concat(bn.identifier,"/share"),onCopy:function(){return C.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},t.a.createElement("span",{className:D.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",t.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),bn.edit_privilege?t.a.createElement(_.a,{className:D.a.btn_back,to:"/problems/".concat(bn.identifier,"/ojedit"),style:{marginRight:10}}," ",t.a.createElement(d.a,null)," \u7F16\u8F91"):null,t.a.createElement(_.a,{className:D.a.btn_back,to:"/problems"}," ",t.a.createElement(v.a,null),"\u9000\u51FA")),t.a.createElement(y.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:t.a.createElement(ci,Xi),rightChild:t.a.createElement(bi,Jr)})):null),t.a.createElement(p.a,{centered:!0,closable:!1,width:680,footer:null,visible:Yt,className:"oj-modal"},t.a.createElement("section",{className:"oj-modal-content"},t.a.createElement("div",{className:"oj-modal-head"},t.a.createElement("img",{src:yi.a,alt:""}),t.a.createElement("i",{onClick:function(){return Qt(!1)},className:"iconfont icon-guanbi1"})),t.a.createElement("aside",null,t.a.createElement("img",{className:"mr30",src:wn.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",t.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Rn==null?void 0:Rn.execute_time,"s"),"\u4F18\u4E8E",t.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Rn==null?void 0:Rn.time_better_than)||100,"%"),"\u7684\u7528\u6237"),t.a.createElement("aside",{className:"mb50"},t.a.createElement("img",{src:ma.a,className:"mr30"}),t.a.createElement("span",{className:"oj-modal-tt"},t.a.createElement("span",null,t.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),t.a.createElement("span",{className:"c-light-primary"},Rn==null?void 0:Rn.execute_memory,"kb")),t.a.createElement("span",null,t.a.createElement("span",null))),"\u4F18\u4E8E",t.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Rn==null?void 0:Rn.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),t.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function Br(ft){var gt=ft.languageValue,Tt=ft.languageList,Ft=ft.onChangeLanguage,mn=ft.title,fn=ft.modify_code,Et=ft.onSyncCode,bt=ft.onShowCodeSetting,$t=ft.onResetCode,xt=Object(g.h)(),on=function(){p.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:t.a.createElement(o.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:$t})};return t.a.createElement("div",{className:"action-bar"},t.a.createElement(w.a,{className:"oj-select",value:gt,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:Ft},Tt==null?void 0:Tt.map(function(jt){return t.a.createElement(w.a.Option,{key:jt.language,value:jt.language},jt.language)})),t.a.createElement("span",null),t.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:on},t.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),t.a.createElement("a",{onClick:bt},t.a.createElement("i",{className:"iconfont icon-shezhi"})))}function bi(ft){var gt=ft.id,Tt=ft.input,Ft=ft.showNote,mn=ft.onShowNote,fn=ft.notes,Et=ft.onCancelNote,bt=ft.onAddNote,$t=ft.debugResult,xt=ft.language,on=ft.debuging,jt=ft.submitting,dn=ft.executingMessage,$n=ft.code,Dn=ft.onSubmitCode,En=ft.onDebugCode,er=ft.onChangeCode,Rn=ft.onChangeInput,kn=ft.onUpdateCode,Gn=Object(ee.a)(ft,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function Tr(dr){return t.a.createElement(Br,Object(de.a)({},Gn,{onShowCodeSetting:dr}))}var ir={id:gt,input:Tt,debugResult:$t,debuging:on,submitting:jt,executingMessage:dn,onDebugCode:En,onChangeCode:er,onSubmitCode:Dn,onChangeInput:Rn};return t.a.createElement("div",{className:"right-panel"},t.a.createElement(x.a,{language:xt,value:$n,onChange:er,ActionBarRender:Tr}),t.a.createElement("div",{className:"note-form-area ".concat(Ft?"active":"")},t.a.createElement(ue,{onCancel:Et,notes:fn,callback:bt})),t.a.createElement(W.b,ir))}},WaYH:function(rt,$e,H){"use strict";var de=H("rePB"),ee=H("Ff2n"),j=H("VTBJ"),w=H("1OyB"),k=H("vuIU"),S=H("JX7q"),T=H("Ji7U"),C=H("LK+K"),h=H("q1tI"),p=H("TSYQ"),c=H.n(p),l=H("sboe"),a=H("OZM5"),u=function(_){var m=_.prefixCls,y=_.level,E=_.isStart,o=_.isEnd;if(!y)return null;for(var x="".concat(m,"-indent-unit"),A=[],O=0;O<y;O+=1){var D;A.push(h.createElement("span",{key:O,className:c()(x,(D={},Object(de.a)(D,"".concat(x,"-start"),E[O+1]),Object(de.a)(D,"".concat(x,"-end"),o[O+1]),Object(de.a)(D,"".concat(x,"-end-first-level"),!O&&o[0]),D))}))}return h.createElement("span",{"aria-hidden":"true",className:"".concat(m,"-indent")},A)},s=u,f=H("815F"),i="open",n="close",t="---",d=function(b){Object(T.a)(m,b);var _=Object(C.a)(m);function m(){var y;return Object(w.a)(this,m),y=_.apply(this,arguments),y.state={dragNodeHighlight:!1},y.onSelectorClick=function(E){var o=y.props.context.onNodeClick;o(E,Object(f.b)(y.props)),y.isSelectable()?y.onSelect(E):y.onCheck(E)},y.onSelectorDoubleClick=function(E){var o=y.props.context.onNodeDoubleClick;o(E,Object(f.b)(y.props))},y.onSelect=function(E){if(y.isDisabled())return;var o=y.props.context.onNodeSelect;E.preventDefault(),o(E,Object(f.b)(y.props))},y.onCheck=function(E){if(y.isDisabled())return;var o=y.props,x=o.disableCheckbox,A=o.checked,O=y.props.context.onNodeCheck;if(!y.isCheckable()||x)return;E.preventDefault();var D=!A;O(E,Object(f.b)(y.props),D)},y.onMouseEnter=function(E){var o=y.props.context.onNodeMouseEnter;o(E,Object(f.b)(y.props))},y.onMouseLeave=function(E){var o=y.props.context.onNodeMouseLeave;o(E,Object(f.b)(y.props))},y.onContextMenu=function(E){var o=y.props.context.onNodeContextMenu;o(E,Object(f.b)(y.props))},y.onDragStart=function(E){var o=y.props.context.onNodeDragStart;E.stopPropagation(),y.setState({dragNodeHighlight:!0}),o(E,Object(S.a)(y));try{E.dataTransfer.setData("text/plain","")}catch(x){}},y.onDragEnter=function(E){var o=y.props.context.onNodeDragEnter;E.preventDefault(),E.stopPropagation(),o(E,Object(S.a)(y))},y.onDragOver=function(E){var o=y.props.context.onNodeDragOver;E.preventDefault(),E.stopPropagation(),o(E,Object(S.a)(y))},y.onDragLeave=function(E){var o=y.props.context.onNodeDragLeave;E.stopPropagation(),o(E,Object(S.a)(y))},y.onDragEnd=function(E){var o=y.props.context.onNodeDragEnd;E.stopPropagation(),y.setState({dragNodeHighlight:!1}),o(E,Object(S.a)(y))},y.onDrop=function(E){var o=y.props.context.onNodeDrop;E.preventDefault(),E.stopPropagation(),y.setState({dragNodeHighlight:!1}),o(E,Object(S.a)(y))},y.onExpand=function(E){var o=y.props.context.onNodeExpand;o(E,Object(f.b)(y.props))},y.setSelectHandle=function(E){y.selectHandle=E},y.getNodeState=function(){var E=y.props.expanded;return y.isLeaf()?null:E?i:n},y.hasChildren=function(){var E=y.props.eventKey,o=y.props.context.keyEntities,x=o[E]||{},A=x.children;return!!(A||[]).length},y.isLeaf=function(){var E=y.props,o=E.isLeaf,x=E.loaded,A=y.props.context.loadData,O=y.hasChildren();return o===!1?!1:o||!A&&!O||A&&x&&!O},y.isDisabled=function(){var E=y.props.disabled,o=y.props.context.disabled;return!!(o||E)},y.isCheckable=function(){var E=y.props.checkable,o=y.props.context.checkable;return!o||E===!1?!1:o},y.syncLoadData=function(E){var o=E.expanded,x=E.loading,A=E.loaded,O=y.props.context,D=O.loadData,N=O.onNodeLoad;if(x)return;D&&o&&!y.isLeaf()&&(!y.hasChildren()&&!A&&N(Object(f.b)(y.props)))},y.renderSwitcher=function(){var E=y.props,o=E.expanded,x=E.switcherIcon,A=y.props.context,O=A.prefixCls,D=A.switcherIcon,N=x||D;if(y.isLeaf())return h.createElement("span",{className:c()("".concat(O,"-switcher"),"".concat(O,"-switcher-noop"))},typeof N=="function"?N(Object(j.a)(Object(j.a)({},y.props),{},{isLeaf:!0})):N);var W=c()("".concat(O,"-switcher"),"".concat(O,"-switcher_").concat(o?i:n));return h.createElement("span",{onClick:y.onExpand,className:W},typeof N=="function"?N(Object(j.a)(Object(j.a)({},y.props),{},{isLeaf:!1})):N)},y.renderCheckbox=function(){var E=y.props,o=E.checked,x=E.halfChecked,A=E.disableCheckbox,O=y.props.context.prefixCls,D=y.isDisabled(),N=y.isCheckable();if(!N)return null;var W=typeof N!="boolean"?N:null;return h.createElement("span",{className:c()("".concat(O,"-checkbox"),o&&"".concat(O,"-checkbox-checked"),!o&&x&&"".concat(O,"-checkbox-indeterminate"),(D||A)&&"".concat(O,"-checkbox-disabled")),onClick:y.onCheck},W)},y.renderIcon=function(){var E=y.props.loading,o=y.props.context.prefixCls;return h.createElement("span",{className:c()("".concat(o,"-iconEle"),"".concat(o,"-icon__").concat(y.getNodeState()||"docu"),E&&"".concat(o,"-icon_loading"))})},y.renderSelector=function(){var E=y.state.dragNodeHighlight,o=y.props,x=o.title,A=o.selected,O=o.icon,D=o.loading,N=o.data,W=y.props.context,K=W.prefixCls,oe=W.showIcon,B=W.icon,X=W.draggable,V=W.loadData,ne=W.titleRender,$=y.isDisabled(),Z="".concat(K,"-node-content-wrapper"),ue;if(oe){var he=O||B;ue=he?h.createElement("span",{className:c()("".concat(K,"-iconEle"),"".concat(K,"-icon__customize"))},typeof he=="function"?he(y.props):he):y.renderIcon()}else V&&D&&(ue=y.renderIcon());var Oe;typeof x=="function"?Oe=x(N):ne?Oe=ne(N):Oe=x;var we=h.createElement("span",{className:"".concat(K,"-title")},Oe);return h.createElement("span",{ref:y.setSelectHandle,title:typeof x=="string"?x:"",className:c()("".concat(Z),"".concat(Z,"-").concat(y.getNodeState()||"normal"),!$&&(A||E)&&"".concat(K,"-node-selected"),!$&&X&&"draggable"),draggable:!$&&X||void 0,"aria-grabbed":!$&&X||void 0,onMouseEnter:y.onMouseEnter,onMouseLeave:y.onMouseLeave,onContextMenu:y.onContextMenu,onClick:y.onSelectorClick,onDoubleClick:y.onSelectorDoubleClick,onDragStart:X?y.onDragStart:void 0},ue,we)},y}return Object(k.a)(m,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var E=this.props.selectable,o=this.props.context.selectable;return typeof E=="boolean"?E:o}},{key:"render",value:function(){var E,o=this.props,x=o.eventKey,A=o.className,O=o.style,D=o.dragOver,N=o.dragOverGapTop,W=o.dragOverGapBottom,K=o.isLeaf,oe=o.isStart,B=o.isEnd,X=o.expanded,V=o.selected,ne=o.checked,$=o.halfChecked,Z=o.loading,ue=o.domRef,he=o.active,Oe=o.onMouseMove,we=Object(ee.a)(o,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Pe=this.props.context,_e=Pe.prefixCls,xe=Pe.filterTreeNode,Ve=Pe.draggable,Ne=Pe.keyEntities,Be=this.isDisabled(),ze=Object(a.f)(we),ye=Ne[x]||{},me=ye.level,We=B[B.length-1];return h.createElement("div",Object.assign({ref:ue,className:c()(A,"".concat(_e,"-treenode"),(E={},Object(de.a)(E,"".concat(_e,"-treenode-disabled"),Be),Object(de.a)(E,"".concat(_e,"-treenode-switcher-").concat(X?"open":"close"),!K),Object(de.a)(E,"".concat(_e,"-treenode-checkbox-checked"),ne),Object(de.a)(E,"".concat(_e,"-treenode-checkbox-indeterminate"),$),Object(de.a)(E,"".concat(_e,"-treenode-selected"),V),Object(de.a)(E,"".concat(_e,"-treenode-loading"),Z),Object(de.a)(E,"".concat(_e,"-treenode-active"),he),Object(de.a)(E,"".concat(_e,"-treenode-leaf-last"),We),Object(de.a)(E,"drag-over",!Be&&D),Object(de.a)(E,"drag-over-gap-top",!Be&&N),Object(de.a)(E,"drag-over-gap-bottom",!Be&&W),Object(de.a)(E,"filter-node",xe&&xe(Object(f.b)(this.props))),E)),style:O,onDragEnter:Ve?this.onDragEnter:void 0,onDragOver:Ve?this.onDragOver:void 0,onDragLeave:Ve?this.onDragLeave:void 0,onDrop:Ve?this.onDrop:void 0,onDragEnd:Ve?this.onDragEnd:void 0,onMouseMove:Oe},ze),h.createElement(s,{prefixCls:_e,level:me,isStart:oe,isEnd:B}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),m}(h.Component),v=function(_){return h.createElement(l.a.Consumer,null,function(m){return h.createElement(d,Object.assign({},_,{context:m}))})};v.displayName="TreeNode",v.defaultProps={title:t},v.isTreeNode=1;var g=$e.a=v},Wtmd:function(rt,$e,H){rt.exports=H.p+"static/c.03ba6fd6.svg"},Wx9E:function(rt,$e,H){},XIdC:function(rt,$e,H){"use strict";var de=H("rePB"),ee=H("ODXe"),j=H("Ff2n"),w=H("q1tI"),k=H.n(w),S=H("TSYQ"),T=H.n(S),C=H("6cGi"),h=H("4IlW"),p=w.forwardRef(function(c,l){var a,u=c.prefixCls,s=u===void 0?"rc-switch":u,f=c.className,i=c.checked,n=c.defaultChecked,t=c.disabled,d=c.loadingIcon,v=c.checkedChildren,g=c.unCheckedChildren,b=c.onClick,_=c.onChange,m=c.onKeyDown,y=Object(j.a)(c,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),E=Object(C.a)(!1,{value:i,defaultValue:n}),o=Object(ee.a)(E,2),x=o[0],A=o[1];function O(K,oe){var B=x;return t||(B=K,A(B),_==null||_(B,oe)),B}function D(K){K.which===h.a.LEFT?O(!1,K):K.which===h.a.RIGHT&&O(!0,K),m==null||m(K)}function N(K){var oe=O(!x,K);b==null||b(oe,K)}var W=T()(s,f,(a={},Object(de.a)(a,"".concat(s,"-checked"),x),Object(de.a)(a,"".concat(s,"-disabled"),t),a));return w.createElement("button",Object.assign({},y,{type:"button",role:"switch","aria-checked":x,disabled:t,className:W,ref:l,onKeyDown:D,onClick:N}),d,w.createElement("span",{className:"".concat(s,"-inner")},x?v:g))});p.displayName="Switch",$e.a=p},Y1PL:function(rt,$e,H){"use strict";H.r($e),H.d($e,"ResizableTextArea",function(){return $});var de=H("wx14"),ee=H("1OyB"),j=H("vuIU"),w=H("Ji7U"),k=H("LK+K"),S=H("q1tI"),T=H("VTBJ"),C=H("rePB"),h=H("Zm9Q"),p=H("Kwbf"),c=H("c+Xe"),l=H("m+aA"),a=H("bdgK"),u=new Map;function s(he){he.forEach(function(Oe){var we,Pe=Oe.target;(we=u.get(Pe))===null||we===void 0||we.forEach(function(_e){return _e(Pe)})})}var f=new a.default(s),i=null,n=null;function t(he,Oe){u.has(he)||(u.set(he,new Set),f.observe(he)),u.get(he).add(Oe)}function d(he,Oe){u.has(he)&&(u.get(he).delete(Oe),u.get(he).size||(f.unobserve(he),u.delete(he)))}var v=function(he){Object(w.a)(we,he);var Oe=Object(k.a)(we);function we(){return Object(ee.a)(this,we),Oe.apply(this,arguments)}return Object(j.a)(we,[{key:"render",value:function(){return this.props.children}}]),we}(S.Component),g=S.createContext(null);function b(he){var Oe=he.children,we=he.onBatchResize,Pe=S.useRef(0),_e=S.useRef([]),xe=S.useContext(g),Ve=S.useCallback(function(Ne,Be,ze){Pe.current+=1;var ye=Pe.current;_e.current.push({size:Ne,element:Be,data:ze}),Promise.resolve().then(function(){ye===Pe.current&&(we==null||we(_e.current),_e.current=[])}),xe==null||xe(Ne,Be,ze)},[we,xe]);return S.createElement(g.Provider,{value:Ve},Oe)}function _(he){var Oe=he.children,we=he.disabled,Pe=S.useRef(null),_e=S.useRef(null),xe=S.useContext(g),Ve=S.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ne=S.isValidElement(Oe)&&Object(c.c)(Oe),Be=Ne?Oe.ref:null,ze=S.useMemo(function(){return Object(c.a)(Be,Pe)},[Be,Pe]),ye=S.useRef(he);ye.current=he;var me=S.useCallback(function(We){var He=ye.current,nt=He.onResize,te=He.data,P=We.getBoundingClientRect(),U=P.width,q=P.height,Y=We.offsetWidth,J=We.offsetHeight,Ee=Math.floor(U),ke=Math.floor(q);if(Ve.current.width!==Ee||Ve.current.height!==ke||Ve.current.offsetWidth!==Y||Ve.current.offsetHeight!==J){var ht={width:Ee,height:ke,offsetWidth:Y,offsetHeight:J};Ve.current=ht;var Ue=Y===Math.round(U)?U:Y,je=J===Math.round(q)?q:J,tt=Object(T.a)(Object(T.a)({},ht),{},{offsetWidth:Ue,offsetHeight:je});xe==null||xe(tt,We,te),nt&&Promise.resolve().then(function(){nt(tt,We)})}},[]);return S.useEffect(function(){var We=Object(l.a)(Pe.current)||Object(l.a)(_e.current);return We&&!we&&t(We,me),function(){return d(We,me)}},[Pe.current,we]),S.createElement(v,{ref:_e},Ne?S.cloneElement(Oe,{ref:ze}):Oe)}var m="rc-observer-key";function y(he){var Oe=he.children,we=Object(h.a)(Oe);return we.map(function(Pe,_e){var xe=(Pe==null?void 0:Pe.key)||"".concat(m,"-").concat(_e);return S.createElement(_,Object(de.a)({},he,{key:xe}),Pe)})}y.Collection=b;var E=y,o=H("bT9E"),x=H("TSYQ"),A=H.n(x),O=`
|
|
|
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
|
|
|
`,D=["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"],N={},W;function K(he){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=he.getAttribute("id")||he.getAttribute("data-reactid")||he.getAttribute("name");if(Oe&&N[we])return N[we];var Pe=window.getComputedStyle(he),_e=Pe.getPropertyValue("box-sizing")||Pe.getPropertyValue("-moz-box-sizing")||Pe.getPropertyValue("-webkit-box-sizing"),xe=parseFloat(Pe.getPropertyValue("padding-bottom"))+parseFloat(Pe.getPropertyValue("padding-top")),Ve=parseFloat(Pe.getPropertyValue("border-bottom-width"))+parseFloat(Pe.getPropertyValue("border-top-width")),Ne=D.map(function(ze){return"".concat(ze,":").concat(Pe.getPropertyValue(ze))}).join(";"),Be={sizingStyle:Ne,paddingSize:xe,borderSize:Ve,boxSizing:_e};return Oe&&we&&(N[we]=Be),Be}function oe(he){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Pe=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)),he.getAttribute("wrap")?W.setAttribute("wrap",he.getAttribute("wrap")):W.removeAttribute("wrap");var _e=K(he,Oe),xe=_e.paddingSize,Ve=_e.borderSize,Ne=_e.boxSizing,Be=_e.sizingStyle;W.setAttribute("style","".concat(Be,";").concat(O)),W.value=he.value||he.placeholder||"";var ze=Number.MIN_SAFE_INTEGER,ye=Number.MAX_SAFE_INTEGER,me=W.scrollHeight,We;if(Ne==="border-box"?me+=Ve:Ne==="content-box"&&(me-=xe),we!==null||Pe!==null){W.value=" ";var He=W.scrollHeight-xe;we!==null&&(ze=He*we,Ne==="border-box"&&(ze=ze+xe+Ve),me=Math.max(ze,me)),Pe!==null&&(ye=He*Pe,Ne==="border-box"&&(ye=ye+xe+Ve),We=me>ye?"":"hidden",me=Math.min(ye,me))}return{height:me,minHeight:ze,maxHeight:ye,overflowY:We,resize:"none"}}var B=H("Gytx"),X=H.n(B),V;(function(he){he[he.NONE=0]="NONE",he[he.RESIZING=1]="RESIZING",he[he.RESIZED=2]="RESIZED"})(V||(V={}));var ne=function(he){Object(w.a)(we,he);var Oe=Object(k.a)(we);function we(Pe){var _e;return Object(ee.a)(this,we),_e=Oe.call(this,Pe),_e.nextFrameActionId=void 0,_e.resizeFrameId=void 0,_e.textArea=void 0,_e.saveTextArea=function(xe){_e.textArea=xe},_e.handleResize=function(xe){var Ve=_e.state.resizeStatus,Ne=_e.props,Be=Ne.autoSize,ze=Ne.onResize;if(Ve!==V.NONE)return;typeof ze=="function"&&ze(xe),Be&&_e.resizeOnNextFrame()},_e.resizeOnNextFrame=function(){cancelAnimationFrame(_e.nextFrameActionId),_e.nextFrameActionId=requestAnimationFrame(_e.resizeTextarea)},_e.resizeTextarea=function(){var xe=_e.props.autoSize;if(!xe||!_e.textArea)return;var Ve=xe.minRows,Ne=xe.maxRows,Be=oe(_e.textArea,!1,Ve,Ne);_e.setState({textareaStyles:Be,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(_e.resizeFrameId),_e.resizeFrameId=requestAnimationFrame(function(){_e.setState({resizeStatus:V.RESIZED},function(){_e.resizeFrameId=requestAnimationFrame(function(){_e.setState({resizeStatus:V.NONE}),_e.fixFirefoxAutoScroll()})})})})},_e.renderTextArea=function(){var xe=_e.props,Ve=xe.prefixCls,Ne=Ve===void 0?"rc-textarea":Ve,Be=xe.autoSize,ze=xe.onResize,ye=xe.className,me=xe.disabled,We=_e.state,He=We.textareaStyles,nt=We.resizeStatus,te=Object(o.a)(_e.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),P=A()(Ne,ye,Object(C.a)({},"".concat(Ne,"-disabled"),me));"value"in te&&(te.value=te.value||"");var U=Object(T.a)(Object(T.a)(Object(T.a)({},_e.props.style),He),nt===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return S.createElement(E,{onResize:_e.handleResize,disabled:!(Be||ze)},S.createElement("textarea",Object(de.a)({},te,{className:P,style:U,ref:_e.saveTextArea})))},_e.state={textareaStyles:{},resizeStatus:V.NONE},_e}return Object(j.a)(we,[{key:"componentDidUpdate",value:function(_e){(_e.value!==this.props.value||!X()(_e.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 _e=this.textArea.selectionStart,xe=this.textArea.selectionEnd;this.textArea.setSelectionRange(_e,xe)}}catch(Ve){}}},{key:"render",value:function(){return this.renderTextArea()}}]),we}(S.Component),$=ne,Z=function(he){Object(w.a)(we,he);var Oe=Object(k.a)(we);function we(Pe){var _e;Object(ee.a)(this,we),_e=Oe.call(this,Pe),_e.resizableTextArea=void 0,_e.focus=function(){_e.resizableTextArea.textArea.focus()},_e.saveTextArea=function(Ve){_e.resizableTextArea=Ve},_e.handleChange=function(Ve){var Ne=_e.props.onChange;_e.setValue(Ve.target.value,function(){_e.resizableTextArea.resizeTextarea()}),Ne&&Ne(Ve)},_e.handleKeyDown=function(Ve){var Ne=_e.props,Be=Ne.onPressEnter,ze=Ne.onKeyDown;Ve.keyCode===13&&Be&&Be(Ve),ze&&ze(Ve)};var xe=typeof Pe.value=="undefined"||Pe.value===null?Pe.defaultValue:Pe.value;return _e.state={value:xe},_e}return Object(j.a)(we,[{key:"setValue",value:function(_e,xe){"value"in this.props||this.setState({value:_e},xe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return S.createElement($,Object(de.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(_e){return"value"in _e?{value:_e.value}:null}}]),we}(S.Component),ue=$e.default=Z},Z8dc:function(rt,$e,H){rt.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(rt,$e,H){"use strict";var de=H("BoS7"),ee=H("Sdc0"),j=H("OaEy"),w=H("2fM7"),k=H("q1tI"),S=H.n(k),T=H("lOMy"),C=H.n(T),h=w.a.Option;$e.a=function(p){var c=p.onFontSizeChange,l=p.cmFontSize,a=p.cmCodeMode,u=p.onCodeModeChange,s=p.onTabToSpace,f=p.className,i=f===void 0?"":f,n=p.tabToSpace,t=p.children;return S.a.createElement("div",{className:"tpi-code-setting ".concat(i)},S.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),S.a.createElement("section",null,S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),S.a.createElement(w.a,{bordered:!1,size:"small",value:a,onChange:u},S.a.createElement(h,{value:"vs"},"\u767D\u8272\u80CC\u666F"),S.a.createElement(h,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),S.a.createElement(w.a,{bordered:!1,size:"small",value:l,onChange:c},S.a.createElement(h,{value:12},"12px"),S.a.createElement(h,{value:14},"14px"),S.a.createElement(h,{value:16},"16px"),S.a.createElement(h,{value:18},"18px"),S.a.createElement(h,{value:20},"20px"),S.a.createElement(h,{value:22},"22px"))),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"Tab\u8F6C\u6362"),S.a.createElement(ee.a,{checked:n,onChange:s}))),S.a.createElement("h3",null,"\u5FEB\u6377\u952E"),S.a.createElement("section",null,S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),S.a.createElement("span",null,"Ctrl + S")),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),S.a.createElement("span",null,"F1 / Alt + F1")),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),S.a.createElement("span",null,"Ctrl + ]/[")),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),S.a.createElement("span",null,"Ctrl + Shift + \\")),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),S.a.createElement("span",null,"Home")),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),S.a.createElement("span",null,"End"))),t)}},ZW9T:function(rt,$e,H){"use strict";H.d($e,"a",function(){return v});var de=H("k1fw"),ee=H("miYZ"),j=H("tsqr"),w=H("rAM+"),k=H("tJVT"),S=H("PpiC"),T=H("q1tI"),C=H.n(T),h=H("bdgK");function p(g,b,_,m,y){var E=b.getWordUntilPosition(_),o={startLineNumber:_.lineNumber,endLineNumber:_.lineNumber,startColumn:E.startColumn,endColumn:E.endColumn},x=m.map(function(A){return{label:A,kind:g.languages.CompletionItemKind.Keyword,insertText:A,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:o}});return y.map(function(A){x.push(Object(de.a)(Object(de.a)({},A),{},{range:o}))}),x}var c=function(g){var b={label:"ifelse",kind:g.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
|
`),insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet},_=["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"];g.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(o,x){var A=p(g,o,x,_,[b]);return{suggestions:A}}});var m=["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"];g.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(o,x){var A=[{label:"print",kind:g.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
|
`),insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}],O=p(g,o,x,m,A);return{suggestions:O}}});var y=["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"];g.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(o,x){var A=[b,{label:"main",kind:g.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
|
`),insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:g.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
|
`),insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}],O=p(g,o,x,y,A);return{suggestions:O}}})},l="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",a=H("LvDl");function u(g){return/^\d+$/.test(g)?"".concat(g,"px"):g}function s(){}var f=!1,i={"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"};function n(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],b=g;if(Array.isArray(g)){for(var _=0;_<g.length;_++){var m=i[g[_]];if(m)return m}return b[0]}return i[b]||b}var t=null,d=$e.b=function(g){var b=g.width,_=b===void 0?"100%":b,m=g.height,y=m===void 0?"100%":m,E=g.value,o=g.language,x=o===void 0?"javascript":o,A=g.style,O=A===void 0?{}:A,D=g.options,N=D===void 0?{}:D,W=g.overrideServices,K=W===void 0?{}:W,oe=g.theme,B=oe===void 0?"vs-dark":oe,X=g.onEditBlur,V=g.onSave,ne=g.autoHeight,$=ne===void 0?!1:ne,Z=g.forbidCopy,ue=Z===void 0?!1:Z,he=g.onChange,Oe=he===void 0?s:he,we=g.editorDidMount,Pe=we===void 0?s:we,_e=g.onFocus,xe=_e===void 0?s:_e,Ve=g.filename,Ne=Ve===void 0?"educoder.txt":Ve,Be=Object(S.a)(g,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),ze=Object(T.useRef)(),ye=Object(T.useRef)({}),me=Object(T.useRef)(),We=Object(T.useRef)(!1),He=Object(T.useRef)(),nt=Object(T.useState)(!1),te=Object(k.a)(nt,2),P=te[0],U=te[1];function q(){var Le;return ze.current&&(Le=new h.default(function(Ce){var et=Object(w.a)(Ce),Qe;try{for(et.s();!(Qe=et.n()).done;){var yt=Qe.value;(yt.target.offsetHeight>0||yt.target.offsetWidth>0)&&ye.current.instance.layout()}}catch(Dt){et.e(Dt)}finally{et.f()}}),Le.observe(ze.current)),Le}function Y(){j.b.warn(decodeURIComponent(l))}var J=function(){var Ce=ye.current.instance;if(E!=null&&Ce&&P){var et=Ce.getModel();et&&E!==et.getValue()&&(f=!0,et.setValue(E),Ce.layout(),f=!1)}};Object(T.useEffect)(function(){me.current&&clearTimeout(me.current),me.current=setTimeout(function(){J()},500)},[E,P,ye.current]);function Ee(){var Le=ye.current.instance;if(Le){var Ce=Le.getSelection(),et=ye.current.pastePos||{},Qe=new t.Range(et.startLineNumber||Ce.endLineNumber,et.startColumn||Ce.endColumn,et.endLineNumber||Ce.endLineNumber,et.endColumn||Ce.endColumn);setTimeout(function(){Le.executeEdits("",[{range:Qe,text:""}])},300)}}function ke(Le){(window.navigator.platform.match("Mac")?Le.metaKey:Le.ctrlKey)&&Le.keyCode==83&&(Le.preventDefault(),V())}var ht=function(){if($&&ye.current.instance){var Ce=ye.current.instance.getContentHeight();be(Ce<y?y:Ce)}else be(y)};function Ue(Le){var Ce=document.createEvent("MouseEvents");Ce.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Le.dispatchEvent(Ce)}function je(Le,Ce){var et=window.URL||window.webkitURL||window,Qe=new Blob([Ce]),yt=document.createElementNS("http://www.w3.org/1999/xhtml","a");yt.href=et.createObjectURL(Qe),yt.download=Le,Ue(yt)}Object(T.useEffect)(function(){ht()},[ht]),Object(T.useEffect)(function(){ze.current&&!P&&H.e(27).then(H.t.bind(null,"M/lh",7)).then(function(Le){try{t=Le,ye.current.instance=t.editor.create(ze.current,{value:E,language:n(x),theme:B,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},K);var Ce=ye.current.instance;if(Pe(Ce,t),setTimeout(function(){ht(),ye.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){je(Ne||"educoder.txt",Ce.getValue())}})},500),ye.current.subscription=Ce.onDidChangeModelContent(function(Qe){We.current?clearTimeout(He.current):(ht(),Oe(Ce.getValue(),Qe)),He.current=setTimeout(function(){We.current=!1},500)}),window.Monaco||c(t),ue&&(Ce.addCommand(t.KeyMod.CtrlCmd|t.KeyMod.Shift|t.KeyCode.KEY_V,function(){return Y(),null}),Ce.addCommand(t.KeyMod.CtrlCmd|t.KeyCode.KEY_C,function(){return Y(),null})),window.Monaco=t,X&&Ce.onDidBlurEditorWidget(function(){X(Ce.getValue())}),xe&&Ce.onDidFocusEditorText(function(){xe(Ce.getValue())}),ue){Ce.addCommand(t.KeyMod.CtrlCmd|t.KeyCode.KEY_V,function(){return Y(),null}),Ce.onDidPaste(function(Qe){ye.current.pastePos=Qe});try{window.addEventListener("paste",Ee)}catch(Qe){}}var et=q();return U(!0),function(){var Qe=ye.current.instance;Qe.dispose();var yt=Qe.getModel();yt&&yt.dispose(),ye.current.subscription&&ye.current.subscription.dispose(),ue&&window.removeEventListener("paste",Ee),et.unobserve(ze.current)}}catch(Qe){}})},[]),Object(T.useEffect)(function(){var Le=ye.current.instance;if(Le&&P)return document.addEventListener("keydown",ke,!1),function(){document.removeEventListener("keydown",ke)}},[V,P]),Object(T.useEffect)(function(){var Le=ye.current.instance;if(Le&&P){var Ce=n(x);t.editor.setModelLanguage(Le.getModel(),Ce),console.log("language:",x,Le.getModel(),Ce)}},[x,P]),Object(T.useEffect)(function(){var Le=ye.current.instance;Le&&P&&t.editor.setTheme(B)},[B,P]),Object(T.useEffect)(function(){var Le=ye.current.instance;Le&&P&&(Le.updateOptions(Object(de.a)({},N)),setTimeout(function(){Le.getModel().updateOptions(Object(de.a)({},N))},200))},[JSON.stringify(N),P]),Object(T.useEffect)(function(){var Le=ye.current.instance;Le&&P&&Le.layout()},[_,y,P]);var tt=Object(T.useState)(u(_)),dt=Object(k.a)(tt,2),qe=dt[0],Ye=dt[1],Fe=Object(T.useState)(u(y)),Ie=Object(k.a)(Fe,2),Me=Ie[0],be=Ie[1],Te=Object(de.a)(Object(de.a)({},O),{},{width:qe,height:Me});return C.a.createElement("div",{className:"my-monaco-editor",ref:ze,style:Te})};function v(g){var b=g.width,_=b===void 0?"100%":b,m=g.height,y=m===void 0?"100%":m,E=g.original,o=g.modified,x=g.language,A=g.options,O=A===void 0?{}:A,D=Object(T.useRef)(),N=Object(T.useState)(null),W=Object(k.a)(N,2),K=W[0],oe=W[1];function B($){var Z;return D.current&&(Z=new h.default(function(ue){var he=Object(w.a)(ue),Oe;try{for(he.s();!(Oe=he.n()).done;){var we=Oe.value;(we.target.offsetHeight>0||we.target.offsetWidth>0)&&$.layout()}}catch(Pe){he.e(Pe)}finally{he.f()}}),Z.observe(D.current)),Z}Object(T.useEffect)(function(){D.current&&H.e(27).then(H.t.bind(null,"M/lh",7)).then(function($){t=$;var Z=t.editor.createDiffEditor(D.current,Object(de.a)(Object(de.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},O),{},{wordWrap:!0}));oe(Z);var ue=B(Z);return function(){Z.dispose();var he=Z.getModel();he&&he.dispose(),ue.unobserve(D.current)}})},[]),Object(T.useEffect)(function(){K&&K.setModel({original:t.editor.createModel(E,x),modified:t.editor.createModel(o,x)})},[E,o,x,K]);var X=u(_),V=u(y),ne={width:X,height:V};return C.a.createElement("div",{className:"my-diff-editor",ref:D,style:ne})}},ZpRC:function(rt,$e,H){"use strict";function de(c){return typeof c=="object"&&c!=null&&c.nodeType===1}function ee(c,l){return(!l||c!=="hidden")&&c!=="visible"&&c!=="clip"}function j(c,l){if(c.clientHeight<c.scrollHeight||c.clientWidth<c.scrollWidth){var a=getComputedStyle(c,null);return ee(a.overflowY,l)||ee(a.overflowX,l)||function(u){var s=function(f){if(!f.ownerDocument||!f.ownerDocument.defaultView)return null;try{return f.ownerDocument.defaultView.frameElement}catch(i){return null}}(u);return!!s&&(s.clientHeight<u.scrollHeight||s.clientWidth<u.scrollWidth)}(c)}return!1}function w(c,l,a,u,s,f,i,n){return f<c&&i>l||f>c&&i<l?0:f<=c&&n<=a||i>=l&&n>=a?f-c-u:i>l&&n<a||f<c&&n>a?i-l+s:0}var k=function(c,l){var a=window,u=l.scrollMode,s=l.block,f=l.inline,i=l.boundary,n=l.skipOverflowHiddenElements,t=typeof i=="function"?i:function(He){return He!==i};if(!de(c))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,v=[],g=c;de(g)&&t(g);){if((g=g.parentElement)===d){v.push(g);break}g!=null&&g===document.body&&j(g)&&!j(document.documentElement)||g!=null&&j(g,n)&&v.push(g)}for(var b=a.visualViewport?a.visualViewport.width:innerWidth,_=a.visualViewport?a.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,E=c.getBoundingClientRect(),o=E.height,x=E.width,A=E.top,O=E.right,D=E.bottom,N=E.left,W=s==="start"||s==="nearest"?A:s==="end"?D:A+o/2,K=f==="center"?N+x/2:f==="end"?O:N,oe=[],B=0;B<v.length;B++){var X=v[B],V=X.getBoundingClientRect(),ne=V.height,$=V.width,Z=V.top,ue=V.right,he=V.bottom,Oe=V.left;if(u==="if-needed"&&A>=0&&N>=0&&D<=_&&O<=b&&A>=Z&&D<=he&&N>=Oe&&O<=ue)return oe;var we=getComputedStyle(X),Pe=parseInt(we.borderLeftWidth,10),_e=parseInt(we.borderTopWidth,10),xe=parseInt(we.borderRightWidth,10),Ve=parseInt(we.borderBottomWidth,10),Ne=0,Be=0,ze="offsetWidth"in X?X.offsetWidth-X.clientWidth-Pe-xe:0,ye="offsetHeight"in X?X.offsetHeight-X.clientHeight-_e-Ve:0;if(d===X)Ne=s==="start"?W:s==="end"?W-_:s==="nearest"?w(y,y+_,_,_e,Ve,y+W,y+W+o,o):W-_/2,Be=f==="start"?K:f==="center"?K-b/2:f==="end"?K-b:w(m,m+b,b,Pe,xe,m+K,m+K+x,x),Ne=Math.max(0,Ne+y),Be=Math.max(0,Be+m);else{Ne=s==="start"?W-Z-_e:s==="end"?W-he+Ve+ye:s==="nearest"?w(Z,he,ne,_e,Ve+ye,W,W+o,o):W-(Z+ne/2)+ye/2,Be=f==="start"?K-Oe-Pe:f==="center"?K-(Oe+$/2)+ze/2:f==="end"?K-ue+xe+ze:w(Oe,ue,$,Pe,xe+ze,K,K+x,x);var me=X.scrollLeft,We=X.scrollTop;W+=We-(Ne=Math.max(0,Math.min(We+Ne,X.scrollHeight-ne+ye))),K+=me-(Be=Math.max(0,Math.min(me+Be,X.scrollWidth-$+ze)))}oe.push({el:X,top:Ne,left:Be})}return oe};function S(c){return c===Object(c)&&Object.keys(c).length!==0}function T(c,l){l===void 0&&(l="auto");var a="scrollBehavior"in document.body.style;c.forEach(function(u){var s=u.el,f=u.top,i=u.left;s.scroll&&a?s.scroll({top:f,left:i,behavior:l}):(s.scrollTop=f,s.scrollLeft=i)})}function C(c){return c===!1?{block:"end",inline:"nearest"}:S(c)?c:{block:"start",inline:"nearest"}}function h(c,l){var a=!c.ownerDocument.documentElement.contains(c);if(S(l)&&typeof l.behavior=="function")return l.behavior(a?[]:k(c,l));if(a)return;var u=C(l);return T(k(c,u),u.behavior)}var p=$e.a=h},ZsLC:function(rt,$e,H){rt.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(rt,$e,H){"use strict";H.d($e,"b",function(){return w}),H.d($e,"a",function(){return k});var de=H("je13"),ee=H.n(de),j=!1;function w(S,T){var C=ee.a.get("__ec");C||(C={}),C[S]=T,ee.a.set("__ec",C)}function k(S,T){var C=ee.a.get("__ec");return C?C[S]===void 0?T:C[S]:T}},bT9E:function(rt,$e,H){"use strict";H.d($e,"a",function(){return ee});var de=H("VTBJ");function ee(j,w){var k=Object(de.a)({},j);return Array.isArray(w)&&w.forEach(function(S){delete k[S]}),k}},bdLU:function(rt,$e,H){"use strict";H.d($e,"a",function(){return de});var de;(function(ee){ee[ee.NOMATCH=-1]="NOMATCH",ee[ee.OK=0]="OK",ee[ee.TIMEOUT=2]="TIMEOUT",ee[ee.PODFAILURE=3]="PODFAILURE",ee[ee.COMPILEFAILURE=4]="COMPILEFAILURE",ee[ee.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(de||(de={}))},biw7:function(rt,$e,H){"use strict";var de=H("q1tI"),ee=H.n(de),j=de.createContext(null);$e.a=j},c5Ni:function(rt,$e,H){},cDPC:function(rt,$e,H){"use strict";var de=H("tJVT"),ee=H("q1tI"),j=H.n(ee),w=H("i3hx"),k=H.n(w);$e.a=function(S){var T=S.defaultX,C=T===void 0?"40%":T,h=S.leftChild,p=S.rightChild,c=S.className,l=S.hideResize,a=l===void 0?!1:l,u=Object(ee.useState)(C),s=Object(de.a)(u,2),f=s[0],i=s[1],n=Object(ee.useRef)();function t(){n.current=!0}Object(ee.useEffect)(function(){function g(_){n.current&&i(_.pageX)}function b(){n.current=!1}return window.addEventListener("mousemove",g),window.addEventListener("mouseup",b),function(){window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",b)}},[]);var d=typeof f=="number"&&f!==.01?"".concat(f,"px"):C,v="calc(100% - ".concat(a?"0px":"4px"," - ").concat(d,")");return j.a.createElement("div",{className:"split-panel-container ".concat(c)},j.a.createElement("section",{style:{width:d,display:f===.01?"none":""}},h),j.a.createElement("section",{className:"resize-x-bar",onMouseDown:t},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:v}},p))}},dejd:function(rt,$e,H){},dmUQ:function(rt,$e,H){"use strict";var de=H("Ff2n"),ee=H("rePB"),j=H("1OyB"),w=H("vuIU"),k=H("Ji7U"),S=H("md7G"),T=H("foSv"),C=H("q1tI"),h=H.n(C),p=H("TSYQ"),c=H.n(p),l=H("4IlW");function a(o,x){var A=Object.keys(o);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(o);x&&(O=O.filter(function(D){return Object.getOwnPropertyDescriptor(o,D).enumerable})),A.push.apply(A,O)}return A}function u(o){for(var x=1;x<arguments.length;x++){var A=arguments[x]!=null?arguments[x]:{};x%2?a(Object(A),!0).forEach(function(O){Object(ee.a)(o,O,A[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(A)):a(Object(A)).forEach(function(O){Object.defineProperty(o,O,Object.getOwnPropertyDescriptor(A,O))})}return o}function s(o){var x=f();return function(){var O=Object(T.a)(o),D;if(x){var N=Object(T.a)(this).constructor;D=Reflect.construct(O,arguments,N)}else D=O.apply(this,arguments);return Object(S.a)(this,D)}}function f(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(o){return!1}}function i(){}function n(o){o.preventDefault()}var t=function(x){return x.replace(/[^\w.-]+/g,"")},d=200,v=600,g=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,b=function(x){return x!=null},_=function(x,A){return A===x||typeof A=="number"&&typeof x=="number"&&isNaN(A)&&isNaN(x)},m=function(o){Object(k.a)(A,o);var x=s(A);function A(O){var D;Object(j.a)(this,A),D=x.call(this,O),D.onKeyDown=function(K){var oe=D.props,B=oe.onKeyDown,X=oe.onPressEnter;if(K.keyCode===l.a.UP){var V=D.getRatio(K);D.up(K,V,null),D.stop()}else if(K.keyCode===l.a.DOWN){var ne=D.getRatio(K);D.down(K,ne,null),D.stop()}else K.keyCode===l.a.ENTER&&X&&X(K);if(D.recordCursorPosition(),D.lastKeyCode=K.keyCode,B){for(var $=arguments.length,Z=new Array($>1?$-1:0),ue=1;ue<$;ue++)Z[ue-1]=arguments[ue];B.apply(void 0,[K].concat(Z))}},D.onKeyUp=function(K){var oe=D.props.onKeyUp;if(D.stop(),D.recordCursorPosition(),oe){for(var B=arguments.length,X=new Array(B>1?B-1:0),V=1;V<B;V++)X[V-1]=arguments[V];oe.apply(void 0,[K].concat(X))}},D.onChange=function(K){var oe=D.props.onChange;D.state.focused&&(D.inputting=!0),D.rawInput=D.props.parser(D.getValueFromEvent(K)),D.setState({inputValue:D.rawInput}),oe(D.toNumber(D.rawInput))},D.onMouseUp=function(){var K=D.props.onMouseUp;D.recordCursorPosition(),K&&K.apply(void 0,arguments)},D.onFocus=function(){var K;D.setState({focused:!0}),(K=D.props).onFocus.apply(K,arguments)},D.onBlur=function(){var K=D.props.onBlur;D.inputting=!1,D.setState({focused:!1});var oe=D.getCurrentValidValue(D.state.inputValue),B=D.setValue(oe,i);if(K){var X=D.input.value,V=D.getInputDisplayValue({focus:!1,value:B});D.input.value=V&&Number(V),K.apply(void 0,arguments),D.input.value=X}},D.getRatio=function(K){var oe=1;return K.metaKey||K.ctrlKey?oe=.1:K.shiftKey&&(oe=10),oe},D.getFullNum=function(K){return isNaN(K)?K:/e/i.test(String(K))?Number(K).toFixed(18).replace(/\.?0+$/,""):K},D.getPrecision=function(K){if(b(D.props.precision))return D.props.precision;var oe=String(K);if(oe.indexOf("e-")>=0)return parseInt(oe.slice(oe.indexOf("e-")+2),10);var B=0;return oe.indexOf(".")>=0&&(B=oe.length-oe.indexOf(".")-1),B},D.getInputDisplayValue=function(K){var oe=K||D.state,B=oe.focused,X=oe.inputValue,V=oe.value,ne;B?ne=X:ne=D.toPrecisionAsStep(V),ne==null&&(ne="");var $=D.formatWrapper(ne);return b(D.props.decimalSeparator)&&($=$.toString().replace(".",D.props.decimalSeparator)),$},D.recordCursorPosition=function(){try{D.cursorStart=D.input.selectionStart,D.cursorEnd=D.input.selectionEnd,D.currentValue=D.input.value,D.cursorBefore=D.input.value.substring(0,D.cursorStart),D.cursorAfter=D.input.value.substring(D.cursorEnd)}catch(K){}},D.restoreByAfter=function(K){if(K===void 0)return!1;var oe=D.input.value,B=oe.lastIndexOf(K);if(B===-1)return!1;var X=D.cursorBefore.length;return D.lastKeyCode===l.a.DELETE&&D.cursorBefore.charAt(X-1)===K[0]?(D.fixCaret(X,X),!0):B+K.length===oe.length?(D.fixCaret(B,B),!0):!1},D.partRestoreByAfter=function(K){return K===void 0?!1:Array.prototype.some.call(K,function(oe,B){var X=K.substring(B);return D.restoreByAfter(X)})},D.isNotCompleteNumber=function(K){return isNaN(K)||K===""||K===null||K&&K.toString().indexOf(".")===K.toString().length-1},D.stop=function(){D.autoStepTimer&&clearTimeout(D.autoStepTimer)},D.down=function(K,oe,B){D.pressingUpOrDown=!0,D.step("down",K,oe,B)},D.up=function(K,oe,B){D.pressingUpOrDown=!0,D.step("up",K,oe,B)},D.saveInput=function(K){D.input=K};var N=O.value;N===void 0&&(N=O.defaultValue),D.state={focused:O.autoFocus};var W=D.getValidValue(D.toNumber(N));return D.state=u(u({},D.state),{},{inputValue:D.toPrecisionAsStep(W),value:W}),D}return Object(w.a)(A,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(D){var N=this.props,W=N.value,K=N.onChange,oe=N.max,B=N.min,X=this.state.focused;if(D){if(!_(D.value,W)||!_(D.max,oe)||!_(D.min,B)){var V=X?W:this.getValidValue(W),ne;this.pressingUpOrDown?ne=V:this.inputting?ne=this.rawInput:ne=this.toPrecisionAsStep(V),this.setState({value:V,inputValue:ne})}var $="value"in this.props?W:this.state.value;"max"in this.props&&D.max!==oe&&typeof $=="number"&&$>oe&&K&&K(oe),"min"in this.props&&D.min!==B&&typeof $=="number"&&$<B&&K&&K(B)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Z=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===l.a.BACKSPACE?Z=this.cursorStart-1:this.lastKeyCode===l.a.DELETE&&(Z=this.cursorStart):Z=this.input.value.length,this.fixCaret(Z,Z)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case l.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case l.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ue){}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(D){var N=D;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(D){var N=D.target.value.trim().replace(/。/g,".");return b(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(D){var N=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(D);return isNaN(K)?D:(K<N&&(K=N),K>W&&(K=W),K)}},{key:"setValue",value:function(D,N){var W=this.props.precision,K=this.isNotCompleteNumber(parseFloat(D))?null:parseFloat(D),oe=this.state.value,B=oe===void 0?null:oe,X=this.state.inputValue,V=X===void 0?null:X,ne=typeof K=="number"?K.toFixed(W):"".concat(K),$=K!==B||ne!=="".concat(V);return"value"in this.props?(V=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:V},N)):this.setState({value:K,inputValue:this.toPrecisionAsStep(D)},N),$&&this.props.onChange(K),K}},{key:"getMaxPrecision",value:function(D){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.props,K=W.precision,oe=W.step;if(b(K))return K;var B=this.getPrecision(N),X=this.getPrecision(oe),V=this.getPrecision(D);return D?Math.max(V,B+X):B+X}},{key:"getPrecisionFactor",value:function(D){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.getMaxPrecision(D,N);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(D){return this.props.formatter?this.props.formatter(D):D}},{key:"toPrecisionAsStep",value:function(D){if(this.isNotCompleteNumber(D)||D==="")return D;var N=Math.abs(this.getMaxPrecision(D));return isNaN(N)?D.toString():Number(D).toFixed(N)}},{key:"toNumber",value:function(D){var N=this.props.precision,W=this.state.focused,K=D&&D.length>16&&W;return this.isNotCompleteNumber(D)||K?D:b(N)?Math.round(D*Math.pow(10,N))/Math.pow(10,N):Number(D)}},{key:"upStep",value:function(D,N){var W=this.props.step,K=this.getPrecisionFactor(D,N),oe=Math.abs(this.getMaxPrecision(D,N)),B=((K*D+K*W*N)/K).toFixed(oe);return this.toNumber(B)}},{key:"downStep",value:function(D,N){var W=this.props.step,K=this.getPrecisionFactor(D,N),oe=Math.abs(this.getMaxPrecision(D,N)),B=((K*D-K*W*N)/K).toFixed(oe);return this.toNumber(B)}},{key:"step",value:function(D,N){var W=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,oe=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var B=this.props;if(B.disabled)return;var X=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(X))return;var V=this["".concat(D,"Step")](X,K),ne=V>B.max||V<B.min;if(V>B.max?V=B.max:V<B.min&&(V=B.min),this.setValue(V,null),this.setState({focused:!0},function(){W.pressingUpOrDown=!1}),ne)return;this.autoStepTimer=setTimeout(function(){W[D](N,K,!0)},oe?d:v)}},{key:"fixCaret",value:function(D,N){if(D===void 0||N===void 0||!this.input||!this.input.value)return;try{var W=this.input.selectionStart,K=this.input.selectionEnd;(D!==W||N!==K)&&this.input.setSelectionRange(D,N)}catch(oe){}}},{key:"render",value:function(){var D,N=this.props,W=N.prefixCls,K=N.disabled,oe=N.readOnly,B=N.useTouch,X=N.autoComplete,V=N.upHandler,ne=N.downHandler,$=N.className,Z=N.max,ue=N.min,he=N.style,Oe=N.title,we=N.onMouseEnter,Pe=N.onMouseLeave,_e=N.onMouseOver,xe=N.onMouseOut,Ve=N.required,Ne=N.onClick,Be=N.tabIndex,ze=N.type,ye=N.placeholder,me=N.id,We=N.inputMode,He=N.pattern,nt=N.step,te=N.maxLength,P=N.autoFocus,U=N.name,q=N.onPaste,Y=N.onInput,J=Object(de.a)(N,["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"]),Ee=this.state,ke=Ee.value,ht=Ee.focused,Ue=c()(W,(D={},Object(ee.a)(D,$,!!$),Object(ee.a)(D,"".concat(W,"-disabled"),K),Object(ee.a)(D,"".concat(W,"-focused"),ht),D)),je={};Object.keys(J).forEach(function(Ce){(Ce.substr(0,5)==="data-"||Ce.substr(0,5)==="aria-"||Ce==="role")&&(je[Ce]=J[Ce])});var tt=!oe&&!K,dt=this.getInputDisplayValue(null),qe=(ke||ke===0)&&(isNaN(ke)||Number(ke)>=Z),Ye=(ke||ke===0)&&(isNaN(ke)||Number(ke)<=ue),Fe=qe||K||oe,Ie=Ye||K||oe,Me=c()("".concat(W,"-handler"),"".concat(W,"-handler-up"),Object(ee.a)({},"".concat(W,"-handler-up-disabled"),Fe)),be=c()("".concat(W,"-handler"),"".concat(W,"-handler-down"),Object(ee.a)({},"".concat(W,"-handler-down-disabled"),Ie)),Te=B?{onTouchStart:Fe?i:this.up,onTouchEnd:this.stop}:{onMouseDown:Fe?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Le=B?{onTouchStart:Ie?i:this.down,onTouchEnd:this.stop}:{onMouseDown:Ie?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return h.a.createElement("div",{className:Ue,style:he,title:Oe,onMouseEnter:we,onMouseLeave:Pe,onMouseOver:_e,onMouseOut:xe,onFocus:function(){return null},onBlur:function(){return null}},h.a.createElement("div",{className:"".concat(W,"-handler-wrap")},h.a.createElement("span",Object.assign({unselectable:"on"},Te,{role:"button","aria-label":"Increase Value","aria-disabled":Fe,className:Me}),V||h.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-up-inner"),onClick:n})),h.a.createElement("span",Object.assign({unselectable:"on"},Le,{role:"button","aria-label":"Decrease Value","aria-disabled":Ie,className:be}),ne||h.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-down-inner"),onClick:n}))),h.a.createElement("div",{className:"".concat(W,"-input-wrap")},h.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ue,"aria-valuemax":Z,"aria-valuenow":ke,required:Ve,type:ze,placeholder:ye,onPaste:q,onClick:Ne,onMouseUp:this.onMouseUp,className:"".concat(W,"-input"),tabIndex:Be,autoComplete:X,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:tt?this.onKeyDown:i,onKeyUp:tt?this.onKeyUp:i,autoFocus:P,maxLength:te,readOnly:oe,disabled:K,max:Z,min:ue,step:nt,name:U,title:Oe,id:me,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(dt),pattern:He,inputMode:We,onInput:Y},je))))}}]),A}(h.a.Component);m.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:g,min:-g,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:t,required:!1,autoComplete:"off"};var y=m,E=$e.a=y},fcSX:function(rt,$e,H){"use strict";var de=H("Ff2n"),ee=H("1OyB"),j=H("vuIU"),w=H("Ji7U"),k=H("md7G"),S=H("foSv"),T=H("1W/9"),C=H("q1tI"),h=H("rePB"),p=H("JX7q"),c=H("TSYQ"),l=H.n(c),a=H("qx4F"),u=H("4IlW");function s(K){return Array.isArray(K)?K:[K]}var f={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(f).filter(function(K){if(typeof document=="undefined")return!1;var oe=document.getElementsByTagName("html")[0];return K in(oe?oe.style:{})})[0],n=f[i];function t(K,oe,B,X){K.addEventListener?K.addEventListener(oe,B,X):K.attachEvent&&K.attachEvent("on".concat(oe),B)}function d(K,oe,B,X){K.removeEventListener?K.removeEventListener(oe,B,X):K.attachEvent&&K.detachEvent("on".concat(oe),B)}function v(K,oe){var B=typeof K=="function"?K(oe):K;return Array.isArray(B)?B.length===2?B:[B[0],B[1]]:[B]}var g=function(oe){return!isNaN(parseFloat(oe))&&isFinite(oe)},b=!(typeof window!="undefined"&&window.document&&window.document.createElement),_=function K(oe,B,X,V){if(!B||B===document||B instanceof Document)return!1;if(B===oe.parentNode)return!0;var ne=Math.max(Math.abs(X),Math.abs(V))===Math.abs(V),$=Math.max(Math.abs(X),Math.abs(V))===Math.abs(X),Z=B.scrollHeight-B.clientHeight,ue=B.scrollWidth-B.clientWidth,he=document.defaultView.getComputedStyle(B),Oe=he.overflowY==="auto"||he.overflowY==="scroll",we=he.overflowX==="auto"||he.overflowX==="scroll",Pe=Z&&Oe,_e=ue&&we;return ne&&(!Pe||Pe&&(B.scrollTop>=Z&&V<0||B.scrollTop<=0&&V>0))||$&&(!_e||_e&&(B.scrollLeft>=ue&&X<0||B.scrollLeft<=0&&X>0))?K(oe,B.parentNode,X,V):!1};function m(K){var oe=y();return function(){var X=Object(S.a)(K),V;if(oe){var ne=Object(S.a)(this).constructor;V=Reflect.construct(X,arguments,ne)}else V=X.apply(this,arguments);return Object(k.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 E={},o=function(K){Object(w.a)(B,K);var oe=m(B);function B(X){var V;return Object(ee.a)(this,B),V=oe.call(this,X),V.domFocus=function(){V.dom&&V.dom.focus()},V.removeStartHandler=function(ne){if(ne.touches.length>1)return;V.startPos={x:ne.touches[0].clientX,y:ne.touches[0].clientY}},V.removeMoveHandler=function(ne){if(ne.changedTouches.length>1)return;var $=ne.currentTarget,Z=ne.changedTouches[0].clientX-V.startPos.x,ue=ne.changedTouches[0].clientY-V.startPos.y;($===V.maskDom||$===V.handlerDom||$===V.contentDom&&_($,ne.target,Z,ue))&&ne.cancelable&&ne.preventDefault()},V.transitionEnd=function(ne){var $=ne.target;d($,n,V.transitionEnd),$.style.transition=""},V.onKeyDown=function(ne){if(ne.keyCode===u.a.ESC){var $=V.props.onClose;ne.stopPropagation(),$&&$(ne)}},V.onWrapperTransitionEnd=function(ne){var $=V.props,Z=$.open,ue=$.afterVisibleChange;ne.target===V.contentWrapper&&ne.propertyName.match(/transform$/)&&(V.dom.style.transition="",!Z&&V.getCurrentDrawerSome()&&(document.body.style.overflowX="",V.maskDom&&(V.maskDom.style.left="",V.maskDom.style.width="")),ue&&ue(!!Z))},V.openLevelTransition=function(){var ne=V.props,$=ne.open,Z=ne.width,ue=ne.height,he=V.getHorizontalBoolAndPlacementName(),Oe=he.isHorizontal,we=he.placementName,Pe=V.contentDom?V.contentDom.getBoundingClientRect()[Oe?"width":"height"]:0,_e=(Oe?Z:ue)||Pe;V.setLevelAndScrolling($,we,_e)},V.setLevelTransform=function(ne,$,Z,ue){var he=V.props,Oe=he.placement,we=he.levelMove,Pe=he.duration,_e=he.ease,xe=he.showMask;V.levelDom.forEach(function(Ve){Ve.style.transition="transform ".concat(Pe," ").concat(_e),t(Ve,n,V.transitionEnd);var Ne=ne?Z:0;if(we){var Be=v(we,{target:Ve,open:ne});Ne=ne?Be[0]:Be[1]||0}var ze=typeof Ne=="number"?"".concat(Ne,"px"):Ne,ye=Oe==="left"||Oe==="top"?ze:"-".concat(ze);ye=xe&&Oe==="right"&&ue?"calc(".concat(ye," + ").concat(ue,"px)"):ye,Ve.style.transform=Ne?"".concat($,"(").concat(ye,")"):""})},V.setLevelAndScrolling=function(ne,$,Z){var ue=V.props.onChange;if(!b){var he=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(a.a)(!0):0;V.setLevelTransform(ne,$,Z,he),V.toggleScrollingToDrawerAndBody(he)}ue&&ue(ne)},V.toggleScrollingToDrawerAndBody=function(ne){var $=V.props,Z=$.getOpenCount,ue=$.getContainer,he=$.showMask,Oe=$.open,we=ue&&ue(),Pe=Z&&Z();if(we&&we.parentNode===document.body&&he){var _e=["touchstart"],xe=[document.body,V.maskDom,V.handlerDom,V.contentDom];Oe&&document.body.style.overflow!=="hidden"?(ne&&V.addScrollingEffect(ne),Pe===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",xe.forEach(function(Ve,Ne){if(!Ve)return;t(Ve,_e[Ne]||"touchmove",Ne?V.removeMoveHandler:V.removeStartHandler,V.passive)})):V.getCurrentDrawerSome()&&(Pe||(document.body.style.overflow=""),document.body.style.touchAction="",ne&&V.remScrollingEffect(ne),xe.forEach(function(Ve,Ne){if(!Ve)return;d(Ve,_e[Ne]||"touchmove",Ne?V.removeMoveHandler:V.removeStartHandler,V.passive)}))}},V.addScrollingEffect=function(ne){var $=V.props,Z=$.placement,ue=$.duration,he=$.ease,Oe=$.getOpenCount,we=$.switchScrollingEffect,Pe=Oe&&Oe();Pe===1&&we();var _e="width ".concat(ue," ").concat(he),xe="transform ".concat(ue," ").concat(he);V.dom.style.transition="none";switch(Z){case"right":V.dom.style.transform="translateX(-".concat(ne,"px)");break;case"top":case"bottom":V.dom.style.width="calc(100% - ".concat(ne,"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(_e),V.dom.style.width="",V.dom.style.transform="")})},V.remScrollingEffect=function(ne){var $=V.props,Z=$.placement,ue=$.duration,he=$.ease,Oe=$.getOpenCount,we=$.switchScrollingEffect,Pe=Oe&&Oe();Pe||we(!0),i&&(document.body.style.overflowX="hidden"),V.dom.style.transition="none";var _e,xe="width ".concat(ue," ").concat(he),Ve="transform ".concat(ue," ").concat(he);switch(Z){case"left":{V.dom.style.width="100%",xe="width 0s ".concat(he," ").concat(ue);break}case"right":{V.dom.style.transform="translateX(".concat(ne,"px)"),V.dom.style.width="100%",xe="width 0s ".concat(he," ").concat(ue),V.maskDom&&(V.maskDom.style.left="-".concat(ne,"px"),V.maskDom.style.width="calc(100% + ".concat(ne,"px)"));break}case"top":case"bottom":{V.dom.style.width="calc(100% + ".concat(ne,"px)"),V.dom.style.height="100%",V.dom.style.transform="translateZ(0)",_e="height 0s ".concat(he," ").concat(ue);break}default:break}clearTimeout(V.timeout),V.timeout=setTimeout(function(){V.dom&&(V.dom.style.transition="".concat(Ve,",").concat(_e?"".concat(_e,","):"").concat(xe),V.dom.style.transform="",V.dom.style.width="",V.dom.style.height="")})},V.getCurrentDrawerSome=function(){return!Object.keys(E).some(function(ne){return E[ne]})},V.getLevelDom=function(ne){var $=ne.level,Z=ne.getContainer;if(b)return;var ue=Z&&Z(),he=ue?ue.parentNode:null;if(V.levelDom=[],$==="all"){var Oe=he?Array.prototype.slice.call(he.children):[];Oe.forEach(function(we){we.nodeName!=="SCRIPT"&&we.nodeName!=="STYLE"&&we.nodeName!=="LINK"&&we!==ue&&V.levelDom.push(we)})}else $&&s($).forEach(function(we){document.querySelectorAll(we).forEach(function(Pe){V.levelDom.push(Pe)})})},V.getHorizontalBoolAndPlacementName=function(){var ne=V.props.placement,$=ne==="left"||ne==="right",Z="translate".concat($?"X":"Y");return{isHorizontal:$,placementName:Z}},V.state={_self:Object(p.a)(V)},V}return Object(j.a)(B,[{key:"componentDidMount",value:function(){var V=this;if(!b){var ne=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return ne=!0,null}}))}catch(Oe){}this.passive=ne?{passive:!1}:!1}var $=this.props,Z=$.open,ue=$.getContainer,he=ue&&ue();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),Z&&(he&&he.parentNode===document.body&&(E[this.drawerId]=Z),this.openLevelTransition(),this.forceUpdate(function(){V.domFocus()}))}},{key:"componentDidUpdate",value:function(V){var ne=this.props,$=ne.open,Z=ne.getContainer,ue=Z&&Z();$!==V.open&&($&&this.domFocus(),ue&&ue.parentNode===document.body&&(E[this.drawerId]=!!$),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var V=this.props,ne=V.getOpenCount,$=V.open,Z=V.switchScrollingEffect,ue=typeof ne=="function"&&ne();delete E[this.drawerId],$&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ue||(document.body.style.overflow="",Z(!0))}},{key:"render",value:function(){var V,ne=this,$=this.props,Z=$.className,ue=$.children,he=$.style,Oe=$.width,we=$.height,Pe=$.defaultOpen,_e=$.open,xe=$.prefixCls,Ve=$.placement,Ne=$.level,Be=$.levelMove,ze=$.ease,ye=$.duration,me=$.getContainer,We=$.handler,He=$.onChange,nt=$.afterVisibleChange,te=$.showMask,P=$.maskClosable,U=$.maskStyle,q=$.onClose,Y=$.onHandleClick,J=$.keyboard,Ee=$.getOpenCount,ke=$.switchScrollingEffect,ht=Object(de.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"]),Ue=this.dom?_e:!1,je=l()(xe,(V={},Object(h.a)(V,"".concat(xe,"-").concat(Ve),!0),Object(h.a)(V,"".concat(xe,"-open"),Ue),Object(h.a)(V,Z||"",!!Z),Object(h.a)(V,"no-mask",!te),V)),tt=this.getHorizontalBoolAndPlacementName(),dt=tt.placementName,qe=Ve==="left"||Ve==="top"?"-100%":"100%",Ye=Ue?"":"".concat(dt,"(").concat(qe,")"),Fe=We&&C.cloneElement(We,{onClick:function(Me){We.props.onClick&&We.props.onClick(),Y&&Y(Me)},ref:function(Me){ne.handlerDom=Me}});return C.createElement("div",Object.assign({},ht,{tabIndex:-1,className:je,style:he,ref:function(Me){ne.dom=Me},onKeyDown:Ue&&J?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),te&&C.createElement("div",{className:"".concat(xe,"-mask"),onClick:P?q:void 0,style:U,ref:function(Me){ne.maskDom=Me}}),C.createElement("div",{className:"".concat(xe,"-content-wrapper"),style:{transform:Ye,msTransform:Ye,width:g(Oe)?"".concat(Oe,"px"):Oe,height:g(we)?"".concat(we,"px"):we},ref:function(Me){ne.contentWrapper=Me}},C.createElement("div",{className:"".concat(xe,"-content"),ref:function(Me){ne.contentDom=Me},onTouchStart:Ue&&te?this.removeStartHandler:void 0,onTouchMove:Ue&&te?this.removeMoveHandler:void 0},ue),Fe))}}],[{key:"getDerivedStateFromProps",value:function(V,ne){var $=ne.prevProps,Z=ne._self,ue={prevProps:V};if($!==void 0){var he=V.placement,Oe=V.level;he!==$.placement&&(Z.contentDom=null),Oe!==$.level&&Z.getLevelDom(V)}return ue}}]),B}(C.Component);o.defaultProps={switchScrollingEffect:function(){}};var x=o;function A(K){var oe=O();return function(){var X=Object(S.a)(K),V;if(oe){var ne=Object(S.a)(this).constructor;V=Reflect.construct(X,arguments,ne)}else V=X.apply(this,arguments);return Object(k.a)(this,V)}}function O(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(K){return!1}}var D=function(K){Object(w.a)(B,K);var oe=A(B);function B(X){var V;Object(ee.a)(this,B),V=oe.call(this,X),V.onHandleClick=function($){var Z=V.props,ue=Z.onHandleClick,he=Z.open;if(ue&&ue($),typeof he=="undefined"){var Oe=V.state.open;V.setState({open:!Oe})}},V.onClose=function($){var Z=V.props,ue=Z.onClose,he=Z.open;ue&&ue($),typeof he=="undefined"&&V.setState({open:!1})};var ne=typeof X.open!="undefined"?X.open:!!X.defaultOpen;return V.state={open:ne},"onMaskClick"in X&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),V}return Object(j.a)(B,[{key:"render",value:function(){var V=this,ne=this.props,$=ne.defaultOpen,Z=ne.getContainer,ue=ne.wrapperClassName,he=ne.forceRender,Oe=ne.handler,we=Object(de.a)(ne,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Pe=this.state.open;if(!Z)return C.createElement("div",{className:ue,ref:function(Ve){V.dom=Ve}},C.createElement(x,Object.assign({},we,{open:Pe,handler:Oe,getContainer:function(){return V.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var _e=!!Oe||he;return C.createElement(T.a,{visible:Pe,forceRender:_e,getContainer:Z,wrapperClassName:ue},function(xe){var Ve=xe.visible,Ne=xe.afterClose,Be=Object(de.a)(xe,["visible","afterClose"]);return C.createElement(x,Object.assign({},we,Be,{open:Ve!==void 0?Ve:Pe,afterVisibleChange:Ne!==void 0?Ne:we.afterVisibleChange,handler:Oe,onClose:V.onClose,onHandleClick:V.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(V,ne){var $=ne.prevProps,Z={prevProps:V};return typeof $!="undefined"&&V.open!==$.open&&(Z.open=V.open),Z}}]),B}(C.Component);D.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:C.createElement("div",{className:"drawer-handle"},C.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var N=D,W=$e.a=N},fcyK:function(rt,$e,H){},fyJ8:function(rt,$e,H){"use strict";var de=H("rePB"),ee=H("VTBJ"),j=H("Ff2n"),w=H("U8pU"),k=H("q1tI"),S=H.n(k),T=H("TSYQ"),C=H.n(T),h=H("c+Xe"),p=H("sR1s");function c(f){return f&&Object(w.a)(f)==="object"&&!Array.isArray(f)&&!k.isValidElement(f)}function l(f){return typeof f=="string"?!0:Object(h.c)(f)}function a(f,i){var n,t=f.prefixCls,d=f.className,v=f.record,g=f.index,b=f.dataIndex,_=f.render,m=f.children,y=f.component,E=y===void 0?"td":y,o=f.colSpan,x=f.rowSpan,A=f.fixLeft,O=f.fixRight,D=f.firstFixLeft,N=f.lastFixLeft,W=f.firstFixRight,K=f.lastFixRight,oe=f.appendNode,B=f.additionalProps,X=B===void 0?{}:B,V=f.ellipsis,ne=f.align,$=f.rowType,Z=f.isSticky,ue="".concat(t,"-cell"),he,Oe;if(m)Oe=m;else{var we=Object(p.b)(v,b);if(Oe=we,_){var Pe=_(we,v,g);c(Pe)?(Oe=Pe.children,he=Pe.props):Oe=Pe}}Object(w.a)(Oe)==="object"&&!Array.isArray(Oe)&&!k.isValidElement(Oe)&&(Oe=null),V&&(N||W)&&(Oe=k.createElement("span",{className:"".concat(ue,"-content")},Oe));var _e=he||{},xe=_e.colSpan,Ve=_e.rowSpan,Ne=_e.style,Be=_e.className,ze=Object(j.a)(_e,["colSpan","rowSpan","style","className"]),ye=xe!==void 0?xe:o,me=Ve!==void 0?Ve:x;if(ye===0||me===0)return null;var We={},He=typeof A=="number",nt=typeof O=="number";He&&(We.position="sticky",We.left=A),nt&&(We.position="sticky",We.right=O);var te={};ne&&(te.textAlign=ne);var P,U=V===!0?{showTitle:!0}:V;U&&(U.showTitle||$==="header")&&(typeof Oe=="string"||typeof Oe=="number"?P=Oe.toString():k.isValidElement(Oe)&&typeof Oe.props.children=="string"&&(P=Oe.props.children));var q=Object(ee.a)(Object(ee.a)(Object(ee.a)({title:P},ze),X),{},{colSpan:ye&&ye!==1?ye:null,rowSpan:me&&me!==1?me:null,className:C()(ue,d,(n={},Object(de.a)(n,"".concat(ue,"-fix-left"),He),Object(de.a)(n,"".concat(ue,"-fix-left-first"),D),Object(de.a)(n,"".concat(ue,"-fix-left-last"),N),Object(de.a)(n,"".concat(ue,"-fix-right"),nt),Object(de.a)(n,"".concat(ue,"-fix-right-first"),W),Object(de.a)(n,"".concat(ue,"-fix-right-last"),K),Object(de.a)(n,"".concat(ue,"-ellipsis"),V),Object(de.a)(n,"".concat(ue,"-with-append"),oe),Object(de.a)(n,"".concat(ue,"-fix-sticky"),(He||nt)&&Z),n),X.className,Be),style:Object(ee.a)(Object(ee.a)(Object(ee.a)(Object(ee.a)({},X.style),te),We),Ne),ref:l(E)?i:null});return k.createElement(E,Object.assign({},q),oe,Oe)}var u=k.forwardRef(a);u.displayName="Cell";var s=k.memo(u,function(f,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,f.record):!1});$e.a=s},gRFJ:function(rt,$e,H){rt.exports=[H("rdUC"),H("ynwM"),H("RELg"),H("DlR+"),H("CrYA"),H("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(rt){return rt<10?"0"+rt:rt}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(rt){return rx_escapable.lastIndex=0,rx_escapable.test(rt)?'"'+rt.replace(rx_escapable,function($e){var H=meta[$e];return typeof H=="string"?H:"\\u"+("0000"+$e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+rt+'"'}function str(rt,$e){var H,de,ee,j,w=gap,k,S=$e[rt];S&&typeof S=="object"&&typeof S.toJSON=="function"&&(S=S.toJSON(rt)),typeof rep=="function"&&(S=rep.call($e,rt,S));switch(typeof S){case"string":return quote(S);case"number":return isFinite(S)?String(S):"null";case"boolean":case"null":return String(S);case"object":if(!S)return"null";if(gap+=indent,k=[],Object.prototype.toString.apply(S)==="[object Array]"){for(j=S.length,H=0;H<j;H+=1)k[H]=str(H,S)||"null";return ee=k.length===0?"[]":gap?`[
|
|
|
`+gap+k.join(`,
|
|
|
`+gap)+`
|
|
|
`+w+"]":"["+k.join(",")+"]",gap=w,ee}if(rep&&typeof rep=="object")for(j=rep.length,H=0;H<j;H+=1)typeof rep[H]=="string"&&(de=rep[H],ee=str(de,S),ee&&k.push(quote(de)+(gap?": ":":")+ee));else for(de in S)Object.prototype.hasOwnProperty.call(S,de)&&(ee=str(de,S),ee&&k.push(quote(de)+(gap?": ":":")+ee));return ee=k.length===0?"{}":gap?`{
|
|
|
`+gap+k.join(`,
|
|
|
`+gap)+`
|
|
|
`+w+"}":"{"+k.join(",")+"}",gap=w,ee}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(rt,$e,H){var de;if(gap="",indent="",typeof H=="number")for(de=0;de<H;de+=1)indent+=" ";else typeof H=="string"&&(indent=H);if(rep=$e,$e&&typeof $e!="function"&&(typeof $e!="object"||typeof $e.length!="number"))throw new Error("JSON.stringify");return str("",{"":rt})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(rt,$e){var H,de,ee=rt[$e];if(ee&&typeof ee=="object")for(H in ee)Object.prototype.hasOwnProperty.call(ee,H)&&(de=walk(ee,H),de!==void 0?ee[H]=de:delete ee[H]);return reviver.call(rt,$e,ee)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(rt){return"\\u"+("0000"+rt.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(rt,$e,H){rt.exports=H.p+"static/g.a5bcde87.svg"},hW8S:function(rt,$e,H){"use strict";H.d($e,"a",function(){return w}),H.d($e,"c",function(){return k}),H.d($e,"b",function(){return S});var de=H("VTBJ"),ee=H("Ff2n"),j=H("Kwbf"),w="RC_TABLE_INTERNAL_COL_DEFINE";function k(T){var C=T.expandable,h=Object(ee.a)(T,["expandable"]);return"expandable"in T?Object(de.a)(Object(de.a)({},h),C):h}function S(T){return Object.keys(T).reduce(function(C,h){return(h.substr(0,5)==="data-"||h.substr(0,5)==="aria-")&&(C[h]=T[h]),C},{})}},hgre:function(rt,$e,H){"use strict";var de=H("miYZ"),ee=H("tsqr"),j=H("9og8"),w=H("WmNS"),k=H.n(w),S=H("q1tI"),T=H.n(S),C=H("GUcZ"),h=H("ulZh"),p=H.n(h),c=H("xKgJ"),l=H("bntm"),a=H("4xil"),u=H.n(a);function s(t){if(isNaN(t))return{minutes:"00",seconds:"00"};var d=new Date(t*1e3).toISOString().substr(11,8);return{minutes:d.substr(3,2),seconds:d.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function f(t,d){return t-d}function i(t){t.sort(f);for(var d=0,v=0;v<t.length-1;v++){var g=Math.abs(t[v+1]-t[v]);g<21&&(d+=g)}return d}var n=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;$e.a=Object(S.forwardRef)(function(t,d){var v,g=t.src,b=t.toLog,_=t.videoId,m=t.logWatchHistory,y=t.courseId,E=y===void 0?null:y,o=t.startTime,x=t.handlePause,A=x===void 0?function(){}:x,O=t.handlePlay,D=O===void 0?function(){}:O,N=t.handlePlayEnded,W=N===void 0?function(){}:N,K=t.videoSpeed,oe=K===void 0?1:K,B=g==null||((v=g.split("."))===null||v===void 0)?void 0:v.pop(),X=B==="flv",V=Object(S.useRef)(),ne=Object(S.useRef)(),$=Object(S.useRef)(),Z=Object(S.useRef)(),ue=Object(S.useRef)(),he=Object(S.useRef)(),Oe=Object(S.useRef)(),we=Object(S.useRef)(),Pe=Object(S.useRef)(),_e=Object(S.useRef)(),xe=Object(S.useRef)(),Ve=Object(S.useRef)(),Ne=Object(S.useRef)(),Be=Object(S.useRef)(),ze=navigator.userAgent.toLowerCase().match(n),ye=ze?ze[0]:"pc",me=Object(S.useRef)(!1),We=Object(c.x)(),He=0,nt=0,te=0,P=null,U=!1,q=20,Y=1,J=!1,Ee=!1,ke=[];Object(S.useImperativeHandle)(d,function(){return{getLastUpdatedTime:function(){return V.current.currentTime},getDuration:function(){return V.current.duration}}});var ht=Object(S.useCallback)(function(qe){var Ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe={point:V.current.currentTime};P?(Fe.log_id=P,Fe.watch_duration=i(ke),Fe.total_duration=nt):(E?(Fe.video_id=parseInt(_,10),Fe.course_id=E):Fe.video_id=_,Fe.duration=He,Fe.device=ye),Ye&&(Fe.ed="1");function Ie(){return Me.apply(this,arguments)}function Me(){return Me=Object(j.a)(k.a.mark(function be(){var Te;return k.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return J=!0,Ce.next=3,m(Fe);case 3:Te=Ce.sent,P=Te,J=!1,qe&&qe();case 7:case"end":return Ce.stop()}},be)})),Me.apply(this,arguments)}Ie()},[_,E]);Object(S.useEffect)(function(){ee.b.destroy();var qe=null;return C.a.isSupported&&X&&g&&(g==null?void 0:g.indexOf(".m3u8"))<0?(qe=C.a.createPlayer({type:"flv",volume:.8,cors:!0,url:g,muted:!1}),V.current&&(qe.attachMediaElement(V.current),qe.load())):V.current.setAttribute("src",g),je(),function(){qe&&(qe.unload(),qe.pause(),qe.destroy(),qe=null)}},[V,X,g]);function Ue(){V.current.paused?(Z.current.style.display="none",ue.current.style.display="block"):(Z.current.style.display="block",ue.current.style.display="none")}function je(){xe.current.style.display="none",Ne.current.style.display="none",Ve.current.style.display="none",V.current.muted||V.current.volume===0?xe.current.style.display="block":V.current.volume>0&&V.current.volume<=.5?Ne.current.style.display="block":Ve.current.style.display="block"}Object(S.useEffect)(function(){var qe=document.getElementById("play"),Ye=document.querySelectorAll(".playback-icons use");function Fe(){D(),o&&!me.current&&(V.current.currentTime=o),me.current=!0,ke.push(V.current.currentTime),U||(U=!0,b&&ht())}function Ie(){return Me.apply(this,arguments)}function Me(){return Me=Object(j.a)(k.a.mark(function st(){return k.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:Ue(),ke.push(V.current.currentTime),b&&ht(function(){P=null,te=0,U=!1,J=!1,Ee=!1,ke=[],nt=0,Y=1},!0);case 3:case"end":return lt.stop()}},st)})),Me.apply(this,arguments)}function be(){he.current.value=Math.floor(V.current.currentTime),Oe.current.value=Math.floor(V.current.currentTime)}function Te(){var st=s(Math.round(V.current.currentTime));Pe.current.innerText="".concat(st.minutes,":").concat(st.seconds),Pe.current.setAttribute("datetime","".concat(st.minutes,"m ").concat(st.seconds,"s"))}function Le(){var st=Math.round(V.current.duration);he.current.setAttribute("max",st),Oe.current.setAttribute("max",st);var mt=s(st);we.current.innerText="".concat(mt.minutes,":").concat(mt.seconds),we.current.setAttribute("datetime","".concat(mt.minutes,"m ").concat(mt.seconds,"s"))}function Ce(){var st=Math.round(V.current.duration);he.current.setAttribute("max",st),Oe.current.setAttribute("max",st);var mt=s(st);we.current.innerText="".concat(mt.minutes,":").concat(mt.seconds),we.current.setAttribute("datetime","".concat(mt.minutes,"m ").concat(mt.seconds,"s")),be(),Te();var lt=ne.current.getBoundingClientRect(),De=lt.width,Ke=lt.height,vt=lt.x,ot=lt.y;if(vt<0||ot<0||!De)return;if(!Ee){var Mt=V.current.currentTime,Nt=Mt-te;Math.abs(Nt)<10?(nt+=Math.abs(Nt),te=Mt,J||nt-Y*q>=0&&(Y++,ke.push(te),b&&ht())):(te=Mt,b&&ht())}}function et(){Ee=!0}function Qe(){V.current.playing&&ke.push(V.current.currentTime,te),te=V.current.currentTime,Ee=!1}function yt(){He=V.current.duration,He<=20&&(q=He/3),V.current.addEventListener("play",Fe)}function Dt(st){st.preventDefault(),Object(l.a)()?(V.current.style.width="100%",V.current.style.height="100%"):V.current.style.cssText=""}function Bt(){A()}function Pt(st){var mt=st.target.dataset.seek?st.target.dataset.seek:st.target.value;V.current.currentTime=mt,Oe.current.value=mt,he.current.value=mt}function Rt(st){var mt=Math.round(st.offsetX/st.target.clientWidth*parseInt(st.target.getAttribute("max"),10));he.current.setAttribute("data-seek",mt);var lt=s(mt);_e.current.textContent="".concat(lt.minutes,":").concat(lt.seconds);var De=V.current.getBoundingClientRect();_e.current.style.left="".concat(st.pageX-De.left,"px")}return $.current.addEventListener(Object(l.c)(),Dt),V.current.addEventListener("canplay",yt),V.current.addEventListener("ended",Ie),V.current.addEventListener("seeking",et),V.current.addEventListener("seeked",Qe),V.current.addEventListener("loadedmetadata",Le),he.current.addEventListener("mousemove",Rt),he.current.addEventListener("input",Pt),V.current.addEventListener("timeupdate",Ce),V.current.addEventListener("pause",Bt),V.current.addEventListener("volumechange",je),function(){V.current.removeEventListener("canplay",yt),V.current.removeEventListener("play",Fe),V.current.removeEventListener("ended",Ie),V.current.removeEventListener("seeking",et),V.current.removeEventListener("seeked",Qe),he.current.removeEventListener("mousemove",Rt),he.current.removeEventListener("input",Pt),V.current.removeEventListener("timeupdate",Ce),V.current.removeEventListener("pause",Bt),V.current.removeEventListener("loadedmetadata",Le),V.current.removeEventListener("volumechange",je),V.current.playing&&(ke.push(te,V.current.currentTime),b&&ht())}},[V,g]),Object(S.useEffect)(function(){if(V.current.onended=function(){W(V)},V.current.oncontextmenu=function(){return!1},(g==null?void 0:g.indexOf(".m3u8"))>-1){if(V.current.canPlayType("application/vnd.apple.mpegurl"))V.current.src=g;else if(p.a.isSupported()){var qe=new p.a;qe.loadSource(g),qe.attachMedia(V.current)}}},[g]),Object(S.useEffect)(function(){V.current.playbackRate=oe},[oe]);var tt=function(){V.current.paused||V.current.ended?V.current.play():V.current.pause(),Ue()};function dt(){V.current.muted=!V.current.muted,V.current.muted?(Be.current.setAttribute("data-volume",volume.value),Be.current.value=0):Be.current.value=Be.current.dataset.volume}return T.a.createElement("div",{style:{position:"relative"},ref:$},T.a.createElement("div",{ref:ne,className:"".concat(u.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(u.a.animate__loop)},We?We.login:" "),T.a.createElement("div",{className:u.a.container},T.a.createElement("div",{className:u.a["video-container"],id:"video-container"},T.a.createElement("div",{className:u.a["playback-animation"],id:"playback-animation"},T.a.createElement("svg",{className:u.a["playback-icons"]},T.a.createElement("use",{className:"hidden",href:"#play-icon"}),T.a.createElement("use",{href:"#pause"}))),T.a.createElement("video",{className:u.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:V,autoPlay:!1}),T.a.createElement("div",{className:"".concat(u.a["video-controls"]," "),id:"video-controls"},T.a.createElement("div",{className:u.a["bottom-controls"]},T.a.createElement("div",{className:u.a["left-controls"]},T.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:tt},T.a.createElement("svg",{className:u.a["playback-icons"]},T.a.createElement("use",{ref:ue,href:"#play-icon"}),T.a.createElement("use",{ref:Z,style:{display:"none"},href:"#pause"}))),T.a.createElement("div",{className:u.a.time},T.a.createElement("time",{id:"time-elapsed",ref:Pe},"00:00"),T.a.createElement("span",null," / "),T.a.createElement("time",{id:"duration",ref:we},"00:00"))),T.a.createElement("div",{className:u.a["right-controls"]},T.a.createElement("div",{className:u.a["volume-controls"]},T.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:u.a["volume-button"],id:"volume-button",onClick:dt},T.a.createElement("svg",null,T.a.createElement("use",{ref:xe,href:"#volume-mute"}),T.a.createElement("use",{ref:Ne,href:"#volume-low"}),T.a.createElement("use",{ref:Ve,href:"#volume-high"}))),T.a.createElement("input",{className:u.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Be,style:{display:"none"},onClick:je})),T.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:u.a["fullscreen-button"],onClick:function(){Object(l.a)()?Object(l.b)():Object(l.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:u.a["video-progress"]},T.a.createElement("progress",{ref:Oe,value:"0",min:"0"}),T.a.createElement("input",{className:u.a.seek,ref:he,value:"0",min:"0",type:"range",step:"1"}),T.a.createElement("div",{className:u.a["seek-tooltip"],ref:_e,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(rt,$e,H){},je13:function(rt,$e,H){var de=H("5nXd"),ee=H("gRFJ"),j=[H("uQRt")];rt.exports=de.createStore(ee,j)},kSUc:function(rt,$e,H){},"kaH+":function(rt,$e,H){"use strict";var de=H("+L6B"),ee=H("2/Rp"),j=H("tJVT"),w=H("q1tI"),k=H.n(w),S=H("UZu5"),T=H.n(S),C=H("dhSg"),h=H("rLCj"),p=H("dF/Y"),c=H("4i/N");$e.a=function(){var l=Object(w.useState)(""),a=Object(j.a)(l,2),u=a[0],s=a[1],f=Object(w.useState)(0),i=Object(j.a)(f,2),n=i[0],t=i[1],d=Object(w.useRef)("");Object(w.useEffect)(function(){var _=C.a.subscribe("preview-image",function(m){s(m),document.body.style.overflow="hidden"});return _},[]),Object(w.useEffect)(function(){return document.addEventListener("keydown",v),function(){document.removeEventListener("keydown",v)}},[]),Object(w.useEffect)(function(){d.current=u},[u]);function v(_){_.keyCode==27&&d.current&&g()}function g(){document.body.style.overflow="auto",s("")}function b(){t(n+90)}return k.a.createElement(w.Fragment,null,u?k.a.createElement("div",{className:"image-preview-container"},k.a.createElement("div",{className:"button-group"},k.a.createElement(ee.a,{onClick:b},"\u65CB\u8F6C",k.a.createElement(h.a,null)),k.a.createElement(ee.a,{href:u},"\u4E0B\u8F7D",k.a.createElement(p.a,null)),k.a.createElement(ee.a,{onClick:g},"\u5173\u95ED",k.a.createElement(c.a,null))),k.a.createElement("div",{className:"preview-wrp-group"},k.a.createElement("img",{className:"image-preview",src:u,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(n,"deg)")}}))):null)}},kovY:function(rt,$e,H){rt.exports=H.p+"static/e.eabfa286.svg"},lOMy:function(rt,$e,H){},lZu9:function(rt,$e,H){(function(de){de(H("VrN/"),H("1eCo"),H("8EBN"))})(function(de){"use strict";de.defineMode("markdown",function(ee,j){var w=de.getMode(ee,"text/html"),k=w.name=="null";function S(B){if(de.findModeByName){var X=de.findModeByName(B);X&&(B=X.mime||X.mimes[0])}var V=de.getMode(ee,B);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 C in T)T.hasOwnProperty(C)&&j.tokenTypeOverrides[C]&&(T[C]=j.tokenTypeOverrides[C]);var h=/^([*\-_])(?:\s*\1){2,}\s*$/,p=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,l=j.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,a=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,n=" ";function t(B,X,V){return X.f=X.inline=V,V(B,X)}function d(B,X,V){return X.f=X.block=V,V(B,X)}function v(B){return!B||!/\S/.test(B.string)}function g(B){if(B.linkTitle=!1,B.linkHref=!1,B.linkText=!1,B.em=!1,B.strong=!1,B.strikethrough=!1,B.quote=0,B.indentedCode=!1,B.f==_){var X=k;if(!X){var V=de.innerMode(w,B.htmlState);X=V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText}X&&(B.f=o,B.block=b,B.htmlState=null)}return B.trailingSpace=0,B.trailingSpaceNewLine=!1,B.prevLine=B.thisLine,B.thisLine={stream:null},null}function b(B,X){var V=B.column()===X.indentation,ne=v(X.prevLine.stream),$=X.indentedCode,Z=X.prevLine.hr,ue=X.list!==!1,he=(X.listStack[X.listStack.length-1]||0)+3;X.indentedCode=!1;var Oe=X.indentation;if(X.indentationDiff===null&&(X.indentationDiff=X.indentation,ue)){for(X.list=null;Oe<X.listStack[X.listStack.length-1];)X.listStack.pop(),X.listStack.length?X.indentation=X.listStack[X.listStack.length-1]:X.list=!1;X.list!==!1&&(X.indentationDiff=Oe-X.listStack[X.listStack.length-1])}var we=!ne&&!Z&&!X.prevLine.header&&(!ue||!$)&&!X.prevLine.fencedCodeEnd,Pe=(X.list===!1||Z||ne)&&X.indentation<=he&&B.match(h),_e=null;if(X.indentationDiff>=4&&($||X.prevLine.fencedCodeEnd||X.prevLine.header||ne))return B.skipToEnd(),X.indentedCode=!0,T.code;if(B.eatSpace())return null;if(V&&X.indentation<=he&&(_e=B.match(l))&&_e[1].length<=6)return X.quote=0,X.header=_e[1].length,X.thisLine.header=!0,j.highlightFormatting&&(X.formatting="header"),X.f=X.inline,y(X);if(X.indentation<=he&&B.eat(">"))return X.quote=V?1:X.quote+1,j.highlightFormatting&&(X.formatting="quote"),B.eatSpace(),y(X);if(!Pe&&!X.setext&&V&&X.indentation<=he&&(_e=B.match(p))){var xe=_e[1]?"ol":"ul";return X.indentation=Oe+B.current().length,X.list=!0,X.quote=0,X.listStack.push(X.indentation),X.em=!1,X.strong=!1,X.code=!1,X.strikethrough=!1,j.taskLists&&B.match(c,!1)&&(X.taskList=!0),X.f=X.inline,j.highlightFormatting&&(X.formatting=["list","list-"+xe]),y(X)}else{if(V&&X.indentation<=he&&(_e=B.match(s,!0)))return X.quote=0,X.fencedEndRE=new RegExp(_e[1]+"+ *$"),X.localMode=j.fencedCodeBlockHighlighting&&S(_e[2]||j.fencedCodeBlockDefaultMode),X.localMode&&(X.localState=de.startState(X.localMode)),X.f=X.block=m,j.highlightFormatting&&(X.formatting="code-block"),X.code=-1,y(X);if(X.setext||(!we||!ue)&&!X.quote&&X.list===!1&&!X.code&&!Pe&&!f.test(B.string)&&(_e=B.lookAhead(1))&&(_e=_e.match(a)))return X.setext?(X.header=X.setext,X.setext=0,B.skipToEnd(),j.highlightFormatting&&(X.formatting="header")):(X.header=_e[0].charAt(0)=="="?1:2,X.setext=X.header),X.thisLine.header=!0,X.f=X.inline,y(X);if(Pe)return B.skipToEnd(),X.hr=!0,X.thisLine.hr=!0,T.hr;if(B.peek()==="[")return t(B,X,N)}return t(B,X,X.inline)}function _(B,X){var V=w.token(B,X.htmlState);if(!k){var ne=de.innerMode(w,X.htmlState);(ne.mode.name=="xml"&&ne.state.tagStart===null&&!ne.state.context&&ne.state.tokenize.isInText||X.md_inside&&B.current().indexOf(">")>-1)&&(X.f=o,X.block=b,X.htmlState=null)}return V}function m(B,X){var V=X.listStack[X.listStack.length-1]||0,ne=X.indentation<V,$=V+3;if(X.fencedEndRE&&X.indentation<=$&&(ne||B.match(X.fencedEndRE))){j.highlightFormatting&&(X.formatting="code-block");var Z;return ne||(Z=y(X)),X.localMode=X.localState=null,X.block=b,X.f=o,X.fencedEndRE=null,X.code=0,X.thisLine.fencedCodeEnd=!0,ne?d(B,X,X.block):Z}else return X.localMode?X.localMode.token(B,X.localState):(B.skipToEnd(),T.code)}function y(B){var X=[];if(B.formatting){X.push(T.formatting),typeof B.formatting=="string"&&(B.formatting=[B.formatting]);for(var V=0;V<B.formatting.length;V++)X.push(T.formatting+"-"+B.formatting[V]),B.formatting[V]==="header"&&X.push(T.formatting+"-"+B.formatting[V]+"-"+B.header),B.formatting[V]==="quote"&&(!j.maxBlockquoteDepth||j.maxBlockquoteDepth>=B.quote?X.push(T.formatting+"-"+B.formatting[V]+"-"+B.quote):X.push("error"))}if(B.taskOpen)return X.push("meta"),X.length?X.join(" "):null;if(B.taskClosed)return X.push("property"),X.length?X.join(" "):null;if(B.linkHref?X.push(T.linkHref,"url"):(B.strong&&X.push(T.strong),B.em&&X.push(T.em),B.strikethrough&&X.push(T.strikethrough),B.emoji&&X.push(T.emoji),B.linkText&&X.push(T.linkText),B.code&&X.push(T.code),B.image&&X.push(T.image),B.imageAltText&&X.push(T.imageAltText,"link"),B.imageMarker&&X.push(T.imageMarker)),B.header&&X.push(T.header,T.header+"-"+B.header),B.quote&&(X.push(T.quote),!j.maxBlockquoteDepth||j.maxBlockquoteDepth>=B.quote?X.push(T.quote+"-"+B.quote):X.push(T.quote+"-"+j.maxBlockquoteDepth)),B.list!==!1){var ne=(B.listStack.length-1)%3;ne?ne===1?X.push(T.list2):X.push(T.list3):X.push(T.list1)}return B.trailingSpaceNewLine?X.push("trailing-space-new-line"):B.trailingSpace&&X.push("trailing-space-"+(B.trailingSpace%2?"a":"b")),X.length?X.join(" "):null}function E(B,X){return B.match(u,!0)?y(X):void 0}function o(B,X){var V=X.text(B,X);if(typeof V!="undefined")return V;if(X.list)return X.list=null,y(X);if(X.taskList){var ne=B.match(c,!0)[1]===" ";return ne?X.taskOpen=!0:X.taskClosed=!0,j.highlightFormatting&&(X.formatting="task"),X.taskList=!1,y(X)}if(X.taskOpen=!1,X.taskClosed=!1,X.header&&B.match(/^#+$/,!0))return j.highlightFormatting&&(X.formatting="header"),y(X);var $=B.next();if(X.linkTitle){X.linkTitle=!1;var Z=$;$==="("&&(Z=")"),Z=(Z+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ue="^\\s*(?:[^"+Z+"\\\\]+|\\\\\\\\|\\\\.)"+Z;if(B.match(new RegExp(ue),!0))return T.linkHref}if($==="`"){var he=X.formatting;j.highlightFormatting&&(X.formatting="code"),B.eatWhile("`");var Oe=B.current().length;if(X.code==0&&(!X.quote||Oe==1))return X.code=Oe,y(X);if(Oe==X.code){var we=y(X);return X.code=0,we}else return X.formatting=he,y(X)}else if(X.code)return y(X);if($==="\\"&&(B.next(),j.highlightFormatting)){var Pe=y(X),_e=T.formatting+"-escape";return Pe?Pe+" "+_e:_e}if($==="!"&&B.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return X.imageMarker=!0,X.image=!0,j.highlightFormatting&&(X.formatting="image"),y(X);if($==="["&&X.imageMarker&&B.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return X.imageMarker=!1,X.imageAltText=!0,j.highlightFormatting&&(X.formatting="image"),y(X);if($==="]"&&X.imageAltText){j.highlightFormatting&&(X.formatting="image");var Pe=y(X);return X.imageAltText=!1,X.image=!1,X.inline=X.f=A,Pe}if($==="["&&!X.image)return X.linkText&&B.match(/^.*?\]/)||(X.linkText=!0,j.highlightFormatting&&(X.formatting="link")),y(X);if($==="]"&&X.linkText){j.highlightFormatting&&(X.formatting="link");var Pe=y(X);return X.linkText=!1,X.inline=X.f=B.match(/\(.*?\)| ?\[.*?\]/,!1)?A:o,Pe}if($==="<"&&B.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){X.f=X.inline=x,j.highlightFormatting&&(X.formatting="link");var Pe=y(X);return Pe?Pe+=" ":Pe="",Pe+T.linkInline}if($==="<"&&B.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){X.f=X.inline=x,j.highlightFormatting&&(X.formatting="link");var Pe=y(X);return Pe?Pe+=" ":Pe="",Pe+T.linkEmail}if(j.xml&&$==="<"&&B.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var xe=B.string.indexOf(">",B.pos);if(xe!=-1){var Ve=B.string.substring(B.start,xe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ve)&&(X.md_inside=!0)}return B.backUp(1),X.htmlState=de.startState(w),d(B,X,_)}if(j.xml&&$==="<"&&B.match(/^\/\w*?>/))return X.md_inside=!1,"tag";if($==="*"||$==="_"){for(var Ne=1,Be=B.pos==1?" ":B.string.charAt(B.pos-2);Ne<3&&B.eat($);)Ne++;var ze=B.peek()||" ",ye=!/\s/.test(ze)&&(!i.test(ze)||/\s/.test(Be)||i.test(Be)),me=!/\s/.test(Be)&&(!i.test(Be)||/\s/.test(ze)||i.test(ze)),We=null,He=null;if(Ne%2&&(!X.em&&ye&&($==="*"||!me||i.test(Be))?We=!0:X.em==$&&me&&($==="*"||!ye||i.test(ze))&&(We=!1)),Ne>1&&(!X.strong&&ye&&($==="*"||!me||i.test(Be))?He=!0:X.strong==$&&me&&($==="*"||!ye||i.test(ze))&&(He=!1)),He!=null||We!=null){j.highlightFormatting&&(X.formatting=We==null?"strong":He==null?"em":"strong em"),We===!0&&(X.em=$),He===!0&&(X.strong=$);var we=y(X);return We===!1&&(X.em=!1),He===!1&&(X.strong=!1),we}}else if($===" "&&(B.eat("*")||B.eat("_"))){if(B.peek()===" ")return y(X);B.backUp(1)}if(j.strikethrough){if($==="~"&&B.eatWhile($)){if(X.strikethrough){j.highlightFormatting&&(X.formatting="strikethrough");var we=y(X);return X.strikethrough=!1,we}else if(B.match(/^[^\s]/,!1))return X.strikethrough=!0,j.highlightFormatting&&(X.formatting="strikethrough"),y(X)}else if($===" "&&B.match(/^~~/,!0)){if(B.peek()===" ")return y(X);B.backUp(2)}}if(j.emoji&&$===":"&&B.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){X.emoji=!0,j.highlightFormatting&&(X.formatting="emoji");var nt=y(X);return X.emoji=!1,nt}return $===" "&&(B.match(/^ +$/,!1)?X.trailingSpace++:X.trailingSpace&&(X.trailingSpaceNewLine=!0)),y(X)}function x(B,X){var V=B.next();if(V===">"){X.f=X.inline=o,j.highlightFormatting&&(X.formatting="link");var ne=y(X);return ne?ne+=" ":ne="",ne+T.linkInline}return B.match(/^[^>]+/,!0),T.linkInline}function A(B,X){if(B.eatSpace())return null;var V=B.next();return V==="("||V==="["?(X.f=X.inline=D(V==="("?")":"]"),j.highlightFormatting&&(X.formatting="link-string"),X.linkHref=!0,y(X)):"error"}var O={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function D(B){return function(X,V){var ne=X.next();if(ne===B){V.f=V.inline=o,j.highlightFormatting&&(V.formatting="link-string");var $=y(V);return V.linkHref=!1,$}return X.match(O[B]),V.linkHref=!0,y(V)}}function N(B,X){return B.match(/^([^\]\\]|\\.)*\]:/,!1)?(X.f=W,B.next(),j.highlightFormatting&&(X.formatting="link"),X.linkText=!0,y(X)):t(B,X,o)}function W(B,X){if(B.match(/^\]:/,!0)){X.f=X.inline=K,j.highlightFormatting&&(X.formatting="link");var V=y(X);return X.linkText=!1,V}return B.match(/^([^\]\\]|\\.)+/,!0),T.linkText}function K(B,X){return B.eatSpace()?null:(B.match(/^[^\s]+/,!0),B.peek()===void 0?X.linkTitle=!0:B.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),X.f=X.inline=o,T.linkHref+" url")}var oe={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:o,text:E,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(B){return{f:B.f,prevLine:B.prevLine,thisLine:B.thisLine,block:B.block,htmlState:B.htmlState&&de.copyState(w,B.htmlState),indentation:B.indentation,localMode:B.localMode,localState:B.localMode?de.copyState(B.localMode,B.localState):null,inline:B.inline,text:B.text,formatting:!1,linkText:B.linkText,linkTitle:B.linkTitle,linkHref:B.linkHref,code:B.code,em:B.em,strong:B.strong,strikethrough:B.strikethrough,emoji:B.emoji,header:B.header,setext:B.setext,hr:B.hr,taskList:B.taskList,list:B.list,listStack:B.listStack.slice(0),quote:B.quote,indentedCode:B.indentedCode,trailingSpace:B.trailingSpace,trailingSpaceNewLine:B.trailingSpaceNewLine,md_inside:B.md_inside,fencedEndRE:B.fencedEndRE}},token:function(B,X){if(X.formatting=!1,B!=X.thisLine.stream){if(X.header=0,X.hr=!1,B.match(/^\s*$/,!0))return g(X),null;if(X.prevLine=X.thisLine,X.thisLine={stream:B},X.taskList=!1,X.trailingSpace=0,X.trailingSpaceNewLine=!1,!X.localState&&(X.f=X.block,X.f!=_)){var V=B.match(/^\s*/,!0)[0].replace(/\t/g,n).length;if(X.indentation=V,X.indentationDiff=null,V>0)return null}}return X.f(B,X)},innerMode:function(B){return B.block==_?{state:B.htmlState,mode:w}:B.localState?{state:B.localState,mode:B.localMode}:{state:B,mode:oe}},indent:function(B,X,V){return B.block==_&&w.indent?w.indent(B.htmlState,X,V):B.localState&&B.localMode.indent?B.localMode.indent(B.localState,X,V):de.Pass},blankLine:g,getType:y,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return oe},"xml"),de.defineMIME("text/markdown","markdown"),de.defineMIME("text/x-markdown","markdown")})},n6Qo:function(rt,$e,H){"use strict";H.d($e,"a",function(){return C});var de=H("q1tI"),ee=H("biw7"),j=H("fyJ8");function w(h){var p=h.className,c=h.index,l=h.children,a=h.colSpan,u=h.rowSpan,s=de.useContext(ee.a),f=s.prefixCls,i=s.fixedInfoList,n=i[c];return de.createElement(j.a,Object.assign({className:p,index:c,component:"td",prefixCls:f,record:null,dataIndex:null,render:function(){return{children:l,props:{colSpan:a,rowSpan:u}}}},n))}function k(h){return de.createElement("tr",Object.assign({},h))}function S(h){var p=h.children,c=de.useContext(ee.a),l=c.prefixCls;return de.createElement("tfoot",{className:"".concat(l,"-summary")},p)}var T=$e.b=S,C={Cell:w,Row:k}},nCk5:function(rt,$e,H){rt.exports=H.p+"static/d.53bf6ae3.svg"},nWbc:function(rt,$e,H){},oE5q:function(rt,$e,H){rt.exports=H.p+"static/t.0b94c5c3.svg"},oFv4:function(rt,$e,H){rt.exports=H.p+"static/internal.da228387.png"},osHv:function(rt,$e,H){(function(de){de(H("VrN/"))})(function(de){"use strict";var ee=de.Pos;function j(i,n){return i.line-n.line||i.ch-n.ch}var w="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",k=w+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",S=new RegExp("<(/?)(["+w+"]["+k+"]*)","g");function T(i,n,t,d){this.line=n,this.ch=t,this.cm=i,this.text=i.getLine(n),this.min=d?Math.max(d.from,i.firstLine()):i.firstLine(),this.max=d?Math.min(d.to-1,i.lastLine()):i.lastLine()}function C(i,n){var t=i.cm.getTokenTypeAt(ee(i.line,n));return t&&/\btag\b/.test(t)}function h(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function p(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function c(i){for(;;){var n=i.text.indexOf(">",i.ch);if(n==-1){if(h(i))continue;return}if(!C(i,n+1)){i.ch=n+1;continue}var t=i.text.lastIndexOf("/",n),d=t>-1&&!/\S/.test(i.text.slice(t+1,n));return i.ch=n+1,d?"selfClose":"regular"}}function l(i){for(;;){var n=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(n==-1){if(p(i))continue;return}if(!C(i,n+1)){i.ch=n;continue}S.lastIndex=n,i.ch=n;var t=S.exec(i.text);if(t&&t.index==n)return t}}function a(i){for(;;){S.lastIndex=i.ch;var n=S.exec(i.text);if(!n){if(h(i))continue;return}if(!C(i,n.index+1)){i.ch=n.index+1;continue}return i.ch=n.index+n[0].length,n}}function u(i){for(;;){var n=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(n==-1){if(p(i))continue;return}if(!C(i,n+1)){i.ch=n;continue}var t=i.text.lastIndexOf("/",n),d=t>-1&&!/\S/.test(i.text.slice(t+1,n));return i.ch=n+1,d?"selfClose":"regular"}}function s(i,n){for(var t=[];;){var d=a(i),v,g=i.line,b=i.ch-(d?d[0].length:0);if(!d||!(v=c(i)))return;if(v=="selfClose")continue;if(d[1]){for(var _=t.length-1;_>=0;--_)if(t[_]==d[2]){t.length=_;break}if(_<0&&(!n||n==d[2]))return{tag:d[2],from:ee(g,b),to:ee(i.line,i.ch)}}else t.push(d[2])}}function f(i,n){for(var t=[];;){var d=u(i);if(!d)return;if(d=="selfClose"){l(i);continue}var v=i.line,g=i.ch,b=l(i);if(!b)return;if(b[1])t.push(b[2]);else{for(var _=t.length-1;_>=0;--_)if(t[_]==b[2]){t.length=_;break}if(_<0&&(!n||n==b[2]))return{tag:b[2],from:ee(i.line,i.ch),to:ee(v,g)}}}}de.registerHelper("fold","xml",function(i,n){for(var t=new T(i,n.line,0);;){var d=a(t);if(!d||t.line!=n.line)return;var v=c(t);if(!v)return;if(!d[1]&&v!="selfClose"){var g=ee(t.line,t.ch),b=s(t,d[2]);return b&&j(b.from,g)>0?{from:g,to:b.from}:null}}}),de.findMatchingTag=function(i,n,t){var d=new T(i,n.line,n.ch,t);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var v=c(d),g=v&&ee(d.line,d.ch),b=v&&l(d);if(!v||!b||j(d,n)>0)return;var _={from:ee(d.line,d.ch),to:g,tag:b[2]};return v=="selfClose"?{open:_,close:null,at:"open"}:b[1]?{open:f(d,b[2]),close:_,at:"close"}:(d=new T(i,g.line,g.ch,t),{open:_,close:s(d,b[2]),at:"open"})},de.findEnclosingTag=function(i,n,t,d){for(var v=new T(i,n.line,n.ch,t);;){var g=f(v,d);if(!g)break;var b=new T(i,n.line,n.ch,t),_=s(b,g.tag);if(_)return{open:g,close:_}}},de.scanForClosingTag=function(i,n,t,d){var v=new T(i,n.line,n.ch,d?{from:0,to:d}:null);return s(v,t)}})},p5ED:function(rt,$e,H){"use strict";var de=H("+L6B"),ee=H("2/Rp"),j=H("5Dmo"),w=H("3S7+"),k=H("k1fw"),S=H("9og8"),T=H("tJVT"),C=H("WmNS"),h=H.n(C),p=H("q1tI"),c=H.n(p),l=H("vHTk"),a=H.n(l),u=H("yEEn"),s=H("ZW9T"),f=H("1vsH"),i=H("V0Rq"),n=H("m3rI"),t=function(v){var g=v.name,b=v.data,_=v.theme,m=v.type,y=v.filename,E=v.monacoEditor,o=v.className,x=v.style,A=v.close,O=v.onClose,D=v.hasMask,N=v.otherData,W=N===void 0?{}:N,K=Object(p.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),oe=Object(T.a)(K,2),B=oe[0],X=oe[1],V=Object(p.useState)(""),ne=Object(T.a)(V,2),$=ne[0],Z=ne[1],ue=Object(p.useState)(),he=Object(T.a)(ue,2),Oe=he[0],we=he[1],Pe=window.ENV==="build"?"/react/build/office.html":"/office.html",_e,xe=1024*1024,Ve=10*xe,Ne=Object(p.useRef)();m==="office"&&(_e=Object(f.R)(b).filesize,_e>Ve&&(m="other")),y&&(E.filename=y),Object(p.useEffect)(function(){var me,We,He=(me=document.cookie)===null||me===void 0||((We=me.replace(/\s/g,""))===null||We===void 0)?void 0:We.split(";");He==null||He.map(function(nt){var te=nt.split("=");te[0]==="_educoder_session"&&Z(te[1])})},[]),Object(p.useEffect)(function(){m==="office"&&Be()},[m]);var Be=function(){var me=Object(S.a)(h.a.mark(function We(){var He,nt,te;return h.a.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return console.log("data:",b),He=b,b.startsWith("http")||(He=location.origin+He),nt=new URL(He).pathname.split("/").pop(),U.next=6,Object(i.U)({attachment_id:nt});case 6:te=U.sent,we(te);case 8:case"end":return U.stop()}},We)}));return function(){return me.apply(this,arguments)}}(),ze=function(){if(b.startsWith("http")||b.startsWith("/api")||b.startsWith("blob:")){ye();return}Object(f.x)(y||"educoder",b,y||"educoder")},ye=function(){Object(f.v)(y||"educoder",decodeURIComponent(b))};return c.a.createElement("div",{style:Object(k.a)({},x||{}),className:"".concat(D&&a.a.bgBlack," ").concat(m?a.a.wrp:"hide")},A&&c.a.createElement("div",{className:a.a.close,ref:Ne},c.a.createElement(w.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ne.current}},c.a.createElement("span",{onClick:ye},c.a.createElement("i",{className:"icon-quxiaozhiding"}))),c.a.createElement(w.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ne.current}},c.a.createElement("span",{className:"",onClick:function(){O(),we(null)}},c.a.createElement("i",{className:"icon-guanbi1"})))),c.a.createElement("div",{className:"".concat(a.a[o]," ").concat(o," ").concat(a.a.monaco," ").concat(m==="txt"?"show":"hide")},m==="txt"&&c.a.createElement(s.b,E)),m==="audio"&&c.a.createElement("audio",{src:"".concat((b==null?void 0:b.indexOf("http://"))>-1||(b==null?void 0:b.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(b),autoPlay:!0}),m==="video"&&c.a.createElement(c.a.Fragment,null,(b==null?void 0:b.indexOf("/api"))>-1?c.a.createElement("video",{controls:!0,src:"".concat(b),autoPlay:!0}):c.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(b),autoPlay:!0})),m==="office"&&Oe&&c.a.createElement("iframe",{src:"".concat(Pe,"?key=").concat(Oe.key,"&url=").concat(n.a.API_SERVER+Oe.url,"&callbackUrl=").concat(n.a.API_SERVER+Oe.callbackUrl,"&fileType=").concat(Oe.fileType,"&title=").concat(Oe.title,"&model=view")}),(m==="xlsx"||m==="doc"||m==="pptx"||m==="docx")&&c.a.createElement("iframe",{src:"".concat(Pe,"?key=").concat(W.key,"&url=").concat(n.a.API_SERVER+W.url,"&callbackUrl=").concat(n.a.API_SERVER+W.callbackUrl,"&fileType=").concat(W.fileType,"&title=").concat(W.title,"&model=").concat(W.model)}),m==="html"&&c.a.createElement("iframe",{src:b+"&disposition=inline"}),m==="pdf"&&c.a.createElement("embed",{className:a.a.embed,src:b,type:"application/pdf"}),m==="image"&&c.a.createElement("img",{src:"".concat((b==null?void 0:b.indexOf("http://"))>-1||(b==null?void 0:b.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(b)}),m==="other"&&c.a.createElement("div",null,c.a.createElement(ee.a,{type:"primary",size:"large",onClick:ze},c.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),m==="download"&&c.a.createElement(ee.a,{type:"primary",size:"large",onClick:ze},c.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};$e.a=t},"p77/":function(rt,$e,H){},pYxM:function(rt,$e,H){rt.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"}},ppsT:function(rt,$e,H){(function(de){var ee,ee;!function(j){if(!0)window.OSS=j(),rt.exports=j();else var w}(function(){var j;return function(){function w(k,S,T){function C(c,l){if(!S[c]){if(!k[c]){var a=typeof ee=="function"&ⅇif(!l&&a)return ee(c,!0);if(h)return h(c,!0);var u=new Error("Cannot find module '"+c+"'");throw u.code="MODULE_NOT_FOUND",u}var s=S[c]={exports:{}};k[c][0].call(s.exports,function(f){return C(k[c][1][f]||f)},s,s.exports,w,k,S,T)}return S[c].exports}for(var h=typeof ee=="function"&&ee,p=0;p<T.length;p++)C(T[p]);return C}return w}()({1:[function(w,k,S){"use strict";var T=w("./browser/client");T.Buffer=w("buffer").Buffer,T.co=w("co"),T.urllib=w("../shims/xhr"),T.version=w("./browser/version").version,k.exports=T},{"../shims/xhr":244,"./browser/client":2,"./browser/version":5,buffer:38,co:41}],2:[function(w,k,S){(function(T,C){"use strict";function h(ne){return ne&&ne.__esModule?ne:{default:ne}}function p(ne,$){return ne[$]||ne[$.toLowerCase()]}function c(ne,$){var Z=o.parse(ne);if(!Z.protocol){var ue=$?"https://":"http://";Z=o.parse(ue+ne)}if(Z.protocol!=="http:"&&Z.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return Z}function l(ne,$,Z){var ue=Z?"https://":"http://",he=$?"-internal.aliyuncs.com":".aliyuncs.com";return ne.substr(0,"vpc100-oss-cn-".length)==="vpc100-oss-cn-"&&(he=".aliyuncs.com"),o.parse(ue+ne+he)}function a(){return document&&document.location&&document.location.protocol==="https:"}function u(ne,$){if(!(this instanceof u))return new u(ne,$);ne&&ne.inited?this.options=ne:this.options=u.initOptions(ne),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=D,this.agent=this.options.agent||X),this.ctx=$,this.userAgent=this._getUserAgent(),this.options.amendTimeSkewed=0}var s=w("babel-runtime/regenerator"),f=h(s),i=w("babel-runtime/core-js/object/keys"),n=h(i),t=w("debug")("ali-oss"),d=w("./../../shims/crypto/crypto.js"),v=w("path"),g=w("copy-to"),b=w("mime"),_=w("xml2js"),m=w("humanize-ms"),y=w("agentkeepalive"),E=w("merge-descriptors"),o=w("url"),x=w("is-type-of"),A=w("platform"),O=w("utility"),D=w("urllib"),N=w("./version"),W=w("dateformat"),K=w("bowser"),oe=w("../common/signUtils"),B=w("../common/utils"),X=new y;k.exports=u,u.initOptions=function(ne){if(!ne||!ne.accessKeyId||!ne.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");var $=a(),Z={region:"oss-cn-hangzhou",internal:!1,secure:$,bucket:null,endpoint:null,cname:!1};if((0,n.default)(ne).forEach(function(ue){ne[ue]!==void 0&&(Z[ue]=ne[ue])}),Z.accessKeyId=Z.accessKeyId.trim(),Z.accessKeySecret=Z.accessKeySecret.trim(),Z.timeout&&(Z.timeout=m(Z.timeout)),Z.endpoint)Z.endpoint=c(Z.endpoint,Z.secure);else{if(!Z.region)throw new Error("require options.endpoint or options.region");Z.endpoint=l(Z.region,Z.internal,Z.secure)}return Z.inited=!0,Z};var V=u.prototype;E(V,w("./object")),E(V,w("./managed_upload")),E(V,w("../common/multipart")),E(V,w("../common/thunkpool.js")),u.Wrapper=w("./wrapper"),V.signature=function(ne){return t("authorization stringToSign: %s",ne),oe.computeSignature(this.options.accessKeySecret,ne)},V.authorization=function(ne,$,Z,ue){var he=oe.buildCanonicalString(ne.toUpperCase(),$,{headers:ue,parameters:Z});return oe.authorization(this.options.accessKeyId,this.options.accessKeySecret,he)},V.createRequest=function(ne){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),g(ne.headers).to($),p($,"Content-Type")||(ne.mime===b.default_type&&(ne.mime=""),ne.mime&&ne.mime.indexOf("/")>0?$["Content-Type"]=ne.mime:$["Content-Type"]=b.getType(ne.mime||v.extname(ne.object||""))||"application/octet-stream"),ne.content&&($["Content-Md5"]=d.createHash("md5").update(new C(ne.content,"utf8")).digest("base64"),$["Content-Length"]||($["Content-Length"]=ne.content.length));var Z=this._getResource(ne);$.authorization=this.authorization(ne.method,Z,ne.subres,$);var ue=this._getReqUrl(ne);t("request %s %s, with headers %j, !!stream: %s",ne.method,ue,$,!!ne.stream);var he=ne.timeout||this.options.timeout;return{url:ue,params:{agent:this.agent,method:ne.method,content:ne.content,stream:ne.stream,headers:$,timeout:he,writeStream:ne.writeStream,customResponse:ne.customResponse,ctx:ne.ctx||this.ctx}}},V.request=f.default.mark(function ne($){var Z,ue,he,Oe;return f.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return Z=this.createRequest($),ue=void 0,he=void 0,we.prev=3,we.next=6,this.urllib.request(Z.url,Z.params);case 6:ue=we.sent,t("response %s %s, got %s, headers: %j",$.method,Z.url,ue.status,ue.headers),we.next=13;break;case 10:we.prev=10,we.t0=we.catch(3),he=we.t0;case 13:if(Oe=void 0,!ue||!$.successStatuses||$.successStatuses.indexOf(ue.status)!==-1){we.next=26;break}return we.next=17,this.requestError(ue);case 17:if(Oe=we.sent,Oe.code!=="RequestTimeTooSkewed"){we.next=23;break}return this.options.amendTimeSkewed=+new Date(Oe.serverTime)-new Date,we.next=22,this.request($);case 22:return we.abrupt("return",we.sent);case 23:Oe.params=$,we.next=30;break;case 26:if(!he){we.next=30;break}return we.next=29,this.requestError(he);case 29:Oe=we.sent;case 30:if(!Oe){we.next=32;break}throw Oe;case 32:if(!$.xmlResponse){we.next=36;break}return we.next=35,this.parseXML(ue.data);case 35:ue.data=we.sent;case 36:return we.abrupt("return",ue);case 37:case"end":return we.stop()}},ne,this,[[3,10]])}),V._getResource=function(ne){var $="/";return ne.bucket&&($+=ne.bucket+"/"),ne.object&&($+=ne.object),$},V._isIP=function(ne){return B._isIP(ne)},V._escape=function(ne){return O.encodeURIComponent(ne).replace(/%2F/g,"/")},V._getReqUrl=function(ne){var $={};g(this.options.endpoint).to($);var Z=this._isIP($.hostname),ue=this.options.cname;!ne.bucket||ue||Z||($.host=ne.bucket+"."+$.host);var he="/";ne.bucket&&Z&&(he+=ne.bucket+"/"),ne.object&&(he+=this._escape(ne.object).replace(/\+/g,"%2B")),$.pathname=he;var Oe={};if(ne.query&&E(Oe,ne.query),ne.subres){var we={};x.string(ne.subres)?we[ne.subres]="":x.array(ne.subres)?ne.subres.forEach(function(Pe){we[Pe]=""}):we=ne.subres,E(Oe,we)}return $.query=Oe,o.format($)},V._getUserAgent=function(){var ne=T&&T.browser?"js":"nodejs",$="aliyun-sdk-"+ne+"/"+N.version,Z=A.description;return!Z&&T&&(Z="Node.js "+T.version.slice(1)+" on "+T.platform+" "+T.arch),this._checkUserAgent($+" "+Z)},V._checkUserAgent=function(ne){return ne.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")},V.checkBrowserAndVersion=function(ne,$){return K.name===ne&&K.version.split(".")[0]===$},V.parseXML=function(ne){return function($){C.isBuffer(ne)&&(ne=ne.toString()),_.parseString(ne,{explicitRoot:!1,explicitArray:!1},$)}},V.requestError=f.default.mark(function ne($){var Z,ue,he,Oe;return f.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:if(Z=null,$.data&&$.data.length){we.next=5;break}$.status===-1||$.status===-2?(Z=new Error($.message),Z.name=$.name,Z.status=$.status,Z.code=$.name):($.status===404?(Z=new Error("Object not exists"),Z.name="NoSuchKeyError",Z.status=404,Z.code="NoSuchKey"):$.status===412?(Z=new Error("Pre condition failed"),Z.name="PreconditionFailedError",Z.status=412,Z.code="PreconditionFailed"):(Z=new Error("Unknow error, status: "+$.status),Z.name="UnknowError",Z.status=$.status),Z.requestId=$.headers["x-oss-request-id"],Z.host=""),we.next=30;break;case 5:return ue=String($.data),t("request response error data: %s",ue),he=void 0,we.prev=8,we.next=11,this.parseXML(ue)||{};case 11:he=we.sent,we.next=21;break;case 14:return we.prev=14,we.t0=we.catch(8),t(ue),we.t0.message+=`
|
|
|
raw xml: `+ue,we.t0.status=$.status,we.t0.requestId=$.headers["x-oss-request-id"],we.abrupt("return",we.t0);case 21:Oe=he.Message||"unknow request error, status: "+$.status,he.Condition&&(Oe+=" (condition: "+he.Condition+")"),Z=new Error(Oe),Z.name=he.Code?he.Code+"Error":"UnknowError",Z.status=$.status,Z.code=he.Code,Z.requestId=he.RequestId,Z.hostId=he.HostId,Z.serverTime=he.ServerTime;case 30:return t("generate error %j",Z),we.abrupt("return",Z);case 32:case"end":return we.stop()}},ne,this,[[8,14]])})}).call(this,w("_process"),w("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(w,k,S){(function(T){"use strict";function C(g){return g&&g.__esModule?g:{default:g}}function h(g,b){if(!(this instanceof h))return new h(g,b);v.call(this,b),this.file=g,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}var p=w("babel-runtime/core-js/array/from"),c=C(p),l=w("babel-runtime/regenerator"),a=C(l),u=w("is-type-of"),s=w("util"),f=w("path"),i=w("mime"),n=w("copy-to"),t=S;t.multipartUpload=a.default.mark(function g(b,_,m){var y,E,o,x,A,O,D,N,W;return a.default.wrap(function(K){for(;;)switch(K.prev=K.next){case 0:if(this.resetCancelFlag(),m=m||{},!m.checkpoint||!m.checkpoint.uploadId){K.next=6;break}return K.next=5,this._resumeMultipart(m.checkpoint,m);case 5:return K.abrupt("return",K.sent);case 6:return y=102400,m.mime||(u.file(_)?m.mime=i.getType(f.extname(_.name)):u.blob(_)?m.mime=_.type:m.mime=i.getType(f.extname(_))),m.headers=m.headers||{},this._convertMetaToHeaders(m.meta,m.headers),K.next=12,this._getFileSize(_);case 12:if(!((E=K.sent)<y)){K.next=25;break}return o=this._createStream(_,0,E),m.contentLength=E,K.next=18,this.putStream(b,o,m);case 18:if(x=K.sent,!m||!m.progress){K.next=22;break}return K.next=22,m.progress(1);case 22:return A={res:x.res,bucket:this.options.bucket,name:b,etag:x.res.headers.etag},(m.headers&&m.headers["x-oss-callback"]||m.callback)&&(A.data=x.data),K.abrupt("return",A);case 25:if(!(m.partSize&&m.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,m);case 29:if(O=K.sent,D=O.uploadId,N=this._getPartSize(E,m.partSize),W={file:_,name:b,fileSize:E,partSize:N,uploadId:D,doneParts:[]},!m||!m.progress){K.next=36;break}return K.next=36,m.progress(0,W,O.res);case 36:return K.next=38,this._resumeMultipart(W,m);case 38:return K.abrupt("return",K.sent);case 39:case"end":return K.stop()}},g,this)}),t._resumeMultipart=a.default.mark(function g(b,_){var m,y,E,o,x,A,O,D,N,W,K,oe,B,X,V,ne,$,Z,ue,he,Oe;return a.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(m=b.file,y=b.fileSize,E=b.partSize,o=b.uploadId,x=b.doneParts,A=b.name,O=[],x.length>0&&n(x).to(O),D=this._divideParts(y,E),N=D.length,W=!1,K=a.default.mark(function Pe(_e,xe){var Ve,Ne,Be;return a.default.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:if(_e.isCancel()){ze.next=21;break}return ze.prev=1,Ve=D[xe-1],Ne={stream:_e._createStream(m,Ve.start,Ve.end),size:Ve.end-Ve.start},ze.next=6,_e._uploadPart(A,o,xe,Ne);case 6:if(Be=ze.sent,_e.isCancel()||W){ze.next=13;break}if(b.doneParts.push({number:xe,etag:Be.res.headers.etag}),O.push({number:xe,etag:Be.res.headers.etag}),!_||!_.progress){ze.next=13;break}return ze.next=13,_.progress(x.length/N,b,Be.res);case 13:ze.next=21;break;case 15:if(ze.prev=15,ze.t0=ze.catch(1),_e.isCancel()){ze.next=21;break}throw _e.cancel(),ze.t0.partNum=xe,ze.t0;case 21:case"end":return ze.stop()}},Pe,this,[[1,15]])}),oe=(0,c.default)(new Array(N),function(Pe,_e){return _e+1}),B=O.map(function(Pe){return Pe.number}),X=oe.filter(function(Pe){return B.indexOf(Pe)<0}),V=5,ne=_.parallel||V,!this.checkBrowserAndVersion("Internet Explorer","10")&&ne!==1){we.next=26;break}$=0;case 16:if(!($<X.length)){we.next=24;break}if(!this.isCancel()){we.next=19;break}throw this._makeCancelEvent();case 19:return we.next=21,K(this,X[$]);case 21:$++,we.next=16;break;case 24:we.next=40;break;case 26:for(Z=[],ue=0;ue<X.length;ue++)Z.push(K(this,X[ue]));return we.next=30,this._thunkPool(Z,ne);case 30:if(he=we.sent,W=!0,!(he&&he.length>0)){we.next=37;break}throw this.resetCancelFlag(),Oe=he[0],Oe.message="Failed to upload some parts with error: "+Oe.toString()+" part_num: "+Oe.partNum,Oe;case 37:if(!this.isCancel()){we.next=40;break}throw Z=null,this._makeCancelEvent();case 40:return we.next=42,this.completeMultipartUpload(A,o,O,_);case 42:return we.abrupt("return",we.sent);case 43:case"end":return we.stop()}},g,this)}),u.file=function(g){return typeof File!="undefined"&&g instanceof File},u.blob=function(g){return typeof Blob!="undefined"&&g instanceof Blob},t._getFileSize=a.default.mark(function g(b){var _;return a.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(!u.buffer(b)){m.next=4;break}return m.abrupt("return",b.length);case 4:if(!u.blob(b)&&!u.file(b)){m.next=6;break}return m.abrupt("return",b.size);case 6:if(!u.string(b)){m.next=11;break}return m.next=9,this._statFile(b);case 9:return _=m.sent,m.abrupt("return",_.size);case 11:throw new Error("_getFileSize requires Buffer/File/String.");case 12:case"end":return m.stop()}},g,this)});var d=w("stream"),v=d.Readable;s.inherits(h,v),h.prototype.readFileAndPush=function(g){if(this.fileBuffer)for(var b=!0;b&&this.fileBuffer&&this.start<this.fileBuffer.length;){var _=this.start,m=_+g;m=m>this.fileBuffer.length?this.fileBuffer.length:m,this.start=m,b=this.push(this.fileBuffer.slice(_,m))}},h.prototype._read=function(g){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);g=g||16384;var b=this;this.reader.onload=function(_){b.fileBuffer=new T(new Uint8Array(_.target.result)),b.file=null,b.readFileAndPush(g)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(g)},t._createStream=function(g,b,_){if(u.blob(g)||u.file(g))return new h(g.slice(b,_));throw new Error("_createStream requires File/String.")},t._getPartSize=function(g,b){return b?Math.max(Math.ceil(g/1e4),b):1048576},t._divideParts=function(g,b){for(var _=Math.ceil(g/b),m=[],y=0;y<_;y++){var E=b*y,o=Math.min(E+b,g);m.push({start:E,end:o})}return m},t._makeCancelEvent=function(){return{status:0,name:"cancel"}}}).call(this,w("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(w,k,S){"use strict";function T(b){return b&&b.__esModule?b:{default:b}}var C=w("babel-runtime/core-js/object/keys"),h=T(C),p=w("babel-runtime/regenerator"),c=T(p),l=w("debug")("ali-oss:object"),a=w("utility"),u=w("fs"),s=w("is-type-of"),f=w("url"),i=w("copy-to"),n=w("path"),t=w("mime"),d=w("../common/callback"),v=w("../common/signUtils"),g=S;g.append=c.default.mark(function b(_,m,y){var E;return c.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return y=y||{},y.position===void 0&&(y.position="0"),y.subres={append:"",position:y.position},y.method="POST",o.next=6,this.put(_,m,y);case 6:return E=o.sent,E.nextAppendPosition=E.res.headers["x-oss-next-append-position"],o.abrupt("return",E);case 9:case"end":return o.stop()}},b,this)}),g.put=c.default.mark(function b(_,m,y){var E,o,x,A,O,D;return c.default.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(E=void 0,y=y||{},!s.buffer(m)){N.next=6;break}E=m,N.next=18;break;case 6:if(!s.blob(m)&&!s.file(m)){N.next=17;break}return y.mime||(s.file(m)?y.mime=t.getType(n.extname(m.name)):y.mime=m.type),o=this._createStream(m,0,m.size),N.next=11,this._getFileSize(m);case 11:return y.contentLength=N.sent,N.next=14,this.putStream(_,o,y);case 14:return N.abrupt("return",N.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),x=y.method||"PUT",A=this._objectRequestParams(x,_,y),d.encodeCallback(A,y),A.mime=y.mime,A.content=E,A.successStatuses=[200],N.next=28,this.request(A);case 28:return O=N.sent,D={name:_,url:this._objectUrl(_),res:O.res},A.headers&&A.headers["x-oss-callback"]&&(D.data=JSON.parse(O.data.toString())),N.abrupt("return",D);case 32:case"end":return N.stop()}},b,this)}),g.putStream=c.default.mark(function b(_,m,y){var E,o,x,A;return c.default.wrap(function(O){for(;;)switch(O.prev=O.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),E=y.method||"PUT",o=this._objectRequestParams(E,_,y),d.encodeCallback(o,y),o.mime=y.mime,o.stream=m,o.successStatuses=[200],O.next=12,this.request(o);case 12:return x=O.sent,A={name:_,url:this._objectUrl(_),res:x.res},o.headers&&o.headers["x-oss-callback"]&&(A.data=JSON.parse(x.data.toString())),O.abrupt("return",A);case 16:case"end":return O.stop()}},b,this)}),g.head=c.default.mark(function b(_,m){var y,E,o;return c.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return y=this._objectRequestParams("HEAD",_,m),y.successStatuses=[200,304],x.next=4,this.request(y);case 4:return E=x.sent,o={meta:null,res:E.res,status:E.status},E.status===200&&(0,h.default)(E.headers).forEach(function(A){A.indexOf("x-oss-meta-")===0&&(o.meta||(o.meta={}),o.meta[A.substring(11)]=E.headers[A])}),x.abrupt("return",o);case 8:case"end":return x.stop()}},b,this)}),g.get=c.default.mark(function b(_,m,y){var E,o,x,A;return c.default.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return E=null,o=!1,s.writableStream(m)?E=m:s.string(m)?(E=u.createWriteStream(m),o=!0):y=m,y=y||{},y.process&&(y.subres=y.subres||{},y.subres["x-oss-process"]=y.process),x=void 0,O.prev=6,A=this._objectRequestParams("GET",_,y),A.writeStream=E,A.successStatuses=[200,206,304],O.next=12,this.request(A);case 12:x=O.sent,o&&E.destroy(),O.next=24;break;case 16:if(O.prev=16,O.t0=O.catch(6),!o){O.next=23;break}return E.destroy(),l("get error: %s, delete the exists file %s",O.t0,m),O.next=23,this._deleteFileSafe(m);case 23:throw O.t0;case 24:return O.abrupt("return",{res:x.res,content:x.data});case 25:case"end":return O.stop()}},b,this,[[6,16]])}),g.getStream=c.default.mark(function b(_,m){var y,E;return c.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return m=m||{},y=this._objectRequestParams("GET",_,m),y.customResponse=!0,y.successStatuses=[200,206,304],o.next=6,this.request(y);case 6:return E=o.sent,o.abrupt("return",{stream:E.res,res:{status:E.status,headers:E.headers}});case 8:case"end":return o.stop()}},b,this)}),g.delete=c.default.mark(function b(_,m){var y,E;return c.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return y=this._objectRequestParams("DELETE",_,m),y.successStatuses=[204],o.next=4,this.request(y);case 4:return E=o.sent,o.abrupt("return",{res:E.res});case 6:case"end":return o.stop()}},b,this)}),g.deleteMulti=c.default.mark(function b(_,m){var y,E,o,x,A,O;return c.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:for(m=m||{},y=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<Delete>
|
|
|
`,m.quiet?y+=` <Quiet>true</Quiet>
|
|
|
`:y+=` <Quiet>false</Quiet>
|
|
|
`,E=0;E<_.length;E++)y+=" <Object><Key>"+a.escape(this._objectName(_[E]))+`</Key></Object>
|
|
|
`;return y+="</Delete>",l("delete multi objects: %s",y),m.subres="delete",o=this._objectRequestParams("POST","",m),o.mime="xml",o.content=y,o.xmlResponse=!0,o.successStatuses=[200],D.next=14,this.request(o);case 14:return x=D.sent,A=x.data,O=A&&A.Deleted||null,O&&(Array.isArray(O)||(O=[O]),O=O.map(function(N){return N.Key})),D.abrupt("return",{res:x.res,deleted:O});case 19:case"end":return D.stop()}},b,this)}),g.copy=c.default.mark(function b(_,m,y){var E,o,x;return c.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return y=y||{},y.headers=y.headers||{},(0,h.default)(y.headers).forEach(function(O){y.headers["x-oss-copy-source-"+O.toLowerCase()]=y.headers[O]}),y.meta&&(y.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(y.meta,y.headers),m=m[0]!=="/"?"/"+this.options.bucket+"/"+encodeURIComponent(m):"/"+encodeURIComponent(m.slice(1)),y.headers["x-oss-copy-source"]=m,E=this._objectRequestParams("PUT",_,y),E.xmlResponse=!0,E.successStatuses=[200,304],A.next=12,this.request(E);case 12:return o=A.sent,x=o.data,x&&(x={etag:x.ETag,lastModified:x.LastModified}),A.abrupt("return",{data:x,res:o.res});case 16:case"end":return A.stop()}},b,this)}),g.putMeta=c.default.mark(function b(_,m,y){return c.default.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,this.copy(_,_,{meta:m||{},timeout:y&&y.timeout,ctx:y&&y.ctx});case 2:return E.abrupt("return",E.sent);case 3:case"end":return E.stop()}},b,this)}),g.list=c.default.mark(function b(_,m){var y,E,o,x,A;return c.default.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return y=this._objectRequestParams("GET","",m),y.query=_,y.xmlResponse=!0,y.successStatuses=[200],O.next=6,this.request(y);case 6:return E=O.sent,o=E.data.Contents,x=this,o&&(Array.isArray(o)||(o=[o]),o=o.map(function(D){return{name:D.Key,url:x._objectUrl(D.Key),lastModified:D.LastModified,etag:D.ETag,type:D.Type,size:Number(D.Size),storageClass:D.StorageClass,owner:{id:D.Owner.ID,displayName:D.Owner.DisplayName}}})),A=E.data.CommonPrefixes||null,A&&(Array.isArray(A)||(A=[A]),A=A.map(function(D){return D.Prefix})),O.abrupt("return",{res:E.res,objects:o,prefixes:A,nextMarker:E.data.NextMarker||null,isTruncated:E.data.IsTruncated==="true"});case 13:case"end":return O.stop()}},b,this)}),g.putACL=c.default.mark(function b(_,m,y){var E,o;return c.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return y=y||{},y.subres="acl",y.headers=y.headers||{},y.headers["x-oss-object-acl"]=m,_=this._objectName(_),E=this._objectRequestParams("PUT",_,y),E.successStatuses=[200],x.next=9,this.request(E);case 9:return o=x.sent,x.abrupt("return",{res:o.res});case 11:case"end":return x.stop()}},b,this)}),g.getACL=c.default.mark(function b(_,m){var y,E;return c.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return m=m||{},m.subres="acl",_=this._objectName(_),y=this._objectRequestParams("GET",_,m),y.successStatuses=[200],y.xmlResponse=!0,o.next=8,this.request(y);case 8:return E=o.sent,o.abrupt("return",{acl:E.data.AccessControlList.Grant,owner:{id:E.data.Owner.ID,displayName:E.data.Owner.DisplayName},res:E.res});case 10:case"end":return o.stop()}},b,this)}),g.restore=c.default.mark(function b(_,m){var y,E;return c.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return m=m||{},m.subres="restore",y=this._objectRequestParams("POST",_,m),y.successStatuses=[202],o.next=6,this.request(y);case 6:return E=o.sent,o.abrupt("return",{res:E.res});case 8:case"end":return o.stop()}},b,this)}),g.signatureUrl=function(b,_){_=_||{},b=this._objectName(b),_.method=_.method||"GET";var m=a.timestamp()+(_.expires||1800),y={bucket:this.options.bucket,object:b},E=this._getResource(y);this.options.stsToken&&(_["security-token"]=this.options.stsToken);var o=v._signatureForURL(this.options.accessKeySecret,_,E,m),x=f.parse(this._getReqUrl(y));return x.query={OSSAccessKeyId:this.options.accessKeyId,Expires:m,Signature:o.Signature},i(o.subResource).to(x.query),x.format()},g.getObjectUrl=function(b,_){return _?_[_.length-1]!=="/"&&(_+="/"):_=this.options.endpoint.format(),_+this._escape(this._objectName(b))},g._objectUrl=function(b){return this._getReqUrl({bucket:this.options.bucket,object:b})},g.generateObjectUrl=function(b,_){if(_)_[_.length-1]!=="/"&&(_+="/");else{_=this.options.endpoint.format();var m=f.parse(_),y=this.options.bucket;m.hostname=y+"."+m.hostname,m.host=y+"."+m.host,_=m.format()}return _+this._escape(this._objectName(b))},g._objectRequestParams=function(b,_,m){if(!this.options.bucket)throw new Error("Please create a bucket first");m=m||{},_=this._objectName(_);var y={object:_,bucket:this.options.bucket,method:b,subres:m&&m.subres,timeout:m&&m.timeout,ctx:m&&m.ctx};return m.headers&&(y.headers={},i(m.headers).to(y.headers)),y},g._objectName=function(b){return b.replace(/^\/+/,"")},g._statFile=function(b){return function(_){u.stat(b,_)}},g._convertMetaToHeaders=function(b,_){b&&(0,h.default)(b).forEach(function(m){_["x-oss-meta-"+m]=b[m]})},g._deleteFileSafe=function(b){return function(_){u.exists(b,function(m){m?u.unlink(b,function(y){y&&l("unlink %j error: %s",b,y),_()}):_()})}}},{"../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(w,k,S){"use strict";S.version="5.3.1"},{}],6:[function(w,k,S){"use strict";function T(n){return n&&n.__esModule?n:{default:n}}function C(n){return n&&typeof n.next=="function"&&typeof n.throw=="function"}function h(n){if(!n)return!1;var t=n.constructor;return!!t&&(t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction"||C(t.prototype)||C(n.prototype))}function p(n,t){var d=new n(t),v=(0,s.default)(d),g=(0,s.default)((0,a.default)(d));v.concat(g).forEach(function(b){h(d[b])?this[b]=f.wrap(d[b]).bind(d):this[b]=d[b]},this)}function c(n){if(!(this instanceof c))return new c(n);p.call(this,i,n)}var l=w("babel-runtime/core-js/object/get-prototype-of"),a=T(l),u=w("babel-runtime/core-js/object/keys"),s=T(u),f=w("co"),i=w("./client");k.exports=c,c.STS=function n(t){if(!(this instanceof n))return new n(t);p.call(this,i.STS,t)}},{"./client":2,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/core-js/object/keys":23,co:41}],7:[function(w,k,S){(function(T){"use strict";function C(a){return a&&a.__esModule?a:{default:a}}var h=w("babel-runtime/core-js/object/keys"),p=C(h),c=w("babel-runtime/core-js/json/stringify"),l=C(c);S.encodeCallback=function(a,u){if(a.headers=a.headers||{},!Object.prototype.hasOwnProperty.call(a.headers,"x-oss-callback")&&u.callback){var s={callbackUrl:encodeURI(u.callback.url),callbackBody:u.callback.body};u.callback.host&&(s.callbackHost=u.callback.host),u.callback.contentType&&(s.callbackBodyType=u.callback.contentType);var f=new T((0,l.default)(s)).toString("base64");if(a.headers["x-oss-callback"]=f,u.callback.customValue){var i={};(0,p.default)(u.callback.customValue).forEach(function(n){i["x:"+n]=u.callback.customValue[n]}),a.headers["x-oss-callback-var"]=new T((0,l.default)(i)).toString("base64")}}}}).call(this,w("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38}],8:[function(w,k,S){"use strict";var T=w("babel-runtime/regenerator"),C=function(l){return l&&l.__esModule?l:{default:l}}(T),h=w("copy-to"),p=w("./callback"),c=S;c.listUploads=C.default.mark(function l(a,u){var s,f,i,n;return C.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return u=u||{},s={},h(u).to(s),s.subres="uploads",f=this._objectRequestParams("GET","",s),f.query=a,f.xmlResponse=!0,f.successStatuses=[200],t.next=10,this.request(f);case 10:return i=t.sent,n=i.data.Upload||[],Array.isArray(n)||(n=[n]),n=n.map(function(d){return{name:d.Key,uploadId:d.UploadId,initiated:d.Initiated}}),t.abrupt("return",{res:i.res,uploads:n,bucket:i.data.Bucket,nextKeyMarker:i.data.NextKeyMarker,nextUploadIdMarker:i.data.NextUploadIdMarker,isTruncated:i.data.IsTruncated==="true"});case 15:case"end":return t.stop()}},l,this)}),c.listParts=C.default.mark(function l(a,u,s,f){var i,n,t;return C.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return f=f||{},i={},h(f).to(i),i.subres={uploadId:u},n=this._objectRequestParams("GET",a,i),n.query=s,n.xmlResponse=!0,n.successStatuses=[200],d.next=10,this.request(n);case 10:return t=d.sent,d.abrupt("return",{res:t.res,uploadId:t.data.UploadId,bucket:t.data.Bucket,name:t.data.Key,partNumberMarker:t.data.PartNumberMarker,nextPartNumberMarker:t.data.NextPartNumberMarker,maxParts:t.data.MaxParts,isTruncated:t.data.IsTruncated,parts:t.data.Part||[]});case 12:case"end":return d.stop()}},l,this)}),c.abortMultipartUpload=C.default.mark(function l(a,u,s){var f,i,n;return C.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.cancel(),s=s||{},f={},h(s).to(f),f.subres={uploadId:u},i=this._objectRequestParams("DELETE",a,f),i.successStatuses=[204],t.next=9,this.request(i);case 9:return n=t.sent,t.abrupt("return",{res:n.res});case 11:case"end":return t.stop()}},l,this)}),c.initMultipartUpload=C.default.mark(function l(a,u){var s,f,i;return C.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return u=u||{},s={},h(u).to(s),s.headers=s.headers||{},this._convertMetaToHeaders(u.meta,s.headers),s.subres="uploads",f=this._objectRequestParams("POST",a,s),f.mime=u.mime,f.xmlResponse=!0,f.successStatuses=[200],n.next=12,this.request(f);case 12:return i=n.sent,n.abrupt("return",{res:i.res,bucket:i.data.Bucket,name:i.data.Key,uploadId:i.data.UploadId});case 14:case"end":return n.stop()}},l,this)}),c.uploadPart=C.default.mark(function l(a,u,s,f,i,n,t){var d;return C.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return d={stream:this._createStream(f,i,n),size:n-i},v.next=3,this._uploadPart(a,u,s,d,t);case 3:return v.abrupt("return",v.sent);case 4:case"end":return v.stop()}},l,this)}),c.completeMultipartUpload=C.default.mark(function l(a,u,s,f){var i,n,t,d,v,g,b,_;return C.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:for(i=s.concat().sort(function(y,E){return y.number-E.number}).filter(function(y,E,o){return!E||y.number!==o[E-1].number}),n=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<CompleteMultipartUpload>
|
|
|
`,t=0;t<i.length;t++)d=i[t],n+=`<Part>
|
|
|
`,n+="<PartNumber>"+d.number+`</PartNumber>
|
|
|
`,n+="<ETag>"+d.etag+`</ETag>
|
|
|
`,n+=`</Part>
|
|
|
`;return n+="</CompleteMultipartUpload>",f=f||{},v={},h(f).to(v),v.subres={uploadId:u},g=this._objectRequestParams("POST",a,v),p.encodeCallback(g,v),g.mime="xml",g.content=n,g.headers&&g.headers["x-oss-callback"]||(g.xmlResponse=!0),g.successStatuses=[200],m.next=16,this.request(g);case 16:return b=m.sent,_={res:b.res,bucket:g.bucket,name:a,etag:b.res.headers.etag},g.headers&&g.headers["x-oss-callback"]&&(_.data=JSON.parse(b.data.toString())),m.abrupt("return",_);case 20:case"end":return m.stop()}},l,this)}),c._uploadPart=C.default.mark(function l(a,u,s,f,i){var n,t,d;return C.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return i=i||{},n={},h(i).to(n),n.headers={"Content-Length":f.size},n.subres={partNumber:s,uploadId:u},t=this._objectRequestParams("PUT",a,n),t.mime=n.mime,t.stream=f.stream,t.successStatuses=[200],v.next=11,this.request(t);case 11:return d=v.sent,f.stream=null,t.stream=null,v.abrupt("return",{name:a,etag:d.res.headers.etag,res:d.res});case 15:case"end":return v.stop()}},l,this)})},{"./callback":7,"babel-runtime/regenerator":33,"copy-to":43}],9:[function(w,k,S){(function(T){"use strict";function C(s){return s&&s.__esModule?s:{default:s}}var h=w("babel-runtime/core-js/json/stringify"),p=C(h),c=w("babel-runtime/core-js/object/keys"),l=C(c),a=w("./../../shims/crypto/crypto.js"),u=w("is-type-of");S.buildCanonicalizedResource=function(s,f){var i=""+s,n="?";if(u.string(f)&&f.trim()!=="")i+=n+f;else if(u.array(f))f.sort(),i+=n+f.join("&");else if(f){var t=function(v,g){return v[0]>g[0]?1:v[0]<g[0]?-1:0},d=function(v){i+=n+v,f[v]&&(i+="="+f[v]),n="&"};(0,l.default)(f).sort(t).forEach(d)}return i},S.buildCanonicalString=function(s,f,i,n){i=i||{};var t=i.headers||{},d=[],v={},g=[s.toUpperCase(),t["Content-Md5"]||"",t["Content-Type"]||t["Content-Type".toLowerCase()],n||t["x-oss-date"]];return(0,l.default)(t).forEach(function(b){var _=b.toLowerCase();_.indexOf("x-oss-")===0&&(v[_]=String(t[b]).trim())}),(0,l.default)(v).sort().forEach(function(b){d.push(b+":"+v[b])}),g=g.concat(d),g.push(this.buildCanonicalizedResource(f,i.parameters)),g.join(`
|
|
|
`)},S.computeSignature=function(s,f){return a.createHmac("sha1",s).update(new T(f,"utf8")).digest("base64")},S.authorization=function(s,f,i){return"OSS "+s+":"+this.computeSignature(f,i)},S._signatureForURL=function(s,f,i,n){var t={},d={};if(f.process&&(d["x-oss-process"]=f.process),f.response&&(0,l.default)(f.response).forEach(function(_){var m="response-"+_.toLowerCase();d[m]=f.response[_]}),(0,l.default)(f).forEach(function(_){var m=_.toLowerCase(),y=f[_];m.indexOf("x-oss-")===0?t[m]=y:m.indexOf("content-md5")===0||m.indexOf("content-type")===0?t[_]=y:m!=="expires"&&m!=="response"&&m!=="process"&&m!=="method"&&(d[m]=y)}),Object.prototype.hasOwnProperty.call(f,"security-token")&&(d["security-token"]=f["security-token"]),Object.prototype.hasOwnProperty.call(f,"callback")){var v={callbackUrl:encodeURI(f.callback.url),callbackBody:f.callback.body};if(f.callback.host&&(v.callbackHost=f.callback.host),f.callback.contentType&&(v.callbackBodyType=f.callback.contentType),d.callback=new T((0,p.default)(v)).toString("base64"),f.callback.customValue){var g={};(0,l.default)(f.callback.customValue).forEach(function(_){g["x:"+_]=f.callback.customValue[_]}),d["callback-var"]=new T((0,p.default)(g)).toString("base64")}}var b=this.buildCanonicalString(f.method,i,{headers:t,parameters:d},n.toString());return{Signature:this.computeSignature(s,b),subResource:d}}}).call(this,w("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(w,k,S){"use strict";var T=w("babel-runtime/regenerator"),C=function(a){return a&&a.__esModule?a:{default:a}}(T),h=w("co"),p=w("co-priority-queue"),c=w("any-promise"),l=S;l._thunkPool=function(a,u){function s(d,v){++n===d.length&&v(t)}function f(d,v){function g(){var o;return C.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:o=void 0;case 1:if(i.isCancel()){x.next=9;break}return x.next=4,m.next();case 4:return o=x.sent,x.next=7,o();case 7:x.next=1;break;case 9:y+=1,y===d&&(m.fns=[],m.buffer=[],v(t));case 11:case"end":return x.stop()}},_,this)}function b(o){console.error(o.stack)}for(var _=C.default.mark(g),m=new p,y=0,E=0;E<d;E++)h(g).catch(b);return function(o,x){return function(A){m.push(C.default.mark(function O(){return C.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.prev=0,D.t0=A,D.next=4,o;case 4:D.t1=D.sent,(0,D.t0)(null,D.t1),D.next=11;break;case 8:D.prev=8,D.t2=D.catch(0),A(D.t2);case 11:case"end":return D.stop()}},O,this,[[0,8]])}),x)}}}var i=this,n=0,t=[];return new c(function(d){function v(y){return C.default.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,_(a[y]);case 2:s(a,d);case 3:case"end":return E.stop()}},b,this)}function g(y){t.push(y),s(a,d)}for(var b=C.default.mark(v),_=new f(u,d),m=0;m<a.length;m++)h(v(m)).catch(g)})},l.cancel=function(){this.options.cancelFlag=!0},l.isCancel=function(){return this.options.cancelFlag},l.resetCancelFlag=function(){this.options.cancelFlag=!1}},{"any-promise":13,"babel-runtime/regenerator":33,co:41,"co-priority-queue":40}],11:[function(w,k,S){"use strict";S._isIP=function(T){var C=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,h=/^\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 C.test(T)||h.test(T)}},{}],12:[function(w,k,S){function T(){}k.exports=T,k.exports.HttpsAgent=T},{}],13:[function(w,k,S){k.exports=w("./register")().Promise},{"./register":15}],14:[function(w,k,S){"use strict";var T=null;k.exports=function(C,h){return function(p,c){p=p||null,c=c||{};var l=c.global!==!1;if(T===null&&l&&(T=C["@@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&&c.Promise!==void 0?{Promise:c.Promise,implementation:p}:h(p),l&&(C["@@any-promise/REGISTRATION"]=T)),T}}},{}],15:[function(w,k,S){"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"}}k.exports=w("./loader")(window,T)},{"./loader":14}],16:[function(w,k,S){k.exports={default:w("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":44}],17:[function(w,k,S){k.exports={default:w("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":45}],18:[function(w,k,S){k.exports={default:w("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":46}],19:[function(w,k,S){k.exports={default:w("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":47}],20:[function(w,k,S){k.exports={default:w("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":48}],21:[function(w,k,S){k.exports={default:w("core-js/library/fn/object/get-own-property-names"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-names":49}],22:[function(w,k,S){k.exports={default:w("core-js/library/fn/object/get-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/get-prototype-of":50}],23:[function(w,k,S){k.exports={default:w("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":51}],24:[function(w,k,S){k.exports={default:w("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":52}],25:[function(w,k,S){k.exports={default:w("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":53}],26:[function(w,k,S){k.exports={default:w("core-js/library/fn/string/from-code-point"),__esModule:!0}},{"core-js/library/fn/string/from-code-point":54}],27:[function(w,k,S){k.exports={default:w("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":56}],28:[function(w,k,S){k.exports={default:w("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":55}],29:[function(w,k,S){k.exports={default:w("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":57}],30:[function(w,k,S){"use strict";S.__esModule=!0,S.default=function(T,C){if(!(T instanceof C))throw new TypeError("Cannot call a class as a function")}},{}],31:[function(w,k,S){"use strict";S.__esModule=!0;var T=w("../core-js/object/define-property"),C=function(h){return h&&h.__esModule?h:{default:h}}(T);S.default=function(){function h(p,c){for(var l=0;l<c.length;l++){var a=c[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),(0,C.default)(p,a.key,a)}}return function(p,c,l){return c&&h(p.prototype,c),l&&h(p,l),p}}()},{"../core-js/object/define-property":20}],32:[function(w,k,S){"use strict";function T(a){return a&&a.__esModule?a:{default:a}}S.__esModule=!0;var C=w("../core-js/symbol/iterator"),h=T(C),p=w("../core-js/symbol"),c=T(p),l=typeof c.default=="function"&&typeof h.default=="symbol"?function(a){return typeof a}:function(a){return a&&typeof c.default=="function"&&a.constructor===c.default&&a!==c.default.prototype?"symbol":typeof a};S.default=typeof c.default=="function"&&l(h.default)==="symbol"?function(a){return a===void 0?"undefined":l(a)}:function(a){return a&&typeof c.default=="function"&&a.constructor===c.default&&a!==c.default.prototype?"symbol":a===void 0?"undefined":l(a)}},{"../core-js/symbol":27,"../core-js/symbol/iterator":29}],33:[function(w,k,S){k.exports=w("regenerator-runtime")},{"regenerator-runtime":191}],34:[function(w,k,S){"use strict";function T(d){var v=d.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var g=d.indexOf("=");return g===-1&&(g=v),[g,g===v?0:4-g%4]}function C(d){var v=T(d),g=v[0],b=v[1];return 3*(g+b)/4-b}function h(d,v,g){return 3*(v+g)/4-g}function p(d){for(var v,g=T(d),b=g[0],_=g[1],m=new f(h(d,b,_)),y=0,E=_>0?b-4:b,o=0;o<E;o+=4)v=s[d.charCodeAt(o)]<<18|s[d.charCodeAt(o+1)]<<12|s[d.charCodeAt(o+2)]<<6|s[d.charCodeAt(o+3)],m[y++]=v>>16&255,m[y++]=v>>8&255,m[y++]=255&v;return _===2&&(v=s[d.charCodeAt(o)]<<2|s[d.charCodeAt(o+1)]>>4,m[y++]=255&v),_===1&&(v=s[d.charCodeAt(o)]<<10|s[d.charCodeAt(o+1)]<<4|s[d.charCodeAt(o+2)]>>2,m[y++]=v>>8&255,m[y++]=255&v),m}function c(d){return u[d>>18&63]+u[d>>12&63]+u[d>>6&63]+u[63&d]}function l(d,v,g){for(var b,_=[],m=v;m<g;m+=3)b=(d[m]<<16&16711680)+(d[m+1]<<8&65280)+(255&d[m+2]),_.push(c(b));return _.join("")}function a(d){for(var v,g=d.length,b=g%3,_=[],m=0,y=g-b;m<y;m+=16383)_.push(l(d,m,m+16383>y?y:m+16383));return b===1?(v=d[g-1],_.push(u[v>>2]+u[v<<4&63]+"==")):b===2&&(v=(d[g-2]<<8)+d[g-1],_.push(u[v>>10]+u[v>>4&63]+u[v<<2&63]+"=")),_.join("")}S.byteLength=C,S.toByteArray=p,S.fromByteArray=a;for(var u=[],s=[],f=typeof Uint8Array!="undefined"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,t=i.length;n<t;++n)u[n]=i[n],s[i.charCodeAt(n)]=n;s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},{}],35:[function(w,k,S){!function(T,C,h){k!==void 0&&k.exports?k.exports=h():typeof j=="function"&&j.amd?j("bowser",h):T.bowser=h()}(this,0,function(){function T(s){function f(ne){var $=s.match(ne);return $&&$.length>1&&$[1]||""}function i(ne){var $=s.match(ne);return $&&$.length>1&&$[2]||""}var n,t=f(/(ipod|iphone|ipad)/i).toLowerCase(),d=/like android/i.test(s),v=!d&&/android/i.test(s),g=/nexus\s*[0-6]\s*/i.test(s),b=!g&&/nexus\s*[0-9]+/i.test(s),_=/CrOS/.test(s),m=/silk/i.test(s),y=/sailfish/i.test(s),E=/tizen/i.test(s),o=/(web|hpw)os/i.test(s),x=/windows phone/i.test(s),A=(/SamsungBrowser/i.test(s),!x&&/windows/i.test(s)),O=!t&&!m&&/macintosh/i.test(s),D=!v&&!y&&!E&&!o&&/linux/i.test(s),N=i(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),W=f(/version\/(\d+(\.\d+)?)/i),K=/tablet/i.test(s)&&!/tablet pc/i.test(s),oe=!K&&/[^-]mobi/i.test(s),B=/xbox/i.test(s);/opera/i.test(s)?n={name:"Opera",opera:a,version:W||f(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(s)?n={name:"Opera",opera:a,version:f(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||W}:/SamsungBrowser/i.test(s)?n={name:"Samsung Internet for Android",samsungBrowser:a,version:W||f(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(s)?n={name:"Opera Coast",coast:a,version:W||f(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(s)?n={name:"Yandex Browser",yandexbrowser:a,version:W||f(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(s)?n={name:"UC Browser",ucbrowser:a,version:f(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(s)?n={name:"Maxthon",maxthon:a,version:f(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(s)?n={name:"Epiphany",epiphany:a,version:f(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(s)?n={name:"Puffin",puffin:a,version:f(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(s)?n={name:"Sleipnir",sleipnir:a,version:f(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(s)?n={name:"K-Meleon",kMeleon:a,version:f(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:x?(n={name:"Windows Phone",osname:"Windows Phone",windowsphone:a},N?(n.msedge=a,n.version=N):(n.msie=a,n.version=f(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(s)?n={name:"Internet Explorer",msie:a,version:f(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:_?n={name:"Chrome",osname:"Chrome OS",chromeos:a,chromeBook:a,chrome:a,version:f(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(s)?n={name:"Microsoft Edge",msedge:a,version:N}:/vivaldi/i.test(s)?n={name:"Vivaldi",vivaldi:a,version:f(/vivaldi\/(\d+(\.\d+)?)/i)||W}:y?n={name:"Sailfish",osname:"Sailfish OS",sailfish:a,version:f(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(s)?n={name:"SeaMonkey",seamonkey:a,version:f(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(s)?(n={name:"Firefox",firefox:a,version:f(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(s)&&(n.firefoxos=a,n.osname="Firefox OS")):m?n={name:"Amazon Silk",silk:a,version:f(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(s)?n={name:"PhantomJS",phantom:a,version:f(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(s)?n={name:"SlimerJS",slimer:a,version:f(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(s)||/rim\stablet/i.test(s)?n={name:"BlackBerry",osname:"BlackBerry OS",blackberry:a,version:W||f(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:o?(n={name:"WebOS",osname:"WebOS",webos:a,version:W||f(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(s)&&(n.touchpad=a)):/bada/i.test(s)?n={name:"Bada",osname:"Bada",bada:a,version:f(/dolfin\/(\d+(\.\d+)?)/i)}:E?n={name:"Tizen",osname:"Tizen",tizen:a,version:f(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||W}:/qupzilla/i.test(s)?n={name:"QupZilla",qupzilla:a,version:f(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||W}:/chromium/i.test(s)?n={name:"Chromium",chromium:a,version:f(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||W}:/chrome|crios|crmo/i.test(s)?n={name:"Chrome",chrome:a,version:f(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:v?n={name:"Android",version:W}:/safari|applewebkit/i.test(s)?(n={name:"Safari",safari:a},W&&(n.version=W)):t?(n={name:t=="iphone"?"iPhone":t=="ipad"?"iPad":"iPod"},W&&(n.version=W)):n=/googlebot/i.test(s)?{name:"Googlebot",googlebot:a,version:f(/googlebot\/(\d+(\.\d+))/i)||W}:{name:f(/^(.*)\/(.*) /),version:i(/^(.*)\/(.*) /)},!n.msedge&&/(apple)?webkit/i.test(s)?(/(apple)?webkit\/537\.36/i.test(s)?(n.name=n.name||"Blink",n.blink=a):(n.name=n.name||"Webkit",n.webkit=a),!n.version&&W&&(n.version=W)):!n.opera&&/gecko\//i.test(s)&&(n.name=n.name||"Gecko",n.gecko=a,n.version=n.version||f(/gecko\/(\d+(\.\d+)?)/i)),n.windowsphone||!v&&!n.silk?!n.windowsphone&&t?(n[t]=a,n.ios=a,n.osname="iOS"):O?(n.mac=a,n.osname="macOS"):B?(n.xbox=a,n.osname="Xbox"):A?(n.windows=a,n.osname="Windows"):D&&(n.linux=a,n.osname="Linux"):(n.android=a,n.osname="Android");var X="";n.windows?X=function(ne){switch(ne){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}}(f(/Windows ((NT|XP)( \d\d?.\d)?)/i)):n.windowsphone?X=f(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):n.mac?(X=f(/Mac OS X (\d+([_\.\s]\d+)*)/i),X=X.replace(/[_\s]/g,".")):t?(X=f(/os (\d+([_\s]\d+)*) like mac os x/i),X=X.replace(/[_\s]/g,".")):v?X=f(/android[ \/-](\d+(\.\d+)*)/i):n.webos?X=f(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):n.blackberry?X=f(/rim\stablet\sos\s(\d+(\.\d+)*)/i):n.bada?X=f(/bada\/(\d+(\.\d+)*)/i):n.tizen&&(X=f(/tizen[\/\s](\d+(\.\d+)*)/i)),X&&(n.osversion=X);var V=!n.windows&&X.split(".")[0];return K||b||t=="ipad"||v&&(V==3||V>=4&&!oe)||n.silk?n.tablet=a:(oe||t=="iphone"||t=="ipod"||v||g||n.blackberry||n.webos||n.bada)&&(n.mobile=a),n.msedge||n.msie&&n.version>=10||n.yandexbrowser&&n.version>=15||n.vivaldi&&n.version>=1||n.chrome&&n.version>=20||n.samsungBrowser&&n.version>=4||n.firefox&&n.version>=20||n.safari&&n.version>=6||n.opera&&n.version>=10||n.ios&&n.osversion&&n.osversion.split(".")[0]>=6||n.blackberry&&n.version>=10.1||n.chromium&&n.version>=20?n.a=a:n.msie&&n.version<10||n.chrome&&n.version<20||n.firefox&&n.version<20||n.safari&&n.version<6||n.opera&&n.version<10||n.ios&&n.osversion&&n.osversion.split(".")[0]<6||n.chromium&&n.version<20?n.c=a:n.x=a,n}function C(s){return s.split(".").length}function h(s,f){var i,n=[];if(Array.prototype.map)return Array.prototype.map.call(s,f);for(i=0;i<s.length;i++)n.push(f(s[i]));return n}function p(s){for(var f=Math.max(C(s[0]),C(s[1])),i=h(s,function(n){var t=f-C(n);return n+=new Array(t+1).join(".0"),h(n.split("."),function(d){return new Array(20-d.length).join("0")+d}).reverse()});--f>=0;){if(i[0][f]>i[1][f])return 1;if(i[0][f]!==i[1][f])return-1;if(f===0)return 0}}function c(s,f,i){var n=u;typeof f=="string"&&(i=f,f=void 0),f===void 0&&(f=!1),i&&(n=T(i));var t=""+n.version;for(var d in s)if(s.hasOwnProperty(d)&&n[d]){if(typeof s[d]!="string")throw new Error("Browser version in the minVersion map should be a string: "+d+": "+String(s));return p([t,s[d]])<0}return f}function l(s,f,i){return!c(s,f,i)}var a=!0,u=T(typeof navigator!="undefined"&&navigator.userAgent||"");return u.test=function(s){for(var f=0;f<s.length;++f){var i=s[f];if(typeof i=="string"&&i in u)return!0}return!1},u.isUnsupportedBrowser=c,u.compareVersions=p,u.check=l,u._detect=T,u.detect=T,u})},{}],36:[function(w,k,S){},{}],37:[function(w,k,S){function T(u){if(u&&!l(u))throw new Error("Unknown encoding: "+u)}function C(u){return u.toString(this.encoding)}function h(u){this.charReceived=u.length%2,this.charLength=this.charReceived?2:0}function p(u){this.charReceived=u.length%3,this.charLength=this.charReceived?3:0}var c=w("buffer").Buffer,l=c.isEncoding||function(u){switch(u&&u.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}},a=S.StringDecoder=function(u){switch(this.encoding=(u||"utf8").toLowerCase().replace(/[-_]/,""),T(u),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=h;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=p;break;default:return void(this.write=C)}this.charBuffer=new c(6),this.charReceived=0,this.charLength=0};a.prototype.write=function(u){for(var s="";this.charLength;){var f=u.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:u.length;if(u.copy(this.charBuffer,this.charReceived,0,f),this.charReceived+=f,this.charReceived<this.charLength)return"";u=u.slice(f,u.length),s=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var n=s.charCodeAt(s.length-1);if(!(n>=55296&&n<=56319)){if(this.charReceived=this.charLength=0,u.length===0)return s;break}this.charLength+=this.surrogateSize,s=""}this.detectIncompleteChar(u);var i=u.length;this.charLength&&(u.copy(this.charBuffer,0,u.length-this.charReceived,i),i-=this.charReceived),s+=u.toString(this.encoding,0,i);var i=s.length-1,n=s.charCodeAt(i);if(n>=55296&&n<=56319){var t=this.surrogateSize;return this.charLength+=t,this.charReceived+=t,this.charBuffer.copy(this.charBuffer,t,0,t),u.copy(this.charBuffer,0,0,t),s.substring(0,i)}return s},a.prototype.detectIncompleteChar=function(u){for(var s=u.length>=3?3:u.length;s>0;s--){var f=u[u.length-s];if(s==1&&f>>5==6){this.charLength=2;break}if(s<=2&&f>>4==14){this.charLength=3;break}if(s<=3&&f>>3==30){this.charLength=4;break}}this.charReceived=s},a.prototype.end=function(u){var s="";if(u&&u.length&&(s=this.write(u)),this.charReceived){var f=this.charReceived,i=this.charBuffer,n=this.encoding;s+=i.slice(0,f).toString(n)}return s}},{buffer:38}],38:[function(w,k,S){(function(T){"use strict";function C(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function h(P,U){if(C()<U)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(P=new Uint8Array(U),P.__proto__=p.prototype):(P===null&&(P=new p(U)),P.length=U),P}function p(P,U,q){if(!(p.TYPED_ARRAY_SUPPORT||this instanceof p))return new p(P,U,q);if(typeof P=="number"){if(typeof U=="string")throw new Error("If encoding is specified then the first argument must be a string");return u(this,P)}return c(this,P,U,q)}function c(P,U,q,Y){if(typeof U=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&U instanceof ArrayBuffer?i(P,U,q,Y):typeof U=="string"?s(P,U,q):n(P,U)}function l(P){if(typeof P!="number")throw new TypeError('"size" argument must be a number');if(P<0)throw new RangeError('"size" argument must not be negative')}function a(P,U,q,Y){return l(U),U<=0?h(P,U):q!==void 0?typeof Y=="string"?h(P,U).fill(q,Y):h(P,U).fill(q):h(P,U)}function u(P,U){if(l(U),P=h(P,U<0?0:0|t(U)),!p.TYPED_ARRAY_SUPPORT)for(var q=0;q<U;++q)P[q]=0;return P}function s(P,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|v(U,q);P=h(P,Y);var J=P.write(U,q);return J!==Y&&(P=P.slice(0,J)),P}function f(P,U){var q=U.length<0?0:0|t(U.length);P=h(P,q);for(var Y=0;Y<q;Y+=1)P[Y]=255&U[Y];return P}function i(P,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?(P=U,P.__proto__=p.prototype):P=f(P,U),P}function n(P,U){if(p.isBuffer(U)){var q=0|t(U.length);return P=h(P,q),P.length===0||U.copy(P,0,0,q),P}if(U){if(typeof ArrayBuffer!="undefined"&&U.buffer instanceof ArrayBuffer||"length"in U)return typeof U.length!="number"||ye(U.length)?h(P,0):f(P,U);if(U.type==="Buffer"&&He(U.data))return f(P,U.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function t(P){if(P>=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return 0|P}function d(P){return+P!=P&&(P=0),p.alloc(+P)}function v(P,U){if(p.isBuffer(P))return P.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(P)||P instanceof ArrayBuffer))return P.byteLength;typeof P!="string"&&(P=""+P);var q=P.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(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*q;case"hex":return q>>>1;case"base64":return Be(P).length;default:if(Y)return xe(P).length;U=(""+U).toLowerCase(),Y=!0}}function g(P,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(P||(P="utf8");;)switch(P){case"hex":return B(this,U,q);case"utf8":case"utf-8":return N(this,U,q);case"ascii":return K(this,U,q);case"latin1":case"binary":return oe(this,U,q);case"base64":return D(this,U,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,U,q);default:if(Y)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),Y=!0}}function b(P,U,q){var Y=P[U];P[U]=P[q],P[q]=Y}function _(P,U,q,Y,J){if(P.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:P.length-1),q<0&&(q=P.length+q),q>=P.length){if(J)return-1;q=P.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:m(P,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(P,U,q):Uint8Array.prototype.lastIndexOf.call(P,U,q):m(P,[U],q,Y,J);throw new TypeError("val must be string, number or Buffer")}function m(P,U,q,Y,J){function Ee(Ye,Fe){return ke===1?Ye[Fe]:Ye.readUInt16BE(Fe*ke)}var ke=1,ht=P.length,Ue=U.length;if(Y!==void 0&&((Y=String(Y).toLowerCase())==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(P.length<2||U.length<2)return-1;ke=2,ht/=2,Ue/=2,q/=2}var je;if(J){var tt=-1;for(je=q;je<ht;je++)if(Ee(P,je)===Ee(U,tt===-1?0:je-tt)){if(tt===-1&&(tt=je),je-tt+1===Ue)return tt*ke}else tt!==-1&&(je-=je-tt),tt=-1}else for(q+Ue>ht&&(q=ht-Ue),je=q;je>=0;je--){for(var dt=!0,qe=0;qe<Ue;qe++)if(Ee(P,je+qe)!==Ee(U,qe)){dt=!1;break}if(dt)return je}return-1}function y(P,U,q,Y){q=Number(q)||0;var J=P.length-q;Y?(Y=Number(Y))>J&&(Y=J):Y=J;var Ee=U.length;if(Ee%2!=0)throw new TypeError("Invalid hex string");Y>Ee/2&&(Y=Ee/2);for(var ke=0;ke<Y;++ke){var ht=parseInt(U.substr(2*ke,2),16);if(isNaN(ht))return ke;P[q+ke]=ht}return ke}function E(P,U,q,Y){return ze(xe(U,P.length-q),P,q,Y)}function o(P,U,q,Y){return ze(Ve(U),P,q,Y)}function x(P,U,q,Y){return o(P,U,q,Y)}function A(P,U,q,Y){return ze(Be(U),P,q,Y)}function O(P,U,q,Y){return ze(Ne(U,P.length-q),P,q,Y)}function D(P,U,q){return U===0&&q===P.length?me.fromByteArray(P):me.fromByteArray(P.slice(U,q))}function N(P,U,q){q=Math.min(P.length,q);for(var Y=[],J=U;J<q;){var Ee=P[J],ke=null,ht=Ee>239?4:Ee>223?3:Ee>191?2:1;if(J+ht<=q){var Ue,je,tt,dt;switch(ht){case 1:Ee<128&&(ke=Ee);break;case 2:Ue=P[J+1],(192&Ue)==128&&(dt=(31&Ee)<<6|63&Ue)>127&&(ke=dt);break;case 3:Ue=P[J+1],je=P[J+2],(192&Ue)==128&&(192&je)==128&&(dt=(15&Ee)<<12|(63&Ue)<<6|63&je)>2047&&(dt<55296||dt>57343)&&(ke=dt);break;case 4:Ue=P[J+1],je=P[J+2],tt=P[J+3],(192&Ue)==128&&(192&je)==128&&(192&tt)==128&&(dt=(15&Ee)<<18|(63&Ue)<<12|(63&je)<<6|63&tt)>65535&&dt<1114112&&(ke=dt)}}ke===null?(ke=65533,ht=1):ke>65535&&(ke-=65536,Y.push(ke>>>10&1023|55296),ke=56320|1023&ke),Y.push(ke),J+=ht}return W(Y)}function W(P){var U=P.length;if(U<=nt)return String.fromCharCode.apply(String,P);for(var q="",Y=0;Y<U;)q+=String.fromCharCode.apply(String,P.slice(Y,Y+=nt));return q}function K(P,U,q){var Y="";q=Math.min(P.length,q);for(var J=U;J<q;++J)Y+=String.fromCharCode(127&P[J]);return Y}function oe(P,U,q){var Y="";q=Math.min(P.length,q);for(var J=U;J<q;++J)Y+=String.fromCharCode(P[J]);return Y}function B(P,U,q){var Y=P.length;(!U||U<0)&&(U=0),(!q||q<0||q>Y)&&(q=Y);for(var J="",Ee=U;Ee<q;++Ee)J+=_e(P[Ee]);return J}function X(P,U,q){for(var Y=P.slice(U,q),J="",Ee=0;Ee<Y.length;Ee+=2)J+=String.fromCharCode(Y[Ee]+256*Y[Ee+1]);return J}function V(P,U,q){if(P%1!=0||P<0)throw new RangeError("offset is not uint");if(P+U>q)throw new RangeError("Trying to access beyond buffer length")}function ne(P,U,q,Y,J,Ee){if(!p.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(U>J||U<Ee)throw new RangeError('"value" argument is out of bounds');if(q+Y>P.length)throw new RangeError("Index out of range")}function $(P,U,q,Y){U<0&&(U=65535+U+1);for(var J=0,Ee=Math.min(P.length-q,2);J<Ee;++J)P[q+J]=(U&255<<8*(Y?J:1-J))>>>8*(Y?J:1-J)}function Z(P,U,q,Y){U<0&&(U=4294967295+U+1);for(var J=0,Ee=Math.min(P.length-q,4);J<Ee;++J)P[q+J]=U>>>8*(Y?J:3-J)&255}function ue(P,U,q,Y,J,Ee){if(q+Y>P.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("Index out of range")}function he(P,U,q,Y,J){return J||ue(P,U,q,4,34028234663852886e22,-34028234663852886e22),We.write(P,U,q,Y,23,4),q+4}function Oe(P,U,q,Y,J){return J||ue(P,U,q,8,17976931348623157e292,-17976931348623157e292),We.write(P,U,q,Y,52,8),q+8}function we(P){if(P=Pe(P).replace(te,""),P.length<2)return"";for(;P.length%4!=0;)P+="=";return P}function Pe(P){return P.trim?P.trim():P.replace(/^\s+|\s+$/g,"")}function _e(P){return P<16?"0"+P.toString(16):P.toString(16)}function xe(P,U){U=U||1/0;for(var q,Y=P.length,J=null,Ee=[],ke=0;ke<Y;++ke){if((q=P.charCodeAt(ke))>55295&&q<57344){if(!J){if(q>56319){(U-=3)>-1&&Ee.push(239,191,189);continue}if(ke+1===Y){(U-=3)>-1&&Ee.push(239,191,189);continue}J=q;continue}if(q<56320){(U-=3)>-1&&Ee.push(239,191,189),J=q;continue}q=65536+(J-55296<<10|q-56320)}else J&&(U-=3)>-1&&Ee.push(239,191,189);if(J=null,q<128){if((U-=1)<0)break;Ee.push(q)}else if(q<2048){if((U-=2)<0)break;Ee.push(q>>6|192,63&q|128)}else if(q<65536){if((U-=3)<0)break;Ee.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;Ee.push(q>>18|240,q>>12&63|128,q>>6&63|128,63&q|128)}}return Ee}function Ve(P){for(var U=[],q=0;q<P.length;++q)U.push(255&P.charCodeAt(q));return U}function Ne(P,U){for(var q,Y,J,Ee=[],ke=0;ke<P.length&&!((U-=2)<0);++ke)q=P.charCodeAt(ke),Y=q>>8,J=q%256,Ee.push(J),Ee.push(Y);return Ee}function Be(P){return me.toByteArray(we(P))}function ze(P,U,q,Y){for(var J=0;J<Y&&!(J+q>=U.length||J>=P.length);++J)U[J+q]=P[J];return J}function ye(P){return P!==P}var me=w("base64-js"),We=w("ieee754"),He=w("isarray");S.Buffer=p,S.SlowBuffer=d,S.INSPECT_MAX_BYTES=50,p.TYPED_ARRAY_SUPPORT=T.TYPED_ARRAY_SUPPORT!==void 0?T.TYPED_ARRAY_SUPPORT:function(){try{var P=new Uint8Array(1);return P.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},P.foo()===42&&typeof P.subarray=="function"&&P.subarray(1,1).byteLength===0}catch(U){return!1}}(),S.kMaxLength=C(),p.poolSize=8192,p._augment=function(P){return P.__proto__=p.prototype,P},p.from=function(P,U,q){return c(null,P,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(P,U,q){return a(null,P,U,q)},p.allocUnsafe=function(P){return u(null,P)},p.allocUnsafeSlow=function(P){return u(null,P)},p.isBuffer=function(P){return!(P==null||!P._isBuffer)},p.compare=function(P,U){if(!p.isBuffer(P)||!p.isBuffer(U))throw new TypeError("Arguments must be Buffers");if(P===U)return 0;for(var q=P.length,Y=U.length,J=0,Ee=Math.min(q,Y);J<Ee;++J)if(P[J]!==U[J]){q=P[J],Y=U[J];break}return q<Y?-1:Y<q?1:0},p.isEncoding=function(P){switch(String(P).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(P,U){if(!He(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return p.alloc(0);var q;if(U===void 0)for(U=0,q=0;q<P.length;++q)U+=P[q].length;var Y=p.allocUnsafe(U),J=0;for(q=0;q<P.length;++q){var Ee=P[q];if(!p.isBuffer(Ee))throw new TypeError('"list" argument must be an Array of Buffers');Ee.copy(Y,J),J+=Ee.length}return Y},p.byteLength=v,p.prototype._isBuffer=!0,p.prototype.swap16=function(){var P=this.length;if(P%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var U=0;U<P;U+=2)b(this,U,U+1);return this},p.prototype.swap32=function(){var P=this.length;if(P%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var U=0;U<P;U+=4)b(this,U,U+3),b(this,U+1,U+2);return this},p.prototype.swap64=function(){var P=this.length;if(P%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var U=0;U<P;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 P=0|this.length;return P===0?"":arguments.length===0?N(this,0,P):g.apply(this,arguments)},p.prototype.equals=function(P){if(!p.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P||p.compare(this,P)===0},p.prototype.inspect=function(){var P="",U=S.INSPECT_MAX_BYTES;return this.length>0&&(P=this.toString("hex",0,U).match(/.{2}/g).join(" "),this.length>U&&(P+=" ... ")),"<Buffer "+P+">"},p.prototype.compare=function(P,U,q,Y,J){if(!p.isBuffer(P))throw new TypeError("Argument must be a Buffer");if(U===void 0&&(U=0),q===void 0&&(q=P?P.length:0),Y===void 0&&(Y=0),J===void 0&&(J=this.length),U<0||q>P.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===P)return 0;for(var Ee=J-Y,ke=q-U,ht=Math.min(Ee,ke),Ue=this.slice(Y,J),je=P.slice(U,q),tt=0;tt<ht;++tt)if(Ue[tt]!==je[tt]){Ee=Ue[tt],ke=je[tt];break}return Ee<ke?-1:ke<Ee?1:0},p.prototype.includes=function(P,U,q){return this.indexOf(P,U,q)!==-1},p.prototype.indexOf=function(P,U,q){return _(this,P,U,q,!0)},p.prototype.lastIndexOf=function(P,U,q){return _(this,P,U,q,!1)},p.prototype.write=function(P,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),P.length>0&&(q<0||U<0)||U>this.length)throw new RangeError("Attempt to write outside buffer bounds");Y||(Y="utf8");for(var Ee=!1;;)switch(Y){case"hex":return y(this,P,U,q);case"utf8":case"utf-8":return E(this,P,U,q);case"ascii":return o(this,P,U,q);case"latin1":case"binary":return x(this,P,U,q);case"base64":return A(this,P,U,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,P,U,q);default:if(Ee)throw new TypeError("Unknown encoding: "+Y);Y=(""+Y).toLowerCase(),Ee=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var nt=4096;p.prototype.slice=function(P,U){var q=this.length;P=~~P,U=U===void 0?q:~~U,P<0?(P+=q)<0&&(P=0):P>q&&(P=q),U<0?(U+=q)<0&&(U=0):U>q&&(U=q),U<P&&(U=P);var Y;if(p.TYPED_ARRAY_SUPPORT)Y=this.subarray(P,U),Y.__proto__=p.prototype;else{var J=U-P;Y=new p(J,void 0);for(var Ee=0;Ee<J;++Ee)Y[Ee]=this[Ee+P]}return Y},p.prototype.readUIntLE=function(P,U,q){P|=0,U|=0,q||V(P,U,this.length);for(var Y=this[P],J=1,Ee=0;++Ee<U&&(J*=256);)Y+=this[P+Ee]*J;return Y},p.prototype.readUIntBE=function(P,U,q){P|=0,U|=0,q||V(P,U,this.length);for(var Y=this[P+--U],J=1;U>0&&(J*=256);)Y+=this[P+--U]*J;return Y},p.prototype.readUInt8=function(P,U){return U||V(P,1,this.length),this[P]},p.prototype.readUInt16LE=function(P,U){return U||V(P,2,this.length),this[P]|this[P+1]<<8},p.prototype.readUInt16BE=function(P,U){return U||V(P,2,this.length),this[P]<<8|this[P+1]},p.prototype.readUInt32LE=function(P,U){return U||V(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+16777216*this[P+3]},p.prototype.readUInt32BE=function(P,U){return U||V(P,4,this.length),16777216*this[P]+(this[P+1]<<16|this[P+2]<<8|this[P+3])},p.prototype.readIntLE=function(P,U,q){P|=0,U|=0,q||V(P,U,this.length);for(var Y=this[P],J=1,Ee=0;++Ee<U&&(J*=256);)Y+=this[P+Ee]*J;return J*=128,Y>=J&&(Y-=Math.pow(2,8*U)),Y},p.prototype.readIntBE=function(P,U,q){P|=0,U|=0,q||V(P,U,this.length);for(var Y=U,J=1,Ee=this[P+--Y];Y>0&&(J*=256);)Ee+=this[P+--Y]*J;return J*=128,Ee>=J&&(Ee-=Math.pow(2,8*U)),Ee},p.prototype.readInt8=function(P,U){return U||V(P,1,this.length),128&this[P]?-1*(255-this[P]+1):this[P]},p.prototype.readInt16LE=function(P,U){U||V(P,2,this.length);var q=this[P]|this[P+1]<<8;return 32768&q?4294901760|q:q},p.prototype.readInt16BE=function(P,U){U||V(P,2,this.length);var q=this[P+1]|this[P]<<8;return 32768&q?4294901760|q:q},p.prototype.readInt32LE=function(P,U){return U||V(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},p.prototype.readInt32BE=function(P,U){return U||V(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},p.prototype.readFloatLE=function(P,U){return U||V(P,4,this.length),We.read(this,P,!0,23,4)},p.prototype.readFloatBE=function(P,U){return U||V(P,4,this.length),We.read(this,P,!1,23,4)},p.prototype.readDoubleLE=function(P,U){return U||V(P,8,this.length),We.read(this,P,!0,52,8)},p.prototype.readDoubleBE=function(P,U){return U||V(P,8,this.length),We.read(this,P,!1,52,8)},p.prototype.writeUIntLE=function(P,U,q,Y){(P=+P,U|=0,q|=0,!Y)&&ne(this,P,U,q,Math.pow(2,8*q)-1,0);var J=1,Ee=0;for(this[U]=255&P;++Ee<q&&(J*=256);)this[U+Ee]=P/J&255;return U+q},p.prototype.writeUIntBE=function(P,U,q,Y){(P=+P,U|=0,q|=0,!Y)&&ne(this,P,U,q,Math.pow(2,8*q)-1,0);var J=q-1,Ee=1;for(this[U+J]=255&P;--J>=0&&(Ee*=256);)this[U+J]=P/Ee&255;return U+q},p.prototype.writeUInt8=function(P,U,q){return P=+P,U|=0,q||ne(this,P,U,1,255,0),p.TYPED_ARRAY_SUPPORT||(P=Math.floor(P)),this[U]=255&P,U+1},p.prototype.writeUInt16LE=function(P,U,q){return P=+P,U|=0,q||ne(this,P,U,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[U]=255&P,this[U+1]=P>>>8):$(this,P,U,!0),U+2},p.prototype.writeUInt16BE=function(P,U,q){return P=+P,U|=0,q||ne(this,P,U,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[U]=P>>>8,this[U+1]=255&P):$(this,P,U,!1),U+2},p.prototype.writeUInt32LE=function(P,U,q){return P=+P,U|=0,q||ne(this,P,U,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[U+3]=P>>>24,this[U+2]=P>>>16,this[U+1]=P>>>8,this[U]=255&P):Z(this,P,U,!0),U+4},p.prototype.writeUInt32BE=function(P,U,q){return P=+P,U|=0,q||ne(this,P,U,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[U]=P>>>24,this[U+1]=P>>>16,this[U+2]=P>>>8,this[U+3]=255&P):Z(this,P,U,!1),U+4},p.prototype.writeIntLE=function(P,U,q,Y){if(P=+P,U|=0,!Y){var J=Math.pow(2,8*q-1);ne(this,P,U,q,J-1,-J)}var Ee=0,ke=1,ht=0;for(this[U]=255&P;++Ee<q&&(ke*=256);)P<0&&ht===0&&this[U+Ee-1]!==0&&(ht=1),this[U+Ee]=(P/ke>>0)-ht&255;return U+q},p.prototype.writeIntBE=function(P,U,q,Y){if(P=+P,U|=0,!Y){var J=Math.pow(2,8*q-1);ne(this,P,U,q,J-1,-J)}var Ee=q-1,ke=1,ht=0;for(this[U+Ee]=255&P;--Ee>=0&&(ke*=256);)P<0&&ht===0&&this[U+Ee+1]!==0&&(ht=1),this[U+Ee]=(P/ke>>0)-ht&255;return U+q},p.prototype.writeInt8=function(P,U,q){return P=+P,U|=0,q||ne(this,P,U,1,127,-128),p.TYPED_ARRAY_SUPPORT||(P=Math.floor(P)),P<0&&(P=255+P+1),this[U]=255&P,U+1},p.prototype.writeInt16LE=function(P,U,q){return P=+P,U|=0,q||ne(this,P,U,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[U]=255&P,this[U+1]=P>>>8):$(this,P,U,!0),U+2},p.prototype.writeInt16BE=function(P,U,q){return P=+P,U|=0,q||ne(this,P,U,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[U]=P>>>8,this[U+1]=255&P):$(this,P,U,!1),U+2},p.prototype.writeInt32LE=function(P,U,q){return P=+P,U|=0,q||ne(this,P,U,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[U]=255&P,this[U+1]=P>>>8,this[U+2]=P>>>16,this[U+3]=P>>>24):Z(this,P,U,!0),U+4},p.prototype.writeInt32BE=function(P,U,q){return P=+P,U|=0,q||ne(this,P,U,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),p.TYPED_ARRAY_SUPPORT?(this[U]=P>>>24,this[U+1]=P>>>16,this[U+2]=P>>>8,this[U+3]=255&P):Z(this,P,U,!1),U+4},p.prototype.writeFloatLE=function(P,U,q){return he(this,P,U,!0,q)},p.prototype.writeFloatBE=function(P,U,q){return he(this,P,U,!1,q)},p.prototype.writeDoubleLE=function(P,U,q){return Oe(this,P,U,!0,q)},p.prototype.writeDoubleBE=function(P,U,q){return Oe(this,P,U,!1,q)},p.prototype.copy=function(P,U,q,Y){if(q||(q=0),Y||Y===0||(Y=this.length),U>=P.length&&(U=P.length),U||(U=0),Y>0&&Y<q&&(Y=q),Y===q)return 0;if(P.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),P.length-U<Y-q&&(Y=P.length-U+q);var J,Ee=Y-q;if(this===P&&q<U&&U<Y)for(J=Ee-1;J>=0;--J)P[J+U]=this[J+q];else if(Ee<1e3||!p.TYPED_ARRAY_SUPPORT)for(J=0;J<Ee;++J)P[J+U]=this[J+q];else Uint8Array.prototype.set.call(P,this.subarray(q,q+Ee),U);return Ee},p.prototype.fill=function(P,U,q,Y){if(typeof P=="string"){if(typeof U=="string"?(Y=U,U=0,q=this.length):typeof q=="string"&&(Y=q,q=this.length),P.length===1){var J=P.charCodeAt(0);J<256&&(P=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 P=="number"&&(P&=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,P||(P=0);var Ee;if(typeof P=="number")for(Ee=U;Ee<q;++Ee)this[Ee]=P;else{var ke=p.isBuffer(P)?P:xe(new p(P,Y).toString()),ht=ke.length;for(Ee=0;Ee<q-U;++Ee)this[Ee+U]=ke[Ee%ht]}return this};var te=/[^+\/0-9A-Za-z-_]/g}).call(this,typeof de!="undefined"?de:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"base64-js":34,ieee754:161,isarray:166}],39:[function(w,k,S){k.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(w,k,S){"use strict";var T=function(){this.buffer=[],this.fns=[]};T.prototype.push=function(h,p){if(this.fns.length)return this.fns.shift()(null,h);var c={data:h,priority:p},l=C(this.buffer,c,function(a){return a.priority});this.buffer.splice(l,0,c)},T.prototype.next=function(){var h=this;return function(p){if(h.buffer.length)return p(null,h.buffer.pop().data);h.fns.push(p)}};var C=function(h,p,c){p=c(p);for(var l=0,a=h?h.length:l;l<a;){var u=l+a>>>1;c(h[u])<p?l=u+1:a=u}return l};k.exports=T},{}],41:[function(w,k,S){function T(i){var n=this,t=f.call(arguments,1);return new Promise(function(d,v){function g(m){var y;try{y=i.next(m)}catch(E){return v(E)}_(y)}function b(m){var y;try{y=i.throw(m)}catch(E){return v(E)}_(y)}function _(m){if(m.done)return d(m.value);var y=C.call(n,m.value);return y&&l(y)?y.then(g,b):b(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "'+String(m.value)+'"'))}if(typeof i=="function"&&(i=i.apply(n,t)),!i||typeof i.next!="function")return d(i);g()})}function C(i){return i&&(l(i)?i:u(i)||a(i)?T.call(this,i):typeof i=="function"?h.call(this,i):Array.isArray(i)?p.call(this,i):s(i)?c.call(this,i):i)}function h(i){var n=this;return new Promise(function(t,d){i.call(n,function(v,g){if(v)return d(v);arguments.length>2&&(g=f.call(arguments,1)),t(g)})})}function p(i){return Promise.all(i.map(C,this))}function c(i){for(var n=new i.constructor,t=Object.keys(i),d=[],v=0;v<t.length;v++){var g=t[v],b=C.call(this,i[g]);b&&l(b)?function(_,m){n[m]=void 0,d.push(_.then(function(y){n[m]=y}))}(b,g):n[g]=i[g]}return Promise.all(d).then(function(){return n})}function l(i){return typeof i.then=="function"}function a(i){return typeof i.next=="function"&&typeof i.throw=="function"}function u(i){var n=i.constructor;return!!n&&(n.name==="GeneratorFunction"||n.displayName==="GeneratorFunction"||a(n.prototype))}function s(i){return Object==i.constructor}var f=Array.prototype.slice;k.exports=T.default=T.co=T,T.wrap=function(i){function n(){return T.call(this,i.apply(this,arguments))}return n.__generatorFunction__=i,n}},{}],42:[function(w,k,S){k.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(w,k,S){"use strict";function T(p,c){if(!(this instanceof T))return new T(p,c);this.src=p,this._withAccess=c}function C(p,c){return p[c]===void 0&&p.__lookupGetter__(c)===void 0&&p.__lookupSetter__(c)===void 0}var h=Array.prototype.slice;k.exports=T,T.prototype.withAccess=function(p){return this._withAccess=p!==!1,this},T.prototype.pick=function(p){return Array.isArray(p)||(p=h.call(arguments)),p.length&&(this.keys=p),this},T.prototype.to=function(p){if(p=p||{},!this.src)return p;var c=this.keys||Object.keys(this.src);if(!this._withAccess){for(var l=0;l<c.length;l++)a=c[l],p[a]===void 0&&(p[a]=this.src[a]);return p}for(var l=0;l<c.length;l++){var a=c[l];if(C(p,a)){var u=this.src.__lookupGetter__(a),s=this.src.__lookupSetter__(a);u&&p.__defineGetter__(a,u),s&&p.__defineSetter__(a,s),u||s||(p[a]=this.src[a])}}return p},T.prototype.toCover=function(p){for(var c=this.keys||Object.keys(this.src),l=0;l<c.length;l++){var a=c[l];delete p[a];var u=this.src.__lookupGetter__(a),s=this.src.__lookupSetter__(a);u&&p.__defineGetter__(a,u),s&&p.__defineSetter__(a,s),u||s||(p[a]=this.src[a])}},T.prototype.override=T.prototype.toCover,T.prototype.and=function(p){var c={};return this.to(c),this.src=p,this.to(c),this.src=c,this}},{}],44:[function(w,k,S){w("../../modules/es6.string.iterator"),w("../../modules/es6.array.from"),k.exports=w("../../modules/_core").Array.from},{"../../modules/_core":65,"../../modules/es6.array.from":133,"../../modules/es6.string.iterator":145}],45:[function(w,k,S){var T=w("../../modules/_core"),C=T.JSON||(T.JSON={stringify:JSON.stringify});k.exports=function(h){return C.stringify.apply(C,arguments)}},{"../../modules/_core":65}],46:[function(w,k,S){w("../../modules/es6.object.assign"),k.exports=w("../../modules/_core").Object.assign},{"../../modules/_core":65,"../../modules/es6.object.assign":136}],47:[function(w,k,S){w("../../modules/es6.object.create");var T=w("../../modules/_core").Object;k.exports=function(C,h){return T.create(C,h)}},{"../../modules/_core":65,"../../modules/es6.object.create":137}],48:[function(w,k,S){w("../../modules/es6.object.define-property");var T=w("../../modules/_core").Object;k.exports=function(C,h,p){return T.defineProperty(C,h,p)}},{"../../modules/_core":65,"../../modules/es6.object.define-property":138}],49:[function(w,k,S){w("../../modules/es6.object.get-own-property-names");var T=w("../../modules/_core").Object;k.exports=function(C){return T.getOwnPropertyNames(C)}},{"../../modules/_core":65,"../../modules/es6.object.get-own-property-names":139}],50:[function(w,k,S){w("../../modules/es6.object.get-prototype-of"),k.exports=w("../../modules/_core").Object.getPrototypeOf},{"../../modules/_core":65,"../../modules/es6.object.get-prototype-of":140}],51:[function(w,k,S){w("../../modules/es6.object.keys"),k.exports=w("../../modules/_core").Object.keys},{"../../modules/_core":65,"../../modules/es6.object.keys":141}],52:[function(w,k,S){w("../modules/es6.object.to-string"),w("../modules/es6.string.iterator"),w("../modules/web.dom.iterable"),w("../modules/es6.promise"),w("../modules/es7.promise.finally"),w("../modules/es7.promise.try"),k.exports=w("../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(w,k,S){w("../modules/web.immediate"),k.exports=w("../modules/_core").setImmediate},{"../modules/_core":65,"../modules/web.immediate":152}],54:[function(w,k,S){w("../../modules/es6.string.from-code-point"),k.exports=w("../../modules/_core").String.fromCodePoint},{"../../modules/_core":65,"../../modules/es6.string.from-code-point":144}],55:[function(w,k,S){w("../../modules/es6.function.has-instance"),k.exports=w("../../modules/_wks-ext").f("hasInstance")},{"../../modules/_wks-ext":130,"../../modules/es6.function.has-instance":135}],56:[function(w,k,S){w("../../modules/es6.symbol"),w("../../modules/es6.object.to-string"),w("../../modules/es7.symbol.async-iterator"),w("../../modules/es7.symbol.observable"),k.exports=w("../../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(w,k,S){w("../../modules/es6.string.iterator"),w("../../modules/web.dom.iterable"),k.exports=w("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":130,"../../modules/es6.string.iterator":145,"../../modules/web.dom.iterable":151}],58:[function(w,k,S){k.exports=function(T){if(typeof T!="function")throw TypeError(T+" is not a function!");return T}},{}],59:[function(w,k,S){k.exports=function(){}},{}],60:[function(w,k,S){k.exports=function(T,C,h,p){if(!(T instanceof C)||p!==void 0&&p in T)throw TypeError(h+": incorrect invocation!");return T}},{}],61:[function(w,k,S){var T=w("./_is-object");k.exports=function(C){if(!T(C))throw TypeError(C+" is not an object!");return C}},{"./_is-object":85}],62:[function(w,k,S){var T=w("./_to-iobject"),C=w("./_to-length"),h=w("./_to-absolute-index");k.exports=function(p){return function(c,l,a){var u,s=T(c),f=C(s.length),i=h(a,f);if(p&&l!=l){for(;f>i;)if((u=s[i++])!=u)return!0}else for(;f>i;i++)if((p||i in s)&&s[i]===l)return p||i||0;return!p&&-1}}},{"./_to-absolute-index":121,"./_to-iobject":123,"./_to-length":124}],63:[function(w,k,S){var T=w("./_cof"),C=w("./_wks")("toStringTag"),h=T(function(){return arguments}())=="Arguments",p=function(c,l){try{return c[l]}catch(a){}};k.exports=function(c){var l,a,u;return c===void 0?"Undefined":c===null?"Null":typeof(a=p(l=Object(c),C))=="string"?a:h?T(l):(u=T(l))=="Object"&&typeof l.callee=="function"?"Arguments":u}},{"./_cof":64,"./_wks":131}],64:[function(w,k,S){var T={}.toString;k.exports=function(C){return T.call(C).slice(8,-1)}},{}],65:[function(w,k,S){var T=k.exports={version:"2.5.7"};typeof __e=="number"&&(__e=T)},{}],66:[function(w,k,S){"use strict";var T=w("./_object-dp"),C=w("./_property-desc");k.exports=function(h,p,c){p in h?T.f(h,p,C(0,c)):h[p]=c}},{"./_object-dp":98,"./_property-desc":111}],67:[function(w,k,S){var T=w("./_a-function");k.exports=function(C,h,p){if(T(C),h===void 0)return C;switch(p){case 1:return function(c){return C.call(h,c)};case 2:return function(c,l){return C.call(h,c,l)};case 3:return function(c,l,a){return C.call(h,c,l,a)}}return function(){return C.apply(h,arguments)}}},{"./_a-function":58}],68:[function(w,k,S){k.exports=function(T){if(T==null)throw TypeError("Can't call method on "+T);return T}},{}],69:[function(w,k,S){k.exports=!w("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":74}],70:[function(w,k,S){var T=w("./_is-object"),C=w("./_global").document,h=T(C)&&T(C.createElement);k.exports=function(p){return h?C.createElement(p):{}}},{"./_global":76,"./_is-object":85}],71:[function(w,k,S){k.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],72:[function(w,k,S){var T=w("./_object-keys"),C=w("./_object-gops"),h=w("./_object-pie");k.exports=function(p){var c=T(p),l=C.f;if(l)for(var a,u=l(p),s=h.f,f=0;u.length>f;)s.call(p,a=u[f++])&&c.push(a);return c}},{"./_object-gops":103,"./_object-keys":106,"./_object-pie":107}],73:[function(w,k,S){var T=w("./_global"),C=w("./_core"),h=w("./_ctx"),p=w("./_hide"),c=w("./_has"),l=function(a,u,s){var f,i,n,t=a&l.F,d=a&l.G,v=a&l.S,g=a&l.P,b=a&l.B,_=a&l.W,m=d?C:C[u]||(C[u]={}),y=m.prototype,E=d?T:v?T[u]:(T[u]||{}).prototype;d&&(s=u);for(f in s)(i=!t&&E&&E[f]!==void 0)&&c(m,f)||(n=i?E[f]:s[f],m[f]=d&&typeof E[f]!="function"?s[f]:b&&i?h(n,T):_&&E[f]==n?function(o){var x=function(A,O,D){if(this instanceof o){switch(arguments.length){case 0:return new o;case 1:return new o(A);case 2:return new o(A,O)}return new o(A,O,D)}return o.apply(this,arguments)};return x.prototype=o.prototype,x}(n):g&&typeof n=="function"?h(Function.call,n):n,g&&((m.virtual||(m.virtual={}))[f]=n,a&l.R&&y&&!y[f]&&p(y,f,n)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,k.exports=l},{"./_core":65,"./_ctx":67,"./_global":76,"./_has":77,"./_hide":78}],74:[function(w,k,S){k.exports=function(T){try{return!!T()}catch(C){return!0}}},{}],75:[function(w,k,S){var T=w("./_ctx"),C=w("./_iter-call"),h=w("./_is-array-iter"),p=w("./_an-object"),c=w("./_to-length"),l=w("./core.get-iterator-method"),a={},u={},S=k.exports=function(s,f,i,n,t){var d,v,g,b,_=t?function(){return s}:l(s),m=T(i,n,f?2:1),y=0;if(typeof _!="function")throw TypeError(s+" is not iterable!");if(h(_)){for(d=c(s.length);d>y;y++)if((b=f?m(p(v=s[y])[0],v[1]):m(s[y]))===a||b===u)return b}else for(g=_.call(s);!(v=g.next()).done;)if((b=C(g,m,v.value,f))===a||b===u)return b};S.BREAK=a,S.RETURN=u},{"./_an-object":61,"./_ctx":67,"./_is-array-iter":83,"./_iter-call":86,"./_to-length":124,"./core.get-iterator-method":132}],76:[function(w,k,S){var T=k.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(w,k,S){var T={}.hasOwnProperty;k.exports=function(C,h){return T.call(C,h)}},{}],78:[function(w,k,S){var T=w("./_object-dp"),C=w("./_property-desc");k.exports=w("./_descriptors")?function(h,p,c){return T.f(h,p,C(1,c))}:function(h,p,c){return h[p]=c,h}},{"./_descriptors":69,"./_object-dp":98,"./_property-desc":111}],79:[function(w,k,S){var T=w("./_global").document;k.exports=T&&T.documentElement},{"./_global":76}],80:[function(w,k,S){k.exports=!w("./_descriptors")&&!w("./_fails")(function(){return Object.defineProperty(w("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":69,"./_dom-create":70,"./_fails":74}],81:[function(w,k,S){k.exports=function(T,C,h){var p=h===void 0;switch(C.length){case 0:return p?T():T.call(h);case 1:return p?T(C[0]):T.call(h,C[0]);case 2:return p?T(C[0],C[1]):T.call(h,C[0],C[1]);case 3:return p?T(C[0],C[1],C[2]):T.call(h,C[0],C[1],C[2]);case 4:return p?T(C[0],C[1],C[2],C[3]):T.call(h,C[0],C[1],C[2],C[3])}return T.apply(h,C)}},{}],82:[function(w,k,S){var T=w("./_cof");k.exports=Object("z").propertyIsEnumerable(0)?Object:function(C){return T(C)=="String"?C.split(""):Object(C)}},{"./_cof":64}],83:[function(w,k,S){var T=w("./_iterators"),C=w("./_wks")("iterator"),h=Array.prototype;k.exports=function(p){return p!==void 0&&(T.Array===p||h[C]===p)}},{"./_iterators":91,"./_wks":131}],84:[function(w,k,S){var T=w("./_cof");k.exports=Array.isArray||function(C){return T(C)=="Array"}},{"./_cof":64}],85:[function(w,k,S){k.exports=function(T){return typeof T=="object"?T!==null:typeof T=="function"}},{}],86:[function(w,k,S){var T=w("./_an-object");k.exports=function(C,h,p,c){try{return c?h(T(p)[0],p[1]):h(p)}catch(a){var l=C.return;throw l!==void 0&&T(l.call(C)),a}}},{"./_an-object":61}],87:[function(w,k,S){"use strict";var T=w("./_object-create"),C=w("./_property-desc"),h=w("./_set-to-string-tag"),p={};w("./_hide")(p,w("./_wks")("iterator"),function(){return this}),k.exports=function(c,l,a){c.prototype=T(p,{next:C(1,a)}),h(c,l+" Iterator")}},{"./_hide":78,"./_object-create":97,"./_property-desc":111,"./_set-to-string-tag":115,"./_wks":131}],88:[function(w,k,S){"use strict";var T=w("./_library"),C=w("./_export"),h=w("./_redefine"),p=w("./_hide"),c=w("./_iterators"),l=w("./_iter-create"),a=w("./_set-to-string-tag"),u=w("./_object-gpo"),s=w("./_wks")("iterator"),f=!([].keys&&"next"in[].keys()),i=function(){return this};k.exports=function(n,t,d,v,g,b,_){l(d,t,v);var m,y,E,o=function(B){if(!f&&B in D)return D[B];switch(B){case"keys":case"values":return function(){return new d(this,B)}}return function(){return new d(this,B)}},x=t+" Iterator",A=g=="values",O=!1,D=n.prototype,N=D[s]||D["@@iterator"]||g&&D[g],W=N||o(g),K=g?A?o("entries"):W:void 0,oe=t=="Array"&&D.entries||N;if(oe&&(E=u(oe.call(new n)))!==Object.prototype&&E.next&&(a(E,x,!0),T||typeof E[s]=="function"||p(E,s,i)),A&&N&&N.name!=="values"&&(O=!0,W=function(){return N.call(this)}),T&&!_||!f&&!O&&D[s]||p(D,s,W),c[t]=W,c[x]=i,g)if(m={values:A?W:o("values"),keys:b?W:o("keys"),entries:K},_)for(y in m)y in D||h(D,y,m[y]);else C(C.P+C.F*(f||O),t,m);return m}},{"./_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(w,k,S){var T=w("./_wks")("iterator"),C=!1;try{var h=[7][T]();h.return=function(){C=!0},Array.from(h,function(){throw 2})}catch(p){}k.exports=function(p,c){if(!c&&!C)return!1;var l=!1;try{var a=[7],u=a[T]();u.next=function(){return{done:l=!0}},a[T]=function(){return u},p(a)}catch(s){}return l}},{"./_wks":131}],90:[function(w,k,S){k.exports=function(T,C){return{value:C,done:!!T}}},{}],91:[function(w,k,S){k.exports={}},{}],92:[function(w,k,S){k.exports=!0},{}],93:[function(w,k,S){var T=w("./_uid")("meta"),C=w("./_is-object"),h=w("./_has"),p=w("./_object-dp").f,c=0,l=Object.isExtensible||function(){return!0},a=!w("./_fails")(function(){return l(Object.preventExtensions({}))}),u=function(t){p(t,T,{value:{i:"O"+ ++c,w:{}}})},s=function(t,d){if(!C(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!h(t,T)){if(!l(t))return"F";if(!d)return"E";u(t)}return t[T].i},f=function(t,d){if(!h(t,T)){if(!l(t))return!0;if(!d)return!1;u(t)}return t[T].w},i=function(t){return a&&n.NEED&&l(t)&&!h(t,T)&&u(t),t},n=k.exports={KEY:T,NEED:!1,fastKey:s,getWeak:f,onFreeze:i}},{"./_fails":74,"./_has":77,"./_is-object":85,"./_object-dp":98,"./_uid":127}],94:[function(w,k,S){var T=w("./_global"),C=w("./_task").set,h=T.MutationObserver||T.WebKitMutationObserver,p=T.process,c=T.Promise,l=w("./_cof")(p)=="process";k.exports=function(){var a,u,s,f=function(){var d,v;for(l&&(d=p.domain)&&d.exit();a;){v=a.fn,a=a.next;try{v()}catch(g){throw a?s():u=void 0,g}}u=void 0,d&&d.enter()};if(l)s=function(){p.nextTick(f)};else if(!h||T.navigator&&T.navigator.standalone)if(c&&c.resolve){var i=c.resolve(void 0);s=function(){i.then(f)}}else s=function(){C.call(T,f)};else{var n=!0,t=document.createTextNode("");new h(f).observe(t,{characterData:!0}),s=function(){t.data=n=!n}}return function(d){var v={fn:d,next:void 0};u&&(u.next=v),a||(a=v,s()),u=v}}},{"./_cof":64,"./_global":76,"./_task":120}],95:[function(w,k,S){"use strict";function T(h){var p,c;this.promise=new h(function(l,a){if(p!==void 0||c!==void 0)throw TypeError("Bad Promise constructor");p=l,c=a}),this.resolve=C(p),this.reject=C(c)}var C=w("./_a-function");k.exports.f=function(h){return new T(h)}},{"./_a-function":58}],96:[function(w,k,S){"use strict";var T=w("./_object-keys"),C=w("./_object-gops"),h=w("./_object-pie"),p=w("./_to-object"),c=w("./_iobject"),l=Object.assign;k.exports=!l||w("./_fails")(function(){var a={},u={},s=Symbol(),f="abcdefghijklmnopqrst";return a[s]=7,f.split("").forEach(function(i){u[i]=i}),l({},a)[s]!=7||Object.keys(l({},u)).join("")!=f})?function(a,u){for(var s=p(a),f=arguments.length,i=1,n=C.f,t=h.f;f>i;)for(var d,v=c(arguments[i++]),g=n?T(v).concat(n(v)):T(v),b=g.length,_=0;b>_;)t.call(v,d=g[_++])&&(s[d]=v[d]);return s}:l},{"./_fails":74,"./_iobject":82,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_to-object":125}],97:[function(w,k,S){var T=w("./_an-object"),C=w("./_object-dps"),h=w("./_enum-bug-keys"),p=w("./_shared-key")("IE_PROTO"),c=function(){},l=function(){var a,u=w("./_dom-create")("iframe"),s=h.length;for(u.style.display="none",w("./_html").appendChild(u),u.src="javascript:",a=u.contentWindow.document,a.open(),a.write("<script>document.F=Object</script>"),a.close(),l=a.F;s--;)delete l.prototype[h[s]];return l()};k.exports=Object.create||function(a,u){var s;return a!==null?(c.prototype=T(a),s=new c,c.prototype=null,s[p]=a):s=l(),u===void 0?s:C(s,u)}},{"./_an-object":61,"./_dom-create":70,"./_enum-bug-keys":71,"./_html":79,"./_object-dps":99,"./_shared-key":116}],98:[function(w,k,S){var T=w("./_an-object"),C=w("./_ie8-dom-define"),h=w("./_to-primitive"),p=Object.defineProperty;S.f=w("./_descriptors")?Object.defineProperty:function(c,l,a){if(T(c),l=h(l,!0),T(a),C)try{return p(c,l,a)}catch(u){}if("get"in a||"set"in a)throw TypeError("Accessors not supported!");return"value"in a&&(c[l]=a.value),c}},{"./_an-object":61,"./_descriptors":69,"./_ie8-dom-define":80,"./_to-primitive":126}],99:[function(w,k,S){var T=w("./_object-dp"),C=w("./_an-object"),h=w("./_object-keys");k.exports=w("./_descriptors")?Object.defineProperties:function(p,c){C(p);for(var l,a=h(c),u=a.length,s=0;u>s;)T.f(p,l=a[s++],c[l]);return p}},{"./_an-object":61,"./_descriptors":69,"./_object-dp":98,"./_object-keys":106}],100:[function(w,k,S){var T=w("./_object-pie"),C=w("./_property-desc"),h=w("./_to-iobject"),p=w("./_to-primitive"),c=w("./_has"),l=w("./_ie8-dom-define"),a=Object.getOwnPropertyDescriptor;S.f=w("./_descriptors")?a:function(u,s){if(u=h(u),s=p(s,!0),l)try{return a(u,s)}catch(f){}if(c(u,s))return C(!T.f.call(u,s),u[s])}},{"./_descriptors":69,"./_has":77,"./_ie8-dom-define":80,"./_object-pie":107,"./_property-desc":111,"./_to-iobject":123,"./_to-primitive":126}],101:[function(w,k,S){var T=w("./_to-iobject"),C=w("./_object-gopn").f,h={}.toString,p=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],c=function(l){try{return C(l)}catch(a){return p.slice()}};k.exports.f=function(l){return p&&h.call(l)=="[object Window]"?c(l):C(T(l))}},{"./_object-gopn":102,"./_to-iobject":123}],102:[function(w,k,S){var T=w("./_object-keys-internal"),C=w("./_enum-bug-keys").concat("length","prototype");S.f=Object.getOwnPropertyNames||function(h){return T(h,C)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],103:[function(w,k,S){S.f=Object.getOwnPropertySymbols},{}],104:[function(w,k,S){var T=w("./_has"),C=w("./_to-object"),h=w("./_shared-key")("IE_PROTO"),p=Object.prototype;k.exports=Object.getPrototypeOf||function(c){return c=C(c),T(c,h)?c[h]:typeof c.constructor=="function"&&c instanceof c.constructor?c.constructor.prototype:c instanceof Object?p:null}},{"./_has":77,"./_shared-key":116,"./_to-object":125}],105:[function(w,k,S){var T=w("./_has"),C=w("./_to-iobject"),h=w("./_array-includes")(!1),p=w("./_shared-key")("IE_PROTO");k.exports=function(c,l){var a,u=C(c),s=0,f=[];for(a in u)a!=p&&T(u,a)&&f.push(a);for(;l.length>s;)T(u,a=l[s++])&&(~h(f,a)||f.push(a));return f}},{"./_array-includes":62,"./_has":77,"./_shared-key":116,"./_to-iobject":123}],106:[function(w,k,S){var T=w("./_object-keys-internal"),C=w("./_enum-bug-keys");k.exports=Object.keys||function(h){return T(h,C)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],107:[function(w,k,S){S.f={}.propertyIsEnumerable},{}],108:[function(w,k,S){var T=w("./_export"),C=w("./_core"),h=w("./_fails");k.exports=function(p,c){var l=(C.Object||{})[p]||Object[p],a={};a[p]=c(l),T(T.S+T.F*h(function(){l(1)}),"Object",a)}},{"./_core":65,"./_export":73,"./_fails":74}],109:[function(w,k,S){k.exports=function(T){try{return{e:!1,v:T()}}catch(C){return{e:!0,v:C}}}},{}],110:[function(w,k,S){var T=w("./_an-object"),C=w("./_is-object"),h=w("./_new-promise-capability");k.exports=function(p,c){if(T(p),C(c)&&c.constructor===p)return c;var l=h.f(p);return(0,l.resolve)(c),l.promise}},{"./_an-object":61,"./_is-object":85,"./_new-promise-capability":95}],111:[function(w,k,S){k.exports=function(T,C){return{enumerable:!(1&T),configurable:!(2&T),writable:!(4&T),value:C}}},{}],112:[function(w,k,S){var T=w("./_hide");k.exports=function(C,h,p){for(var c in h)p&&C[c]?C[c]=h[c]:T(C,c,h[c]);return C}},{"./_hide":78}],113:[function(w,k,S){k.exports=w("./_hide")},{"./_hide":78}],114:[function(w,k,S){"use strict";var T=w("./_global"),C=w("./_core"),h=w("./_object-dp"),p=w("./_descriptors"),c=w("./_wks")("species");k.exports=function(l){var a=typeof C[l]=="function"?C[l]:T[l];p&&a&&!a[c]&&h.f(a,c,{configurable:!0,get:function(){return this}})}},{"./_core":65,"./_descriptors":69,"./_global":76,"./_object-dp":98,"./_wks":131}],115:[function(w,k,S){var T=w("./_object-dp").f,C=w("./_has"),h=w("./_wks")("toStringTag");k.exports=function(p,c,l){p&&!C(p=l?p:p.prototype,h)&&T(p,h,{configurable:!0,value:c})}},{"./_has":77,"./_object-dp":98,"./_wks":131}],116:[function(w,k,S){var T=w("./_shared")("keys"),C=w("./_uid");k.exports=function(h){return T[h]||(T[h]=C(h))}},{"./_shared":117,"./_uid":127}],117:[function(w,k,S){var T=w("./_core"),C=w("./_global"),h=C["__core-js_shared__"]||(C["__core-js_shared__"]={});(k.exports=function(p,c){return h[p]||(h[p]=c!==void 0?c:{})})("versions",[]).push({version:T.version,mode:w("./_library")?"pure":"global",copyright:"\u6F0F 2018 Denis Pushkarev (zloirock.ru)"})},{"./_core":65,"./_global":76,"./_library":92}],118:[function(w,k,S){var T=w("./_an-object"),C=w("./_a-function"),h=w("./_wks")("species");k.exports=function(p,c){var l,a=T(p).constructor;return a===void 0||(l=T(a)[h])==null?c:C(l)}},{"./_a-function":58,"./_an-object":61,"./_wks":131}],119:[function(w,k,S){var T=w("./_to-integer"),C=w("./_defined");k.exports=function(h){return function(p,c){var l,a,u=String(C(p)),s=T(c),f=u.length;return s<0||s>=f?h?"":void 0:(l=u.charCodeAt(s),l<55296||l>56319||s+1===f||(a=u.charCodeAt(s+1))<56320||a>57343?h?u.charAt(s):l:h?u.slice(s,s+2):a-56320+(l-55296<<10)+65536)}}},{"./_defined":68,"./_to-integer":122}],120:[function(w,k,S){var T,C,h,p=w("./_ctx"),c=w("./_invoke"),l=w("./_html"),a=w("./_dom-create"),u=w("./_global"),s=u.process,f=u.setImmediate,i=u.clearImmediate,n=u.MessageChannel,t=u.Dispatch,d=0,v={},g=function(){var _=+this;if(v.hasOwnProperty(_)){var m=v[_];delete v[_],m()}},b=function(_){g.call(_.data)};f&&i||(f=function(_){for(var m=[],y=1;arguments.length>y;)m.push(arguments[y++]);return v[++d]=function(){c(typeof _=="function"?_:Function(_),m)},T(d),d},i=function(_){delete v[_]},w("./_cof")(s)=="process"?T=function(_){s.nextTick(p(g,_,1))}:t&&t.now?T=function(_){t.now(p(g,_,1))}:n?(C=new n,h=C.port2,C.port1.onmessage=b,T=p(h.postMessage,h,1)):u.addEventListener&&typeof postMessage=="function"&&!u.importScripts?(T=function(_){u.postMessage(_+"","*")},u.addEventListener("message",b,!1)):T="onreadystatechange"in a("script")?function(_){l.appendChild(a("script")).onreadystatechange=function(){l.removeChild(this),g.call(_)}}:function(_){setTimeout(p(g,_,1),0)}),k.exports={set:f,clear:i}},{"./_cof":64,"./_ctx":67,"./_dom-create":70,"./_global":76,"./_html":79,"./_invoke":81}],121:[function(w,k,S){var T=w("./_to-integer"),C=Math.max,h=Math.min;k.exports=function(p,c){return p=T(p),p<0?C(p+c,0):h(p,c)}},{"./_to-integer":122}],122:[function(w,k,S){var T=Math.ceil,C=Math.floor;k.exports=function(h){return isNaN(h=+h)?0:(h>0?C:T)(h)}},{}],123:[function(w,k,S){var T=w("./_iobject"),C=w("./_defined");k.exports=function(h){return T(C(h))}},{"./_defined":68,"./_iobject":82}],124:[function(w,k,S){var T=w("./_to-integer"),C=Math.min;k.exports=function(h){return h>0?C(T(h),9007199254740991):0}},{"./_to-integer":122}],125:[function(w,k,S){var T=w("./_defined");k.exports=function(C){return Object(T(C))}},{"./_defined":68}],126:[function(w,k,S){var T=w("./_is-object");k.exports=function(C,h){if(!T(C))return C;var p,c;if(h&&typeof(p=C.toString)=="function"&&!T(c=p.call(C)))return c;if(typeof(p=C.valueOf)=="function"&&!T(c=p.call(C)))return c;if(!h&&typeof(p=C.toString)=="function"&&!T(c=p.call(C)))return c;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":85}],127:[function(w,k,S){var T=0,C=Math.random();k.exports=function(h){return"Symbol(".concat(h===void 0?"":h,")_",(++T+C).toString(36))}},{}],128:[function(w,k,S){var T=w("./_global"),C=T.navigator;k.exports=C&&C.userAgent||""},{"./_global":76}],129:[function(w,k,S){var T=w("./_global"),C=w("./_core"),h=w("./_library"),p=w("./_wks-ext"),c=w("./_object-dp").f;k.exports=function(l){var a=C.Symbol||(C.Symbol=h?{}:T.Symbol||{});l.charAt(0)=="_"||l in a||c(a,l,{value:p.f(l)})}},{"./_core":65,"./_global":76,"./_library":92,"./_object-dp":98,"./_wks-ext":130}],130:[function(w,k,S){S.f=w("./_wks")},{"./_wks":131}],131:[function(w,k,S){var T=w("./_shared")("wks"),C=w("./_uid"),h=w("./_global").Symbol,p=typeof h=="function";(k.exports=function(c){return T[c]||(T[c]=p&&h[c]||(p?h:C)("Symbol."+c))}).store=T},{"./_global":76,"./_shared":117,"./_uid":127}],132:[function(w,k,S){var T=w("./_classof"),C=w("./_wks")("iterator"),h=w("./_iterators");k.exports=w("./_core").getIteratorMethod=function(p){if(p!=null)return p[C]||p["@@iterator"]||h[T(p)]}},{"./_classof":63,"./_core":65,"./_iterators":91,"./_wks":131}],133:[function(w,k,S){"use strict";var T=w("./_ctx"),C=w("./_export"),h=w("./_to-object"),p=w("./_iter-call"),c=w("./_is-array-iter"),l=w("./_to-length"),a=w("./_create-property"),u=w("./core.get-iterator-method");C(C.S+C.F*!w("./_iter-detect")(function(s){Array.from(s)}),"Array",{from:function(s){var f,i,n,t,d=h(s),v=typeof this=="function"?this:Array,g=arguments.length,b=g>1?arguments[1]:void 0,_=b!==void 0,m=0,y=u(d);if(_&&(b=T(b,g>2?arguments[2]:void 0,2)),y==null||v==Array&&c(y))for(f=l(d.length),i=new v(f);f>m;m++)a(i,m,_?b(d[m],m):d[m]);else for(t=y.call(d),i=new v;!(n=t.next()).done;m++)a(i,m,_?p(t,b,[n.value,m],!0):n.value);return i.length=m,i}})},{"./_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(w,k,S){"use strict";var T=w("./_add-to-unscopables"),C=w("./_iter-step"),h=w("./_iterators"),p=w("./_to-iobject");k.exports=w("./_iter-define")(Array,"Array",function(c,l){this._t=p(c),this._i=0,this._k=l},function(){var c=this._t,l=this._k,a=this._i++;return!c||a>=c.length?(this._t=void 0,C(1)):l=="keys"?C(0,a):l=="values"?C(0,c[a]):C(0,[a,c[a]])},"values"),h.Arguments=h.Array,T("keys"),T("values"),T("entries")},{"./_add-to-unscopables":59,"./_iter-define":88,"./_iter-step":90,"./_iterators":91,"./_to-iobject":123}],135:[function(w,k,S){"use strict";var T=w("./_is-object"),C=w("./_object-gpo"),h=w("./_wks")("hasInstance"),p=Function.prototype;h in p||w("./_object-dp").f(p,h,{value:function(c){if(typeof this!="function"||!T(c))return!1;if(!T(this.prototype))return c instanceof this;for(;c=C(c);)if(this.prototype===c)return!0;return!1}})},{"./_is-object":85,"./_object-dp":98,"./_object-gpo":104,"./_wks":131}],136:[function(w,k,S){var T=w("./_export");T(T.S+T.F,"Object",{assign:w("./_object-assign")})},{"./_export":73,"./_object-assign":96}],137:[function(w,k,S){var T=w("./_export");T(T.S,"Object",{create:w("./_object-create")})},{"./_export":73,"./_object-create":97}],138:[function(w,k,S){var T=w("./_export");T(T.S+T.F*!w("./_descriptors"),"Object",{defineProperty:w("./_object-dp").f})},{"./_descriptors":69,"./_export":73,"./_object-dp":98}],139:[function(w,k,S){w("./_object-sap")("getOwnPropertyNames",function(){return w("./_object-gopn-ext").f})},{"./_object-gopn-ext":101,"./_object-sap":108}],140:[function(w,k,S){var T=w("./_to-object"),C=w("./_object-gpo");w("./_object-sap")("getPrototypeOf",function(){return function(h){return C(T(h))}})},{"./_object-gpo":104,"./_object-sap":108,"./_to-object":125}],141:[function(w,k,S){var T=w("./_to-object"),C=w("./_object-keys");w("./_object-sap")("keys",function(){return function(h){return C(T(h))}})},{"./_object-keys":106,"./_object-sap":108,"./_to-object":125}],142:[function(w,k,S){arguments[4][36][0].apply(S,arguments)},{dup:36}],143:[function(w,k,S){"use strict";var T,C,h,p,c=w("./_library"),l=w("./_global"),a=w("./_ctx"),u=w("./_classof"),s=w("./_export"),f=w("./_is-object"),i=w("./_a-function"),n=w("./_an-instance"),t=w("./_for-of"),d=w("./_species-constructor"),v=w("./_task").set,g=w("./_microtask")(),b=w("./_new-promise-capability"),_=w("./_perform"),m=w("./_user-agent"),y=w("./_promise-resolve"),E=l.TypeError,o=l.process,x=o&&o.versions,A=x&&x.v8||"",O=l.Promise,D=u(o)=="process",N=function(){},W=C=b.f,K=!!function(){try{var ue=O.resolve(1),he=(ue.constructor={})[w("./_wks")("species")]=function(Oe){Oe(N,N)};return(D||typeof PromiseRejectionEvent=="function")&&ue.then(N)instanceof he&&A.indexOf("6.6")!==0&&m.indexOf("Chrome/66")===-1}catch(Oe){}}(),oe=function(ue){var he;return!(!f(ue)||typeof(he=ue.then)!="function")&&he},B=function(ue,he){if(!ue._n){ue._n=!0;var Oe=ue._c;g(function(){for(var we=ue._v,Pe=ue._s==1,_e=0;Oe.length>_e;)!function(xe){var Ve,Ne,Be,ze=Pe?xe.ok:xe.fail,ye=xe.resolve,me=xe.reject,We=xe.domain;try{ze?(Pe||(ue._h==2&&ne(ue),ue._h=1),ze===!0?Ve=we:(We&&We.enter(),Ve=ze(we),We&&(We.exit(),Be=!0)),Ve===xe.promise?me(E("Promise-chain cycle")):(Ne=oe(Ve))?Ne.call(Ve,ye,me):ye(Ve)):me(we)}catch(He){We&&!Be&&We.exit(),me(He)}}(Oe[_e++]);ue._c=[],ue._n=!1,he&&!ue._h&&X(ue)})}},X=function(ue){v.call(l,function(){var he,Oe,we,Pe=ue._v,_e=V(ue);if(_e&&(he=_(function(){D?o.emit("unhandledRejection",Pe,ue):(Oe=l.onunhandledrejection)?Oe({promise:ue,reason:Pe}):(we=l.console)&&we.error&&we.error("Unhandled promise rejection",Pe)}),ue._h=D||V(ue)?2:1),ue._a=void 0,_e&&he.e)throw he.v})},V=function(ue){return ue._h!==1&&(ue._a||ue._c).length===0},ne=function(ue){v.call(l,function(){var he;D?o.emit("rejectionHandled",ue):(he=l.onrejectionhandled)&&he({promise:ue,reason:ue._v})})},$=function(ue){var he=this;he._d||(he._d=!0,he=he._w||he,he._v=ue,he._s=2,he._a||(he._a=he._c.slice()),B(he,!0))},Z=function(ue){var he,Oe=this;if(!Oe._d){Oe._d=!0,Oe=Oe._w||Oe;try{if(Oe===ue)throw E("Promise can't be resolved itself");(he=oe(ue))?g(function(){var we={_w:Oe,_d:!1};try{he.call(ue,a(Z,we,1),a($,we,1))}catch(Pe){$.call(we,Pe)}}):(Oe._v=ue,Oe._s=1,B(Oe,!1))}catch(we){$.call({_w:Oe,_d:!1},we)}}};K||(O=function(ue){n(this,O,"Promise","_h"),i(ue),T.call(this);try{ue(a(Z,this,1),a($,this,1))}catch(he){$.call(this,he)}},T=function(ue){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},T.prototype=w("./_redefine-all")(O.prototype,{then:function(ue,he){var Oe=W(d(this,O));return Oe.ok=typeof ue!="function"||ue,Oe.fail=typeof he=="function"&&he,Oe.domain=D?o.domain:void 0,this._c.push(Oe),this._a&&this._a.push(Oe),this._s&&B(this,!1),Oe.promise},catch:function(ue){return this.then(void 0,ue)}}),h=function(){var ue=new T;this.promise=ue,this.resolve=a(Z,ue,1),this.reject=a($,ue,1)},b.f=W=function(ue){return ue===O||ue===p?new h(ue):C(ue)}),s(s.G+s.W+s.F*!K,{Promise:O}),w("./_set-to-string-tag")(O,"Promise"),w("./_set-species")("Promise"),p=w("./_core").Promise,s(s.S+s.F*!K,"Promise",{reject:function(ue){var he=W(this);return(0,he.reject)(ue),he.promise}}),s(s.S+s.F*(c||!K),"Promise",{resolve:function(ue){return y(c&&this===p?O:this,ue)}}),s(s.S+s.F*!(K&&w("./_iter-detect")(function(ue){O.all(ue).catch(N)})),"Promise",{all:function(ue){var he=this,Oe=W(he),we=Oe.resolve,Pe=Oe.reject,_e=_(function(){var xe=[],Ve=0,Ne=1;t(ue,!1,function(Be){var ze=Ve++,ye=!1;xe.push(void 0),Ne++,he.resolve(Be).then(function(me){ye||(ye=!0,xe[ze]=me,--Ne||we(xe))},Pe)}),--Ne||we(xe)});return _e.e&&Pe(_e.v),Oe.promise},race:function(ue){var he=this,Oe=W(he),we=Oe.reject,Pe=_(function(){t(ue,!1,function(_e){he.resolve(_e).then(Oe.resolve,we)})});return Pe.e&&we(Pe.v),Oe.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(w,k,S){var T=w("./_export"),C=w("./_to-absolute-index"),h=String.fromCharCode,p=String.fromCodePoint;T(T.S+T.F*(!!p&&p.length!=1),"String",{fromCodePoint:function(c){for(var l,a=[],u=arguments.length,s=0;u>s;){if(l=+arguments[s++],C(l,1114111)!==l)throw RangeError(l+" is not a valid code point");a.push(l<65536?h(l):h(55296+((l-=65536)>>10),l%1024+56320))}return a.join("")}})},{"./_export":73,"./_to-absolute-index":121}],145:[function(w,k,S){"use strict";var T=w("./_string-at")(!0);w("./_iter-define")(String,"String",function(C){this._t=String(C),this._i=0},function(){var C,h=this._t,p=this._i;return p>=h.length?{value:void 0,done:!0}:(C=T(h,p),this._i+=C.length,{value:C,done:!1})})},{"./_iter-define":88,"./_string-at":119}],146:[function(w,k,S){"use strict";var T=w("./_global"),C=w("./_has"),h=w("./_descriptors"),p=w("./_export"),c=w("./_redefine"),l=w("./_meta").KEY,a=w("./_fails"),u=w("./_shared"),s=w("./_set-to-string-tag"),f=w("./_uid"),i=w("./_wks"),n=w("./_wks-ext"),t=w("./_wks-define"),d=w("./_enum-keys"),v=w("./_is-array"),g=w("./_an-object"),b=w("./_is-object"),_=w("./_to-iobject"),m=w("./_to-primitive"),y=w("./_property-desc"),E=w("./_object-create"),o=w("./_object-gopn-ext"),x=w("./_object-gopd"),A=w("./_object-dp"),O=w("./_object-keys"),D=x.f,N=A.f,W=o.f,K=T.Symbol,oe=T.JSON,B=oe&&oe.stringify,X=i("_hidden"),V=i("toPrimitive"),ne={}.propertyIsEnumerable,$=u("symbol-registry"),Z=u("symbols"),ue=u("op-symbols"),he=Object.prototype,Oe=typeof K=="function",we=T.QObject,Pe=!we||!we.prototype||!we.prototype.findChild,_e=h&&a(function(){return E(N({},"a",{get:function(){return N(this,"a",{value:7}).a}})).a!=7})?function(q,Y,J){var Ee=D(he,Y);Ee&&delete he[Y],N(q,Y,J),Ee&&q!==he&&N(he,Y,Ee)}:N,xe=function(q){var Y=Z[q]=E(K.prototype);return Y._k=q,Y},Ve=Oe&&typeof K.iterator=="symbol"?function(q){return typeof q=="symbol"}:function(q){return q instanceof K},Ne=function(q,Y,J){return q===he&&Ne(ue,Y,J),g(q),Y=m(Y,!0),g(J),C(Z,Y)?(J.enumerable?(C(q,X)&&q[X][Y]&&(q[X][Y]=!1),J=E(J,{enumerable:y(0,!1)})):(C(q,X)||N(q,X,y(1,{})),q[X][Y]=!0),_e(q,Y,J)):N(q,Y,J)},Be=function(q,Y){g(q);for(var J,Ee=d(Y=_(Y)),ke=0,ht=Ee.length;ht>ke;)Ne(q,J=Ee[ke++],Y[J]);return q},ze=function(q,Y){return Y===void 0?E(q):Be(E(q),Y)},ye=function(q){var Y=ne.call(this,q=m(q,!0));return!(this===he&&C(Z,q)&&!C(ue,q))&&(!(Y||!C(this,q)||!C(Z,q)||C(this,X)&&this[X][q])||Y)},me=function(q,Y){if(q=_(q),Y=m(Y,!0),q!==he||!C(Z,Y)||C(ue,Y)){var J=D(q,Y);return!J||!C(Z,Y)||C(q,X)&&q[X][Y]||(J.enumerable=!0),J}},We=function(q){for(var Y,J=W(_(q)),Ee=[],ke=0;J.length>ke;)C(Z,Y=J[ke++])||Y==X||Y==l||Ee.push(Y);return Ee},He=function(q){for(var Y,J=q===he,Ee=W(J?ue:_(q)),ke=[],ht=0;Ee.length>ht;)!C(Z,Y=Ee[ht++])||J&&!C(he,Y)||ke.push(Z[Y]);return ke};Oe||(K=function(){if(this instanceof K)throw TypeError("Symbol is not a constructor!");var q=f(arguments.length>0?arguments[0]:void 0),Y=function(J){this===he&&Y.call(ue,J),C(this,X)&&C(this[X],q)&&(this[X][q]=!1),_e(this,q,y(1,J))};return h&&Pe&&_e(he,q,{configurable:!0,set:Y}),xe(q)},c(K.prototype,"toString",function(){return this._k}),x.f=me,A.f=Ne,w("./_object-gopn").f=o.f=We,w("./_object-pie").f=ye,w("./_object-gops").f=He,h&&!w("./_library")&&c(he,"propertyIsEnumerable",ye,!0),n.f=function(q){return xe(i(q))}),p(p.G+p.W+p.F*!Oe,{Symbol:K});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),te=0;nt.length>te;)i(nt[te++]);for(var P=O(i.store),U=0;P.length>U;)t(P[U++]);p(p.S+p.F*!Oe,"Symbol",{for:function(q){return C($,q+="")?$[q]:$[q]=K(q)},keyFor:function(q){if(!Ve(q))throw TypeError(q+" is not a symbol!");for(var Y in $)if($[Y]===q)return Y},useSetter:function(){Pe=!0},useSimple:function(){Pe=!1}}),p(p.S+p.F*!Oe,"Object",{create:ze,defineProperty:Ne,defineProperties:Be,getOwnPropertyDescriptor:me,getOwnPropertyNames:We,getOwnPropertySymbols:He}),oe&&p(p.S+p.F*(!Oe||a(function(){var q=K();return B([q])!="[null]"||B({a:q})!="{}"||B(Object(q))!="{}"})),"JSON",{stringify:function(q){for(var Y,J,Ee=[q],ke=1;arguments.length>ke;)Ee.push(arguments[ke++]);if(J=Y=Ee[1],(b(Y)||q!==void 0)&&!Ve(q))return v(Y)||(Y=function(ht,Ue){if(typeof J=="function"&&(Ue=J.call(this,ht,Ue)),!Ve(Ue))return Ue}),Ee[1]=Y,B.apply(oe,Ee)}}),K.prototype[V]||w("./_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(w,k,S){"use strict";var T=w("./_export"),C=w("./_core"),h=w("./_global"),p=w("./_species-constructor"),c=w("./_promise-resolve");T(T.P+T.R,"Promise",{finally:function(l){var a=p(this,C.Promise||h.Promise),u=typeof l=="function";return this.then(u?function(s){return c(a,l()).then(function(){return s})}:l,u?function(s){return c(a,l()).then(function(){throw s})}:l)}})},{"./_core":65,"./_export":73,"./_global":76,"./_promise-resolve":110,"./_species-constructor":118}],148:[function(w,k,S){"use strict";var T=w("./_export"),C=w("./_new-promise-capability"),h=w("./_perform");T(T.S,"Promise",{try:function(p){var c=C.f(this),l=h(p);return(l.e?c.reject:c.resolve)(l.v),c.promise}})},{"./_export":73,"./_new-promise-capability":95,"./_perform":109}],149:[function(w,k,S){w("./_wks-define")("asyncIterator")},{"./_wks-define":129}],150:[function(w,k,S){w("./_wks-define")("observable")},{"./_wks-define":129}],151:[function(w,k,S){w("./es6.array.iterator");for(var T=w("./_global"),C=w("./_hide"),h=w("./_iterators"),p=w("./_wks")("toStringTag"),c="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(","),l=0;l<c.length;l++){var a=c[l],u=T[a],s=u&&u.prototype;s&&!s[p]&&C(s,p,a),h[a]=h.Array}},{"./_global":76,"./_hide":78,"./_iterators":91,"./_wks":131,"./es6.array.iterator":134}],152:[function(w,k,S){var T=w("./_export"),C=w("./_task");T(T.G+T.B,{setImmediate:C.set,clearImmediate:C.clear})},{"./_export":73,"./_task":120}],153:[function(w,k,S){(function(T){"use strict";function C(m){return Array.isArray?Array.isArray(m):g(m)==="[object Array]"}function h(m){return typeof m=="boolean"}function p(m){return m===null}function c(m){return m==null}function l(m){return typeof m=="number"}function a(m){return typeof m=="string"}function u(m){return(m===void 0?"undefined":(0,_.default)(m))==="symbol"}function s(m){return m===void 0}function f(m){return g(m)==="[object RegExp]"}function i(m){return(m===void 0?"undefined":(0,_.default)(m))==="object"&&m!==null}function n(m){return g(m)==="[object Date]"}function t(m){return g(m)==="[object Error]"||m instanceof Error}function d(m){return typeof m=="function"}function v(m){return m===null||typeof m=="boolean"||typeof m=="number"||typeof m=="string"||(m===void 0?"undefined":(0,_.default)(m))==="symbol"||m===void 0}function g(m){return Object.prototype.toString.call(m)}var b=w("babel-runtime/helpers/typeof"),_=function(m){return m&&m.__esModule?m:{default:m}}(b);S.isArray=C,S.isBoolean=h,S.isNull=p,S.isNullOrUndefined=c,S.isNumber=l,S.isString=a,S.isSymbol=u,S.isUndefined=s,S.isRegExp=f,S.isObject=i,S.isDate=n,S.isError=t,S.isFunction=d,S.isPrimitive=v,S.isBuffer=T.isBuffer}).call(this,{isBuffer:w("../../is-buffer/index.js")})},{"../../is-buffer/index.js":163,"babel-runtime/helpers/typeof":32}],154:[function(w,k,S){"use strict";var T=w("babel-runtime/helpers/typeof"),C=function(h){return h&&h.__esModule?h:{default:h}}(T);!function(h){function p(s,f){for(s=String(s),f=f||2;s.length<f;)s="0"+s;return s}function c(s){var f=new Date(s.getFullYear(),s.getMonth(),s.getDate());f.setDate(f.getDate()-(f.getDay()+6)%7+3);var i=new Date(f.getFullYear(),0,4);i.setDate(i.getDate()-(i.getDay()+6)%7+3);var n=f.getTimezoneOffset()-i.getTimezoneOffset();f.setHours(f.getHours()-n);var t=(f-i)/6048e5;return 1+Math.floor(t)}function l(s){var f=s.getDay();return f===0&&(f=7),f}function a(s){return s===null?"null":s===void 0?"undefined":(s===void 0?"undefined":(0,C.default)(s))!=="object"?s===void 0?"undefined":(0,C.default)(s):Array.isArray(s)?"array":{}.toString.call(s).slice(8,-1).toLowerCase()}var u=function(){var s=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,f=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,i=/[^-+\dA-Z]/g;return function(n,t,d,v){if(arguments.length!==1||a(n)!=="string"||/\d/.test(n)||(t=n,n=void 0),n=n||new Date,n instanceof Date||(n=new Date(n)),isNaN(n))throw TypeError("Invalid date");t=String(u.masks[t]||t||u.masks.default);var g=t.slice(0,4);g!=="UTC:"&&g!=="GMT:"||(t=t.slice(4),d=!0,g==="GMT:"&&(v=!0));var b=d?"getUTC":"get",_=n[b+"Date"](),m=n[b+"Day"](),y=n[b+"Month"](),E=n[b+"FullYear"](),o=n[b+"Hours"](),x=n[b+"Minutes"](),A=n[b+"Seconds"](),O=n[b+"Milliseconds"](),D=d?0:n.getTimezoneOffset(),N=c(n),W=l(n),K={d:_,dd:p(_),ddd:u.i18n.dayNames[m],dddd:u.i18n.dayNames[m+7],m:y+1,mm:p(y+1),mmm:u.i18n.monthNames[y],mmmm:u.i18n.monthNames[y+12],yy:String(E).slice(2),yyyy:E,h:o%12||12,hh:p(o%12||12),H:o,HH:p(o),M:x,MM:p(x),s:A,ss:p(A),l:p(O,3),L:p(Math.round(O/10)),t:o<12?"a":"p",tt:o<12?"am":"pm",T:o<12?"A":"P",TT:o<12?"AM":"PM",Z:v?"GMT":d?"UTC":(String(n).match(f)||[""]).pop().replace(i,""),o:(D>0?"-":"+")+p(100*Math.floor(Math.abs(D)/60)+Math.abs(D)%60,4),S:["th","st","nd","rd"][_%10>3?0:(_%100-_%10!=10)*_%10],W:N,N:W};return t.replace(s,function(oe){return oe in K?K[oe]:oe.slice(1,oe.length-1)})}}();u.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"},u.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 u}):(S===void 0?"undefined":(0,C.default)(S))==="object"?k.exports=u:h.dateFormat=u}(void 0)},{"babel-runtime/helpers/typeof":32}],155:[function(w,k,S){(function(T){function C(){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 h(a){var u=this.useColors;if(a[0]=(u?"%c":"")+this.namespace+(u?" %c":" ")+a[0]+(u?"%c ":" ")+"+"+S.humanize(this.diff),u){var s="color: "+this.color;a.splice(1,0,s,"color: inherit");var f=0,i=0;a[0].replace(/%[a-zA-Z%]/g,function(n){n!=="%%"&&(f++,n==="%c"&&(i=f))}),a.splice(i,0,s)}}function p(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function c(a){try{a==null?S.storage.removeItem("debug"):S.storage.debug=a}catch(u){}}function l(){var a;try{a=S.storage.debug}catch(u){}return!a&&T!==void 0&&"env"in T&&(a=T.env.DEBUG),a}S=k.exports=w("./debug"),S.log=p,S.formatArgs=h,S.save=c,S.load=l,S.useColors=C,S.storage=typeof chrome!="undefined"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch(a){}}(),S.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],S.formatters.j=function(a){try{return JSON.stringify(a)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}},S.enable(l())}).call(this,w("_process"))},{"./debug":156,_process:173}],156:[function(w,k,S){function T(u){var s,f=0;for(s in u)f=(f<<5)-f+u.charCodeAt(s),f|=0;return S.colors[Math.abs(f)%S.colors.length]}function C(u){function s(){if(s.enabled){var f=s,i=+new Date,n=i-(a||i);f.diff=n,f.prev=a,f.curr=i,a=i;for(var t=new Array(arguments.length),d=0;d<t.length;d++)t[d]=arguments[d];t[0]=S.coerce(t[0]),typeof t[0]!="string"&&t.unshift("%O");var v=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,function(g,b){if(g==="%%")return g;v++;var _=S.formatters[b];if(typeof _=="function"){var m=t[v];g=_.call(f,m),t.splice(v,1),v--}return g}),S.formatArgs.call(f,t),(s.log||S.log||console.log.bind(console)).apply(f,t)}}return s.namespace=u,s.enabled=S.enabled(u),s.useColors=S.useColors(),s.color=T(u),typeof S.init=="function"&&S.init(s),s}function h(u){S.save(u),S.names=[],S.skips=[];for(var s=(typeof u=="string"?u:"").split(/[\s,]+/),f=s.length,i=0;i<f;i++)s[i]&&(u=s[i].replace(/\*/g,".*?"),u[0]==="-"?S.skips.push(new RegExp("^"+u.substr(1)+"$")):S.names.push(new RegExp("^"+u+"$")))}function p(){S.enable("")}function c(u){var s,f;for(s=0,f=S.skips.length;s<f;s++)if(S.skips[s].test(u))return!1;for(s=0,f=S.names.length;s<f;s++)if(S.names[s].test(u))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}S=k.exports=C.debug=C.default=C,S.coerce=l,S.disable=p,S.enable=h,S.enabled=c,S.humanize=w("ms"),S.names=[],S.skips=[],S.formatters={};var a},{ms:169}],157:[function(w,k,S){"use strict";function T(h){var p=""+h,c=C.exec(p);if(!c)return p;var l,a="",u=0,s=0;for(u=c.index;u<p.length;u++){switch(p.charCodeAt(u)){case 34:l=""";break;case 38:l="&";break;case 39:l="'";break;case 60:l="<";break;case 62:l=">";break;default:continue}s!==u&&(a+=p.substring(s,u)),s=u+1,a+=l}return s!==u?a+p.substring(s,u):a}var C=/["'&<>]/;k.exports=T},{}],158:[function(w,k,S){function T(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function C(l){return typeof l=="function"}function h(l){return typeof l=="number"}function p(l){return typeof l=="object"&&l!==null}function c(l){return l===void 0}k.exports=T,T.EventEmitter=T,T.prototype._events=void 0,T.prototype._maxListeners=void 0,T.defaultMaxListeners=10,T.prototype.setMaxListeners=function(l){if(!h(l)||l<0||isNaN(l))throw TypeError("n must be a positive number");return this._maxListeners=l,this},T.prototype.emit=function(l){var a,u,s,f,i,n;if(this._events||(this._events={}),l==="error"&&(!this._events.error||p(this._events.error)&&!this._events.error.length)){if((a=arguments[1])instanceof Error)throw a;var t=new Error('Uncaught, unspecified "error" event. ('+a+")");throw t.context=a,t}if(u=this._events[l],c(u))return!1;if(C(u))switch(arguments.length){case 1:u.call(this);break;case 2:u.call(this,arguments[1]);break;case 3:u.call(this,arguments[1],arguments[2]);break;default:f=Array.prototype.slice.call(arguments,1),u.apply(this,f)}else if(p(u))for(f=Array.prototype.slice.call(arguments,1),n=u.slice(),s=n.length,i=0;i<s;i++)n[i].apply(this,f);return!0},T.prototype.addListener=function(l,a){var u;if(!C(a))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",l,C(a.listener)?a.listener:a),this._events[l]?p(this._events[l])?this._events[l].push(a):this._events[l]=[this._events[l],a]:this._events[l]=a,p(this._events[l])&&!this._events[l].warned&&(u=c(this._maxListeners)?T.defaultMaxListeners:this._maxListeners)&&u>0&&this._events[l].length>u&&(this._events[l].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[l].length),typeof console.trace=="function"&&console.trace()),this},T.prototype.on=T.prototype.addListener,T.prototype.once=function(l,a){function u(){this.removeListener(l,u),s||(s=!0,a.apply(this,arguments))}if(!C(a))throw TypeError("listener must be a function");var s=!1;return u.listener=a,this.on(l,u),this},T.prototype.removeListener=function(l,a){var u,s,f,i;if(!C(a))throw TypeError("listener must be a function");if(!this._events||!this._events[l])return this;if(u=this._events[l],f=u.length,s=-1,u===a||C(u.listener)&&u.listener===a)delete this._events[l],this._events.removeListener&&this.emit("removeListener",l,a);else if(p(u)){for(i=f;i-- >0;)if(u[i]===a||u[i].listener&&u[i].listener===a){s=i;break}if(s<0)return this;u.length===1?(u.length=0,delete this._events[l]):u.splice(s,1),this._events.removeListener&&this.emit("removeListener",l,a)}return this},T.prototype.removeAllListeners=function(l){var a,u;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[l]&&delete this._events[l],this;if(arguments.length===0){for(a in this._events)a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events={},this}if(u=this._events[l],C(u))this.removeListener(l,u);else if(u)for(;u.length;)this.removeListener(l,u[u.length-1]);return delete this._events[l],this},T.prototype.listeners=function(l){return this._events&&this._events[l]?C(this._events[l])?[this._events[l]]:this._events[l].slice():[]},T.prototype.listenerCount=function(l){if(this._events){var a=this._events[l];if(C(a))return 1;if(a)return a.length}return 0},T.listenerCount=function(l,a){return l.listenerCount(a)}},{}],159:[function(w,k,S){var T=w("http"),C=k.exports;for(var h in T)T.hasOwnProperty(h)&&(C[h]=T[h]);C.request=function(p,c){return p||(p={}),p.scheme="https",p.protocol="https:",T.request.call(this,p,c)}},{http:196}],160:[function(w,k,S){"use strict";var T=w("util"),C=w("ms");k.exports=function(h){if(typeof h=="number")return h;var p=C(h);if(p===void 0){var c=new Error(T.format("humanize-ms(%j) result undefined",h));console.warn(c.stack)}return p}},{ms:169,util:207}],161:[function(w,k,S){S.read=function(T,C,h,p,c){var l,a,u=8*c-p-1,s=(1<<u)-1,f=s>>1,i=-7,n=h?c-1:0,t=h?-1:1,d=T[C+n];for(n+=t,l=d&(1<<-i)-1,d>>=-i,i+=u;i>0;l=256*l+T[C+n],n+=t,i-=8);for(a=l&(1<<-i)-1,l>>=-i,i+=p;i>0;a=256*a+T[C+n],n+=t,i-=8);if(l===0)l=1-f;else{if(l===s)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,p),l-=f}return(d?-1:1)*a*Math.pow(2,l-p)},S.write=function(T,C,h,p,c,l){var a,u,s,f=8*l-c-1,i=(1<<f)-1,n=i>>1,t=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=p?0:l-1,v=p?1:-1,g=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(u=isNaN(C)?1:0,a=i):(a=Math.floor(Math.log(C)/Math.LN2),C*(s=Math.pow(2,-a))<1&&(a--,s*=2),C+=a+n>=1?t/s:t*Math.pow(2,1-n),C*s>=2&&(a++,s/=2),a+n>=i?(u=0,a=i):a+n>=1?(u=(C*s-1)*Math.pow(2,c),a+=n):(u=C*Math.pow(2,n-1)*Math.pow(2,c),a=0));c>=8;T[h+d]=255&u,d+=v,u/=256,c-=8);for(a=a<<c|u,f+=c;f>0;T[h+d]=255&a,d+=v,a/=256,f-=8);T[h+d-v]|=128*g}},{}],162:[function(w,k,S){typeof Object.create=="function"?k.exports=function(T,C){T.super_=C,T.prototype=Object.create(C.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}})}:k.exports=function(T,C){T.super_=C;var h=function(){};h.prototype=C.prototype,T.prototype=new h,T.prototype.constructor=T}},{}],163:[function(w,k,S){function T(h){return!!h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h)}function C(h){return typeof h.readFloatLE=="function"&&typeof h.slice=="function"&&T(h.slice(0,0))}k.exports=function(h){return h!=null&&(T(h)||C(h)||!!h._isBuffer)}},{}],164:[function(w,k,S){!function(T){function C(c){return p.call(c).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}function h(c){return typeof c=="function"&&(/^class(\s|\{\}$)/.test(p.call(c))||/^.*classCallCheck\(/.test(C(c)))}var p=Function.prototype.toString;S!==void 0?(k!==void 0&&k.exports&&(S=k.exports=h),S.isClass=h):typeof j=="function"&&j.amd?j([],function(){return h}):T.isClass=h}(this)},{}],165:[function(w,k,S){"use strict";function T(l){var a=l.slice(2);return a=a[0].toLowerCase()+a.slice(1)}var C=w("core-util-is"),h=w("isstream"),p=w("is-class");Object.keys(C).map(function(l){S[T(l)]=C[l]}),S.stream=h,S.readableStream=h.isReadable,S.writableStream=h.isWritable,S.duplexStream=h.isDuplex,S.class=p,S.finite=function(l){return Number.isFinite(l)},S.NaN=function(l){return Number.isNaN(l)},S.generator=function(l){return l&&typeof l.next=="function"&&typeof l.throw=="function"},S.generatorFunction=function(l){return l&&l.constructor&&l.constructor.name==="GeneratorFunction"},S.asyncFunction=function(l){return l&&l.constructor&&l.constructor.name==="AsyncFunction"},S.promise=function(l){return l&&typeof l.then=="function"};var c=Math.pow(2,31);S.int=function(l){return C.isNumber(l)&&l%1==0},S.int32=function(l){return S.int(l)&&l<c&&l>=-c},S.long=function(l){return S.int(l)&&(l>=c||l<-c)},S.Long=function(l){return S.object(l)&&S.number(l.high)&&S.number(l.low)},S.double=function(l){return C.isNumber(l)&&!isNaN(l)&&l%1!=0},S.date=function(l){return l instanceof Date},S.regExp=function(l){return l instanceof RegExp},S.regexp=S.regExp,S.error=function(l){return l instanceof Error},S.array=function(l){return Array.isArray(l)}},{"core-util-is":153,"is-class":164,isstream:167}],166:[function(w,k,S){var T={}.toString;k.exports=Array.isArray||function(C){return T.call(C)=="[object Array]"}},{}],167:[function(w,k,S){function T(l){return l instanceof c.Stream}function C(l){return T(l)&&typeof l._read=="function"&&typeof l._readableState=="object"}function h(l){return T(l)&&typeof l._write=="function"&&typeof l._writableState=="object"}function p(l){return C(l)&&h(l)}var c=w("stream");k.exports=T,k.exports.isReadable=C,k.exports.isWritable=h,k.exports.isDuplex=p},{stream:195}],168:[function(w,k,S){"use strict";function T(h,p,c){if(!h)throw new TypeError("argument dest is required");if(!p)throw new TypeError("argument src is required");return c===void 0&&(c=!0),Object.getOwnPropertyNames(p).forEach(function(l){if(c||!C.call(h,l)){var a=Object.getOwnPropertyDescriptor(p,l);Object.defineProperty(h,l,a)}}),h}k.exports=T;var C=Object.prototype.hasOwnProperty},{}],169:[function(w,k,S){function T(f){if(f=String(f),!(f.length>100)){var i=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(f);if(i){var n=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*s;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"hrs":case"hr":case"h":return n*a;case"minutes":case"minute":case"mins":case"min":case"m":return n*l;case"seconds":case"second":case"secs":case"sec":case"s":return n*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function C(f){return f>=u?Math.round(f/u)+"d":f>=a?Math.round(f/a)+"h":f>=l?Math.round(f/l)+"m":f>=c?Math.round(f/c)+"s":f+"ms"}function h(f){return p(f,u,"day")||p(f,a,"hour")||p(f,l,"minute")||p(f,c,"second")||f+" ms"}function p(f,i,n){if(!(f<i))return f<1.5*i?Math.floor(f/i)+" "+n:Math.ceil(f/i)+" "+n+"s"}var c=1e3,l=60*c,a=60*l,u=24*a,s=365.25*u;k.exports=function(f,i){i=i||{};var n=typeof f;if(n==="string"&&f.length>0)return T(f);if(n==="number"&&isNaN(f)===!1)return i.long?h(f):C(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))}},{}],170:[function(w,k,S){(function(T){function C(l,a){for(var u=0,s=l.length-1;s>=0;s--){var f=l[s];f==="."?l.splice(s,1):f===".."?(l.splice(s,1),u++):u&&(l.splice(s,1),u--)}if(a)for(;u--;u)l.unshift("..");return l}function h(l){typeof l!="string"&&(l+="");var a,u=0,s=-1,f=!0;for(a=l.length-1;a>=0;--a)if(l.charCodeAt(a)===47){if(!f){u=a+1;break}}else s===-1&&(f=!1,s=a+1);return s===-1?"":l.slice(u,s)}function p(l,a){if(l.filter)return l.filter(a);for(var u=[],s=0;s<l.length;s++)a(l[s],s,l)&&u.push(l[s]);return u}S.resolve=function(){for(var l="",a=!1,u=arguments.length-1;u>=-1&&!a;u--){var s=u>=0?arguments[u]:T.cwd();if(typeof s!="string")throw new TypeError("Arguments to path.resolve must be strings");s&&(l=s+"/"+l,a=s.charAt(0)==="/")}return l=C(p(l.split("/"),function(f){return!!f}),!a).join("/"),(a?"/":"")+l||"."},S.normalize=function(l){var a=S.isAbsolute(l),u=c(l,-1)==="/";return l=C(p(l.split("/"),function(s){return!!s}),!a).join("/"),l||a||(l="."),l&&u&&(l+="/"),(a?"/":"")+l},S.isAbsolute=function(l){return l.charAt(0)==="/"},S.join=function(){var l=Array.prototype.slice.call(arguments,0);return S.normalize(p(l,function(a,u){if(typeof a!="string")throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},S.relative=function(l,a){function u(v){for(var g=0;g<v.length&&v[g]==="";g++);for(var b=v.length-1;b>=0&&v[b]==="";b--);return g>b?[]:v.slice(g,b-g+1)}l=S.resolve(l).substr(1),a=S.resolve(a).substr(1);for(var s=u(l.split("/")),f=u(a.split("/")),i=Math.min(s.length,f.length),n=i,t=0;t<i;t++)if(s[t]!==f[t]){n=t;break}for(var d=[],t=n;t<s.length;t++)d.push("..");return d=d.concat(f.slice(n)),d.join("/")},S.sep="/",S.delimiter=":",S.dirname=function(l){if(typeof l!="string"&&(l+=""),l.length===0)return".";for(var a=l.charCodeAt(0),u=a===47,s=-1,f=!0,i=l.length-1;i>=1;--i)if((a=l.charCodeAt(i))===47){if(!f){s=i;break}}else f=!1;return s===-1?u?"/":".":u&&s===1?"/":l.slice(0,s)},S.basename=function(l,a){var u=h(l);return a&&u.substr(-1*a.length)===a&&(u=u.substr(0,u.length-a.length)),u},S.extname=function(l){typeof l!="string"&&(l+="");for(var a=-1,u=0,s=-1,f=!0,i=0,n=l.length-1;n>=0;--n){var t=l.charCodeAt(n);if(t!==47)s===-1&&(f=!1,s=n+1),t===46?a===-1?a=n:i!==1&&(i=1):a!==-1&&(i=-1);else if(!f){u=n+1;break}}return a===-1||s===-1||i===0||i===1&&a===s-1&&a===u+1?"":l.slice(a,s)};var c="ab".substr(-1)==="b"?function(l,a,u){return l.substr(a,u)}:function(l,a,u){return a<0&&(a=l.length+a),l.substr(a,u)}}).call(this,w("_process"))},{_process:173}],171:[function(w,k,S){(function(T){(function(){"use strict";function C(A){return A=String(A),A.charAt(0).toUpperCase()+A.slice(1)}function h(A,O,D){var N={"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 O&&D&&/^Win/i.test(A)&&!/^Windows Phone /i.test(A)&&(N=N[/[\d.]+$/.exec(A)])&&(A="Windows "+N),A=String(A),O&&D&&(A=A.replace(RegExp(O,"i"),D)),A=c(A.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(A,O){var D=-1,N=A?A.length:0;if(typeof N=="number"&&N>-1&&N<=_)for(;++D<N;)O(A[D],D,A);else l(A,O)}function c(A){return A=i(A),/^(?:webOS|i(?:OS|P))/.test(A)?A:C(A)}function l(A,O){for(var D in A)E.call(A,D)&&O(A[D],D,A)}function a(A){return A==null?C(A):o.call(A).slice(8,-1)}function u(A,O){var D=A!=null?typeof A[O]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(D)||D=="object"&&!A[O])}function s(A){return String(A).replace(/([ -])(?!$)/g,"$1?")}function f(A,O){var D=null;return p(A,function(N,W){D=O(D,N,W,A)}),D}function i(A){return String(A).replace(/^ +| +$/g,"")}function n(A){function O(q){return f(q,function(Y,J){var Ee=J.pattern||s(J);return!Y&&(Y=RegExp("\\b"+Ee+" *\\d+[.\\w_]*","i").exec(A)||RegExp("\\b"+Ee+" *\\w+-[\\w]*","i").exec(A)||RegExp("\\b"+Ee+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(A))&&((Y=String(J.label&&!RegExp(Ee,"i").test(J.label)?J.label:Y).split("/"))[1]&&!/[\d.]+/.test(Y[0])&&(Y[0]+=" "+Y[1]),J=J.label||J,Y=c(Y[0].replace(RegExp(Ee,"i"),J).replace(RegExp("; *(?:"+J+"[_-])?","i")," ").replace(RegExp("("+J+")[-_.]?(\\w)","i"),"$1 $2"))),Y})}function D(){return this.description||""}var N=d,W=A&&typeof A=="object"&&a(A)!="String";W&&(N=A,A=null);var K=N.navigator||{},oe=K.userAgent||"";A||(A=oe);var B,X,V=W?!!K.likeChrome:/\bChrome\b/.test(A)&&!/internal|\n/i.test(o.toString()),ne=W?"Object":"ScriptBridgingProxyObject",$=W?"Object":"Environment",Z=W&&N.java?"JavaPackage":a(N.java),ue=W?"Object":"RuntimeObject",he=/\bJava/.test(Z)&&N.java,Oe=he&&a(N.environment)==$,we=he?"a":"\u4F2A",Pe=he?"b":"\u5C3E",_e=N.document||{},xe=N.operamini||N.opera,Ve=m.test(Ve=W&&xe?xe["[[Class]]"]:a(xe))?Ve:xe=null,Ne=A,Be=[],ze=null,ye=A==oe,me=ye&&xe&&typeof xe.version=="function"&&xe.version(),We=function(q){return f(q,function(Y,J){return Y||RegExp("\\b"+(J.pattern||s(J))+"\\b","i").exec(A)&&(J.label||J)})}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),He=function(q){return f(q,function(Y,J){return Y||RegExp("\\b"+(J.pattern||s(J))+"\\b","i").exec(A)&&(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"]),nt=O([{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"]),te=function(q){return f(q,function(Y,J,Ee){return Y||(J[nt]||J[/^[a-z]+(?: +[a-z]+\b)*/i.exec(nt)]||RegExp("\\b"+s(Ee)+"(?:\\b|\\w*\\d)","i").exec(A))&&Ee})}({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}}),P=function(q){return f(q,function(Y,J){var Ee=J.pattern||s(J);return!Y&&(Y=RegExp("\\b"+Ee+"(?:/[\\d.]+|[ \\w.]*)","i").exec(A))&&(Y=h(Y,Ee,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(We&&(We=[We]),te&&!nt&&(nt=O([te])),(B=/\bGoogle TV\b/.exec(nt))&&(nt=B[0]),/\bSimulator\b/i.test(A)&&(nt=(nt?nt+" ":"")+"Simulator"),He=="Opera Mini"&&/\bOPiOS\b/.test(A)&&Be.push("running in Turbo/Uncompressed mode"),He=="IE"&&/\blike iPhone OS\b/.test(A)?(B=n(A.replace(/like iPhone OS/,"")),te=B.manufacturer,nt=B.product):/^iP/.test(nt)?(He||(He="Safari"),P="iOS"+((B=/ OS ([\d_]+)/i.exec(A))?" "+B[1].replace(/_/g,"."):"")):He!="Konqueror"||/buntu/i.test(P)?te&&te!="Google"&&(/Chrome/.test(He)&&!/\bMobile Safari\b/i.test(A)||/\bVita\b/.test(nt))||/\bAndroid\b/.test(P)&&/^Chrome/.test(He)&&/\bVersion\//i.test(A)?(He="Android Browser",P=/\bAndroid\b/.test(P)?P:"Android"):He=="Silk"?(/\bMobi/i.test(A)||(P="Android",Be.unshift("desktop mode")),/Accelerated *= *true/i.test(A)&&Be.unshift("accelerated")):He=="PaleMoon"&&(B=/\bFirefox\/([\d.]+)\b/.exec(A))?Be.push("identifying as Firefox "+B[1]):He=="Firefox"&&(B=/\b(Mobile|Tablet|TV)\b/i.exec(A))?(P||(P="Firefox OS"),nt||(nt=B[1])):!He||(B=!/\bMinefield\b/i.test(A)&&/\b(?:Firefox|Safari)\b/.exec(He))?(He&&!nt&&/[\/,]|^[^(]+?\)/.test(A.slice(A.indexOf(B+"/")+8))&&(He=null),(B=nt||te||P)&&(nt||te||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(P))&&(He=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(P)?P:B)+" Browser")):He=="Electron"&&(B=(/\bChrome\/([\d.]+)\b/.exec(A)||0)[1])&&Be.push("Chromium "+B):P="Kubuntu",me||(me=function(q){return f(q,function(Y,J){return Y||(RegExp(J+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(A)||0)[1]||null})}(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",s(He),"(?:Firefox|Minefield|NetFront)"])),(B=We=="iCab"&&parseFloat(me)>3&&"WebKit"||/\bOpera\b/.test(He)&&(/\bOPR\b/.test(A)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(A)&&!/^(?:Trident|EdgeHTML)$/.test(We)&&"WebKit"||!We&&/\bMSIE\b/i.test(A)&&(P=="Mac OS"?"Tasman":"Trident")||We=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(He)&&"NetFront")&&(We=[B]),He=="IE"&&(B=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(A)||0)[1])?(He+=" Mobile",P="Windows Phone "+(/\+$/.test(B)?B:B+".x"),Be.unshift("desktop mode")):/\bWPDesktop\b/i.test(A)?(He="IE Mobile",P="Windows Phone 8.x",Be.unshift("desktop mode"),me||(me=(/\brv:([\d.]+)/.exec(A)||0)[1])):He!="IE"&&We=="Trident"&&(B=/\brv:([\d.]+)/.exec(A))&&(He&&Be.push("identifying as "+He+(me?" "+me:"")),He="IE",me=B[1]),ye){if(u(N,"global"))if(he&&(B=he.lang.System,Ne=B.getProperty("os.arch"),P=P||B.getProperty("os.name")+" "+B.getProperty("os.version")),Oe){try{me=N.require("ringo/engine").version.join("."),He="RingoJS"}catch(q){(B=N.system)&&B.global.system==N.system&&(He="Narwhal",P||(P=B[0].os||null))}He||(He="Rhino")}else typeof N.process=="object"&&!N.process.browser&&(B=N.process)&&(typeof B.versions=="object"&&(typeof B.versions.electron=="string"?(Be.push("Node "+B.versions.node),He="Electron",me=B.versions.electron):typeof B.versions.nw=="string"&&(Be.push("Chromium "+me,"Node "+B.versions.node),He="NW.js",me=B.versions.nw)),He||(He="Node.js",Ne=B.arch,P=B.platform,me=/[\d.]+/.exec(B.version),me=me?me[0]:null));else a(B=N.runtime)==ne?(He="Adobe AIR",P=B.flash.system.Capabilities.os):a(B=N.phantom)==ue?(He="PhantomJS",me=(B=B.version||null)&&B.major+"."+B.minor+"."+B.patch):typeof _e.documentMode=="number"&&(B=/\bTrident\/(\d+)/i.exec(A))?(me=[me,_e.documentMode],(B=+B[1]+4)!=me[1]&&(Be.push("IE "+me[1]+" mode"),We&&(We[1]=""),me[1]=B),me=He=="IE"?String(me[1].toFixed(1)):me[0]):typeof _e.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(He)&&(Be.push("masking as "+He+" "+me),He="IE",me="11.0",We=["Trident"],P="Windows");P=P&&c(P)}if(me&&(B=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(me)||/(?:alpha|beta)(?: ?\d)?/i.exec(A+";"+(ye&&K.appMinorVersion))||/\bMinefield\b/i.test(A)&&"a")&&(ze=/b/i.test(B)?"beta":"alpha",me=me.replace(RegExp(B+"\\+?$"),"")+(ze=="beta"?Pe:we)+(/\d+\+?/.exec(B)||"")),He=="Fennec"||He=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(P))He="Firefox Mobile";else if(He=="Maxthon"&&me)me=me.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(nt))nt=="Xbox 360"&&(P=null),nt=="Xbox 360"&&/\bIEMobile\b/.test(A)&&Be.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(He)&&(!He||nt||/Browser|Mobi/.test(He))||P!="Windows CE"&&!/Mobi/i.test(A))if(He=="IE"&&ye)try{N.external===null&&Be.unshift("platform preview")}catch(q){Be.unshift("embedded")}else(/\bBlackBerry\b/.test(nt)||/\bBB10\b/.test(A))&&(B=(RegExp(nt.replace(/ +/g," *")+"/([.\\d]+)","i").exec(A)||0)[1]||me)?(B=[B,/BB10/.test(A)],P=(B[1]?(nt=null,te="BlackBerry"):"Device Software")+" "+B[0],me=null):this!=l&&nt!="Wii"&&(ye&&xe||/Opera/.test(He)&&/\b(?:MSIE|Firefox)\b/i.test(A)||He=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(P)||He=="IE"&&(P&&!/^Win/.test(P)&&me>5.5||/\bWindows XP\b/.test(P)&&me>8||me==8&&!/\bTrident\b/.test(A)))&&!m.test(B=n.call(l,A.replace(m,"")+";"))&&B.name&&(B="ing as "+B.name+((B=B.version)?" "+B:""),m.test(He)?(/\bIE\b/.test(B)&&P=="Mac OS"&&(P=null),B="identify"+B):(B="mask"+B,He=Ve?c(Ve.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(B)&&(P=null),ye||(me=null)),We=["Presto"],Be.push(B));else He+=" Mobile";(B=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(A)||0)[1])&&(B=[parseFloat(B.replace(/\.(\d)$/,".0$1")),B],He=="Safari"&&B[1].slice(-1)=="+"?(He="WebKit Nightly",ze="alpha",me=B[1].slice(0,-1)):me!=B[1]&&me!=(B[2]=(/\bSafari\/([\d.]+\+?)/i.exec(A)||0)[1])||(me=null),B[1]=(/\bChrome\/([\d.]+)/i.exec(A)||0)[1],B[0]==537.36&&B[2]==537.36&&parseFloat(B[1])>=28&&We=="WebKit"&&(We=["Blink"]),ye&&(V||B[1])?(We&&(We[1]="like Chrome"),B=B[1]||(B=B[0],B<530?1:B<532?2:B<532.05?3:B<533?4:B<534.03?5:B<534.07?6:B<534.1?7:B<534.13?8:B<534.16?9:B<534.24?10:B<534.3?11:B<535.01?12:B<535.02?"13+":B<535.07?15:B<535.11?16:B<535.19?17:B<536.05?18:B<536.1?19:B<537.01?20:B<537.11?"21+":B<537.13?23:B<537.18?24:B<537.24?25:B<537.36?26:We!="Blink"?"27":"28")):(We&&(We[1]="like Safari"),B=B[0],B=B<400?1:B<500?2:B<526?3:B<533?4:B<534?"4+":B<535?5:B<537?6:B<538?7:B<601?8:"8"),We&&(We[1]+=" "+(B+=typeof B=="number"?".x":/[.+]/.test(B)?"":"+")),He=="Safari"&&(!me||parseInt(me)>45)&&(me=B)),He=="Opera"&&(B=/\bzbov|zvav$/.exec(P))?(He+=" ",Be.unshift("desktop mode"),B=="zvav"?(He+="Mini",me=null):He+="Mobile",P=P.replace(RegExp(" *"+B+"$"),"")):He=="Safari"&&/\bChrome\b/.exec(We&&We[1])&&(Be.unshift("desktop mode"),He="Chrome Mobile",me=null,/\bOS X\b/.test(P)?(te="Apple",P="iOS 4.3+"):P=null),me&&me.indexOf(B=/[\d.]+$/.exec(P))==0&&A.indexOf("/"+B+"-")>-1&&(P=i(P.replace(B,""))),We&&!/\b(?:Avant|Nook)\b/.test(He)&&(/Browser|Lunascape|Maxthon/.test(He)||He!="Safari"&&/^iOS/.test(P)&&/\bSafari\b/.test(We[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(He)&&We[1])&&(B=We[We.length-1])&&Be.push(B),Be.length&&(Be=["("+Be.join("; ")+")"]),te&&nt&&nt.indexOf(te)<0&&Be.push("on "+te),nt&&Be.push((/^on /.test(Be[Be.length-1])?"":"on ")+nt),P&&(B=/ ([\d.+]+)$/.exec(P),X=B&&P.charAt(P.length-B[0].length-1)=="/",P={architecture:32,family:B&&!X?P.replace(B[0],""):P,version:B?B[1]:null,toString:function(){var q=this.version;return this.family+(q&&!X?" "+q:"")+(this.architecture==64?" 64-bit":"")}}),(B=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Ne))&&!/\bi686\b/i.test(Ne)?(P&&(P.architecture=64,P.family=P.family.replace(RegExp(" *"+B),"")),He&&(/\bWOW64\b/i.test(A)||ye&&/\w(?:86|32)$/.test(K.cpuClass||K.platform)&&!/\bWin64; x64\b/i.test(A))&&Be.unshift("32-bit")):P&&/^OS X/.test(P.family)&&He=="Chrome"&&parseFloat(me)>=39&&(P.architecture=64),A||(A=null);var U={};return U.description=A,U.layout=We&&We[0],U.manufacturer=te,U.name=He,U.prerelease=ze,U.product=nt,U.ua=A,U.version=He&&me,U.os=P||{architecture:null,family:null,version:null,toString:function(){return"null"}},U.parse=n,U.toString=D,U.version&&Be.unshift(me),U.name&&Be.unshift(He),P&&He&&(P!=String(P).split(" ")[0]||P!=He.split(" ")[0]&&!nt)&&Be.push(nt?"("+P+")":"on "+P),Be.length&&(U.description=Be.join(" ")),U}var t={function:!0,object:!0},d=t[typeof window]&&window||this,v=t[typeof S]&&S,g=t[typeof k]&&k&&!k.nodeType&&k,b=v&&g&&typeof T=="object"&&T;!b||b.global!==b&&b.window!==b&&b.self!==b||(d=b);var _=Math.pow(2,53)-1,m=/\bOpera/,y=Object.prototype,E=y.hasOwnProperty,o=y.toString,x=n();typeof j=="function"&&typeof j.amd=="object"&&j.amd?(d.platform=x,j(function(){return x})):v&&g?l(x,function(A,O){v[O]=A}):d.platform=x}).call(this)}).call(this,typeof de!="undefined"?de:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],172:[function(w,k,S){(function(T){"use strict";function C(h,p,c,l){if(typeof h!="function")throw new TypeError('"callback" argument must be a function');var a,u,s=arguments.length;switch(s){case 0:case 1:return T.nextTick(h);case 2:return T.nextTick(function(){h.call(null,p)});case 3:return T.nextTick(function(){h.call(null,p,c)});case 4:return T.nextTick(function(){h.call(null,p,c,l)});default:for(a=new Array(s-1),u=0;u<a.length;)a[u++]=arguments[u];return T.nextTick(function(){h.apply(null,a)})}}!T.version||T.version.indexOf("v0.")===0||T.version.indexOf("v1.")===0&&T.version.indexOf("v1.8.")!==0?k.exports={nextTick:C}:k.exports=T}).call(this,w("_process"))},{_process:173}],173:[function(w,k,S){function T(){throw new Error("setTimeout has not been defined")}function C(){throw new Error("clearTimeout has not been defined")}function h(g){if(s===setTimeout)return setTimeout(g,0);if((s===T||!s)&&setTimeout)return s=setTimeout,setTimeout(g,0);try{return s(g,0)}catch(b){try{return s.call(null,g,0)}catch(_){return s.call(this,g,0)}}}function p(g){if(f===clearTimeout)return clearTimeout(g);if((f===C||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(g);try{return f(g)}catch(b){try{return f.call(null,g)}catch(_){return f.call(this,g)}}}function c(){d&&n&&(d=!1,n.length?t=n.concat(t):v=-1,t.length&&l())}function l(){if(!d){var g=h(c);d=!0;for(var b=t.length;b;){for(n=t,t=[];++v<b;)n&&n[v].run();v=-1,b=t.length}n=null,d=!1,p(g)}}function a(g,b){this.fun=g,this.array=b}function u(){}var s,f,i=k.exports={};!function(){try{s=typeof setTimeout=="function"?setTimeout:T}catch(g){s=T}try{f=typeof clearTimeout=="function"?clearTimeout:C}catch(g){f=C}}();var n,t=[],d=!1,v=-1;i.nextTick=function(g){var b=new Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)b[_-1]=arguments[_];t.push(new a(g,b)),t.length!==1||d||h(l)},a.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=u,i.addListener=u,i.once=u,i.off=u,i.removeListener=u,i.removeAllListeners=u,i.emit=u,i.prependListener=u,i.prependOnceListener=u,i.listeners=function(g){return[]},i.binding=function(g){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(g){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],174:[function(w,k,S){(function(T){!function(C){function h(Z){throw new RangeError(X[Z])}function p(Z,ue){for(var he=Z.length,Oe=[];he--;)Oe[he]=ue(Z[he]);return Oe}function c(Z,ue){var he=Z.split("@"),Oe="";return he.length>1&&(Oe=he[0]+"@",Z=he[1]),Z=Z.replace(B,"."),Oe+p(Z.split("."),ue).join(".")}function l(Z){for(var ue,he,Oe=[],we=0,Pe=Z.length;we<Pe;)ue=Z.charCodeAt(we++),ue>=55296&&ue<=56319&&we<Pe?(he=Z.charCodeAt(we++),(64512&he)==56320?Oe.push(((1023&ue)<<10)+(1023&he)+65536):(Oe.push(ue),we--)):Oe.push(ue);return Oe}function a(Z){return p(Z,function(ue){var he="";return ue>65535&&(ue-=65536,he+=$(ue>>>10&1023|55296),ue=56320|1023&ue),he+=$(ue)}).join("")}function u(Z){return Z-48<10?Z-22:Z-65<26?Z-65:Z-97<26?Z-97:E}function s(Z,ue){return Z+22+75*(Z<26)-((ue!=0)<<5)}function f(Z,ue,he){var Oe=0;for(Z=he?ne(Z/O):Z>>1,Z+=ne(Z/ue);Z>V*x>>1;Oe+=E)Z=ne(Z/V);return ne(Oe+(V+1)*Z/(Z+A))}function i(Z){var ue,he,Oe,we,Pe,_e,xe,Ve,Ne,Be,ze=[],ye=Z.length,me=0,We=N,He=D;for(he=Z.lastIndexOf(W),he<0&&(he=0),Oe=0;Oe<he;++Oe)Z.charCodeAt(Oe)>=128&&h("not-basic"),ze.push(Z.charCodeAt(Oe));for(we=he>0?he+1:0;we<ye;){for(Pe=me,_e=1,xe=E;we>=ye&&h("invalid-input"),Ve=u(Z.charCodeAt(we++)),(Ve>=E||Ve>ne((y-me)/_e))&&h("overflow"),me+=Ve*_e,Ne=xe<=He?o:xe>=He+x?x:xe-He,!(Ve<Ne);xe+=E)Be=E-Ne,_e>ne(y/Be)&&h("overflow"),_e*=Be;ue=ze.length+1,He=f(me-Pe,ue,Pe==0),ne(me/ue)>y-We&&h("overflow"),We+=ne(me/ue),me%=ue,ze.splice(me++,0,We)}return a(ze)}function n(Z){var ue,he,Oe,we,Pe,_e,xe,Ve,Ne,Be,ze,ye,me,We,He,nt=[];for(Z=l(Z),ye=Z.length,ue=N,he=0,Pe=D,_e=0;_e<ye;++_e)(ze=Z[_e])<128&&nt.push($(ze));for(Oe=we=nt.length,we&&nt.push(W);Oe<ye;){for(xe=y,_e=0;_e<ye;++_e)(ze=Z[_e])>=ue&&ze<xe&&(xe=ze);for(me=Oe+1,xe-ue>ne((y-he)/me)&&h("overflow"),he+=(xe-ue)*me,ue=xe,_e=0;_e<ye;++_e)if(ze=Z[_e],ze<ue&&++he>y&&h("overflow"),ze==ue){for(Ve=he,Ne=E;Be=Ne<=Pe?o:Ne>=Pe+x?x:Ne-Pe,!(Ve<Be);Ne+=E)He=Ve-Be,We=E-Be,nt.push($(s(Be+He%We,0))),Ve=ne(He/We);nt.push($(s(Ve,0))),Pe=f(he,me,Oe==we),he=0,++Oe}++he,++ue}return nt.join("")}function t(Z){return c(Z,function(ue){return K.test(ue)?i(ue.slice(4).toLowerCase()):ue})}function d(Z){return c(Z,function(ue){return oe.test(ue)?"xn--"+n(ue):ue})}var v=typeof S=="object"&&S&&!S.nodeType&&S,g=typeof k=="object"&&k&&!k.nodeType&&k,b=typeof T=="object"&&T;b.global!==b&&b.window!==b&&b.self!==b||(C=b);var _,m,y=2147483647,E=36,o=1,x=26,A=38,O=700,D=72,N=128,W="-",K=/^xn--/,oe=/[^\x20-\x7E]/,B=/[\x2E\u3002\uFF0E\uFF61]/g,X={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=E-o,ne=Math.floor,$=String.fromCharCode;if(_={version:"1.4.1",ucs2:{decode:l,encode:a},decode:i,encode:n,toASCII:d,toUnicode:t},typeof j=="function"&&typeof j.amd=="object"&&j.amd)j("punycode",function(){return _});else if(v&&g)if(k.exports==v)g.exports=_;else for(m in _)_.hasOwnProperty(m)&&(v[m]=_[m]);else C.punycode=_}(this)}).call(this,typeof de!="undefined"?de:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],175:[function(w,k,S){"use strict";function T(h,p){return Object.prototype.hasOwnProperty.call(h,p)}k.exports=function(h,p,c,l){p=p||"&",c=c||"=";var a={};if(typeof h!="string"||h.length===0)return a;var u=/\+/g;h=h.split(p);var s=1e3;l&&typeof l.maxKeys=="number"&&(s=l.maxKeys);var f=h.length;s>0&&f>s&&(f=s);for(var i=0;i<f;++i){var n,t,d,v,g=h[i].replace(u,"%20"),b=g.indexOf(c);b>=0?(n=g.substr(0,b),t=g.substr(b+1)):(n=g,t=""),d=decodeURIComponent(n),v=decodeURIComponent(t),T(a,d)?C(a[d])?a[d].push(v):a[d]=[a[d],v]:a[d]=v}return a};var C=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"}},{}],176:[function(w,k,S){"use strict";function T(c,l){if(c.map)return c.map(l);for(var a=[],u=0;u<c.length;u++)a.push(l(c[u],u));return a}var C=function(c){switch(typeof c){case"string":return c;case"boolean":return c?"true":"false";case"number":return isFinite(c)?c:"";default:return""}};k.exports=function(c,l,a,u){return l=l||"&",a=a||"=",c===null&&(c=void 0),typeof c=="object"?T(p(c),function(s){var f=encodeURIComponent(C(s))+a;return h(c[s])?T(c[s],function(i){return f+encodeURIComponent(C(i))}).join(l):f+encodeURIComponent(C(c[s]))}).join(l):u?encodeURIComponent(C(u))+a+encodeURIComponent(C(c)):""};var h=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},p=Object.keys||function(c){var l=[];for(var a in c)Object.prototype.hasOwnProperty.call(c,a)&&l.push(a);return l}},{}],177:[function(w,k,S){"use strict";S.decode=S.parse=w("./decode"),S.encode=S.stringify=w("./encode")},{"./decode":175,"./encode":176}],178:[function(w,k,S){k.exports=w("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":179}],179:[function(w,k,S){"use strict";function T(d){if(!(this instanceof T))return new T(d);s.call(this,d),f.call(this,d),d&&d.readable===!1&&(this.readable=!1),d&&d.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,d&&d.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",C)}function C(){this.allowHalfOpen||this._writableState.ended||l.nextTick(h,this)}function h(d){d.end()}var p=w("babel-runtime/core-js/object/keys"),c=function(d){return d&&d.__esModule?d:{default:d}}(p),l=w("process-nextick-args"),a=c.default||function(d){var v=[];for(var g in d)v.push(g);return v};k.exports=T;var u=w("core-util-is");u.inherits=w("inherits");var s=w("./_stream_readable"),f=w("./_stream_writable");u.inherits(T,s);for(var i=a(f.prototype),n=0;n<i.length;n++){var t=i[n];T.prototype[t]||(T.prototype[t]=f.prototype[t])}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(d){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),T.prototype._destroy=function(d,v){this.push(null),this.end(),l.nextTick(v,d)}},{"./_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(w,k,S){"use strict";function T(p){if(!(this instanceof T))return new T(p);C.call(this,p)}k.exports=T;var C=w("./_stream_transform"),h=w("core-util-is");h.inherits=w("inherits"),h.inherits(T,C),T.prototype._transform=function(p,c,l){l(null,p)}},{"./_stream_transform":182,"core-util-is":153,inherits:162}],181:[function(w,k,S){(function(T,C){"use strict";function h(ye){return he.from(ye)}function p(ye){return he.isBuffer(ye)||ye instanceof Oe}function c(ye,me,We){if(typeof ye.prependListener=="function")return ye.prependListener(me,We);ye._events&&ye._events[me]?$(ye._events[me])?ye._events[me].unshift(We):ye._events[me]=[We,ye._events[me]]:ye.on(me,We)}function l(ye,me){ne=ne||w("./_stream_duplex"),ye=ye||{};var We=me instanceof ne;this.objectMode=!!ye.objectMode,We&&(this.objectMode=this.objectMode||!!ye.readableObjectMode);var He=ye.highWaterMark,nt=ye.readableHighWaterMark,te=this.objectMode?16:16384;this.highWaterMark=He||He===0?He:We&&(nt||nt===0)?nt:te,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Ve,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=ye.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ye.encoding&&(xe||(xe=w("string_decoder/").StringDecoder),this.decoder=new xe(ye.encoding),this.encoding=ye.encoding)}function a(ye){if(ne=ne||w("./_stream_duplex"),!(this instanceof a))return new a(ye);this._readableState=new l(ye,this),this.readable=!0,ye&&(typeof ye.read=="function"&&(this._read=ye.read),typeof ye.destroy=="function"&&(this._destroy=ye.destroy)),ue.call(this)}function u(ye,me,We,He,nt){var te=ye._readableState;if(me===null)te.reading=!1,d(ye,te);else{var P;nt||(P=f(te,me)),P?ye.emit("error",P):te.objectMode||me&&me.length>0?(typeof me=="string"||te.objectMode||(0,X.default)(me)===he.prototype||(me=h(me)),He?te.endEmitted?ye.emit("error",new Error("stream.unshift() after end event")):s(ye,te,me,!0):te.ended?ye.emit("error",new Error("stream.push() after EOF")):(te.reading=!1,te.decoder&&!We?(me=te.decoder.write(me),te.objectMode||me.length!==0?s(ye,te,me,!1):b(ye,te)):s(ye,te,me,!1))):He||(te.reading=!1)}return i(te)}function s(ye,me,We,He){me.flowing&&me.length===0&&!me.sync?(ye.emit("data",We),ye.read(0)):(me.length+=me.objectMode?1:We.length,He?me.buffer.unshift(We):me.buffer.push(We),me.needReadable&&v(ye)),b(ye,me)}function f(ye,me){var We;return p(me)||typeof me=="string"||me===void 0||ye.objectMode||(We=new TypeError("Invalid non-string/buffer chunk")),We}function i(ye){return!ye.ended&&(ye.needReadable||ye.length<ye.highWaterMark||ye.length===0)}function n(ye){return ye>=ze?ye=ze:(ye--,ye|=ye>>>1,ye|=ye>>>2,ye|=ye>>>4,ye|=ye>>>8,ye|=ye>>>16,ye++),ye}function t(ye,me){return ye<=0||me.length===0&&me.ended?0:me.objectMode?1:ye!==ye?me.flowing&&me.length?me.buffer.head.data.length:me.length:(ye>me.highWaterMark&&(me.highWaterMark=n(ye)),ye<=me.length?ye:me.ended?me.length:(me.needReadable=!0,0))}function d(ye,me){if(!me.ended){if(me.decoder){var We=me.decoder.end();We&&We.length&&(me.buffer.push(We),me.length+=me.objectMode?1:We.length)}me.ended=!0,v(ye)}}function v(ye){var me=ye._readableState;me.needReadable=!1,me.emittedReadable||(_e("emitReadable",me.flowing),me.emittedReadable=!0,me.sync?V.nextTick(g,ye):g(ye))}function g(ye){_e("emit readable"),ye.emit("readable"),x(ye)}function b(ye,me){me.readingMore||(me.readingMore=!0,V.nextTick(_,ye,me))}function _(ye,me){for(var We=me.length;!me.reading&&!me.flowing&&!me.ended&&me.length<me.highWaterMark&&(_e("maybeReadMore read 0"),ye.read(0),We!==me.length);)We=me.length;me.readingMore=!1}function m(ye){return function(){var me=ye._readableState;_e("pipeOnDrain",me.awaitDrain),me.awaitDrain&&me.awaitDrain--,me.awaitDrain===0&&Z(ye,"data")&&(me.flowing=!0,x(ye))}}function y(ye){_e("readable nexttick read 0"),ye.read(0)}function E(ye,me){me.resumeScheduled||(me.resumeScheduled=!0,V.nextTick(o,ye,me))}function o(ye,me){me.reading||(_e("resume read 0"),ye.read(0)),me.resumeScheduled=!1,me.awaitDrain=0,ye.emit("resume"),x(ye),me.flowing&&!me.reading&&ye.read(0)}function x(ye){var me=ye._readableState;for(_e("flow",me.flowing);me.flowing&&ye.read()!==null;);}function A(ye,me){if(me.length===0)return null;var We;return me.objectMode?We=me.buffer.shift():!ye||ye>=me.length?(We=me.decoder?me.buffer.join(""):me.buffer.length===1?me.buffer.head.data:me.buffer.concat(me.length),me.buffer.clear()):We=O(ye,me.buffer,me.decoder),We}function O(ye,me,We){var He;return ye<me.head.data.length?(He=me.head.data.slice(0,ye),me.head.data=me.head.data.slice(ye)):He=ye===me.head.data.length?me.shift():We?D(ye,me):N(ye,me),He}function D(ye,me){var We=me.head,He=1,nt=We.data;for(ye-=nt.length;We=We.next;){var te=We.data,P=ye>te.length?te.length:ye;if(P===te.length?nt+=te:nt+=te.slice(0,ye),(ye-=P)===0){P===te.length?(++He,We.next?me.head=We.next:me.head=me.tail=null):(me.head=We,We.data=te.slice(P));break}++He}return me.length-=He,nt}function N(ye,me){var We=he.allocUnsafe(ye),He=me.head,nt=1;for(He.data.copy(We),ye-=He.data.length;He=He.next;){var te=He.data,P=ye>te.length?te.length:ye;if(te.copy(We,We.length-ye,0,P),(ye-=P)===0){P===te.length?(++nt,He.next?me.head=He.next:me.head=me.tail=null):(me.head=He,He.data=te.slice(P));break}++nt}return me.length-=nt,We}function W(ye){var me=ye._readableState;if(me.length>0)throw new Error('"endReadable()" called on non-empty stream');me.endEmitted||(me.ended=!0,V.nextTick(K,me,ye))}function K(ye,me){ye.endEmitted||ye.length!==0||(ye.endEmitted=!0,me.readable=!1,me.emit("end"))}function oe(ye,me){for(var We=0,He=ye.length;We<He;We++)if(ye[We]===me)return We;return-1}var B=w("babel-runtime/core-js/object/get-prototype-of"),X=function(ye){return ye&&ye.__esModule?ye:{default:ye}}(B),V=w("process-nextick-args");k.exports=a;var ne,$=w("isarray");a.ReadableState=l;var Z=(w("events").EventEmitter,function(ye,me){return ye.listeners(me).length}),ue=w("./internal/streams/stream"),he=w("safe-buffer").Buffer,Oe=C.Uint8Array||function(){},we=w("core-util-is");we.inherits=w("inherits");var Pe=w("util"),_e=void 0;_e=Pe&&Pe.debuglog?Pe.debuglog("stream"):function(){};var xe,Ve=w("./internal/streams/BufferList"),Ne=w("./internal/streams/destroy");we.inherits(a,ue);var Be=["error","close","destroy","pause","resume"];Object.defineProperty(a.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(ye){this._readableState&&(this._readableState.destroyed=ye)}}),a.prototype.destroy=Ne.destroy,a.prototype._undestroy=Ne.undestroy,a.prototype._destroy=function(ye,me){this.push(null),me(ye)},a.prototype.push=function(ye,me){var We,He=this._readableState;return He.objectMode?We=!0:typeof ye=="string"&&(me=me||He.defaultEncoding,me!==He.encoding&&(ye=he.from(ye,me),me=""),We=!0),u(this,ye,me,!1,We)},a.prototype.unshift=function(ye){return u(this,ye,null,!0,!1)},a.prototype.isPaused=function(){return this._readableState.flowing===!1},a.prototype.setEncoding=function(ye){return xe||(xe=w("string_decoder/").StringDecoder),this._readableState.decoder=new xe(ye),this._readableState.encoding=ye,this};var ze=8388608;a.prototype.read=function(ye){_e("read",ye),ye=parseInt(ye,10);var me=this._readableState,We=ye;if(ye!==0&&(me.emittedReadable=!1),ye===0&&me.needReadable&&(me.length>=me.highWaterMark||me.ended))return _e("read: emitReadable",me.length,me.ended),me.length===0&&me.ended?W(this):v(this),null;if((ye=t(ye,me))===0&&me.ended)return me.length===0&&W(this),null;var He=me.needReadable;_e("need readable",He),(me.length===0||me.length-ye<me.highWaterMark)&&(He=!0,_e("length less than watermark",He)),me.ended||me.reading?(He=!1,_e("reading or ended",He)):He&&(_e("do read"),me.reading=!0,me.sync=!0,me.length===0&&(me.needReadable=!0),this._read(me.highWaterMark),me.sync=!1,me.reading||(ye=t(We,me)));var nt;return nt=ye>0?A(ye,me):null,nt===null?(me.needReadable=!0,ye=0):me.length-=ye,me.length===0&&(me.ended||(me.needReadable=!0),We!==ye&&me.ended&&W(this)),nt!==null&&this.emit("data",nt),nt},a.prototype._read=function(ye){this.emit("error",new Error("_read() is not implemented"))},a.prototype.pipe=function(ye,me){function We(dt,qe){_e("onunpipe"),dt===J&&qe&&qe.hasUnpiped===!1&&(qe.hasUnpiped=!0,nt())}function He(){_e("onend"),ye.end()}function nt(){_e("cleanup"),ye.removeListener("close",U),ye.removeListener("finish",q),ye.removeListener("drain",Ue),ye.removeListener("error",P),ye.removeListener("unpipe",We),J.removeListener("end",He),J.removeListener("end",Y),J.removeListener("data",te),je=!0,!Ee.awaitDrain||ye._writableState&&!ye._writableState.needDrain||Ue()}function te(dt){_e("ondata"),tt=!1,ye.write(dt)!==!1||tt||((Ee.pipesCount===1&&Ee.pipes===ye||Ee.pipesCount>1&&oe(Ee.pipes,ye)!==-1)&&!je&&(_e("false write response, pause",J._readableState.awaitDrain),J._readableState.awaitDrain++,tt=!0),J.pause())}function P(dt){_e("onerror",dt),Y(),ye.removeListener("error",P),Z(ye,"error")===0&&ye.emit("error",dt)}function U(){ye.removeListener("finish",q),Y()}function q(){_e("onfinish"),ye.removeListener("close",U),Y()}function Y(){_e("unpipe"),J.unpipe(ye)}var J=this,Ee=this._readableState;switch(Ee.pipesCount){case 0:Ee.pipes=ye;break;case 1:Ee.pipes=[Ee.pipes,ye];break;default:Ee.pipes.push(ye)}Ee.pipesCount+=1,_e("pipe count=%d opts=%j",Ee.pipesCount,me);var ke=(!me||me.end!==!1)&&ye!==T.stdout&&ye!==T.stderr,ht=ke?He:Y;Ee.endEmitted?V.nextTick(ht):J.once("end",ht),ye.on("unpipe",We);var Ue=m(J);ye.on("drain",Ue);var je=!1,tt=!1;return J.on("data",te),c(ye,"error",P),ye.once("close",U),ye.once("finish",q),ye.emit("pipe",J),Ee.flowing||(_e("pipe resume"),J.resume()),ye},a.prototype.unpipe=function(ye){var me=this._readableState,We={hasUnpiped:!1};if(me.pipesCount===0)return this;if(me.pipesCount===1)return ye&&ye!==me.pipes?this:(ye||(ye=me.pipes),me.pipes=null,me.pipesCount=0,me.flowing=!1,ye&&ye.emit("unpipe",this,We),this);if(!ye){var He=me.pipes,nt=me.pipesCount;me.pipes=null,me.pipesCount=0,me.flowing=!1;for(var te=0;te<nt;te++)He[te].emit("unpipe",this,We);return this}var P=oe(me.pipes,ye);return P===-1?this:(me.pipes.splice(P,1),me.pipesCount-=1,me.pipesCount===1&&(me.pipes=me.pipes[0]),ye.emit("unpipe",this,We),this)},a.prototype.on=function(ye,me){var We=ue.prototype.on.call(this,ye,me);if(ye==="data")this._readableState.flowing!==!1&&this.resume();else if(ye==="readable"){var He=this._readableState;He.endEmitted||He.readableListening||(He.readableListening=He.needReadable=!0,He.emittedReadable=!1,He.reading?He.length&&v(this):V.nextTick(y,this))}return We},a.prototype.addListener=a.prototype.on,a.prototype.resume=function(){var ye=this._readableState;return ye.flowing||(_e("resume"),ye.flowing=!0,E(this,ye)),this},a.prototype.pause=function(){return _e("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(_e("pause"),this._readableState.flowing=!1,this.emit("pause")),this},a.prototype.wrap=function(ye){var me=this,We=this._readableState,He=!1;ye.on("end",function(){if(_e("wrapped end"),We.decoder&&!We.ended){var P=We.decoder.end();P&&P.length&&me.push(P)}me.push(null)}),ye.on("data",function(P){(_e("wrapped data"),We.decoder&&(P=We.decoder.write(P)),(!We.objectMode||P!=null)&&(We.objectMode||P&&P.length))&&(me.push(P)||(He=!0,ye.pause()))});for(var nt in ye)this[nt]===void 0&&typeof ye[nt]=="function"&&(this[nt]=function(P){return function(){return ye[P].apply(ye,arguments)}}(nt));for(var te=0;te<Be.length;te++)ye.on(Be[te],this.emit.bind(this,Be[te]));return this._read=function(P){_e("wrapped _read",P),He&&(He=!1,ye.resume())},this},Object.defineProperty(a.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),a._fromList=A}).call(this,w("_process"),typeof de!="undefined"?de: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(w,k,S){"use strict";function T(a,u){var s=this._transformState;s.transforming=!1;var f=s.writecb;if(!f)return this.emit("error",new Error("write callback called multiple times"));s.writechunk=null,s.writecb=null,u!=null&&this.push(u),f(a);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function C(a){if(!(this instanceof C))return new C(a);c.call(this,a),this._transformState={afterTransform:T.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,a&&(typeof a.transform=="function"&&(this._transform=a.transform),typeof a.flush=="function"&&(this._flush=a.flush)),this.on("prefinish",h)}function h(){var a=this;typeof this._flush=="function"?this._flush(function(u,s){p(a,u,s)}):p(this,null,null)}function p(a,u,s){if(u)return a.emit("error",u);if(s!=null&&a.push(s),a._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(a._transformState.transforming)throw new Error("Calling transform done when still transforming");return a.push(null)}k.exports=C;var c=w("./_stream_duplex"),l=w("core-util-is");l.inherits=w("inherits"),l.inherits(C,c),C.prototype.push=function(a,u){return this._transformState.needTransform=!1,c.prototype.push.call(this,a,u)},C.prototype._transform=function(a,u,s){throw new Error("_transform() is not implemented")},C.prototype._write=function(a,u,s){var f=this._transformState;if(f.writecb=s,f.writechunk=a,f.writeencoding=u,!f.transforming){var i=this._readableState;(f.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},C.prototype._read=function(a){var u=this._transformState;u.writechunk!==null&&u.writecb&&!u.transforming?(u.transforming=!0,this._transform(u.writechunk,u.writeencoding,u.afterTransform)):u.needTransform=!0},C.prototype._destroy=function(a,u){var s=this;c.prototype._destroy.call(this,a,function(f){u(f),s.emit("close")})}},{"./_stream_duplex":179,"core-util-is":153,inherits:162}],183:[function(w,k,S){(function(T,C){"use strict";function h(Ne){return Ne&&Ne.__esModule?Ne:{default:Ne}}function p(Ne){var Be=this;this.next=null,this.entry=null,this.finish=function(){D(Be,Ne)}}function c(Ne){return Pe.from(Ne)}function l(Ne){return Pe.isBuffer(Ne)||Ne instanceof _e}function a(){}function u(Ne,Be){Z=Z||w("./_stream_duplex"),Ne=Ne||{};var ze=Be instanceof Z;this.objectMode=!!Ne.objectMode,ze&&(this.objectMode=this.objectMode||!!Ne.writableObjectMode);var ye=Ne.highWaterMark,me=Ne.writableHighWaterMark,We=this.objectMode?16:16384;this.highWaterMark=ye||ye===0?ye:ze&&(me||me===0)?me:We,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 He=Ne.decodeStrings===!1;this.decodeStrings=!He,this.defaultEncoding=Ne.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(nt){b(Be,nt)},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(Ne){if(Z=Z||w("./_stream_duplex"),!(Ve.call(s,this)||this instanceof Z))return new s(Ne);this._writableState=new u(Ne,this),this.writable=!0,Ne&&(typeof Ne.write=="function"&&(this._write=Ne.write),typeof Ne.writev=="function"&&(this._writev=Ne.writev),typeof Ne.destroy=="function"&&(this._destroy=Ne.destroy),typeof Ne.final=="function"&&(this._final=Ne.final)),we.call(this)}function f(Ne,Be){var ze=new Error("write after end");Ne.emit("error",ze),$.nextTick(Be,ze)}function i(Ne,Be,ze,ye){var me=!0,We=!1;return ze===null?We=new TypeError("May not write null values to stream"):typeof ze=="string"||ze===void 0||Be.objectMode||(We=new TypeError("Invalid non-string/buffer chunk")),We&&(Ne.emit("error",We),$.nextTick(ye,We),me=!1),me}function n(Ne,Be,ze){return Ne.objectMode||Ne.decodeStrings===!1||typeof Be!="string"||(Be=Pe.from(Be,ze)),Be}function t(Ne,Be,ze,ye,me,We){if(!ze){var He=n(Be,ye,me);ye!==He&&(ze=!0,me="buffer",ye=He)}var nt=Be.objectMode?1:ye.length;Be.length+=nt;var te=Be.length<Be.highWaterMark;if(te||(Be.needDrain=!0),Be.writing||Be.corked){var P=Be.lastBufferedRequest;Be.lastBufferedRequest={chunk:ye,encoding:me,isBuf:ze,callback:We,next:null},P?P.next=Be.lastBufferedRequest:Be.bufferedRequest=Be.lastBufferedRequest,Be.bufferedRequestCount+=1}else d(Ne,Be,!1,nt,ye,me,We);return te}function d(Ne,Be,ze,ye,me,We,He){Be.writelen=ye,Be.writecb=He,Be.writing=!0,Be.sync=!0,ze?Ne._writev(me,Be.onwrite):Ne._write(me,We,Be.onwrite),Be.sync=!1}function v(Ne,Be,ze,ye,me){--Be.pendingcb,ze?($.nextTick(me,ye),$.nextTick(A,Ne,Be),Ne._writableState.errorEmitted=!0,Ne.emit("error",ye)):(me(ye),Ne._writableState.errorEmitted=!0,Ne.emit("error",ye),A(Ne,Be))}function g(Ne){Ne.writing=!1,Ne.writecb=null,Ne.length-=Ne.writelen,Ne.writelen=0}function b(Ne,Be){var ze=Ne._writableState,ye=ze.sync,me=ze.writecb;if(g(ze),Be)v(Ne,ze,ye,Be,me);else{var We=E(ze);We||ze.corked||ze.bufferProcessing||!ze.bufferedRequest||y(Ne,ze),ye?ue(_,Ne,ze,We,me):_(Ne,ze,We,me)}}function _(Ne,Be,ze,ye){ze||m(Ne,Be),Be.pendingcb--,ye(),A(Ne,Be)}function m(Ne,Be){Be.length===0&&Be.needDrain&&(Be.needDrain=!1,Ne.emit("drain"))}function y(Ne,Be){Be.bufferProcessing=!0;var ze=Be.bufferedRequest;if(Ne._writev&&ze&&ze.next){var ye=Be.bufferedRequestCount,me=new Array(ye),We=Be.corkedRequestsFree;We.entry=ze;for(var He=0,nt=!0;ze;)me[He]=ze,ze.isBuf||(nt=!1),ze=ze.next,He+=1;me.allBuffers=nt,d(Ne,Be,!0,Be.length,me,"",We.finish),Be.pendingcb++,Be.lastBufferedRequest=null,We.next?(Be.corkedRequestsFree=We.next,We.next=null):Be.corkedRequestsFree=new p(Be),Be.bufferedRequestCount=0}else{for(;ze;){var te=ze.chunk,P=ze.encoding,U=ze.callback;if(d(Ne,Be,!1,Be.objectMode?1:te.length,te,P,U),ze=ze.next,Be.bufferedRequestCount--,Be.writing)break}ze===null&&(Be.lastBufferedRequest=null)}Be.bufferedRequest=ze,Be.bufferProcessing=!1}function E(Ne){return Ne.ending&&Ne.length===0&&Ne.bufferedRequest===null&&!Ne.finished&&!Ne.writing}function o(Ne,Be){Ne._final(function(ze){Be.pendingcb--,ze&&Ne.emit("error",ze),Be.prefinished=!0,Ne.emit("prefinish"),A(Ne,Be)})}function x(Ne,Be){Be.prefinished||Be.finalCalled||(typeof Ne._final=="function"?(Be.pendingcb++,Be.finalCalled=!0,$.nextTick(o,Ne,Be)):(Be.prefinished=!0,Ne.emit("prefinish")))}function A(Ne,Be){var ze=E(Be);return ze&&(x(Ne,Be),Be.pendingcb===0&&(Be.finished=!0,Ne.emit("finish"))),ze}function O(Ne,Be,ze){Be.ending=!0,A(Ne,Be),ze&&(Be.finished?$.nextTick(ze):Ne.once("finish",ze)),Be.ended=!0,Ne.writable=!1}function D(Ne,Be,ze){var ye=Ne.entry;for(Ne.entry=null;ye;){var me=ye.callback;Be.pendingcb--,me(ze),ye=ye.next}Be.corkedRequestsFree?Be.corkedRequestsFree.next=Ne:Be.corkedRequestsFree=Ne}var N=w("babel-runtime/core-js/object/define-property"),W=h(N),K=w("babel-runtime/core-js/symbol/has-instance"),oe=h(K),B=w("babel-runtime/core-js/symbol"),X=h(B),V=w("babel-runtime/core-js/set-immediate"),ne=h(V),$=w("process-nextick-args");k.exports=s;var Z,ue=!T.browser&&["v0.10","v0.9."].indexOf(T.version.slice(0,5))>-1?ne.default:$.nextTick;s.WritableState=u;var he=w("core-util-is");he.inherits=w("inherits");var Oe={deprecate:w("util-deprecate")},we=w("./internal/streams/stream"),Pe=w("safe-buffer").Buffer,_e=C.Uint8Array||function(){},xe=w("./internal/streams/destroy");he.inherits(s,we),u.prototype.getBuffer=function(){for(var Ne=this.bufferedRequest,Be=[];Ne;)Be.push(Ne),Ne=Ne.next;return Be},function(){try{Object.defineProperty(u.prototype,"buffer",{get:Oe.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(Ne){}}();var Ve;typeof X.default=="function"&&oe.default&&typeof Function.prototype[oe.default]=="function"?(Ve=Function.prototype[oe.default],(0,W.default)(s,oe.default,{value:function(Ne){return!!Ve.call(this,Ne)||this===s&&Ne&&Ne._writableState instanceof u}})):Ve=function(Ne){return Ne instanceof this},s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(Ne,Be,ze){var ye=this._writableState,me=!1,We=!ye.objectMode&&l(Ne);return We&&!Pe.isBuffer(Ne)&&(Ne=c(Ne)),typeof Be=="function"&&(ze=Be,Be=null),We?Be="buffer":Be||(Be=ye.defaultEncoding),typeof ze!="function"&&(ze=a),ye.ended?f(this,ze):(We||i(this,ye,Ne,ze))&&(ye.pendingcb++,me=t(this,ye,We,Ne,Be,ze)),me},s.prototype.cork=function(){this._writableState.corked++},s.prototype.uncork=function(){var Ne=this._writableState;Ne.corked&&(Ne.corked--,Ne.writing||Ne.corked||Ne.finished||Ne.bufferProcessing||!Ne.bufferedRequest||y(this,Ne))},s.prototype.setDefaultEncoding=function(Ne){if(typeof Ne=="string"&&(Ne=Ne.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Ne+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+Ne);return this._writableState.defaultEncoding=Ne,this},Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),s.prototype._write=function(Ne,Be,ze){ze(new Error("_write() is not implemented"))},s.prototype._writev=null,s.prototype.end=function(Ne,Be,ze){var ye=this._writableState;typeof Ne=="function"?(ze=Ne,Ne=null,Be=null):typeof Be=="function"&&(ze=Be,Be=null),Ne!=null&&this.write(Ne,Be),ye.corked&&(ye.corked=1,this.uncork()),ye.ending||ye.finished||O(this,ye,ze)},Object.defineProperty(s.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(Ne){this._writableState&&(this._writableState.destroyed=Ne)}}),s.prototype.destroy=xe.destroy,s.prototype._undestroy=xe.undestroy,s.prototype._destroy=function(Ne,Be){this.end(),Be(Ne)}}).call(this,w("_process"),typeof de!="undefined"?de: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(w,k,S){"use strict";function T(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function C(c,l,a){c.copy(l,a)}var h=w("safe-buffer").Buffer,p=w("util");k.exports=function(){function c(){T(this,c),this.head=null,this.tail=null,this.length=0}return c.prototype.push=function(l){var a={data:l,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length},c.prototype.unshift=function(l){var a={data:l,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length},c.prototype.shift=function(){if(this.length!==0){var l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}},c.prototype.clear=function(){this.head=this.tail=null,this.length=0},c.prototype.join=function(l){if(this.length===0)return"";for(var a=this.head,u=""+a.data;a=a.next;)u+=l+a.data;return u},c.prototype.concat=function(l){if(this.length===0)return h.alloc(0);if(this.length===1)return this.head.data;for(var a=h.allocUnsafe(l>>>0),u=this.head,s=0;u;)C(u.data,a,s),s+=u.data.length,u=u.next;return a},c}(),p&&p.inspect&&p.inspect.custom&&(k.exports.prototype[p.inspect.custom]=function(){var c=p.inspect({length:this.length});return this.constructor.name+" "+c})},{"safe-buffer":193,util:36}],185:[function(w,k,S){"use strict";function T(c,l){var a=this,u=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return u||s?(l?l(c):!c||this._writableState&&this._writableState.errorEmitted||p.nextTick(h,this,c),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(c||null,function(f){!l&&f?(p.nextTick(h,a,f),a._writableState&&(a._writableState.errorEmitted=!0)):l&&l(f)}),this)}function C(){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 h(c,l){c.emit("error",l)}var p=w("process-nextick-args");k.exports={destroy:T,undestroy:C}},{"process-nextick-args":172}],186:[function(w,k,S){"use strict";k.exports=w("events").EventEmitter},{events:158}],187:[function(w,k,S){k.exports=w("./readable").PassThrough},{"./readable":188}],188:[function(w,k,S){S=k.exports=w("./lib/_stream_readable.js"),S.Stream=S,S.Readable=S,S.Writable=w("./lib/_stream_writable.js"),S.Duplex=w("./lib/_stream_duplex.js"),S.Transform=w("./lib/_stream_transform.js"),S.PassThrough=w("./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(w,k,S){k.exports=w("./readable").Transform},{"./readable":188}],190:[function(w,k,S){k.exports=w("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":183}],191:[function(w,k,S){var T=function(){return this}()||Function("return this")(),C=T.regeneratorRuntime&&Object.getOwnPropertyNames(T).indexOf("regeneratorRuntime")>=0,h=C&&T.regeneratorRuntime;if(T.regeneratorRuntime=void 0,k.exports=w("./runtime"),C)T.regeneratorRuntime=h;else try{delete T.regeneratorRuntime}catch(p){T.regeneratorRuntime=void 0}},{"./runtime":192}],192:[function(w,k,S){!function(T){"use strict";function C(ne,$,Z,ue){var he=$&&$.prototype instanceof p?$:p,Oe=Object.create(he.prototype),we=new t(ue||[]);return Oe._invoke=s(ne,Z,we),Oe}function h(ne,$,Z){try{return{type:"normal",arg:ne.call($,Z)}}catch(ue){return{type:"throw",arg:ue}}}function p(){}function c(){}function l(){}function a(ne){["next","throw","return"].forEach(function($){ne[$]=function(Z){return this._invoke($,Z)}})}function u(ne){function $(he,Oe,we,Pe){var _e=h(ne[he],ne,Oe);if(_e.type!=="throw"){var xe=_e.arg,Ve=xe.value;return Ve&&typeof Ve=="object"&&_.call(Ve,"__await")?Promise.resolve(Ve.__await).then(function(Ne){$("next",Ne,we,Pe)},function(Ne){$("throw",Ne,we,Pe)}):Promise.resolve(Ve).then(function(Ne){xe.value=Ne,we(xe)},Pe)}Pe(_e.arg)}function Z(he,Oe){function we(){return new Promise(function(Pe,_e){$(he,Oe,Pe,_e)})}return ue=ue?ue.then(we,we):we()}var ue;this._invoke=Z}function s(ne,$,Z){var ue=O;return function(he,Oe){if(ue===N)throw new Error("Generator is already running");if(ue===W){if(he==="throw")throw Oe;return v()}for(Z.method=he,Z.arg=Oe;;){var we=Z.delegate;if(we){var Pe=f(we,Z);if(Pe){if(Pe===K)continue;return Pe}}if(Z.method==="next")Z.sent=Z._sent=Z.arg;else if(Z.method==="throw"){if(ue===O)throw ue=W,Z.arg;Z.dispatchException(Z.arg)}else Z.method==="return"&&Z.abrupt("return",Z.arg);ue=N;var _e=h(ne,$,Z);if(_e.type==="normal"){if(ue=Z.done?W:D,_e.arg===K)continue;return{value:_e.arg,done:Z.done}}_e.type==="throw"&&(ue=W,Z.method="throw",Z.arg=_e.arg)}}}function f(ne,$){var Z=ne.iterator[$.method];if(Z===g){if($.delegate=null,$.method==="throw"){if(ne.iterator.return&&($.method="return",$.arg=g,f(ne,$),$.method==="throw"))return K;$.method="throw",$.arg=new TypeError("The iterator does not provide a 'throw' method")}return K}var ue=h(Z,ne.iterator,$.arg);if(ue.type==="throw")return $.method="throw",$.arg=ue.arg,$.delegate=null,K;var he=ue.arg;return he?he.done?($[ne.resultName]=he.value,$.next=ne.nextLoc,$.method!=="return"&&($.method="next",$.arg=g),$.delegate=null,K):he:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,K)}function i(ne){var $={tryLoc:ne[0]};1 in ne&&($.catchLoc=ne[1]),2 in ne&&($.finallyLoc=ne[2],$.afterLoc=ne[3]),this.tryEntries.push($)}function n(ne){var $=ne.completion||{};$.type="normal",delete $.arg,ne.completion=$}function t(ne){this.tryEntries=[{tryLoc:"root"}],ne.forEach(i,this),this.reset(!0)}function d(ne){if(ne){var $=ne[y];if($)return $.call(ne);if(typeof ne.next=="function")return ne;if(!isNaN(ne.length)){var Z=-1,ue=function he(){for(;++Z<ne.length;)if(_.call(ne,Z))return he.value=ne[Z],he.done=!1,he;return he.value=g,he.done=!0,he};return ue.next=ue}}return{next:v}}function v(){return{value:g,done:!0}}var g,b=Object.prototype,_=b.hasOwnProperty,m=typeof Symbol=="function"?Symbol:{},y=m.iterator||"@@iterator",E=m.asyncIterator||"@@asyncIterator",o=m.toStringTag||"@@toStringTag",x=typeof k=="object",A=T.regeneratorRuntime;if(A)return void(x&&(k.exports=A));A=T.regeneratorRuntime=x?k.exports:{},A.wrap=C;var O="suspendedStart",D="suspendedYield",N="executing",W="completed",K={},oe={};oe[y]=function(){return this};var B=Object.getPrototypeOf,X=B&&B(B(d([])));X&&X!==b&&_.call(X,y)&&(oe=X);var V=l.prototype=p.prototype=Object.create(oe);c.prototype=V.constructor=l,l.constructor=c,l[o]=c.displayName="GeneratorFunction",A.isGeneratorFunction=function(ne){var $=typeof ne=="function"&&ne.constructor;return!!$&&($===c||($.displayName||$.name)==="GeneratorFunction")},A.mark=function(ne){return Object.setPrototypeOf?Object.setPrototypeOf(ne,l):(ne.__proto__=l,o in ne||(ne[o]="GeneratorFunction")),ne.prototype=Object.create(V),ne},A.awrap=function(ne){return{__await:ne}},a(u.prototype),u.prototype[E]=function(){return this},A.AsyncIterator=u,A.async=function(ne,$,Z,ue){var he=new u(C(ne,$,Z,ue));return A.isGeneratorFunction($)?he:he.next().then(function(Oe){return Oe.done?Oe.value:he.next()})},a(V),V[o]="Generator",V[y]=function(){return this},V.toString=function(){return"[object Generator]"},A.keys=function(ne){var $=[];for(var Z in ne)$.push(Z);return $.reverse(),function ue(){for(;$.length;){var he=$.pop();if(he in ne)return ue.value=he,ue.done=!1,ue}return ue.done=!0,ue}},A.values=d,t.prototype={constructor:t,reset:function(ne){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(n),!ne)for(var $ in this)$.charAt(0)==="t"&&_.call(this,$)&&!isNaN(+$.slice(1))&&(this[$]=g)},stop:function(){this.done=!0;var ne=this.tryEntries[0],$=ne.completion;if($.type==="throw")throw $.arg;return this.rval},dispatchException:function(ne){function $(_e,xe){return Oe.type="throw",Oe.arg=ne,Z.next=_e,xe&&(Z.method="next",Z.arg=g),!!xe}if(this.done)throw ne;for(var Z=this,ue=this.tryEntries.length-1;ue>=0;--ue){var he=this.tryEntries[ue],Oe=he.completion;if(he.tryLoc==="root")return $("end");if(he.tryLoc<=this.prev){var we=_.call(he,"catchLoc"),Pe=_.call(he,"finallyLoc");if(we&&Pe){if(this.prev<he.catchLoc)return $(he.catchLoc,!0);if(this.prev<he.finallyLoc)return $(he.finallyLoc)}else if(we){if(this.prev<he.catchLoc)return $(he.catchLoc,!0)}else{if(!Pe)throw new Error("try statement without catch or finally");if(this.prev<he.finallyLoc)return $(he.finallyLoc)}}}},abrupt:function(ne,$){for(var Z=this.tryEntries.length-1;Z>=0;--Z){var ue=this.tryEntries[Z];if(ue.tryLoc<=this.prev&&_.call(ue,"finallyLoc")&&this.prev<ue.finallyLoc){var he=ue;break}}he&&(ne==="break"||ne==="continue")&&he.tryLoc<=$&&$<=he.finallyLoc&&(he=null);var Oe=he?he.completion:{};return Oe.type=ne,Oe.arg=$,he?(this.method="next",this.next=he.finallyLoc,K):this.complete(Oe)},complete:function(ne,$){if(ne.type==="throw")throw ne.arg;return ne.type==="break"||ne.type==="continue"?this.next=ne.arg:ne.type==="return"?(this.rval=this.arg=ne.arg,this.method="return",this.next="end"):ne.type==="normal"&&$&&(this.next=$),K},finish:function(ne){for(var $=this.tryEntries.length-1;$>=0;--$){var Z=this.tryEntries[$];if(Z.finallyLoc===ne)return this.complete(Z.completion,Z.afterLoc),n(Z),K}},catch:function(ne){for(var $=this.tryEntries.length-1;$>=0;--$){var Z=this.tryEntries[$];if(Z.tryLoc===ne){var ue=Z.completion;if(ue.type==="throw"){var he=ue.arg;n(Z)}return he}}throw new Error("illegal catch attempt")},delegateYield:function(ne,$,Z){return this.delegate={iterator:d(ne),resultName:$,nextLoc:Z},this.method==="next"&&(this.arg=g),K}}}(function(){return this}()||Function("return this")())},{}],193:[function(w,k,S){function T(c,l){for(var a in c)l[a]=c[a]}function C(c,l,a){return p(c,l,a)}var h=w("buffer"),p=h.Buffer;p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?k.exports=h:(T(h,S),S.Buffer=C),T(p,C),C.from=function(c,l,a){if(typeof c=="number")throw new TypeError("Argument must not be a number");return p(c,l,a)},C.alloc=function(c,l,a){if(typeof c!="number")throw new TypeError("Argument must be a number");var u=p(c);return l!==void 0?typeof a=="string"?u.fill(l,a):u.fill(l):u.fill(0),u},C.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return p(c)},C.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return h.SlowBuffer(c)}},{buffer:38}],194:[function(w,k,S){(function(T){"use strict";function C(v){return v&&v.__esModule?v:{default:v}}var h=w("babel-runtime/core-js/string/from-code-point"),p=C(h),c=w("babel-runtime/core-js/json/stringify"),l=C(c),a=w("babel-runtime/helpers/typeof"),u=C(a),s=w("babel-runtime/core-js/object/define-property"),f=C(s),i=w("babel-runtime/core-js/object/keys"),n=C(i),t=w("babel-runtime/core-js/object/create"),d=C(t);!function(v){function g(Y,J){if(!(this instanceof g))return new g(Y,J);var Ee=this;_(Ee),Ee.q=Ee.c="",Ee.bufferCheckPosition=v.MAX_BUFFER_LENGTH,Ee.opt=J||{},Ee.opt.lowercase=Ee.opt.lowercase||Ee.opt.lowercasetags,Ee.looseCase=Ee.opt.lowercase?"toLowerCase":"toUpperCase",Ee.tags=[],Ee.closed=Ee.closedRoot=Ee.sawRoot=!1,Ee.tag=Ee.error=null,Ee.strict=!!Y,Ee.noscript=!(!Y&&!Ee.opt.noscript),Ee.state=U.BEGIN,Ee.strictEntities=Ee.opt.strictEntities,Ee.ENTITIES=Ee.strictEntities?(0,d.default)(v.XML_ENTITIES):(0,d.default)(v.ENTITIES),Ee.attribList=[],Ee.opt.xmlns&&(Ee.ns=(0,d.default)(We)),Ee.trackPosition=Ee.opt.position!==!1,Ee.trackPosition&&(Ee.position=Ee.line=Ee.column=0),N(Ee,"onready")}function b(Y){for(var J=Math.max(v.MAX_BUFFER_LENGTH,10),Ee=0,ke=0,ht=xe.length;ke<ht;ke++){var Ue=Y[xe[ke]].length;if(Ue>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:B(Y,"Max buffer length exceeded: "+xe[ke])}Ee=Math.max(Ee,Ue)}var je=v.MAX_BUFFER_LENGTH-Ee;Y.bufferCheckPosition=je+Y.position}function _(Y){for(var J=0,Ee=xe.length;J<Ee;J++)Y[xe[J]]=""}function m(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 E(Y,J)}function E(Y,J){if(!(this instanceof E))return new E(Y,J);Ve.apply(this),this._parser=new g(Y,J),this.writable=!0,this.readable=!0;var Ee=this;this._parser.onend=function(){Ee.emit("end")},this._parser.onerror=function(ke){Ee.emit("error",ke),Ee._parser.error=null},this._decoder=null,Ne.forEach(function(ke){(0,f.default)(Ee,"on"+ke,{get:function(){return Ee._parser["on"+ke]},set:function(ht){if(!ht)return Ee.removeAllListeners(ke),Ee._parser["on"+ke]=ht,ht;Ee.on(ke,ht)},enumerable:!0,configurable:!1})})}function o(Y){return Y===" "||Y===`
|
|
|
`||Y==="\r"||Y===" "}function x(Y){return Y==='"'||Y==="'"}function A(Y){return Y===">"||o(Y)}function O(Y,J){return Y.test(J)}function D(Y,J){return!O(Y,J)}function N(Y,J,Ee){Y[J]&&Y[J](Ee)}function W(Y,J,Ee){Y.textNode&&K(Y),N(Y,J,Ee)}function K(Y){Y.textNode=oe(Y.opt,Y.textNode),Y.textNode&&N(Y,"ontext",Y.textNode),Y.textNode=""}function oe(Y,J){return Y.trim&&(J=J.trim()),Y.normalize&&(J=J.replace(/\s+/g," ")),J}function B(Y,J){return K(Y),Y.trackPosition&&(J+=`
|
|
|
Line: `+Y.line+`
|
|
|
Column: `+Y.column+`
|
|
|
Char: `+Y.c),J=new Error(J),Y.error=J,N(Y,"onerror",J),Y}function X(Y){return Y.sawRoot&&!Y.closedRoot&&V(Y,"Unclosed root tag"),Y.state!==U.BEGIN&&Y.state!==U.BEGIN_WHITESPACE&&Y.state!==U.TEXT&&B(Y,"Unexpected end"),K(Y),Y.c="",Y.closed=!0,N(Y,"onend"),g.call(Y,Y.strict,Y.opt),Y}function V(Y,J){if((Y===void 0?"undefined":(0,u.default)(Y))!=="object"||!(Y instanceof g))throw new Error("bad call to strictFail");Y.strict&&B(Y,J)}function ne(Y){Y.strict||(Y.tagName=Y.tagName[Y.looseCase]());var J=Y.tags[Y.tags.length-1]||Y,Ee=Y.tag={name:Y.tagName,attributes:{}};Y.opt.xmlns&&(Ee.ns=J.ns),Y.attribList.length=0,W(Y,"onopentagstart",Ee)}function $(Y,J){var Ee=Y.indexOf(":"),ke=Ee<0?["",Y]:Y.split(":"),ht=ke[0],Ue=ke[1];return J&&Y==="xmlns"&&(ht="xmlns",Ue=""),{prefix:ht,local:Ue}}function Z(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),Ee=J.prefix,ke=J.local;if(Ee==="xmlns")if(ke==="xml"&&Y.attribValue!==ye)V(Y,"xml: prefix must be bound to "+ye+`
|
|
|
Actual: `+Y.attribValue);else if(ke==="xmlns"&&Y.attribValue!==me)V(Y,"xmlns: prefix must be bound to "+me+`
|
|
|
Actual: `+Y.attribValue);else{var ht=Y.tag,Ue=Y.tags[Y.tags.length-1]||Y;ht.ns===Ue.ns&&(ht.ns=(0,d.default)(Ue.ns)),ht.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 ue(Y,J){if(Y.opt.xmlns){var Ee=Y.tag,ke=$(Y.tagName);Ee.prefix=ke.prefix,Ee.local=ke.local,Ee.uri=Ee.ns[ke.prefix]||"",Ee.prefix&&!Ee.uri&&(V(Y,"Unbound namespace prefix: "+(0,l.default)(Y.tagName)),Ee.uri=ke.prefix);var ht=Y.tags[Y.tags.length-1]||Y;Ee.ns&&ht.ns!==Ee.ns&&(0,n.default)(Ee.ns).forEach(function(Te){W(Y,"onopennamespace",{prefix:Te,uri:Ee.ns[Te]})});for(var Ue=0,je=Y.attribList.length;Ue<je;Ue++){var tt=Y.attribList[Ue],dt=tt[0],qe=tt[1],Ye=$(dt,!0),Fe=Ye.prefix,Ie=Ye.local,Me=Fe===""?"":Ee.ns[Fe]||"",be={name:dt,value:qe,prefix:Fe,local:Ie,uri:Me};Fe&&Fe!=="xmlns"&&!Me&&(V(Y,"Unbound namespace prefix: "+(0,l.default)(Fe)),be.uri=Fe),Y.tag.attributes[dt]=be,W(Y,"onattribute",be)}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 he(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,Ee=Y.tagName;Y.strict||(Ee=Ee[Y.looseCase]());for(var ke=Ee;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=Ee;for(var ht=Y.tags.length;ht-- >J;){var Ue=Y.tag=Y.tags.pop();Y.tagName=Y.tag.name,W(Y,"onclosetag",Y.tagName);var je={};for(var tt in Ue.ns)je[tt]=Ue.ns[tt];var dt=Y.tags[Y.tags.length-1]||Y;Y.opt.xmlns&&Ue.ns!==dt.ns&&(0,n.default)(Ue.ns).forEach(function(qe){var Ye=Ue.ns[qe];W(Y,"onclosenamespace",{prefix:qe,uri:Ye})})}J===0&&(Y.closedRoot=!0),Y.tagName=Y.attribValue=Y.attribName="",Y.attribList.length=0,Y.state=U.TEXT}function Oe(Y){var J,Ee=Y.entity,ke=Ee.toLowerCase(),ht="";return Y.ENTITIES[Ee]?Y.ENTITIES[Ee]:Y.ENTITIES[ke]?Y.ENTITIES[ke]:(Ee=ke,Ee.charAt(0)==="#"&&(Ee.charAt(1)==="x"?(Ee=Ee.slice(2),J=parseInt(Ee,16),ht=J.toString(16)):(Ee=Ee.slice(1),J=parseInt(Ee,10),ht=J.toString(10))),Ee=Ee.replace(/^0+/,""),isNaN(J)||ht.toLowerCase()!==Ee?(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):o(J)||(V(Y,"Non-whitespace before first tag."),Y.textNode=J,Y.state=U.TEXT)}function Pe(Y,J){var Ee="";return J<Y.length&&(Ee=Y.charAt(J)),Ee}function _e(Y){var J=this;if(this.error)throw this.error;if(J.closed)return B(J,"Cannot write after close. Assign an onready handler.");if(Y===null)return X(J);(Y===void 0?"undefined":(0,u.default)(Y))==="object"&&(Y=Y.toString());for(var Ee=0,ke="";!(ke=Pe(Y,Ee++),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 ht=Ee-1;ke&&ke!=="<"&&ke!=="&";)(ke=Pe(Y,Ee++))&&J.trackPosition&&(J.position++,ke===`
|
|
|
`?(J.line++,J.column=0):J.column++);J.textNode+=Y.substring(ht,Ee-1)}ke!=="<"||J.sawRoot&&J.closedRoot&&!J.strict?(o(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(!o(ke))if(O(He,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 Ue=J.position-J.startTagPosition;ke=new Array(Ue).join(" ")+ke}J.textNode+="<"+ke,J.state=U.TEXT}continue;case U.SGML_DECL:(J.sgmlDecl+ke).toUpperCase()===Be?(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):(x(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:x(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:x(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=oe(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:o(ke)?J.state=U.PROC_INST_BODY:J.procInstName+=ke;continue;case U.PROC_INST_BODY:if(!J.procInstBody&&o(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:O(nt,ke)?J.tagName+=ke:(ne(J),ke===">"?ue(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:(o(ke)||V(J,"Invalid character in tag name"),J.state=U.ATTRIB));continue;case U.OPEN_TAG_SLASH:ke===">"?(ue(J,!0),he(J)):(V(J,"Forward-slash in opening tag not followed by >"),J.state=U.ATTRIB);continue;case U.ATTRIB:if(o(ke))continue;ke===">"?ue(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:O(He,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,Z(J),ue(J)):o(ke)?J.state=U.ATTRIB_NAME_SAW_WHITE:O(nt,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(o(ke))continue;V(J,"Attribute without value"),J.tag.attributes[J.attribName]="",J.attribValue="",W(J,"onattribute",{name:J.attribName,value:""}),J.attribName="",ke===">"?ue(J):O(He,ke)?(J.attribName=ke,J.state=U.ATTRIB_NAME):(V(J,"Invalid attribute name"),J.state=U.ATTRIB)}continue;case U.ATTRIB_VALUE:if(o(ke))continue;x(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}Z(J),J.q="",J.state=U.ATTRIB_VALUE_CLOSED;continue;case U.ATTRIB_VALUE_CLOSED:o(ke)?J.state=U.ATTRIB:ke===">"?ue(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:O(He,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(!A(ke)){ke==="&"?J.state=U.ATTRIB_VALUE_ENTITY_U:J.attribValue+=ke;continue}Z(J),ke===">"?ue(J):J.state=U.ATTRIB;continue;case U.CLOSE_TAG:if(J.tagName)ke===">"?he(J):O(nt,ke)?J.tagName+=ke:J.script?(J.script+="</"+J.tagName,J.tagName="",J.state=U.SCRIPT):(o(ke)||V(J,"Invalid tagname in closing tag"),J.state=U.CLOSE_TAG_SAW_WHITE);else{if(o(ke))continue;D(He,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(o(ke))continue;ke===">"?he(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 je,tt;switch(J.state){case U.TEXT_ENTITY:je=U.TEXT,tt="textNode";break;case U.ATTRIB_VALUE_ENTITY_Q:je=U.ATTRIB_VALUE_QUOTED,tt="attribValue";break;case U.ATTRIB_VALUE_ENTITY_U:je=U.ATTRIB_VALUE_UNQUOTED,tt="attribValue"}ke===";"?(J[tt]+=Oe(J),J.entity="",J.state=je):O(J.entity.length?P:te,ke)?J.entity+=ke:(V(J,"Invalid character in entity name"),J[tt]+="&"+J.entity+ke,J.entity="",J.state=je);continue;default:throw new Error(J,"Unknown state: "+J.state)}return J.position>=J.bufferCheckPosition&&b(J),J}v.parser=function(Y,J){return new g(Y,J)},v.SAXParser=g,v.SAXStream=E,v.createStream=y,v.MAX_BUFFER_LENGTH=65536;var xe=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];v.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],d.default||(Object.create=function(Y){function J(){}return J.prototype=Y,new J}),n.default||(Object.keys=function(Y){var J=[];for(var Ee in Y)Y.hasOwnProperty(Ee)&&J.push(Ee);return J}),g.prototype={end:function(){X(this)},write:_e,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){m(this)}};var Ve;try{Ve=w("stream").Stream}catch(Y){Ve=function(){}}var Ne=v.EVENTS.filter(function(Y){return Y!=="error"&&Y!=="end"});E.prototype=(0,d.default)(Ve.prototype,{constructor:{value:E}}),E.prototype.write=function(Y){if(typeof T=="function"&&typeof T.isBuffer=="function"&&T.isBuffer(Y)){if(!this._decoder){var J=w("string_decoder").StringDecoder;this._decoder=new J("utf8")}Y=this._decoder.write(Y)}return this._parser.write(Y.toString()),this.emit("data",Y),!0},E.prototype.end=function(Y){return Y&&Y.length&&this.write(Y),this._parser.end(),!0},E.prototype.on=function(Y,J){var Ee=this;return Ee._parser["on"+Y]||Ne.indexOf(Y)===-1||(Ee._parser["on"+Y]=function(){var ke=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ke.splice(0,0,Y),Ee.emit.apply(Ee,ke)}),Ve.prototype.on.call(Ee,Y,J)};var Be="[CDATA[",ze="DOCTYPE",ye="http://www.w3.org/XML/1998/namespace",me="http://www.w3.org/2000/xmlns/",We={xml:ye,xmlns:me},He=/[:_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]/,nt=/[:_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-]/,te=/[#:_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]/,P=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,U=0;v.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++},v.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},v.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,n.default)(v.ENTITIES).forEach(function(Y){var J=v.ENTITIES[Y],Ee=typeof J=="number"?String.fromCharCode(J):J;v.ENTITIES[Y]=Ee});for(var q in v.STATE)v.STATE[v.STATE[q]]=q;U=v.STATE,p.default||function(){var Y=String.fromCharCode,J=Math.floor,Ee=function(){var ke,ht,Ue=[],je=-1,tt=arguments.length;if(!tt)return"";for(var dt="";++je<tt;){var qe=Number(arguments[je]);if(!isFinite(qe)||qe<0||qe>1114111||J(qe)!==qe)throw RangeError("Invalid code point: "+qe);qe<=65535?Ue.push(qe):(qe-=65536,ke=55296+(qe>>10),ht=qe%1024+56320,Ue.push(ke,ht)),(je+1===tt||Ue.length>16384)&&(dt+=Y.apply(null,Ue),Ue.length=0)}return dt};f.default?Object.defineProperty(String,"fromCodePoint",{value:Ee,configurable:!0,writable:!0}):String.fromCodePoint=Ee}()}(S===void 0?(void 0).sax={}:S)}).call(this,w("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(w,k,S){function T(){C.call(this)}k.exports=T;var C=w("events").EventEmitter;w("inherits")(T,C),T.Readable=w("readable-stream/readable.js"),T.Writable=w("readable-stream/writable.js"),T.Duplex=w("readable-stream/duplex.js"),T.Transform=w("readable-stream/transform.js"),T.PassThrough=w("readable-stream/passthrough.js"),T.Stream=T,T.prototype.pipe=function(h,p){function c(t){h.writable&&h.write(t)===!1&&i.pause&&i.pause()}function l(){i.readable&&i.resume&&i.resume()}function a(){n||(n=!0,h.end())}function u(){n||(n=!0,typeof h.destroy=="function"&&h.destroy())}function s(t){if(f(),C.listenerCount(this,"error")===0)throw t}function f(){i.removeListener("data",c),h.removeListener("drain",l),i.removeListener("end",a),i.removeListener("close",u),i.removeListener("error",s),h.removeListener("error",s),i.removeListener("end",f),i.removeListener("close",f),h.removeListener("close",f)}var i=this;i.on("data",c),h.on("drain",l),h._isStdio||p&&p.end===!1||(i.on("end",a),i.on("close",u));var n=!1;return i.on("error",s),h.on("error",s),i.on("end",f),i.on("close",f),h.on("close",f),h.emit("pipe",i),h}},{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(w,k,S){(function(T){var C=w("./lib/request"),h=w("./lib/response"),p=w("xtend"),c=w("builtin-status-codes"),l=w("url"),a=S;a.request=function(u,s){u=typeof u=="string"?l.parse(u):p(u);var f=T.location.protocol.search(/^https?:$/)===-1?"http:":"",i=u.protocol||f,n=u.hostname||u.host,t=u.port,d=u.path||"/";n&&n.indexOf(":")!==-1&&(n="["+n+"]"),u.url=(n?i+"//"+n:"")+(t?":"+t:"")+d,u.method=(u.method||"GET").toUpperCase(),u.headers=u.headers||{};var v=new C(u);return s&&v.on("response",s),v},a.get=function(u,s){var f=a.request(u,s);return f.end(),f},a.ClientRequest=C,a.IncomingMessage=h.IncomingMessage,a.Agent=function(){},a.Agent.defaultMaxSockets=4,a.globalAgent=new a.Agent,a.STATUS_CODES=c,a.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 de!="undefined"?de:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":198,"./lib/response":199,"builtin-status-codes":39,url:203,xtend:236}],197:[function(w,k,S){(function(T){"use strict";function C(){if(c!==void 0)return c;if(T.XMLHttpRequest){c=new T.XMLHttpRequest;try{c.open("GET",T.XDomainRequest?"/":"https://example.com")}catch(u){c=null}}else c=null;return c}function h(u){var s=C();if(!s)return!1;try{return s.responseType=u,s.responseType===u}catch(f){}return!1}function p(u){return typeof u=="function"}S.fetch=p(T.fetch)&&p(T.ReadableStream),S.writableStream=p(T.WritableStream),S.abortController=p(T.AbortController),S.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),S.blobConstructor=!0}catch(u){}var c,l=T.ArrayBuffer!==void 0,a=l&&p(T.ArrayBuffer.prototype.slice);S.arraybuffer=S.fetch||l&&h("arraybuffer"),S.msstream=!S.fetch&&a&&h("ms-stream"),S.mozchunkedarraybuffer=!S.fetch&&l&&h("moz-chunked-arraybuffer"),S.overrideMimeType=S.fetch||!!C()&&p(C().overrideMimeType),S.vbArray=p(T.VBArray),c=null}).call(this,typeof de!="undefined"?de:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],198:[function(w,k,S){(function(T,C,h){"use strict";function p(b,_){return u.fetch&&_?"fetch":u.mozchunkedarraybuffer?"moz-chunked-arraybuffer":u.msstream?"ms-stream":u.arraybuffer&&b?"arraybuffer":u.vbArray&&b?"text:vbarray":"text"}function c(b){try{var _=b.status;return _!==null&&_!==0}catch(m){return!1}}var l=w("babel-runtime/core-js/object/keys"),a=function(b){return b&&b.__esModule?b:{default:b}}(l),u=w("./capability"),s=w("inherits"),f=w("./response"),i=w("readable-stream"),n=w("to-arraybuffer"),t=f.IncomingMessage,d=f.readyStates,v=k.exports=function(b){var _=this;i.Writable.call(_),_._opts=b,_._body=[],_._headers={},b.auth&&_.setHeader("Authorization","Basic "+new h(b.auth).toString("base64")),(0,a.default)(b.headers).forEach(function(E){_.setHeader(E,b.headers[E])});var m,y=!0;if(b.mode==="disable-fetch"||"requestTimeout"in b&&!u.abortController)y=!1,m=!0;else if(b.mode==="prefer-streaming")m=!1;else if(b.mode==="allow-wrong-content-type")m=!u.overrideMimeType;else{if(b.mode&&b.mode!=="default"&&b.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");m=!0}_._mode=p(m,y),_._fetchTimer=null,_.on("finish",function(){_._onFinish()})};s(v,i.Writable),v.prototype.setHeader=function(b,_){var m=this,y=b.toLowerCase();g.indexOf(y)===-1&&(m._headers[y]={name:b,value:_})},v.prototype.getHeader=function(b){var _=this._headers[b.toLowerCase()];return _?_.value:null},v.prototype.removeHeader=function(b){delete this._headers[b.toLowerCase()]},v.prototype._onFinish=function(){var b=this;if(!b._destroyed){var _=b._opts,m=b._headers,y=null;_.method!=="GET"&&_.method!=="HEAD"&&(y=u.arraybuffer?n(h.concat(b._body)):u.blobConstructor?new C.Blob(b._body.map(function(O){return n(O)}),{type:(m["content-type"]||{}).value||""}):h.concat(b._body).toString());var E=[];if((0,a.default)(m).forEach(function(O){var D=m[O].name,N=m[O].value;Array.isArray(N)?N.forEach(function(W){E.push([D,W])}):E.push([D,N])}),b._mode==="fetch"){var o=null;if(u.abortController){var x=new AbortController;o=x.signal,b._fetchAbortController=x,"requestTimeout"in _&&_.requestTimeout!==0&&(b._fetchTimer=C.setTimeout(function(){b.emit("requestTimeout"),b._fetchAbortController&&b._fetchAbortController.abort()},_.requestTimeout))}C.fetch(b._opts.url,{method:b._opts.method,headers:E,body:y||void 0,mode:"cors",credentials:_.withCredentials?"include":"same-origin",signal:o}).then(function(O){b._fetchResponse=O,b._connect()},function(O){C.clearTimeout(b._fetchTimer),b._destroyed||b.emit("error",O)})}else{var A=b._xhr=new C.XMLHttpRequest;try{A.open(b._opts.method,b._opts.url,!0)}catch(O){return void T.nextTick(function(){b.emit("error",O)})}"responseType"in A&&(A.responseType=b._mode.split(":")[0]),"withCredentials"in A&&(A.withCredentials=!!_.withCredentials),b._mode==="text"&&"overrideMimeType"in A&&A.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in _&&(A.timeout=_.requestTimeout,A.ontimeout=function(){b.emit("requestTimeout")}),E.forEach(function(O){A.setRequestHeader(O[0],O[1])}),b._response=null,A.onreadystatechange=function(){switch(A.readyState){case d.LOADING:case d.DONE:b._onXHRProgress()}},b._mode==="moz-chunked-arraybuffer"&&(A.onprogress=function(){b._onXHRProgress()}),A.onerror=function(){b._destroyed||b.emit("error",new Error("XHR error"))};try{A.send(y)}catch(O){return void T.nextTick(function(){b.emit("error",O)})}}}},v.prototype._onXHRProgress=function(){var b=this;c(b._xhr)&&!b._destroyed&&(b._response||b._connect(),b._response._onXHRProgress())},v.prototype._connect=function(){var b=this;b._destroyed||(b._response=new t(b._xhr,b._fetchResponse,b._mode,b._fetchTimer),b._response.on("error",function(_){b.emit("error",_)}),b.emit("response",b._response))},v.prototype._write=function(b,_,m){this._body.push(b),m()},v.prototype.abort=v.prototype.destroy=function(){var b=this;b._destroyed=!0,C.clearTimeout(b._fetchTimer),b._response&&(b._response._destroyed=!0),b._xhr?b._xhr.abort():b._fetchAbortController&&b._fetchAbortController.abort()},v.prototype.end=function(b,_,m){var y=this;typeof b=="function"&&(m=b,b=void 0),i.Writable.prototype.end.call(y,b,_,m)},v.prototype.flushHeaders=function(){},v.prototype.setTimeout=function(){},v.prototype.setNoDelay=function(){},v.prototype.setSocketKeepAlive=function(){};var g=["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,w("_process"),typeof de!="undefined"?de:typeof self!="undefined"?self:typeof window!="undefined"?window:{},w("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(w,k,S){(function(T,C,h){"use strict";var p=w("babel-runtime/core-js/promise"),c=function(i){return i&&i.__esModule?i:{default:i}}(p),l=w("./capability"),a=w("inherits"),u=w("readable-stream"),s=S.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},f=S.IncomingMessage=function(i,n,t,d){var v=this;if(u.Readable.call(v),v._mode=t,v.headers={},v.rawHeaders=[],v.trailers={},v.rawTrailers=[],v.on("end",function(){T.nextTick(function(){v.emit("close")})}),t==="fetch"){if(v._fetchResponse=n,v.url=n.url,v.statusCode=n.status,v.statusMessage=n.statusText,n.headers.forEach(function(y,E){v.headers[E.toLowerCase()]=y,v.rawHeaders.push(E,y)}),l.writableStream){var g=new WritableStream({write:function(y){return new c.default(function(E,o){v._destroyed?o():v.push(new h(y))?E():v._resumeFetch=E})},close:function(){C.clearTimeout(d),v._destroyed||v.push(null)},abort:function(y){v._destroyed||v.emit("error",y)}});try{return void n.body.pipeTo(g).catch(function(y){C.clearTimeout(d),v._destroyed||v.emit("error",y)})}catch(y){}}var b=n.body.getReader();!function y(){b.read().then(function(E){if(!v._destroyed){if(E.done)return C.clearTimeout(d),void v.push(null);v.push(new h(E.value)),y()}}).catch(function(E){C.clearTimeout(d),v._destroyed||v.emit("error",E)})}()}else if(v._xhr=i,v._pos=0,v.url=i.responseURL,v.statusCode=i.status,v.statusMessage=i.statusText,i.getAllResponseHeaders().split(/\r?\n/).forEach(function(y){var E=y.match(/^([^:]+):\s*(.*)/);if(E){var o=E[1].toLowerCase();o==="set-cookie"?(v.headers[o]===void 0&&(v.headers[o]=[]),v.headers[o].push(E[2])):v.headers[o]!==void 0?v.headers[o]+=", "+E[2]:v.headers[o]=E[2],v.rawHeaders.push(E[1],E[2])}}),v._charset="x-user-defined",!l.overrideMimeType){var _=v.rawHeaders["mime-type"];if(_){var m=_.match(/;\s*charset=([^;])(;|$)/);m&&(v._charset=m[1].toLowerCase())}v._charset||(v._charset="utf-8")}};a(f,u.Readable),f.prototype._read=function(){var i=this,n=i._resumeFetch;n&&(i._resumeFetch=null,n())},f.prototype._onXHRProgress=function(){var i=this,n=i._xhr,t=null;switch(i._mode){case"text:vbarray":if(n.readyState!==s.DONE)break;try{t=new C.VBArray(n.responseBody).toArray()}catch(_){}if(t!==null){i.push(new h(t));break}case"text":try{t=n.responseText}catch(_){i._mode="text:vbarray";break}if(t.length>i._pos){var d=t.substr(i._pos);if(i._charset==="x-user-defined"){for(var v=new h(d.length),g=0;g<d.length;g++)v[g]=255&d.charCodeAt(g);i.push(v)}else i.push(d,i._charset);i._pos=t.length}break;case"arraybuffer":if(n.readyState!==s.DONE||!n.response)break;t=n.response,i.push(new h(new Uint8Array(t)));break;case"moz-chunked-arraybuffer":if(t=n.response,n.readyState!==s.LOADING||!t)break;i.push(new h(new Uint8Array(t)));break;case"ms-stream":if(t=n.response,n.readyState!==s.LOADING)break;var b=new C.MSStreamReader;b.onprogress=function(){b.result.byteLength>i._pos&&(i.push(new h(new Uint8Array(b.result.slice(i._pos)))),i._pos=b.result.byteLength)},b.onload=function(){i.push(null)},b.readAsArrayBuffer(t)}i._xhr.readyState===s.DONE&&i._mode!=="ms-stream"&&i.push(null)}}).call(this,w("_process"),typeof de!="undefined"?de:typeof self!="undefined"?self:typeof window!="undefined"?window:{},w("buffer").Buffer)},{"./capability":197,_process:173,"babel-runtime/core-js/promise":24,buffer:38,inherits:162,"readable-stream":188}],200:[function(w,k,S){"use strict";function T(_){if(!_)return"utf8";for(var m;;)switch(_){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 _;default:if(m)return;_=(""+_).toLowerCase(),m=!0}}function C(_){var m=T(_);if(typeof m!="string"&&(g.isEncoding===b||!b(_)))throw new Error("Unknown encoding: "+_);return m||_}function h(_){this.encoding=C(_);var m;switch(this.encoding){case"utf16le":this.text=f,this.end=i,m=4;break;case"utf8":this.fillLast=a,m=4;break;case"base64":this.text=n,this.end=t,m=3;break;default:return this.write=d,void(this.end=v)}this.lastNeed=0,this.lastTotal=0,this.lastChar=g.allocUnsafe(m)}function p(_){return _<=127?0:_>>5==6?2:_>>4==14?3:_>>3==30?4:_>>6==2?-1:-2}function c(_,m,y){var E=m.length-1;if(E<y)return 0;var o=p(m[E]);return o>=0?(o>0&&(_.lastNeed=o-1),o):--E<y||o===-2?0:(o=p(m[E]))>=0?(o>0&&(_.lastNeed=o-2),o):--E<y||o===-2?0:(o=p(m[E]),o>=0?(o>0&&(o===2?o=0:_.lastNeed=o-3),o):0)}function l(_,m,y){if((192&m[0])!=128)return _.lastNeed=0,"\u951F\uFFFD";if(_.lastNeed>1&&m.length>1){if((192&m[1])!=128)return _.lastNeed=1,"\u951F\uFFFD";if(_.lastNeed>2&&m.length>2&&(192&m[2])!=128)return _.lastNeed=2,"\u951F\uFFFD"}}function a(_){var m=this.lastTotal-this.lastNeed,y=l(this,_,m);return y!==void 0?y:this.lastNeed<=_.length?(_.copy(this.lastChar,m,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(_.copy(this.lastChar,m,0,_.length),void(this.lastNeed-=_.length))}function u(_,m){var y=c(this,_,m);if(!this.lastNeed)return _.toString("utf8",m);this.lastTotal=y;var E=_.length-(y-this.lastNeed);return _.copy(this.lastChar,0,E),_.toString("utf8",m,E)}function s(_){var m=_&&_.length?this.write(_):"";return this.lastNeed?m+"\u951F\uFFFD":m}function f(_,m){if((_.length-m)%2==0){var y=_.toString("utf16le",m);if(y){var E=y.charCodeAt(y.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=_[_.length-1],_.toString("utf16le",m,_.length-1)}function i(_){var m=_&&_.length?this.write(_):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return m+this.lastChar.toString("utf16le",0,y)}return m}function n(_,m){var y=(_.length-m)%3;return y===0?_.toString("base64",m):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=_[_.length-1]:(this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1]),_.toString("base64",m,_.length-y))}function t(_){var m=_&&_.length?this.write(_):"";return this.lastNeed?m+this.lastChar.toString("base64",0,3-this.lastNeed):m}function d(_){return _.toString(this.encoding)}function v(_){return _&&_.length?this.write(_):""}var g=w("safe-buffer").Buffer,b=g.isEncoding||function(_){switch((_=""+_)&&_.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}};S.StringDecoder=h,h.prototype.write=function(_){if(_.length===0)return"";var m,y;if(this.lastNeed){if((m=this.fillLast(_))===void 0)return"";y=this.lastNeed,this.lastNeed=0}else y=0;return y<_.length?m?m+this.text(_,y):this.text(_,y):m||""},h.prototype.end=s,h.prototype.text=u,h.prototype.fillLast=function(_){if(this.lastNeed<=_.length)return _.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_.copy(this.lastChar,this.lastTotal-this.lastNeed,0,_.length),this.lastNeed-=_.length}},{"safe-buffer":193}],201:[function(w,k,S){(function(T,C){function h(s,f){this._id=s,this._clearFn=f}var p=w("process/browser.js").nextTick,c=Function.prototype.apply,l=Array.prototype.slice,a={},u=0;S.setTimeout=function(){return new h(c.call(setTimeout,window,arguments),clearTimeout)},S.setInterval=function(){return new h(c.call(setInterval,window,arguments),clearInterval)},S.clearTimeout=S.clearInterval=function(s){s.close()},h.prototype.unref=h.prototype.ref=function(){},h.prototype.close=function(){this._clearFn.call(window,this._id)},S.enroll=function(s,f){clearTimeout(s._idleTimeoutId),s._idleTimeout=f},S.unenroll=function(s){clearTimeout(s._idleTimeoutId),s._idleTimeout=-1},S._unrefActive=S.active=function(s){clearTimeout(s._idleTimeoutId);var f=s._idleTimeout;f>=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},f))},S.setImmediate=typeof T=="function"?T:function(s){var f=u++,i=!(arguments.length<2)&&l.call(arguments,1);return a[f]=!0,p(function(){a[f]&&(i?s.apply(null,i):s.call(null),S.clearImmediate(f))}),f},S.clearImmediate=typeof C=="function"?C:function(s){delete a[s]}}).call(this,w("timers").setImmediate,w("timers").clearImmediate)},{"process/browser.js":173,timers:201}],202:[function(w,k,S){var T=w("buffer").Buffer;k.exports=function(C){if(C instanceof Uint8Array){if(C.byteOffset===0&&C.byteLength===C.buffer.byteLength)return C.buffer;if(typeof C.buffer.slice=="function")return C.buffer.slice(C.byteOffset,C.byteOffset+C.byteLength)}if(T.isBuffer(C)){for(var h=new Uint8Array(C.length),p=C.length,c=0;c<p;c++)h[c]=C[c];return h.buffer}throw new Error("Argument must be a Buffer")}},{buffer:38}],203:[function(w,k,S){"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 C(o,x,A){if(o&&a.isObject(o)&&o instanceof T)return o;var O=new T;return O.parse(o,x,A),O}function h(o){return a.isString(o)&&(o=C(o)),o instanceof T?o.format():T.prototype.format.call(o)}function p(o,x){return C(o,!1,!0).resolve(x)}function c(o,x){return o?C(o,!1,!0).resolveObject(x):x}var l=w("punycode"),a=w("./util");S.parse=C,S.resolve=p,S.resolveObject=c,S.format=h,S.Url=T;var u=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,i=["<",">",'"',"`"," ","\r",`
|
|
|
`," "],n=["{","}","|","\\","^","`"].concat(i),t=["'"].concat(n),d=["%","/","?",";","#"].concat(t),v=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_={javascript:!0,"javascript:":!0},m={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},E=w("querystring");T.prototype.parse=function(o,x,A){if(!a.isString(o))throw new TypeError("Parameter 'url' must be a string, not "+typeof o);var O=o.indexOf("?"),D=O!==-1&&O<o.indexOf("#")?"?":"#",N=o.split(D),W=/\\/g;N[0]=N[0].replace(W,"/"),o=N.join(D);var K=o;if(K=K.trim(),!A&&o.split("#").length===1){var oe=f.exec(K);if(oe)return this.path=K,this.href=K,this.pathname=oe[1],oe[2]?(this.search=oe[2],this.query=x?E.parse(this.search.substr(1)):this.search.substr(1)):x&&(this.search="",this.query={}),this}var B=u.exec(K);if(B){B=B[0];var X=B.toLowerCase();this.protocol=X,K=K.substr(B.length)}if(A||B||K.match(/^\/\/[^@\/]+@[^@\/]+/)){var V=K.substr(0,2)==="//";!V||B&&m[B]||(K=K.substr(2),this.slashes=!0)}if(!m[B]&&(V||B&&!y[B])){for(var ne=-1,$=0;$<v.length;$++){var Z=K.indexOf(v[$]);Z!==-1&&(ne===-1||Z<ne)&&(ne=Z)}var ue,he;he=ne===-1?K.lastIndexOf("@"):K.lastIndexOf("@",ne),he!==-1&&(ue=K.slice(0,he),K=K.slice(he+1),this.auth=decodeURIComponent(ue)),ne=-1;for(var $=0;$<d.length;$++){var Z=K.indexOf(d[$]);Z!==-1&&(ne===-1||Z<ne)&&(ne=Z)}ne===-1&&(ne=K.length),this.host=K.slice(0,ne),K=K.slice(ne),this.parseHost(),this.hostname=this.hostname||"";var Oe=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Oe)for(var we=this.hostname.split(/\./),$=0,Pe=we.length;$<Pe;$++){var _e=we[$];if(_e&&!_e.match(g)){for(var xe="",Ve=0,Ne=_e.length;Ve<Ne;Ve++)_e.charCodeAt(Ve)>127?xe+="x":xe+=_e[Ve];if(!xe.match(g)){var Be=we.slice(0,$),ze=we.slice($+1),ye=_e.match(b);ye&&(Be.push(ye[1]),ze.unshift(ye[2])),ze.length&&(K="/"+ze.join(".")+K),this.hostname=Be.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),Oe||(this.hostname=l.toASCII(this.hostname));var me=this.port?":"+this.port:"",We=this.hostname||"";this.host=We+me,this.href+=this.host,Oe&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),K[0]!=="/"&&(K="/"+K))}if(!_[X])for(var $=0,Pe=t.length;$<Pe;$++){var He=t[$];if(K.indexOf(He)!==-1){var nt=encodeURIComponent(He);nt===He&&(nt=escape(He)),K=K.split(He).join(nt)}}var te=K.indexOf("#");te!==-1&&(this.hash=K.substr(te),K=K.slice(0,te));var P=K.indexOf("?");if(P!==-1?(this.search=K.substr(P),this.query=K.substr(P+1),x&&(this.query=E.parse(this.query)),K=K.slice(0,P)):x&&(this.search="",this.query={}),K&&(this.pathname=K),y[X]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var me=this.pathname||"",U=this.search||"";this.path=me+U}return this.href=this.format(),this},T.prototype.format=function(){var o=this.auth||"";o&&(o=encodeURIComponent(o),o=o.replace(/%3A/i,":"),o+="@");var x=this.protocol||"",A=this.pathname||"",O=this.hash||"",D=!1,N="";this.host?D=o+this.host:this.hostname&&(D=o+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(D+=":"+this.port)),this.query&&a.isObject(this.query)&&Object.keys(this.query).length&&(N=E.stringify(this.query));var W=this.search||N&&"?"+N||"";return x&&x.substr(-1)!==":"&&(x+=":"),this.slashes||(!x||y[x])&&D!==!1?(D="//"+(D||""),A&&A.charAt(0)!=="/"&&(A="/"+A)):D||(D=""),O&&O.charAt(0)!=="#"&&(O="#"+O),W&&W.charAt(0)!=="?"&&(W="?"+W),A=A.replace(/[?#]/g,function(K){return encodeURIComponent(K)}),W=W.replace("#","%23"),x+D+A+W+O},T.prototype.resolve=function(o){return this.resolveObject(C(o,!1,!0)).format()},T.prototype.resolveObject=function(o){if(a.isString(o)){var x=new T;x.parse(o,!1,!0),o=x}for(var A=new T,O=Object.keys(this),D=0;D<O.length;D++){var N=O[D];A[N]=this[N]}if(A.hash=o.hash,o.href==="")return A.href=A.format(),A;if(o.slashes&&!o.protocol){for(var W=Object.keys(o),K=0;K<W.length;K++){var oe=W[K];oe!=="protocol"&&(A[oe]=o[oe])}return y[A.protocol]&&A.hostname&&!A.pathname&&(A.path=A.pathname="/"),A.href=A.format(),A}if(o.protocol&&o.protocol!==A.protocol){if(!y[o.protocol]){for(var B=Object.keys(o),X=0;X<B.length;X++){var V=B[X];A[V]=o[V]}return A.href=A.format(),A}if(A.protocol=o.protocol,o.host||m[o.protocol])A.pathname=o.pathname;else{for(var Pe=(o.pathname||"").split("/");Pe.length&&!(o.host=Pe.shift()););o.host||(o.host=""),o.hostname||(o.hostname=""),Pe[0]!==""&&Pe.unshift(""),Pe.length<2&&Pe.unshift(""),A.pathname=Pe.join("/")}if(A.search=o.search,A.query=o.query,A.host=o.host||"",A.auth=o.auth,A.hostname=o.hostname||o.host,A.port=o.port,A.pathname||A.search){var ne=A.pathname||"",$=A.search||"";A.path=ne+$}return A.slashes=A.slashes||o.slashes,A.href=A.format(),A}var Z=A.pathname&&A.pathname.charAt(0)==="/",ue=o.host||o.pathname&&o.pathname.charAt(0)==="/",he=ue||Z||A.host&&o.pathname,Oe=he,we=A.pathname&&A.pathname.split("/")||[],Pe=o.pathname&&o.pathname.split("/")||[],_e=A.protocol&&!y[A.protocol];if(_e&&(A.hostname="",A.port=null,A.host&&(we[0]===""?we[0]=A.host:we.unshift(A.host)),A.host="",o.protocol&&(o.hostname=null,o.port=null,o.host&&(Pe[0]===""?Pe[0]=o.host:Pe.unshift(o.host)),o.host=null),he=he&&(Pe[0]===""||we[0]==="")),ue)A.host=o.host||o.host===""?o.host:A.host,A.hostname=o.hostname||o.hostname===""?o.hostname:A.hostname,A.search=o.search,A.query=o.query,we=Pe;else if(Pe.length)we||(we=[]),we.pop(),we=we.concat(Pe),A.search=o.search,A.query=o.query;else if(!a.isNullOrUndefined(o.search)){if(_e){A.hostname=A.host=we.shift();var xe=!!(A.host&&A.host.indexOf("@")>0)&&A.host.split("@");xe&&(A.auth=xe.shift(),A.host=A.hostname=xe.shift())}return A.search=o.search,A.query=o.query,a.isNull(A.pathname)&&a.isNull(A.search)||(A.path=(A.pathname?A.pathname:"")+(A.search?A.search:"")),A.href=A.format(),A}if(!we.length)return A.pathname=null,A.search?A.path="/"+A.search:A.path=null,A.href=A.format(),A;for(var Ve=we.slice(-1)[0],Ne=(A.host||o.host||we.length>1)&&(Ve==="."||Ve==="..")||Ve==="",Be=0,ze=we.length;ze>=0;ze--)Ve=we[ze],Ve==="."?we.splice(ze,1):Ve===".."?(we.splice(ze,1),Be++):Be&&(we.splice(ze,1),Be--);if(!he&&!Oe)for(;Be--;Be)we.unshift("..");!he||we[0]===""||we[0]&&we[0].charAt(0)==="/"||we.unshift(""),Ne&&we.join("/").substr(-1)!=="/"&&we.push("");var ye=we[0]===""||we[0]&&we[0].charAt(0)==="/";if(_e){A.hostname=A.host=ye?"":we.length?we.shift():"";var xe=!!(A.host&&A.host.indexOf("@")>0)&&A.host.split("@");xe&&(A.auth=xe.shift(),A.host=A.hostname=xe.shift())}return he=he||A.host&&we.length,he&&!ye&&we.unshift(""),we.length?A.pathname=we.join("/"):(A.pathname=null,A.path=null),a.isNull(A.pathname)&&a.isNull(A.search)||(A.path=(A.pathname?A.pathname:"")+(A.search?A.search:"")),A.auth=o.auth||A.auth,A.slashes=A.slashes||o.slashes,A.href=A.format(),A},T.prototype.parseHost=function(){var o=this.host,x=s.exec(o);x&&(x=x[0],x!==":"&&(this.port=x.substr(1)),o=o.substr(0,o.length-x.length)),o&&(this.hostname=o)}},{"./util":204,punycode:174,querystring:177}],204:[function(w,k,S){"use strict";k.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(w,k,S){(function(T){function C(p,c){function l(){if(!a){if(h("throwDeprecation"))throw new Error(c);h("traceDeprecation")?console.trace(c):console.warn(c),a=!0}return p.apply(this,arguments)}if(h("noDeprecation"))return p;var a=!1;return l}function h(p){try{if(!T.localStorage)return!1}catch(l){return!1}var c=T.localStorage[p];return c!=null&&String(c).toLowerCase()==="true"}k.exports=C}).call(this,typeof de!="undefined"?de:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],206:[function(w,k,S){k.exports=function(T){return T&&typeof T=="object"&&typeof T.copy=="function"&&typeof T.fill=="function"&&typeof T.readUInt8=="function"}},{}],207:[function(w,k,S){(function(T,C){function h($,Z){var ue={seen:[],stylize:c};return arguments.length>=3&&(ue.depth=arguments[2]),arguments.length>=4&&(ue.colors=arguments[3]),d(Z)?ue.showHidden=Z:Z&&S._extend(ue,Z),y(ue.showHidden)&&(ue.showHidden=!1),y(ue.depth)&&(ue.depth=2),y(ue.colors)&&(ue.colors=!1),y(ue.customInspect)&&(ue.customInspect=!0),ue.colors&&(ue.stylize=p),a(ue,$,ue.depth)}function p($,Z){var ue=h.styles[Z];return ue?"["+h.colors[ue][0]+"m"+$+"["+h.colors[ue][1]+"m":$}function c($,Z){return $}function l($){var Z={};return $.forEach(function(ue,he){Z[ue]=!0}),Z}function a($,Z,ue){if($.customInspect&&Z&&O(Z.inspect)&&Z.inspect!==S.inspect&&(!Z.constructor||Z.constructor.prototype!==Z)){var he=Z.inspect(ue,$);return _(he)||(he=a($,he,ue)),he}var Oe=u($,Z);if(Oe)return Oe;var we=Object.keys(Z),Pe=l(we);if($.showHidden&&(we=Object.getOwnPropertyNames(Z)),A(Z)&&(we.indexOf("message")>=0||we.indexOf("description")>=0))return s(Z);if(we.length===0){if(O(Z)){var _e=Z.name?": "+Z.name:"";return $.stylize("[Function"+_e+"]","special")}if(E(Z))return $.stylize(RegExp.prototype.toString.call(Z),"regexp");if(x(Z))return $.stylize(Date.prototype.toString.call(Z),"date");if(A(Z))return s(Z)}var xe="",Ve=!1,Ne=["{","}"];if((t(Z)&&(Ve=!0,Ne=["[","]"]),O(Z))&&(xe=" [Function"+(Z.name?": "+Z.name:"")+"]"),E(Z)&&(xe=" "+RegExp.prototype.toString.call(Z)),x(Z)&&(xe=" "+Date.prototype.toUTCString.call(Z)),A(Z)&&(xe=" "+s(Z)),we.length===0&&(!Ve||Z.length==0))return Ne[0]+xe+Ne[1];if(ue<0)return E(Z)?$.stylize(RegExp.prototype.toString.call(Z),"regexp"):$.stylize("[Object]","special");$.seen.push(Z);var Be;return Be=Ve?f($,Z,ue,Pe,we):we.map(function(ze){return i($,Z,ue,Pe,ze,Ve)}),$.seen.pop(),n(Be,xe,Ne)}function u($,Z){if(y(Z))return $.stylize("undefined","undefined");if(_(Z)){var ue="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(ue,"string")}return b(Z)?$.stylize(""+Z,"number"):d(Z)?$.stylize(""+Z,"boolean"):v(Z)?$.stylize("null","null"):void 0}function s($){return"["+Error.prototype.toString.call($)+"]"}function f($,Z,ue,he,Oe){for(var we=[],Pe=0,_e=Z.length;Pe<_e;++Pe)oe(Z,String(Pe))?we.push(i($,Z,ue,he,String(Pe),!0)):we.push("");return Oe.forEach(function(xe){xe.match(/^\d+$/)||we.push(i($,Z,ue,he,xe,!0))}),we}function i($,Z,ue,he,Oe,we){var Pe,_e,xe;if(xe=Object.getOwnPropertyDescriptor(Z,Oe)||{value:Z[Oe]},xe.get?_e=xe.set?$.stylize("[Getter/Setter]","special"):$.stylize("[Getter]","special"):xe.set&&(_e=$.stylize("[Setter]","special")),oe(he,Oe)||(Pe="["+Oe+"]"),_e||($.seen.indexOf(xe.value)<0?(_e=v(ue)?a($,xe.value,null):a($,xe.value,ue-1),_e.indexOf(`
|
|
|
`)>-1&&(_e=we?_e.split(`
|
|
|
`).map(function(Ve){return" "+Ve}).join(`
|
|
|
`).substr(2):`
|
|
|
`+_e.split(`
|
|
|
`).map(function(Ve){return" "+Ve}).join(`
|
|
|
`))):_e=$.stylize("[Circular]","special")),y(Pe)){if(we&&Oe.match(/^\d+$/))return _e;Pe=JSON.stringify(""+Oe),Pe.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Pe=Pe.substr(1,Pe.length-2),Pe=$.stylize(Pe,"name")):(Pe=Pe.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Pe=$.stylize(Pe,"string"))}return Pe+": "+_e}function n($,Z,ue){var he=0;return $.reduce(function(Oe,we){return he++,we.indexOf(`
|
|
|
`)>=0&&he++,Oe+we.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?ue[0]+(Z===""?"":Z+`
|
|
|
`)+" "+$.join(`,
|
|
|
`)+" "+ue[1]:ue[0]+Z+" "+$.join(", ")+" "+ue[1]}function t($){return Array.isArray($)}function d($){return typeof $=="boolean"}function v($){return $===null}function g($){return $==null}function b($){return typeof $=="number"}function _($){return typeof $=="string"}function m($){return typeof $=="symbol"}function y($){return $===void 0}function E($){return o($)&&N($)==="[object RegExp]"}function o($){return typeof $=="object"&&$!==null}function x($){return o($)&&N($)==="[object Date]"}function A($){return o($)&&(N($)==="[object Error]"||$ instanceof Error)}function O($){return typeof $=="function"}function D($){return $===null||typeof $=="boolean"||typeof $=="number"||typeof $=="string"||typeof $=="symbol"||$===void 0}function N($){return Object.prototype.toString.call($)}function W($){return $<10?"0"+$.toString(10):$.toString(10)}function K(){var $=new Date,Z=[W($.getHours()),W($.getMinutes()),W($.getSeconds())].join(":");return[$.getDate(),ne[$.getMonth()],Z].join(" ")}function oe($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var B=/%[sdj%]/g;S.format=function($){if(!_($)){for(var Z=[],ue=0;ue<arguments.length;ue++)Z.push(h(arguments[ue]));return Z.join(" ")}for(var ue=1,he=arguments,Oe=he.length,we=String($).replace(B,function(xe){if(xe==="%%")return"%";if(ue>=Oe)return xe;switch(xe){case"%s":return String(he[ue++]);case"%d":return Number(he[ue++]);case"%j":try{return JSON.stringify(he[ue++])}catch(Ve){return"[Circular]"}default:return xe}}),Pe=he[ue];ue<Oe;Pe=he[++ue])v(Pe)||!o(Pe)?we+=" "+Pe:we+=" "+h(Pe);return we},S.deprecate=function($,Z){function ue(){if(!he){if(T.throwDeprecation)throw new Error(Z);T.traceDeprecation?console.trace(Z):console.error(Z),he=!0}return $.apply(this,arguments)}if(y(C.process))return function(){return S.deprecate($,Z).apply(this,arguments)};if(T.noDeprecation===!0)return $;var he=!1;return ue};var X,V={};S.debuglog=function($){if(y(X)&&(X=T.env.NODE_DEBUG||""),$=$.toUpperCase(),!V[$])if(new RegExp("\\b"+$+"\\b","i").test(X)){var Z=T.pid;V[$]=function(){var ue=S.format.apply(S,arguments);console.error("%s %d: %s",$,Z,ue)}}else V[$]=function(){};return V[$]},S.inspect=h,h.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]},h.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},S.isArray=t,S.isBoolean=d,S.isNull=v,S.isNullOrUndefined=g,S.isNumber=b,S.isString=_,S.isSymbol=m,S.isUndefined=y,S.isRegExp=E,S.isObject=o,S.isDate=x,S.isError=A,S.isFunction=O,S.isPrimitive=D,S.isBuffer=w("./support/isBuffer");var ne=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];S.log=function(){console.log("%s - %s",K(),S.format.apply(S,arguments))},S.inherits=w("inherits"),S._extend=function($,Z){if(!Z||!o(Z))return $;for(var ue=Object.keys(Z),he=ue.length;he--;)$[ue[he]]=Z[ue[he]];return $}}).call(this,w("_process"),typeof de!="undefined"?de:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":206,_process:173,inherits:162}],208:[function(w,k,S){"use strict";(function(){S.stripBOM=function(T){return T[0]==="\uFEFF"?T.substring(1):T}}).call(void 0)},{}],209:[function(w,k,S){"use strict";function T(l){return l&&l.__esModule?l:{default:l}}var C=w("babel-runtime/helpers/typeof"),h=T(C),p=w("babel-runtime/core-js/object/keys"),c=T(p);(function(){var l,a,u,s,f,i={}.hasOwnProperty;l=w("xmlbuilder"),a=w("./defaults").defaults,s=function(n){return typeof n=="string"&&(n.indexOf("&")>=0||n.indexOf(">")>=0||n.indexOf("<")>=0)},f=function(n){return"<![CDATA["+u(n)+"]]>"},u=function(n){return n.replace("]]>","]]]]><![CDATA[>")},S.Builder=function(){function n(t){var d,v,g;this.options={},v=a[.2];for(d in v)i.call(v,d)&&(g=v[d],this.options[d]=g);for(d in t)i.call(t,d)&&(g=t[d],this.options[d]=g)}return n.prototype.buildObject=function(t){var d,v,g,b,_;return d=this.options.attrkey,v=this.options.charkey,(0,c.default)(t).length===1&&this.options.rootName===a[.2].rootName?(_=(0,c.default)(t)[0],t=t[_]):_=this.options.rootName,g=function(m){return function(y,E){var o,x,A,O,D,N;if((E===void 0?"undefined":(0,h.default)(E))!=="object")m.options.cdata&&s(E)?y.raw(f(E)):y.txt(E);else if(Array.isArray(E)){for(O in E)if(i.call(E,O)){x=E[O];for(D in x)A=x[D],y=g(y.ele(D),A).up()}}else for(D in E)if(i.call(E,D))if(x=E[D],D===d){if((x===void 0?"undefined":(0,h.default)(x))==="object")for(o in x)N=x[o],y=y.att(o,N)}else if(D===v)y=m.options.cdata&&s(x)?y.raw(f(x)):y.txt(x);else if(Array.isArray(x))for(O in x)i.call(x,O)&&(A=x[O],y=typeof A=="string"?m.options.cdata&&s(A)?y.ele(D).raw(f(A)).up():y.ele(D,A).up():g(y.ele(D),A).up());else(x===void 0?"undefined":(0,h.default)(x))==="object"?y=g(y.ele(D),x).up():typeof x=="string"&&m.options.cdata&&s(x)?y=y.ele(D).raw(f(x)).up():(x==null&&(x=""),y=y.ele(D,x.toString()).up());return y}}(this),b=l.create(_,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),g(b,t).end(this.options.renderOpts)},n}()}).call(void 0)},{"./defaults":210,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,xmlbuilder:235}],210:[function(w,k,S){"use strict";(function(){S.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(w,k,S){"use strict";function T(u){return u&&u.__esModule?u:{default:u}}var C=w("babel-runtime/core-js/object/get-own-property-names"),h=T(C),p=w("babel-runtime/core-js/object/keys"),c=T(p),l=w("babel-runtime/helpers/typeof"),a=T(l);(function(){var u,s,f,i,n,t,d,v,g=function(m,y){return function(){return m.apply(y,arguments)}},b=function(m,y){function E(){this.constructor=m}for(var o in y)_.call(y,o)&&(m[o]=y[o]);return E.prototype=y.prototype,m.prototype=new E,m.__super__=y.prototype,m},_={}.hasOwnProperty;d=w("sax"),f=w("events"),u=w("./bom"),t=w("./processors"),v=w("timers").setImmediate,s=w("./defaults").defaults,i=function(m){return(m===void 0?"undefined":(0,a.default)(m))==="object"&&m!=null&&(0,c.default)(m).length===0},n=function(m,y,E){var o,x,A;for(o=0,x=m.length;o<x;o++)A=m[o],y=A(y,E);return y},S.Parser=function(m){function y(E){this.parseString=g(this.parseString,this),this.reset=g(this.reset,this),this.assignOrPush=g(this.assignOrPush,this),this.processAsync=g(this.processAsync,this);var o,x,A;if(!(this instanceof S.Parser))return new S.Parser(E);this.options={},x=s[.2];for(o in x)_.call(x,o)&&(A=x[o],this.options[o]=A);for(o in E)_.call(E,o)&&(A=E[o],this.options[o]=A);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(t.normalize)),this.reset()}return b(y,m),y.prototype.processAsync=function(){var E,o;try{return this.remaining.length<=this.options.chunkSize?(E=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(E),this.saxParser.close()):(E=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(E),v(this.processAsync))}catch(x){if(o=x,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(o)}},y.prototype.assignOrPush=function(E,o,x){return o in E?(E[o]instanceof Array||(E[o]=[E[o]]),E[o].push(x)):this.options.explicitArray?E[o]=[x]:E[o]=x},y.prototype.reset=function(){var E,o,x,A;return this.removeAllListeners(),this.saxParser=d.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(O){return function(D){if(O.saxParser.resume(),!O.saxParser.errThrown)return O.saxParser.errThrown=!0,O.emit("error",D)}}(this),this.saxParser.onend=function(O){return function(){if(!O.saxParser.ended)return O.saxParser.ended=!0,O.emit("end",O.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,A=[],E=this.options.attrkey,o=this.options.charkey,this.saxParser.onopentag=function(O){return function(D){var N,W,K,oe,B;if(K={},K[o]="",!O.options.ignoreAttrs){B=D.attributes;for(N in B)_.call(B,N)&&(E in K||O.options.mergeAttrs||(K[E]={}),W=O.options.attrValueProcessors?n(O.options.attrValueProcessors,D.attributes[N],N):D.attributes[N],oe=O.options.attrNameProcessors?n(O.options.attrNameProcessors,N):N,O.options.mergeAttrs?O.assignOrPush(K,oe,W):K[E][oe]=W)}return K["#name"]=O.options.tagNameProcessors?n(O.options.tagNameProcessors,D.name):D.name,O.options.xmlns&&(K[O.options.xmlnskey]={uri:D.uri,local:D.local}),A.push(K)}}(this),this.saxParser.onclosetag=function(O){return function(){var D,N,W,K,oe,B,X,V,ne,$;if(B=A.pop(),oe=B["#name"],O.options.explicitChildren&&O.options.preserveChildrenOrder||delete B["#name"],B.cdata===!0&&(D=B.cdata,delete B.cdata),ne=A[A.length-1],B[o].match(/^\s*$/)&&!D?(N=B[o],delete B[o]):(O.options.trim&&(B[o]=B[o].trim()),O.options.normalize&&(B[o]=B[o].replace(/\s{2,}/g," ").trim()),B[o]=O.options.valueProcessors?n(O.options.valueProcessors,B[o],oe):B[o],(0,c.default)(B).length===1&&o in B&&!O.EXPLICIT_CHARKEY&&(B=B[o])),i(B)&&(B=O.options.emptyTag!==""?O.options.emptyTag:N),O.options.validator!=null&&($="/"+function(){var Z,ue,he;for(he=[],Z=0,ue=A.length;Z<ue;Z++)K=A[Z],he.push(K["#name"]);return he}().concat(oe).join("/"),function(){var Z;try{B=O.options.validator($,ne&&ne[oe],B)}catch(ue){return Z=ue,O.emit("error",Z)}}()),O.options.explicitChildren&&!O.options.mergeAttrs&&(B===void 0?"undefined":(0,a.default)(B))==="object")if(O.options.preserveChildrenOrder){if(ne){ne[O.options.childkey]=ne[O.options.childkey]||[],X={};for(W in B)_.call(B,W)&&(X[W]=B[W]);ne[O.options.childkey].push(X),delete B["#name"],(0,c.default)(B).length===1&&o in B&&!O.EXPLICIT_CHARKEY&&(B=B[o])}}else K={},O.options.attrkey in B&&(K[O.options.attrkey]=B[O.options.attrkey],delete B[O.options.attrkey]),!O.options.charsAsChildren&&O.options.charkey in B&&(K[O.options.charkey]=B[O.options.charkey],delete B[O.options.charkey]),(0,h.default)(B).length>0&&(K[O.options.childkey]=B),B=K;return A.length>0?O.assignOrPush(ne,oe,B):(O.options.explicitRoot&&(V=B,B={},B[oe]=V),O.resultObject=B,O.saxParser.ended=!0,O.emit("end",O.resultObject))}}(this),x=function(O){return function(D){var N,W;if(W=A[A.length-1])return W[o]+=D,O.options.explicitChildren&&O.options.preserveChildrenOrder&&O.options.charsAsChildren&&(O.options.includeWhiteChars||D.replace(/\\n/g,"").trim()!=="")&&(W[O.options.childkey]=W[O.options.childkey]||[],N={"#name":"__text__"},N[o]=D,O.options.normalize&&(N[o]=N[o].replace(/\s{2,}/g," ").trim()),W[O.options.childkey].push(N)),W}}(this),this.saxParser.ontext=x,this.saxParser.oncdata=function(O){return function(D){var N;if(N=x(D))return N.cdata=!0}}()},y.prototype.parseString=function(E,o){var x;o!=null&&typeof o=="function"&&(this.on("end",function(A){return this.reset(),o(null,A)}),this.on("error",function(A){return this.reset(),o(A)}));try{return E=E.toString(),E.trim()===""?(this.emit("end",null),!0):(E=u.stripBOM(E),this.options.async?(this.remaining=E,v(this.processAsync),this.saxParser):this.saxParser.write(E).close())}catch(A){if(x=A,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",x),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw x}},y}(f.EventEmitter),S.parseString=function(m,y,E){var o,x,A;return E!=null?(typeof E=="function"&&(o=E),(y===void 0?"undefined":(0,a.default)(y))==="object"&&(x=y)):(typeof y=="function"&&(o=y),x={}),A=new S.Parser(x),A.parseString(m,o)}}).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(w,k,S){"use strict";(function(){var T;T=new RegExp(/(?!xmlns)^.*:/),S.normalize=function(C){return C.toLowerCase()},S.firstCharLowerCase=function(C){return C.charAt(0).toLowerCase()+C.slice(1)},S.stripPrefix=function(C){return C.replace(T,"")},S.parseNumbers=function(C){return isNaN(C)||(C=C%1==0?parseInt(C,10):parseFloat(C)),C},S.parseBooleans=function(C){return/^(?:true|false)$/i.test(C)&&(C=C.toLowerCase()==="true"),C}}).call(void 0)},{}],213:[function(w,k,S){"use strict";(function(){var T,C,h,p,c=function(a,u){function s(){this.constructor=a}for(var f in u)l.call(u,f)&&(a[f]=u[f]);return s.prototype=u.prototype,a.prototype=new s,a.__super__=u.prototype,a},l={}.hasOwnProperty;C=w("./defaults"),T=w("./builder"),h=w("./parser"),p=w("./processors"),S.defaults=C.defaults,S.processors=p,S.ValidationError=function(a){function u(s){this.message=s}return c(u,a),u}(Error),S.Builder=T.Builder,S.Parser=h.Parser,S.parseString=h.parseString}).call(void 0)},{"./builder":209,"./defaults":210,"./parser":211,"./processors":212}],214:[function(w,k,S){"use strict";function T(u){return u&&u.__esModule?u:{default:u}}var C=w("babel-runtime/core-js/object/get-prototype-of"),h=T(C),p=w("babel-runtime/helpers/typeof"),c=T(p),l=w("babel-runtime/core-js/object/assign"),a=T(l);(function(){var u,s,f,i,n,t,d=[].slice,v={}.hasOwnProperty;u=function(){var g,b,_,m,y,E;if(E=arguments[0],y=2<=arguments.length?d.call(arguments,1):[],i(a.default))a.default.apply(null,arguments);else for(g=0,_=y.length;g<_;g++)if((m=y[g])!=null)for(b in m)v.call(m,b)&&(E[b]=m[b]);return E},i=function(g){return!!g&&Object.prototype.toString.call(g)==="[object Function]"},n=function(g){var b;return!!g&&((b=g===void 0?"undefined":(0,c.default)(g))==="function"||b==="object")},s=function(g){return i(Array.isArray)?Array.isArray(g):Object.prototype.toString.call(g)==="[object Array]"},f=function(g){var b;if(s(g))return!g.length;for(b in g)if(v.call(g,b))return!1;return!0},t=function(g){var b,_;return n(g)&&(_=(0,h.default)(g))&&(b=_.constructor)&&typeof b=="function"&&b instanceof b&&Function.prototype.toString.call(b)===Function.prototype.toString.call(Object)},k.exports.assign=u,k.exports.isFunction=i,k.exports.isObject=n,k.exports.isArray=s,k.exports.isEmpty=f,k.exports.isPlainObject=t}).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(w,k,S){"use strict";var T=w("babel-runtime/core-js/object/create"),C=function(h){return h&&h.__esModule?h:{default:h}}(T);(function(){k.exports=function(){function h(p,c,l){if(this.options=p.options,this.stringify=p.stringify,c==null)throw new Error("Missing attribute name of element "+p.name);if(l==null)throw new Error("Missing attribute value for attribute "+c+" of element "+p.name);this.name=this.stringify.attName(c),this.value=this.stringify.attValue(l)}return h.prototype.clone=function(){return(0,C.default)(this)},h.prototype.toString=function(p){return this.options.writer.set(p).attribute(this)},h}()}).call(void 0)},{"babel-runtime/core-js/object/create":19}],216:[function(w,k,S){"use strict";var T=w("babel-runtime/core-js/object/create"),C=function(h){return h&&h.__esModule?h:{default:h}}(T);(function(){var h,p=function(l,a){function u(){this.constructor=l}for(var s in a)c.call(a,s)&&(l[s]=a[s]);return u.prototype=a.prototype,l.prototype=new u,l.__super__=a.prototype,l},c={}.hasOwnProperty;h=w("./XMLNode"),k.exports=function(l){function a(u,s){if(a.__super__.constructor.call(this,u),s==null)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(s)}return p(a,l),a.prototype.clone=function(){return(0,C.default)(this)},a.prototype.toString=function(u){return this.options.writer.set(u).cdata(this)},a}(h)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],217:[function(w,k,S){"use strict";var T=w("babel-runtime/core-js/object/create"),C=function(h){return h&&h.__esModule?h:{default:h}}(T);(function(){var h,p=function(l,a){function u(){this.constructor=l}for(var s in a)c.call(a,s)&&(l[s]=a[s]);return u.prototype=a.prototype,l.prototype=new u,l.__super__=a.prototype,l},c={}.hasOwnProperty;h=w("./XMLNode"),k.exports=function(l){function a(u,s){if(a.__super__.constructor.call(this,u),s==null)throw new Error("Missing comment text");this.text=this.stringify.comment(s)}return p(a,l),a.prototype.clone=function(){return(0,C.default)(this)},a.prototype.toString=function(u){return this.options.writer.set(u).comment(this)},a}(h)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],218:[function(w,k,S){"use strict";(function(){var T,C=function(p,c){function l(){this.constructor=p}for(var a in c)h.call(c,a)&&(p[a]=c[a]);return l.prototype=c.prototype,p.prototype=new l,p.__super__=c.prototype,p},h={}.hasOwnProperty;T=w("./XMLNode"),k.exports=function(p){function c(l,a,u,s,f,i){if(c.__super__.constructor.call(this,l),a==null)throw new Error("Missing DTD element name");if(u==null)throw new Error("Missing DTD attribute name");if(!s)throw new Error("Missing DTD attribute type");if(!f)throw new Error("Missing DTD attribute default");if(f.indexOf("#")!==0&&(f="#"+f),!f.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(i&&!f.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(a),this.attributeName=this.stringify.attName(u),this.attributeType=this.stringify.dtdAttType(s),this.defaultValue=this.stringify.dtdAttDefault(i),this.defaultValueType=f}return C(c,p),c.prototype.toString=function(l){return this.options.writer.set(l).dtdAttList(this)},c}(T)}).call(void 0)},{"./XMLNode":227}],219:[function(w,k,S){"use strict";(function(){var T,C=function(p,c){function l(){this.constructor=p}for(var a in c)h.call(c,a)&&(p[a]=c[a]);return l.prototype=c.prototype,p.prototype=new l,p.__super__=c.prototype,p},h={}.hasOwnProperty;T=w("./XMLNode"),k.exports=function(p){function c(l,a,u){if(c.__super__.constructor.call(this,l),a==null)throw new Error("Missing DTD element name");u||(u="(#PCDATA)"),Array.isArray(u)&&(u="("+u.join(",")+")"),this.name=this.stringify.eleName(a),this.value=this.stringify.dtdElementValue(u)}return C(c,p),c.prototype.toString=function(l){return this.options.writer.set(l).dtdElement(this)},c}(T)}).call(void 0)},{"./XMLNode":227}],220:[function(w,k,S){"use strict";(function(){var T,C,h=function(c,l){function a(){this.constructor=c}for(var u in l)p.call(l,u)&&(c[u]=l[u]);return a.prototype=l.prototype,c.prototype=new a,c.__super__=l.prototype,c},p={}.hasOwnProperty;C=w("./Utility").isObject,T=w("./XMLNode"),k.exports=function(c){function l(a,u,s,f){if(l.__super__.constructor.call(this,a),s==null)throw new Error("Missing entity name");if(f==null)throw new Error("Missing entity value");if(this.pe=!!u,this.name=this.stringify.eleName(s),C(f)){if(!f.pubID&&!f.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(f.pubID&&!f.sysID)throw new Error("System identifier is required for a public external entity");if(f.pubID!=null&&(this.pubID=this.stringify.dtdPubID(f.pubID)),f.sysID!=null&&(this.sysID=this.stringify.dtdSysID(f.sysID)),f.nData!=null&&(this.nData=this.stringify.dtdNData(f.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}else this.value=this.stringify.dtdEntityValue(f)}return h(l,c),l.prototype.toString=function(a){return this.options.writer.set(a).dtdEntity(this)},l}(T)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],221:[function(w,k,S){"use strict";(function(){var T,C=function(p,c){function l(){this.constructor=p}for(var a in c)h.call(c,a)&&(p[a]=c[a]);return l.prototype=c.prototype,p.prototype=new l,p.__super__=c.prototype,p},h={}.hasOwnProperty;T=w("./XMLNode"),k.exports=function(p){function c(l,a,u){if(c.__super__.constructor.call(this,l),a==null)throw new Error("Missing notation name");if(!u.pubID&&!u.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(a),u.pubID!=null&&(this.pubID=this.stringify.dtdPubID(u.pubID)),u.sysID!=null&&(this.sysID=this.stringify.dtdSysID(u.sysID))}return C(c,p),c.prototype.toString=function(l){return this.options.writer.set(l).dtdNotation(this)},c}(T)}).call(void 0)},{"./XMLNode":227}],222:[function(w,k,S){"use strict";(function(){var T,C,h=function(c,l){function a(){this.constructor=c}for(var u in l)p.call(l,u)&&(c[u]=l[u]);return a.prototype=l.prototype,c.prototype=new a,c.__super__=l.prototype,c},p={}.hasOwnProperty;C=w("./Utility").isObject,T=w("./XMLNode"),k.exports=function(c){function l(a,u,s,f){var i;l.__super__.constructor.call(this,a),C(u)&&(i=u,u=i.version,s=i.encoding,f=i.standalone),u||(u="1.0"),this.version=this.stringify.xmlVersion(u),s!=null&&(this.encoding=this.stringify.xmlEncoding(s)),f!=null&&(this.standalone=this.stringify.xmlStandalone(f))}return h(l,c),l.prototype.toString=function(a){return this.options.writer.set(a).declaration(this)},l}(T)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],223:[function(w,k,S){"use strict";(function(){var T,C,h,p,c,l,a=function(s,f){function i(){this.constructor=s}for(var n in f)u.call(f,n)&&(s[n]=f[n]);return i.prototype=f.prototype,s.prototype=new i,s.__super__=f.prototype,s},u={}.hasOwnProperty;l=w("./Utility").isObject,c=w("./XMLNode"),T=w("./XMLDTDAttList"),h=w("./XMLDTDEntity"),C=w("./XMLDTDElement"),p=w("./XMLDTDNotation"),k.exports=function(s){function f(i,n,t){var d,v;f.__super__.constructor.call(this,i),this.documentObject=i,l(n)&&(d=n,n=d.pubID,t=d.sysID),t==null&&(v=[n,t],t=v[0],n=v[1]),n!=null&&(this.pubID=this.stringify.dtdPubID(n)),t!=null&&(this.sysID=this.stringify.dtdSysID(t))}return a(f,s),f.prototype.element=function(i,n){var t;return t=new C(this,i,n),this.children.push(t),this},f.prototype.attList=function(i,n,t,d,v){var g;return g=new T(this,i,n,t,d,v),this.children.push(g),this},f.prototype.entity=function(i,n){var t;return t=new h(this,!1,i,n),this.children.push(t),this},f.prototype.pEntity=function(i,n){var t;return t=new h(this,!0,i,n),this.children.push(t),this},f.prototype.notation=function(i,n){var t;return t=new p(this,i,n),this.children.push(t),this},f.prototype.toString=function(i){return this.options.writer.set(i).docType(this)},f.prototype.ele=function(i,n){return this.element(i,n)},f.prototype.att=function(i,n,t,d,v){return this.attList(i,n,t,d,v)},f.prototype.ent=function(i,n){return this.entity(i,n)},f.prototype.pent=function(i,n){return this.pEntity(i,n)},f.prototype.not=function(i,n){return this.notation(i,n)},f.prototype.up=function(){return this.root()||this.documentObject},f}(c)}).call(void 0)},{"./Utility":214,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLNode":227}],224:[function(w,k,S){"use strict";(function(){var T,C,h,p,c=function(a,u){function s(){this.constructor=a}for(var f in u)l.call(u,f)&&(a[f]=u[f]);return s.prototype=u.prototype,a.prototype=new s,a.__super__=u.prototype,a},l={}.hasOwnProperty;p=w("./Utility").isPlainObject,T=w("./XMLNode"),h=w("./XMLStringifier"),C=w("./XMLStringWriter"),k.exports=function(a){function u(s){u.__super__.constructor.call(this,null),s||(s={}),s.writer||(s.writer=new C),this.options=s,this.stringify=new h(s),this.isDocument=!0}return c(u,a),u.prototype.end=function(s){var f;return s?p(s)&&(f=s,s=this.options.writer.set(f)):s=this.options.writer,s.document(this)},u.prototype.toString=function(s){return this.options.writer.set(s).document(this)},u}(T)}).call(void 0)},{"./Utility":214,"./XMLNode":227,"./XMLStringWriter":231,"./XMLStringifier":232}],225:[function(w,k,S){"use strict";(function(){var T,C,h,p,c,l,a,u,s,f,i,n,t,d,v,g,b,_,m,y={}.hasOwnProperty;m=w("./Utility"),b=m.isObject,g=m.isFunction,_=m.isPlainObject,f=w("./XMLElement"),C=w("./XMLCData"),h=w("./XMLComment"),n=w("./XMLRaw"),v=w("./XMLText"),i=w("./XMLProcessingInstruction"),u=w("./XMLDeclaration"),s=w("./XMLDocType"),p=w("./XMLDTDAttList"),l=w("./XMLDTDEntity"),c=w("./XMLDTDElement"),a=w("./XMLDTDNotation"),T=w("./XMLAttribute"),d=w("./XMLStringifier"),t=w("./XMLStringWriter"),k.exports=function(){function E(o,x,A){var O;o||(o={}),o.writer?_(o.writer)&&(O=o.writer,o.writer=new t(O)):o.writer=new t(o),this.options=o,this.writer=o.writer,this.stringify=new d(o),this.onDataCallback=x||function(){},this.onEndCallback=A||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return E.prototype.node=function(o,x,A){var O;if(o==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(),o=o.valueOf(),x==null&&(x={}),x=x.valueOf(),b(x)||(O=[x,A],A=O[0],x=O[1]),this.currentNode=new f(this,o,x),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,A!=null&&this.text(A),this},E.prototype.element=function(o,x,A){return this.currentNode&&this.currentNode instanceof s?this.dtdElement.apply(this,arguments):this.node(o,x,A)},E.prototype.attribute=function(o,x){var A,O;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode");if(o!=null&&(o=o.valueOf()),b(o))for(A in o)y.call(o,A)&&(O=o[A],this.attribute(A,O));else g(x)&&(x=x.apply()),this.options.skipNullAttributes&&x==null||(this.currentNode.attributes[o]=new T(this,o,x));return this},E.prototype.text=function(o){var x;return this.openCurrent(),x=new v(this,o),this.onData(this.writer.text(x,this.currentLevel+1)),this},E.prototype.cdata=function(o){var x;return this.openCurrent(),x=new C(this,o),this.onData(this.writer.cdata(x,this.currentLevel+1)),this},E.prototype.comment=function(o){var x;return this.openCurrent(),x=new h(this,o),this.onData(this.writer.comment(x,this.currentLevel+1)),this},E.prototype.raw=function(o){var x;return this.openCurrent(),x=new n(this,o),this.onData(this.writer.raw(x,this.currentLevel+1)),this},E.prototype.instruction=function(o,x){var A,O,D,N,W;if(this.openCurrent(),o!=null&&(o=o.valueOf()),x!=null&&(x=x.valueOf()),Array.isArray(o))for(A=0,N=o.length;A<N;A++)O=o[A],this.instruction(O);else if(b(o))for(O in o)y.call(o,O)&&(D=o[O],this.instruction(O,D));else g(x)&&(x=x.apply()),W=new i(this,o,x),this.onData(this.writer.processingInstruction(W,this.currentLevel+1));return this},E.prototype.declaration=function(o,x,A){var O;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node");return O=new u(this,o,x,A),this.onData(this.writer.declaration(O,this.currentLevel+1)),this},E.prototype.doctype=function(o,x,A){if(this.openCurrent(),o==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,x,A),this.currentNode.rootNodeName=o,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},E.prototype.dtdElement=function(o,x){var A;return this.openCurrent(),A=new c(this,o,x),this.onData(this.writer.dtdElement(A,this.currentLevel+1)),this},E.prototype.attList=function(o,x,A,O,D){var N;return this.openCurrent(),N=new p(this,o,x,A,O,D),this.onData(this.writer.dtdAttList(N,this.currentLevel+1)),this},E.prototype.entity=function(o,x){var A;return this.openCurrent(),A=new l(this,!1,o,x),this.onData(this.writer.dtdEntity(A,this.currentLevel+1)),this},E.prototype.pEntity=function(o,x){var A;return this.openCurrent(),A=new l(this,!0,o,x),this.onData(this.writer.dtdEntity(A,this.currentLevel+1)),this},E.prototype.notation=function(o,x){var A;return this.openCurrent(),A=new a(this,o,x),this.onData(this.writer.dtdNotation(A,this.currentLevel+1)),this},E.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},E.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},E.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},E.prototype.openNode=function(o){if(!o.isOpen)return!this.root&&this.currentLevel===0&&o instanceof f&&(this.root=o),this.onData(this.writer.openNode(o,this.currentLevel)),o.isOpen=!0},E.prototype.closeNode=function(o){if(!o.isClosed)return this.onData(this.writer.closeNode(o,this.currentLevel)),o.isClosed=!0},E.prototype.onData=function(o){return this.documentStarted=!0,this.onDataCallback(o)},E.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},E.prototype.ele=function(){return this.element.apply(this,arguments)},E.prototype.nod=function(o,x,A){return this.node(o,x,A)},E.prototype.txt=function(o){return this.text(o)},E.prototype.dat=function(o){return this.cdata(o)},E.prototype.com=function(o){return this.comment(o)},E.prototype.ins=function(o,x){return this.instruction(o,x)},E.prototype.dec=function(o,x,A){return this.declaration(o,x,A)},E.prototype.dtd=function(o,x,A){return this.doctype(o,x,A)},E.prototype.e=function(o,x,A){return this.element(o,x,A)},E.prototype.n=function(o,x,A){return this.node(o,x,A)},E.prototype.t=function(o){return this.text(o)},E.prototype.d=function(o){return this.cdata(o)},E.prototype.c=function(o){return this.comment(o)},E.prototype.r=function(o){return this.raw(o)},E.prototype.i=function(o,x){return this.instruction(o,x)},E.prototype.att=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},E.prototype.a=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},E.prototype.ent=function(o,x){return this.entity(o,x)},E.prototype.pent=function(o,x){return this.pEntity(o,x)},E.prototype.not=function(o,x){return this.notation(o,x)},E}()}).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(w,k,S){"use strict";var T=w("babel-runtime/core-js/object/create"),C=function(h){return h&&h.__esModule?h:{default:h}}(T);(function(){var h,p,c,l,a,u=function(f,i){function n(){this.constructor=f}for(var t in i)s.call(i,t)&&(f[t]=i[t]);return n.prototype=i.prototype,f.prototype=new n,f.__super__=i.prototype,f},s={}.hasOwnProperty;a=w("./Utility"),l=a.isObject,c=a.isFunction,p=w("./XMLNode"),h=w("./XMLAttribute"),k.exports=function(f){function i(n,t,d){if(i.__super__.constructor.call(this,n),t==null)throw new Error("Missing element name");this.name=this.stringify.eleName(t),this.attributes={},d!=null&&this.attribute(d),n.isDocument&&(this.isRoot=!0,this.documentObject=n,n.rootObject=this)}return u(i,f),i.prototype.clone=function(){var n,t,d,v;d=(0,C.default)(this),d.isRoot&&(d.documentObject=null),d.attributes={},v=this.attributes;for(t in v)s.call(v,t)&&(n=v[t],d.attributes[t]=n.clone());return d.children=[],this.children.forEach(function(g){var b;return b=g.clone(),b.parent=d,d.children.push(b)}),d},i.prototype.attribute=function(n,t){var d,v;if(n!=null&&(n=n.valueOf()),l(n))for(d in n)s.call(n,d)&&(v=n[d],this.attribute(d,v));else c(t)&&(t=t.apply()),this.options.skipNullAttributes&&t==null||(this.attributes[n]=new h(this,n,t));return this},i.prototype.removeAttribute=function(n){var t,d,v;if(n==null)throw new Error("Missing attribute name");if(n=n.valueOf(),Array.isArray(n))for(d=0,v=n.length;d<v;d++)t=n[d],delete this.attributes[t];else delete this.attributes[n];return this},i.prototype.toString=function(n){return this.options.writer.set(n).element(this)},i.prototype.att=function(n,t){return this.attribute(n,t)},i.prototype.a=function(n,t){return this.attribute(n,t)},i}(p)}).call(void 0)},{"./Utility":214,"./XMLAttribute":215,"./XMLNode":227,"babel-runtime/core-js/object/create":19}],227:[function(w,k,S){"use strict";(function(){var T,C,h,p,c,l,a,u,s,f,i,n,t={}.hasOwnProperty;n=w("./Utility"),i=n.isObject,f=n.isFunction,s=n.isEmpty,c=null,T=null,C=null,h=null,p=null,a=null,u=null,l=null,k.exports=function(){function d(v){this.parent=v,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],c||(c=w("./XMLElement"),T=w("./XMLCData"),C=w("./XMLComment"),h=w("./XMLDeclaration"),p=w("./XMLDocType"),a=w("./XMLRaw"),u=w("./XMLText"),l=w("./XMLProcessingInstruction"))}return d.prototype.element=function(v,g,b){var _,m,y,E,o,x,A,O,D,N;if(x=null,g==null&&(g={}),g=g.valueOf(),i(g)||(D=[g,b],b=D[0],g=D[1]),v!=null&&(v=v.valueOf()),Array.isArray(v))for(y=0,A=v.length;y<A;y++)m=v[y],x=this.element(m);else if(f(v))x=this.element(v.apply());else if(i(v)){for(o in v)if(t.call(v,o))if(N=v[o],f(N)&&(N=N.apply()),i(N)&&s(N)&&(N=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&o.indexOf(this.stringify.convertAttKey)===0)x=this.attribute(o.substr(this.stringify.convertAttKey.length),N);else if(!this.options.separateArrayItems&&Array.isArray(N))for(E=0,O=N.length;E<O;E++)m=N[E],_={},_[o]=m,x=this.element(_);else i(N)?(x=this.element(o),x.element(N)):x=this.element(o,N)}else x=!this.options.ignoreDecorators&&this.stringify.convertTextKey&&v.indexOf(this.stringify.convertTextKey)===0?this.text(b):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&v.indexOf(this.stringify.convertCDataKey)===0?this.cdata(b):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&v.indexOf(this.stringify.convertCommentKey)===0?this.comment(b):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&v.indexOf(this.stringify.convertRawKey)===0?this.raw(b):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&v.indexOf(this.stringify.convertPIKey)===0?this.instruction(v.substr(this.stringify.convertPIKey.length),b):this.node(v,g,b);if(x==null)throw new Error("Could not create any elements with: "+v);return x},d.prototype.insertBefore=function(v,g,b){var _,m,y;if(this.isRoot)throw new Error("Cannot insert elements at root level");return m=this.parent.children.indexOf(this),y=this.parent.children.splice(m),_=this.parent.element(v,g,b),Array.prototype.push.apply(this.parent.children,y),_},d.prototype.insertAfter=function(v,g,b){var _,m,y;if(this.isRoot)throw new Error("Cannot insert elements at root level");return m=this.parent.children.indexOf(this),y=this.parent.children.splice(m+1),_=this.parent.element(v,g,b),Array.prototype.push.apply(this.parent.children,y),_},d.prototype.remove=function(){var v;if(this.isRoot)throw new Error("Cannot remove the root element");return v=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[v,v-v+1].concat([])),this.parent},d.prototype.node=function(v,g,b){var _,m;return v!=null&&(v=v.valueOf()),g||(g={}),g=g.valueOf(),i(g)||(m=[g,b],b=m[0],g=m[1]),_=new c(this,v,g),b!=null&&_.text(b),this.children.push(_),_},d.prototype.text=function(v){var g;return g=new u(this,v),this.children.push(g),this},d.prototype.cdata=function(v){var g;return g=new T(this,v),this.children.push(g),this},d.prototype.comment=function(v){var g;return g=new C(this,v),this.children.push(g),this},d.prototype.commentBefore=function(v){var g,b;return g=this.parent.children.indexOf(this),b=this.parent.children.splice(g),this.parent.comment(v),Array.prototype.push.apply(this.parent.children,b),this},d.prototype.commentAfter=function(v){var g,b;return g=this.parent.children.indexOf(this),b=this.parent.children.splice(g+1),this.parent.comment(v),Array.prototype.push.apply(this.parent.children,b),this},d.prototype.raw=function(v){var g;return g=new a(this,v),this.children.push(g),this},d.prototype.instruction=function(v,g){var b,_,m,y,E;if(v!=null&&(v=v.valueOf()),g!=null&&(g=g.valueOf()),Array.isArray(v))for(y=0,E=v.length;y<E;y++)b=v[y],this.instruction(b);else if(i(v))for(b in v)t.call(v,b)&&(_=v[b],this.instruction(b,_));else f(g)&&(g=g.apply()),m=new l(this,v,g),this.children.push(m);return this},d.prototype.instructionBefore=function(v,g){var b,_;return b=this.parent.children.indexOf(this),_=this.parent.children.splice(b),this.parent.instruction(v,g),Array.prototype.push.apply(this.parent.children,_),this},d.prototype.instructionAfter=function(v,g){var b,_;return b=this.parent.children.indexOf(this),_=this.parent.children.splice(b+1),this.parent.instruction(v,g),Array.prototype.push.apply(this.parent.children,_),this},d.prototype.declaration=function(v,g,b){var _,m;return _=this.document(),m=new h(_,v,g,b),_.children[0]instanceof h?_.children[0]=m:_.children.unshift(m),_.root()||_},d.prototype.doctype=function(v,g){var b,_,m,y,E,o,x,A,O,D;for(_=this.document(),m=new p(_,v,g),O=_.children,y=E=0,x=O.length;E<x;y=++E)if((b=O[y])instanceof p)return _.children[y]=m,m;for(D=_.children,y=o=0,A=D.length;o<A;y=++o)if(b=D[y],b.isRoot)return _.children.splice(y,0,m),m;return _.children.push(m),m},d.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},d.prototype.root=function(){var v;for(v=this;v;){if(v.isDocument)return v.rootObject;if(v.isRoot)return v;v=v.parent}},d.prototype.document=function(){var v;for(v=this;v;){if(v.isDocument)return v;v=v.parent}},d.prototype.end=function(v){return this.document().end(v)},d.prototype.prev=function(){var v;if((v=this.parent.children.indexOf(this))<1)throw new Error("Already at the first node");return this.parent.children[v-1]},d.prototype.next=function(){var v;if((v=this.parent.children.indexOf(this))===-1||v===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[v+1]},d.prototype.importDocument=function(v){var g;return g=v.root().clone(),g.parent=this,g.isRoot=!1,this.children.push(g),this},d.prototype.ele=function(v,g,b){return this.element(v,g,b)},d.prototype.nod=function(v,g,b){return this.node(v,g,b)},d.prototype.txt=function(v){return this.text(v)},d.prototype.dat=function(v){return this.cdata(v)},d.prototype.com=function(v){return this.comment(v)},d.prototype.ins=function(v,g){return this.instruction(v,g)},d.prototype.doc=function(){return this.document()},d.prototype.dec=function(v,g,b){return this.declaration(v,g,b)},d.prototype.dtd=function(v,g){return this.doctype(v,g)},d.prototype.e=function(v,g,b){return this.element(v,g,b)},d.prototype.n=function(v,g,b){return this.node(v,g,b)},d.prototype.t=function(v){return this.text(v)},d.prototype.d=function(v){return this.cdata(v)},d.prototype.c=function(v){return this.comment(v)},d.prototype.r=function(v){return this.raw(v)},d.prototype.i=function(v,g){return this.instruction(v,g)},d.prototype.u=function(){return this.up()},d.prototype.importXMLBuilder=function(v){return this.importDocument(v)},d}()}).call(void 0)},{"./Utility":214,"./XMLCData":216,"./XMLComment":217,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233}],228:[function(w,k,S){"use strict";var T=w("babel-runtime/core-js/object/create"),C=function(h){return h&&h.__esModule?h:{default:h}}(T);(function(){var h,p=function(l,a){function u(){this.constructor=l}for(var s in a)c.call(a,s)&&(l[s]=a[s]);return u.prototype=a.prototype,l.prototype=new u,l.__super__=a.prototype,l},c={}.hasOwnProperty;h=w("./XMLNode"),k.exports=function(l){function a(u,s,f){if(a.__super__.constructor.call(this,u),s==null)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(s),f&&(this.value=this.stringify.insValue(f))}return p(a,l),a.prototype.clone=function(){return(0,C.default)(this)},a.prototype.toString=function(u){return this.options.writer.set(u).processingInstruction(this)},a}(h)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],229:[function(w,k,S){"use strict";var T=w("babel-runtime/core-js/object/create"),C=function(h){return h&&h.__esModule?h:{default:h}}(T);(function(){var h,p=function(l,a){function u(){this.constructor=l}for(var s in a)c.call(a,s)&&(l[s]=a[s]);return u.prototype=a.prototype,l.prototype=new u,l.__super__=a.prototype,l},c={}.hasOwnProperty;h=w("./XMLNode"),k.exports=function(l){function a(u,s){if(a.__super__.constructor.call(this,u),s==null)throw new Error("Missing raw text");this.value=this.stringify.raw(s)}return p(a,l),a.prototype.clone=function(){return(0,C.default)(this)},a.prototype.toString=function(u){return this.options.writer.set(u).raw(this)},a}(h)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],230:[function(w,k,S){"use strict";(function(){var T,C,h,p,c,l,a,u,s,f,i,n,t,d=function(g,b){function _(){this.constructor=g}for(var m in b)v.call(b,m)&&(g[m]=b[m]);return _.prototype=b.prototype,g.prototype=new _,g.__super__=b.prototype,g},v={}.hasOwnProperty;a=w("./XMLDeclaration"),u=w("./XMLDocType"),T=w("./XMLCData"),C=w("./XMLComment"),s=w("./XMLElement"),i=w("./XMLRaw"),n=w("./XMLText"),f=w("./XMLProcessingInstruction"),h=w("./XMLDTDAttList"),p=w("./XMLDTDElement"),c=w("./XMLDTDEntity"),l=w("./XMLDTDNotation"),t=w("./XMLWriterBase"),k.exports=function(g){function b(_,m){b.__super__.constructor.call(this,m),this.stream=_}return d(b,g),b.prototype.document=function(_){var m,y,E,o,x,A,O,D;for(A=_.children,y=0,o=A.length;y<o;y++)m=A[y],m.isLastRootNode=!1;for(_.children[_.children.length-1].isLastRootNode=!0,O=_.children,D=[],E=0,x=O.length;E<x;E++)switch(m=O[E],!1){case!(m instanceof a):D.push(this.declaration(m));break;case!(m instanceof u):D.push(this.docType(m));break;case!(m instanceof C):D.push(this.comment(m));break;case!(m instanceof f):D.push(this.processingInstruction(m));break;default:D.push(this.element(m))}return D},b.prototype.attribute=function(_){return this.stream.write(" "+_.name+'="'+_.value+'"')},b.prototype.cdata=function(_,m){return this.stream.write(this.space(m)+"<![CDATA["+_.text+"]]>"+this.endline(_))},b.prototype.comment=function(_,m){return this.stream.write(this.space(m)+"<!-- "+_.text+" -->"+this.endline(_))},b.prototype.declaration=function(_,m){return this.stream.write(this.space(m)),this.stream.write('<?xml version="'+_.version+'"'),_.encoding!=null&&this.stream.write(' encoding="'+_.encoding+'"'),_.standalone!=null&&this.stream.write(' standalone="'+_.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(_))},b.prototype.docType=function(_,m){var y,E,o,x;if(m||(m=0),this.stream.write(this.space(m)),this.stream.write("<!DOCTYPE "+_.root().name),_.pubID&&_.sysID?this.stream.write(' PUBLIC "'+_.pubID+'" "'+_.sysID+'"'):_.sysID&&this.stream.write(' SYSTEM "'+_.sysID+'"'),_.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(_)),x=_.children,E=0,o=x.length;E<o;E++)switch(y=x[E],!1){case!(y instanceof h):this.dtdAttList(y,m+1);break;case!(y instanceof p):this.dtdElement(y,m+1);break;case!(y instanceof c):this.dtdEntity(y,m+1);break;case!(y instanceof l):this.dtdNotation(y,m+1);break;case!(y instanceof T):this.cdata(y,m+1);break;case!(y instanceof C):this.comment(y,m+1);break;case!(y instanceof f):this.processingInstruction(y,m+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(_))},b.prototype.element=function(_,m){var y,E,o,x,A,O,D,N;m||(m=0),N=this.space(m),this.stream.write(N+"<"+_.name),O=_.attributes;for(A in O)v.call(O,A)&&(y=O[A],this.attribute(y));if(_.children.length===0||_.children.every(function(W){return W.value===""}))this.allowEmpty?this.stream.write("></"+_.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&_.children.length===1&&_.children[0].value!=null)this.stream.write(">"),this.stream.write(_.children[0].value),this.stream.write("</"+_.name+">");else{for(this.stream.write(">"+this.newline),D=_.children,o=0,x=D.length;o<x;o++)switch(E=D[o],!1){case!(E instanceof T):this.cdata(E,m+1);break;case!(E instanceof C):this.comment(E,m+1);break;case!(E instanceof s):this.element(E,m+1);break;case!(E instanceof i):this.raw(E,m+1);break;case!(E instanceof n):this.text(E,m+1);break;case!(E instanceof f):this.processingInstruction(E,m+1);break;default:throw new Error("Unknown XML node type: "+E.constructor.name)}this.stream.write(N+"</"+_.name+">")}return this.stream.write(this.endline(_))},b.prototype.processingInstruction=function(_,m){return this.stream.write(this.space(m)+"<?"+_.target),_.value&&this.stream.write(" "+_.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(_))},b.prototype.raw=function(_,m){return this.stream.write(this.space(m)+_.value+this.endline(_))},b.prototype.text=function(_,m){return this.stream.write(this.space(m)+_.value+this.endline(_))},b.prototype.dtdAttList=function(_,m){return this.stream.write(this.space(m)+"<!ATTLIST "+_.elementName+" "+_.attributeName+" "+_.attributeType),_.defaultValueType!=="#DEFAULT"&&this.stream.write(" "+_.defaultValueType),_.defaultValue&&this.stream.write(' "'+_.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(_))},b.prototype.dtdElement=function(_,m){return this.stream.write(this.space(m)+"<!ELEMENT "+_.name+" "+_.value),this.stream.write(this.spacebeforeslash+">"+this.endline(_))},b.prototype.dtdEntity=function(_,m){return this.stream.write(this.space(m)+"<!ENTITY"),_.pe&&this.stream.write(" %"),this.stream.write(" "+_.name),_.value?this.stream.write(' "'+_.value+'"'):(_.pubID&&_.sysID?this.stream.write(' PUBLIC "'+_.pubID+'" "'+_.sysID+'"'):_.sysID&&this.stream.write(' SYSTEM "'+_.sysID+'"'),_.nData&&this.stream.write(" NDATA "+_.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(_))},b.prototype.dtdNotation=function(_,m){return this.stream.write(this.space(m)+"<!NOTATION "+_.name),_.pubID&&_.sysID?this.stream.write(' PUBLIC "'+_.pubID+'" "'+_.sysID+'"'):_.pubID?this.stream.write(' PUBLIC "'+_.pubID+'"'):_.sysID&&this.stream.write(' SYSTEM "'+_.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(_))},b.prototype.endline=function(_){return _.isLastRootNode?"":this.newline},b}(t)}).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(w,k,S){"use strict";(function(){var T,C,h,p,c,l,a,u,s,f,i,n,t,d=function(g,b){function _(){this.constructor=g}for(var m in b)v.call(b,m)&&(g[m]=b[m]);return _.prototype=b.prototype,g.prototype=new _,g.__super__=b.prototype,g},v={}.hasOwnProperty;a=w("./XMLDeclaration"),u=w("./XMLDocType"),T=w("./XMLCData"),C=w("./XMLComment"),s=w("./XMLElement"),i=w("./XMLRaw"),n=w("./XMLText"),f=w("./XMLProcessingInstruction"),h=w("./XMLDTDAttList"),p=w("./XMLDTDElement"),c=w("./XMLDTDEntity"),l=w("./XMLDTDNotation"),t=w("./XMLWriterBase"),k.exports=function(g){function b(_){b.__super__.constructor.call(this,_)}return d(b,g),b.prototype.document=function(_){var m,y,E,o,x;for(this.textispresent=!1,o="",x=_.children,y=0,E=x.length;y<E;y++)m=x[y],o+=function(){switch(!1){case!(m instanceof a):return this.declaration(m);case!(m instanceof u):return this.docType(m);case!(m instanceof C):return this.comment(m);case!(m instanceof f):return this.processingInstruction(m);default:return this.element(m,0)}}.call(this);return this.pretty&&o.slice(-this.newline.length)===this.newline&&(o=o.slice(0,-this.newline.length)),o},b.prototype.attribute=function(_){return" "+_.name+'="'+_.value+'"'},b.prototype.cdata=function(_,m){return this.space(m)+"<![CDATA["+_.text+"]]>"+this.newline},b.prototype.comment=function(_,m){return this.space(m)+"<!-- "+_.text+" -->"+this.newline},b.prototype.declaration=function(_,m){var y;return y=this.space(m),y+='<?xml version="'+_.version+'"',_.encoding!=null&&(y+=' encoding="'+_.encoding+'"'),_.standalone!=null&&(y+=' standalone="'+_.standalone+'"'),y+=this.spacebeforeslash+"?>",y+=this.newline},b.prototype.docType=function(_,m){var y,E,o,x,A;if(m||(m=0),x=this.space(m),x+="<!DOCTYPE "+_.root().name,_.pubID&&_.sysID?x+=' PUBLIC "'+_.pubID+'" "'+_.sysID+'"':_.sysID&&(x+=' SYSTEM "'+_.sysID+'"'),_.children.length>0){for(x+=" [",x+=this.newline,A=_.children,E=0,o=A.length;E<o;E++)y=A[E],x+=function(){switch(!1){case!(y instanceof h):return this.dtdAttList(y,m+1);case!(y instanceof p):return this.dtdElement(y,m+1);case!(y instanceof c):return this.dtdEntity(y,m+1);case!(y instanceof l):return this.dtdNotation(y,m+1);case!(y instanceof T):return this.cdata(y,m+1);case!(y instanceof C):return this.comment(y,m+1);case!(y instanceof f):return this.processingInstruction(y,m+1);default:throw new Error("Unknown DTD node type: "+y.constructor.name)}}.call(this);x+="]"}return x+=this.spacebeforeslash+">",x+=this.newline},b.prototype.element=function(_,m){var y,E,o,x,A,O,D,N,W,K,oe,B,X;m||(m=0),X=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),B=this.space(m),N="",N+=B+"<"+_.name,W=_.attributes;for(D in W)v.call(W,D)&&(y=W[D],N+=this.attribute(y));if(_.children.length===0||_.children.every(function(V){return V.value===""}))this.allowEmpty?N+="></"+_.name+">"+this.newline:N+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&_.children.length===1&&_.children[0].value!=null)N+=">",N+=_.children[0].value,N+="</"+_.name+">"+this.newline;else{if(this.dontprettytextnodes){for(K=_.children,o=0,A=K.length;o<A;o++)if(E=K[o],E.value!=null){this.textispresent++,X=!0;break}}for(this.textispresent&&(this.newline="",this.pretty=!1,B=this.space(m)),N+=">"+this.newline,oe=_.children,x=0,O=oe.length;x<O;x++)E=oe[x],N+=function(){switch(!1){case!(E instanceof T):return this.cdata(E,m+1);case!(E instanceof C):return this.comment(E,m+1);case!(E instanceof s):return this.element(E,m+1);case!(E instanceof i):return this.raw(E,m+1);case!(E instanceof n):return this.text(E,m+1);case!(E instanceof f):return this.processingInstruction(E,m+1);default:throw new Error("Unknown XML node type: "+E.constructor.name)}}.call(this);X&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),N+=B+"</"+_.name+">"+this.newline}return N},b.prototype.processingInstruction=function(_,m){var y;return y=this.space(m)+"<?"+_.target,_.value&&(y+=" "+_.value),y+=this.spacebeforeslash+"?>"+this.newline},b.prototype.raw=function(_,m){return this.space(m)+_.value+this.newline},b.prototype.text=function(_,m){return this.space(m)+_.value+this.newline},b.prototype.dtdAttList=function(_,m){var y;return y=this.space(m)+"<!ATTLIST "+_.elementName+" "+_.attributeName+" "+_.attributeType,_.defaultValueType!=="#DEFAULT"&&(y+=" "+_.defaultValueType),_.defaultValue&&(y+=' "'+_.defaultValue+'"'),y+=this.spacebeforeslash+">"+this.newline},b.prototype.dtdElement=function(_,m){return this.space(m)+"<!ELEMENT "+_.name+" "+_.value+this.spacebeforeslash+">"+this.newline},b.prototype.dtdEntity=function(_,m){var y;return y=this.space(m)+"<!ENTITY",_.pe&&(y+=" %"),y+=" "+_.name,_.value?y+=' "'+_.value+'"':(_.pubID&&_.sysID?y+=' PUBLIC "'+_.pubID+'" "'+_.sysID+'"':_.sysID&&(y+=' SYSTEM "'+_.sysID+'"'),_.nData&&(y+=" NDATA "+_.nData)),y+=this.spacebeforeslash+">"+this.newline},b.prototype.dtdNotation=function(_,m){var y;return y=this.space(m)+"<!NOTATION "+_.name,_.pubID&&_.sysID?y+=' PUBLIC "'+_.pubID+'" "'+_.sysID+'"':_.pubID?y+=' PUBLIC "'+_.pubID+'"':_.sysID&&(y+=' SYSTEM "'+_.sysID+'"'),y+=this.spacebeforeslash+">"+this.newline},b.prototype.openNode=function(_,m){var y,E,o,x;if(m||(m=0),_ instanceof s){o=this.space(m)+"<"+_.name,x=_.attributes;for(E in x)v.call(x,E)&&(y=x[E],o+=this.attribute(y));return o+=(_.children?">":"/>")+this.newline}return o=this.space(m)+"<!DOCTYPE "+_.rootNodeName,_.pubID&&_.sysID?o+=' PUBLIC "'+_.pubID+'" "'+_.sysID+'"':_.sysID&&(o+=' SYSTEM "'+_.sysID+'"'),o+=(_.children?" [":">")+this.newline},b.prototype.closeNode=function(_,m){switch(m||(m=0),!1){case!(_ instanceof s):return this.space(m)+"</"+_.name+">"+this.newline;case!(_ instanceof u):return this.space(m)+"]>"+this.newline}},b}(t)}).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(w,k,S){"use strict";(function(){var T=function(h,p){return function(){return h.apply(p,arguments)}},C={}.hasOwnProperty;k.exports=function(){function h(p){this.assertLegalChar=T(this.assertLegalChar,this);var c,l,a;p||(p={}),this.noDoubleEncoding=p.noDoubleEncoding,l=p.stringify||{};for(c in l)C.call(l,c)&&(a=l[c],this[c]=a)}return h.prototype.eleName=function(p){return p=""+p||"",this.assertLegalChar(p)},h.prototype.eleText=function(p){return p=""+p||"",this.assertLegalChar(this.elEscape(p))},h.prototype.cdata=function(p){return p=""+p||"",p=p.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(p)},h.prototype.comment=function(p){if(p=""+p||"",p.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+p);return this.assertLegalChar(p)},h.prototype.raw=function(p){return""+p||""},h.prototype.attName=function(p){return p=""+p||""},h.prototype.attValue=function(p){return p=""+p||"",this.attEscape(p)},h.prototype.insTarget=function(p){return""+p||""},h.prototype.insValue=function(p){if(p=""+p||"",p.match(/\?>/))throw new Error("Invalid processing instruction value: "+p);return p},h.prototype.xmlVersion=function(p){if(p=""+p||"",!p.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+p);return p},h.prototype.xmlEncoding=function(p){if(p=""+p||"",!p.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+p);return p},h.prototype.xmlStandalone=function(p){return p?"yes":"no"},h.prototype.dtdPubID=function(p){return""+p||""},h.prototype.dtdSysID=function(p){return""+p||""},h.prototype.dtdElementValue=function(p){return""+p||""},h.prototype.dtdAttType=function(p){return""+p||""},h.prototype.dtdAttDefault=function(p){return p!=null?""+p||"":p},h.prototype.dtdEntityValue=function(p){return""+p||""},h.prototype.dtdNData=function(p){return""+p||""},h.prototype.convertAttKey="@",h.prototype.convertPIKey="?",h.prototype.convertTextKey="#text",h.prototype.convertCDataKey="#cdata",h.prototype.convertCommentKey="#comment",h.prototype.convertRawKey="#raw",h.prototype.assertLegalChar=function(p){var c;if(c=p.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+p+" at index "+c.index);return p},h.prototype.elEscape=function(p){var c;return c=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(c,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
")},h.prototype.attEscape=function(p){var c;return c=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(c,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
")},h}()}).call(void 0)},{}],233:[function(w,k,S){"use strict";var T=w("babel-runtime/core-js/object/create"),C=function(h){return h&&h.__esModule?h:{default:h}}(T);(function(){var h,p=function(l,a){function u(){this.constructor=l}for(var s in a)c.call(a,s)&&(l[s]=a[s]);return u.prototype=a.prototype,l.prototype=new u,l.__super__=a.prototype,l},c={}.hasOwnProperty;h=w("./XMLNode"),k.exports=function(l){function a(u,s){if(a.__super__.constructor.call(this,u),s==null)throw new Error("Missing element text");this.value=this.stringify.eleText(s)}return p(a,l),a.prototype.clone=function(){return(0,C.default)(this)},a.prototype.toString=function(u){return this.options.writer.set(u).text(this)},a}(h)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],234:[function(w,k,S){"use strict";(function(){var T={}.hasOwnProperty;k.exports=function(){function C(h){var p,c,l,a,u,s,f,i,n;h||(h={}),this.pretty=h.pretty||!1,this.allowEmpty=(c=h.allowEmpty)!=null&&c,this.pretty?(this.indent=(l=h.indent)!=null?l:" ",this.newline=(a=h.newline)!=null?a:`
|
|
|
`,this.offset=(u=h.offset)!=null?u:0,this.dontprettytextnodes=(s=h.dontprettytextnodes)!=null?s:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=(f=h.spacebeforeslash)!=null?f:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,i=h.writer||{};for(p in i)T.call(i,p)&&(n=i[p],this[p]=n)}return C.prototype.set=function(h){var p,c,l;h||(h={}),"pretty"in h&&(this.pretty=h.pretty),"allowEmpty"in h&&(this.allowEmpty=h.allowEmpty),this.pretty?(this.indent="indent"in h?h.indent:" ",this.newline="newline"in h?h.newline:`
|
|
|
`,this.offset="offset"in h?h.offset:0,this.dontprettytextnodes="dontprettytextnodes"in h?h.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in h?h.spacebeforeslash:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,c=h.writer||{};for(p in c)T.call(c,p)&&(l=c[p],this[p]=l);return this},C.prototype.space=function(h){var p;return this.pretty?(p=(h||0)+this.offset+1,p>0?new Array(p).join(this.indent):""):""},C}()}).call(void 0)},{}],235:[function(w,k,S){"use strict";(function(){var T,C,h,p,c,l,a;a=w("./Utility"),c=a.assign,l=a.isFunction,T=w("./XMLDocument"),C=w("./XMLDocumentCB"),p=w("./XMLStringWriter"),h=w("./XMLStreamWriter"),k.exports.create=function(u,s,f,i){var n,t;if(u==null)throw new Error("Root element needs a name");return i=c({},s,f,i),n=new T(i),t=n.element(u),i.headless||(n.declaration(i),i.pubID==null&&i.sysID==null||n.doctype(i)),t},k.exports.begin=function(u,s,f){var i;return l(u)&&(i=[u,s],s=i[0],f=i[1],u={}),s?new C(u,s,f):new T(u)},k.exports.stringWriter=function(u){return new p(u)},k.exports.streamWriter=function(u,s){return new h(u,s)}}).call(void 0)},{"./Utility":214,"./XMLDocument":224,"./XMLDocumentCB":225,"./XMLStreamWriter":230,"./XMLStringWriter":231}],236:[function(w,k,S){function T(){for(var h={},p=0;p<arguments.length;p++){var c=arguments[p];for(var l in c)C.call(c,l)&&(h[l]=c[l])}return h}k.exports=T;var C=Object.prototype.hasOwnProperty},{}],237:[function(w,k,S){"use strict";function T(i,n,t){p.isBuffer(n)||(n=new p(n)),p.isBuffer(t)||(t=new p(t)),n.length>s?n=i(n):n.length<s&&(n=p.concat([n,f],s));for(var d=new p(s),v=new p(s),g=0;g<s;g++)d[g]=54^n[g],v[g]=92^n[g];var b=i(p.concat([d,t]));return i(p.concat([v,b]))}function C(i,n){i=i||"sha1";var t=u[i],d=[],v=0;return t||h("algorithm:",i,"is not yet supported"),{update:function(g){return p.isBuffer(g)||(g=new p(g)),d.push(g),v+=g.length,this},digest:function(g){var b=p.concat(d),_=n?T(t,n,b):t(b);return d=null,g?_.toString(g):_}}}function h(){var i=[].slice.call(arguments).join(" ");throw new Error([i,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
|
|
|
`))}var p=w("buffer").Buffer,c=w("./sha"),l=w("./sha256"),a=w("./md5"),u={sha1:c,sha256:l,md5:a},s=64,f=new p(s);f.fill(0),S.createHash=function(i){return C(i)},S.createHmac=function(i,n){return C(i,n)},function(i,n){for(var t in i)n(i[t],t)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(i){S[i]=function(){h("sorry,",i,"is not implemented yet")}})},{"./md5":239,"./sha":240,"./sha256":241,buffer:38}],238:[function(w,k,S){"use strict";function T(u,s){if(u.length%c!=0){var f=u.length+(c-u.length%c);u=p.concat([u,l],f)}for(var i=[],n=s?u.readInt32BE:u.readInt32LE,t=0;t<u.length;t+=c)i.push(n.call(u,t));return i}function C(u,s,f){for(var i=new p(s),n=f?i.writeInt32BE:i.writeInt32LE,t=0;t<u.length;t++)n.call(i,u[t],4*t,!0);return i}function h(u,s,f,i){return p.isBuffer(u)||(u=new p(u)),C(s(T(u,i),u.length*a),f,i)}var p=w("buffer").Buffer,c=4,l=new p(c);l.fill(0);var a=8;k.exports={hash:h}},{buffer:38}],239:[function(w,k,S){"use strict";function T(f,i){f[i>>5]|=128<<i%32,f[14+(i+64>>>9<<4)]=i;for(var n=1732584193,t=-271733879,d=-1732584194,v=271733878,g=0;g<f.length;g+=16){var b=n,_=t,m=d,y=v;n=h(n,t,d,v,f[g+0],7,-680876936),v=h(v,n,t,d,f[g+1],12,-389564586),d=h(d,v,n,t,f[g+2],17,606105819),t=h(t,d,v,n,f[g+3],22,-1044525330),n=h(n,t,d,v,f[g+4],7,-176418897),v=h(v,n,t,d,f[g+5],12,1200080426),d=h(d,v,n,t,f[g+6],17,-1473231341),t=h(t,d,v,n,f[g+7],22,-45705983),n=h(n,t,d,v,f[g+8],7,1770035416),v=h(v,n,t,d,f[g+9],12,-1958414417),d=h(d,v,n,t,f[g+10],17,-42063),t=h(t,d,v,n,f[g+11],22,-1990404162),n=h(n,t,d,v,f[g+12],7,1804603682),v=h(v,n,t,d,f[g+13],12,-40341101),d=h(d,v,n,t,f[g+14],17,-1502002290),t=h(t,d,v,n,f[g+15],22,1236535329),n=p(n,t,d,v,f[g+1],5,-165796510),v=p(v,n,t,d,f[g+6],9,-1069501632),d=p(d,v,n,t,f[g+11],14,643717713),t=p(t,d,v,n,f[g+0],20,-373897302),n=p(n,t,d,v,f[g+5],5,-701558691),v=p(v,n,t,d,f[g+10],9,38016083),d=p(d,v,n,t,f[g+15],14,-660478335),t=p(t,d,v,n,f[g+4],20,-405537848),n=p(n,t,d,v,f[g+9],5,568446438),v=p(v,n,t,d,f[g+14],9,-1019803690),d=p(d,v,n,t,f[g+3],14,-187363961),t=p(t,d,v,n,f[g+8],20,1163531501),n=p(n,t,d,v,f[g+13],5,-1444681467),v=p(v,n,t,d,f[g+2],9,-51403784),d=p(d,v,n,t,f[g+7],14,1735328473),t=p(t,d,v,n,f[g+12],20,-1926607734),n=c(n,t,d,v,f[g+5],4,-378558),v=c(v,n,t,d,f[g+8],11,-2022574463),d=c(d,v,n,t,f[g+11],16,1839030562),t=c(t,d,v,n,f[g+14],23,-35309556),n=c(n,t,d,v,f[g+1],4,-1530992060),v=c(v,n,t,d,f[g+4],11,1272893353),d=c(d,v,n,t,f[g+7],16,-155497632),t=c(t,d,v,n,f[g+10],23,-1094730640),n=c(n,t,d,v,f[g+13],4,681279174),v=c(v,n,t,d,f[g+0],11,-358537222),d=c(d,v,n,t,f[g+3],16,-722521979),t=c(t,d,v,n,f[g+6],23,76029189),n=c(n,t,d,v,f[g+9],4,-640364487),v=c(v,n,t,d,f[g+12],11,-421815835),d=c(d,v,n,t,f[g+15],16,530742520),t=c(t,d,v,n,f[g+2],23,-995338651),n=l(n,t,d,v,f[g+0],6,-198630844),v=l(v,n,t,d,f[g+7],10,1126891415),d=l(d,v,n,t,f[g+14],15,-1416354905),t=l(t,d,v,n,f[g+5],21,-57434055),n=l(n,t,d,v,f[g+12],6,1700485571),v=l(v,n,t,d,f[g+3],10,-1894986606),d=l(d,v,n,t,f[g+10],15,-1051523),t=l(t,d,v,n,f[g+1],21,-2054922799),n=l(n,t,d,v,f[g+8],6,1873313359),v=l(v,n,t,d,f[g+15],10,-30611744),d=l(d,v,n,t,f[g+6],15,-1560198380),t=l(t,d,v,n,f[g+13],21,1309151649),n=l(n,t,d,v,f[g+4],6,-145523070),v=l(v,n,t,d,f[g+11],10,-1120210379),d=l(d,v,n,t,f[g+2],15,718787259),t=l(t,d,v,n,f[g+9],21,-343485551),n=a(n,b),t=a(t,_),d=a(d,m),v=a(v,y)}return Array(n,t,d,v)}function C(f,i,n,t,d,v){return a(u(a(a(i,f),a(t,v)),d),n)}function h(f,i,n,t,d,v,g){return C(i&n|~i&t,f,i,d,v,g)}function p(f,i,n,t,d,v,g){return C(i&t|n&~t,f,i,d,v,g)}function c(f,i,n,t,d,v,g){return C(i^n^t,f,i,d,v,g)}function l(f,i,n,t,d,v,g){return C(n^(i|~t),f,i,d,v,g)}function a(f,i){var n=(65535&f)+(65535&i);return(f>>16)+(i>>16)+(n>>16)<<16|65535&n}function u(f,i){return f<<i|f>>>32-i}var s=w("./helpers");k.exports=function(f){return s.hash(f,T,16)}},{"./helpers":238}],240:[function(w,k,S){"use strict";function T(a,u){a[u>>5]|=128<<24-u%32,a[15+(u+64>>9<<4)]=u;for(var s=Array(80),f=1732584193,i=-271733879,n=-1732584194,t=271733878,d=-1009589776,v=0;v<a.length;v+=16){for(var g=f,b=i,_=n,m=t,y=d,E=0;E<80;E++){s[E]=E<16?a[v+E]:c(s[E-3]^s[E-8]^s[E-14]^s[E-16],1);var o=p(p(c(f,5),C(E,i,n,t)),p(p(d,s[E]),h(E)));d=t,t=n,n=c(i,30),i=f,f=o}f=p(f,g),i=p(i,b),n=p(n,_),t=p(t,m),d=p(d,y)}return Array(f,i,n,t,d)}function C(a,u,s,f){return a<20?u&s|~u&f:a<40?u^s^f:a<60?u&s|u&f|s&f:u^s^f}function h(a){return a<20?1518500249:a<40?1859775393:a<60?-1894007588:-899497514}function p(a,u){var s=(65535&a)+(65535&u);return(a>>16)+(u>>16)+(s>>16)<<16|65535&s}function c(a,u){return a<<u|a>>>32-u}var l=w("./helpers");k.exports=function(a){return l.hash(a,T,20,!0)}},{"./helpers":238}],241:[function(w,k,S){"use strict";var T=w("./helpers"),C=function(n,t){var d=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(d>>16)<<16|65535&d},h=function(n,t){return n>>>t|n<<32-t},p=function(n,t){return n>>>t},c=function(n,t,d){return n&t^~n&d},l=function(n,t,d){return n&t^n&d^t&d},a=function(n){return h(n,2)^h(n,13)^h(n,22)},u=function(n){return h(n,6)^h(n,11)^h(n,25)},s=function(n){return h(n,7)^h(n,18)^p(n,3)},f=function(n){return h(n,17)^h(n,19)^p(n,10)},i=function(n,t){var d,v,g,b,_,m,y,E,o,x,A,O,D=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),N=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),W=new Array(64);n[t>>5]|=128<<24-t%32,n[15+(t+64>>9<<4)]=t;for(var o=0;o<n.length;o+=16){d=N[0],v=N[1],g=N[2],b=N[3],_=N[4],m=N[5],y=N[6],E=N[7];for(var x=0;x<64;x++)W[x]=x<16?n[x+o]:C(C(C(f(W[x-2]),W[x-7]),s(W[x-15])),W[x-16]),A=C(C(C(C(E,u(_)),c(_,m,y)),D[x]),W[x]),O=C(a(d),l(d,v,g)),E=y,y=m,m=_,_=C(b,A),b=g,g=v,v=d,d=C(A,O);N[0]=C(d,N[0]),N[1]=C(v,N[1]),N[2]=C(g,N[2]),N[3]=C(b,N[3]),N[4]=C(_,N[4]),N[5]=C(m,N[5]),N[6]=C(y,N[6]),N[7]=C(E,N[7])}return N};k.exports=function(n){return T.hash(n,i,32,!0)}},{"./helpers":238}],242:[function(w,k,S){(function(T){"use strict";function C(i){return i&&i.__esModule?i:{default:i}}var h=w("babel-runtime/core-js/object/create"),p=C(h),c=w("babel-runtime/helpers/classCallCheck"),l=C(c),a=w("babel-runtime/helpers/createClass"),u=C(a),s=w("babel-runtime/helpers/typeof"),f=C(s);!function(i){if((S===void 0?"undefined":(0,f.default)(S))==="object"&&k!==void 0)k.exports=i();else if(typeof j=="function"&&j.amd)j([],i);else{var n;n=typeof window!="undefined"?window:T!==void 0?T:typeof self!="undefined"?self:this,n.mime=i()}}(function(){return function i(n,t,d){function v(_,m){if(!t[_]){if(!n[_]){var y=typeof w=="function"&&w;if(!m&&y)return y(_,!0);if(g)return g(_,!0);var E=new Error("Cannot find module '"+_+"'");throw E.code="MODULE_NOT_FOUND",E}var o=t[_]={exports:{}};n[_][0].call(o.exports,function(x){var A=n[_][1][x];return v(A||x)},o,o.exports,i,n,t,d)}return t[_].exports}for(var g=typeof w=="function"&&w,b=0;b<d.length;b++)v(d[b]);return v}({1:[function(i,n,t){var d=function(){function v(){(0,l.default)(this,v),this._types=(0,p.default)(null),this._extensions=(0,p.default)(null);for(var g=0;g<arguments.length;g++)this.define(arguments[g])}return(0,u.default)(v,[{key:"define",value:function(g,b){for(var _ in g){for(var m=g[_],y=0;y<m.length;y++){var E=m[y];if(!b&&E in this._types)throw new Error('Attempt to change mapping for "'+E+'" extension from "'+this._types[E]+'" to "'+_+'". Pass `force=true` to allow this, otherwise remove "'+E+'" from the list of extensions for "'+_+'".');this._types[E]=_}!b&&this._extensions[_]||(this._extensions[_]=m[0])}}},{key:"getType",value:function(g){g=String(g);var b=g.replace(/^.*[\/\\]/,"").toLowerCase(),_=b.replace(/^.*\./,"").toLowerCase(),m=b.length<g.length;return(_.length<b.length-1||!m)&&this._types[_]||null}},{key:"getExtension",value:function(g){return(g=/^\s*([^;\s]*)/.test(g)&&RegExp.$1)&&this._extensions[g.toLowerCase()]||null}}]),v}();n.exports=d},{}],2:[function(i,n,t){var d=i("./Mime");n.exports=new d(i("./types/standard"),i("./types/other"))},{"./Mime":1,"./types/other":3,"./types/standard":4}],3:[function(i,n,t){n.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(i,n,t){n.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 de!="undefined"?de: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(w,k,S){"use strict";S.encodeURIComponent=function(T){try{return encodeURIComponent(T)}catch(C){return T}},S.escape=w("escape-html"),S.timestamp=function(T){if(T){var C=T;return typeof C=="string"&&(C=Number(C)),String(T).length===10&&(C*=1e3),new Date(C)}return Math.round(Date.now()/1e3)}},{"escape-html":157}],244:[function(w,k,S){(function(T,C){"use strict";function h(E){return E&&E.__esModule?E:{default:E}}function p(E,o){return E===void 0?o:E}function c(E,o){return function(x,A,O){if(x)return o(x);E({data:A,status:O.statusCode,headers:O.headers,res:O})}}var l,a=w("babel-runtime/core-js/json/stringify"),u=h(a),s=w("babel-runtime/helpers/typeof"),f=h(s),i=w("util"),n=w("url"),t=w("http"),d=w("https"),v=w("debug")("urllib"),g=w("humanize-ms"),b=0,_=Math.pow(2,31)-10,m=/^https?:\/\//i;S.TIMEOUTS=[g("300s"),g("300s")];var y=["json","text"];S.request=function(E,o,x){return arguments.length===2&&typeof o=="function"&&(x=o,o=null),typeof x=="function"?S.requestWithCallback(E,o,x):(l||(l=w("any-promise")),new l(function(A,O){S.requestWithCallback(E,o,c(A,O))}))},S.requestWithCallback=function(E,o,x){function A(){nt&&(clearTimeout(nt),nt=null)}function O(){te&&(clearTimeout(te),te=null)}function D(Ye,Fe,Ie){if(O(),!x)return console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),V,T.pid,_e.method,E),void(Ye&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
|
|
|
stack: %s`,Date(),V,T.pid,Ye.name,Ye.message,Ye.stack));var Me=x;x=null;var be={};if(Ie&&(J=Ie.statusCode,be=Ie.headers),J===401&&be["www-authenticate"]&&(!o.headers||!o.headers.Authorization)&&o.digestAuth){var Te=be["www-authenticate"];if(Te.indexOf("Digest ")>=0)return v("Request#%d %s: got digest auth header WWW-Authenticate: %s",V,E,Te),o.headers=o.headers||{},o.headers.Authorization=digestAuthHeader(_e.method,_e.path,Te,o.digestAuth),v("Request#%d %s: auth with digest header: %s",V,E,o.headers.Authorization),Ie.headers["set-cookie"]&&(o.headers.Cookie=Ie.headers["set-cookie"].join(";")),S.requestWithCallback(E,o,Me)}var Le=Date.now()-Z;Ue&&(Ue.contentDownload=Le),v("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",Le,Y,J,_e.method,_e.host,_e.path,q,Ue);var Ce={status:J,statusCode:J,headers:be,size:Y,aborted:Ee,rt:Le,keepAliveSocket:q,data:Fe,requestUrls:o.requestUrls,timing:Ue,remoteAddress:ke,remotePort:ht};if(Ye){var et="";we&&typeof we.getCurrentStatus=="function"&&(et=", agent status: "+(0,u.default)(we.getCurrentStatus())),Ye.message+=", "+_e.method+" "+E+" "+J+" (connected: "+U+", keepalive socket: "+q+et+`)
|
|
|
headers: `+(0,u.default)(be),Ye.data=Fe,Ye.path=_e.path,Ye.status=J,Ye.headers=be,Ye.res=Ce}Me(Ye,Fe,o.streaming?Ie:Ce),o.emitter&&(ne.url=E,ne.socket=qe&&qe.connection,ne.options=_e,ne.size=We,o.emitter.emit("response",{requestId:V,error:Ye,ctx:o.ctx,req:ne,res:Ce}))}function N(Ye){var Fe=null;if(o.followRedirect&&statuses.redirect[Ye.statusCode]){o._followRedirectCount=(o._followRedirectCount||0)+1;var Ie=Ye.headers.location;if(Ie){if(!(o._followRedirectCount>o.maxRedirects)){var Me=o.formatRedirectUrl?o.formatRedirectUrl(E,Ie):n.resolve(E,Ie);v("Request#%d %s: `redirected` from %s to %s",V,_e.path,E,Me),O(),o.headers&&o.headers.Host&&m.test(Ie)&&(o.headers.Host=null);var be=x;return x=null,S.requestWithCallback(Me,o,be),{redirect:!0,error:null}}Fe=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+E),Fe.name="MaxRedirectError"}else Fe=new Error("Got statusCode "+Ye.statusCode+" but cannot resolve next location from headers"),Fe.name="FollowRedirectError"}return{redirect:!1,error:Fe}}function W(Ye,Fe,Ie){return Ie(null,Fe,Ye.headers["content-encoding"])}function K(Ye){if(Ue&&(Ue.waiting=Date.now()-Z),v("Request#%d %s `req response` event emit: status %d, headers: %j",V,E,Ye.statusCode,Ye.headers),o.streaming){var Fe=N(Ye);return Fe.redirect?void Ye.resume():Fe.error?(Ye.resume(),D(Fe.error,null,Ye)):D(null,null,Ye)}if(Ye.on("close",function(){v("Request#%d %s: `res close` event emit, total size %d",V,E,Y)}),Ye.on("error",function(){v("Request#%d %s: `res error` event emit, total size %d",V,E,Y)}),Ye.on("aborted",function(){Ee=!0,v("Request#%d %s: `res aborted` event emit, total size %d",V,E,Y)}),je){var Fe=N(Ye);return Fe.redirect?void Ye.resume():Fe.error?(Ye.resume(),je.end(),D(Fe.error,null,Ye)):(o.consumeWriteStream===!1?Ye.on("end",D.bind(null,null,null,Ye)):isNode010||isNode012?first([[je,"close"],[Ye,"aborted"]],function(be,Te,Le){v("Request#%d %s: writeStream or res %s event emitted",V,E,Le),D(P||null,null,Ye)}):je.on("close",function(){v("Request#%d %s: writeStream close event emitted",V,E),D(P||null,null,Ye)}),Ye.pipe(je))}var Ie=[];Ye.on("data",function(Me){v("Request#%d %s: `res data` event emit, size %d",V,E,Me.length),Y+=Me.length,Ie.push(Me)}),Ye.on("end",function(){var Me=C.concat(Ie,Y);if(v("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",V,E,Y,Ye._dumped),P)return D(P,Me,Ye);var be=N(Ye);if(be.error)return D(be.error,Me,Ye);be.redirect||W(Ye,Me,function(Te,Le,Ce){if(Te)return D(Te,Me,Ye);if(!Ce&&y.indexOf(o.dataType)>=0){try{Le=decodeBodyByCharset(Le,Ye)}catch(Qe){return v("decodeBodyByCharset error: %s",Qe),D(null,Le,Ye)}if(o.dataType==="json")if(Y===0)Le=null;else{var et=parseJSON(Le,Pe);et.error?Te=et.error:Le=et.data}}Ee&&v("Request#%d %s: Remote socket was terminated before `response.end()` was called",V,E),D(Te,Le,Ye)})})}function oe(){v("Response timer ticking, timeout: %d",dt),te=setTimeout(function(){te=null;var Ye="Response timeout for "+dt+"ms";P=new Error(Ye),P.name="ResponseTimeoutError",P.requestId=V,v("ResponseTimeout: Request#%d %s %s: %s, connected: %s",V,E,P.name,Ye,U),B()},dt)}function B(){v("Request#%d %s abort, connected: %s",V,E,U),qe.socket||(P.noSocket=!0,D(P)),qe.abort()}if(!E||typeof E!="string"&&(E===void 0?"undefined":(0,f.default)(E))!=="object"){var X=i.format("expect request url to be a string or a http request options, but got %j",E);throw new Error(X)}arguments.length===2&&typeof o=="function"&&(x=o,o=null),o=o||{},b>=_&&(b=0);var V=++b;o.requestUrls=o.requestUrls||[];var ne={requestId:V,url:E,args:o,ctx:o.ctx};o.emitter&&o.emitter.emit("request",ne),o.timeout=o.timeout||S.TIMEOUTS,o.maxRedirects=o.maxRedirects||10,o.streaming=o.streaming||o.customResponse;var $,Z=Date.now();typeof E=="string"?(m.test(E)||(E="http://"+E),$=n.parse(E)):$=E;var ue=(o.type||o.method||$.method||"GET").toUpperCase(),he=$.port||80,Oe=t,we=p(o.agent,S.agent),Pe=o.fixJSONCtlChars;$.protocol==="https:"&&(Oe=d,we=p(o.httpsAgent,S.httpsAgent),$.port||(he=443));var _e={host:$.hostname||$.host||"localhost",path:$.path||"/",method:ue,port:he,agent:we,headers:o.headers||{},lookup:o.lookup};Array.isArray(o.timeout)?_e.requestTimeout=o.timeout[o.timeout.length-1]:o.timeout!==void 0&&(_e.requestTimeout=o.timeout);for(var xe=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],Ve=0;Ve<xe.length;Ve++){var Ne=xe[Ve];o.hasOwnProperty(Ne)&&(_e[Ne]=o[Ne])}_e.rejectUnauthorized!==!1||_e.hasOwnProperty("secureOptions")||(_e.secureOptions=w("constants").SSL_OP_NO_TLSv1_2);var Be=o.auth||$.auth;Be&&(_e.auth=Be);var ze=o.content||o.data,ye=ue==="GET"||ue==="HEAD"||o.dataAsQueryString;if(!o.content&&ze&&typeof ze!="string"&&!C.isBuffer(ze))if(ye)ze=o.nestedQuerystring?qs.stringify(ze):querystring.stringify(ze);else{var me=_e.headers["Content-Type"]||_e.headers["content-type"];me||(me=o.contentType==="json"?"application/json":"application/x-www-form-urlencoded",_e.headers["Content-Type"]=me),ze=parseContentType(me).type==="application/json"?(0,u.default)(ze):o.nestedQuerystring?qs.stringify(ze):querystring.stringify(ze)}ye&&ze&&(_e.path+=($.query?"&":"?")+ze,ze=null);var We=0;if(ze){var He=ze.length;C.isBuffer(ze)||(He=C.byteLength(ze)),We=_e.headers["Content-Length"]=He}o.dataType==="json"&&(_e.headers.Accept="application/json"),typeof o.beforeRequest=="function"&&o.beforeRequest(_e);var nt=null,te=null,P=null,U=!1,q=!1,Y=0,J=-1,Ee=!1,ke="",ht="",Ue=null;o.timing&&(Ue={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0}),_e.headers["User-Agent"]||_e.headers["user-agent"]||(_e.headers["User-Agent"]=navigator.userAgent),o.gzip&&(_e.headers["Accept-Encoding"]||_e.headers["accept-encoding"]||(_e.headers["Accept-Encoding"]="gzip"));var je=o.writeStream;v("Request#%d %s %s with headers %j, options.path: %s",V,ue,E,_e.headers,_e.path),o.requestUrls.push(E);var tt,dt;Array.isArray(o.timeout)?(tt=g(o.timeout[0]),dt=g(o.timeout[1])):tt=dt=g(o.timeout),v("ConnectTimeout: %d, ResponseTimeout: %d",tt,dt);var qe;try{qe=Oe.request(_e,K)}catch(Ye){return D(Ye)}return typeof window=="undefined"?function(){v("Connect timer ticking, timeout: %d",tt),nt=setTimeout(function(){nt=null,J===-1&&(J=-2);var Ye="Connect timeout for "+tt+"ms",Fe="ConnectionTimeoutError";qe.socket||(Fe="SocketAssignTimeoutError",Ye+=", working sockets is full"),P=new Error(Ye),P.name=Fe,P.requestId=V,v("ConnectTimeout: Request#%d %s %s: %s, connected: %s",V,E,P.name,Ye,U),B()},tt)}():qe.on("requestTimeout",function(){J===-1&&(J=-2);var Ye="Connect timeout for "+tt+"ms";P=new Error(Ye),P.name="ConnectionTimeoutError",P.requestId=V,B()}),Ue&&qe.on("finish",function(){Ue.requestSent=Date.now()-Z}),qe.once("socket",function(Ye){Ue&&(Ue.queuing=Date.now()-Z),isNode010&&Ye.socket&&(Ye=Ye.socket);var Fe=Ye.readyState;if(Fe==="opening")return Ye.once("lookup",function(Ie,Me,be){v("Request#%d %s lookup: %s, %s, %s",V,E,Ie,Me,be),Ue&&(Ue.dnslookup=Date.now()-Z),Me&&(ke=Me)}),void Ye.once("connect",function(){Ue&&(Ue.connected=Date.now()-Z),A(),oe(),v("Request#%d %s new socket connected",V,E),U=!0,ke||(ke=Ye.remoteAddress),ht=Ye.remotePort});v("Request#%d %s reuse socket connected, readyState: %s",V,E,Fe),U=!0,q=!0,ke||(ke=Ye.remoteAddress),ht=Ye.remotePort,A(),oe()}),qe.on("error",function(Ye){Ye.name!=="Error"&&Ye.name!=="TypeError"||(Ye.name=U?"ResponseError":"RequestError"),Ye.message+=' (req "error")',v("Request#%d %s `req error` event emit, %s: %s",V,E,Ye.name,Ye.message),D(P||Ye)}),je&&je.once("error",function(Ye){Ye.message+=' (writeStream "error")',P=Ye,v("Request#%d %s `writeStream error` event emit, %s: %s",V,E,Ye.name,Ye.message),B()}),o.stream?(o.stream.pipe(qe),o.stream.once("error",function(Ye){Ye.message+=' (stream "error")',P=Ye,v("Request#%d %s `readStream error` event emit, %s: %s",V,E,Ye.name,Ye.message),B()})):qe.end(ze),qe.requestId=V,qe}}).call(this,w("_process"),w("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 w(S){if(k[S])return k[S].exports;var T=k[S]={i:S,l:!1,exports:{}};return j[S].call(T.exports,T,T.exports,w),T.l=!0,T.exports}var k={};w.m=j,w.c=k,w.d=function(S,T,C){w.o(S,T)||Object.defineProperty(S,T,{configurable:!1,enumerable:!0,get:C})},w.n=function(S){var T=S&&S.__esModule?function(){return S.default}:function(){return S};return w.d(T,"a",T),T},w.o=function(S,T){return Object.prototype.hasOwnProperty.call(S,T)},w.p="",w(w.s=12)}([function(j,w,k){!function(S,T){j.exports=w=T()}(0,function(){var S=S||function(T,C){var h=Object.create||function(){function d(){}return function(v){var g;return d.prototype=v,g=new d,d.prototype=null,g}}(),p={},c=p.lib={},l=c.Base=function(){return{extend:function(d){var v=h(this);return d&&v.mixIn(d),v.hasOwnProperty("init")&&this.init!==v.init||(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},create:function(){var d=this.extend();return d.init.apply(d,arguments),d},init:function(){},mixIn:function(d){for(var v in d)d.hasOwnProperty(v)&&(this[v]=d[v]);d.hasOwnProperty("toString")&&(this.toString=d.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=c.WordArray=l.extend({init:function(d,v){d=this.words=d||[],this.sigBytes=v!=null?v:4*d.length},toString:function(d){return(d||s).stringify(this)},concat:function(d){var v=this.words,g=d.words,b=this.sigBytes,_=d.sigBytes;if(this.clamp(),b%4)for(var m=0;m<_;m++){var y=g[m>>>2]>>>24-m%4*8&255;v[b+m>>>2]|=y<<24-(b+m)%4*8}else for(var m=0;m<_;m+=4)v[b+m>>>2]=g[m>>>2];return this.sigBytes+=_,this},clamp:function(){var d=this.words,v=this.sigBytes;d[v>>>2]&=4294967295<<32-v%4*8,d.length=T.ceil(v/4)},clone:function(){var d=l.clone.call(this);return d.words=this.words.slice(0),d},random:function(d){for(var v,g=[],b=0;b<d;b+=4){var _=function(m){var m=m,y=987654321,E=4294967295;return function(){y=36969*(65535&y)+(y>>16)&E,m=18e3*(65535&m)+(m>>16)&E;var o=(y<<16)+m&E;return o/=4294967296,(o+=.5)*(T.random()>.5?1:-1)}}(4294967296*(v||T.random()));v=987654071*_(),g.push(4294967296*_()|0)}return new a.init(g,d)}}),u=p.enc={},s=u.Hex={stringify:function(d){for(var v=d.words,g=d.sigBytes,b=[],_=0;_<g;_++){var m=v[_>>>2]>>>24-_%4*8&255;b.push((m>>>4).toString(16)),b.push((15&m).toString(16))}return b.join("")},parse:function(d){for(var v=d.length,g=[],b=0;b<v;b+=2)g[b>>>3]|=parseInt(d.substr(b,2),16)<<24-b%8*4;return new a.init(g,v/2)}},f=u.Latin1={stringify:function(d){for(var v=d.words,g=d.sigBytes,b=[],_=0;_<g;_++){var m=v[_>>>2]>>>24-_%4*8&255;b.push(String.fromCharCode(m))}return b.join("")},parse:function(d){for(var v=d.length,g=[],b=0;b<v;b++)g[b>>>2]|=(255&d.charCodeAt(b))<<24-b%4*8;return new a.init(g,v)}},i=u.Utf8={stringify:function(d){try{return decodeURIComponent(escape(f.stringify(d)))}catch(v){throw new Error("Malformed UTF-8 data")}},parse:function(d){return f.parse(unescape(encodeURIComponent(d)))}},n=c.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(d){typeof d=="string"&&(d=i.parse(d)),this._data.concat(d),this._nDataBytes+=d.sigBytes},_process:function(d){var v=this._data,g=v.words,b=v.sigBytes,_=this.blockSize,m=4*_,y=b/m;y=d?T.ceil(y):T.max((0|y)-this._minBufferSize,0);var E=y*_,o=T.min(4*E,b);if(E){for(var x=0;x<E;x+=_)this._doProcessBlock(g,x);var A=g.splice(0,E);v.sigBytes-=o}return new a.init(A,o)},clone:function(){var d=l.clone.call(this);return d._data=this._data.clone(),d},_minBufferSize:0}),t=(c.Hasher=n.extend({cfg:l.extend(),init:function(d){this.cfg=this.cfg.extend(d),this.reset()},reset:function(){n.reset.call(this),this._doReset()},update:function(d){return this._append(d),this._process(),this},finalize:function(d){return d&&this._append(d),this._doFinalize()},blockSize:16,_createHelper:function(d){return function(v,g){return new d.init(g).finalize(v)}},_createHmacHelper:function(d){return function(v,g){return new t.HMAC.init(d,g).finalize(v)}}}),p.algo={});return p}(Math);return S})},function(j,w,k){"use strict";function S(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function h(p,c){for(var l=0;l<c.length;l++){var a=c[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}return function(p,c,l){return c&&h(p.prototype,c),l&&h(p,l),p}}(),C=function(){function h(){S(this,h)}return T(h,null,[{key:"detectIEVersion",value:function(){for(var p=4,c=document.createElement("div"),l=c.getElementsByTagName("i");c.innerHTML="<!--[if gt IE "+p+"]><i></i><![endif]-->",l[0];)p++;return p>4&&p}},{key:"extend",value:function(p,c){for(var l in c)Object.prototype.hasOwnProperty.call(c,l)&&c[l]&&(p[l]=c[l])}},{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 c(l){return l<10?"0"+l:l}return p.getUTCFullYear()+"-"+c(p.getUTCMonth()+1)+"-"+c(p.getUTCDate())+"T"+c(p.getUTCHours())+":"+c(p.getUTCMinutes())+":"+c(p.getUTCSeconds())+"Z"}},{key:"isIntNum",value:function(p){return!!/^\d+$/.test(p)}}]),h}();w.default=C},function(j,w,k){!function(S,T){j.exports=w=T(k(0))}(0,function(S){return function(T){function C(t,d,v,g,b,_,m){var y=t+(d&v|~d&g)+b+m;return(y<<_|y>>>32-_)+d}function h(t,d,v,g,b,_,m){var y=t+(d&g|v&~g)+b+m;return(y<<_|y>>>32-_)+d}function p(t,d,v,g,b,_,m){var y=t+(d^v^g)+b+m;return(y<<_|y>>>32-_)+d}function c(t,d,v,g,b,_,m){var y=t+(v^(d|~g))+b+m;return(y<<_|y>>>32-_)+d}var l=S,a=l.lib,u=a.WordArray,s=a.Hasher,f=l.algo,i=[];!function(){for(var t=0;t<64;t++)i[t]=4294967296*T.abs(T.sin(t+1))|0}();var n=f.MD5=s.extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,d){for(var v=0;v<16;v++){var g=d+v,b=t[g];t[g]=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8)}var _=this._hash.words,m=t[d+0],y=t[d+1],E=t[d+2],o=t[d+3],x=t[d+4],A=t[d+5],O=t[d+6],D=t[d+7],N=t[d+8],W=t[d+9],K=t[d+10],oe=t[d+11],B=t[d+12],X=t[d+13],V=t[d+14],ne=t[d+15],$=_[0],Z=_[1],ue=_[2],he=_[3];$=C($,Z,ue,he,m,7,i[0]),he=C(he,$,Z,ue,y,12,i[1]),ue=C(ue,he,$,Z,E,17,i[2]),Z=C(Z,ue,he,$,o,22,i[3]),$=C($,Z,ue,he,x,7,i[4]),he=C(he,$,Z,ue,A,12,i[5]),ue=C(ue,he,$,Z,O,17,i[6]),Z=C(Z,ue,he,$,D,22,i[7]),$=C($,Z,ue,he,N,7,i[8]),he=C(he,$,Z,ue,W,12,i[9]),ue=C(ue,he,$,Z,K,17,i[10]),Z=C(Z,ue,he,$,oe,22,i[11]),$=C($,Z,ue,he,B,7,i[12]),he=C(he,$,Z,ue,X,12,i[13]),ue=C(ue,he,$,Z,V,17,i[14]),Z=C(Z,ue,he,$,ne,22,i[15]),$=h($,Z,ue,he,y,5,i[16]),he=h(he,$,Z,ue,O,9,i[17]),ue=h(ue,he,$,Z,oe,14,i[18]),Z=h(Z,ue,he,$,m,20,i[19]),$=h($,Z,ue,he,A,5,i[20]),he=h(he,$,Z,ue,K,9,i[21]),ue=h(ue,he,$,Z,ne,14,i[22]),Z=h(Z,ue,he,$,x,20,i[23]),$=h($,Z,ue,he,W,5,i[24]),he=h(he,$,Z,ue,V,9,i[25]),ue=h(ue,he,$,Z,o,14,i[26]),Z=h(Z,ue,he,$,N,20,i[27]),$=h($,Z,ue,he,X,5,i[28]),he=h(he,$,Z,ue,E,9,i[29]),ue=h(ue,he,$,Z,D,14,i[30]),Z=h(Z,ue,he,$,B,20,i[31]),$=p($,Z,ue,he,A,4,i[32]),he=p(he,$,Z,ue,N,11,i[33]),ue=p(ue,he,$,Z,oe,16,i[34]),Z=p(Z,ue,he,$,V,23,i[35]),$=p($,Z,ue,he,y,4,i[36]),he=p(he,$,Z,ue,x,11,i[37]),ue=p(ue,he,$,Z,D,16,i[38]),Z=p(Z,ue,he,$,K,23,i[39]),$=p($,Z,ue,he,X,4,i[40]),he=p(he,$,Z,ue,m,11,i[41]),ue=p(ue,he,$,Z,o,16,i[42]),Z=p(Z,ue,he,$,O,23,i[43]),$=p($,Z,ue,he,W,4,i[44]),he=p(he,$,Z,ue,B,11,i[45]),ue=p(ue,he,$,Z,ne,16,i[46]),Z=p(Z,ue,he,$,E,23,i[47]),$=c($,Z,ue,he,m,6,i[48]),he=c(he,$,Z,ue,D,10,i[49]),ue=c(ue,he,$,Z,V,15,i[50]),Z=c(Z,ue,he,$,A,21,i[51]),$=c($,Z,ue,he,B,6,i[52]),he=c(he,$,Z,ue,o,10,i[53]),ue=c(ue,he,$,Z,K,15,i[54]),Z=c(Z,ue,he,$,y,21,i[55]),$=c($,Z,ue,he,N,6,i[56]),he=c(he,$,Z,ue,ne,10,i[57]),ue=c(ue,he,$,Z,O,15,i[58]),Z=c(Z,ue,he,$,X,21,i[59]),$=c($,Z,ue,he,x,6,i[60]),he=c(he,$,Z,ue,oe,10,i[61]),ue=c(ue,he,$,Z,E,15,i[62]),Z=c(Z,ue,he,$,W,21,i[63]),_[0]=_[0]+$|0,_[1]=_[1]+Z|0,_[2]=_[2]+ue|0,_[3]=_[3]+he|0},_doFinalize:function(){var t=this._data,d=t.words,v=8*this._nDataBytes,g=8*t.sigBytes;d[g>>>5]|=128<<24-g%32;var b=T.floor(v/4294967296),_=v;d[15+(g+64>>>9<<4)]=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8),d[14+(g+64>>>9<<4)]=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>8),t.sigBytes=4*(d.length+1),this._process();for(var m=this._hash,y=m.words,E=0;E<4;E++){var o=y[E];y[E]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}return m},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}});l.MD5=s._createHelper(n),l.HmacMD5=s._createHmacHelper(n)}(Math),S.MD5})},function(j,w,k){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.UPLOADSTATE={INIT:"init",UPLOADING:"uploading",COMPLETE:"complete",INTERRUPT:"interrupt"},w.UPLOADSTEP={INIT:"init",PART:"part",COMPLETE:"complete"},w.UPLOADDEFAULT={PARALLEL:5,PARTSIZE:1048576}},function(j,w,k){"use strict";function S(n){return n&&n.__esModule?n:{default:n}}function T(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function n(t,d){for(var v=0;v<d.length;v++){var g=d[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(t,g.key,g)}}return function(t,d,v){return d&&n(t.prototype,d),v&&n(t,v),t}}(),h=k(5),p=S(h),c=k(25),l=S(c),a=k(6),u=S(a),s=k(7),f=S(s),i=function(){function n(t){T(this,n);var d=f.default.os.name,v=f.default.os.version||"",g=f.default.browser.name,b=f.default.browser.version||"",_=window.location.href,m="";_&&(m=f.default.getHost(_));var y="pc";f.default.os.ipad?y="pad":(f.default.os.iphone||f.default.os.android)&&(y="phone"),this._ri=p.default.create(),this.initParam={APIVersion:"0.6.0",lv:"1",av:u.default.version,pd:"upload",sm:"upload",md:"uploader",uuid:n.getUuid(),os:d,ov:v,et:g,ev:b,uat:navigator.userAgent,app_n:m,tt:y,dm:"h5",ut:""}}return C(n,[{key:"log",value:function(t,d){d&&d.ri?(this._ri=d.ri,delete d.ri):this._ri=p.default.create(),d&&d.ut&&(this.initParam.ut=d.ut,delete d.ut),this.initParam.t=new Date().getTime(),this.initParam.ll=t=="20006"?"error":"info",this.initParam.ri=this._ri,this.initParam.e=t;var v=[];if(d)for(var g in d)v.push(g+"="+d[g]);var b=v.join("&");this.initParam.args=encodeURIComponent(b==""?"0":b);var _=[];for(var g in this.initParam)_.push(g+"="+this.initParam[g]);var m=_.join("&");AliyunUpload&&AliyunUpload.__logTestCallback__?AliyunUpload.__logTestCallback__(m):new Image(0,0).src="https://videocloud.cn-hangzhou.log.aliyuncs.com/logstores/upload/track?"+m}}],[{key:"getUuid",value:function(){var t=l.default.get("p_h5_upload_u");return t||(t=p.default.create(),l.default.set("p_h5_upload_u",t,730)),t}},{key:"getClientId",value:function(){return l.default.get("p_h5_upload_clientId")}},{key:"setClientId",value:function(t){return t||(t=p.default.create()),l.default.set("p_h5_upload_clientId",t,730),t}}]),n}();w.default=i},function(j,w,k){"use strict";function S(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function h(p,c){for(var l=0;l<c.length;l++){var a=c[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}return function(p,c,l){return c&&h(p.prototype,c),l&&h(p,l),p}}(),C=function(){function h(){S(this,h)}return T(h,null,[{key:"create",value:function(p,c){var l,a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),u=[];if(c=c||a.length,p)for(l=0;l<p;l++)u[l]=a[0|Math.random()*c];else{var s;for(u[8]=u[13]=u[18]=u[23]="-",u[14]="4",l=0;l<36;l++)u[l]||(s=0|16*Math.random(),u[l]=a[l==19?3&s|8:s])}return u.join("")}}]),h}();w.default=C},function(j,w,k){"use strict";Object.defineProperty(w,"__esModule",{value:!0});var S={version:"1.5.0"};w.default=S},function(j,w,k){"use strict";function S(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function a(u,s){for(var f=0;f<s.length;f++){var i=s[f];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}return function(u,s,f){return s&&a(u.prototype,s),f&&a(u,f),u}}(),C=function(a){var u=navigator.userAgent,s="other";if(a.ios)return"iOS";if(a.android)return"android";if(u.indexOf("Baiduspider")>-1)return"Baiduspider";if(u.indexOf("PlayStation")>-1)return"PS4";var f=navigator.platform=="Win32"||navigator.platform=="Windows"||u.indexOf("Windows")>-1,i=navigator.platform=="Mac68K"||navigator.platform=="MacPPC"||navigator.platform=="Macintosh"||navigator.platform=="MacIntel";return i&&(s="macOS"),navigator.platform=="X11"&&!f&&!i&&(s="Unix"),String(navigator.platform).indexOf("Linux")>-1&&(s="Linux"),f?"windows":s},h=function(){var a=navigator.userAgent,u="";return(a.indexOf("Windows NT 5.0")>-1||a.indexOf("Windows 2000")>-1)&&(u="2000"),(a.indexOf("Windows NT 5.1")>-1||a.indexOf("Windows XP")>-1)&&(u="XP"),(a.indexOf("Windows NT 5.2")>-1||a.indexOf("Windows 2003")>-1)&&(u="2003"),(a.indexOf("Windows NT 6.0")>-1||a.indexOf("Windows Vista")>-1)&&(u="Vista"),(a.indexOf("Windows NT 6.1")>-1||a.indexOf("Windows 7")>-1)&&(u="7"),(a.indexOf("Windows NT 6.2")>-1||a.indexOf("Windows 8")>-1)&&(u="8"),(a.indexOf("Windows NT 6.3")>-1||a.indexOf("Windows 8.1")>-1)&&(u="8.1"),(a.indexOf("Windows NT 10")>-1||a.indexOf("Windows 10")>-1)&&(u="10"),u},p=function(a){var u=navigator.userAgent.toLowerCase();return a.chrome?"Chrome":a.firefox?"Firefox":a.safari?"Safari":a.webview?"webview":a.ie?/edge/.test(u)?"Edge":"IE":/baiduspider/.test(u)?"Baiduspider":/ucweb/.test(u)||/UCBrowser/.test(u)?"UC":/opera/.test(u)?"Opera":/ucweb/.test(u)?"UC":/360se/.test(u)?"360\u6D4F\u89C8\u5668":/bidubrowser/.test(u)?"\u767E\u5EA6\u6D4F\u89C8\u5668":/metasr/.test(u)?"\u641C\u72D7\u6D4F\u89C8\u5668":/lbbrowser/.test(u)?"\u730E\u8C79\u6D4F\u89C8\u5668":/micromessenger/.test(u)?"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668":/qqbrowser/.test(u)?"QQ\u6D4F\u89C8\u5668":/playstation/.test(u)?"PS4\u6D4F\u89C8\u5668":void 0},c=function(){var a={},u={},s=navigator.userAgent,f=navigator.platform,i=s.match(/Web[kK]it[\/]{0,1}([\d.]+)/),n=s.match(/(Android);?[\s\/]+([\d.]+)?/),t=!!s.match(/\(Macintosh\; Intel /),d=s.match(/(iPad).*OS\s([\d_]+)/),v=s.match(/(iPod)(.*OS\s([\d_]+))?/),g=!d&&s.match(/(iPhone\sOS)\s([\d_]+)/),b=s.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),_=/Win\d{2}|Windows/.test(f),m=s.match(/Windows Phone ([\d.]+)/),y=b&&s.match(/TouchPad/),E=s.match(/Kindle\/([\d.]+)/),o=s.match(/Silk\/([\d._]+)/),x=s.match(/(BlackBerry).*Version\/([\d.]+)/),A=s.match(/(BB10).*Version\/([\d.]+)/),O=s.match(/(RIM\sTablet\sOS)\s([\d.]+)/),D=s.match(/PlayBook/),N=s.match(/Chrome\/([\d.]+)/)||s.match(/CriOS\/([\d.]+)/),W=s.match(/Firefox\/([\d.]+)/),K=s.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/),oe=s.match(/MSIE\s([\d.]+)/)||s.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),B=!N&&s.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),X=B||s.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if((u.webkit=!!i)&&(u.version=i[1]),n&&(a.android=!0,a.version=n[2]),g&&!v&&(a.ios=a.iphone=!0,a.version=g[2].replace(/_/g,".")),d&&(a.ios=a.ipad=!0,a.version=d[2].replace(/_/g,".")),v&&(a.ios=a.ipod=!0,a.version=v[3]?v[3].replace(/_/g,"."):null),m&&(a.wp=!0,a.version=m[1]),b&&(a.webos=!0,a.version=b[2]),y&&(a.touchpad=!0),x&&(a.blackberry=!0,a.version=x[2]),A&&(a.bb10=!0,a.version=A[2]),O&&(a.rimtabletos=!0,a.version=O[2]),D&&(u.playbook=!0),E&&(a.kindle=!0,a.version=E[1]),o&&(u.silk=!0,u.version=o[1]),!o&&a.android&&s.match(/Kindle Fire/)&&(u.silk=!0),N&&(u.chrome=!0,u.version=N[1]),W&&(u.firefox=!0,u.version=W[1]),K&&(a.firefoxos=!0,a.version=K[1]),oe&&(u.ie=!0,u.version=oe[1]),X&&(t||a.ios||_||n)&&(u.safari=!0,a.ios||(u.version=X[1])),B&&(u.webview=!0),t){var V=s.match(/[\d]*_[\d]*_[\d]*/);V&&V.length>0&&V[0]&&(a.version=V[0].replace(/_/g,"."))}return a.tablet=!!(d||D||n&&!s.match(/Mobile/)||W&&s.match(/Tablet/)||oe&&!s.match(/Phone/)&&s.match(/Touch/)),a.phone=!(a.tablet||a.ipod||!(n||g||b||x||A||N&&s.match(/Android/)||N&&s.match(/CriOS\/([\d.]+)/)||W&&s.match(/Mobile/)||oe&&s.match(/Touch/))),a.pc=!a.tablet&&!a.phone,t?a.name="macOS":_?(a.name="windows",a.version=h()):a.name=C(a),u.name=p(u),{os:a,browser:u}}(),l=function(){function a(){S(this,a)}return T(a,null,[{key:"getHost",value:function(u){var s="";if(u===void 0||u==null||u=="")return"";var f=u.indexOf("//"),i=u;f>-1&&(i=u.substring(f+2));var s=i,n=i.split("/");return n&&n.length>0&&(s=n[0]),n=s.split(":"),n&&n.length>0&&(s=n[0]),s}},{key:"os",get:function(){return c.os}},{key:"browser",get:function(){var u=c.browser;return u.name||(u.name=p()),u}}]),a}();w.default=l},function(j,w,k){"use strict";function S(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function h(p,c){for(var l=0;l<c.length;l++){var a=c[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}return function(p,c,l){return c&&h(p.prototype,c),l&&h(p,l),p}}(),C=function(){function h(){S(this,h)}return T(h,null,[{key:"get",value:function(p,c,l,a,u){var s;l=l||function(){},typeof XMLHttpRequest=="undefined"&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(f){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(f){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(f){}throw new Error("This browser does not support XMLHttpRequest.")}),s=new XMLHttpRequest,s.onreadystatechange=function(){s.readyState===4&&(s.status===200?c(s.responseText):l(s.responseText))};try{a===void 0&&(a=!0),s.open("GET",p,a),u&&(s.withCredentials=!0)}catch(f){return void l(f)}try{s.send()}catch(f){l(f)}}}]),h}();w.default=C},function(j,w,k){"use strict";function S(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function c(l,a){for(var u=0;u<a.length;u++){var s=a[u];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}return function(l,a,u){return a&&c(l.prototype,a),u&&c(l,u),l}}(),C=k(27),h=k(30),p=(k(10),function(){function c(){S(this,c)}return T(c,null,[{key:"randomUUID",value:function(){for(var l=[],a="0123456789abcdef",u=0;u<36;u++)l[u]=a.substr(Math.floor(16*Math.random()),1);return l[14]="4",l[19]=a.substr(3&l[19]|8,1),l[8]=l[13]=l[18]=l[23]="-",l.join("")}},{key:"aliyunEncodeURI",value:function(l){var a=encodeURIComponent(l);return a=a.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(l,a,u){if(!l)throw new Error("PrismPlayer Error: vid should not be null!");var s=[];for(var f in l)s.push(f);for(var i=s.sort(),n="",t=i.length,f=0;f<t;f++){var d=c.aliyunEncodeURI(i[f]),v=c.aliyunEncodeURI(l[i[f]]);n==""?n=d+a+v:n+=u+d+a+v}return n}},{key:"makeChangeSiga",value:function(l,a){if(!l)throw new Error("PrismPlayer Error: vid should not be null!");return h.stringify(C("GET&"+c.aliyunEncodeURI("/")+"&"+c.aliyunEncodeURI(c.makeUTF8sort(l,"=","&")),a+"&"))}}]),c}());w.default=p},function(j,w,k){!function(S,T){j.exports=w=T(k(0))}(0,function(S){return S.enc.Utf8})},function(j,w,k){!function(S,T){j.exports=w=T(k(0))}(0,function(S){return S.enc.Hex})},function(j,w,k){j.exports=k(13)},function(j,w,k){"use strict";var S,T,C=(typeof Symbol=="function"&&Symbol.iterator,k(14)),h=function(c){return c&&c.__esModule?c:{default:c}}(C),p={Vod:h.default};S=[],(T=function(){return p}.apply(w,S))!==void 0&&(j.exports=T),window.AliyunUpload=p,rt.exports=AliyunUpload},function(j,w,k){"use strict";function S(A){return A&&A.__esModule?A:{default:A}}function T(A,O){if(!(A instanceof O))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function A(O,D){for(var N=0;N<D.length;N++){var W=D[N];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(O,W.key,W)}}return function(O,D,N){return D&&A(O.prototype,D),N&&A(O,N),O}}(),h=k(15),p=k(3),c=k(16),l=S(c),a=k(18),u=S(a),s=k(24),f=S(s),i=k(4),n=S(i),t=k(1),d=S(t),v=k(5),g=S(v),b=k(26),_=S(b),m=k(31),y=S(m),E=k(32),o=S(E),x=(k(2),function(){function A(O){T(this,A),this.options=O,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=h.VODSTATE.INIT,this._uploadList=[],this._curIndex=-1,this._ossUpload=null,this._log=new n.default,this._retryCount=0,this._retryTotal=this.options.retryCount||3,this._retryDuration=this.options.retryDuration||2,this._state=h.VODSTATE.INIT,this._uploadWay="vod",this._onbeforeunload=!1,this._invalidUserId=!1,this._initEvent()}return C(A,[{key:"init",value:function(O,D,N,W){return this._retryCount=0,!(N&&!W||!N&&W)&&!(O&&!D||!O&&D)&&(this._ossCreditor.accessKeyId=O,this._ossCreditor.accessKeySecret=D,this._ossCreditor.securityToken=N,this._ossCreditor.expireTime=W,!0)}},{key:"addFile",value:function(O,D,N,W,K,oe){if(!O)return!1;if(O.size==0)try{this.options.onUploadFailed({file:O},"EmptyFile","\u6587\u4EF6\u5927\u5C0F\u4E3A0\uFF0C\u4E0D\u80FD\u4E0A\u4F20")}catch(ne){console.log(ne)}for(var B=(this.options,0);B<this._uploadList.length;B++)if(this._uploadList[B].file==O)return!1;var X=new Object;if(X.file=O,X._endpoint=D,X._bucket=N,X._object=W,X.state=h.UPLOADSTATE.INIT,X.isImage=d.default.isImage(O.name),!X.isImage&&this.options.enableUploadProgress){var V=this;o.default.getMd5(O,function(ne){X.fileHash=ne;var $=V._getCheckoutpoint(X);V.options.localCheckpoint||$||V._getCheckoutpointFromCloud(X,function(Z){if(Z.UploadPoint){var ue=JSON.parse(Z.UploadPoint);ue.loaded!=1&&(X.checkpoint=ue.checkpoint,X.loaded=ue.loaded,X.videoId=Z.VideoId,V._saveCheckoutpoint(X,ue.checkpoint))}},function(Z){try{if((Z=JSON.parse(Z))&&Z.Code=="InvalidParameter"&&Z.Message.indexOf("UserId")>0){V._invalidUserId=!0;var ue=Z.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(ue)}}catch(he){console.log(he)}})})}K&&(X.videoInfo=K?JSON.parse(K).Vod:{},X.userData=u.default.encode(K)),X.ri=g.default.create(),this._uploadList.push(X),this._reportLog("20001",X,{ql:this._uploadList.length});try{this.options.addFileSuccess&&this.options.addFileSuccess(X)}catch(ne){console.log(ne)}return!0}},{key:"deleteFile",value:function(O){return!!this.cancelFile(O)&&(this._uploadList.splice(O,1),!0)}},{key:"cleanList",value:function(){this.stopUpload(),this._uploadList.length=0,this._curIndex=-1}},{key:"cancelFile",value:function(O){if(this.options,O<0||O>=this._uploadList.length)return!1;var D=this._uploadList[O];if(O==this._curIndex&&D.state==h.UPLOADSTATE.UPLOADING){D.state=h.UPLOADSTATE.CANCELED;var N=this._getCheckoutpoint(D);N&&N.checkpoint&&(N=N.checkpoint),N&&this._ossUpload.abort(D),this._removeCheckoutpoint(D),this.nextUpload()}else D.state!=h.UPLOADSTATE.SUCCESS&&(D.state=h.UPLOADSTATE.CANCELED);return this._reportLog("20008",D),!0}},{key:"resumeFile",value:function(O){if(this.options,O<0||O>=this._uploadList.length)return!1;var D=this._uploadList[O];return D.state==h.UPLOADSTATE.CANCELED&&(D.state=h.UPLOADSTATE.INIT,!0)}},{key:"listFiles",value:function(){return this._uploadList}},{key:"getCheckpoint",value:function(O){return this._getCheckoutpoint({file:O})}},{key:"startUpload",value:function(O){if(this._retryCount=0,this.options,this._state==h.VODSTATE.START||this._state==h.VODSTATE.EXPIRE)return void console.log("already started or expired");if(this._initState(),this._curIndex=this._findUploadIndex(),this._curIndex==-1)return void(this._state=h.VODSTATE.END);var D=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(D),this._state=h.VODSTATE.START}},{key:"nextUpload",value:function(){var O=this.options;if(this._state==h.VODSTATE.START)if(this._curIndex=this._findUploadIndex(),this._curIndex!=-1){var D=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(D)}else{this._state=h.VODSTATE.END;try{O.onUploadEnd&&O.onUploadEnd(D)}catch(N){console.log(N)}}}},{key:"clear",value:function(O){for(var D=this.options,N=0,W=0;W<this._uploadList.length;W++)D.uploadList[W].state==h.UPLOADSTATE.SUCCESS&&N++,this._uploadList[W].state==O&&(D.uploadList.splice(W,1),W--);D.onClear&&D.onClear(D.uploadList.length,N)}},{key:"stopUpload",value:function(){if((this._state==h.VODSTATE.START||this._state==h.VODSTATE.FAILURE||this._curIndex==-1)&&this._curIndex!=-1){var O=this._uploadList[this._curIndex];this._state=h.VODSTATE.STOP,O.state=h.UPLOADSTATE.STOPED,this._changeState(O,h.UPLOADSTATE.STOPED),this._ossUpload.cancel()}}},{key:"resumeUploadWithAuth",value:function(O){var D=this;if(!O)return!1;var N=JSON.parse(u.default.decode(O));return!!(N.AccessKeyId&&N.AccessKeySecret&&N.SecurityToken&&N.Expiration)&&D.resumeUploadWithToken(N.AccessKeyId,N.AccessKeySecret,N.SecurityToken,N.Expiration)}},{key:"resumeUploadWithToken",value:function(O,D,N,W){if(this.options,!(O&&D&&N&&W))return!1;if(this._state!=h.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(O,D,N,W),this._state=h.VODSTATE.START,this._ossUpload=null,this._uploadCore(K,K.retry),K.retry=!1),!0}},{key:"resumeUploadWithSTSToken",value:function(O,D,N){if(this._curIndex==-1)return!1;if(this._state!=h.VODSTATE.EXPIRE)return!1;if(this._uploadList.length>this._curIndex){var W=this._uploadList[this._curIndex];W.object?this._refreshSTSTokenUpload(W,O,D,N):this.setSTSToken(W,O,D,N)}}},{key:"setSTSTokenDirectlyUpload",value:function(O,D,N,W,K){if(!(D&&N&&W&&K))return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken and expiration should not be empty."),!1;this._ut="oss";var oe=O;this.init(D,N,W,K),oe.endpoint=oe._endpoint,oe.bucket=oe._bucket,oe.object=oe._object,this._ossUpload=null,this._uploadCore(oe,O.retry),O.retry=!1}},{key:"setSTSToken",value:function(O,D,N,W){if(!D||!N||!W)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;this._ut="vod",this._uploadWay="sts";var K=O.videoInfo,oe={accessKeyId:D,securityToken:W,accessKeySecret:N,fileName:O.file.name,title:K.Title,requestId:O.ri,region:this.options.region};K.ImageType&&(oe.imageType=K.ImageType),K.ImageExt&&(oe.imageExt=K.ImageExt),K.FileSize&&(oe.fileSize=K.FileSize),K.Description&&(oe.description=K.Description),K.CateId&&(oe.cateId=K.CateId),K.Tags&&(oe.tags=K.Tags),K.TemplateGroupId&&(oe.templateGroupId=K.TemplateGroupId),K.StorageLocation&&(oe.storageLocation=K.StorageLocation),K.CoverURL&&(oe.coverUrl=K.CoverURL),K.TransCodeMode&&(oe.transCodeMode=K.TransCodeMode),K.UserData&&(oe.userData=K.UserData);var B=this,X="getUploadAuth";O.videoId?(oe.videoId=O.videoId,X="refreshUploadAuth"):O.isImage&&(X="getImageUploadAuth"),_.default[X](oe,function(V){O.videoId=V.VideoId?V.VideoId:O.videoId,B.setUploadAuthAndAddress(O,V.UploadAuth,V.UploadAddress),B._state=h.VODSTATE.START},function(V){B._error(O,{name:V.Code,code:V.Code,message:V.Message,requestId:V.RequestId})})}},{key:"setUploadAuthAndAddress",value:function(O,D,N,W){if(!O||!D||!N)return!1;var K=JSON.parse(u.default.decode(D));if(!(K.AccessKeyId&&K.AccessKeySecret&&K.SecurityToken&&K.Expiration))return console.error("uploadauth is invalid"),!1;var oe={},B=O;if(N){if(oe=JSON.parse(u.default.decode(N)),!oe.Endpoint||!oe.Bucket||!oe.FileName)return console.error("uploadAddress is invalid"),!1}else oe.Endpoint=B.endpoint,oe.Bucket=B.bucket,oe.FileName=B.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),B.endpoint=B._endpoint?B._endpoint:oe.Endpoint,B.bucket=B._bucket?B._bucket:oe.Bucket,B.object=B._object?B._object:oe.FileName,B.region=this.options.region,W&&(B.videoId=W),this._ossUpload=null,this._uploadCore(B,O.retry),O.retry=!1}},{key:"_refreshSTSTokenUpload",value:function(O,D,N,W){if(!D||!N||!W)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;var K={accessKeyId:D,securityToken:W,accessKeySecret:N,videoId:O.object,requestId:O.ri,region:this.options.region},oe=this,B="refreshUploadAuth";O.isImage&&(B="getImageUploadAuth"),_.default[B](K,function(X){oe.setUploadAuthAndAddress(O,X.UploadAuth,UploadAddress),oe._state=h.VODSTATE.START},function(X){oe._error(O,{name:X.Code,code:X.Code,message:X.Message,requestId:X.RequestId})})}},{key:"_upload",value:function(O){var D=arguments.length>1&&arguments[1]!==void 0&&arguments[1],N=this.options;if(O.retry=D,N.onUploadstarted&&!D)try{var W=this._getCheckoutpoint(O);W&&W.state!=h.UPLOADSTATE.UPLOADING&&(O.checkpoint=W,O.videoId=W.videoId),N.onUploadstarted(O)}catch(K){console.log(K)}}},{key:"_uploadCore",value:function(O){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(O.state=h.UPLOADSTATE.UPLOADING,!this._ossUpload){O.endpoint=O.endpoint||"http://oss-cn-hangzhou.aliyuncs.com";var D=this;this._ossUpload=new l.default({bucket:O.bucket,endpoint:O.endpoint,AccessKeyId:this._ossCreditor.accessKeyId,AccessKeySecret:this._ossCreditor.accessKeySecret,SecurityToken:this._ossCreditor.securityToken,timeout:this.options.timeout,cname:this.options.cname},{onerror:function(V,ne){D._error.call(D,V,ne)},oncomplete:function(V,ne){D._complete.call(D,V,ne)},onprogress:function(V,ne,$){D._progress.call(D,V,ne,$)}})}var N=d.default.getFileType(O.file.name),W=this._getCheckoutpoint(O),K="",oe="";W&&W.checkpoint&&(oe=W.state,K=W.videoId,W=W.checkpoint),W&&K==O.videoId&&oe!=h.UPLOADSTATE.UPLOADING&&(W.file=O.file,O.checkpoint=W,W.uploadId);var B=this._adjustPartSize(O);this._reportLog("20002",O,{ft:N,fs:O.file.size,bu:O.bucket,ok:O.object,vid:O.videoId||"",fn:O.file.name,fw:null,fh:null,ps:B});var X={headers:{"x-oss-notification":O.userData?O.userData:""},partSize:B,parallel:this.options.parallel};this._ossUpload.upload(O,X)}},{key:"_findUploadIndex",value:function(){for(var O=-1,D=0;D<this._uploadList.length;D++)if(this._uploadList[D].state==h.UPLOADSTATE.INIT){O=D;break}return O}},{key:"_error",value:function(O,D){if(D.name=="cancel")try{this.options.onUploadCanceled(O,D)}catch(W){console.log(W)}else{if(D.message.indexOf("InvalidAccessKeyIdError")>0||D.name=="SignatureDoesNotMatchError"||D.code=="SecurityTokenExpired"||D.code=="InvalidSecurityToken.Expired"||D.code=="InvalidAccessKeyId"&&this._ossCreditor.securityToken){if(this.options.onUploadTokenExpired){this._state=h.VODSTATE.EXPIRE,O.state=h.UPLOADSTATE.FAIlURE;try{this.options.onUploadTokenExpired(O,D)}catch(W){console.log(W)}}return}if((D.name=="RequestTimeoutError"||D.name=="ConnectionTimeout"||D.name=="ConnectionTimeoutError")&&this._retryTotal>this._retryCount){var N=this;return setTimeout(function(){N._uploadCore(O,!0)},1e3*N._retryDuration),void this._retryCount++}D.name=="NoSuchUploadError"&&this._removeCheckoutpoint(O),this._handleError(O,D)}}},{key:"_handleError",value:function(O,D){var N=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],W=h.UPLOADSTATE.FAIlURE;if(O.state!=h.UPLOADSTATE.CANCELED&&(O.state=h.UPLOADSTATE.FAIlURE,this._state=h.VODSTATE.FAILURE,this.options.onUploadFailed&&D&&D.code&&D.message))try{this.options.onUploadFailed(O,D.code,D.message)}catch(oe){console.log(oe)}if(N&&this._changeState(O,W),this._reportLog("20006",O,{code:D.name,message:D.message,requestId:D.requestId,fs:O.file.size,bu:O.bucket,ok:O.object,fn:O.file.name}),this._reportLog("20004",O,{requestId:D.requestId,fs:O.file.size,bu:O.bucket,ok:O.object,fn:O.file.name}),O.ri=g.default.create(),this._findUploadIndex()!=-1){var K=this;this._state=h.VODSTATE.START,setTimeout(function(){K.nextUpload()},100)}}},{key:"_complete",value:function(O,D){if(O.state=h.UPLOADSTATE.SUCCESS,this.options.onUploadSucceed)try{this.options.onUploadSucceed(O)}catch(K){console.log(K)}var N=0;D&&D.res&&D.res.headers&&(N=D.res.headers["x-oss-request-id"]),this._removeCheckoutpoint(O);var W=this;setTimeout(function(){W.nextUpload()},100),this._retryCount=0,this._reportLog("20003",O,{requestId:N})}},{key:"_progress",value:function(O,D,N){if(this.options.onUploadProgress)try{O.loaded=D.loaded,this.options.onUploadProgress(O,D.total,D.loaded)}catch(ne){console.log(ne)}var W=D.checkpoint,K=0;W&&(O.checkpoint=W,this._saveCheckoutpoint(O,W,h.UPLOADSTATE.UPLOADING),K=W.uploadId),this._retryCount=0;var oe=this._getPortNumber(W),B=0;if(N&&N.headers&&(B=N.headers["x-oss-request-id"]),D.loaded!=0&&this._reportLog("20007",O,{pn:oe,requestId:B}),D.loaded!=1&&this._reportLog("20005",O,{UploadId:K,pn:oe+1,pr:O.retry?1:0,fs:O.file.size,bu:O.bucket,ok:O.object,fn:O.file.name}),!this._invalidUserId&&!O.isImage&&this._ut=="vod"&&this.options.enableUploadProgress){var X={file:O.file,checkpoint:D,userId:this.options.userId,videoId:O.videoId,region:this.options.region,fileHash:O.fileHash};try{var V=this;y.default.upload(X,function(){},function(ne){if((ne=JSON.parse(ne))&&ne.Code=="InvalidParameter"&&ne.Message.indexOf("UserId")>0){V._invalidUserId=!0;var $=ne.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log($)}})}catch(ne){console.log(ne)}}}},{key:"_getPortNumber",value:function(O){if(O){var D=O.doneParts;if(D&&D.length>0)return D[D.length-1].number}return 0}},{key:"_removeCheckoutpoint",value:function(O){var D=this._getCheckoutpointKey(O);f.default.remove(D)}},{key:"_getCheckoutpoint",value:function(O){var D=this._getCheckoutpointKey(O),N=f.default.get(D);if(N)try{return JSON.parse(N)}catch(W){}return""}},{key:"_saveCheckoutpoint",value:function(O,D,N){if(D){var W=this._getCheckoutpointKey(O),K=O.file,oe={fileName:K.name,lastModified:K.lastModified,size:K.size,object:O.object,videoId:O.videoId,bucket:O.bucket,endpoint:O.endpoint,checkpoint:D,loaded:O.loaded,state:N};f.default.set(W,JSON.stringify(oe))}}},{key:"_changeState",value:function(O,D){var N=this._getCheckoutpoint(O);N&&((this._onbeforeunload=!0)&&(D=h.UPLOADSTATE.STOPED),this._saveCheckoutpoint(O,N.checkpoint,D))}},{key:"_getCheckoutpointKey",value:function(O){return"upload_"+O.file.lastModified+"_"+O.file.name+"_"+O.file.size}},{key:"_getCheckoutpointFromCloud",value:function(O,D,N){var W={userId:this.options.userId,uploadInfoList:[{FileName:O.file.name,FileSize:O.file.size,FileCreateTime:O.file.lastModified,FileHash:O.fileHash}],region:this.options.region};y.default.get(W,function(K){D(K)},N)}},{key:"_reportLog",value:function(O,D,N){N||(N={}),N.ri=D.ri,this._ut&&(N.ut=this._ut),this._log.log(O,N)}},{key:"_initEvent",value:function(){var O=this;window&&(window.onbeforeunload=function(D){if(O._onbeforeunload=!0,O._curIndex!=-1&&O._uploadList.length>O._curIndex){var N=O._uploadList[O._curIndex];O._changeState(N,h.UPLOADSTATE.STOPED)}})}},{key:"_initState",value:function(){for(var O=0;O<this._uploadList.length;O++){var D=this._uploadList[O];D.state!=h.UPLOADSTATE.FAIlURE&&D.state!=h.UPLOADSTATE.STOPED||(D.state=h.UPLOADSTATE.INIT)}this._state=h.VODSTATE.INIT}},{key:"_adjustPartSize",value:function(O){return O.file.size/this.options.partSize>1e4?O.file.size/9999:this.options.partSize}}]),A}());w.default=x},function(j,w,k){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.UPLOADSTATE={INIT:"Ready",UPLOADING:"Uploading",SUCCESS:"Success",FAIlURE:"Failure",CANCELED:"Canceled",STOPED:"Stoped"},w.VODSTATE={INIT:"Init",START:"Start",STOP:"Stop",FAILURE:"Failure",EXPIRE:"Expire",END:"End"}},function(j,w,k){"use strict";function S(a){return a&&a.__esModule?a:{default:a}}function T(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function a(u,s){for(var f=0;f<s.length;f++){var i=s[f];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}return function(u,s,f){return s&&a(u.prototype,s),f&&a(u,f),u}}(),h=k(3),p=k(17),c=(S(p),k(1)),l=(S(c),function(){function a(u,s){if(T(this,a),u){this._config=u,this.create(this._config),this._uploadInfo=null,this._callback={};var f=function(){};this._callback.onerror=s.onerror||f,this._callback.oncomplete=s.oncomplete||f,this._callback.onprogress=s.onprogress||f}}return C(a,[{key:"create",value:function(u){if(u.endpoint=u.endpoint||this._config.endpoint,u.bucket=u.bucket||this._config.bucket,!(u.AccessKeyId&&u.AccessKeySecret&&u.endpoint&&u.SecurityToken))throw new Error("AccessKeyId\u3001AccessKeySecret\u3001endpoint should not be null");var s={accessKeyId:u.AccessKeyId,accessKeySecret:u.AccessKeySecret,stsToken:u.SecurityToken,endpoint:u.endpoint||this._config.endpoint,bucket:u.bucket||this._config.bucket,secure:!0,cname:u.cname};u.timeout&&(s.timeout=u.timeout),this.oss=new OSS.Wrapper(s)}},{key:"abort",value:function(u){if(u.checkpoint){var s=u.checkpoint.uploadId;this.oss.abortMultipartUpload(u.object,s)}}},{key:"getVersion",value:function(){}},{key:"cancel",value:function(){this.oss.cancel&&this.oss.cancel()}},{key:"upload",value:function(u,s){this._uploadInfo=u;var f=this,i=function(t,d,v){return function(g){f._progress(t,d,v),g()}},n={parallel:s.parallel||this._config.parallel||h.UPLOADDEFAULT.PARALLEL,partSize:s.partSize||this._config.partSize||h.UPLOADDEFAULT.PARTSIZE,progress:i};s.headers&&(n.headers=s.headers),u.checkpoint&&(n.checkpoint=u.checkpoint),u.bucket||(this.oss.options.bucket=u.bucket),u.endpoint||(this.oss.options.endpoint=u.endpoint),this.oss.multipartUpload(u.object,u.file,n).then(function(t,d){f._complete(t)}).catch(function(t){f.oss.cancel&&(f.oss&&f.oss.isCancel()?console.log("oss is cancel as error"):f.oss.cancel()),f._error(t)})}},{key:"header",value:function(u,s,f){this.oss.get(u.object).then(function(i){s(i)}).catch(function(i){f(i)})}},{key:"_progress",value:function(u,s,f){this._callback.onprogress(this._uploadInfo,{loaded:u,total:this._uploadInfo.file.size,checkpoint:s},f)}},{key:"_error",value:function(u){this._callback.onerror(this._uploadInfo,u)}},{key:"_complete",value:function(u){this._callback.oncomplete(this._uploadInfo,u)}}]),a}());w.default=l},function(j,w,k){"use strict";function S(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function h(p,c){for(var l=0;l<c.length;l++){var a=c[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}return function(p,c,l){return c&&h(p.prototype,c),l&&h(p,l),p}}(),C=function(){function h(){S(this,h)}return T(h,null,[{key:"format",value:function(p){if(arguments.length<2)return null;for(var c=arguments[1],l=1;l<arguments.length;l++){var a=new RegExp("\\{"+(l-1)+"\\}","gm");c=c.replace(a,arguments[l+1])}return{code:p,message:c}}},{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."}}}]),h}();w.default=C},function(j,w,k){"use strict";(function(S){function T(p,c){if(!(p instanceof c))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function p(c,l){for(var a=0;a<l.length;a++){var u=l[a];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(c,u.key,u)}}return function(c,l,a){return l&&p(c.prototype,l),a&&p(c,a),c}}(),h=function(){function p(){T(this,p)}return C(p,null,[{key:"encode",value:function(c){return new S(c).toString("base64")}},{key:"decode",value:function(c){return new S(c,"base64").toString()}}]),p}();w.default=h}).call(w,k(19).Buffer)},function(j,w,k){"use strict";(function(S){function T(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(te,P){if(T()<P)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(te=new Uint8Array(P),te.__proto__=h.prototype):(te===null&&(te=new h(P)),te.length=P),te}function h(te,P,U){if(!(h.TYPED_ARRAY_SUPPORT||this instanceof h))return new h(te,P,U);if(typeof te=="number"){if(typeof P=="string")throw new Error("If encoding is specified then the first argument must be a string");return a(this,te)}return p(this,te,P,U)}function p(te,P,U,q){if(typeof P=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&P instanceof ArrayBuffer?f(te,P,U,q):typeof P=="string"?u(te,P,U):i(te,P)}function c(te){if(typeof te!="number")throw new TypeError('"size" argument must be a number');if(te<0)throw new RangeError('"size" argument must not be negative')}function l(te,P,U,q){return c(P),P<=0?C(te,P):U!==void 0?typeof q=="string"?C(te,P).fill(U,q):C(te,P).fill(U):C(te,P)}function a(te,P){if(c(P),te=C(te,P<0?0:0|n(P)),!h.TYPED_ARRAY_SUPPORT)for(var U=0;U<P;++U)te[U]=0;return te}function u(te,P,U){if(typeof U=="string"&&U!==""||(U="utf8"),!h.isEncoding(U))throw new TypeError('"encoding" must be a valid string encoding');var q=0|d(P,U);te=C(te,q);var Y=te.write(P,U);return Y!==q&&(te=te.slice(0,Y)),te}function s(te,P){var U=P.length<0?0:0|n(P.length);te=C(te,U);for(var q=0;q<U;q+=1)te[q]=255&P[q];return te}function f(te,P,U,q){if(P.byteLength,U<0||P.byteLength<U)throw new RangeError("'offset' is out of bounds");if(P.byteLength<U+(q||0))throw new RangeError("'length' is out of bounds");return P=U===void 0&&q===void 0?new Uint8Array(P):q===void 0?new Uint8Array(P,U):new Uint8Array(P,U,q),h.TYPED_ARRAY_SUPPORT?(te=P,te.__proto__=h.prototype):te=s(te,P),te}function i(te,P){if(h.isBuffer(P)){var U=0|n(P.length);return te=C(te,U),te.length===0||P.copy(te,0,0,U),te}if(P){if(typeof ArrayBuffer!="undefined"&&P.buffer instanceof ArrayBuffer||"length"in P)return typeof P.length!="number"||ze(P.length)?C(te,0):s(te,P);if(P.type==="Buffer"&&We(P.data))return s(te,P.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function n(te){if(te>=T())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T().toString(16)+" bytes");return 0|te}function t(te){return+te!=te&&(te=0),h.alloc(+te)}function d(te,P){if(h.isBuffer(te))return te.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(te)||te instanceof ArrayBuffer))return te.byteLength;typeof te!="string"&&(te=""+te);var U=te.length;if(U===0)return 0;for(var q=!1;;)switch(P){case"ascii":case"latin1":case"binary":return U;case"utf8":case"utf-8":case void 0:return _e(te).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*U;case"hex":return U>>>1;case"base64":return Ne(te).length;default:if(q)return _e(te).length;P=(""+P).toLowerCase(),q=!0}}function v(te,P,U){var q=!1;if((P===void 0||P<0)&&(P=0),P>this.length)return"";if((U===void 0||U>this.length)&&(U=this.length),U<=0)return"";if(U>>>=0,P>>>=0,U<=P)return"";for(te||(te="utf8");;)switch(te){case"hex":return oe(this,P,U);case"utf8":case"utf-8":return D(this,P,U);case"ascii":return W(this,P,U);case"latin1":case"binary":return K(this,P,U);case"base64":return O(this,P,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,P,U);default:if(q)throw new TypeError("Unknown encoding: "+te);te=(te+"").toLowerCase(),q=!0}}function g(te,P,U){var q=te[P];te[P]=te[U],te[U]=q}function b(te,P,U,q,Y){if(te.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:te.length-1),U<0&&(U=te.length+U),U>=te.length){if(Y)return-1;U=te.length-1}else if(U<0){if(!Y)return-1;U=0}if(typeof P=="string"&&(P=h.from(P,q)),h.isBuffer(P))return P.length===0?-1:_(te,P,U,q,Y);if(typeof P=="number")return P&=255,h.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Y?Uint8Array.prototype.indexOf.call(te,P,U):Uint8Array.prototype.lastIndexOf.call(te,P,U):_(te,[P],U,q,Y);throw new TypeError("val must be string, number or Buffer")}function _(te,P,U,q,Y){function J(qe,Ye){return Ee===1?qe[Ye]:qe.readUInt16BE(Ye*Ee)}var Ee=1,ke=te.length,ht=P.length;if(q!==void 0&&((q=String(q).toLowerCase())==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(te.length<2||P.length<2)return-1;Ee=2,ke/=2,ht/=2,U/=2}var Ue;if(Y){var je=-1;for(Ue=U;Ue<ke;Ue++)if(J(te,Ue)===J(P,je===-1?0:Ue-je)){if(je===-1&&(je=Ue),Ue-je+1===ht)return je*Ee}else je!==-1&&(Ue-=Ue-je),je=-1}else for(U+ht>ke&&(U=ke-ht),Ue=U;Ue>=0;Ue--){for(var tt=!0,dt=0;dt<ht;dt++)if(J(te,Ue+dt)!==J(P,dt)){tt=!1;break}if(tt)return Ue}return-1}function m(te,P,U,q){U=Number(U)||0;var Y=te.length-U;q?(q=Number(q))>Y&&(q=Y):q=Y;var J=P.length;if(J%2!=0)throw new TypeError("Invalid hex string");q>J/2&&(q=J/2);for(var Ee=0;Ee<q;++Ee){var ke=parseInt(P.substr(2*Ee,2),16);if(isNaN(ke))return Ee;te[U+Ee]=ke}return Ee}function y(te,P,U,q){return Be(_e(P,te.length-U),te,U,q)}function E(te,P,U,q){return Be(xe(P),te,U,q)}function o(te,P,U,q){return E(te,P,U,q)}function x(te,P,U,q){return Be(Ne(P),te,U,q)}function A(te,P,U,q){return Be(Ve(P,te.length-U),te,U,q)}function O(te,P,U){return P===0&&U===te.length?ye.fromByteArray(te):ye.fromByteArray(te.slice(P,U))}function D(te,P,U){U=Math.min(te.length,U);for(var q=[],Y=P;Y<U;){var J=te[Y],Ee=null,ke=J>239?4:J>223?3:J>191?2:1;if(Y+ke<=U){var ht,Ue,je,tt;switch(ke){case 1:J<128&&(Ee=J);break;case 2:ht=te[Y+1],(192&ht)==128&&(tt=(31&J)<<6|63&ht)>127&&(Ee=tt);break;case 3:ht=te[Y+1],Ue=te[Y+2],(192&ht)==128&&(192&Ue)==128&&(tt=(15&J)<<12|(63&ht)<<6|63&Ue)>2047&&(tt<55296||tt>57343)&&(Ee=tt);break;case 4:ht=te[Y+1],Ue=te[Y+2],je=te[Y+3],(192&ht)==128&&(192&Ue)==128&&(192&je)==128&&(tt=(15&J)<<18|(63&ht)<<12|(63&Ue)<<6|63&je)>65535&&tt<1114112&&(Ee=tt)}}Ee===null?(Ee=65533,ke=1):Ee>65535&&(Ee-=65536,q.push(Ee>>>10&1023|55296),Ee=56320|1023&Ee),q.push(Ee),Y+=ke}return N(q)}function N(te){var P=te.length;if(P<=He)return String.fromCharCode.apply(String,te);for(var U="",q=0;q<P;)U+=String.fromCharCode.apply(String,te.slice(q,q+=He));return U}function W(te,P,U){var q="";U=Math.min(te.length,U);for(var Y=P;Y<U;++Y)q+=String.fromCharCode(127&te[Y]);return q}function K(te,P,U){var q="";U=Math.min(te.length,U);for(var Y=P;Y<U;++Y)q+=String.fromCharCode(te[Y]);return q}function oe(te,P,U){var q=te.length;(!P||P<0)&&(P=0),(!U||U<0||U>q)&&(U=q);for(var Y="",J=P;J<U;++J)Y+=Pe(te[J]);return Y}function B(te,P,U){for(var q=te.slice(P,U),Y="",J=0;J<q.length;J+=2)Y+=String.fromCharCode(q[J]+256*q[J+1]);return Y}function X(te,P,U){if(te%1!=0||te<0)throw new RangeError("offset is not uint");if(te+P>U)throw new RangeError("Trying to access beyond buffer length")}function V(te,P,U,q,Y,J){if(!h.isBuffer(te))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>Y||P<J)throw new RangeError('"value" argument is out of bounds');if(U+q>te.length)throw new RangeError("Index out of range")}function ne(te,P,U,q){P<0&&(P=65535+P+1);for(var Y=0,J=Math.min(te.length-U,2);Y<J;++Y)te[U+Y]=(P&255<<8*(q?Y:1-Y))>>>8*(q?Y:1-Y)}function $(te,P,U,q){P<0&&(P=4294967295+P+1);for(var Y=0,J=Math.min(te.length-U,4);Y<J;++Y)te[U+Y]=P>>>8*(q?Y:3-Y)&255}function Z(te,P,U,q,Y,J){if(U+q>te.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("Index out of range")}function ue(te,P,U,q,Y){return Y||Z(te,P,U,4,34028234663852886e22,-34028234663852886e22),me.write(te,P,U,q,23,4),U+4}function he(te,P,U,q,Y){return Y||Z(te,P,U,8,17976931348623157e292,-17976931348623157e292),me.write(te,P,U,q,52,8),U+8}function Oe(te){if(te=we(te).replace(nt,""),te.length<2)return"";for(;te.length%4!=0;)te+="=";return te}function we(te){return te.trim?te.trim():te.replace(/^\s+|\s+$/g,"")}function Pe(te){return te<16?"0"+te.toString(16):te.toString(16)}function _e(te,P){P=P||1/0;for(var U,q=te.length,Y=null,J=[],Ee=0;Ee<q;++Ee){if((U=te.charCodeAt(Ee))>55295&&U<57344){if(!Y){if(U>56319){(P-=3)>-1&&J.push(239,191,189);continue}if(Ee+1===q){(P-=3)>-1&&J.push(239,191,189);continue}Y=U;continue}if(U<56320){(P-=3)>-1&&J.push(239,191,189),Y=U;continue}U=65536+(Y-55296<<10|U-56320)}else Y&&(P-=3)>-1&&J.push(239,191,189);if(Y=null,U<128){if((P-=1)<0)break;J.push(U)}else if(U<2048){if((P-=2)<0)break;J.push(U>>6|192,63&U|128)}else if(U<65536){if((P-=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((P-=4)<0)break;J.push(U>>18|240,U>>12&63|128,U>>6&63|128,63&U|128)}}return J}function xe(te){for(var P=[],U=0;U<te.length;++U)P.push(255&te.charCodeAt(U));return P}function Ve(te,P){for(var U,q,Y,J=[],Ee=0;Ee<te.length&&!((P-=2)<0);++Ee)U=te.charCodeAt(Ee),q=U>>8,Y=U%256,J.push(Y),J.push(q);return J}function Ne(te){return ye.toByteArray(Oe(te))}function Be(te,P,U,q){for(var Y=0;Y<q&&!(Y+U>=P.length||Y>=te.length);++Y)P[Y+U]=te[Y];return Y}function ze(te){return te!==te}/*!
|
|
|
* The buffer module from node.js, for the browser.
|
|
|
*
|
|
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
|
* @license MIT
|
|
|
*/var ye=k(21),me=k(22),We=k(23);w.Buffer=h,w.SlowBuffer=t,w.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=S.TYPED_ARRAY_SUPPORT!==void 0?S.TYPED_ARRAY_SUPPORT:function(){try{var te=new Uint8Array(1);return te.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},te.foo()===42&&typeof te.subarray=="function"&&te.subarray(1,1).byteLength===0}catch(P){return!1}}(),w.kMaxLength=T(),h.poolSize=8192,h._augment=function(te){return te.__proto__=h.prototype,te},h.from=function(te,P,U){return p(null,te,P,U)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(te,P,U){return l(null,te,P,U)},h.allocUnsafe=function(te){return a(null,te)},h.allocUnsafeSlow=function(te){return a(null,te)},h.isBuffer=function(te){return!(te==null||!te._isBuffer)},h.compare=function(te,P){if(!h.isBuffer(te)||!h.isBuffer(P))throw new TypeError("Arguments must be Buffers");if(te===P)return 0;for(var U=te.length,q=P.length,Y=0,J=Math.min(U,q);Y<J;++Y)if(te[Y]!==P[Y]){U=te[Y],q=P[Y];break}return U<q?-1:q<U?1:0},h.isEncoding=function(te){switch(String(te).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}},h.concat=function(te,P){if(!We(te))throw new TypeError('"list" argument must be an Array of Buffers');if(te.length===0)return h.alloc(0);var U;if(P===void 0)for(P=0,U=0;U<te.length;++U)P+=te[U].length;var q=h.allocUnsafe(P),Y=0;for(U=0;U<te.length;++U){var J=te[U];if(!h.isBuffer(J))throw new TypeError('"list" argument must be an Array of Buffers');J.copy(q,Y),Y+=J.length}return q},h.byteLength=d,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var te=this.length;if(te%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var P=0;P<te;P+=2)g(this,P,P+1);return this},h.prototype.swap32=function(){var te=this.length;if(te%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var P=0;P<te;P+=4)g(this,P,P+3),g(this,P+1,P+2);return this},h.prototype.swap64=function(){var te=this.length;if(te%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var P=0;P<te;P+=8)g(this,P,P+7),g(this,P+1,P+6),g(this,P+2,P+5),g(this,P+3,P+4);return this},h.prototype.toString=function(){var te=0|this.length;return te===0?"":arguments.length===0?D(this,0,te):v.apply(this,arguments)},h.prototype.equals=function(te){if(!h.isBuffer(te))throw new TypeError("Argument must be a Buffer");return this===te||h.compare(this,te)===0},h.prototype.inspect=function(){var te="",P=w.INSPECT_MAX_BYTES;return this.length>0&&(te=this.toString("hex",0,P).match(/.{2}/g).join(" "),this.length>P&&(te+=" ... ")),"<Buffer "+te+">"},h.prototype.compare=function(te,P,U,q,Y){if(!h.isBuffer(te))throw new TypeError("Argument must be a Buffer");if(P===void 0&&(P=0),U===void 0&&(U=te?te.length:0),q===void 0&&(q=0),Y===void 0&&(Y=this.length),P<0||U>te.length||q<0||Y>this.length)throw new RangeError("out of range index");if(q>=Y&&P>=U)return 0;if(q>=Y)return-1;if(P>=U)return 1;if(P>>>=0,U>>>=0,q>>>=0,Y>>>=0,this===te)return 0;for(var J=Y-q,Ee=U-P,ke=Math.min(J,Ee),ht=this.slice(q,Y),Ue=te.slice(P,U),je=0;je<ke;++je)if(ht[je]!==Ue[je]){J=ht[je],Ee=Ue[je];break}return J<Ee?-1:Ee<J?1:0},h.prototype.includes=function(te,P,U){return this.indexOf(te,P,U)!==-1},h.prototype.indexOf=function(te,P,U){return b(this,te,P,U,!0)},h.prototype.lastIndexOf=function(te,P,U){return b(this,te,P,U,!1)},h.prototype.write=function(te,P,U,q){if(P===void 0)q="utf8",U=this.length,P=0;else if(U===void 0&&typeof P=="string")q=P,U=this.length,P=0;else{if(!isFinite(P))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");P|=0,isFinite(U)?(U|=0,q===void 0&&(q="utf8")):(q=U,U=void 0)}var Y=this.length-P;if((U===void 0||U>Y)&&(U=Y),te.length>0&&(U<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");for(var J=!1;;)switch(q){case"hex":return m(this,te,P,U);case"utf8":case"utf-8":return y(this,te,P,U);case"ascii":return E(this,te,P,U);case"latin1":case"binary":return o(this,te,P,U);case"base64":return x(this,te,P,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,te,P,U);default:if(J)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),J=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var He=4096;h.prototype.slice=function(te,P){var U=this.length;te=~~te,P=P===void 0?U:~~P,te<0?(te+=U)<0&&(te=0):te>U&&(te=U),P<0?(P+=U)<0&&(P=0):P>U&&(P=U),P<te&&(P=te);var q;if(h.TYPED_ARRAY_SUPPORT)q=this.subarray(te,P),q.__proto__=h.prototype;else{var Y=P-te;q=new h(Y,void 0);for(var J=0;J<Y;++J)q[J]=this[J+te]}return q},h.prototype.readUIntLE=function(te,P,U){te|=0,P|=0,U||X(te,P,this.length);for(var q=this[te],Y=1,J=0;++J<P&&(Y*=256);)q+=this[te+J]*Y;return q},h.prototype.readUIntBE=function(te,P,U){te|=0,P|=0,U||X(te,P,this.length);for(var q=this[te+--P],Y=1;P>0&&(Y*=256);)q+=this[te+--P]*Y;return q},h.prototype.readUInt8=function(te,P){return P||X(te,1,this.length),this[te]},h.prototype.readUInt16LE=function(te,P){return P||X(te,2,this.length),this[te]|this[te+1]<<8},h.prototype.readUInt16BE=function(te,P){return P||X(te,2,this.length),this[te]<<8|this[te+1]},h.prototype.readUInt32LE=function(te,P){return P||X(te,4,this.length),(this[te]|this[te+1]<<8|this[te+2]<<16)+16777216*this[te+3]},h.prototype.readUInt32BE=function(te,P){return P||X(te,4,this.length),16777216*this[te]+(this[te+1]<<16|this[te+2]<<8|this[te+3])},h.prototype.readIntLE=function(te,P,U){te|=0,P|=0,U||X(te,P,this.length);for(var q=this[te],Y=1,J=0;++J<P&&(Y*=256);)q+=this[te+J]*Y;return Y*=128,q>=Y&&(q-=Math.pow(2,8*P)),q},h.prototype.readIntBE=function(te,P,U){te|=0,P|=0,U||X(te,P,this.length);for(var q=P,Y=1,J=this[te+--q];q>0&&(Y*=256);)J+=this[te+--q]*Y;return Y*=128,J>=Y&&(J-=Math.pow(2,8*P)),J},h.prototype.readInt8=function(te,P){return P||X(te,1,this.length),128&this[te]?-1*(255-this[te]+1):this[te]},h.prototype.readInt16LE=function(te,P){P||X(te,2,this.length);var U=this[te]|this[te+1]<<8;return 32768&U?4294901760|U:U},h.prototype.readInt16BE=function(te,P){P||X(te,2,this.length);var U=this[te+1]|this[te]<<8;return 32768&U?4294901760|U:U},h.prototype.readInt32LE=function(te,P){return P||X(te,4,this.length),this[te]|this[te+1]<<8|this[te+2]<<16|this[te+3]<<24},h.prototype.readInt32BE=function(te,P){return P||X(te,4,this.length),this[te]<<24|this[te+1]<<16|this[te+2]<<8|this[te+3]},h.prototype.readFloatLE=function(te,P){return P||X(te,4,this.length),me.read(this,te,!0,23,4)},h.prototype.readFloatBE=function(te,P){return P||X(te,4,this.length),me.read(this,te,!1,23,4)},h.prototype.readDoubleLE=function(te,P){return P||X(te,8,this.length),me.read(this,te,!0,52,8)},h.prototype.readDoubleBE=function(te,P){return P||X(te,8,this.length),me.read(this,te,!1,52,8)},h.prototype.writeUIntLE=function(te,P,U,q){(te=+te,P|=0,U|=0,!q)&&V(this,te,P,U,Math.pow(2,8*U)-1,0);var Y=1,J=0;for(this[P]=255&te;++J<U&&(Y*=256);)this[P+J]=te/Y&255;return P+U},h.prototype.writeUIntBE=function(te,P,U,q){(te=+te,P|=0,U|=0,!q)&&V(this,te,P,U,Math.pow(2,8*U)-1,0);var Y=U-1,J=1;for(this[P+Y]=255&te;--Y>=0&&(J*=256);)this[P+Y]=te/J&255;return P+U},h.prototype.writeUInt8=function(te,P,U){return te=+te,P|=0,U||V(this,te,P,1,255,0),h.TYPED_ARRAY_SUPPORT||(te=Math.floor(te)),this[P]=255&te,P+1},h.prototype.writeUInt16LE=function(te,P,U){return te=+te,P|=0,U||V(this,te,P,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[P]=255&te,this[P+1]=te>>>8):ne(this,te,P,!0),P+2},h.prototype.writeUInt16BE=function(te,P,U){return te=+te,P|=0,U||V(this,te,P,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[P]=te>>>8,this[P+1]=255&te):ne(this,te,P,!1),P+2},h.prototype.writeUInt32LE=function(te,P,U){return te=+te,P|=0,U||V(this,te,P,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[P+3]=te>>>24,this[P+2]=te>>>16,this[P+1]=te>>>8,this[P]=255&te):$(this,te,P,!0),P+4},h.prototype.writeUInt32BE=function(te,P,U){return te=+te,P|=0,U||V(this,te,P,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[P]=te>>>24,this[P+1]=te>>>16,this[P+2]=te>>>8,this[P+3]=255&te):$(this,te,P,!1),P+4},h.prototype.writeIntLE=function(te,P,U,q){if(te=+te,P|=0,!q){var Y=Math.pow(2,8*U-1);V(this,te,P,U,Y-1,-Y)}var J=0,Ee=1,ke=0;for(this[P]=255&te;++J<U&&(Ee*=256);)te<0&&ke===0&&this[P+J-1]!==0&&(ke=1),this[P+J]=(te/Ee>>0)-ke&255;return P+U},h.prototype.writeIntBE=function(te,P,U,q){if(te=+te,P|=0,!q){var Y=Math.pow(2,8*U-1);V(this,te,P,U,Y-1,-Y)}var J=U-1,Ee=1,ke=0;for(this[P+J]=255&te;--J>=0&&(Ee*=256);)te<0&&ke===0&&this[P+J+1]!==0&&(ke=1),this[P+J]=(te/Ee>>0)-ke&255;return P+U},h.prototype.writeInt8=function(te,P,U){return te=+te,P|=0,U||V(this,te,P,1,127,-128),h.TYPED_ARRAY_SUPPORT||(te=Math.floor(te)),te<0&&(te=255+te+1),this[P]=255&te,P+1},h.prototype.writeInt16LE=function(te,P,U){return te=+te,P|=0,U||V(this,te,P,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[P]=255&te,this[P+1]=te>>>8):ne(this,te,P,!0),P+2},h.prototype.writeInt16BE=function(te,P,U){return te=+te,P|=0,U||V(this,te,P,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[P]=te>>>8,this[P+1]=255&te):ne(this,te,P,!1),P+2},h.prototype.writeInt32LE=function(te,P,U){return te=+te,P|=0,U||V(this,te,P,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[P]=255&te,this[P+1]=te>>>8,this[P+2]=te>>>16,this[P+3]=te>>>24):$(this,te,P,!0),P+4},h.prototype.writeInt32BE=function(te,P,U){return te=+te,P|=0,U||V(this,te,P,4,2147483647,-2147483648),te<0&&(te=4294967295+te+1),h.TYPED_ARRAY_SUPPORT?(this[P]=te>>>24,this[P+1]=te>>>16,this[P+2]=te>>>8,this[P+3]=255&te):$(this,te,P,!1),P+4},h.prototype.writeFloatLE=function(te,P,U){return ue(this,te,P,!0,U)},h.prototype.writeFloatBE=function(te,P,U){return ue(this,te,P,!1,U)},h.prototype.writeDoubleLE=function(te,P,U){return he(this,te,P,!0,U)},h.prototype.writeDoubleBE=function(te,P,U){return he(this,te,P,!1,U)},h.prototype.copy=function(te,P,U,q){if(U||(U=0),q||q===0||(q=this.length),P>=te.length&&(P=te.length),P||(P=0),q>0&&q<U&&(q=U),q===U)return 0;if(te.length===0||this.length===0)return 0;if(P<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),te.length-P<q-U&&(q=te.length-P+U);var Y,J=q-U;if(this===te&&U<P&&P<q)for(Y=J-1;Y>=0;--Y)te[Y+P]=this[Y+U];else if(J<1e3||!h.TYPED_ARRAY_SUPPORT)for(Y=0;Y<J;++Y)te[Y+P]=this[Y+U];else Uint8Array.prototype.set.call(te,this.subarray(U,U+J),P);return J},h.prototype.fill=function(te,P,U,q){if(typeof te=="string"){if(typeof P=="string"?(q=P,P=0,U=this.length):typeof U=="string"&&(q=U,U=this.length),te.length===1){var Y=te.charCodeAt(0);Y<256&&(te=Y)}if(q!==void 0&&typeof q!="string")throw new TypeError("encoding must be a string");if(typeof q=="string"&&!h.isEncoding(q))throw new TypeError("Unknown encoding: "+q)}else typeof te=="number"&&(te&=255);if(P<0||this.length<P||this.length<U)throw new RangeError("Out of range index");if(U<=P)return this;P>>>=0,U=U===void 0?this.length:U>>>0,te||(te=0);var J;if(typeof te=="number")for(J=P;J<U;++J)this[J]=te;else{var Ee=h.isBuffer(te)?te:_e(new h(te,q).toString()),ke=Ee.length;for(J=0;J<U-P;++J)this[J+P]=Ee[J%ke]}return this};var nt=/[^+\/0-9A-Za-z-_]/g}).call(w,k(20))},function(j,w){var k;k=function(){return this}();try{k=k||Function("return this")()||(0,eval)("this")}catch(S){typeof window=="object"&&(k=window)}j.exports=k},function(j,w,k){"use strict";function S(n){var t=n.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return n[t-2]==="="?2:n[t-1]==="="?1:0}function T(n){return 3*n.length/4-S(n)}function C(n){var t,d,v,g,b,_=n.length;g=S(n),b=new u(3*_/4-g),d=g>0?_-4:_;var m=0;for(t=0;t<d;t+=4)v=a[n.charCodeAt(t)]<<18|a[n.charCodeAt(t+1)]<<12|a[n.charCodeAt(t+2)]<<6|a[n.charCodeAt(t+3)],b[m++]=v>>16&255,b[m++]=v>>8&255,b[m++]=255&v;return g===2?(v=a[n.charCodeAt(t)]<<2|a[n.charCodeAt(t+1)]>>4,b[m++]=255&v):g===1&&(v=a[n.charCodeAt(t)]<<10|a[n.charCodeAt(t+1)]<<4|a[n.charCodeAt(t+2)]>>2,b[m++]=v>>8&255,b[m++]=255&v),b}function h(n){return l[n>>18&63]+l[n>>12&63]+l[n>>6&63]+l[63&n]}function p(n,t,d){for(var v,g=[],b=t;b<d;b+=3)v=(n[b]<<16)+(n[b+1]<<8)+n[b+2],g.push(h(v));return g.join("")}function c(n){for(var t,d=n.length,v=d%3,g="",b=[],_=0,m=d-v;_<m;_+=16383)b.push(p(n,_,_+16383>m?m:_+16383));return v===1?(t=n[d-1],g+=l[t>>2],g+=l[t<<4&63],g+="=="):v===2&&(t=(n[d-2]<<8)+n[d-1],g+=l[t>>10],g+=l[t>>4&63],g+=l[t<<2&63],g+="="),b.push(g),b.join("")}w.byteLength=T,w.toByteArray=C,w.fromByteArray=c;for(var l=[],a=[],u=typeof Uint8Array!="undefined"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,i=s.length;f<i;++f)l[f]=s[f],a[s.charCodeAt(f)]=f;a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(j,w){w.read=function(k,S,T,C,h){var p,c,l=8*h-C-1,a=(1<<l)-1,u=a>>1,s=-7,f=T?h-1:0,i=T?-1:1,n=k[S+f];for(f+=i,p=n&(1<<-s)-1,n>>=-s,s+=l;s>0;p=256*p+k[S+f],f+=i,s-=8);for(c=p&(1<<-s)-1,p>>=-s,s+=C;s>0;c=256*c+k[S+f],f+=i,s-=8);if(p===0)p=1-u;else{if(p===a)return c?NaN:1/0*(n?-1:1);c+=Math.pow(2,C),p-=u}return(n?-1:1)*c*Math.pow(2,p-C)},w.write=function(k,S,T,C,h,p){var c,l,a,u=8*p-h-1,s=(1<<u)-1,f=s>>1,i=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,n=C?0:p-1,t=C?1:-1,d=S<0||S===0&&1/S<0?1:0;for(S=Math.abs(S),isNaN(S)||S===1/0?(l=isNaN(S)?1:0,c=s):(c=Math.floor(Math.log(S)/Math.LN2),S*(a=Math.pow(2,-c))<1&&(c--,a*=2),S+=c+f>=1?i/a:i*Math.pow(2,1-f),S*a>=2&&(c++,a/=2),c+f>=s?(l=0,c=s):c+f>=1?(l=(S*a-1)*Math.pow(2,h),c+=f):(l=S*Math.pow(2,f-1)*Math.pow(2,h),c=0));h>=8;k[T+n]=255&l,n+=t,l/=256,h-=8);for(c=c<<h|l,u+=h;u>0;k[T+n]=255&c,n+=t,c/=256,u-=8);k[T+n-t]|=128*d}},function(j,w){var k={}.toString;j.exports=Array.isArray||function(S){return k.call(S)=="[object Array]"}},function(j,w,k){"use strict";function S(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function h(p,c){for(var l=0;l<c.length;l++){var a=c[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}return function(p,c,l){return c&&h(p.prototype,c),l&&h(p,l),p}}(),C=function(){function h(){S(this,h)}return T(h,null,[{key:"set",value:function(p,c){try{window.localStorage&&localStorage.setItem(p,c)}catch(l){window[p+"_localStorage"]=c}}},{key:"get",value:function(p){try{if(window.localStorage)return localStorage.getItem(p)}catch(c){return window[p+"_localStorage"]}return""}},{key:"remove",value:function(p){try{window.localStorage&&localStorage.removeItem(p)}catch(c){delete window[p+"_localStorage"]}}}]),h}();w.default=C},function(j,w,k){"use strict";function S(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function h(p,c){for(var l=0;l<c.length;l++){var a=c[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}return function(p,c,l){return c&&h(p.prototype,c),l&&h(p,l),p}}(),C=function(){function h(){S(this,h)}return T(h,null,[{key:"get",value:function(p){for(var c=p+"",l=document.cookie.split(";"),a=0;a<l.length;a++){var u=l[a].trim();if(u.indexOf(c)==0)return unescape(u.substring(c.length+1,u.length))}return""}},{key:"set",value:function(p,c,l){var a=new Date;a.setTime(a.getTime()+24*l*60*60*1e3);var u="expires="+a.toGMTString();document.cookie=p+"="+escape(c)+"; "+u}}]),h}();w.default=C},function(j,w,k){"use strict";function S(u){return u&&u.__esModule?u:{default:u}}function T(u,s){if(!(u instanceof s))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function u(s,f){for(var i=0;i<f.length;i++){var n=f[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}return function(s,f,i){return f&&u(s.prototype,f),i&&u(s,i),s}}(),h=k(8),p=S(h),c=k(9),l=S(c),a=function(){function u(){T(this,u)}return C(u,null,[{key:"refreshUploadAuth",value:function(s,f,i){var n=(l.default.randomUUID(),l.default.randomUUID()),t={AccessKeyId:s.accessKeyId,SecurityToken:s.securityToken,Action:"RefreshUploadVideo",VideoId:s.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:n,RequestId:s.requestId},d=l.default.makeUTF8sort(t,"=","&")+"&Signature="+l.default.aliyunEncodeURI(l.default.makeChangeSiga(t,s.accessKeySecret)),v="https://vod."+s.region+".aliyuncs.com/?"+d;p.default.get(v,function(g){var g=JSON.parse(g);f&&f(g)},function(g){if(i){var b=JSON.parse(g);i(b)}})}},{key:"getUploadAuth",value:function(s,f,i){var n=(l.default.randomUUID(),l.default.randomUUID()),t={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:n,RequestId:s.requestId};s.fileSize&&(t.FileSize=s.fileSize),s.description&&(t.Description=s.description),s.cateId&&(t.CateId=s.cateId),s.tags&&(t.Tags=s.tags),s.templateGroupId&&(t.TemplateGroupId=s.templateGroupId),s.storageLocation&&(t.StorageLocation=s.storageLocation),s.coverUrl&&(t.CoverURL=s.coverUrl),s.transCodeMode&&(t.TransCodeMode=s.transCodeMode),s.userData&&(t.UserData=JSON.stringify(s.userData));var d=l.default.makeUTF8sort(t,"=","&")+"&Signature="+l.default.aliyunEncodeURI(l.default.makeChangeSiga(t,s.accessKeySecret)),v="https://vod."+s.region+".aliyuncs.com/?"+d;p.default.get(v,function(g){try{g=JSON.parse(g)}catch(b){if(i)return void i({Code:"GetUploadAuthFailed",Message:"\u83B7\u53D6uploadauth\u5931\u8D25"})}f&&f(g)},function(g){if(i){var b={Code:"GetUploadAuthFailed",Message:"\u83B7\u53D6uploadauth\u5931\u8D25"};try{b=JSON.parse(g)}catch(_){}i(b)}})}},{key:"getImageUploadAuth",value:function(s,f,i){var n=(l.default.randomUUID(),l.default.randomUUID()),t={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:n,RequestId:s.requestId};s.title&&(t.Title=s.title),s.imageExt&&(t.ImageExt=s.imageExt),s.tags&&(t.Tags=s.tags),s.storageLocation&&(t.StorageLocation=s.storageLocation);var d=l.default.makeUTF8sort(t,"=","&")+"&Signature="+l.default.aliyunEncodeURI(l.default.makeChangeSiga(t,s.accessKeySecret)),v="https://vod."+s.region+".aliyuncs.com/?"+d;p.default.get(v,function(g){g=JSON.parse(g),f&&f(g)},function(g){if(i){var b=JSON.parse(g);i(b)}})}}]),u}();w.default=a},function(j,w,k){!function(S,T,C){j.exports=w=T(k(0),k(28),k(29))}(0,function(S){return S.HmacSHA1})},function(j,w,k){!function(S,T){j.exports=w=T(k(0))}(0,function(S){return function(){var T=S,C=T.lib,h=C.WordArray,p=C.Hasher,c=T.algo,l=[],a=c.SHA1=p.extend({_doReset:function(){this._hash=new h.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(u,s){for(var f=this._hash.words,i=f[0],n=f[1],t=f[2],d=f[3],v=f[4],g=0;g<80;g++){if(g<16)l[g]=0|u[s+g];else{var b=l[g-3]^l[g-8]^l[g-14]^l[g-16];l[g]=b<<1|b>>>31}var _=(i<<5|i>>>27)+v+l[g];_+=g<20?1518500249+(n&t|~n&d):g<40?1859775393+(n^t^d):g<60?(n&t|n&d|t&d)-1894007588:(n^t^d)-899497514,v=d,d=t,t=n<<30|n>>>2,n=i,i=_}f[0]=f[0]+i|0,f[1]=f[1]+n|0,f[2]=f[2]+t|0,f[3]=f[3]+d|0,f[4]=f[4]+v|0},_doFinalize:function(){var u=this._data,s=u.words,f=8*this._nDataBytes,i=8*u.sigBytes;return s[i>>>5]|=128<<24-i%32,s[14+(i+64>>>9<<4)]=Math.floor(f/4294967296),s[15+(i+64>>>9<<4)]=f,u.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var u=p.clone.call(this);return u._hash=this._hash.clone(),u}});T.SHA1=p._createHelper(a),T.HmacSHA1=p._createHmacHelper(a)}(),S.SHA1})},function(j,w,k){!function(S,T){j.exports=w=T(k(0))}(0,function(S){!function(){var T=S,C=T.lib,h=C.Base,p=T.enc,c=p.Utf8,l=T.algo;l.HMAC=h.extend({init:function(a,u){a=this._hasher=new a.init,typeof u=="string"&&(u=c.parse(u));var s=a.blockSize,f=4*s;u.sigBytes>f&&(u=a.finalize(u)),u.clamp();for(var i=this._oKey=u.clone(),n=this._iKey=u.clone(),t=i.words,d=n.words,v=0;v<s;v++)t[v]^=1549556828,d[v]^=909522486;i.sigBytes=n.sigBytes=f,this.reset()},reset:function(){var a=this._hasher;a.reset(),a.update(this._iKey)},update:function(a){return this._hasher.update(a),this},finalize:function(a){var u=this._hasher,s=u.finalize(a);return u.reset(),u.finalize(this._oKey.clone().concat(s))}})}()})},function(j,w,k){!function(S,T){j.exports=w=T(k(0))}(0,function(S){return function(){function T(l,a,u){for(var s=[],f=0,i=0;i<a;i++)if(i%4){var n=u[l.charCodeAt(i-1)]<<i%4*2,t=u[l.charCodeAt(i)]>>>6-i%4*2;s[f>>>2]|=(n|t)<<24-f%4*8,f++}return p.create(s,f)}var C=S,h=C.lib,p=h.WordArray,c=C.enc;c.Base64={stringify:function(l){var a=l.words,u=l.sigBytes,s=this._map;l.clamp();for(var f=[],i=0;i<u;i+=3)for(var n=a[i>>>2]>>>24-i%4*8&255,t=a[i+1>>>2]>>>24-(i+1)%4*8&255,d=a[i+2>>>2]>>>24-(i+2)%4*8&255,v=n<<16|t<<8|d,g=0;g<4&&i+.75*g<u;g++)f.push(s.charAt(v>>>6*(3-g)&63));var b=s.charAt(64);if(b)for(;f.length%4;)f.push(b);return f.join("")},parse:function(l){var a=l.length,u=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var f=0;f<u.length;f++)s[u.charCodeAt(f)]=f}var i=u.charAt(64);if(i){var n=l.indexOf(i);n!==-1&&(a=n)}return T(l,a,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),S.enc.Base64})},function(j,w,k){"use strict";function S(m){return m&&m.__esModule?m:{default:m}}function T(m,y){if(!(m instanceof y))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function m(y,E){for(var o=0;o<E.length;o++){var x=E[o];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(y,x.key,x)}}return function(y,E,o){return E&&m(y.prototype,E),o&&m(y,o),y}}(),h=k(8),p=S(h),c=k(7),l=S(c),a=k(4),u=S(a),s=k(6),f=S(s),i=k(1),n=S(i),t=k(9),d=S(t),v=k(2),g=k(11),b=k(10),_=function(){function m(){T(this,m)}return C(m,null,[{key:"getAuthInfo",value:function(y,E,o){var x=y+"|f#Ylm&^1TppeRhLg|"+o;return E&&(x=y+"|"+E+"|f#Ylm&^1TppeRhLg|"+o),v(b.parse(x)).toString(g)}},{key:"upload",value:function(y,E,o){var x=n.default.ISODateString(new Date),A=Math.floor(new Date().valueOf()/1e3),O=u.default.getClientId();O=u.default.setClientId(O);var D=m.getAuthInfo(y.userId,O,A),N=d.default.randomUUID(),W={Source:"WebSDK",BusinessType:"UploadVideo",Action:"ReportUploadProgress",TerminalType:"H5",DeviceModel:l.default.browser.name+(l.default.browser.version||""),AppVersion:f.default.version,AuthTimestamp:A,Timestamp:x,AuthInfo:D,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:N};O&&(W.ClientId=O);var K=d.default.makeUTF8sort(W,"=","&")+"&Signature="+d.default.aliyunEncodeURI(d.default.makeChangeSiga(W,y.accessKeySecret)),oe="https://vod."+y.region+".aliyuncs.com/?"+K;p.default.get(oe,function(B){E&&E()},function(B){B&&(o(B),console.log(B))})}},{key:"get",value:function(y,E,o){var x=n.default.ISODateString(new Date),A=Math.floor(new Date().valueOf()/1e3),O=u.default.getClientId(),D=m.getAuthInfo(y.userId,O,A),N=d.default.randomUUID(),W={Source:"WebSDK",BusinessType:"UploadVideo",Action:"GetUploadProgress",TerminalType:"H5",DeviceModel:l.default.browser.name+(l.default.browser.version||""),AppVersion:f.default.version,AuthTimestamp:A,Timestamp:x,AuthInfo:D,UserId:y.userId,UploadInfoList:JSON.stringify(y.uploadInfoList),Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:N};O&&(W.ClientId=O);var K=d.default.makeUTF8sort(W,"=","&")+"&Signature="+d.default.aliyunEncodeURI(d.default.makeChangeSiga(W,y.accessKeySecret)),oe="https://vod."+y.region+".aliyuncs.com/?"+K;p.default.get(oe,function(B){var X={},V=O;B=B?JSON.parse(B):{},B.UploadProgress&&B.UploadProgress.UploadProgressList&&B.UploadProgress.UploadProgressList.length>0&&(X=B.UploadProgress.UploadProgressList[0],V=X.ClientId),u.default.setClientId(V),E&&E(X)},function(B){B&&(o(B),console.log(B))})}}]),m}();w.default=_},function(j,w,k){"use strict";function S(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function c(l,a){for(var u=0;u<a.length;u++){var s=a[u];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}return function(l,a,u){return a&&c(l.prototype,a),u&&c(l,u),l}}(),C=k(2),h=k(33),p=(k(11),function(){function c(){S(this,c)}return T(c,null,[{key:"getMd5",value:function(l,a,u){var s=new FileReader;s.onload=function(n){try{if(n&&n.target){var t=C(h.parse(n.target.result)),d=t.toString();a(d)}}catch(v){console.log(v)}},s.onerror=function(n){console.log(n),errorCallback(n)};var f=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,i=f.call(l,0,1024);s.readAsBinaryString(i)}}]),c}());w.default=p},function(j,w,k){!function(S,T){j.exports=w=T(k(0))}(0,function(S){return S.enc.Latin1})}])}).call(this,H("IyRk"))},ps8w:function(rt,$e,H){rt.exports=H.p+"static/show.6268a056.svg"},"rAM+":function(rt,$e,H){"use strict";H.d($e,"a",function(){return ee});var de=H("Qw5x");function ee(j,w){var k;if(typeof Symbol=="undefined"||j[Symbol.iterator]==null){if(Array.isArray(j)||(k=Object(de.a)(j))||w&&j&&typeof j.length=="number"){k&&(j=k);var S=0,T=function(){};return{s:T,n:function(){return S>=j.length?{done:!0}:{done:!1,value:j[S++]}},e:function(l){throw l},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 C=!0,h=!1,p;return{s:function(){k=j[Symbol.iterator]()},n:function(){var l=k.next();return C=l.done,l},e:function(l){h=!0,p=l},f:function(){try{!C&&k.return!=null&&k.return()}finally{if(h)throw p}}}}},rHrb:function(rt,$e,H){"use strict";Object.defineProperty($e,"__esModule",{value:!0}),$e.CopyToClipboard=void 0;var de=j(H("q1tI")),ee=j(H("+QRC"));function j(t){return t&&t.__esModule?t:{default:t}}function w(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?w=function(v){return typeof v}:w=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},w(t)}function k(t,d){var v=Object.keys(t);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(t);d&&(g=g.filter(function(b){return Object.getOwnPropertyDescriptor(t,b).enumerable})),v.push.apply(v,g)}return v}function S(t){for(var d=1;d<arguments.length;d++){var v=arguments[d]!=null?arguments[d]:{};d%2?k(v,!0).forEach(function(g){i(t,g,v[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(v)):k(v).forEach(function(g){Object.defineProperty(t,g,Object.getOwnPropertyDescriptor(v,g))})}return t}function T(t,d){if(t==null)return{};var v=C(t,d),g,b;if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(t);for(b=0;b<_.length;b++){if(g=_[b],d.indexOf(g)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,g))continue;v[g]=t[g]}}return v}function C(t,d){if(t==null)return{};var v={},g=Object.keys(t),b,_;for(_=0;_<g.length;_++){if(b=g[_],d.indexOf(b)>=0)continue;v[b]=t[b]}return v}function h(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}function p(t,d){for(var v=0;v<d.length;v++){var g=d[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(t,g.key,g)}}function c(t,d,v){return d&&p(t.prototype,d),v&&p(t,v),t}function l(t,d){return d&&(w(d)==="object"||typeof d=="function")?d:u(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},a(t)}function u(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(d&&d.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),d&&f(t,d)}function f(t,d){return f=Object.setPrototypeOf||function(g,b){return g.__proto__=b,g},f(t,d)}function i(t,d,v){return d in t?Object.defineProperty(t,d,{value:v,enumerable:!0,configurable:!0,writable:!0}):t[d]=v,t}var n=function(t){s(d,t);function d(){var v,g;h(this,d);for(var b=arguments.length,_=new Array(b),m=0;m<b;m++)_[m]=arguments[m];return g=l(this,(v=a(d)).call.apply(v,[this].concat(_))),i(u(g),"onClick",function(y){var E=g.props,o=E.text,x=E.onCopy,A=E.children,O=E.options,D=de.default.Children.only(A),N=(0,ee.default)(o,O);x&&x(o,N),D&&D.props&&typeof D.props.onClick=="function"&&D.props.onClick(y)}),g}return c(d,[{key:"render",value:function(){var g=this.props,b=g.text,_=g.onCopy,m=g.options,y=g.children,E=T(g,["text","onCopy","options","children"]),o=de.default.Children.only(y);return de.default.cloneElement(o,S({},E,{onClick:this.onClick}))}}]),d}(de.default.PureComponent);$e.CopyToClipboard=n,i(n,"defaultProps",{onCopy:void 0,options:void 0})},rUJ1:function(rt,$e){const H=/[&<>"']/,de=/[&<>"']/g,ee=/[<>"']|&(?!#?\w+;)/,j=/[<>"']|&(?!#?\w+;)/g,w={"&":"&","<":"<",">":">",'"':""","'":"'"},k=m=>w[m];function S(m,y){if(y){if(H.test(m))return m.replace(de,k)}else if(ee.test(m))return m.replace(j,k);return m}const T=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function C(m){return m.replace(T,(y,E)=>(E=E.toLowerCase(),E==="colon"?":":E.charAt(0)==="#"?E.charAt(1)==="x"?String.fromCharCode(parseInt(E.substring(2),16)):String.fromCharCode(+E.substring(1)):""))}const h=/(^|[^\[])\^/g;function p(m,y){m=m.source||m,y=y||"";const E={replace:(o,x)=>(x=x.source||x,x=x.replace(h,"$1"),m=m.replace(o,x),E),getRegex:()=>new RegExp(m,y)};return E}const c=/[^\w:]/g,l=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function a(m,y,E){if(m){let o;try{o=decodeURIComponent(C(E)).replace(c,"").toLowerCase()}catch(x){return null}if(o.indexOf("javascript:")===0||o.indexOf("vbscript:")===0||o.indexOf("data:")===0)return null}y&&!l.test(E)&&(E=n(y,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(o){return null}return E}const u={},s=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(m,y){u[" "+m]||(s.test(m)?u[" "+m]=m+"/":u[" "+m]=g(m,"/",!0)),m=u[" "+m];const E=m.indexOf(":")===-1;return y.substring(0,2)==="//"?E?y:m.replace(f,"$1")+y:y.charAt(0)==="/"?E?y:m.replace(i,"$1")+y:m+y}const t={exec:function(){}};function d(m){let y=1,E,o;for(;y<arguments.length;y++){E=arguments[y];for(o in E)Object.prototype.hasOwnProperty.call(E,o)&&(m[o]=E[o])}return m}function v(m,y){const E=m.replace(/\|/g,(A,O,D)=>{let N=!1,W=O;for(;--W>=0&&D[W]==="\\";)N=!N;return N?"|":" |"}),o=E.split(/ \|/);let x=0;if(o.length>y)o.splice(y);else for(;o.length<y;)o.push("");for(;x<o.length;x++)o[x]=o[x].trim().replace(/\\\|/g,"|");return o}function g(m,y,E){const o=m.length;if(o===0)return"";let x=0;for(;x<o;){const A=m.charAt(o-x-1);if(A===y&&!E)x++;else if(A!==y&&E)x++;else break}return m.substr(0,o-x)}function b(m,y){if(m.indexOf(y[1])===-1)return-1;const E=m.length;let o=0,x=0;for(;x<E;x++)if(m[x]==="\\")x++;else if(m[x]===y[0])o++;else if(m[x]===y[1]&&(o--,o<0))return x;return-1}function _(m){m&&m.sanitize&&!m.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}rt.exports={escape:S,unescape:C,edit:p,cleanUrl:a,resolveUrl:n,noopTest:t,merge:d,splitCells:v,rtrim:g,findClosingBracket:b,checkSanitizeDeprecation:_}},rdUC:function(rt,$e,H){var de=H("MFOe"),ee=de.Global;rt.exports={name:"localStorage",read:w,write:k,each:S,remove:T,clearAll:C};function j(){return ee.localStorage}function w(h){return j().getItem(h)}function k(h,p){return j().setItem(h,p)}function S(h){for(var p=j().length-1;p>=0;p--){var c=j().key(p);h(w(c),c)}}function T(h){return j().removeItem(h)}function C(){return j().clear()}},"s8/Y":function(rt,$e,H){rt.exports=H.p+"static/jx.6713fc81.svg"},"sB/4":function(rt,$e,H){rt.exports=H.p+"static/b.7405990c.svg"},sNtx:function(rt,$e,H){},sR1s:function(rt,$e,H){"use strict";H.d($e,"b",function(){return w}),H.d($e,"a",function(){return k}),H.d($e,"c",function(){return S}),H.d($e,"d",function(){return T});var de=H("U8pU"),ee="RC_TABLE_KEY";function j(C){return C==null?[]:Array.isArray(C)?C:[C]}function w(C,h){if(!h&&typeof h!="number")return C;for(var p=j(h),c=C,l=0;l<p.length;l+=1){if(!c)return null;var a=p[l];c=c[a]}return c}function k(C){var h=[],p={};return C.forEach(function(c){for(var l=c||{},a=l.key,u=l.dataIndex,s=a||j(u).join("-")||ee;p[s];)s="".concat(s,"_next");p[s]=!0,h.push(s)}),h}function S(){var C={};function h(a,u){u&&Object.keys(u).forEach(function(s){var f=u[s];f&&Object(de.a)(f)==="object"?(a[s]=a[s]||{},h(a[s],f)):a[s]=f})}for(var p=arguments.length,c=new Array(p),l=0;l<p;l++)c[l]=arguments[l];return c.forEach(function(a){h(C,a)}),C}function T(C){return C!=null}},sboe:function(rt,$e,H){"use strict";H.d($e,"a",function(){return j});var de=H("q1tI"),ee=H.n(de),j=de.createContext(null)},"t/PP":function(rt,$e,H){rt.exports=H.p+"static/title.dd3b799f.svg"},t23M:function(rt,$e,H){"use strict";var de=H("VTBJ"),ee=H("1OyB"),j=H("vuIU"),w=H("Ji7U"),k=H("LK+K"),S=H("q1tI"),T=H.n(S),C=H("m+aA"),h=H("Zm9Q"),p=H("Kwbf"),c=H("c+Xe"),l=H("bdgK"),a="rc-observer-key",u=function(s){Object(w.a)(i,s);var f=Object(k.a)(i);function i(){var n;return Object(ee.a)(this,i),n=f.apply(this,arguments),n.resizeObserver=null,n.childNode=null,n.currentElement=null,n.state={width:0,height:0,offsetHeight:0,offsetWidth:0},n.onResize=function(t){var d=n.props.onResize,v=t[0].target,g=v.getBoundingClientRect(),b=g.width,_=g.height,m=v.offsetWidth,y=v.offsetHeight,E=Math.floor(b),o=Math.floor(_);if(n.state.width!==E||n.state.height!==o||n.state.offsetWidth!==m||n.state.offsetHeight!==y){var x={width:E,height:o,offsetWidth:m,offsetHeight:y};n.setState(x),d&&Promise.resolve().then(function(){d(Object(de.a)(Object(de.a)({},x),{},{offsetWidth:m,offsetHeight:y}))})}},n.setChildNode=function(t){n.childNode=t},n}return Object(j.a)(i,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var t=this.props.disabled;if(t){this.destroyObserver();return}var d=Object(C.a)(this.childNode||this),v=d!==this.currentElement;v&&(this.destroyObserver(),this.currentElement=d),!this.resizeObserver&&d&&(this.resizeObserver=new l.default(this.onResize),this.resizeObserver.observe(d))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var t=this.props.children,d=Object(h.a)(t);if(d.length>1)Object(p.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(d.length===0)return Object(p.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var v=d[0];if(S.isValidElement(v)&&Object(c.c)(v)){var g=v.ref;d[0]=S.cloneElement(v,{ref:Object(c.a)(g,this.setChildNode)})}return d.length===1?d[0]:d.map(function(b,_){return!S.isValidElement(b)||"key"in b&&b.key!==null?b:S.cloneElement(b,{key:"".concat(a,"-").concat(_)})})}}]),i}(S.Component);u.displayName="ResizeObserver",$e.a=u},twBr:function(rt,$e,H){rt.exports=H.p+"static/s.1f286590.svg"},uMZB:function(rt,$e,H){rt.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(rt,$e,H){rt.exports=de;function de(){return H("gaXo"),{}}},ulZh:function(rt,$e,H){typeof window!="undefined"&&function(ee,j){rt.exports=j()}(this,function(){return function(de){var ee={};function j(w){if(ee[w])return ee[w].exports;var k=ee[w]={i:w,l:!1,exports:{}};return de[w].call(k.exports,k,k.exports,j),k.l=!0,k.exports}return j.m=de,j.c=ee,j.d=function(w,k,S){j.o(w,k)||Object.defineProperty(w,k,{enumerable:!0,get:S})},j.r=function(w){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})},j.t=function(w,k){if(k&1&&(w=j(w)),k&8)return w;if(k&4&&typeof w=="object"&&w&&w.__esModule)return w;var S=Object.create(null);if(j.r(S),Object.defineProperty(S,"default",{enumerable:!0,value:w}),k&2&&typeof w!="string")for(var T in w)j.d(S,T,function(C){return w[C]}.bind(null,T));return S},j.n=function(w){var k=w&&w.__esModule?function(){return w.default}:function(){return w};return j.d(k,"a",k),k},j.o=function(w,k){return Object.prototype.hasOwnProperty.call(w,k)},j.p="/dist/",j(j.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(de,ee,j){"use strict";var w=Object.prototype.hasOwnProperty,k="~";function S(){}Object.create&&(S.prototype=Object.create(null),new S().__proto__||(k=!1));function T(c,l,a){this.fn=c,this.context=l,this.once=a||!1}function C(c,l,a,u,s){if(typeof a!="function")throw new TypeError("The listener must be a function");var f=new T(a,u||c,s),i=k?k+l:l;return c._events[i]?c._events[i].fn?c._events[i]=[c._events[i],f]:c._events[i].push(f):(c._events[i]=f,c._eventsCount++),c}function h(c,l){--c._eventsCount===0?c._events=new S:delete c._events[l]}function p(){this._events=new S,this._eventsCount=0}p.prototype.eventNames=function(){var l=[],a,u;if(this._eventsCount===0)return l;for(u in a=this._events)w.call(a,u)&&l.push(k?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},p.prototype.listeners=function(l){var a=k?k+l:l,u=this._events[a];if(!u)return[];if(u.fn)return[u.fn];for(var s=0,f=u.length,i=new Array(f);s<f;s++)i[s]=u[s].fn;return i},p.prototype.listenerCount=function(l){var a=k?k+l:l,u=this._events[a];return u?u.fn?1:u.length:0},p.prototype.emit=function(l,a,u,s,f,i){var n=k?k+l:l;if(!this._events[n])return!1;var t=this._events[n],d=arguments.length,v,g;if(t.fn){t.once&&this.removeListener(l,t.fn,void 0,!0);switch(d){case 1:return t.fn.call(t.context),!0;case 2:return t.fn.call(t.context,a),!0;case 3:return t.fn.call(t.context,a,u),!0;case 4:return t.fn.call(t.context,a,u,s),!0;case 5:return t.fn.call(t.context,a,u,s,f),!0;case 6:return t.fn.call(t.context,a,u,s,f,i),!0}for(g=1,v=new Array(d-1);g<d;g++)v[g-1]=arguments[g];t.fn.apply(t.context,v)}else{var b=t.length,_;for(g=0;g<b;g++){t[g].once&&this.removeListener(l,t[g].fn,void 0,!0);switch(d){case 1:t[g].fn.call(t[g].context);break;case 2:t[g].fn.call(t[g].context,a);break;case 3:t[g].fn.call(t[g].context,a,u);break;case 4:t[g].fn.call(t[g].context,a,u,s);break;default:if(!v)for(_=1,v=new Array(d-1);_<d;_++)v[_-1]=arguments[_];t[g].fn.apply(t[g].context,v)}}}return!0},p.prototype.on=function(l,a,u){return C(this,l,a,u,!1)},p.prototype.once=function(l,a,u){return C(this,l,a,u,!0)},p.prototype.removeListener=function(l,a,u,s){var f=k?k+l:l;if(!this._events[f])return this;if(!a)return h(this,f),this;var i=this._events[f];if(i.fn)i.fn===a&&(!s||i.once)&&(!u||i.context===u)&&h(this,f);else{for(var n=0,t=[],d=i.length;n<d;n++)(i[n].fn!==a||s&&!i[n].once||u&&i[n].context!==u)&&t.push(i[n]);t.length?this._events[f]=t.length===1?t[0]:t:h(this,f)}return this},p.prototype.removeAllListeners=function(l){var a;return l?(a=k?k+l:l,this._events[a]&&h(this,a)):(this._events=new S,this._eventsCount=0),this},p.prototype.off=p.prototype.removeListener,p.prototype.addListener=p.prototype.on,p.prefixed=k,p.EventEmitter=p,de.exports=p},"./node_modules/url-toolkit/src/url-toolkit.js":function(de,ee,j){(function(w){var k=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,S=/^([^\/?#]*)([^]*)$/,T=/(?:\/|^)\.(?=\/)/g,C=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,h={buildAbsoluteURL:function(p,c,l){if(l=l||{},p=p.trim(),c=c.trim(),!c){if(!l.alwaysNormalize)return p;var a=h.parseURL(p);if(!a)throw new Error("Error trying to parse base URL.");return a.path=h.normalizePath(a.path),h.buildURLFromParts(a)}var u=h.parseURL(c);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return l.alwaysNormalize?(u.path=h.normalizePath(u.path),h.buildURLFromParts(u)):c;var s=h.parseURL(p);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&s.path[0]!=="/"){var f=S.exec(s.path);s.netLoc=f[1],s.path=f[2]}s.netLoc&&!s.path&&(s.path="/");var i={scheme:s.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(i.netLoc=s.netLoc,u.path[0]!=="/"))if(!u.path)i.path=s.path,u.params||(i.params=s.params,u.query||(i.query=s.query));else{var n=s.path,t=n.substring(0,n.lastIndexOf("/")+1)+u.path;i.path=h.normalizePath(t)}return i.path===null&&(i.path=l.alwaysNormalize?h.normalizePath(u.path):u.path),h.buildURLFromParts(i)},parseURL:function(p){var c=k.exec(p);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(p){for(p=p.split("").reverse().join("").replace(T,"");p.length!==(p=p.replace(C,"")).length;);return p.split("").reverse().join("")},buildURLFromParts:function(p){return p.scheme+p.netLoc+p.path+p.params+p.query+p.fragment}};de.exports=h})(this)},"./node_modules/webworkify-webpack/index.js":function(de,ee,j){function w(l){var a={};function u(f){if(a[f])return a[f].exports;var i=a[f]={i:f,l:!1,exports:{}};return l[f].call(i.exports,i,i.exports,u),i.l=!0,i.exports}u.m=l,u.c=a,u.i=function(f){return f},u.d=function(f,i,n){u.o(f,i)||Object.defineProperty(f,i,{configurable:!1,enumerable:!0,get:n})},u.r=function(f){Object.defineProperty(f,"__esModule",{value:!0})},u.n=function(f){var i=f&&f.__esModule?function(){return f.default}:function(){return f};return u.d(i,"a",i),i},u.o=function(f,i){return Object.prototype.hasOwnProperty.call(f,i)},u.p="/",u.oe=function(f){throw console.error(f),f};var s=u(u.s=ENTRY_MODULE);return s.default||s}var k="[\\.|\\-|\\+|\\w|/|@]+",S="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+k+").*?\\)";function T(l){return(l+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function C(l){return!isNaN(1*l)}function h(l,a,u){var s={};s[u]=[];var f=a.toString(),i=f.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return s;for(var n=i[1],t=new RegExp("(\\\\n|\\W)"+T(n)+S,"g"),d;d=t.exec(f);){if(d[3]==="dll-reference")continue;s[u].push(d[3])}for(t=new RegExp("\\("+T(n)+'\\("(dll-reference\\s('+k+'))"\\)\\)'+S,"g");d=t.exec(f);)l[d[2]]||(s[u].push(d[1]),l[d[2]]=j(d[1]).m),s[d[2]]=s[d[2]]||[],s[d[2]].push(d[4]);for(var v=Object.keys(s),g=0;g<v.length;g++)for(var b=0;b<s[v[g]].length;b++)C(s[v[g]][b])&&(s[v[g]][b]=1*s[v[g]][b]);return s}function p(l){var a=Object.keys(l);return a.reduce(function(u,s){return u||l[s].length>0},!1)}function c(l,a){for(var u={main:[a]},s={main:[]},f={main:{}};p(u);)for(var i=Object.keys(u),n=0;n<i.length;n++){var t=i[n],d=u[t],v=d.pop();if(f[t]=f[t]||{},f[t][v]||!l[t][v])continue;f[t][v]=!0,s[t]=s[t]||[],s[t].push(v);for(var g=h(l,l[t][v],t),b=Object.keys(g),_=0;_<b.length;_++)u[b[_]]=u[b[_]]||[],u[b[_]]=u[b[_]].concat(g[b[_]])}return s}de.exports=function(l,a){a=a||{};var u={main:j.m},s=a.all?{main:Object.keys(u.main)}:c(u,l),f="";Object.keys(s).filter(function(v){return v!=="main"}).forEach(function(v){for(var g=0;s[v][g];)g++;s[v].push(g),u[v][g]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",f=f+"var "+v+" = ("+w.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+s[v].map(function(b){return""+JSON.stringify(b)+": "+u[v][b].toString()}).join(",")+`});
|
|
|
`}),f=f+"new (("+w.toString().replace("ENTRY_MODULE",JSON.stringify(l))+")({"+s.main.map(function(v){return""+JSON.stringify(v)+": "+u.main[v].toString()}).join(",")+"}))(self);";var i=new window.Blob([f],{type:"text/javascript"});if(a.bare)return i;var n=window.URL||window.webkitURL||window.mozURL||window.msURL,t=n.createObjectURL(i),d=new window.Worker(t);return d.objectURL=t,d}},"./src/config.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"hlsDefaultConfig",function(){return _}),j.d(ee,"mergeConfig",function(){return y}),j.d(ee,"enableStreamingMode",function(){return E});var w=j("./src/controller/abr-controller.ts"),k=j("./src/controller/audio-stream-controller.ts"),S=j("./src/controller/audio-track-controller.ts"),T=j("./src/controller/subtitle-stream-controller.ts"),C=j("./src/controller/subtitle-track-controller.ts"),h=j("./src/controller/buffer-controller.ts"),p=j("./src/controller/timeline-controller.ts"),c=j("./src/controller/cap-level-controller.ts"),l=j("./src/controller/fps-controller.ts"),a=j("./src/controller/eme-controller.ts"),u=j("./src/controller/cmcd-controller.ts"),s=j("./src/utils/xhr-loader.ts"),f=j("./src/utils/fetch-loader.ts"),i=j("./src/utils/cues.ts"),n=j("./src/utils/mediakeys-helper.ts"),t=j("./src/utils/logger.ts");function d(){return d=Object.assign||function(o){for(var x=1;x<arguments.length;x++){var A=arguments[x];for(var O in A)Object.prototype.hasOwnProperty.call(A,O)&&(o[O]=A[O])}return o},d.apply(this,arguments)}function v(o,x){var A=Object.keys(o);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(o);x&&(O=O.filter(function(D){return Object.getOwnPropertyDescriptor(o,D).enumerable})),A.push.apply(A,O)}return A}function g(o){for(var x=1;x<arguments.length;x++){var A=arguments[x]!=null?arguments[x]:{};x%2?v(Object(A),!0).forEach(function(O){b(o,O,A[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(A)):v(Object(A)).forEach(function(O){Object.defineProperty(o,O,Object.getOwnPropertyDescriptor(A,O))})}return o}function b(o,x,A){return x in o?Object.defineProperty(o,x,{value:A,enumerable:!0,configurable:!0,writable:!0}):o[x]=A,o}var _=g(g({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:w.default,bufferController:h.default,capLevelController:c.default,fpsController:l.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:n.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},m()),{},{subtitleStreamController:T.SubtitleStreamController,subtitleTrackController:C.default,timelineController:p.TimelineController,audioStreamController:k.default,audioTrackController:S.default,emeController:a.default,cmcdController:u.default});function m(){return{cueHandler:i.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(o,x){if((x.liveSyncDurationCount||x.liveMaxLatencyDurationCount)&&(x.liveSyncDuration||x.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(x.liveMaxLatencyDurationCount!==void 0&&(x.liveSyncDurationCount===void 0||x.liveMaxLatencyDurationCount<=x.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(x.liveMaxLatencyDuration!==void 0&&(x.liveSyncDuration===void 0||x.liveMaxLatencyDuration<=x.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return d({},o,x)}function E(o){var x=o.loader;if(x!==f.default&&x!==s.default)t.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),o.progressive=!1;else{var A=Object(f.fetchSupported)();A&&(o.loader=f.default,o.progressive=!0,o.enableSoftwareAES=!0,t.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/polyfills/number.ts"),k=j("./src/utils/ewma-bandwidth-estimator.ts"),S=j("./src/events.ts"),T=j("./src/utils/buffer-helper.ts"),C=j("./src/errors.ts"),h=j("./src/types/loader.ts"),p=j("./src/utils/logger.ts");function c(u,s){for(var f=0;f<s.length;f++){var i=s[f];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}function l(u,s,f){return s&&c(u.prototype,s),f&&c(u,f),u}var a=function(){function u(f){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=f;var i=f.config;this.bwEstimator=new k.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var s=u.prototype;return s.registerListeners=function(){var i=this.hls;i.on(S.Events.FRAG_LOADING,this.onFragLoading,this),i.on(S.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(S.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(S.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var i=this.hls;i.off(S.Events.FRAG_LOADING,this.onFragLoading,this),i.off(S.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(S.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(S.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(i,n){var t=n.frag;if(t.type===h.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=t,this.partCurrent=(d=n.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},s.onLevelLoaded=function(i,n){var t=this.hls.config;n.details.live?this.bwEstimator.update(t.abrEwmaSlowLive,t.abrEwmaFastLive):this.bwEstimator.update(t.abrEwmaSlowVoD,t.abrEwmaFastVoD)},s._abandonRulesCheck=function(){var i=this.fragCurrent,n=this.partCurrent,t=this.hls,d=t.autoLevelEnabled,v=t.config,g=t.media;if(!i||!g)return;var b=n?n.stats:i.stats,_=n?n.duration:i.duration;if(b.aborted){p.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||g.paused||!g.playbackRate||!g.readyState)return;var m=performance.now()-b.loading.start,y=Math.abs(g.playbackRate);if(m<=500*_/y)return;var E=t.levels,o=t.minAutoLevel,x=E[i.level],A=b.total||Math.max(b.loaded,Math.round(_*x.maxBitrate/8)),O=Math.max(1,b.bwEstimate?b.bwEstimate/8:b.loaded*1e3/m),D=(A-b.loaded)/O,N=g.currentTime,W=(T.BufferHelper.bufferInfo(g,N,v.maxBufferHole).end-N)/y;if(W>=2*_/y||D<=W)return;var K=Number.POSITIVE_INFINITY,oe;for(oe=i.level-1;oe>o;oe--){var B=E[oe].maxBitrate;if(K=_*B/(8*.8*O),K<W)break}if(K>=D)return;var X=this.bwEstimator.getEstimate();p.logger.warn("Fragment "+i.sn+(n?" part "+n.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+oe+`
|
|
|
Current BW estimate: `+(Object(w.isFiniteNumber)(X)?(X/1024).toFixed(3):"Unknown")+` Kb/s
|
|
|
Estimated load time for current fragment: `+D.toFixed(3)+` s
|
|
|
Estimated load time for the next fragment: `+K.toFixed(3)+` s
|
|
|
Time to underbuffer: `+W.toFixed(3)+" s"),t.nextLoadLevel=oe,this.bwEstimator.sample(m,b.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),t.trigger(S.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:n,stats:b})},s.onFragLoaded=function(i,n){var t=n.frag,d=n.part;if(t.type===h.PlaylistLevelType.MAIN&&Object(w.isFiniteNumber)(t.sn)){var v=d?d.stats:t.stats,g=d?d.duration:t.duration;if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var b=this.hls.levels[t.level],_=(b.loaded?b.loaded.bytes:0)+v.loaded,m=(b.loaded?b.loaded.duration:0)+g;b.loaded={bytes:_,duration:m},b.realBitrate=Math.round(8*_/m)}if(t.bitrateTest){var y={stats:v,frag:t,part:d,id:t.type};this.onFragBuffered(S.Events.FRAG_BUFFERED,y),t.bitrateTest=!1}}},s.onFragBuffered=function(i,n){var t=n.frag,d=n.part,v=d?d.stats:t.stats;if(v.aborted)return;if(t.type!==h.PlaylistLevelType.MAIN||t.sn==="initSegment")return;var g=v.parsing.end-v.loading.start;this.bwEstimator.sample(g,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),t.bitrateTest?this.bitrateTestDelay=g/1e3:this.bitrateTestDelay=0},s.onError=function(i,n){switch(n.details){case C.ErrorDetails.FRAG_LOAD_ERROR:case C.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var i=this.fragCurrent,n=this.partCurrent,t=this.hls,d=t.maxAutoLevel,v=t.config,g=t.minAutoLevel,b=t.media,_=n?n.duration:i?i.duration:0,m=b?b.currentTime:0,y=b&&b.playbackRate!==0?Math.abs(b.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,o=(T.BufferHelper.bufferInfo(b,m,v.maxBufferHole).end-m)/y,x=this.findBestLevel(E,g,d,o,v.abrBandWidthFactor,v.abrBandWidthUpFactor);if(x>=0)return x;p.logger.trace((o?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var A=_?Math.min(_,v.maxStarvationDelay):v.maxStarvationDelay,O=v.abrBandWidthFactor,D=v.abrBandWidthUpFactor;if(!o){var N=this.bitrateTestDelay;if(N){var W=_?Math.min(_,v.maxLoadingDelay):v.maxLoadingDelay;A=W-N,p.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*A)+" ms"),O=D=1}}return x=this.findBestLevel(E,g,d,o+A,O,D),Math.max(x,0)},s.findBestLevel=function(i,n,t,d,v,g){for(var b,_=this.fragCurrent,m=this.partCurrent,y=this.lastLoadedFragLevel,E=this.hls.levels,o=E[y],x=!!(o!=null&&(b=o.details)!==null&&b!==void 0&&b.live),A=o==null?void 0:o.codecSet,O=m?m.duration:_?_.duration:0,D=t;D>=n;D--){var N=E[D];if(!N||A&&N.codecSet!==A)continue;var W=N.details,K=(m?W==null?void 0:W.partTarget:W==null?void 0:W.averagetargetduration)||O,oe=void 0;D<=y?oe=v*i:oe=g*i;var B=E[D].maxBitrate,X=B*K/oe;if(p.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+D+"/"+Math.round(oe)+"/"+B+"/"+K+"/"+d+"/"+X),oe>B&&(!X||x&&!this.bitrateTestDelay||X<d))return D}return-1},l(u,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,n=this.bwEstimator;if(i!==-1&&(!n||!n.canEstimate()))return i;var t=this.getNextABRAutoLevel();return i!==-1&&(t=Math.min(i,t)),t},set:function(i){this._nextAutoLevel=i}}]),u}();ee.default=a},"./src/controller/audio-stream-controller.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/polyfills/number.ts"),k=j("./src/controller/base-stream-controller.ts"),S=j("./src/events.ts"),T=j("./src/utils/buffer-helper.ts"),C=j("./src/controller/fragment-tracker.ts"),h=j("./src/types/level.ts"),p=j("./src/types/loader.ts"),c=j("./src/loader/fragment.ts"),l=j("./src/demux/chunk-cache.ts"),a=j("./src/demux/transmuxer-interface.ts"),u=j("./src/types/transmuxer.ts"),s=j("./src/controller/fragment-finders.ts"),f=j("./src/utils/discontinuities.ts"),i=j("./src/errors.ts"),n=j("./src/utils/logger.ts");function t(){return t=Object.assign||function(_){for(var m=1;m<arguments.length;m++){var y=arguments[m];for(var E in y)Object.prototype.hasOwnProperty.call(y,E)&&(_[E]=y[E])}return _},t.apply(this,arguments)}function d(_,m){_.prototype=Object.create(m.prototype),_.prototype.constructor=_,v(_,m)}function v(_,m){return v=Object.setPrototypeOf||function(E,o){return E.__proto__=o,E},v(_,m)}var g=100,b=function(_){d(m,_);function m(E,o){var x;return x=_.call(this,E,o,"[audio-stream-controller]")||this,x.videoBuffer=null,x.videoTrackCC=-1,x.waitingVideoCC=-1,x.audioSwitch=!1,x.trackId=-1,x.waitingData=null,x.mainDetails=null,x.bufferFlushed=!1,x._registerListeners(),x}var y=m.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._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.MANIFEST_LOADING,this.onManifestLoading,this),o.on(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(S.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),o.on(S.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),o.on(S.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(S.Events.ERROR,this.onError,this),o.on(S.Events.BUFFER_RESET,this.onBufferReset,this),o.on(S.Events.BUFFER_CREATED,this.onBufferCreated,this),o.on(S.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),o.on(S.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(S.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._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.MANIFEST_LOADING,this.onManifestLoading,this),o.off(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(S.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),o.off(S.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),o.off(S.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(S.Events.ERROR,this.onError,this),o.off(S.Events.BUFFER_RESET,this.onBufferReset,this),o.off(S.Events.BUFFER_CREATED,this.onBufferCreated,this),o.off(S.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),o.off(S.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.off(S.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onInitPtsFound=function(o,x){var A=x.frag,O=x.id,D=x.initPTS;if(O==="main"){var N=A.cc;this.initPTS[A.cc]=D,this.log("InitPTS for cc: "+N+" found from main: "+D),this.videoTrackCC=N,this.state===k.State.WAITING_INIT_PTS&&this.tick()}},y.startLoad=function(o){if(!this.levels){this.startPosition=o,this.state=k.State.STOPPED;return}var x=this.lastCurrentTime;this.stopLoad(),this.setInterval(g),this.fragLoadError=0,x>0&&o===-1?(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),this.state=k.State.IDLE):(this.loadedmetadata=!1,this.state=k.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=o,this.tick()},y.doTick=function(){switch(this.state){case k.State.IDLE:this.doTickIdle();break;case k.State.WAITING_TRACK:{var o,x=this.levels,A=this.trackId,O=x==null||((o=x[A])===null||o===void 0)?void 0:o.details;if(O){if(this.waitForCdnTuneIn(O))break;this.state=k.State.WAITING_INIT_PTS}break}case k.State.FRAG_LOADING_WAITING_RETRY:{var D,N=performance.now(),W=this.retryDate;(!W||N>=W||(D=this.media)!==null&&D!==void 0&&D.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=k.State.IDLE);break}case k.State.WAITING_INIT_PTS:{var K=this.waitingData;if(K){var oe=K.frag,B=K.part,X=K.cache,V=K.complete;if(this.initPTS[oe.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=k.State.FRAG_LOADING;var ne=X.flush(),$={frag:oe,part:B,payload:ne,networkDetails:null};this._handleFragmentLoadProgress($),V&&_.prototype._handleFragmentLoadComplete.call(this,$)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+oe.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Z=this.getLoadPosition(),ue=T.BufferHelper.bufferInfo(this.mediaBuffer,Z,this.config.maxBufferHole),he=Object(s.fragmentWithinToleranceTest)(ue.end,this.config.maxFragLookUpTolerance,oe);he<0&&(n.logger.log("Waiting fragment cc ("+oe.cc+") @ "+oe.start+" cancelled because another fragment at "+ue.end+" is needed"),this.clearWaitingFragment())}}else this.state=k.State.IDLE}}this.onTickEnd()},y.clearWaitingFragment=function(){var o=this.waitingData;o&&(this.fragmentTracker.removeFragment(o.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=k.State.IDLE)},y.onTickEnd=function(){var o=this.media;if(!o||!o.readyState)return;var x=this.mediaBuffer?this.mediaBuffer:o,A=x.buffered;!this.loadedmetadata&&A.length&&(this.loadedmetadata=!0),this.lastCurrentTime=o.currentTime},y.doTickIdle=function(){var o,x,A=this.hls,O=this.levels,D=this.media,N=this.trackId,W=A.config;if(!O||!O[N])return;if(!D&&(this.startFragRequested||!W.startFragPrefetch))return;var K=O[N],oe=K.details;if(!oe||oe.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(oe)){this.state=k.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,c.ElementaryStreamTypes.AUDIO,p.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,p.PlaylistLevelType.AUDIO);if(B===null)return;var X=B.len,V=this.getMaxBufferLength(),ne=this.audioSwitch;if(X>=V&&!ne)return;if(!ne&&this._streamEnded(B,oe)){A.trigger(S.Events.BUFFER_EOS,{type:"audio"}),this.state=k.State.ENDED;return}var $=oe.fragments,Z=$[0].start,ue=B.end;if(ne){var he=this.getLoadPosition();ue=he,oe.PTSKnown&&he<Z&&((B.end>Z||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),D.currentTime=Z+.05))}var Oe=this.getNextFragment(ue,oe);if(!Oe){this.bufferFlushed=!0;return}((o=Oe.decryptdata)===null||o===void 0?void 0:o.keyFormat)==="identity"&&!((x=Oe.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(Oe,oe):this.loadFragment(Oe,oe,ue)},y.getMaxBufferLength=function(){var o=_.prototype.getMaxBufferLength.call(this),x=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,p.PlaylistLevelType.MAIN);return x===null?o:Math.max(o,x.len)},y.onMediaDetaching=function(){this.videoBuffer=null,_.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(o,x){var A=x.audioTracks;this.resetTransmuxer(),this.levels=A.map(function(O){return new h.Level(O)})},y.onAudioTrackSwitching=function(o,x){var A=!!x.url;this.trackId=x.id;var O=this.fragCurrent;O!=null&&O.loader&&O.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),A?this.setInterval(g):this.resetTransmuxer(),A?(this.audioSwitch=!0,this.state=k.State.IDLE):this.state=k.State.STOPPED,this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},y.onLevelLoaded=function(o,x){this.mainDetails=x.details},y.onAudioTrackLoaded=function(o,x){var A,O=this.levels,D=x.details,N=x.id;if(!O){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+D.startSN+","+D.endSN+"],duration:"+D.totalduration);var W=O[N],K=0;if(D.live||(A=W.details)!==null&&A!==void 0&&A.live){var oe=this.mainDetails;if(D.fragments[0]||(D.deltaUpdateFailed=!0),D.deltaUpdateFailed||!oe)return;!W.details&&D.hasProgramDateTime&&oe.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(D,oe),K=D.fragments[0].start):K=this.alignPlaylists(D,W.details)}W.details=D,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!D.live)&&this.setStartPosition(W.details,K),this.state===k.State.WAITING_TRACK&&!this.waitForCdnTuneIn(D)&&(this.state=k.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(o){var x,A=o.frag,O=o.part,D=o.payload,N=this.config,W=this.trackId,K=this.levels;if(!K){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+A.sn+" of level "+A.level+" will not be buffered");return}var oe=K[W];console.assert(oe,"Audio track is defined on fragment load progress");var B=oe.details;console.assert(B,"Audio track details are defined on fragment load progress");var X=N.defaultAudioCodec||oe.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new a.default(this.hls,p.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ne=this.initPTS[A.cc],$=(x=A.initSegment)===null||x===void 0?void 0:x.data;if(ne!==void 0){var Z=!1,ue=O?O.index:-1,he=ue!==-1,Oe=new u.ChunkMetadata(A.level,A.sn,A.stats.chunkCount,D.byteLength,ue,he);V.push(D,$,X,"",A,O,B.totalduration,Z,Oe,ne)}else{n.logger.log("Unknown video PTS for cc "+A.cc+", waiting for video PTS before demuxing audio frag "+A.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+W);var we=this.waitingData=this.waitingData||{frag:A,part:O,cache:new l.default,complete:!1},Pe=we.cache;Pe.push(new Uint8Array(D)),this.waitingVideoCC=this.videoTrackCC,this.state=k.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(o){if(this.waitingData){this.waitingData.complete=!0;return}_.prototype._handleFragmentLoadComplete.call(this,o)},y.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},y.onBufferCreated=function(o,x){var A=x.tracks.audio;A&&(this.mediaBuffer=A.buffer),x.tracks.video&&(this.videoBuffer=x.tracks.video.buffer)},y.onFragBuffered=function(o,x){var A=x.frag,O=x.part;if(A.type!==p.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(A)){this.warn("Fragment "+A.sn+(O?" p: "+O.index:"")+" of level "+A.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}A.sn!=="initSegment"&&(this.fragPrevious=A,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(S.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(A,O)},y.onError=function(o,x){switch(x.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p.PlaylistLevelType.AUDIO,x);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==k.State.ERROR&&this.state!==k.State.STOPPED&&(this.state=x.fatal?k.State.ERROR:k.State.IDLE,this.warn(x.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="audio"&&(this.state===k.State.PARSING||this.state===k.State.PARSED)){var A=!0,O=this.getFwdBufferInfo(this.mediaBuffer,p.PlaylistLevelType.AUDIO);O&&O.len>.5&&(A=!this.reduceMaxBufferLength(O.len)),A&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,_.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},y.onBufferFlushed=function(o,x){var A=x.type;A===c.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(o){var x,A="audio",O=this.hls,D=o.remuxResult,N=o.chunkMeta,W=this.getCurrentContext(N);if(!W){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var K=W.frag,oe=W.part,B=D.audio,X=D.text,V=D.id3,ne=D.initSegment;if(this.fragContextChanged(K))return;if(this.state=k.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),ne!=null&&ne.tracks&&(this._bufferInitSegment(ne.tracks,K,N),O.trigger(S.Events.FRAG_PARSING_INIT_SEGMENT,{frag:K,id:A,tracks:ne.tracks})),B){var $=B.startPTS,Z=B.endPTS,ue=B.startDTS,he=B.endDTS;oe&&(oe.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:$,endPTS:Z,startDTS:ue,endDTS:he}),K.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,$,Z,ue,he),this.bufferFragmentData(B,K,oe,N)}if(V!=null&&(x=V.samples)!==null&&x!==void 0&&x.length){var Oe=t({frag:K,id:A},V);O.trigger(S.Events.FRAG_PARSING_METADATA,Oe)}if(X){var we=t({frag:K,id:A},X);O.trigger(S.Events.FRAG_PARSING_USERDATA,we)}},y._bufferInitSegment=function(o,x,A){if(this.state!==k.State.PARSING)return;o.video&&delete o.video;var O=o.audio;if(!O)return;O.levelCodec=O.codec,O.id="audio",this.log("Init audio buffer, container:"+O.container+", codecs[parsed]=["+O.codec+"]"),this.hls.trigger(S.Events.BUFFER_CODECS,o);var D=O.initSegment;if(D!=null&&D.byteLength){var N={type:"audio",frag:x,part:null,chunkMeta:A,parent:x.type,data:D};this.hls.trigger(S.Events.BUFFER_APPENDING,N)}this.tick()},y.loadFragment=function(o,x,A){var O=this.fragmentTracker.getState(o);this.fragCurrent=o,(this.audioSwitch||O===C.FragmentState.NOT_LOADED||O===C.FragmentState.PARTIAL)&&(o.sn==="initSegment"?this._loadInitSegment(o):x.live&&!Object(w.isFiniteNumber)(this.initPTS[o.cc])?(this.log("Waiting for video PTS in continuity counter "+o.cc+" of live stream before loading audio fragment "+o.sn+" of level "+this.trackId),this.state=k.State.WAITING_INIT_PTS):(this.startFragRequested=!0,_.prototype.loadFragment.call(this,o,x,A)))},y.completeAudioSwitch=function(){var o=this.hls,x=this.media,A=this.trackId;x&&(this.log("Switching audio track : flushing all audio"),_.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,o.trigger(S.Events.AUDIO_TRACK_SWITCHED,{id:A})},m}(k.default);ee.default=b},"./src/controller/audio-track-controller.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/events.ts"),k=j("./src/errors.ts"),S=j("./src/controller/base-playlist-controller.ts"),T=j("./src/types/loader.ts");function C(a,u){for(var s=0;s<u.length;s++){var f=u[s];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(a,f.key,f)}}function h(a,u,s){return u&&C(a.prototype,u),s&&C(a,s),a}function p(a,u){a.prototype=Object.create(u.prototype),a.prototype.constructor=a,c(a,u)}function c(a,u){return c=Object.setPrototypeOf||function(f,i){return f.__proto__=i,f},c(a,u)}var l=function(a){p(u,a);function u(f){var i;return i=a.call(this,f,"[audio-track-controller]")||this,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}var s=u.prototype;return s.registerListeners=function(){var i=this.hls;i.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(w.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(w.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(w.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(w.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var i=this.hls;i.off(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(w.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(w.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(w.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(w.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,a.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(i,n){this.tracks=n.audioTracks||[]},s.onAudioTrackLoaded=function(i,n){var t=n.id,d=n.details,v=this.tracksInGroup[t];if(!v){this.warn("Invalid audio track id "+t);return}var g=v.details;v.details=n.details,this.log("audioTrack "+t+" loaded ["+d.startSN+"-"+d.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,n,g))},s.onLevelLoading=function(i,n){this.switchLevel(n.level)},s.onLevelSwitching=function(i,n){this.switchLevel(n.level)},s.switchLevel=function(i){var n=this.hls.levels[i];if(!(n!=null&&n.audioGroupIds))return;var t=n.audioGroupIds[n.urlId];if(this.groupId!==t){this.groupId=t;var d=this.tracks.filter(function(g){return!t||g.groupId===t});this.selectDefaultTrack&&!d.some(function(g){return g.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var v={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(w.Events.AUDIO_TRACKS_UPDATED,v),this.selectInitialTrack()}},s.onError=function(i,n){if(a.prototype.onError.call(this,i,n),n.fatal||!n.context)return;n.context.type===T.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},s.setAudioTrack=function(i){var n=this.tracksInGroup;if(i<0||i>=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var t=n[this.trackId];this.log("Now switching to audio-track index "+i);var d=n[i],v=d.id,g=d.groupId,b=g===void 0?"":g,_=d.name,m=d.type,y=d.url;if(this.trackId=i,this.trackName=_,this.selectDefaultTrack=!1,this.hls.trigger(w.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:b,name:_,type:m,url:y}),d.details&&!d.details.live)return;var E=this.switchParams(d.url,t==null?void 0:t.details);this.loadPlaylist(E)},s.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,t=this.findTrackId(n)||this.findTrackId();t!==-1?this.setAudioTrack(t):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(w.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(i){for(var n=this.tracksInGroup,t=0;t<n.length;t++){var d=n[t];if((!this.selectDefaultTrack||d.default)&&(!i||i===d.name))return d.id}return-1},s.loadPlaylist=function(i){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var t=n.id,d=n.groupId,v=n.url;if(i)try{v=i.addDirectives(v)}catch(g){this.warn("Could not construct new URL with HLS Delivery Directives: "+g)}this.log("loading audio-track playlist for id: "+t),this.clearTimer(),this.hls.trigger(w.Events.AUDIO_TRACK_LOADING,{url:v,id:t,groupId:d,deliveryDirectives:i||null})}},h(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),u}(S.default);ee.default=l},"./src/controller/base-playlist-controller.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return h});var w=j("./src/polyfills/number.ts"),k=j("./src/types/level.ts"),S=j("./src/controller/level-helper.ts"),T=j("./src/utils/logger.ts"),C=j("./src/errors.ts"),h=function(){function p(l,a){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,a+":"),this.warn=T.logger.warn.bind(T.logger,a+":"),this.hls=l}var c=p.prototype;return c.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},c.onError=function(a,u){u.fatal&&u.type===C.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},c.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},c.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},c.stopLoad=function(){this.canLoad=!1,this.clearTimer()},c.switchParams=function(a,u){var s=u==null?void 0:u.renditionReports;if(s)for(var f=0;f<s.length;f++){var i=s[f],n=""+i.URI;if(n===a.substr(-n.length)){var t=parseInt(i["LAST-MSN"]),d=parseInt(i["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var v=Math.min(u.age-u.partTarget,u.targetduration);d!==void 0&&v>u.partTarget&&(d+=1)}if(Object(w.isFiniteNumber)(t))return new k.HlsUrlParameters(t,Object(w.isFiniteNumber)(d)?d:void 0,k.HlsSkip.No)}}},c.loadPlaylist=function(a){},c.shouldLoadTrack=function(a){return this.canLoad&&a&&!!a.url&&(!a.details||a.details.live)},c.playlistLoaded=function(a,u,s){var f=this,i=u.details,n=u.stats,t=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(i.advancedDateTime=Date.now()-t,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log("live playlist "+a+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),s&&i.fragments.length>0&&Object(S.mergeDetails)(s,i),!this.canLoad||!i.live)return;var d,v=void 0,g=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var b=this.hls.config.lowLatencyMode,_=i.lastPartSn,m=i.endSN,y=i.lastPartIndex,E=y!==-1,o=_===m,x=b?0:y;E?(v=o?m+1:_,g=o?x:y+1):v=m+1;var A=i.age,O=A+i.ageHeader,D=Math.min(O-i.partTarget,i.targetduration*1.5);if(D>0){if(s&&D>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+D+" with playlist age: "+i.age),D=0;else{var N=Math.floor(D/i.targetduration);if(v+=N,g!==void 0){var W=Math.round(D%i.targetduration/i.partTarget);g+=W}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+A.toFixed(2)+"s goal: "+D+" skip sn "+N+" to part "+g)}i.tuneInGoal=D}if(d=this.getDeliveryDirectives(i,u.deliveryDirectives,v,g),b||!o){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(i,u.deliveryDirectives,v,g);var K=Object(S.computeReloadInterval)(i,n);v!==void 0&&i.canBlockReload&&(K-=i.partTarget||1),this.log("reload live playlist "+a+" in "+Math.round(K)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(d)},K)}else this.clearTimer()},c.getDeliveryDirectives=function(a,u,s,f){var i=Object(k.getSkipValue)(a,s);return u!=null&&u.skip&&a.deltaUpdateFailed&&(s=u.msn,f=u.part,i=k.HlsSkip.No),new k.HlsUrlParameters(s,f,i)},c.retryLoadingOrFail=function(a){var u=this,s=this.hls.config,f=this.retryCount<s.levelLoadingMaxRetry;if(f){var i;if(this.retryCount++,a.details.indexOf("LoadTimeOut")>-1&&(i=a.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+a.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+a.details+'"')}}else this.warn('cannot recover from error "'+a.details+'"'),this.clearTimer(),a.fatal=!0;return f},p}()},"./src/controller/base-stream-controller.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"State",function(){return m}),j.d(ee,"default",function(){return y});var w=j("./src/polyfills/number.ts"),k=j("./src/task-loop.ts"),S=j("./src/controller/fragment-tracker.ts"),T=j("./src/utils/buffer-helper.ts"),C=j("./src/utils/logger.ts"),h=j("./src/events.ts"),p=j("./src/errors.ts"),c=j("./src/types/transmuxer.ts"),l=j("./src/utils/mp4-tools.ts"),a=j("./src/utils/discontinuities.ts"),u=j("./src/controller/fragment-finders.ts"),s=j("./src/controller/level-helper.ts"),f=j("./src/loader/fragment-loader.ts"),i=j("./src/crypt/decrypter.ts"),n=j("./src/utils/time-ranges.ts"),t=j("./src/types/loader.ts");function d(E,o){for(var x=0;x<o.length;x++){var A=o[x];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(E,A.key,A)}}function v(E,o,x){return o&&d(E.prototype,o),x&&d(E,x),E}function g(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function b(E,o){E.prototype=Object.create(o.prototype),E.prototype.constructor=E,_(E,o)}function _(E,o){return _=Object.setPrototypeOf||function(A,O){return A.__proto__=O,A},_(E,o)}var m={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(E){b(o,E);function o(A,O,D){var N;return N=E.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=m.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=D,N.log=C.logger.log.bind(C.logger,D+":"),N.warn=C.logger.warn.bind(C.logger,D+":"),N.hls=A,N.fragmentLoader=new f.default(A.config),N.fragmentTracker=O,N.config=A.config,N.decrypter=new i.default(A,A.config),A.on(h.Events.KEY_LOADED,N.onKeyLoaded,g(N)),N}var x=o.prototype;return x.doTick=function(){this.onTickEnd()},x.onTickEnd=function(){},x.startLoad=function(O){},x.stopLoad=function(){this.fragmentLoader.abort();var O=this.fragCurrent;O&&this.fragmentTracker.removeFragment(O),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=m.STOPPED},x._streamEnded=function(O,D){var N=this.fragCurrent,W=this.fragmentTracker;if(!D.live&&N&&N.sn===D.endSN&&!O.nextStart){var K=W.getState(N);return K===S.FragmentState.PARTIAL||K===S.FragmentState.OK}return!1},x.onMediaAttached=function(O,D){var N=this.media=this.mediaBuffer=D.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var W=this.config;this.levels&&W.autoStartLoad&&this.state===m.STOPPED&&this.startLoad(W.startPosition)},x.onMediaDetaching=function(){var O=this.media;O!=null&&O.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),O&&(O.removeEventListener("seeking",this.onvseeking),O.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},x.onMediaSeeking=function(){var O=this.config,D=this.fragCurrent,N=this.media,W=this.mediaBuffer,K=this.state,oe=N?N.currentTime:0,B=T.BufferHelper.bufferInfo(W||N,oe,O.maxBufferHole);if(this.log("media seeking to "+(Object(w.isFiniteNumber)(oe)?oe.toFixed(3):oe)+", state: "+K),K===m.ENDED)this.resetLoadingState();else if(D&&!B.len){var X=O.maxFragLookUpTolerance,V=D.start-X,ne=D.start+D.duration+X,$=oe>ne;(oe<V||$)&&($&&D.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),D.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=oe),!this.loadedmetadata&&!B.len&&(this.nextLoadPosition=this.startPosition=oe),this.tickImmediate()},x.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},x.onKeyLoaded=function(O,D){if(this.state!==m.KEY_LOADING||D.frag!==this.fragCurrent||!this.levels)return;this.state=m.IDLE;var N=this.levels[D.frag.level].details;N&&this.loadFragment(D.frag,N,D.frag.start)},x.onHandlerDestroying=function(){this.stopLoad(),E.prototype.onHandlerDestroying.call(this)},x.onHandlerDestroyed=function(){this.state=m.STOPPED,this.hls.off(h.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,E.prototype.onHandlerDestroyed.call(this)},x.loadKey=function(O,D){this.log("Loading key for "+O.sn+" of ["+D.startSN+"-"+D.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+O.level),this.state=m.KEY_LOADING,this.fragCurrent=O,this.hls.trigger(h.Events.KEY_LOADING,{frag:O})},x.loadFragment=function(O,D,N){this._loadFragForPlayback(O,D,N)},x._loadFragForPlayback=function(O,D,N){var W=this,K=function(B){if(W.fragContextChanged(O)){W.warn("Fragment "+O.sn+(B.part?" p: "+B.part.index:"")+" of level "+O.level+" was dropped during download."),W.fragmentTracker.removeFragment(O);return}O.stats.chunkCount++,W._handleFragmentLoadProgress(B)};this._doFragLoad(O,D,N,K).then(function(oe){if(!oe)return;W.fragLoadError=0;var B=W.state;if(W.fragContextChanged(O)){(B===m.FRAG_LOADING||B===m.BACKTRACKING||!W.fragCurrent&&B===m.PARSING)&&(W.fragmentTracker.removeFragment(O),W.state=m.IDLE);return}if("payload"in oe&&(W.log("Loaded fragment "+O.sn+" of level "+O.level),W.hls.trigger(h.Events.FRAG_LOADED,oe),W.state===m.BACKTRACKING)){W.fragmentTracker.backtrack(O,oe),W.resetFragmentLoading(O);return}W._handleFragmentLoadComplete(oe)}).catch(function(oe){W.warn(oe),W.resetFragmentLoading(O)})},x.flushMainBuffer=function(O,D,N){if(N===void 0&&(N=null),!(O-D))return;var W={startOffset:O,endOffset:D,type:N};this.fragLoadError=0,this.hls.trigger(h.Events.BUFFER_FLUSHING,W)},x._loadInitSegment=function(O){var D=this;this._doFragLoad(O).then(function(N){if(!N||D.fragContextChanged(O)||!D.levels)throw new Error("init load aborted");return N}).then(function(N){var W=D.hls,K=N.payload,oe=O.decryptdata;if(K&&K.byteLength>0&&oe&&oe.key&&oe.iv&&oe.method==="AES-128"){var B=self.performance.now();return D.decrypter.webCryptoDecrypt(new Uint8Array(K),oe.key.buffer,oe.iv.buffer).then(function(X){var V=self.performance.now();return W.trigger(h.Events.FRAG_DECRYPTED,{frag:O,payload:X,stats:{tstart:B,tdecrypt:V}}),N.payload=X,N})}return N}).then(function(N){var W=D.fragCurrent,K=D.hls,oe=D.levels;if(!oe)throw new Error("init load aborted, missing levels");var B=oe[O.level].details;console.assert(B,"Level details are defined when init segment is loaded");var X=O.stats;D.state=m.IDLE,D.fragLoadError=0,O.data=new Uint8Array(N.payload),X.parsing.start=X.buffering.start=self.performance.now(),X.parsing.end=X.buffering.end=self.performance.now(),N.frag===W&&K.trigger(h.Events.FRAG_BUFFERED,{stats:X,frag:W,part:null,id:O.type}),D.tick()}).catch(function(N){D.warn(N),D.resetFragmentLoading(O)})},x.fragContextChanged=function(O){var D=this.fragCurrent;return!O||!D||O.level!==D.level||O.sn!==D.sn||O.urlId!==D.urlId},x.fragBufferedComplete=function(O,D){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+O.type+" sn: "+O.sn+(D?" part: "+D.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+O.level+" "+n.default.toString(T.BufferHelper.getBuffered(N))),this.state=m.IDLE,this.tick()},x._handleFragmentLoadComplete=function(O){var D=this.transmuxer;if(!D)return;var N=O.frag,W=O.part,K=O.partsLoaded,oe=!K||K.length===0||K.some(function(X){return!X}),B=new c.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,W?W.index:-1,!oe);D.flush(B)},x._handleFragmentLoadProgress=function(O){},x._doFragLoad=function(O,D,N,W){var K=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(O.start,N||0),this.config.lowLatencyMode&&D){var oe=D.partList;if(oe&&W){N>O.end&&D.fragmentHint&&(O=D.fragmentHint);var B=this.getNextPart(oe,O,N);if(B>-1){var X=oe[B];return this.log("Loading part sn: "+O.sn+" p: "+X.index+" cc: "+O.cc+" of playlist ["+D.startSN+"-"+D.endSN+"] parts [0-"+B+"-"+(oe.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=X.start+X.duration,this.state=m.FRAG_LOADING,this.hls.trigger(h.Events.FRAG_LOADING,{frag:O,part:oe[B],targetBufferTime:N}),this.doFragPartsLoad(O,oe,B,W).catch(function(V){return K.handleFragLoadError(V)})}else if(!O.url||this.loadedEndOfParts(oe,N))return Promise.resolve(null)}}return this.log("Loading fragment "+O.sn+" cc: "+O.cc+" "+(D?"of ["+D.startSN+"-"+D.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(N.toFixed(3))),Object(w.isFiniteNumber)(O.sn)&&!this.bitrateTest&&(this.nextLoadPosition=O.start+O.duration),this.state=m.FRAG_LOADING,this.hls.trigger(h.Events.FRAG_LOADING,{frag:O,targetBufferTime:N}),this.fragmentLoader.load(O,W).catch(function(V){return K.handleFragLoadError(V)})},x.doFragPartsLoad=function(O,D,N,W){var K=this;return new Promise(function(oe,B){var X=[],V=function ne($){var Z=D[$];K.fragmentLoader.loadPart(O,Z,W).then(function(ue){X[Z.index]=ue;var he=ue.part;K.hls.trigger(h.Events.FRAG_LOADED,ue);var Oe=D[$+1];if(Oe&&Oe.fragment===O)ne($+1);else return oe({frag:O,part:he,partsLoaded:X})}).catch(B)};V(N)})},x.handleFragLoadError=function(O){var D=O.data;return D&&D.details===p.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(D.frag,D.part):this.hls.trigger(h.Events.ERROR,D),null},x._handleTransmuxerFlush=function(O){var D=this.getCurrentContext(O);if(!D||this.state!==m.PARSING){this.fragCurrent||(this.state=m.IDLE);return}var N=D.frag,W=D.part,K=D.level,oe=self.performance.now();N.stats.parsing.end=oe,W&&(W.stats.parsing.end=oe),this.updateLevelTiming(N,W,K,O.partial)},x.getCurrentContext=function(O){var D=this.levels,N=O.level,W=O.sn,K=O.part;if(!D||!D[N])return this.warn("Levels object was unset while buffering fragment "+W+" of level "+N+". The current chunk will not be buffered."),null;var oe=D[N],B=K>-1?Object(s.getPartWith)(oe,W,K):null,X=B?B.fragment:Object(s.getFragmentWithSN)(oe,W,this.fragCurrent);return X?{frag:X,part:B,level:oe}:null},x.bufferFragmentData=function(O,D,N,W){if(!O||this.state!==m.PARSING)return;var K=O.data1,oe=O.data2,B=K;if(K&&oe&&(B=Object(l.appendUint8Array)(K,oe)),!B||!B.length)return;var X={type:O.type,frag:D,part:N,chunkMeta:W,parent:D.type,data:B};this.hls.trigger(h.Events.BUFFER_APPENDING,X),O.dropped&&O.independent&&!N&&this.flushBufferGap(D)},x.flushBufferGap=function(O){var D=this.media;if(!D)return;if(!T.BufferHelper.isBuffered(D,D.currentTime)){this.flushMainBuffer(0,O.start);return}var N=D.currentTime,W=T.BufferHelper.bufferInfo(D,N,0),K=O.duration,oe=Math.min(this.config.maxFragLookUpTolerance*2,K*.25),B=Math.max(Math.min(O.start-oe,W.end-oe),N+oe);O.start-B>oe&&this.flushMainBuffer(B,O.start)},x.getFwdBufferInfo=function(O,D){var N=this.config,W=this.getLoadPosition();if(!Object(w.isFiniteNumber)(W))return null;var K=T.BufferHelper.bufferInfo(O,W,N.maxBufferHole);if(K.len===0&&K.nextStart!==void 0){var oe=this.fragmentTracker.getBufferedFrag(W,D);if(oe&&K.nextStart<oe.end)return T.BufferHelper.bufferInfo(O,W,Math.max(K.nextStart,N.maxBufferHole))}return K},x.getMaxBufferLength=function(O){var D=this.config,N;return O?N=Math.max(8*D.maxBufferSize/O,D.maxBufferLength):N=D.maxBufferLength,Math.min(N,D.maxMaxBufferLength)},x.reduceMaxBufferLength=function(O){var D=this.config,N=O||D.maxBufferLength;return D.maxMaxBufferLength>=N?(D.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+D.maxMaxBufferLength+"s"),!0):!1},x.getNextFragment=function(O,D){var N,W,K=D.fragments,oe=K.length;if(!oe)return null;var B=this.config,X=K[0].start,V;if(D.live){var ne=B.initialLiveManifestSize;if(oe<ne)return this.warn("Not enough fragments to start playback (have: "+oe+", need: "+ne+")"),null;!D.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(V=this.getInitialLiveFragment(D,K),this.startPosition=V?this.hls.liveSyncPosition||V.start:O)}else O<=X&&(V=K[0]);if(!V){var $=B.lowLatencyMode?D.partEnd:D.fragmentEnd;V=this.getFragmentAtPosition(O,$,D)}return(N=V)!==null&&N!==void 0&&N.initSegment&&!((W=V)!==null&&W!==void 0&&W.initSegment.data)&&!this.bitrateTest&&(V=V.initSegment),V},x.getNextPart=function(O,D,N){for(var W=-1,K=!1,oe=!0,B=0,X=O.length;B<X;B++){var V=O[B];if(oe=oe&&!V.independent,W>-1&&N<V.start)break;var ne=V.loaded;!ne&&(K||V.independent||oe)&&V.fragment===D&&(W=B),K=ne}return W},x.loadedEndOfParts=function(O,D){var N=O[O.length-1];return N&&D>N.start&&N.loaded},x.getInitialLiveFragment=function(O,D){var N=this.fragPrevious,W=null;if(N){if(O.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),W=Object(u.findFragmentByPDT)(D,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!W){var K=N.sn+1;if(K>=O.startSN&&K<=O.endSN){var oe=D[K-O.startSN];N.cc===oe.cc&&(W=oe,this.log("Live playlist, switching playlist, load frag with next SN: "+W.sn))}W||(W=Object(u.findFragWithCC)(D,N.cc),W&&this.log("Live playlist, switching playlist, load frag with same CC: "+W.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(W=this.getFragmentAtPosition(B,this.bitrateTest?O.fragmentEnd:O.edge,O))}return W},x.getFragmentAtPosition=function(O,D,N){var W=this.config,K=this.fragPrevious,oe=N.fragments,B=N.endSN,X=N.fragmentHint,V=W.maxFragLookUpTolerance,ne=!!(W.lowLatencyMode&&N.partList&&X);ne&&X&&!this.bitrateTest&&(oe=oe.concat(X),B=X.sn);var $;if(O<D){var Z=O>D-V?0:V;$=Object(u.findFragmentByPTS)(K,oe,O,Z)}else $=oe[oe.length-1];if($){var ue=$.sn-N.startSN,he=K&&$.level===K.level,Oe=oe[ue+1],we=this.fragmentTracker.getState($);if(we===S.FragmentState.BACKTRACKED){$=null;for(var Pe=ue;oe[Pe]&&this.fragmentTracker.getState(oe[Pe])===S.FragmentState.BACKTRACKED;)K?$=oe[Pe--]:$=oe[--Pe];$||($=Oe)}else K&&$.sn===K.sn&&!ne&&(he&&($.sn<B&&this.fragmentTracker.getState(Oe)!==S.FragmentState.OK?(this.log("SN "+$.sn+" just loaded, load next one: "+Oe.sn),$=Oe):$=null))}return $},x.synchronizeToLiveEdge=function(O){var D=this.config,N=this.media;if(!N)return;var W=this.hls.liveSyncPosition,K=N.currentTime,oe=O.fragments[0].start,B=O.edge,X=K>=oe-D.maxFragLookUpTolerance&&K<=B;if(W!==null&&N.duration>W&&(K<W||!X)){var V=D.liveMaxLatencyDuration!==void 0?D.liveMaxLatencyDuration:D.liveMaxLatencyDurationCount*O.targetduration;(!X&&N.readyState<4||K<B-V)&&(this.loadedmetadata||(this.nextLoadPosition=W),N.readyState&&(this.warn("Playback: "+K.toFixed(3)+" is located too far from the end of live sliding playlist: "+B+", reset currentTime to : "+W.toFixed(3)),N.currentTime=W))}},x.alignPlaylists=function(O,D){var N=this.levels,W=this.levelLastLoaded,K=this.fragPrevious,oe=W!==null?N[W]:null,B=O.fragments.length;if(!B)return this.warn("No fragments in live playlist"),0;var X=O.fragments[0].start,V=!D,ne=O.alignedSliding&&Object(w.isFiniteNumber)(X);if(V||!ne&&!X){Object(a.alignStream)(K,oe,O);var $=O.fragments[0].start;return this.log("Live playlist sliding: "+$.toFixed(2)+" start-sn: "+(D?D.startSN:"na")+"->"+O.startSN+" prev-sn: "+(K?K.sn:"na")+" fragments: "+B),$}return X},x.waitForCdnTuneIn=function(O){var D=3;return O.live&&O.canBlockReload&&O.tuneInGoal>Math.max(O.partHoldBack,O.partTarget*D)},x.setStartPosition=function(O,D){var N=this.startPosition;if(N<D&&(N=-1),N===-1||this.lastCurrentTime===-1){var W=O.startTimeOffset;Object(w.isFiniteNumber)(W)?(N=D+W,W<0&&(N+=O.totalduration),N=Math.min(Math.max(D,N),D+O.totalduration),this.log("Start time offset "+W+" found in playlist, adjust startPosition to "+N),this.startPosition=N):O.live?N=this.hls.liveSyncPosition||D:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},x.getLoadPosition=function(){var O=this.media,D=0;return this.loadedmetadata&&O?D=O.currentTime:this.nextLoadPosition&&(D=this.nextLoadPosition),D},x.handleFragLoadAborted=function(O,D){this.transmuxer&&O.sn!=="initSegment"&&O.stats.aborted&&(this.warn("Fragment "+O.sn+(D?" part"+D.index:"")+" of level "+O.level+" was aborted"),this.resetFragmentLoading(O))},x.resetFragmentLoading=function(O){(!this.fragCurrent||!this.fragContextChanged(O))&&(this.state=m.IDLE)},x.onFragmentOrKeyLoadError=function(O,D){if(D.fatal)return;var N=D.frag;if(!N||N.type!==O)return;var W=this.fragCurrent;console.assert(W&&N.sn===W.sn&&N.level===W.level&&N.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(N.level))return;var oe=Math.min(Math.pow(2,this.fragLoadError)*K.fragLoadingRetryDelay,K.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+O+" "+N.level+" failed to load, retrying in "+oe+"ms"),this.retryDate=self.performance.now()+oe,this.fragLoadError++,this.state=m.FRAG_LOADING_WAITING_RETRY}else D.levelRetry?(O===t.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=m.IDLE):(C.logger.error(D.details+" reaches max retry, redispatch as fatal ..."),D.fatal=!0,this.hls.stopLoad(),this.state=m.ERROR)},x.afterBufferFlushed=function(O,D,N){if(!O)return;var W=T.BufferHelper.getBuffered(O);this.fragmentTracker.detectEvictedFragments(D,W,N),this.state===m.ENDED&&this.resetLoadingState()},x.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=m.IDLE},x.resetLiveStartWhenNotLoaded=function(O){if(!this.loadedmetadata){this.startFragRequested=!1;var D=this.levels?this.levels[O].details:null;if(D!=null&&D.live)return this.startPosition=-1,this.setStartPosition(D,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},x.updateLevelTiming=function(O,D,N,W){var K=this,oe=N.details;console.assert(!!oe,"level.details must be defined");var B=Object.keys(O.elementaryStreams).reduce(function(X,V){var ne=O.elementaryStreams[V];if(ne){var $=ne.endPTS-ne.startPTS;if($<=0)return K.warn("Could not parse fragment "+O.sn+" "+V+" duration reliably ("+$+") resetting transmuxer to fallback to playlist timing"),K.resetTransmuxer(),X||!1;var Z=W?0:Object(s.updateFragPTSDTS)(oe,O,ne.startPTS,ne.endPTS,ne.startDTS,ne.endDTS);return K.hls.trigger(h.Events.LEVEL_PTS_UPDATED,{details:oe,level:N,drift:Z,type:V,frag:O,start:ne.startPTS,end:ne.endPTS}),!0}return X},!1);B?(this.state=m.PARSED,this.hls.trigger(h.Events.FRAG_PARSED,{frag:O,part:D})):this.resetLoadingState()},x.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},v(o,[{key:"state",get:function(){return this._state},set:function(O){var D=this._state;D!==O&&(this._state=O,this.log(D+"->"+O))}}]),o}(k.default)},"./src/controller/buffer-controller.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return u});var w=j("./src/polyfills/number.ts"),k=j("./src/events.ts"),S=j("./src/utils/logger.ts"),T=j("./src/errors.ts"),C=j("./src/utils/buffer-helper.ts"),h=j("./src/utils/mediasource-helper.ts"),p=j("./src/loader/fragment.ts"),c=j("./src/controller/buffer-operation-queue.ts"),l=Object(h.getMediaSource)(),a=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function s(i){var n=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 t=n.hls,d=n.media,v=n.mediaSource;S.logger.log("[buffer-controller]: Media source opened"),d&&(n.updateMediaElementDuration(),t.trigger(k.Events.MEDIA_ATTACHED,{media:d})),v&&v.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){S.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){S.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var f=s.prototype;return f.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},f.destroy=function(){this.unregisterListeners(),this.details=null},f.registerListeners=function(){var n=this.hls;n.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(k.Events.BUFFER_RESET,this.onBufferReset,this),n.on(k.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(k.Events.BUFFER_EOS,this.onBufferEos,this),n.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(k.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(k.Events.FRAG_PARSED,this.onFragParsed,this),n.on(k.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var n=this.hls;n.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(k.Events.BUFFER_RESET,this.onBufferReset,this),n.off(k.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(k.Events.BUFFER_EOS,this.onBufferEos,this),n.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(k.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(k.Events.FRAG_PARSED,this.onFragParsed,this),n.off(k.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new c.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(n,t){var d=2;(t.audio&&!t.video||!t.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,S.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(n,t){var d=this.media=t.media;if(d&&l){var v=this.mediaSource=new l;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(v),this._objectUrl=d.src}},f.onMediaDetaching=function(){var n=this.media,t=this.mediaSource,d=this._objectUrl;if(t){if(S.logger.log("[buffer-controller]: media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(v){S.logger.warn("[buffer-controller]: onMediaDetaching: "+v.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(d&&self.URL.revokeObjectURL(d),n.src===d?(n.removeAttribute("src"),n.load()):S.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(k.Events.MEDIA_DETACHED,void 0)},f.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(t){var d=n.sourceBuffer[t];try{d&&(n.removeBufferListeners(t),n.mediaSource&&n.mediaSource.removeSourceBuffer(d),n.sourceBuffer[t]=void 0)}catch(v){S.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",v)}}),this._initSourceBuffer()},f.onBufferCodecs=function(n,t){var d=this,v=this.getSourceBufferTypes().length;if(Object.keys(t).forEach(function(g){if(v){var b=d.tracks[g];if(b&&typeof b.buffer.changeType=="function"){var _=t[g],m=_.codec,y=_.levelCodec,E=_.container,o=(b.levelCodec||b.codec).replace(a,"$1"),x=(y||m).replace(a,"$1");if(o!==x){var A=E+";codecs="+(y||m);d.appendChangeType(g,A)}}}else d.pendingTracks[g]=t[g]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(n,t){var d=this,v=this.operationQueue,g={execute:function(){var _=d.sourceBuffer[n];_&&(S.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+t),_.changeType(t)),v.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(_){S.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",_)}};v.append(g,n)},f.onBufferAppending=function(n,t){var d=this,v=this.hls,g=this.operationQueue,b=this.tracks,_=t.data,m=t.type,y=t.frag,E=t.part,o=t.chunkMeta,x=o.buffering[m],A=self.performance.now();x.start=A;var O=y.stats.buffering,D=E?E.stats.buffering:null;O.start===0&&(O.start=A),D&&D.start===0&&(D.start=A);var N=b.audio,W=m==="audio"&&o.id===1&&(N==null?void 0:N.container)==="audio/mpeg",K={execute:function(){if(x.executeStart=self.performance.now(),W){var B=d.sourceBuffer[m];if(B){var X=y.start-B.timestampOffset;Math.abs(X)>=.1&&(S.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+X+") sn: "+y.sn+")"),B.timestampOffset=y.start)}}d.appendExecutor(_,m)},onStart:function(){},onComplete:function(){var B=self.performance.now();x.executeEnd=x.end=B,O.first===0&&(O.first=B),D&&D.first===0&&(D.first=B);var X=d.sourceBuffer,V={};for(var ne in X)V[ne]=C.BufferHelper.getBuffered(X[ne]);d.appendError=0,d.hls.trigger(k.Events.BUFFER_APPENDED,{type:m,frag:y,part:E,chunkMeta:o,parent:y.type,timeRanges:V})},onError:function(B){S.logger.error("[buffer-controller]: Error encountered while trying to append to the "+m+" SourceBuffer",B);var X={type:T.ErrorTypes.MEDIA_ERROR,parent:y.type,details:T.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?X.details=T.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,X.details=T.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>v.config.appendErrorMaxRetry&&(S.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),X.fatal=!0)),v.trigger(k.Events.ERROR,X)}};g.append(K,m)},f.onBufferFlushing=function(n,t){var d=this,v=this.operationQueue,g=function(_){return{execute:d.removeExecutor.bind(d,_,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(k.Events.BUFFER_FLUSHED,{type:_})},onError:function(y){S.logger.warn("[buffer-controller]: Failed to remove from "+_+" SourceBuffer",y)}}};t.type?v.append(g(t.type),t.type):this.getSourceBufferTypes().forEach(function(b){v.append(g(b),b)})},f.onFragParsed=function(n,t){var d=this,v=t.frag,g=t.part,b=[],_=g?g.elementaryStreams:v.elementaryStreams;_[p.ElementaryStreamTypes.AUDIOVIDEO]?b.push("audiovideo"):(_[p.ElementaryStreamTypes.AUDIO]&&b.push("audio"),_[p.ElementaryStreamTypes.VIDEO]&&b.push("video"));var m=function(){var E=self.performance.now();v.stats.buffering.end=E,g&&(g.stats.buffering.end=E);var o=g?g.stats:v.stats;d.hls.trigger(k.Events.FRAG_BUFFERED,{frag:v,part:g,stats:o,id:v.type})};b.length===0&&S.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(m,b)},f.onFragChanged=function(n,t){this.flushBackBuffer()},f.onBufferEos=function(n,t){var d=this,v=this.getSourceBufferTypes().reduce(function(g,b){var _=d.sourceBuffer[b];return(!t.type||t.type===b)&&(_&&!_.ended&&(_.ended=!0,S.logger.log("[buffer-controller]: "+b+" sourceBuffer now EOS"))),g&&!!(!_||_.ended)},!0);v&&this.blockBuffers(function(){var g=d.mediaSource;if(!g||g.readyState!=="open")return;g.endOfStream()})},f.onLevelUpdated=function(n,t){var d=t.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var n=this.hls,t=this.details,d=this.media,v=this.sourceBuffer;if(!d||t===null)return;var g=this.getSourceBufferTypes();if(!g.length)return;var b=t.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(w.isFiniteNumber)(b)||b<0)return;var _=d.currentTime,m=t.levelTargetDuration,y=Math.max(b,m),E=Math.floor(_/m)*m-y;g.forEach(function(o){var x=v[o];if(x){var A=C.BufferHelper.getBuffered(x);A.length>0&&E>A.start(0)&&(n.trigger(k.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),t.live&&n.trigger(k.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),n.trigger(k.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,type:o}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,t=this.hls,d=this.media,v=this.mediaSource,g=n.fragments[0].start+n.totalduration,b=d.duration,_=Object(w.isFiniteNumber)(v.duration)?v.duration:0;n.live&&t.config.liveDurationInfinity?(S.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(n)):(g>_&&g>b||!Object(w.isFiniteNumber)(b))&&(S.logger.log("[buffer-controller]: Updating Media Source duration to "+g.toFixed(3)),v.duration=g)},f.updateSeekableRange=function(n){var t=this.mediaSource,d=n.fragments,v=d.length;if(v&&n.live&&t!==null&&t!==void 0&&t.setLiveSeekableRange){var g=Math.max(0,d[0].start),b=Math.max(g,g+n.totalduration);t.setLiveSeekableRange(g,b)}},f.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,t=this.operationQueue,d=this.pendingTracks,v=Object.keys(d).length;if(v&&!n||v===2){this.createSourceBuffers(d),this.pendingTracks={};var g=this.getSourceBufferTypes();if(g.length===0){this.hls.trigger(k.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}g.forEach(function(b){t.executeNext(b)})}},f.createSourceBuffers=function(n){var t=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var g in n)if(!t[g]){var b=n[g];if(!b)throw Error("source buffer exists for track "+g+", however track does not");var _=b.levelCodec||b.codec,m=b.container+";codecs="+_;S.logger.log("[buffer-controller]: creating sourceBuffer("+m+")");try{var y=t[g]=d.addSourceBuffer(m),E=g;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[g]={buffer:y,codec:_,container:b.container,levelCodec:b.levelCodec,id:b.id},v++}catch(o){S.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+o.message),this.hls.trigger(k.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:o,mimeType:m})}}v&&this.hls.trigger(k.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(n){var t=this.operationQueue,d=t.current(n);d.onStart()},f._onSBUpdateEnd=function(n){var t=this.operationQueue,d=t.current(n);d.onComplete(),t.shiftAndExecuteNext(n)},f._onSBUpdateError=function(n,t){S.logger.error("[buffer-controller]: "+n+" SourceBuffer error",t),this.hls.trigger(k.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(n);d&&d.onError(t)},f.removeExecutor=function(n,t,d){var v=this.media,g=this.mediaSource,b=this.operationQueue,_=this.sourceBuffer,m=_[n];if(!v||!g||!m){S.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),b.shiftAndExecuteNext(n);return}var y=Object(w.isFiniteNumber)(v.duration)?v.duration:Infinity,E=Object(w.isFiniteNumber)(g.duration)?g.duration:Infinity,o=Math.max(0,t),x=Math.min(d,y,E);x>o?(S.logger.log("[buffer-controller]: Removing ["+o+","+x+"] from the "+n+" SourceBuffer"),console.assert(!m.updating,n+" sourceBuffer must not be updating"),m.remove(o,x)):b.shiftAndExecuteNext(n)},f.appendExecutor=function(n,t){var d=this.operationQueue,v=this.sourceBuffer,g=v[t];if(!g){S.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(t);return}g.ended=!1,console.assert(!g.updating,t+" sourceBuffer must not be updating"),g.appendBuffer(n)},f.blockBuffers=function(n,t){var d=this;if(t===void 0&&(t=this.getSourceBufferTypes()),!t.length){S.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var v=this.operationQueue,g=t.map(function(b){return v.appendBlocker(b)});Promise.all(g).then(function(){n(),t.forEach(function(b){var _=d.sourceBuffer[b];(!_||!_.updating)&&v.shiftAndExecuteNext(b)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(n,t,d){var v=this.sourceBuffer[n];if(!v)return;var g=d.bind(this,n);this.listeners[n].push({event:t,listener:g}),v.addEventListener(t,g)},f.removeBufferListeners=function(n){var t=this.sourceBuffer[n];if(!t)return;this.listeners[n].forEach(function(d){t.removeEventListener(d.event,d.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return k});var w=j("./src/utils/logger.ts"),k=function(){function S(C){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=C}var T=S.prototype;return T.append=function(h,p){var c=this.queues[p];c.push(h),c.length===1&&this.buffers[p]&&this.executeNext(p)},T.insertAbort=function(h,p){var c=this.queues[p];c.unshift(h),this.executeNext(p)},T.appendBlocker=function(h){var p,c=new Promise(function(a){p=a}),l={execute:p,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(l,h),c},T.executeNext=function(h){var p=this.buffers,c=this.queues,l=p[h],a=c[h];if(a.length){var u=a[0];try{u.execute()}catch(s){w.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(s),(!l||!l.updating)&&(a.shift(),this.executeNext(h))}}},T.shiftAndExecuteNext=function(h){this.queues[h].shift(),this.executeNext(h)},T.current=function(h){return this.queues[h][0]},S}()},"./src/controller/cap-level-controller.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/events.ts");function k(C,h){for(var p=0;p<h.length;p++){var c=h[p];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(C,c.key,c)}}function S(C,h,p){return h&&k(C.prototype,h),p&&k(C,p),C}var T=function(){function C(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 h=C.prototype;return h.setStreamController=function(c){this.streamController=c},h.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},h.registerListeners=function(){var c=this.hls;c.on(w.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),c.on(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.on(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(w.Events.BUFFER_CODECS,this.onBufferCodecs,this),c.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},h.unregisterListener=function(){var c=this.hls;c.off(w.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),c.off(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.off(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(w.Events.BUFFER_CODECS,this.onBufferCodecs,this),c.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},h.onFpsDropLevelCapping=function(c,l){C.isLevelAllowed(l.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(l.droppedLevel)},h.onMediaAttaching=function(c,l){this.media=l.media instanceof HTMLVideoElement?l.media:null},h.onManifestParsed=function(c,l){var a=this.hls;this.restrictedLevels=[],this.firstLevel=l.firstLevel,a.config.capLevelToPlayerSize&&l.video&&this.startCapping()},h.onBufferCodecs=function(c,l){var a=this.hls;a.config.capLevelToPlayerSize&&l.video&&this.startCapping()},h.onMediaDetaching=function(){this.stopCapping()},h.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var c=this.hls.levels;if(c.length){var l=this.hls;l.autoLevelCapping=this.getMaxLevel(c.length-1),l.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=l.autoLevelCapping}}},h.getMaxLevel=function(c){var l=this,a=this.hls.levels;if(!a.length)return-1;var u=a.filter(function(s,f){return C.isLevelAllowed(f,l.restrictedLevels)&&f<=c});return this.clientRect=null,C.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)},h.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()},h.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},h.getDimensions=function(){if(this.clientRect)return this.clientRect;var c=this.media,l={width:0,height:0};if(c){var a=c.getBoundingClientRect();l.width=a.width,l.height=a.height,!l.width&&!l.height&&(l.width=a.right-a.left||c.width||0,l.height=a.bottom-a.top||c.height||0)}return this.clientRect=l,l},C.isLevelAllowed=function(c,l){return l===void 0&&(l=[]),l.indexOf(c)===-1},C.getMaxLevelByMediaSize=function(c,l,a){if(!c||!c.length)return-1;for(var u=function(t,d){return d?t.width!==d.width||t.height!==d.height:!0},s=c.length-1,f=0;f<c.length;f+=1){var i=c[f];if((i.width>=l||i.height>=a)&&u(i,c[f+1])){s=f;break}}return s},S(C,[{key:"mediaWidth",get:function(){return this.getDimensions().width*C.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*C.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var c=1;try{c=self.devicePixelRatio}catch(l){}return c}}]),C}();ee.default=T},"./src/controller/cmcd-controller.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return u});var w=j("./src/events.ts"),k=j("./src/types/cmcd.ts"),S=j("./src/utils/buffer-helper.ts"),T=j("./src/utils/logger.ts");function C(s,f){for(var i=0;i<f.length;i++){var n=f[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}function h(s,f,i){return f&&C(s.prototype,f),i&&C(s,i),s}function p(s,f){var i=typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(i)return(i=i.call(s)).next.bind(i);if(Array.isArray(s)||(i=c(s))||f&&s&&typeof s.length=="number"){i&&(s=i);var n=0;return function(){return n>=s.length?{done:!0}:{done:!1,value:s[n++]}}}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 c(s,f){if(!s)return;if(typeof s=="string")return l(s,f);var i=Object.prototype.toString.call(s).slice(8,-1);if(i==="Object"&&s.constructor&&(i=s.constructor.name),i==="Map"||i==="Set")return Array.from(s);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return l(s,f)}function l(s,f){(f==null||f>s.length)&&(f=s.length);for(var i=0,n=new Array(f);i<f;i++)n[i]=s[i];return n}function a(){return a=Object.assign||function(s){for(var f=1;f<arguments.length;f++){var i=arguments[f];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(s[n]=i[n])}return s},a.apply(this,arguments)}var u=function(){function s(i){var n=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(){n.initialized&&(n.starved=!0),n.buffering=!0},this.onPlaying=function(){n.initialized||(n.initialized=!0),n.buffering=!1},this.applyPlaylistData=function(v){try{n.apply(v,{ot:k.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(g){T.logger.warn("Could not generate manifest CMCD data.",g)}},this.applyFragmentData=function(v){try{var g=v.frag,b=n.hls.levels[g.level],_=n.getObjectType(g),m={d:g.duration*1e3,ot:_};(_===k.CMCDObjectType.VIDEO||_===k.CMCDObjectType.AUDIO||_==k.CMCDObjectType.MUXED)&&(m.br=b.bitrate/1e3,m.tb=n.getTopBandwidth(_),m.bl=n.getBufferLength(_)),n.apply(v,m)}catch(y){T.logger.warn("Could not generate segment CMCD data.",y)}},this.hls=i;var t=this.config=i.config,d=t.cmcd;d!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||s.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var f=s.prototype;return f.registerListeners=function(){var n=this.hls;n.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(w.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.on(w.Events.BUFFER_CREATED,this.onBufferCreated,this)},f.unregisterListeners=function(){var n=this.hls;n.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(w.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.off(w.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},f.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},f.onMediaAttached=function(n,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},f.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},f.onBufferCreated=function(n,t){var d,v;this.audioBuffer=(d=t.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(v=t.tracks.video)===null||v===void 0?void 0:v.buffer},f.createData=function(){var n;return{v:k.CMCDVersion,sf:k.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(n=this.media)===null||n===void 0?void 0:n.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},f.apply=function(n,t){t===void 0&&(t={}),a(t,this.createData());var d=t.ot===k.CMCDObjectType.INIT||t.ot===k.CMCDObjectType.VIDEO||t.ot===k.CMCDObjectType.MUXED;if(this.starved&&d&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering),this.useHeaders){var v=s.toHeaders(t);if(!Object.keys(v).length)return;n.headers||(n.headers={}),a(n.headers,v)}else{var g=s.toQuery(t);if(!g)return;n.url=s.appendQueryToUri(n.url,g)}},f.getObjectType=function(n){var t=n.type;return t==="subtitle"?k.CMCDObjectType.TIMED_TEXT:n.sn==="initSegment"?k.CMCDObjectType.INIT:t==="audio"?k.CMCDObjectType.AUDIO:t==="main"?this.hls.audioTracks.length?k.CMCDObjectType.VIDEO:k.CMCDObjectType.MUXED:void 0},f.getTopBandwidth=function(n){for(var t=0,d=n===k.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,v=p(d),g;!(g=v()).done;){var b=g.value;b.bitrate>t&&(t=b.bitrate)}return t>0?t:NaN},f.getBufferLength=function(n){var t=this.hls.media,d=n===k.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!t)return NaN;var v=S.BufferHelper.bufferInfo(d,t.currentTime,this.config.maxBufferHole);return v.len*1e3},f.createPlaylistLoader=function(){var n=this.config.pLoader,t=this.applyPlaylistData,d=n||this.config.loader;return function(){function v(b){this.loader=void 0,this.loader=new d(b)}var g=v.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(_,m,y){t(_),this.loader.load(_,m,y)},h(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},f.createFragmentLoader=function(){var n=this.config.fLoader,t=this.applyFragmentData,d=n||this.config.loader;return function(){function v(b){this.loader=void 0,this.loader=new d(b)}var g=v.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(_,m,y){t(_),this.loader.load(_,m,y)},h(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},s.uuid=function(){var n=URL.createObjectURL(new Blob),t=n.toString();return URL.revokeObjectURL(n),t.substr(t.lastIndexOf("/")+1)},s.serialize=function(n){for(var t=[],d=function(W){return!Number.isNaN(W)&&W!=null&&W!==""&&W!==!1},v=function(W){return Math.round(W)},g=function(W){return v(W/100)*100},b=function(W){return encodeURIComponent(W)},_={br:v,d:v,bl:g,dl:g,mtp:g,nor:b,rtp:g,tb:v},m=Object.keys(n||{}).sort(),y=p(m),E;!(E=y()).done;){var o=E.value,x=n[o];if(!d(x))continue;if(o==="v"&&x===1)continue;if(o=="pr"&&x===1)continue;var A=_[o];A&&(x=A(x));var O=typeof x,D=void 0;o==="ot"||o==="sf"||o==="st"?D=o+"="+x:O==="boolean"?D=o:O==="number"?D=o+"="+x:D=o+"="+JSON.stringify(x),t.push(D)}return t.join(",")},s.toHeaders=function(n){for(var t=Object.keys(n),d={},v=["Object","Request","Session","Status"],g=[{},{},{},{}],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},_=0,m=t;_<m.length;_++){var y=m[_],E=b[y]!=null?b[y]:1;g[E][y]=n[y]}for(var o=0;o<g.length;o++){var x=s.serialize(g[o]);x&&(d["CMCD-"+v[o]]=x)}return d},s.toQuery=function(n){return"CMCD="+encodeURIComponent(s.serialize(n))},s.appendQueryToUri=function(n,t){if(!t)return n;var d=n.includes("?")?"&":"?";return""+n+d+t},s}()},"./src/controller/eme-controller.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/events.ts"),k=j("./src/errors.ts"),S=j("./src/utils/logger.ts"),T=j("./src/utils/mediakeys-helper.ts");function C(u,s){for(var f=0;f<s.length;f++){var i=s[f];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}function h(u,s,f){return s&&C(u.prototype,s),f&&C(u,f),u}var p=3,c=function(s,f,i){var n={audioCapabilities:[],videoCapabilities:[]};return s.forEach(function(t){n.audioCapabilities.push({contentType:'audio/mp4; codecs="'+t+'"',robustness:i.audioRobustness||""})}),f.forEach(function(t){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+t+'"',robustness:i.videoRobustness||""})}),[n]},l=function(s,f,i,n){switch(s){case T.KeySystems.WIDEVINE:return c(f,i,n);default:throw new Error("Unknown key-system: "+s)}},a=function(){function u(f){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=f,this._config=f.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=u.prototype;return s.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},s._registerListeners=function(){this.hls.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(w.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(w.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s._unregisterListeners=function(){this.hls.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(w.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(w.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s.getLicenseServerUrl=function(i){switch(i){case T.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},s._attemptKeySystemAccess=function(i,n,t){var d=this,v=l(i,n,t,this._drmSystemOptions);S.logger.log("Requesting encrypted media key-system access");var g=this.requestMediaKeySystemAccess(i,v);this.mediaKeysPromise=g.then(function(b){return d._onMediaKeySystemAccessObtained(i,b)}),g.catch(function(b){S.logger.error('Failed to obtain key-system "'+i+'" access:',b)})},s._onMediaKeySystemAccessObtained=function(i,n){var t=this;S.logger.log('Access for key-system "'+i+'" obtained');var d={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:n,mediaKeySystemDomain:i};this._mediaKeysList.push(d);var v=Promise.resolve().then(function(){return n.createMediaKeys()}).then(function(g){return d.mediaKeys=g,S.logger.log('Media-keys created for key-system "'+i+'"'),t._onMediaKeysCreated(),g});return v.catch(function(g){S.logger.error("Failed to create media-keys:",g)}),v},s._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(n){n.mediaKeysSession||(n.mediaKeysSession=n.mediaKeys.createSession(),i._onNewMediaKeySession(n.mediaKeysSession))})},s._onNewMediaKeySession=function(i){var n=this;S.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(t){n._onKeySessionMessage(i,t.message)},!1)},s._onKeySessionMessage=function(i,n){S.logger.log("Got EME message event, creating license request"),this._requestLicense(n,function(t){S.logger.log("Received license data (length: "+(t&&t.byteLength)+"), updating key-session"),i.update(t)})},s.onMediaEncrypted=function(i){var n=this;if(S.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){S.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(w.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var t=function(v){if(!n._media)return;n._attemptSetMediaKeys(v),n._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(t).catch(t)},s._attemptSetMediaKeys=function(i){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var n=this._mediaKeysList[0];if(!n||!n.mediaKeys){S.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(w.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}S.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(n.mediaKeys),this._hasSetMediaKeys=!0}},s._generateRequestWithPreferredKeySession=function(i,n){var t=this,d=this._mediaKeysList[0];if(!d){S.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(w.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(d.mediaKeysSessionInitialized){S.logger.warn("Key-Session already initialized but requested again");return}var v=d.mediaKeysSession;if(!v){S.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(w.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!n){S.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(w.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}S.logger.log('Generating key-session request for "'+i+'" init data type'),d.mediaKeysSessionInitialized=!0,v.generateRequest(i,n).then(function(){S.logger.debug("Key-session generation succeeded")}).catch(function(g){S.logger.error("Error generating key-session request:",g),t.hls.trigger(w.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},s._createLicenseXhr=function(i,n,t){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,i,n,t);var v=this._licenseXhrSetup;if(v)try{v.call(this.hls,d,i),v=void 0}catch(g){S.logger.error(g)}try{d.readyState||d.open("POST",i,!0),v&&v.call(this.hls,d,i)}catch(g){throw new Error("issue setting up KeySystem license XHR "+g)}return d},s._onLicenseRequestReadyStageChange=function(i,n,t,d){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,S.logger.log("License request succeeded");var v=i.response,g=this._licenseResponseCallback;if(g)try{v=g.call(this.hls,i,n)}catch(_){S.logger.error(_)}d(v)}else{if(S.logger.error("License Request XHR failed ("+n+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>p){this.hls.trigger(w.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var b=p-this._requestLicenseFailureCount+1;S.logger.warn("Retrying license request, "+b+" attempts left"),this._requestLicense(t,d)}break}},s._generateLicenseRequestChallenge=function(i,n){switch(i.mediaKeySystemDomain){case T.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},s._requestLicense=function(i,n){S.logger.log("Requesting content license for key-system");var t=this._mediaKeysList[0];if(!t){S.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(w.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(t.mediaKeySystemDomain),v=this._createLicenseXhr(d,i,n);S.logger.log("Sending license request to URL: "+d);var g=this._generateLicenseRequestChallenge(t,i);v.send(g)}catch(b){S.logger.error("Failure requesting DRM license: "+b),this.hls.trigger(w.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(i,n){if(!this._emeEnabled)return;var t=n.media;this._media=t,t.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var i=this._media,n=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(i,n){if(!this._emeEnabled)return;var t=n.levels.map(function(v){return v.audioCodec}).filter(function(v){return!!v}),d=n.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(T.KeySystems.WIDEVINE,t,d)},h(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();ee.default=a},"./src/controller/fps-controller.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/events.ts"),k=j("./src/utils/logger.ts"),S=function(){function T(h){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=h,this.registerListeners()}var C=T.prototype;return C.setStreamController=function(p){this.streamController=p},C.registerListeners=function(){this.hls.on(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},C.unregisterListeners=function(){this.hls.off(w.Events.MEDIA_ATTACHING,this.onMediaAttaching)},C.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},C.onMediaAttaching=function(p,c){var l=this.hls.config;if(l.capLevelOnFPSDrop){var a=c.media instanceof self.HTMLVideoElement?c.media:null;this.media=a,a&&typeof a.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),l.fpsDroppedMonitoringPeriod)}},C.checkFPS=function(p,c,l){var a=performance.now();if(c){if(this.lastTime){var u=a-this.lastTime,s=l-this.lastDroppedFrames,f=c-this.lastDecodedFrames,i=1e3*s/u,n=this.hls;if(n.trigger(w.Events.FPS_DROP,{currentDropped:s,currentDecoded:f,totalDroppedFrames:l}),i>0&&s>n.config.fpsDroppedMonitoringThreshold*f){var t=n.currentLevel;k.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=t)&&(t=t-1,n.trigger(w.Events.FPS_DROP_LEVEL_CAPPING,{level:t,droppedLevel:n.currentLevel}),n.autoLevelCapping=t,this.streamController.nextLevelSwitch())}}this.lastTime=a,this.lastDroppedFrames=l,this.lastDecodedFrames=c}},C.checkFPSInterval=function(){var p=this.media;if(p)if(this.isVideoPlaybackQualityAvailable){var c=p.getVideoPlaybackQuality();this.checkFPS(p,c.totalVideoFrames,c.droppedVideoFrames)}else this.checkFPS(p,p.webkitDecodedFrameCount,p.webkitDroppedFrameCount)},T}();ee.default=S},"./src/controller/fragment-finders.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"findFragmentByPDT",function(){return S}),j.d(ee,"findFragmentByPTS",function(){return T}),j.d(ee,"fragmentWithinToleranceTest",function(){return C}),j.d(ee,"pdtWithinToleranceTest",function(){return h}),j.d(ee,"findFragWithCC",function(){return p});var w=j("./src/polyfills/number.ts"),k=j("./src/utils/binary-search.ts");function S(c,l,a){if(l===null||!Array.isArray(c)||!c.length||!Object(w.isFiniteNumber)(l))return null;var u=c[0].programDateTime;if(l<(u||0))return null;var s=c[c.length-1].endProgramDateTime;if(l>=(s||0))return null;a=a||0;for(var f=0;f<c.length;++f){var i=c[f];if(h(l,a,i))return i}return null}function T(c,l,a,u){a===void 0&&(a=0),u===void 0&&(u=0);var s=null;if(c?s=l[c.sn-l[0].sn+1]||null:a===0&&l[0].start===0&&(s=l[0]),s&&C(a,u,s)===0)return s;var f=k.default.search(l,C.bind(null,a,u));return f||s}function C(c,l,a){c===void 0&&(c=0),l===void 0&&(l=0);var u=Math.min(l,a.duration+(a.deltaPTS?a.deltaPTS:0));return a.start+a.duration-u<=c?1:a.start-u>c&&a.start?-1:0}function h(c,l,a){var u=Math.min(l,a.duration+(a.deltaPTS?a.deltaPTS:0))*1e3,s=a.endProgramDateTime||0;return s-u>c}function p(c,l){return k.default.search(c,function(a){return a.cc<l?1:a.cc>l?-1:0})}},"./src/controller/fragment-tracker.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"FragmentState",function(){return S}),j.d(ee,"FragmentTracker",function(){return T});var w=j("./src/events.ts"),k=j("./src/types/loader.ts"),S;(function(p){p.NOT_LOADED="NOT_LOADED",p.BACKTRACKED="BACKTRACKED",p.APPENDING="APPENDING",p.PARTIAL="PARTIAL",p.OK="OK"})(S||(S={}));var T=function(){function p(l){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=l,this._registerListeners()}var c=p.prototype;return c._registerListeners=function(){var a=this.hls;a.on(w.Events.BUFFER_APPENDED,this.onBufferAppended,this),a.on(w.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(w.Events.FRAG_LOADED,this.onFragLoaded,this)},c._unregisterListeners=function(){var a=this.hls;a.off(w.Events.BUFFER_APPENDED,this.onBufferAppended,this),a.off(w.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(w.Events.FRAG_LOADED,this.onFragLoaded,this)},c.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},c.getAppendedFrag=function(a,u){if(u===k.PlaylistLevelType.MAIN){var s=this.activeFragment,f=this.activeParts;if(!s)return null;if(f)for(var i=f.length;i--;){var n=f[i],t=n?n.end:s.appendedPTS;if(n.start<=a&&t!==void 0&&a<=t)return i>9&&(this.activeParts=f.slice(i-9)),n}else if(s.start<=a&&s.appendedPTS!==void 0&&a<=s.appendedPTS)return s}return this.getBufferedFrag(a,u)},c.getBufferedFrag=function(a,u){for(var s=this.fragments,f=Object.keys(s),i=f.length;i--;){var n=s[f[i]];if((n==null?void 0:n.body.type)===u&&n.buffered){var t=n.body;if(t.start<=a&&a<=t.end)return t}}return null},c.detectEvictedFragments=function(a,u,s){var f=this;Object.keys(this.fragments).forEach(function(i){var n=f.fragments[i];if(!n)return;if(!n.buffered){n.body.type===s&&f.removeFragment(n.body);return}var t=n.range[a];if(!t)return;t.time.some(function(d){var v=!f.isTimeBuffered(d.startPTS,d.endPTS,u);return v&&f.removeFragment(n.body),v})})},c.detectPartialFragments=function(a){var u=this,s=this.timeRanges,f=a.frag,i=a.part;if(!s||f.sn==="initSegment")return;var n=h(f),t=this.fragments[n];if(!t)return;Object.keys(s).forEach(function(d){var v=f.elementaryStreams[d];if(!v)return;var g=s[d],b=i!==null||v.partial===!0;t.range[d]=u.getBufferedTimes(f,i,b,g)}),t.backtrack=t.loaded=null,Object.keys(t.range).length?t.buffered=!0:this.removeFragment(t.body)},c.fragBuffered=function(a){var u=h(a),s=this.fragments[u];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},c.getBufferedTimes=function(a,u,s,f){for(var i={time:[],partial:s},n=u?u.start:a.start,t=u?u.end:a.end,d=a.minEndPTS||t,v=a.maxStartPTS||n,g=0;g<f.length;g++){var b=f.start(g)-this.bufferPadding,_=f.end(g)+this.bufferPadding;if(v>=b&&d<=_){i.time.push({startPTS:Math.max(n,f.start(g)),endPTS:Math.min(t,f.end(g))});break}else if(n<_&&t>b)i.partial=!0,i.time.push({startPTS:Math.max(n,f.start(g)),endPTS:Math.min(t,f.end(g))});else if(t<=b)break}return i},c.getPartialFragment=function(a){var u=null,s,f,i,n=0,t=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(v){var g=d[v];if(!g)return;C(g)&&(f=g.body.start-t,i=g.body.end+t,a>=f&&a<=i&&(s=Math.min(a-f,i-a),n<=s&&(u=g.body,n=s)))}),u},c.getState=function(a){var u=h(a),s=this.fragments[u];return s?s.buffered?C(s)?S.PARTIAL:S.OK:s.backtrack?S.BACKTRACKED:S.APPENDING:S.NOT_LOADED},c.backtrack=function(a,u){var s=h(a),f=this.fragments[s];if(!f||f.backtrack)return null;var i=f.backtrack=u||f.loaded;return f.loaded=null,i},c.getBacktrackData=function(a){var u=h(a),s=this.fragments[u];if(s){var f,i=s.backtrack;if(i!=null&&(f=i.payload)!==null&&f!==void 0&&f.byteLength)return i;this.removeFragment(a)}return null},c.isTimeBuffered=function(a,u,s){for(var f,i,n=0;n<s.length;n++){if(f=s.start(n)-this.bufferPadding,i=s.end(n)+this.bufferPadding,a>=f&&u<=i)return!0;if(u<=f)return!1}return!1},c.onFragLoaded=function(a,u){var s=u.frag,f=u.part;if(s.sn==="initSegment"||s.bitrateTest||f)return;var i=h(s);this.fragments[i]={body:s,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},c.onBufferAppended=function(a,u){var s=this,f=u.frag,i=u.part,n=u.timeRanges;if(f.type===k.PlaylistLevelType.MAIN)if(this.activeFragment=f,i){var t=this.activeParts;t||(this.activeParts=t=[]),t.push(i)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(d){var v=n[d];if(s.detectEvictedFragments(d,v),!i)for(var g=0;g<v.length;g++)f.appendedPTS=Math.max(v.end(g),f.appendedPTS||0)})},c.onFragBuffered=function(a,u){this.detectPartialFragments(u)},c.hasFragment=function(a){var u=h(a);return!!this.fragments[u]},c.removeFragmentsInRange=function(a,u,s){var f=this;Object.keys(this.fragments).forEach(function(i){var n=f.fragments[i];if(!n)return;if(n.buffered){var t=n.body;t.type===s&&t.start<u&&t.end>a&&f.removeFragment(t)}})},c.removeFragment=function(a){var u=h(a);a.stats.loaded=0,a.clearElementaryStreamInfo(),delete this.fragments[u]},c.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},p}();function C(p){var c,l;return p.buffered&&(((c=p.range.video)===null||c===void 0?void 0:c.partial)||((l=p.range.audio)===null||l===void 0?void 0:l.partial))}function h(p){return p.type+"_"+p.level+"_"+p.urlId+"_"+p.sn}},"./src/controller/gap-controller.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"STALL_MINIMUM_DURATION_MS",function(){return C}),j.d(ee,"MAX_START_GAP_JUMP",function(){return h}),j.d(ee,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return p}),j.d(ee,"SKIP_BUFFER_RANGE_START",function(){return c}),j.d(ee,"default",function(){return l});var w=j("./src/utils/buffer-helper.ts"),k=j("./src/errors.ts"),S=j("./src/events.ts"),T=j("./src/utils/logger.ts"),C=250,h=2,p=.1,c=.05,l=function(){function a(s,f,i,n){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=f,this.fragmentTracker=i,this.hls=n}var u=a.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(f){var i=this.config,n=this.media,t=this.stalled,d=n.currentTime,v=n.seeking,g=this.seeking&&!v,b=!this.seeking&&v;if(this.seeking=v,d!==f){if(this.moved=!0,t!==null){if(this.stallReported){var _=self.performance.now()-t;T.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(_)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((b||g)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!w.BufferHelper.getBuffered(n).length)return;var m=w.BufferHelper.bufferInfo(n,d,0),y=m.len>0,E=m.nextStart||0;if(!y&&!E)return;if(v){var o=m.len>h,x=!E||E-d>h&&!this.fragmentTracker.getPartialFragment(d);if(o||x)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var A,O=Math.max(E,m.start||0)-d,D=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=D==null||((A=D.details)===null||A===void 0)?void 0:A.live,W=N?D.details.targetduration*2:h;if(O>0&&O<=W){this._trySkipBufferHole(null);return}}var K=self.performance.now();if(t===null){this.stalled=K;return}var oe=K-t;!v&&oe>=C&&this._reportStall(m.len);var B=w.BufferHelper.bufferInfo(n,d,i.maxBufferHole);this._tryFixBufferStall(B,oe)},u._tryFixBufferStall=function(f,i){var n=this.config,t=this.fragmentTracker,d=this.media,v=d.currentTime,g=t.getPartialFragment(v);if(g){var b=this._trySkipBufferHole(g);if(b)return}f.len>n.maxBufferHole&&i>n.highBufferWatchdogPeriod*1e3&&(T.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(f){var i=this.hls,n=this.media,t=this.stallReported;t||(this.stallReported=!0,T.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+f+")"),i.trigger(S.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},u._trySkipBufferHole=function(f){for(var i=this.config,n=this.hls,t=this.media,d=t.currentTime,v=0,g=w.BufferHelper.getBuffered(t),b=0;b<g.length;b++){var _=g.start(b);if(d+i.maxBufferHole>=v&&d<_){var m=Math.max(_+c,t.currentTime+p);return T.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+m),this.moved=!0,this.stalled=null,t.currentTime=m,f&&n.trigger(S.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+m,frag:f}),m}v=g.end(b)}return 0},u._tryNudgeBuffer=function(){var f=this.config,i=this.hls,n=this.media,t=n.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<f.nudgeMaxRetry){var v=t+d*f.nudgeOffset;T.logger.warn("Nudging 'currentTime' from "+t+" to "+v),n.currentTime=v,i.trigger(S.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else T.logger.error("Playhead still not moving while enough data buffered @"+t+" after "+f.nudgeMaxRetry+" nudges"),i.trigger(S.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},a}()},"./src/controller/id3-track-controller.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/events.ts"),k=j("./src/utils/texttrack-utils.ts"),S=j("./src/demux/id3.ts"),T=.25,C=function(){function h(c){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=c,this._registerListeners()}var p=h.prototype;return p.destroy=function(){this._unregisterListeners()},p._registerListeners=function(){var l=this.hls;l.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(w.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),l.on(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p._unregisterListeners=function(){var l=this.hls;l.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(w.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),l.off(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p.onMediaAttached=function(l,a){this.media=a.media},p.onMediaDetaching=function(){if(!this.id3Track)return;Object(k.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},p.getID3Track=function(l){if(!this.media)return;for(var a=0;a<l.length;a++){var u=l[a];if(u.kind==="metadata"&&u.label==="id3")return Object(k.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},p.onFragParsingMetadata=function(l,a){if(!this.media)return;var u=a.frag,s=a.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var f=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,i=0;i<s.length;i++){var n=S.getID3Frames(s[i].data);if(n){var t=s[i].pts,d=i<s.length-1?s[i+1].pts:u.end,v=d-t;v<=0&&(d=t+T);for(var g=0;g<n.length;g++){var b=n[g];if(!S.isTimeStampFrame(b)){var _=new f(t,d,"");_.value=b,this.id3Track.addCue(_)}}}}},p.onBufferFlushing=function(l,a){var u=a.startOffset,s=a.endOffset,f=a.type;if(!f||f==="audio"){var i=this.id3Track;i&&Object(k.removeCuesInRange)(i,u,s)}},h}();ee.default=C},"./src/controller/latency-controller.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return h});var w=j("./src/errors.ts"),k=j("./src/events.ts"),S=j("./src/utils/logger.ts");function T(p,c){for(var l=0;l<c.length;l++){var a=c[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}function C(p,c,l){return c&&T(p.prototype,c),l&&T(p,l),p}var h=function(){function p(l){var a=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 a.timeupdate()},this.hls=l,this.config=l.config,this.registerListeners()}var c=p.prototype;return c.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},c.registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(k.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(k.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(k.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(k.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(k.Events.ERROR,this.onError)},c.onMediaAttached=function(a,u){this.media=u.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},c.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},c.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},c.onLevelUpdated=function(a,u){var s=u.details;this.levelDetails=s,s.advanced&&this.timeupdate(),!s.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},c.onError=function(a,u){if(u.details!==w.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,S.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},c.timeupdate=function(){var a=this.media,u=this.levelDetails;if(!a||!u)return;this.currentTime=a.currentTime;var s=this.computeLatency();if(s===null)return;this._latency=s;var f=this.config,i=f.lowLatencyMode,n=f.maxLiveSyncPlaybackRate;if(!i||n===1)return;var t=this.targetLatency;if(t===null)return;var d=s-t,v=Math.min(this.maxLatency,t+u.targetduration),g=d<v;if(u.live&&g&&d>.05&&this.forwardBufferLength>1){var b=Math.min(2,Math.max(1,n)),_=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;a.playbackRate=Math.min(b,Math.max(1,_))}else a.playbackRate!==1&&a.playbackRate!==0&&(a.playbackRate=1)},c.estimateLiveEdge=function(){var a=this.levelDetails;return a===null?null:a.edge+a.age},c.computeLatency=function(){var a=this.estimateLiveEdge();return a===null?null:a-this.currentTime},C(p,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var a=this.config,u=this.levelDetails;return a.liveMaxLatencyDuration!==void 0?a.liveMaxLatencyDuration:u?a.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var a=this.levelDetails;if(a===null)return null;var u=a.holdBack,s=a.partHoldBack,f=a.targetduration,i=this.config,n=i.liveSyncDuration,t=i.liveSyncDurationCount,d=i.lowLatencyMode,v=this.hls.userConfig,g=d&&s||u;(v.liveSyncDuration||v.liveSyncDurationCount||g===0)&&(g=n!==void 0?n:t*f);var b=f,_=1;return g+Math.min(this.stallCount*_,b)}},{key:"liveSyncPosition",get:function(){var a=this.estimateLiveEdge(),u=this.targetLatency,s=this.levelDetails;if(a===null||u===null||s===null)return null;var f=s.edge,i=a-u-this.edgeStalled,n=f-s.totalduration,t=f-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(n,i),t)}},{key:"drift",get:function(){var a=this.levelDetails;return a===null?1:a.drift}},{key:"edgeStalled",get:function(){var a=this.levelDetails;if(a===null)return 0;var u=(this.config.lowLatencyMode&&a.partTarget||a.targetduration)*3;return Math.max(a.age-u,0)}},{key:"forwardBufferLength",get:function(){var a=this.media,u=this.levelDetails;if(!a||!u)return 0;var s=a.buffered.length;return s?a.buffered.end(s-1):u.edge-this.currentTime}}]),p}()},"./src/controller/level-controller.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return i});var w=j("./src/types/level.ts"),k=j("./src/events.ts"),S=j("./src/errors.ts"),T=j("./src/utils/codecs.ts"),C=j("./src/controller/level-helper.ts"),h=j("./src/controller/base-playlist-controller.ts"),p=j("./src/types/loader.ts");function c(){return c=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var d=arguments[t];for(var v in d)Object.prototype.hasOwnProperty.call(d,v)&&(n[v]=d[v])}return n},c.apply(this,arguments)}function l(n,t){for(var d=0;d<t.length;d++){var v=t[d];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(n,v.key,v)}}function a(n,t,d){return t&&l(n.prototype,t),d&&l(n,d),n}function u(n,t){n.prototype=Object.create(t.prototype),n.prototype.constructor=n,s(n,t)}function s(n,t){return s=Object.setPrototypeOf||function(v,g){return v.__proto__=g,v},s(n,t)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(n){u(t,n);function t(v){var g;return g=n.call(this,v,"[level-controller]")||this,g._levels=[],g._firstLevel=-1,g._startLevel=void 0,g.currentLevelIndex=-1,g.manualLevelIndex=-1,g.onParsedComplete=void 0,g._registerListeners(),g}var d=t.prototype;return d._registerListeners=function(){var g=this.hls;g.on(k.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(k.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.on(k.Events.FRAG_LOADED,this.onFragLoaded,this),g.on(k.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var g=this.hls;g.off(k.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(k.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.off(k.Events.FRAG_LOADED,this.onFragLoaded,this),g.off(k.Events.ERROR,this.onError,this)},d.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,n.prototype.destroy.call(this)},d.startLoad=function(){var g=this._levels;g.forEach(function(b){b.loadError=0}),n.prototype.startLoad.call(this)},d.onManifestLoaded=function(g,b){var _=[],m=[],y=[],E,o={},x,A=!1,O=!1,D=!1;if(b.levels.forEach(function(oe){var B=oe.attrs;A=A||!!(oe.width&&oe.height),O=O||!!oe.videoCodec,D=D||!!oe.audioCodec,f&&oe.audioCodec&&oe.audioCodec.indexOf("mp4a.40.34")!==-1&&(oe.audioCodec=void 0);var X=oe.bitrate+"-"+oe.attrs.RESOLUTION+"-"+oe.attrs.CODECS;x=o[X],x?x.url.push(oe.url):(x=new w.Level(oe),o[X]=x,_.push(x)),B&&(B.AUDIO&&Object(C.addGroupId)(x,"audio",B.AUDIO),B.SUBTITLES&&Object(C.addGroupId)(x,"text",B.SUBTITLES))}),(A||O)&&D&&(_=_.filter(function(oe){var B=oe.videoCodec,X=oe.width,V=oe.height;return!!B||!!(X&&V)})),_=_.filter(function(oe){var B=oe.audioCodec,X=oe.videoCodec;return(!B||Object(T.isCodecSupportedInMp4)(B,"audio"))&&(!X||Object(T.isCodecSupportedInMp4)(X,"video"))}),b.audioTracks&&(m=b.audioTracks.filter(function(oe){return!oe.audioCodec||Object(T.isCodecSupportedInMp4)(oe.audioCodec,"audio")}),Object(C.assignTrackIdsByGroup)(m)),b.subtitles&&(y=b.subtitles,Object(C.assignTrackIdsByGroup)(y)),_.length>0){E=_[0].bitrate,_.sort(function(oe,B){return oe.bitrate-B.bitrate}),this._levels=_;for(var N=0;N<_.length;N++)if(_[N].bitrate===E){this._firstLevel=N,this.log("manifest loaded, "+_.length+" level(s) found, first bitrate: "+E);break}var W=D&&!O,K={levels:_,audioTracks:m,subtitleTracks:y,firstLevel:this._firstLevel,stats:b.stats,audio:D,video:O,altAudio:!W&&m.some(function(oe){return!!oe.url})};this.hls.trigger(k.Events.MANIFEST_PARSED,K),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(k.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:b.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(g,b){if(n.prototype.onError.call(this,g,b),b.fatal)return;var _=b.context,m=this._levels[this.currentLevelIndex];if(_&&(_.type===p.PlaylistContextType.AUDIO_TRACK&&m.audioGroupIds&&_.groupId===m.audioGroupIds[m.urlId]||_.type===p.PlaylistContextType.SUBTITLE_TRACK&&m.textGroupIds&&_.groupId===m.textGroupIds[m.urlId])){this.redundantFailover(this.currentLevelIndex);return}var y=!1,E=!0,o;switch(b.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:if(b.frag){var x=this._levels[b.frag.level];x?(x.fragmentError++,x.fragmentError>this.hls.config.fragLoadingMaxRetry&&(o=b.frag.level)):o=b.frag.level}break;case S.ErrorDetails.LEVEL_LOAD_ERROR:case S.ErrorDetails.LEVEL_LOAD_TIMEOUT:_&&(_.deliveryDirectives&&(E=!1),o=_.level),y=!0;break;case S.ErrorDetails.REMUX_ALLOC_ERROR:o=b.level,y=!0;break}o!==void 0&&this.recoverLevel(b,o,y,E)},d.recoverLevel=function(g,b,_,m){var y=g.details,E=this._levels[b];if(E.loadError++,_){var o=this.retryLoadingOrFail(g);if(o)g.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(m){var x=E.url.length;if(x>1&&E.loadError<x)g.levelRetry=!0,this.redundantFailover(b);else if(this.manualLevelIndex===-1){var A=b===0?this._levels.length-1:b-1;this.currentLevelIndex!==A&&this._levels[A].loadError===0&&(this.warn(y+": switch to "+A),g.levelRetry=!0,this.hls.nextAutoLevel=A)}}},d.redundantFailover=function(g){var b=this._levels[g],_=b.url.length;if(_>1){var m=(b.urlId+1)%_;this.warn("Switching to redundant URL-id "+m),this._levels.forEach(function(y){y.urlId=m}),this.level=g}},d.onFragLoaded=function(g,b){var _=b.frag;if(_!==void 0&&_.type===p.PlaylistLevelType.MAIN){var m=this._levels[_.level];m!==void 0&&(m.fragmentError=0,m.loadError=0)}},d.onLevelLoaded=function(g,b){var _,m=b.level,y=b.details,E=this._levels[m];if(!E){var o;this.warn("Invalid level index "+m),(o=b.deliveryDirectives)!==null&&o!==void 0&&o.skip&&(y.deltaUpdateFailed=!0);return}m===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(m,b,E.details)):(_=b.deliveryDirectives)!==null&&_!==void 0&&_.skip&&(y.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(g,b){var _=this.hls.levels[this.currentLevelIndex];if(!_)return;if(_.audioGroupIds){for(var m=-1,y=this.hls.audioTracks[b.id].groupId,E=0;E<_.audioGroupIds.length;E++)if(_.audioGroupIds[E]===y){m=E;break}m!==_.urlId&&(_.urlId=m,this.startLoad())}},d.loadPlaylist=function(g){var b=this.currentLevelIndex,_=this._levels[b];if(this.canLoad&&_&&_.url.length>0){var m=_.urlId,y=_.url[m];if(g)try{y=g.addDirectives(y)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Attempt loading level index "+b+(g?" at sn "+g.msn+" part "+g.part:"")+" with URL-id "+m+" "+y),this.clearTimer(),this.hls.trigger(k.Events.LEVEL_LOADING,{url:y,level:b,id:m,deliveryDirectives:g||null})}},d.removeLevel=function(g,b){var _=function(E,o){return o!==b},m=this._levels.filter(function(y,E){return E!==g?!0:y.url.length>1&&b!==void 0?(y.url=y.url.filter(_),y.audioGroupIds&&(y.audioGroupIds=y.audioGroupIds.filter(_)),y.textGroupIds&&(y.textGroupIds=y.textGroupIds.filter(_)),y.urlId=0,!0):!1}).map(function(y,E){var o=y.details;return o!=null&&o.fragments&&o.fragments.forEach(function(x){x.level=E}),y});this._levels=m,this.hls.trigger(k.Events.LEVELS_UPDATED,{levels:m})},a(t,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(g){var b,_=this._levels;if(_.length===0)return;if(this.currentLevelIndex===g&&(b=_[g])!==null&&b!==void 0&&b.details)return;if(g<0||g>=_.length){var m=g<0;if(this.hls.trigger(k.Events.ERROR,{type:S.ErrorTypes.OTHER_ERROR,details:S.ErrorDetails.LEVEL_SWITCH_ERROR,level:g,fatal:m,reason:"invalid level idx"}),m)return;g=Math.min(g,_.length-1)}this.clearTimer();var y=this.currentLevelIndex,E=_[y],o=_[g];this.log("switching to level "+g+" from "+y),this.currentLevelIndex=g;var x=c({},o,{level:g,maxBitrate:o.maxBitrate,uri:o.uri,urlId:o.urlId});delete x._urlId,this.hls.trigger(k.Events.LEVEL_SWITCHING,x);var A=o.details;if(!A||A.live){var O=this.switchParams(o.uri,E==null?void 0:E.details);this.loadPlaylist(O)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(g){this.manualLevelIndex=g,this._startLevel===void 0&&(this._startLevel=g),g!==-1&&(this.level=g)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(g){this._firstLevel=g}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var g=this.hls.config.startLevel;return g!==void 0?g:this._firstLevel}else return this._startLevel},set:function(g){this._startLevel=g}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(g){this.level=g,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=g)}}]),t}(h.default)},"./src/controller/level-helper.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"addGroupId",function(){return S}),j.d(ee,"assignTrackIdsByGroup",function(){return T}),j.d(ee,"updatePTS",function(){return C}),j.d(ee,"updateFragPTSDTS",function(){return p}),j.d(ee,"mergeDetails",function(){return c}),j.d(ee,"mapPartIntersection",function(){return l}),j.d(ee,"mapFragmentIntersection",function(){return a}),j.d(ee,"adjustSliding",function(){return u}),j.d(ee,"addSliding",function(){return s}),j.d(ee,"computeReloadInterval",function(){return f}),j.d(ee,"getFragmentWithSN",function(){return i}),j.d(ee,"getPartWith",function(){return n});var w=j("./src/polyfills/number.ts"),k=j("./src/utils/logger.ts");function S(t,d,v){switch(d){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(v);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(v);break}}function T(t){var d={};t.forEach(function(v){var g=v.groupId||"";v.id=d[g]=d[g]||0,d[g]++})}function C(t,d,v){var g=t[d],b=t[v];h(g,b)}function h(t,d){var v=d.startPTS;if(Object(w.isFiniteNumber)(v)){var g=0,b;d.sn>t.sn?(g=v-t.start,b=t):(g=t.start-v,b=d),b.duration!==g&&(b.duration=g)}else if(d.sn>t.sn){var _=t.cc===d.cc;_&&t.minEndPTS?d.start=t.start+(t.minEndPTS-t.start):d.start=t.start+t.duration}else d.start=Math.max(t.start-d.duration,0)}function p(t,d,v,g,b,_){var m=g-v;m<=0&&(k.logger.warn("Fragment should have a positive duration",d),g=v+d.duration,_=b+d.duration);var y=v,E=g,o=d.startPTS,x=d.endPTS;if(Object(w.isFiniteNumber)(o)){var A=Math.abs(o-v);Object(w.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(A,d.deltaPTS):d.deltaPTS=A,y=Math.max(v,o),v=Math.min(v,o),b=Math.min(b,d.startDTS),E=Math.min(g,x),g=Math.max(g,x),_=Math.max(_,d.endDTS)}d.duration=g-v;var O=v-d.start;d.appendedPTS=g,d.start=d.startPTS=v,d.maxStartPTS=y,d.startDTS=b,d.endPTS=g,d.minEndPTS=E,d.endDTS=_;var D=d.sn;if(!t||D<t.startSN||D>t.endSN)return 0;var N,W=D-t.startSN,K=t.fragments;for(K[W]=d,N=W;N>0;N--)h(K[N],K[N-1]);for(N=W;N<K.length-1;N++)h(K[N],K[N+1]);return t.fragmentHint&&h(K[K.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,O}function c(t,d){for(var v=null,g=t.fragments,b=g.length-1;b>=0;b--){var _=g[b].initSegment;if(_){v=_;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var m=0,y;if(a(t,d,function(N,W){N.relurl&&(m=N.cc-W.cc),Object(w.isFiniteNumber)(N.startPTS)&&Object(w.isFiniteNumber)(N.endPTS)&&(W.start=W.startPTS=N.startPTS,W.startDTS=N.startDTS,W.appendedPTS=N.appendedPTS,W.maxStartPTS=N.maxStartPTS,W.endPTS=N.endPTS,W.endDTS=N.endDTS,W.minEndPTS=N.minEndPTS,W.duration=N.endPTS-N.startPTS,W.duration&&(y=W),d.PTSKnown=d.alignedSliding=!0),W.elementaryStreams=N.elementaryStreams,W.loader=N.loader,W.stats=N.stats,W.urlId=N.urlId,N.initSegment&&(W.initSegment=N.initSegment,v=N.initSegment)}),v){var E=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;E.forEach(function(N){var W;(!N.initSegment||N.initSegment.relurl===((W=v)===null||W===void 0?void 0:W.relurl))&&(N.initSegment=v)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(N){return!N}),d.deltaUpdateFailed)){k.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var o=d.skippedSegments;o--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var x=d.fragments;if(m){k.logger.warn("discontinuity sliding from playlist, take drift into account");for(var A=0;A<x.length;A++)x[A].cc+=m}d.skippedSegments&&(d.startCC=d.fragments[0].cc),l(t.partList,d.partList,function(N,W){W.elementaryStreams=N.elementaryStreams,W.stats=N.stats}),y?p(d,y,y.startPTS,y.endPTS,y.startDTS,y.endDTS):u(t,d),x.length&&(d.totalduration=d.edge-x[0].start),d.driftStartTime=t.driftStartTime,d.driftStart=t.driftStart;var O=d.advancedDateTime;if(d.advanced&&O){var D=d.edge;d.driftStart||(d.driftStartTime=O,d.driftStart=D),d.driftEndTime=O,d.driftEnd=D}else d.driftEndTime=t.driftEndTime,d.driftEnd=t.driftEnd,d.advancedDateTime=t.advancedDateTime}function l(t,d,v){if(t&&d)for(var g=0,b=0,_=t.length;b<=_;b++){var m=t[b],y=d[b+g];m&&y&&m.index===y.index&&m.fragment.sn===y.fragment.sn?v(m,y):g--}}function a(t,d,v){for(var g=d.skippedSegments,b=Math.max(t.startSN,d.startSN)-d.startSN,_=(t.fragmentHint?1:0)+(g?d.endSN:Math.min(t.endSN,d.endSN))-d.startSN,m=d.startSN-t.startSN,y=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,E=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,o=b;o<=_;o++){var x=E[m+o],A=y[o];g&&!A&&o<g&&(A=d.fragments[o]=x),x&&A&&v(x,A)}}function u(t,d){var v=d.startSN+d.skippedSegments-t.startSN,g=t.fragments;if(v<0||v>=g.length)return;s(d,g[v].start)}function s(t,d){if(d){for(var v=t.fragments,g=t.skippedSegments;g<v.length;g++)v[g].start+=d;t.fragmentHint&&(t.fragmentHint.start+=d)}}function f(t,d){var v=1e3*t.levelTargetDuration,g=v/2,b=t.age,_=b>0&&b<v*3,m=d.loading.end-d.loading.start,y,E=t.availabilityDelay;if(t.updated===!1)if(_){var o=333*t.misses;y=Math.max(Math.min(g,m*2),o),t.availabilityDelay=(t.availabilityDelay||0)+y}else y=g;else _?(E=Math.min(E||v/2,b),t.availabilityDelay=E,y=E+v-b):y=v-m;return Math.round(y)}function i(t,d,v){if(!t||!t.details)return null;var g=t.details,b=g.fragments[d-g.startSN];return b||(b=g.fragmentHint,b&&b.sn===d?b:d<g.startSN&&v&&v.sn===d?v:null)}function n(t,d,v){if(!t||!t.details)return null;var g=t.details.partList;if(g)for(var b=g.length;b--;){var _=g[b];if(_.index===v&&_.fragment.sn===d)return _}return null}},"./src/controller/stream-controller.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return g});var w=j("./src/polyfills/number.ts"),k=j("./src/controller/base-stream-controller.ts"),S=j("./src/is-supported.ts"),T=j("./src/events.ts"),C=j("./src/utils/buffer-helper.ts"),h=j("./src/controller/fragment-tracker.ts"),p=j("./src/types/loader.ts"),c=j("./src/loader/fragment.ts"),l=j("./src/demux/transmuxer-interface.ts"),a=j("./src/types/transmuxer.ts"),u=j("./src/controller/gap-controller.ts"),s=j("./src/errors.ts"),f=j("./src/utils/logger.ts");function i(b,_){for(var m=0;m<_.length;m++){var y=_[m];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,y.key,y)}}function n(b,_,m){return _&&i(b.prototype,_),m&&i(b,m),b}function t(b,_){b.prototype=Object.create(_.prototype),b.prototype.constructor=b,d(b,_)}function d(b,_){return d=Object.setPrototypeOf||function(y,E){return y.__proto__=E,y},d(b,_)}var v=100,g=function(b){t(_,b);function _(y,E){var o;return o=b.call(this,y,E,"[stream-controller]")||this,o.audioCodecSwap=!1,o.gapController=null,o.level=-1,o._forceStartLoad=!1,o.altAudio=!1,o.audioOnly=!1,o.fragPlaying=null,o.onvplaying=null,o.onvseeked=null,o.fragLastKbps=0,o.stalled=!1,o.couldBacktrack=!1,o.audioCodecSwitch=!1,o.videoBuffer=null,o._registerListeners(),o}var m=_.prototype;return m._registerListeners=function(){var E=this.hls;E.on(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(T.Events.LEVEL_LOADING,this.onLevelLoading,this),E.on(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(T.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.on(T.Events.ERROR,this.onError,this),E.on(T.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(T.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(T.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(T.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.on(T.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m._unregisterListeners=function(){var E=this.hls;E.off(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(T.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.off(T.Events.ERROR,this.onError,this),E.off(T.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(T.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(T.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(T.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.off(T.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},m.startLoad=function(E){if(this.levels){var o=this.lastCurrentTime,x=this.hls;if(this.stopLoad(),this.setInterval(v),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var A=x.startLevel;A===-1&&(x.config.testBandwidth?(A=0,this.bitrateTest=!0):A=x.nextAutoLevel),this.level=x.nextLoadLevel=A,this.loadedmetadata=!1}o>0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),E=o),this.state=k.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()}else this._forceStartLoad=!0,this.state=k.State.STOPPED},m.stopLoad=function(){this._forceStartLoad=!1,b.prototype.stopLoad.call(this)},m.doTick=function(){switch(this.state){case k.State.IDLE:this.doTickIdle();break;case k.State.WAITING_LEVEL:{var E,o=this.levels,x=this.level,A=o==null||((E=o[x])===null||E===void 0)?void 0:E.details;if(A&&(!A.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(A))break;this.state=k.State.IDLE;break}break}case k.State.FRAG_LOADING_WAITING_RETRY:{var O,D=self.performance.now(),N=this.retryDate;(!N||D>=N||(O=this.media)!==null&&O!==void 0&&O.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=k.State.IDLE)}break;default:break}this.onTickEnd()},m.onTickEnd=function(){b.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},m.doTickIdle=function(){var E,o,x=this.hls,A=this.levelLastLoaded,O=this.levels,D=this.media,N=x.config,W=x.nextLoadLevel;if(A===null||!D&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!O||!O[W])return;var K=O[W];this.level=x.nextLoadLevel=W;var oe=K.details;if(!oe||this.state===k.State.WAITING_LEVEL||oe.live&&this.levelLastLoaded!==W){this.state=k.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:D,p.PlaylistLevelType.MAIN);if(B===null)return;var X=B.len,V=this.getMaxBufferLength(K.maxBitrate);if(X>=V)return;if(this._streamEnded(B,oe)){var ne={};this.altAudio&&(ne.type="video"),this.hls.trigger(T.Events.BUFFER_EOS,ne),this.state=k.State.ENDED;return}var $=B.end,Z=this.getNextFragment($,oe);if(this.couldBacktrack&&!this.fragPrevious&&Z&&Z.sn!=="initSegment"){var ue=Z.sn-oe.startSN;ue>1&&(Z=oe.fragments[ue-1],this.fragmentTracker.removeFragment(Z))}if(Z&&this.fragmentTracker.getState(Z)===h.FragmentState.OK&&this.nextLoadPosition>$){var he=this.audioOnly&&!this.altAudio?c.ElementaryStreamTypes.AUDIO:c.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(D,he,p.PlaylistLevelType.MAIN),Z=this.getNextFragment(this.nextLoadPosition,oe)}if(!Z)return;Z.initSegment&&!Z.initSegment.data&&!this.bitrateTest&&(Z=Z.initSegment),((E=Z.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((o=Z.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(Z,oe):this.loadFragment(Z,oe,$)},m.loadFragment=function(E,o,x){var A,O=this.fragmentTracker.getState(E);if(this.fragCurrent=E,O===h.FragmentState.BACKTRACKED){var D=this.fragmentTracker.getBacktrackData(E);if(D){this._handleFragmentLoadProgress(D),this._handleFragmentLoadComplete(D);return}else O=h.FragmentState.NOT_LOADED}O===h.FragmentState.NOT_LOADED||O===h.FragmentState.PARTIAL?E.sn==="initSegment"?this._loadInitSegment(E):this.bitrateTest?(E.bitrateTest=!0,this.log("Fragment "+E.sn+" of level "+E.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(E)):(this.startFragRequested=!0,b.prototype.loadFragment.call(this,E,o,x)):O===h.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((A=this.media)===null||A===void 0?void 0:A.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},m.getAppendedFrag=function(E){var o=this.fragmentTracker.getAppendedFrag(E,p.PlaylistLevelType.MAIN);return o&&"fragment"in o?o.fragment:o},m.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,p.PlaylistLevelType.MAIN)},m.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},m.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},m.nextLevelSwitch=function(){var E=this.levels,o=this.media;if(o!=null&&o.readyState){var x,A=this.getAppendedFrag(o.currentTime);if(A&&A.start>1&&this.flushMainBuffer(0,A.start-1),!o.paused&&E){var O=this.hls.nextLoadLevel,D=E[O],N=this.fragLastKbps;N&&this.fragCurrent?x=this.fragCurrent.duration*D.maxBitrate/(1e3*N)+1:x=0}else x=0;var W=this.getBufferedFrag(o.currentTime+x);if(W){var K=this.followingBufferedFrag(W);if(K){this.abortCurrentFrag();var oe=K.maxStartPTS?K.maxStartPTS:K.start,B=K.duration,X=Math.max(W.end,oe+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(X,Number.POSITIVE_INFINITY)}}}},m.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===k.State.KEY_LOADING&&(this.state=k.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},m.flushMainBuffer=function(E,o){b.prototype.flushMainBuffer.call(this,E,o,this.altAudio?"video":null)},m.onMediaAttached=function(E,o){b.prototype.onMediaAttached.call(this,E,o);var x=o.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),x.addEventListener("playing",this.onvplaying),x.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,x,this.fragmentTracker,this.hls)},m.onMediaDetaching=function(){var E=this.media;E&&(E.removeEventListener("playing",this.onvplaying),E.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)},m.onMediaPlaying=function(){this.tick()},m.onMediaSeeked=function(){var E=this.media,o=E?E.currentTime:null;Object(w.isFiniteNumber)(o)&&this.log("Media seeked to "+o.toFixed(3)),this.tick()},m.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},m.onManifestParsed=function(E,o){var x=!1,A=!1,O;o.levels.forEach(function(D){O=D.audioCodec,O&&(O.indexOf("mp4a.40.2")!==-1&&(x=!0),O.indexOf("mp4a.40.5")!==-1&&(A=!0))}),this.audioCodecSwitch=x&&A&&!Object(S.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=o.levels,this.startFragRequested=!1},m.onLevelLoading=function(E,o){var x=this.levels;if(!x||this.state!==k.State.IDLE)return;var A=x[o.level];(!A.details||A.details.live&&this.levelLastLoaded!==o.level||this.waitForCdnTuneIn(A.details))&&(this.state=k.State.WAITING_LEVEL)},m.onLevelLoaded=function(E,o){var x,A=this.levels,O=o.level,D=o.details,N=D.totalduration;if(!A){this.warn("Levels were reset while loading level "+O);return}this.log("Level "+O+" loaded ["+D.startSN+","+D.endSN+"], cc ["+D.startCC+", "+D.endCC+"] duration:"+N);var W=this.fragCurrent;W&&(this.state===k.State.FRAG_LOADING||this.state===k.State.FRAG_LOADING_WAITING_RETRY)&&(W.level!==o.level&&W.loader&&(this.state=k.State.IDLE,W.loader.abort()));var K=A[O],oe=0;if(D.live||(x=K.details)!==null&&x!==void 0&&x.live){if(D.fragments[0]||(D.deltaUpdateFailed=!0),D.deltaUpdateFailed)return;oe=this.alignPlaylists(D,K.details)}if(K.details=D,this.levelLastLoaded=O,this.hls.trigger(T.Events.LEVEL_UPDATED,{details:D,level:O}),this.state===k.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(D))return;this.state=k.State.IDLE}this.startFragRequested?D.live&&this.synchronizeToLiveEdge(D):this.setStartPosition(D,oe),this.tick()},m._handleFragmentLoadProgress=function(E){var o,x=E.frag,A=E.part,O=E.payload,D=this.levels;if(!D){this.warn("Levels were reset while fragment load was in progress. Fragment "+x.sn+" of level "+x.level+" will not be buffered");return}var N=D[x.level],W=N.details;if(!W){this.warn("Dropping fragment "+x.sn+" of level "+x.level+" after level details were reset");return}var K=N.videoCodec,oe=W.PTSKnown||!W.live,B=(o=x.initSegment)===null||o===void 0?void 0:o.data,X=this._getAudioCodec(N),V=this.transmuxer=this.transmuxer||new l.default(this.hls,p.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ne=A?A.index:-1,$=ne!==-1,Z=new a.ChunkMetadata(x.level,x.sn,x.stats.chunkCount,O.byteLength,ne,$),ue=this.initPTS[x.cc];V.push(O,B,X,K,x,A,W.totalduration,oe,Z,ue)},m.onAudioTrackSwitching=function(E,o){var x=this.altAudio,A=!!o.url,O=o.id;if(!A){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var D=this.fragCurrent;D!=null&&D.loader&&(this.log("Switching to main audio track, cancel main fragment load"),D.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;x&&N.trigger(T.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(T.Events.AUDIO_TRACK_SWITCHED,{id:O})}},m.onAudioTrackSwitched=function(E,o){var x=o.id,A=!!this.hls.audioTracks[x].url;if(A){var O=this.videoBuffer;O&&this.mediaBuffer!==O&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=O)}this.altAudio=A,this.tick()},m.onBufferCreated=function(E,o){var x=o.tracks,A,O,D=!1;for(var N in x){var W=x[N];if(W.id==="main"){if(O=N,A=W,N==="video"){var K=x[N];K&&(this.videoBuffer=K.buffer)}}else D=!0}D&&A?(this.log("Alternate track found, use "+O+".buffered to schedule main fragment loading"),this.mediaBuffer=A.buffer):this.mediaBuffer=this.media},m.onFragBuffered=function(E,o){var x=o.frag,A=o.part;if(x&&x.type!==p.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(x)){this.warn("Fragment "+x.sn+(A?" p: "+A.index:"")+" of level "+x.level+" finished buffering, but was aborted. state: "+this.state),this.state===k.State.PARSED&&(this.state=k.State.IDLE);return}var O=A?A.stats:x.stats;this.fragLastKbps=Math.round(8*O.total/(O.buffering.end-O.loading.first)),x.sn!=="initSegment"&&(this.fragPrevious=x),this.fragBufferedComplete(x,A)},m.onError=function(E,o){switch(o.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,o);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==k.State.ERROR&&(o.fatal?(this.warn(""+o.details),this.state=k.State.ERROR):!o.levelRetry&&this.state===k.State.WAITING_LEVEL&&(this.state=k.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="main"&&(this.state===k.State.PARSING||this.state===k.State.PARSED)){var x=!0,A=this.getFwdBufferInfo(this.media,p.PlaylistLevelType.MAIN);A&&A.len>.5&&(x=!this.reduceMaxBufferLength(A.len)),x&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},m.checkBuffer=function(){var E=this.media,o=this.gapController;if(!E||!o||!E.readyState)return;var x=C.BufferHelper.getBuffered(E);!this.loadedmetadata&&x.length?(this.loadedmetadata=!0,this.seekToStartPos()):o.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},m.onFragLoadEmergencyAborted=function(){this.state=k.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},m.onBufferFlushed=function(E,o){var x=o.type;if(x!==c.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var A=(x===c.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(A,x,p.PlaylistLevelType.MAIN)}},m.onLevelsUpdated=function(E,o){this.levels=o.levels},m.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},m.seekToStartPos=function(){var E=this.media,o=E.currentTime,x=this.startPosition;if(x>=0&&o<x){if(E.seeking){f.logger.log("could not seek to "+x+", already seeking at "+o);return}var A=C.BufferHelper.getBuffered(E),O=A.length?A.start(0):0,D=O-x;D>0&&(D<this.config.maxBufferHole||D<this.config.maxFragLookUpTolerance)&&(f.logger.log("adjusting start position by "+D+" to match buffer start"),x+=D,this.startPosition=x),this.log("seek to target start position "+x+" from current time "+o),E.currentTime=x}},m._getAudioCodec=function(E){var o=this.config.defaultAudioCodec||E.audioCodec;return this.audioCodecSwap&&o&&(this.log("Swapping audio codec"),o.indexOf("mp4a.40.5")!==-1?o="mp4a.40.2":o="mp4a.40.5"),o},m._loadBitrateTestFrag=function(E){var o=this;this._doFragLoad(E).then(function(x){var A=o.hls;if(!x||A.nextLoadLevel||o.fragContextChanged(E))return;o.fragLoadError=0,o.state=k.State.IDLE,o.startFragRequested=!1,o.bitrateTest=!1;var O=E.stats;O.parsing.start=O.parsing.end=O.buffering.start=O.buffering.end=self.performance.now(),A.trigger(T.Events.FRAG_LOADED,x)})},m._handleTransmuxComplete=function(E){var o,x="main",A=this.hls,O=E.remuxResult,D=E.chunkMeta,N=this.getCurrentContext(D);if(!N){this.warn("The loading context changed while buffering fragment "+D.sn+" of level "+D.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(D.level);return}var W=N.frag,K=N.part,oe=N.level,B=O.video,X=O.text,V=O.id3,ne=O.initSegment,$=this.altAudio?void 0:O.audio;if(this.fragContextChanged(W))return;if(this.state=k.State.PARSING,ne){ne.tracks&&(this._bufferInitSegment(oe,ne.tracks,W,D),A.trigger(T.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:x,tracks:ne.tracks}));var Z=ne.initPTS,ue=ne.timescale;Object(w.isFiniteNumber)(Z)&&(this.initPTS[W.cc]=Z,A.trigger(T.Events.INIT_PTS_FOUND,{frag:W,id:x,initPTS:Z,timescale:ue}))}if(B&&O.independent!==!1){if(oe.details){var he=B.startPTS,Oe=B.endPTS,we=B.startDTS,Pe=B.endDTS;if(K)K.elementaryStreams[B.type]={startPTS:he,endPTS:Oe,startDTS:we,endDTS:Pe};else if(B.firstKeyFrame&&B.independent&&(this.couldBacktrack=!0),B.dropped&&B.independent){var _e=this.getLoadPosition()+this.config.maxBufferHole;if(_e<he){this.backtrack(W);return}W.setElementaryStreamInfo(B.type,W.start,Oe,W.start,Pe,!0)}W.setElementaryStreamInfo(B.type,he,Oe,we,Pe),this.bufferFragmentData(B,W,K,D)}}else if(O.independent===!1){this.backtrack(W);return}if($){var xe=$.startPTS,Ve=$.endPTS,Ne=$.startDTS,Be=$.endDTS;K&&(K.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:xe,endPTS:Ve,startDTS:Ne,endDTS:Be}),W.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,xe,Ve,Ne,Be),this.bufferFragmentData($,W,K,D)}if(V!=null&&(o=V.samples)!==null&&o!==void 0&&o.length){var ze={frag:W,id:x,samples:V.samples};A.trigger(T.Events.FRAG_PARSING_METADATA,ze)}if(X){var ye={frag:W,id:x,samples:X.samples};A.trigger(T.Events.FRAG_PARSING_USERDATA,ye)}},m._bufferInitSegment=function(E,o,x,A){var O=this;if(this.state!==k.State.PARSING)return;this.audioOnly=!!o.audio&&!o.video,this.altAudio&&!this.audioOnly&&delete o.audio;var D=o.audio,N=o.video,W=o.audiovideo;if(D){var K=E.audioCodec,oe=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(K&&(K.indexOf("mp4a.40.5")!==-1?K="mp4a.40.2":K="mp4a.40.5"),D.metadata.channelCount!==1&&oe.indexOf("firefox")===-1&&(K="mp4a.40.5")),oe.indexOf("android")!==-1&&D.container!=="audio/mpeg"&&(K="mp4a.40.2",this.log("Android: force audio codec to "+K)),E.audioCodec&&E.audioCodec!==K&&this.log('Swapping manifest audio codec "'+E.audioCodec+'" for "'+K+'"'),D.levelCodec=K,D.id="main",this.log("Init audio buffer, container:"+D.container+", codecs[selected/level/parsed]=["+(K||"")+"/"+(E.audioCodec||"")+"/"+D.codec+"]")}N&&(N.levelCodec=E.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(E.videoCodec||"")+"/"+N.codec+"]")),W&&this.log("Init audiovideo buffer, container:"+W.container+", codecs[level/parsed]=["+(E.attrs.CODECS||"")+"/"+W.codec+"]"),this.hls.trigger(T.Events.BUFFER_CODECS,o),Object.keys(o).forEach(function(B){var X=o[B],V=X.initSegment;V!=null&&V.byteLength&&O.hls.trigger(T.Events.BUFFER_APPENDING,{type:B,data:V,frag:x,part:null,chunkMeta:A,parent:x.type})}),this.tick()},m.backtrack=function(E){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(E);var o=this.fragmentTracker.backtrack(E);this.fragPrevious=null,this.nextLoadPosition=E.start,o?this.resetFragmentLoading(E):this.state=k.State.BACKTRACKING},m.checkFragmentChanged=function(){var E=this.media,o=null;if(E&&E.readyState>1&&E.seeking===!1){var x=E.currentTime;if(C.BufferHelper.isBuffered(E,x)?o=this.getAppendedFrag(x):C.BufferHelper.isBuffered(E,x+.1)&&(o=this.getAppendedFrag(x+.1)),o){var A=this.fragPlaying,O=o.level;(!A||o.sn!==A.sn||A.level!==O||o.urlId!==A.urlId)&&(this.hls.trigger(T.Events.FRAG_CHANGED,{frag:o}),(!A||A.level!==O)&&this.hls.trigger(T.Events.LEVEL_SWITCHED,{level:O}),this.fragPlaying=o)}}},n(_,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var o=this.getAppendedFrag(E.currentTime);if(o)return o.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var o=this.getAppendedFrag(E.currentTime);return this.followingBufferedFrag(o)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),_}(k.default)},"./src/controller/subtitle-stream-controller.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"SubtitleStreamController",function(){return t});var w=j("./src/events.ts"),k=j("./src/utils/logger.ts"),S=j("./src/utils/buffer-helper.ts"),T=j("./src/controller/fragment-finders.ts"),C=j("./src/utils/discontinuities.ts"),h=j("./src/controller/level-helper.ts"),p=j("./src/controller/fragment-tracker.ts"),c=j("./src/controller/base-stream-controller.ts"),l=j("./src/types/loader.ts"),a=j("./src/types/level.ts");function u(d,v){for(var g=0;g<v.length;g++){var b=v[g];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(d,b.key,b)}}function s(d,v,g){return v&&u(d.prototype,v),g&&u(d,g),d}function f(d,v){d.prototype=Object.create(v.prototype),d.prototype.constructor=d,i(d,v)}function i(d,v){return i=Object.setPrototypeOf||function(b,_){return b.__proto__=_,b},i(d,v)}var n=500,t=function(d){f(v,d);function v(b,_){var m;return m=d.call(this,b,_,"[subtitle-stream-controller]")||this,m.levels=[],m.currentTrackId=-1,m.tracksBuffered=[],m.mainDetails=null,m._registerListeners(),m}var g=v.prototype;return g.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},g._registerListeners=function(){var _=this.hls;_.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.on(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(w.Events.ERROR,this.onError,this),_.on(w.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),_.on(w.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),_.on(w.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),_.on(w.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),_.on(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},g._unregisterListeners=function(){var _=this.hls;_.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(w.Events.ERROR,this.onError,this),_.off(w.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),_.off(w.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),_.off(w.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),_.off(w.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),_.off(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},g.startLoad=function(){this.stopLoad(),this.state=c.State.IDLE,this.setInterval(n),this.tick()},g.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},g.onLevelLoaded=function(_,m){this.mainDetails=m.details},g.onSubtitleFragProcessed=function(_,m){var y=m.frag,E=m.success;if(this.fragPrevious=y,this.state=c.State.IDLE,!E)return;var o=this.tracksBuffered[this.currentTrackId];if(!o)return;for(var x,A=y.start,O=0;O<o.length;O++)if(A>=o[O].start&&A<=o[O].end){x=o[O];break}var D=y.start+y.duration;x?x.end=D:(x={start:A,end:D},o.push(x)),this.fragmentTracker.fragBuffered(y)},g.onBufferFlushing=function(_,m){var y=m.startOffset,E=m.endOffset;if(y===0&&E!==Number.POSITIVE_INFINITY){var o=this.currentTrackId,x=this.levels;if(!x.length||!x[o]||!x[o].details)return;var A=x[o].details,O=A.targetduration,D=E-O;if(D<=0)return;m.endOffsetSubtitles=Math.max(0,D),this.tracksBuffered.forEach(function(N){for(var W=0;W<N.length;){if(N[W].end<=D){N.shift();continue}else if(N[W].start<D)N[W].start=D;else break;W++}}),this.fragmentTracker.removeFragmentsInRange(y,D,l.PlaylistLevelType.SUBTITLE)}},g.onError=function(_,m){var y,E=m.frag;if(!E||E.type!==l.PlaylistLevelType.SUBTITLE)return;(y=this.fragCurrent)!==null&&y!==void 0&&y.loader&&this.fragCurrent.loader.abort(),this.state=c.State.IDLE},g.onSubtitleTracksUpdated=function(_,m){var y=this,E=m.subtitleTracks;this.tracksBuffered=[],this.levels=E.map(function(o){return new a.Level(o)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(o){y.tracksBuffered[o.id]=[]}),this.mediaBuffer=null},g.onSubtitleTrackSwitch=function(_,m){if(this.currentTrackId=m.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(n)},g.onSubtitleTrackLoaded=function(_,m){var y,E=m.details,o=m.id,x=this.currentTrackId,A=this.levels;if(!A.length)return;var O=A[x];if(o>=A.length||o!==x||!O)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(y=O.details)!==null&&y!==void 0&&y.live){var D=this.mainDetails;if(E.deltaUpdateFailed||!D)return;var N=D.fragments[0];if(!O.details)E.hasProgramDateTime&&D.hasProgramDateTime?Object(C.alignMediaPlaylistByPDT)(E,D):N&&Object(h.addSliding)(E,N.start);else{var W=this.alignPlaylists(E,O.details);W===0&&N&&Object(h.addSliding)(E,N.start)}}if(O.details=E,this.levelLastLoaded=o,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===c.State.IDLE){var K=Object(T.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);K||(this.warn("Subtitle playlist not aligned with playback"),O.details=void 0)}},g._handleFragmentLoadComplete=function(_){var m=_.frag,y=_.payload,E=m.decryptdata,o=this.hls;if(this.fragContextChanged(m))return;if(y&&y.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var x=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(y),E.key.buffer,E.iv.buffer).then(function(A){var O=performance.now();o.trigger(w.Events.FRAG_DECRYPTED,{frag:m,payload:A,stats:{tstart:x,tdecrypt:O}})})}},g.doTick=function(){if(!this.media){this.state=c.State.IDLE;return}if(this.state===c.State.IDLE){var _,m=this.currentTrackId,y=this.levels;if(!y.length||!y[m]||!y[m].details)return;var E=y[m].details,o=E.targetduration,x=this.config,A=this.media,O=S.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,A.currentTime-o,x.maxBufferHole),D=O.end,N=O.len,W=this.getMaxBufferLength()+o;if(N>W)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var K=E.fragments,oe=K.length,B=E.edge,X,V=this.fragPrevious;if(D<B){var ne=x.maxFragLookUpTolerance;V&&E.hasProgramDateTime&&(X=Object(T.findFragmentByPDT)(K,V.endProgramDateTime,ne)),X||(X=Object(T.findFragmentByPTS)(V,K,D,ne),!X&&V&&V.start<K[0].start&&(X=K[0]))}else X=K[oe-1];(_=X)!==null&&_!==void 0&&_.encrypted?(k.logger.log("Loading key for "+X.sn),this.state=c.State.KEY_LOADING,this.hls.trigger(w.Events.KEY_LOADING,{frag:X})):X&&this.fragmentTracker.getState(X)===p.FragmentState.NOT_LOADED&&this.loadFragment(X,E,D)}},g.loadFragment=function(_,m,y){this.fragCurrent=_,d.prototype.loadFragment.call(this,_,m,y)},s(v,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),v}(c.default)},"./src/controller/subtitle-track-controller.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/events.ts"),k=j("./src/utils/texttrack-utils.ts"),S=j("./src/controller/base-playlist-controller.ts"),T=j("./src/types/loader.ts");function C(u,s){for(var f=0;f<s.length;f++){var i=s[f];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}function h(u,s,f){return s&&C(u.prototype,s),f&&C(u,f),u}function p(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,c(u,s)}function c(u,s){return c=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},c(u,s)}var l=function(u){p(s,u);function s(i){var n;return n=u.call(this,i,"[subtitle-track-controller]")||this,n.media=null,n.tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.selectDefaultTrack=!0,n.queuedDefaultTrack=-1,n.trackChangeListener=function(){return n.onTextTracksChanged()},n.asyncPollTrackChange=function(){return n.pollTrackChange(0)},n.useTextTrackPolling=!1,n.subtitlePollingInterval=-1,n.subtitleDisplay=!0,n.registerListeners(),n}var f=s.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},f.registerListeners=function(){var n=this.hls;n.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(w.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(w.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(w.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.on(w.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var n=this.hls;n.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(w.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(w.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(w.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.off(w.Events.ERROR,this.onError,this)},f.onMediaAttached=function(n,t){if(this.media=t.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)},f.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},f.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 n=a(this.media.textTracks);n.forEach(function(t){Object(k.clearCurrentCues)(t)}),this.subtitleTrack=-1,this.media=null},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(n,t){this.tracks=t.subtitleTracks},f.onSubtitleTrackLoaded=function(n,t){var d=t.id,v=t.details,g=this.trackId,b=this.tracksInGroup[g];if(!b){this.warn("Invalid subtitle track id "+d);return}var _=b.details;b.details=t.details,this.log("subtitle track "+d+" loaded ["+v.startSN+"-"+v.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,t,_))},f.onLevelLoading=function(n,t){this.switchLevel(t.level)},f.onLevelSwitching=function(n,t){this.switchLevel(t.level)},f.switchLevel=function(n){var t=this.hls.levels[n];if(!(t!=null&&t.textGroupIds))return;var d=t.textGroupIds[t.urlId];if(this.groupId!==d){var v=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,g=this.tracks.filter(function(m){return!d||m.groupId===d});this.tracksInGroup=g;var b=this.findTrackId(v==null?void 0:v.name)||this.findTrackId();this.groupId=d;var _={subtitleTracks:g};this.log("Updating subtitle tracks, "+g.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(w.Events.SUBTITLE_TRACKS_UPDATED,_),b!==-1&&this.setSubtitleTrack(b,v)}},f.findTrackId=function(n){for(var t=this.tracksInGroup,d=0;d<t.length;d++){var v=t[d];if((!this.selectDefaultTrack||v.default)&&(!n||n===v.name))return v.id}return-1},f.onError=function(n,t){if(u.prototype.onError.call(this,n,t),t.fatal||!t.context)return;t.context.type===T.PlaylistContextType.SUBTITLE_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},f.loadPlaylist=function(n){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var d=t.id,v=t.groupId,g=t.url;if(n)try{g=n.addDirectives(g)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(w.Events.SUBTITLE_TRACK_LOADING,{url:g,id:d,groupId:v,deliveryDirectives:n||null})}},f.toggleTrackModes=function(n){var t=this,d=this.media,v=this.subtitleDisplay,g=this.trackId;if(!d)return;var b=a(d.textTracks),_=b.filter(function(E){return E.groupId===t.groupId});if(n===-1)[].slice.call(b).forEach(function(E){E.mode="disabled"});else{var m=_[g];m&&(m.mode="disabled")}var y=_[n];y&&(y.mode=v?"showing":"hidden")},f.setSubtitleTrack=function(n,t){var d,v=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=n;return}if(this.trackId!==n&&this.toggleTrackModes(n),this.trackId===n&&(n===-1||(d=v[n])!==null&&d!==void 0&&d.details)||n<-1||n>=v.length)return;this.clearTimer();var g=v[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,g){var b=g.id,_=g.groupId,m=_===void 0?"":_,y=g.name,E=g.type,o=g.url;this.hls.trigger(w.Events.SUBTITLE_TRACK_SWITCH,{id:b,groupId:m,name:y,type:E,url:o});var x=this.switchParams(g.url,t==null?void 0:t.details);this.loadPlaylist(x)}else this.hls.trigger(w.Events.SUBTITLE_TRACK_SWITCH,{id:n})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,t=a(this.media.textTracks),d=0;d<t.length;d++)if(t[d].mode==="hidden")n=d;else if(t[d].mode==="showing"){n=d;break}this.subtitleTrack!==n&&(this.subtitleTrack=n)},h(s,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(n){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(n,t)}}]),s}(S.default);function a(u){for(var s=[],f=0;f<u.length;f++){var i=u[f];i.kind==="subtitles"&&i.label&&s.push(u[f])}return s}ee.default=l},"./src/controller/timeline-controller.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"TimelineController",function(){return a});var w=j("./src/polyfills/number.ts"),k=j("./src/events.ts"),S=j("./src/utils/cea-608-parser.ts"),T=j("./src/utils/output-filter.ts"),C=j("./src/utils/webvtt-parser.ts"),h=j("./src/utils/texttrack-utils.ts"),p=j("./src/utils/imsc1-ttml-parser.ts"),c=j("./src/types/loader.ts"),l=j("./src/utils/logger.ts"),a=function(){function i(t){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=f(),this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.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 d=new T.default(this,"textTrack1"),v=new T.default(this,"textTrack2"),g=new T.default(this,"textTrack3"),b=new T.default(this,"textTrack4");this.cea608Parser1=new S.default(1,d,v),this.cea608Parser2=new S.default(3,g,b)}t.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(k.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(k.Events.FRAG_LOADING,this.onFragLoading,this),t.on(k.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(k.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(k.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(k.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var n=i.prototype;return n.destroy=function(){var d=this.hls;d.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(k.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.off(k.Events.FRAG_LOADING,this.onFragLoading,this),d.off(k.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(k.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.off(k.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.off(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(k.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},n.addCues=function(d,v,g,b,_){for(var m=!1,y=_.length;y--;){var E=_[y],o=s(E[0],E[1],v,g);if(o>=0&&(E[0]=Math.min(E[0],v),E[1]=Math.max(E[1],g),m=!0,o/(g-v)>.5))return}if(m||_.push([v,g]),this.config.renderTextTracksNatively){var x=this.captionsTracks[d];this.Cues.newCue(x,v,g,b)}else{var A=this.Cues.newCue(null,v,g,b);this.hls.trigger(k.Events.CUES_PARSED,{type:"captions",cues:A,track:d})}},n.onInitPtsFound=function(d,v){var g=this,b=v.frag,_=v.id,m=v.initPTS,y=v.timescale,E=this.unparsedVttFrags;_==="main"&&(this.initPTS[b.cc]=m,this.timescale[b.cc]=y),E.length&&(this.unparsedVttFrags=[],E.forEach(function(o){g.onFragLoaded(k.Events.FRAG_LOADED,o)}))},n.getExistingTrack=function(d){var v=this.media;if(v)for(var g=0;g<v.textTracks.length;g++){var b=v.textTracks[g];if(b[d])return b}return null},n.createCaptionsTrack=function(d){this.config.renderTextTracksNatively?this.createNativeTrack(d):this.createNonNativeTrack(d)},n.createNativeTrack=function(d){if(this.captionsTracks[d])return;var v=this.captionsProperties,g=this.captionsTracks,b=this.media,_=v[d],m=_.label,y=_.languageCode,E=this.getExistingTrack(d);if(E)g[d]=E,Object(h.clearCurrentCues)(g[d]),Object(h.sendAddTrackEvent)(g[d],b);else{var o=this.createTextTrack("captions",m,y);o&&(o[d]=!0,g[d]=o)}},n.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var v=this.captionsProperties[d];if(!v)return;var g=v.label,b={_id:d,label:g,kind:"captions",default:v.media?!!v.media.default:!1,closedCaptions:v.media};this.nonNativeCaptionsTracks[d]=b,this.hls.trigger(k.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[b]})},n.createTextTrack=function(d,v,g){var b=this.media;return b?b.addTextTrack(d,v,g):void 0},n.onMediaAttaching=function(d,v){this.media=v.media,this._cleanTracks()},n.onMediaDetaching=function(){var d=this.captionsTracks;Object.keys(d).forEach(function(v){Object(h.clearCurrentCues)(d[v]),delete d[v]}),this.nonNativeCaptionsTracks={}},n.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),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())},n._cleanTracks=function(){var d=this.media;if(!d)return;var v=d.textTracks;if(v)for(var g=0;g<v.length;g++)Object(h.clearCurrentCues)(v[g])},n.onSubtitleTracksUpdated=function(d,v){var g=this;this.textTracks=[];var b=v.subtitleTracks||[],_=b.some(function(o){return o.textCodec===p.IMSC1_CODEC});if(this.config.enableWebVTT||_&&this.config.enableIMSC1){var m=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(o,x){var A;if(x<y.length){for(var O=null,D=0;D<y.length;D++)if(u(y[D],o)){O=y[D];break}O&&(A=O)}A?Object(h.clearCurrentCues)(A):(A=g.createTextTrack("subtitles",o.name,o.lang),A&&(A.mode="disabled")),A&&(A.groupId=o.groupId,g.textTracks.push(A))})}else if(!m&&this.tracks&&this.tracks.length){var E=this.tracks.map(function(o){return{label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}});this.hls.trigger(k.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:E})}}},n.onManifestLoaded=function(d,v){var g=this;this.config.enableCEA708Captions&&v.captions&&v.captions.forEach(function(b){var _=/(?:CC|SERVICE)([1-4])/.exec(b.instreamId);if(!_)return;var m="textTrack"+_[1],y=g.captionsProperties[m];if(!y)return;y.label=b.name,b.lang&&(y.languageCode=b.lang),y.media=b})},n.onFragLoading=function(d,v){var g=this.cea608Parser1,b=this.cea608Parser2,_=this.lastSn,m=this.lastPartIndex;if(!this.enabled||!(g&&b))return;if(v.frag.type===c.PlaylistLevelType.MAIN){var y,E,o=v.frag.sn,x=(y=v==null||((E=v.part)===null||E===void 0)?void 0:E.index)!=null?y:-1;o===_+1||o===_&&x===m+1||(g.reset(),b.reset()),this.lastSn=o,this.lastPartIndex=x}},n.onFragLoaded=function(d,v){var g=v.frag,b=v.payload,_=this.initPTS,m=this.unparsedVttFrags;if(g.type===c.PlaylistLevelType.SUBTITLE)if(b.byteLength){if(!Object(w.isFiniteNumber)(_[g.cc])){m.push(v),_.length&&this.hls.trigger(k.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:new Error("Missing initial subtitle PTS")});return}var y=g.decryptdata;if(y==null||y.key==null||y.method!=="AES-128"){var E=this.tracks[g.level],o=this.vttCCs;o[g.cc]||(o[g.cc]={start:g.start,prevCC:this.prevCC,new:!0},this.prevCC=g.cc),E&&E.textCodec===p.IMSC1_CODEC?this._parseIMSC1(g,b):this._parseVTTs(g,b,o)}}else this.hls.trigger(k.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:new Error("Empty subtitle payload")})},n._parseIMSC1=function(d,v){var g=this,b=this.hls;Object(p.parseIMSC1)(v,this.initPTS[d.cc],this.timescale[d.cc],function(_){g._appendCues(_,d.level),b.trigger(k.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(_){l.logger.log("Failed to parse IMSC1: "+_),b.trigger(k.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:_})})},n._parseVTTs=function(d,v,g){var b=this,_=this.hls;Object(C.parseWebVTT)(v,this.initPTS[d.cc],this.timescale[d.cc],g,d.cc,d.start,function(m){b._appendCues(m,d.level),_.trigger(k.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(m){b._fallbackToIMSC1(d,v),l.logger.log("Failed to parse VTT cue: "+m),_.trigger(k.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:m})})},n._fallbackToIMSC1=function(d,v){var g=this,b=this.tracks[d.level];b.textCodec||Object(p.parseIMSC1)(v,this.initPTS[d.cc],this.timescale[d.cc],function(){b.textCodec=p.IMSC1_CODEC,g._parseIMSC1(d,v)},function(){b.textCodec="wvtt"})},n._appendCues=function(d,v){var g=this.hls;if(this.config.renderTextTracksNatively){var b=this.textTracks[v];if(b.mode==="disabled")return;d.forEach(function(y){return Object(h.addCueToTrack)(b,y)})}else{var _=this.tracks[v],m=_.default?"default":"subtitles"+v;g.trigger(k.Events.CUES_PARSED,{type:"subtitles",cues:d,track:m})}},n.onFragDecrypted=function(d,v){var g=v.frag;if(g.type===c.PlaylistLevelType.SUBTITLE){if(!Object(w.isFiniteNumber)(this.initPTS[g.cc])){this.unparsedVttFrags.push(v);return}this.onFragLoaded(k.Events.FRAG_LOADED,v)}},n.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},n.onFragParsingUserdata=function(d,v){var g=this.cea608Parser1,b=this.cea608Parser2;if(!this.enabled||!(g&&b))return;for(var _=0;_<v.samples.length;_++){var m=v.samples[_].bytes;if(m){var y=this.extractCea608Data(m);g.addData(v.samples[_].pts,y[0]),b.addData(v.samples[_].pts,y[1])}}},n.onBufferFlushing=function(d,v){var g=v.startOffset,b=v.endOffset,_=v.endOffsetSubtitles,m=v.type,y=this.media;if(!y||y.currentTime<b)return;if(!m||m==="video"){var E=this.captionsTracks;Object.keys(E).forEach(function(x){return Object(h.removeCuesInRange)(E[x],g,b)})}if(this.config.renderTextTracksNatively&&(g===0&&_!==void 0)){var o=this.textTracks;Object.keys(o).forEach(function(x){return Object(h.removeCuesInRange)(o[x],g,_)})}},n.extractCea608Data=function(d){for(var v=d[0]&31,g=2,b=[[],[]],_=0;_<v;_++){var m=d[g++],y=127&d[g++],E=127&d[g++],o=(4&m)!==0,x=3&m;if(y===0&&E===0)continue;o&&((x===0||x===1)&&(b[x].push(y),b[x].push(E)))}return b},i}();function u(i,n){return i&&i.label===n.name&&!(i.textTrack1||i.textTrack2)}function s(i,n,t,d){return Math.min(n,d)-Math.max(i,t)}function f(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return w});var w=function(){function k(T,C){this.subtle=void 0,this.aesIV=void 0,this.subtle=T,this.aesIV=C}var S=k.prototype;return S.decrypt=function(C,h){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},h,C)},k}()},"./src/crypt/aes-decryptor.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"removePadding",function(){return k}),j.d(ee,"default",function(){return S});var w=j("./src/utils/typed-array.ts");function k(T){var C=T.byteLength,h=C&&new DataView(T.buffer).getUint8(C-1);return h?Object(w.sliceUint8)(T,0,C-h):T}var S=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 C=T.prototype;return C.uint8ArrayToUint32Array_=function(p){for(var c=new DataView(p),l=new Uint32Array(4),a=0;a<4;a++)l[a]=c.getUint32(a*4);return l},C.initTable=function(){var p=this.sBox,c=this.invSBox,l=this.subMix,a=l[0],u=l[1],s=l[2],f=l[3],i=this.invSubMix,n=i[0],t=i[1],d=i[2],v=i[3],g=new Uint32Array(256),b=0,_=0,m=0;for(m=0;m<256;m++)m<128?g[m]=m<<1:g[m]=m<<1^283;for(m=0;m<256;m++){var y=_^_<<1^_<<2^_<<3^_<<4;y=y>>>8^y&255^99,p[b]=y,c[y]=b;var E=g[b],o=g[E],x=g[o],A=g[y]*257^y*16843008;a[b]=A<<24|A>>>8,u[b]=A<<16|A>>>16,s[b]=A<<8|A>>>24,f[b]=A,A=x*16843009^o*65537^E*257^b*16843008,n[y]=A<<24|A>>>8,t[y]=A<<16|A>>>16,d[y]=A<<8|A>>>24,v[y]=A,b?(b=E^g[g[g[x^E]]],_^=g[g[_]]):b=_=1}},C.expandKey=function(p){for(var c=this.uint8ArrayToUint32Array_(p),l=!0,a=0;a<c.length&&l;)l=c[a]===this.key[a],a++;if(l)return;this.key=c;var u=this.keySize=c.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var s=this.ksRows=(u+6+1)*4,f,i,n=this.keySchedule=new Uint32Array(s),t=this.invKeySchedule=new Uint32Array(s),d=this.sBox,v=this.rcon,g=this.invSubMix,b=g[0],_=g[1],m=g[2],y=g[3],E,o;for(f=0;f<s;f++){if(f<u){E=n[f]=c[f];continue}o=E,f%u===0?(o=o<<8|o>>>24,o=d[o>>>24]<<24|d[o>>>16&255]<<16|d[o>>>8&255]<<8|d[o&255],o^=v[f/u|0]<<24):u>6&&f%u===4&&(o=d[o>>>24]<<24|d[o>>>16&255]<<16|d[o>>>8&255]<<8|d[o&255]),n[f]=E=(n[f-u]^o)>>>0}for(i=0;i<s;i++)f=s-i,i&3?o=n[f]:o=n[f-4],i<4||f<=4?t[i]=o:t[i]=b[d[o>>>24]]^_[d[o>>>16&255]]^m[d[o>>>8&255]]^y[d[o&255]],t[i]=t[i]>>>0},C.networkToHostOrderSwap=function(p){return p<<24|(p&65280)<<8|(p&16711680)>>8|p>>>24},C.decrypt=function(p,c,l){for(var a=this.keySize+6,u=this.invKeySchedule,s=this.invSBox,f=this.invSubMix,i=f[0],n=f[1],t=f[2],d=f[3],v=this.uint8ArrayToUint32Array_(l),g=v[0],b=v[1],_=v[2],m=v[3],y=new Int32Array(p),E=new Int32Array(y.length),o,x,A,O,D,N,W,K,oe,B,X,V,ne,$,Z=this.networkToHostOrderSwap;c<y.length;){for(oe=Z(y[c]),B=Z(y[c+1]),X=Z(y[c+2]),V=Z(y[c+3]),D=oe^u[0],N=V^u[1],W=X^u[2],K=B^u[3],ne=4,$=1;$<a;$++)o=i[D>>>24]^n[N>>16&255]^t[W>>8&255]^d[K&255]^u[ne],x=i[N>>>24]^n[W>>16&255]^t[K>>8&255]^d[D&255]^u[ne+1],A=i[W>>>24]^n[K>>16&255]^t[D>>8&255]^d[N&255]^u[ne+2],O=i[K>>>24]^n[D>>16&255]^t[N>>8&255]^d[W&255]^u[ne+3],D=o,N=x,W=A,K=O,ne=ne+4;o=s[D>>>24]<<24^s[N>>16&255]<<16^s[W>>8&255]<<8^s[K&255]^u[ne],x=s[N>>>24]<<24^s[W>>16&255]<<16^s[K>>8&255]<<8^s[D&255]^u[ne+1],A=s[W>>>24]<<24^s[K>>16&255]<<16^s[D>>8&255]<<8^s[N&255]^u[ne+2],O=s[K>>>24]<<24^s[D>>16&255]<<16^s[N>>8&255]<<8^s[W&255]^u[ne+3],E[c]=Z(o^g),E[c+1]=Z(O^b),E[c+2]=Z(A^_),E[c+3]=Z(x^m),g=oe,b=B,_=X,m=V,c=c+4}return E.buffer},T}()},"./src/crypt/decrypter.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return c});var w=j("./src/crypt/aes-crypto.ts"),k=j("./src/crypt/fast-aes-key.ts"),S=j("./src/crypt/aes-decryptor.ts"),T=j("./src/utils/logger.ts"),C=j("./src/utils/mp4-tools.ts"),h=j("./src/utils/typed-array.ts"),p=16,c=function(){function l(u,s,f){var i=f===void 0?{}:f,n=i.removePKCS7Padding,t=n===void 0?!0:n;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=u,this.config=s,this.removePKCS7Padding=t,t)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(v){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var a=l.prototype;return a.destroy=function(){this.observer=null},a.isSync=function(){return this.config.enableSoftwareAES},a.flush=function(){var s=this.currentResult;if(!s){this.reset();return}var f=new Uint8Array(s);return this.reset(),this.removePKCS7Padding?Object(S.removePadding)(f):f},a.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},a.decrypt=function(s,f,i,n){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(s),f,i);var t=this.flush();t&&n(t.buffer)}else this.webCryptoDecrypt(new Uint8Array(s),f,i).then(n)},a.softwareDecrypt=function(s,f,i){var n=this.currentIV,t=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(s=Object(C.appendUint8Array)(d,s),this.remainderData=null);var v=this.getValidChunk(s);if(!v.length)return null;n&&(i=n);var g=this.softwareDecrypter;g||(g=this.softwareDecrypter=new S.default),g.expandKey(f);var b=t;return this.currentResult=g.decrypt(v.buffer,0,i),this.currentIV=Object(h.sliceUint8)(v,-16).buffer,b||null},a.webCryptoDecrypt=function(s,f,i){var n=this,t=this.subtle;return(this.key!==f||!this.fastAesKey)&&(this.key=f,this.fastAesKey=new k.default(t,f)),this.fastAesKey.expandKey().then(function(d){if(!t)return Promise.reject(new Error("web crypto not initialized"));var v=new w.default(t,i);return v.decrypt(s.buffer,d)}).catch(function(d){return n.onWebCryptoError(d,s,f,i)})},a.onWebCryptoError=function(s,f,i,n){return T.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",s),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(f,i,n)},a.getValidChunk=function(s){var f=s,i=s.length-s.length%p;return i!==s.length&&(f=Object(h.sliceUint8)(s,0,i),this.remainderData=Object(h.sliceUint8)(s,i)),f},a.logOnce=function(s){if(!this.logEnabled)return;T.logger.log("[decrypter.ts]: "+s),this.logEnabled=!1},l}()},"./src/crypt/fast-aes-key.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return w});var w=function(){function k(T,C){this.subtle=void 0,this.key=void 0,this.subtle=T,this.key=C}var S=k.prototype;return S.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},k}()},"./src/demux/aacdemuxer.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/demux/base-audio-demuxer.ts"),k=j("./src/demux/adts.ts"),S=j("./src/utils/logger.ts"),T=j("./src/demux/id3.ts");function C(c,l){c.prototype=Object.create(l.prototype),c.prototype.constructor=c,h(c,l)}function h(c,l){return h=Object.setPrototypeOf||function(u,s){return u.__proto__=s,u},h(c,l)}var p=function(c){C(l,c);function l(u,s){var f;return f=c.call(this)||this,f.observer=void 0,f.config=void 0,f.observer=u,f.config=s,f}var a=l.prototype;return a.resetInitSegment=function(s,f,i){c.prototype.resetInitSegment.call(this,s,f,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},l.probe=function(s){if(!s)return!1;for(var f=T.getID3Data(s,0)||[],i=f.length,n=s.length;i<n;i++)if(k.probe(s,i))return S.logger.log("ADTS sync word found !"),!0;return!1},a.canParse=function(s,f){return k.canParse(s,f)},a.appendFrame=function(s,f,i){k.initTrackConfig(s,this.observer,f,i,s.manifestCodec);var n=k.appendFrame(s,f,i,this.initPTS,this.frameIndex);if(n&&n.missing===0)return n},l}(w.default);p.minProbeByteLength=9,ee.default=p},"./src/demux/adts.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"getAudioConfig",function(){return T}),j.d(ee,"isHeaderPattern",function(){return C}),j.d(ee,"getHeaderLength",function(){return h}),j.d(ee,"getFullFrameLength",function(){return p}),j.d(ee,"canGetFrameLength",function(){return c}),j.d(ee,"isHeader",function(){return l}),j.d(ee,"canParse",function(){return a}),j.d(ee,"probe",function(){return u}),j.d(ee,"initTrackConfig",function(){return s}),j.d(ee,"getFrameDuration",function(){return f}),j.d(ee,"parseFrameHeader",function(){return i}),j.d(ee,"appendFrame",function(){return n});var w=j("./src/utils/logger.ts"),k=j("./src/errors.ts"),S=j("./src/events.ts");function T(t,d,v,g){var b,_,m,y,E=navigator.userAgent.toLowerCase(),o=g,x=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];b=((d[v+2]&192)>>>6)+1;var A=(d[v+2]&60)>>>2;if(A>x.length-1){t.trigger(S.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+A});return}return m=(d[v+2]&1)<<2,m|=(d[v+3]&192)>>>6,w.logger.log("manifest codec:"+g+", ADTS type:"+b+", samplingIndex:"+A),/firefox/i.test(E)?A>=6?(b=5,y=new Array(4),_=A-3):(b=2,y=new Array(2),_=A):E.indexOf("android")!==-1?(b=2,y=new Array(2),_=A):(b=5,y=new Array(4),g&&(g.indexOf("mp4a.40.29")!==-1||g.indexOf("mp4a.40.5")!==-1)||!g&&A>=6?_=A-3:((g&&g.indexOf("mp4a.40.2")!==-1&&(A>=6&&m===1||/vivaldi/i.test(E))||!g&&m===1)&&(b=2,y=new Array(2)),_=A)),y[0]=b<<3,y[0]|=(A&14)>>1,y[1]|=(A&1)<<7,y[1]|=m<<3,b===5&&(y[1]|=(_&14)>>1,y[2]=(_&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:x[A],channelCount:m,codec:"mp4a.40."+b,manifestCodec:o}}function C(t,d){return t[d]===255&&(t[d+1]&246)===240}function h(t,d){return t[d+1]&1?7:9}function p(t,d){return(t[d+3]&3)<<11|t[d+4]<<3|(t[d+5]&224)>>>5}function c(t,d){return d+5<t.length}function l(t,d){return d+1<t.length&&C(t,d)}function a(t,d){return c(t,d)&&C(t,d)&&p(t,d)<=t.length-d}function u(t,d){if(l(t,d)){var v=h(t,d);if(d+v>=t.length)return!1;var g=p(t,d);if(g<=v)return!1;var b=d+g;return b===t.length||l(t,b)}return!1}function s(t,d,v,g,b){if(!t.samplerate){var _=T(d,v,g,b);if(!_)return;t.config=_.config,t.samplerate=_.samplerate,t.channelCount=_.channelCount,t.codec=_.codec,t.manifestCodec=_.manifestCodec,w.logger.log("parsed codec:"+t.codec+", rate:"+_.samplerate+", channels:"+_.channelCount)}}function f(t){return 1024*9e4/t}function i(t,d,v,g,b){var _=h(t,d),m=p(t,d);if(m-=_,m>0){var y=v+g*b;return{headerLength:_,frameLength:m,stamp:y}}}function n(t,d,v,g,b){var _=f(t.samplerate),m=i(d,v,g,b,_);if(m){var y=m.frameLength,E=m.headerLength,o=m.stamp,x=E+y,A=Math.max(0,v+x-d.length),O;A?(O=new Uint8Array(x-E),O.set(d.subarray(v+E,d.length),0)):O=d.subarray(v+E,v+x);var D={unit:O,pts:o};return A||t.samples.push(D),{sample:D,length:x,missing:A}}}},"./src/demux/base-audio-demuxer.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"initPTSFn",function(){return p});var w=j("./src/polyfills/number.ts"),k=j("./src/demux/id3.ts"),S=j("./src/demux/dummy-demuxed-track.ts"),T=j("./src/utils/mp4-tools.ts"),C=j("./src/utils/typed-array.ts"),h=function(){function c(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var l=c.prototype;return l.resetInitSegment=function(u,s,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},l.resetTimeStamp=function(){},l.resetContiguity=function(){},l.canParse=function(u,s){return!1},l.appendFrame=function(u,s,f){},l.demux=function(u,s){this.cachedData&&(u=Object(T.appendUint8Array)(this.cachedData,u),this.cachedData=null);var f=k.getID3Data(u,0),i=f?f.length:0,n,t,d=this._audioTrack,v=this._id3Track,g=f?k.getTimeStamp(f):void 0,b=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=p(g,s)),f&&f.length>0&&v.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),t=this.initPTS;i<b;){if(this.canParse(u,i)){var _=this.appendFrame(d,u,i);_?(this.frameIndex++,t=_.sample.pts,i+=_.length,n=i):i=b}else k.canParse(u,i)?(f=k.getID3Data(u,i),v.samples.push({pts:t,dts:t,data:f}),i+=f.length,n=i):i++;if(i===b&&n!==b){var m=Object(C.sliceUint8)(u,n);this.cachedData?this.cachedData=Object(T.appendUint8Array)(this.cachedData,m):this.cachedData=m}}return{audioTrack:d,avcTrack:Object(S.dummyTrack)(),id3Track:v,textTrack:Object(S.dummyTrack)()}},l.demuxSampleAes=function(u,s,f){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},l.flush=function(u){var s=this.cachedData;return s&&(this.cachedData=null,this.demux(s,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(S.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(S.dummyTrack)()}},l.destroy=function(){},c}(),p=function(l,a){return Object(w.isFiniteNumber)(l)?l*90:a*9e4};ee.default=h},"./src/demux/chunk-cache.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return w});var w=function(){function S(){this.chunks=[],this.dataLength=0}var T=S.prototype;return T.push=function(h){this.chunks.push(h),this.dataLength+=h.length},T.flush=function(){var h=this.chunks,p=this.dataLength,c;if(h.length)h.length===1?c=h[0]:c=k(h,p);else return new Uint8Array(0);return this.reset(),c},T.reset=function(){this.chunks.length=0,this.dataLength=0},S}();function k(S,T){for(var C=new Uint8Array(T),h=0,p=0;p<S.length;p++){var c=S[p];C.set(c,h),h+=c.length}return C}},"./src/demux/dummy-demuxed-track.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"dummyTrack",function(){return w});function w(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/utils/logger.ts"),k=function(){function S(C){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=C,this.bytesAvailable=C.byteLength,this.word=0,this.bitsAvailable=0}var T=S.prototype;return T.loadWord=function(){var h=this.data,p=this.bytesAvailable,c=h.byteLength-p,l=new Uint8Array(4),a=Math.min(4,p);if(a===0)throw new Error("no bytes available");l.set(h.subarray(c,c+a)),this.word=new DataView(l.buffer).getUint32(0),this.bitsAvailable=a*8,this.bytesAvailable-=a},T.skipBits=function(h){var p;this.bitsAvailable>h?(this.word<<=h,this.bitsAvailable-=h):(h-=this.bitsAvailable,p=h>>3,h-=p>>3,this.bytesAvailable-=p,this.loadWord(),this.word<<=h,this.bitsAvailable-=h)},T.readBits=function(h){var p=Math.min(this.bitsAvailable,h),c=this.word>>>32-p;return h>32&&w.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=h-p,p>0&&this.bitsAvailable?c<<p|this.readBits(p):c},T.skipLZ=function(){var h;for(h=0;h<this.bitsAvailable;++h)if((this.word&2147483648>>>h)!==0)return this.word<<=h,this.bitsAvailable-=h,h;return this.loadWord(),h+this.skipLZ()},T.skipUEG=function(){this.skipBits(1+this.skipLZ())},T.skipEG=function(){this.skipBits(1+this.skipLZ())},T.readUEG=function(){var h=this.skipLZ();return this.readBits(h+1)-1},T.readEG=function(){var h=this.readUEG();return 1&h?1+h>>>1:-1*(h>>>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(h){for(var p=8,c=8,l,a=0;a<h;a++)c!==0&&(l=this.readEG(),c=(p+l+256)%256),p=c===0?p:c},T.readSPS=function(){var h=0,p=0,c=0,l=0,a,u,s,f=this.readUByte.bind(this),i=this.readBits.bind(this),n=this.readUEG.bind(this),t=this.readBoolean.bind(this),d=this.skipBits.bind(this),v=this.skipEG.bind(this),g=this.skipUEG.bind(this),b=this.skipScalingList.bind(this);f();var _=f();if(i(5),d(3),f(),g(),_===100||_===110||_===122||_===244||_===44||_===83||_===86||_===118||_===128){var m=n();if(m===3&&d(1),g(),g(),d(1),t())for(u=m!==3?8:12,s=0;s<u;s++)t()&&(s<6?b(16):b(64))}g();var y=n();if(y===0)n();else if(y===1)for(d(1),v(),v(),a=n(),s=0;s<a;s++)v();g(),d(1);var E=n(),o=n(),x=i(1);x===0&&d(1),d(1),t()&&(h=n(),p=n(),c=n(),l=n());var A=[1,1];if(t()&&t()){var O=f();switch(O){case 1:A=[1,1];break;case 2:A=[12,11];break;case 3:A=[10,11];break;case 4:A=[16,11];break;case 5:A=[40,33];break;case 6:A=[24,11];break;case 7:A=[20,11];break;case 8:A=[32,11];break;case 9:A=[80,33];break;case 10:A=[18,11];break;case 11:A=[15,11];break;case 12:A=[64,33];break;case 13:A=[160,99];break;case 14:A=[4,3];break;case 15:A=[3,2];break;case 16:A=[2,1];break;case 255:{A=[f()<<8|f(),f()<<8|f()];break}}}return{width:Math.ceil((E+1)*16-h*2-p*2),height:(2-x)*(o+1)*16-(x?2:4)*(c+l),pixelRatio:A}},T.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},S}();ee.default=k},"./src/demux/id3.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"isHeader",function(){return w}),j.d(ee,"isFooter",function(){return k}),j.d(ee,"getID3Data",function(){return S}),j.d(ee,"canParse",function(){return C}),j.d(ee,"getTimeStamp",function(){return h}),j.d(ee,"isTimeStampFrame",function(){return p}),j.d(ee,"getID3Frames",function(){return l}),j.d(ee,"decodeFrame",function(){return a}),j.d(ee,"utf8ArrayToStr",function(){return n}),j.d(ee,"testables",function(){return t});var w=function(b,_){return _+10<=b.length&&(b[_]===73&&b[_+1]===68&&b[_+2]===51&&(b[_+3]<255&&b[_+4]<255&&(b[_+6]<128&&b[_+7]<128&&b[_+8]<128&&b[_+9]<128)))},k=function(b,_){return _+10<=b.length&&(b[_]===51&&b[_+1]===68&&b[_+2]===73&&(b[_+3]<255&&b[_+4]<255&&(b[_+6]<128&&b[_+7]<128&&b[_+8]<128&&b[_+9]<128)))},S=function(b,_){for(var m=_,y=0;w(b,_);){y+=10;var E=T(b,_+6);y+=E,k(b,_+10)&&(y+=10),_+=y}return y>0?b.subarray(m,m+y):void 0},T=function(b,_){var m=0;return m=(b[_]&127)<<21,m|=(b[_+1]&127)<<14,m|=(b[_+2]&127)<<7,m|=b[_+3]&127,m},C=function(b,_){return w(b,_)&&T(b,_+6)+10<=b.length-_},h=function(b){for(var _=l(b),m=0;m<_.length;m++){var y=_[m];if(p(y))return i(y)}return},p=function(b){return b&&b.key==="PRIV"&&b.info==="com.apple.streaming.transportStreamTimestamp"},c=function(b){var _=String.fromCharCode(b[0],b[1],b[2],b[3]),m=T(b,4),y=10;return{type:_,size:m,data:b.subarray(y,y+m)}},l=function(b){for(var _=0,m=[];w(b,_);){var y=T(b,_+6);_+=10;for(var E=_+y;_+8<E;){var o=c(b.subarray(_)),x=a(o);x&&m.push(x),_+=o.size+10}k(b,_)&&(_+=10)}return m},a=function(b){return b.type==="PRIV"?u(b):b.type[0]==="W"?f(b):s(b)},u=function(b){if(b.size<2)return;var _=n(b.data,!0),m=new Uint8Array(b.data.subarray(_.length+1));return{key:b.type,info:_,data:m.buffer}},s=function(b){if(b.size<2)return;if(b.type==="TXXX"){var _=1,m=n(b.data.subarray(_),!0);_+=m.length+1;var y=n(b.data.subarray(_));return{key:b.type,info:m,data:y}}var E=n(b.data.subarray(1));return{key:b.type,data:E}},f=function(b){if(b.type==="WXXX"){if(b.size<2)return;var _=1,m=n(b.data.subarray(_),!0);_+=m.length+1;var y=n(b.data.subarray(_));return{key:b.type,info:m,data:y}}var E=n(b.data);return{key:b.type,data:E}},i=function(b){if(b.data.byteLength===8){var _=new Uint8Array(b.data),m=_[3]&1,y=(_[4]<<23)+(_[5]<<15)+(_[6]<<7)+_[7];return y/=45,m&&(y+=4772185884e-2),Math.round(y)}return},n=function(b,_){_===void 0&&(_=!1);var m=v();if(m){var y=m.decode(b);if(_){var E=y.indexOf("\0");return E!==-1?y.substring(0,E):y}return y.replace(/\0/g,"")}for(var o=b.length,x,A,O,D="",N=0;N<o;){if(x=b[N++],x===0&&_)return D;if(x===0||x===3)continue;switch(x>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:D+=String.fromCharCode(x);break;case 12:case 13:A=b[N++],D+=String.fromCharCode((x&31)<<6|A&63);break;case 14:A=b[N++],O=b[N++],D+=String.fromCharCode((x&15)<<12|(A&63)<<6|(O&63)<<0);break;default:}}return D},t={decodeTextFrame:s},d;function v(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/demux/base-audio-demuxer.ts"),k=j("./src/demux/id3.ts"),S=j("./src/utils/logger.ts"),T=j("./src/demux/mpegaudio.ts");function C(c,l){c.prototype=Object.create(l.prototype),c.prototype.constructor=c,h(c,l)}function h(c,l){return h=Object.setPrototypeOf||function(u,s){return u.__proto__=s,u},h(c,l)}var p=function(c){C(l,c);function l(){return c.apply(this,arguments)||this}var a=l.prototype;return a.resetInitSegment=function(s,f,i){c.prototype.resetInitSegment.call(this,s,f,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},l.probe=function(s){if(!s)return!1;for(var f=k.getID3Data(s,0)||[],i=f.length,n=s.length;i<n;i++)if(T.probe(s,i))return S.logger.log("MPEG Audio sync word found !"),!0;return!1},a.canParse=function(s,f){return T.canParse(s,f)},a.appendFrame=function(s,f,i){return this.initPTS===null?void 0:T.appendFrame(s,f,i,this.initPTS,this.frameIndex)},l}(w.default);p.minProbeByteLength=4,ee.default=p},"./src/demux/mp4demuxer.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/utils/mp4-tools.ts"),k=j("./src/demux/dummy-demuxed-track.ts"),S=function(){function T(h,p){this.remainderData=null,this.config=void 0,this.config=p}var C=T.prototype;return C.resetTimeStamp=function(){},C.resetInitSegment=function(){},C.resetContiguity=function(){},T.probe=function(p){return Object(w.findBox)({data:p,start:0,end:Math.min(p.length,16384)},["moof"]).length>0},C.demux=function(p){var c=p,l=Object(k.dummyTrack)();if(this.config.progressive){this.remainderData&&(c=Object(w.appendUint8Array)(this.remainderData,p));var a=Object(w.segmentValidRange)(c);this.remainderData=a.remainder,l.samples=a.valid||new Uint8Array}else l.samples=c;return{audioTrack:Object(k.dummyTrack)(),avcTrack:l,id3Track:Object(k.dummyTrack)(),textTrack:Object(k.dummyTrack)()}},C.flush=function(){var p=Object(k.dummyTrack)();return p.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(k.dummyTrack)(),avcTrack:p,id3Track:Object(k.dummyTrack)(),textTrack:Object(k.dummyTrack)()}},C.demuxSampleAes=function(p,c,l){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},C.destroy=function(){},T}();S.minProbeByteLength=1024,ee.default=S},"./src/demux/mpegaudio.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"appendFrame",function(){return h}),j.d(ee,"parseHeader",function(){return p}),j.d(ee,"isHeaderPattern",function(){return c}),j.d(ee,"isHeader",function(){return l}),j.d(ee,"canParse",function(){return a}),j.d(ee,"probe",function(){return u});var w=null,k=[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],S=[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]],C=[0,1,1,4];function h(s,f,i,n,t){if(i+24>f.length)return;var d=p(f,i);if(d&&i+d.frameLength<=f.length){var v=d.samplesPerFrame*9e4/d.sampleRate,g=n+t*v,b={unit:f.subarray(i,i+d.frameLength),pts:g,dts:g};return s.config=[],s.channelCount=d.channelCount,s.samplerate=d.sampleRate,s.samples.push(b),{sample:b,length:d.frameLength,missing:0}}}function p(s,f){var i=s[f+1]>>3&3,n=s[f+1]>>1&3,t=s[f+2]>>4&15,d=s[f+2]>>2&3;if(i!==1&&t!==0&&t!==15&&d!==3){var v=s[f+2]>>1&1,g=s[f+3]>>6,b=i===3?3-n:n===3?3:4,_=k[b*14+t-1]*1e3,m=i===3?0:i===2?1:2,y=S[m*3+d],E=g===3?1:2,o=T[i][n],x=C[n],A=o*8*x,O=Math.floor(o*_/y+v)*x;if(w===null){var D=navigator.userAgent||"",N=D.match(/Chrome\/(\d+)/i);w=N?parseInt(N[1]):0}var W=!!w&&w<=87;return W&&n===2&&_>=224e3&&g===0&&(s[f+3]=s[f+3]|128),{sampleRate:y,channelCount:E,frameLength:O,samplesPerFrame:A}}}function c(s,f){return s[f]===255&&(s[f+1]&224)===224&&(s[f+1]&6)!==0}function l(s,f){return f+1<s.length&&c(s,f)}function a(s,f){var i=4;return c(s,f)&&i<=s.length-f}function u(s,f){if(f+1<s.length&&c(s,f)){var i=4,n=p(s,f),t=i;n!=null&&n.frameLength&&(t=n.frameLength);var d=f+t;return d===s.length||l(s,d)}return!1}},"./src/demux/sample-aes.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/crypt/decrypter.ts"),k=j("./src/demux/tsdemuxer.ts"),S=function(){function T(h,p,c){this.keyData=void 0,this.decrypter=void 0,this.keyData=c,this.decrypter=new w.default(h,p,{removePKCS7Padding:!1})}var C=T.prototype;return C.decryptBuffer=function(p,c){this.decrypter.decrypt(p,this.keyData.key.buffer,this.keyData.iv.buffer,c)},C.decryptAacSample=function(p,c,l,a){var u=p[c].unit,s=u.subarray(16,u.length-u.length%16),f=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),i=this;this.decryptBuffer(f,function(n){var t=new Uint8Array(n);u.set(t,16),a||i.decryptAacSamples(p,c+1,l)})},C.decryptAacSamples=function(p,c,l){for(;;c++){if(c>=p.length){l();return}if(p[c].unit.length<32)continue;var a=this.decrypter.isSync();if(this.decryptAacSample(p,c,l,a),!a)return}},C.getAvcEncryptedData=function(p){for(var c=Math.floor((p.length-48)/160)*16+16,l=new Int8Array(c),a=0,u=32;u<=p.length-16;u+=160,a+=16)l.set(p.subarray(u,u+16),a);return l},C.getAvcDecryptedUnit=function(p,c){for(var l=new Uint8Array(c),a=0,u=32;u<=p.length-16;u+=160,a+=16)p.set(l.subarray(a,a+16),u);return p},C.decryptAvcSample=function(p,c,l,a,u,s){var f=Object(k.discardEPB)(u.data),i=this.getAvcEncryptedData(f),n=this;this.decryptBuffer(i.buffer,function(t){u.data=n.getAvcDecryptedUnit(f,t),s||n.decryptAvcSamples(p,c,l+1,a)})},C.decryptAvcSamples=function(p,c,l,a){if(p instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;c++,l=0){if(c>=p.length){a();return}for(var u=p[c].units;!(l>=u.length);l++){var s=u[l];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(p,c,l,a,s,f),!f)return}}},T}();ee.default=S},"./src/demux/transmuxer-interface.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return u});var w=j("./node_modules/webworkify-webpack/index.js"),k=j.n(w),S=j("./src/events.ts"),T=j("./src/demux/transmuxer.ts"),C=j("./src/utils/logger.ts"),h=j("./src/errors.ts"),p=j("./src/utils/mediasource-helper.ts"),c=j("./node_modules/eventemitter3/index.js"),l=j.n(c),a=Object(p.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function s(i,n,t,d){var v=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=i,this.id=n,this.onTransmuxComplete=t,this.onFlush=d;var g=i.config,b=function(o,x){x=x||{},x.frag=v.frag,x.id=v.id,i.trigger(o,x)};this.observer=new c.EventEmitter,this.observer.on(S.Events.FRAG_DECRYPTED,b),this.observer.on(S.Events.ERROR,b);var _={mp4:a.isTypeSupported("video/mp4"),mpeg:a.isTypeSupported("audio/mpeg"),mp3:a.isTypeSupported('audio/mp4; codecs="mp3"')},m=navigator.vendor;if(g.enableWorker&&typeof Worker!="undefined"){C.logger.log("demuxing in webworker");var y;try{y=this.worker=w("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(E){i.trigger(S.Events.ERROR,{type:h.ErrorTypes.OTHER_ERROR,details:h.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},y.postMessage({cmd:"init",typeSupported:_,vendor:m,id:n,config:JSON.stringify(g)})}catch(E){C.logger.warn("Error in worker:",E),C.logger.error("Error while initializing DemuxerWorker, fallback to inline"),y&&self.URL.revokeObjectURL(y.objectURL),this.transmuxer=new T.default(this.observer,_,g,m,n),this.worker=null}}else this.transmuxer=new T.default(this.observer,_,g,m,n)}var f=s.prototype;return f.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},f.push=function(n,t,d,v,g,b,_,m,y,E){var o=this;y.transmuxing.start=self.performance.now();var x=this.transmuxer,A=this.worker,O=b?b.start:g.start,D=g.decryptdata,N=this.frag,W=!(N&&g.cc===N.cc),K=!(N&&y.level===N.level),oe=N?y.sn-N.sn:-1,B=this.part?y.part-this.part.index:1,X=!K&&(oe===1||oe===0&&B===1),V=self.performance.now();(K||oe||g.stats.parsing.start===0)&&(g.stats.parsing.start=V),b&&(B||!X)&&(b.stats.parsing.start=V);var ne=new T.TransmuxState(W,X,m,K,O);if(!X||W){C.logger.log("[transmuxer-interface, "+g.type+"]: Starting new transmux session for sn: "+y.sn+" p: "+y.part+" level: "+y.level+" id: "+y.id+`
|
|
|
discontinuity: `+W+`
|
|
|
trackSwitch: `+K+`
|
|
|
contiguous: `+X+`
|
|
|
accurateTimeOffset: `+m+`
|
|
|
timeOffset: `+O);var $=new T.TransmuxConfig(d,v,t,_,E);this.configureTransmuxer($)}if(this.frag=g,this.part=b,A)A.postMessage({cmd:"demux",data:n,decryptdata:D,chunkMeta:y,state:ne},n instanceof ArrayBuffer?[n]:[]);else if(x){var Z=x.push(n,D,y,ne);Object(T.isPromise)(Z)?Z.then(function(ue){o.handleTransmuxComplete(ue)}):this.handleTransmuxComplete(Z)}},f.flush=function(n){var t=this;n.transmuxing.start=self.performance.now();var d=this.transmuxer,v=this.worker;if(v)v.postMessage({cmd:"flush",chunkMeta:n});else if(d){var g=d.flush(n);Object(T.isPromise)(g)?g.then(function(b){t.handleFlushResult(b,n)}):this.handleFlushResult(g,n)}},f.handleFlushResult=function(n,t){var d=this;n.forEach(function(v){d.handleTransmuxComplete(v)}),this.onFlush(t)},f.onWorkerMessage=function(n){var t=n.data,d=this.hls;switch(t.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,d.trigger(t.event,t.data);break}}},f.configureTransmuxer=function(n){var t=this.worker,d=this.transmuxer;t?t.postMessage({cmd:"configure",config:n}):d&&d.configure(n)},f.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},s}()},"./src/demux/transmuxer-worker.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return h});var w=j("./src/demux/transmuxer.ts"),k=j("./src/events.ts"),S=j("./src/utils/logger.ts"),T=j("./node_modules/eventemitter3/index.js"),C=j.n(T);function h(u){var s=new T.EventEmitter,f=function(n,t){u.postMessage({event:n,data:t})};s.on(k.Events.FRAG_DECRYPTED,f),s.on(k.Events.ERROR,f),u.addEventListener("message",function(i){var n=i.data;switch(n.cmd){case"init":{var t=JSON.parse(n.config);u.transmuxer=new w.default(s,n.typeSupported,t,n.vendor,n.id),Object(S.enableLogs)(t.debug),f("init",null);break}case"configure":{u.transmuxer.configure(n.config);break}case"demux":{var d=u.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(w.isPromise)(d)?d.then(function(b){p(u,b)}):p(u,d);break}case"flush":{var v=n.chunkMeta,g=u.transmuxer.flush(v);Object(w.isPromise)(g)?g.then(function(b){l(u,b,v)}):l(u,g,v);break}default:break}})}function p(u,s){if(a(s.remuxResult))return;var f=[],i=s.remuxResult,n=i.audio,t=i.video;n&&c(f,n),t&&c(f,t),u.postMessage({event:"transmuxComplete",data:s},f)}function c(u,s){s.data1&&u.push(s.data1.buffer),s.data2&&u.push(s.data2.buffer)}function l(u,s,f){s.forEach(function(i){p(u,i)}),u.postMessage({event:"flush",data:f})}function a(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return t}),j.d(ee,"isPromise",function(){return g}),j.d(ee,"TransmuxConfig",function(){return b}),j.d(ee,"TransmuxState",function(){return _});var w=j("./src/events.ts"),k=j("./src/errors.ts"),S=j("./src/crypt/decrypter.ts"),T=j("./src/demux/aacdemuxer.ts"),C=j("./src/demux/mp4demuxer.ts"),h=j("./src/demux/tsdemuxer.ts"),p=j("./src/demux/mp3demuxer.ts"),c=j("./src/remux/mp4-remuxer.ts"),l=j("./src/remux/passthrough-remuxer.ts"),a=j("./src/demux/chunk-cache.ts"),u=j("./src/utils/mp4-tools.ts"),s=j("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(m){s.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var i=[{demux:h.default,remux:c.default},{demux:C.default,remux:l.default},{demux:T.default,remux:c.default},{demux:p.default,remux:c.default}],n=1024;i.forEach(function(m){var y=m.demux;n=Math.max(n,y.minProbeByteLength)});var t=function(){function m(E,o,x,A,O){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 a.default,this.observer=E,this.typeSupported=o,this.config=x,this.vendor=A,this.id=O}var y=m.prototype;return y.configure=function(o){this.transmuxConfig=o,this.decrypter&&this.decrypter.reset()},y.push=function(o,x,A,O){var D=this,N=A.transmuxing;N.executeStart=f();var W=new Uint8Array(o),K=this.cache,oe=this.config,B=this.currentTransmuxState,X=this.transmuxConfig;O&&(this.currentTransmuxState=O);var V=d(W,x);if(V&&V.method==="AES-128"){var ne=this.getDecrypter();if(oe.enableSoftwareAES){var $=ne.softwareDecrypt(W,V.key.buffer,V.iv.buffer);if(!$)return N.executeEnd=f(),v(A);W=new Uint8Array($)}else return this.decryptionPromise=ne.webCryptoDecrypt(W,V.key.buffer,V.iv.buffer).then(function(We){var He=D.push(We,null,A);return D.decryptionPromise=null,He}),this.decryptionPromise}var Z=O||B,ue=Z.contiguous,he=Z.discontinuity,Oe=Z.trackSwitch,we=Z.accurateTimeOffset,Pe=Z.timeOffset,_e=X.audioCodec,xe=X.videoCodec,Ve=X.defaultInitPts,Ne=X.duration,Be=X.initSegmentData;if((he||Oe)&&this.resetInitSegment(Be,_e,xe,Ne),he&&this.resetInitialTimestamp(Ve),ue||this.resetContiguity(),this.needsProbing(W,he,Oe)){if(K.dataLength){var ze=K.flush();W=Object(u.appendUint8Array)(ze,W)}this.configureTransmuxer(W,X)}var ye=this.transmux(W,V,Pe,we,A),me=this.currentTransmuxState;return me.contiguous=!0,me.discontinuity=!1,me.trackSwitch=!1,N.executeEnd=f(),ye},y.flush=function(o){var x=this,A=o.transmuxing;A.executeStart=f();var O=this.decrypter,D=this.cache,N=this.currentTransmuxState,W=this.decryptionPromise;if(W)return W.then(function(){return x.flush(o)});var K=[],oe=N.timeOffset;if(O){var B=O.flush();B&&K.push(this.push(B,null,o))}var X=D.dataLength;D.reset();var V=this.demuxer,ne=this.remuxer;if(!V||!ne)return X>=n&&this.observer.emit(w.Events.ERROR,w.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),A.executeEnd=f(),[v(o)];var $=V.flush(oe);return g($)?$.then(function(Z){return x.flushRemux(K,Z,o),K}):(this.flushRemux(K,$,o),K)},y.flushRemux=function(o,x,A){var O=x.audioTrack,D=x.avcTrack,N=x.id3Track,W=x.textTrack,K=this.currentTransmuxState,oe=K.accurateTimeOffset,B=K.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+A.sn+(A.part>-1?" p: "+A.part:"")+" of level "+A.level);var X=this.remuxer.remux(O,D,N,W,B,oe,!0,this.id);o.push({remuxResult:X,chunkMeta:A}),A.transmuxing.executeEnd=f()},y.resetInitialTimestamp=function(o){var x=this.demuxer,A=this.remuxer;if(!x||!A)return;x.resetTimeStamp(o),A.resetTimeStamp(o)},y.resetContiguity=function(){var o=this.demuxer,x=this.remuxer;if(!o||!x)return;o.resetContiguity(),x.resetNextTimestamp()},y.resetInitSegment=function(o,x,A,O){var D=this.demuxer,N=this.remuxer;if(!D||!N)return;D.resetInitSegment(x,A,O),N.resetInitSegment(o,x,A)},y.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},y.transmux=function(o,x,A,O,D){var N;return x&&x.method==="SAMPLE-AES"?N=this.transmuxSampleAes(o,x,A,O,D):N=this.transmuxUnencrypted(o,A,O,D),N},y.transmuxUnencrypted=function(o,x,A,O){var D=this.demuxer.demux(o,x,!1,!this.config.progressive),N=D.audioTrack,W=D.avcTrack,K=D.id3Track,oe=D.textTrack,B=this.remuxer.remux(N,W,K,oe,x,A,!1,this.id);return{remuxResult:B,chunkMeta:O}},y.transmuxSampleAes=function(o,x,A,O,D){var N=this;return this.demuxer.demuxSampleAes(o,x,A).then(function(W){var K=N.remuxer.remux(W.audioTrack,W.avcTrack,W.id3Track,W.textTrack,A,O,!1,N.id);return{remuxResult:K,chunkMeta:D}})},y.configureTransmuxer=function(o,x){for(var A=this.config,O=this.observer,D=this.typeSupported,N=this.vendor,W=x.audioCodec,K=x.defaultInitPts,oe=x.duration,B=x.initSegmentData,X=x.videoCodec,V,ne=0,$=i.length;ne<$;ne++)if(i[ne].demux.probe(o)){V=i[ne];break}V||(s.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),V={demux:C.default,remux:l.default});var Z=this.demuxer,ue=this.remuxer,he=V.remux,Oe=V.demux;(!ue||!(ue instanceof he))&&(this.remuxer=new he(O,A,D,N)),(!Z||!(Z instanceof Oe))&&(this.demuxer=new Oe(O,A,D),this.probe=Oe.probe),this.resetInitSegment(B,W,X,oe),this.resetInitialTimestamp(K)},y.needsProbing=function(o,x,A){return!this.demuxer||!this.remuxer||x||A},y.getDecrypter=function(){var o=this.decrypter;return o||(o=this.decrypter=new S.default(this.observer,this.config)),o},m}();function d(m,y){var E=null;return m.byteLength>0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(E=y),E}var v=function(y){return{remuxResult:{},chunkMeta:y}};function g(m){return"then"in m&&m.then instanceof Function}var b=function(y,E,o,x,A){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=E,this.initSegmentData=o,this.duration=x,this.defaultInitPts=A},_=function(y,E,o,x,A){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=E,this.accurateTimeOffset=o,this.trackSwitch=x,this.timeOffset=A}},"./src/demux/tsdemuxer.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"discardEPB",function(){return v});var w=j("./src/demux/adts.ts"),k=j("./src/demux/mpegaudio.ts"),S=j("./src/demux/exp-golomb.ts"),T=j("./src/demux/id3.ts"),C=j("./src/demux/sample-aes.ts"),h=j("./src/events.ts"),p=j("./src/utils/mp4-tools.ts"),c=j("./src/utils/logger.ts"),l=j("./src/errors.ts"),a={video:1,audio:2,id3:3,text:4},u=function(){function g(_,m,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=_,this.config=m,this.typeSupported=y}g.probe=function(m){var y=g.syncOffset(m);return y<0?!1:(y&&c.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},g.syncOffset=function(m){for(var y=Math.min(1e3,m.length-3*188),E=0;E<y;){if(m[E]===71&&m[E+188]===71&&m[E+2*188]===71)return E;E++}return-1},g.createTrack=function(m,y){return{container:m==="video"||m==="audio"?"video/mp2t":void 0,type:m,id:a[m],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:m==="audio"?y:void 0}};var b=g.prototype;return b.resetInitSegment=function(m,y,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=g.createTrack("video",E),this._audioTrack=g.createTrack("audio",E),this._id3Track=g.createTrack("id3",E),this._txtTrack=g.createTrack("text",E),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=m,this.videoCodec=y,this._duration=E},b.resetTimeStamp=function(){},b.resetContiguity=function(){var m=this._audioTrack,y=this._avcTrack,E=this._id3Track;m&&(m.pesData=null),y&&(y.pesData=null),E&&(E.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},b.demux=function(m,y,E,o){E===void 0&&(E=!1),o===void 0&&(o=!1),E||(this.sampleAes=null);var x,A=this._avcTrack,O=this._audioTrack,D=this._id3Track,N=A.pid,W=A.pesData,K=O.pid,oe=D.pid,B=O.pesData,X=D.pesData,V=!1,ne=this.pmtParsed,$=this._pmtId,Z=m.length;if(this.remainderData&&(m=Object(p.appendUint8Array)(this.remainderData,m),Z=m.length,this.remainderData=null),Z<188&&!o)return this.remainderData=m,{audioTrack:O,avcTrack:A,id3Track:D,textTrack:this._txtTrack};var ue=Math.max(0,g.syncOffset(m));Z-=(Z+ue)%188,Z<m.byteLength&&!o&&(this.remainderData=new Uint8Array(m.buffer,Z,m.buffer.byteLength-Z));for(var he=ue;he<Z;he+=188)if(m[he]===71){var Oe=!!(m[he+1]&64),we=((m[he+1]&31)<<8)+m[he+2],Pe=(m[he+3]&48)>>4,_e=void 0;if(Pe>1){if(_e=he+5+m[he+4],_e===he+188)continue}else _e=he+4;switch(we){case N:Oe&&(W&&(x=n(W))&&this.parseAVCPES(x,!1),W={data:[],size:0}),W&&(W.data.push(m.subarray(_e,he+188)),W.size+=he+188-_e);break;case K:Oe&&(B&&(x=n(B))&&(O.isAAC?this.parseAACPES(x):this.parseMPEGPES(x)),B={data:[],size:0}),B&&(B.data.push(m.subarray(_e,he+188)),B.size+=he+188-_e);break;case oe:Oe&&(X&&(x=n(X))&&this.parseID3PES(x),X={data:[],size:0}),X&&(X.data.push(m.subarray(_e,he+188)),X.size+=he+188-_e);break;case 0:Oe&&(_e+=m[_e]+1),$=this._pmtId=f(m,_e);break;case $:{Oe&&(_e+=m[_e]+1);var xe=i(m,_e,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);N=xe.avc,N>0&&(A.pid=N),K=xe.audio,K>0&&(O.pid=K,O.isAAC=xe.isAAC),oe=xe.id3,oe>0&&(D.pid=oe),V&&!ne&&(c.logger.log("reparse from beginning"),V=!1,he=ue-188),ne=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(h.Events.ERROR,h.Events.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});A.pesData=W,O.pesData=B,D.pesData=X;var Ve={audioTrack:O,avcTrack:A,id3Track:D,textTrack:this._txtTrack};return o&&this.extractRemainingSamples(Ve),Ve},b.flush=function(){var m=this.remainderData;this.remainderData=null;var y;return m?y=this.demux(m,-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(m){var y=m.audioTrack,E=m.avcTrack,o=m.id3Track,x=E.pesData,A=y.pesData,O=o.pesData,D;x&&(D=n(x))?(this.parseAVCPES(D,!0),E.pesData=null):E.pesData=x,A&&(D=n(A))?(y.isAAC?this.parseAACPES(D):this.parseMPEGPES(D),y.pesData=null):(A!=null&&A.size&&c.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=A),O&&(D=n(O))?(this.parseID3PES(D),o.pesData=null):o.pesData=O},b.demuxSampleAes=function(m,y,E){var o=this.demux(m,E,!0,!this.config.progressive),x=this.sampleAes=new C.default(this.observer,this.config,y);return this.decrypt(o,x)},b.decrypt=function(m,y){return new Promise(function(E){var o=m.audioTrack,x=m.avcTrack;o.samples&&o.isAAC?y.decryptAacSamples(o.samples,0,function(){x.samples?y.decryptAvcSamples(x.samples,0,0,function(){E(m)}):E(m)}):x.samples&&y.decryptAvcSamples(x.samples,0,0,function(){E(m)})})},b.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},b.parseAVCPES=function(m,y){var E=this,o=this._avcTrack,x=this.parseAVCNALu(m.data),A=!1,O=this.avcSample,D,N=!1;m.data=null,O&&x.length&&!o.audFound&&(t(O,o),O=this.avcSample=s(!1,m.pts,m.dts,"")),x.forEach(function(W){switch(W.type){case 1:{D=!0,O||(O=E.avcSample=s(!0,m.pts,m.dts,"")),A&&(O.debug+="NDR "),O.frame=!0;var K=W.data;if(N&&K.length>4){var oe=new S.default(K).readSliceType();(oe===2||oe===4||oe===7||oe===9)&&(O.key=!0)}break}case 5:D=!0,O||(O=E.avcSample=s(!0,m.pts,m.dts,"")),A&&(O.debug+="IDR "),O.key=!0,O.frame=!0;break;case 6:{D=!0,A&&O&&(O.debug+="SEI ");var B=new S.default(v(W.data));B.readUByte();for(var X=0,V=0,ne=!1,$=0;!ne&&B.bytesAvailable>1;){X=0;do $=B.readUByte(),X+=$;while($===255);V=0;do $=B.readUByte(),V+=$;while($===255);if(X===4&&B.bytesAvailable!==0){ne=!0;var Z=B.readUByte();if(Z===181){var ue=B.readUShort();if(ue===49){var he=B.readUInt();if(he===1195456820){var Oe=B.readUByte();if(Oe===3){for(var we=B.readUByte(),Pe=B.readUByte(),_e=31&we,xe=[we,Pe],Ve=0;Ve<_e;Ve++)xe.push(B.readUByte()),xe.push(B.readUByte()),xe.push(B.readUByte());d(E._txtTrack.samples,{type:3,pts:m.pts,bytes:xe})}}}}}else if(X===5&&B.bytesAvailable!==0){if(ne=!0,V>16){for(var Ne=[],Be=0;Be<16;Be++)Ne.push(B.readUByte().toString(16)),(Be===3||Be===5||Be===7||Be===9)&&Ne.push("-");for(var ze=V-16,ye=new Uint8Array(ze),me=0;me<ze;me++)ye[me]=B.readUByte();d(E._txtTrack.samples,{pts:m.pts,payloadType:X,uuid:Ne.join(""),userData:Object(T.utf8ArrayToStr)(ye),userDataBytes:ye})}}else if(V<B.bytesAvailable)for(var We=0;We<V;We++)B.readUByte()}break}case 7:if(D=!0,N=!0,A&&O&&(O.debug+="SPS "),!o.sps){var He=new S.default(W.data),nt=He.readSPS();o.width=nt.width,o.height=nt.height,o.pixelRatio=nt.pixelRatio,o.sps=[W.data],o.duration=E._duration;for(var te=W.data.subarray(1,4),P="avc1.",U=0;U<3;U++){var q=te[U].toString(16);q.length<2&&(q="0"+q),P+=q}o.codec=P}break;case 8:D=!0,A&&O&&(O.debug+="PPS "),o.pps||(o.pps=[W.data]);break;case 9:D=!1,o.audFound=!0,O&&t(O,o),O=E.avcSample=s(!1,m.pts,m.dts,A?"AUD ":"");break;case 12:D=!1;break;default:D=!1,O&&(O.debug+="unknown NAL "+W.type+" ");break}if(O&&D){var Y=O.units;Y.push(W)}}),y&&O&&(t(O,o),this.avcSample=null)},b.getLastNalUnit=function(){var m,y=this.avcSample,E;if(!y||y.units.length===0){var o=this._avcTrack.samples;y=o[o.length-1]}if((m=y)!==null&&m!==void 0&&m.units){var x=y.units;E=x[x.length-1]}return E},b.parseAVCNALu=function(m){var y=m.byteLength,E=this._avcTrack,o=E.naluState||0,x=o,A=[],O=0,D,N,W,K=-1,oe=0;for(o===-1&&(K=0,oe=m[0]&31,o=0,O=1);O<y;){if(D=m[O++],!o){o=D?0:1;continue}if(o===1){o=D?0:2;continue}if(!D)o=3;else if(D===1){if(K>=0){var B={data:m.subarray(K,O-o-1),type:oe};A.push(B)}else{var X=this.getLastNalUnit();if(X&&(x&&O<=4-x&&(X.state&&(X.data=X.data.subarray(0,X.data.byteLength-x))),N=O-o-1,N>0)){var V=new Uint8Array(X.data.byteLength+N);V.set(X.data,0),V.set(m.subarray(0,N),X.data.byteLength),X.data=V,X.state=0}}O<y?(W=m[O]&31,K=O,oe=W,o=0):o=-1}else o=0}if(K>=0&&o>=0){var ne={data:m.subarray(K,y),type:oe,state:o};A.push(ne)}if(A.length===0){var $=this.getLastNalUnit();if($){var Z=new Uint8Array($.data.byteLength+m.byteLength);Z.set($.data,0),Z.set(m,$.data.byteLength),$.data=Z}}return E.naluState=o,A},b.parseAACPES=function(m){var y=0,E=this._audioTrack,o=this.aacOverFlow,x=m.data;if(o){this.aacOverFlow=null;var A=o.sample.unit.byteLength,O=Math.min(o.missing,A),D=A-O;o.sample.unit.set(x.subarray(0,O),D),E.samples.push(o.sample),y=o.missing}var N,W;for(N=y,W=x.length;N<W-1&&!w.isHeader(x,N);N++);if(N!==y){var K,oe;if(N<W-1?(K="AAC PES did not start with ADTS header,offset:"+N,oe=!1):(K="no ADTS header found in AAC PES",oe=!0),c.logger.warn("parsing error:"+K),this.observer.emit(h.Events.ERROR,h.Events.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:oe,reason:K}),oe)return}w.initTrackConfig(E,this.observer,x,N,this.audioCodec);var B;if(m.pts!==void 0)B=m.pts;else if(o){var X=w.getFrameDuration(E.samplerate);B=o.sample.pts+X}else{c.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var V=0;N<W;)if(w.isHeader(x,N)){if(N+5<W){var ne=w.appendFrame(E,x,N,B,V);if(ne)if(ne.missing)this.aacOverFlow=ne;else{N+=ne.length,V++;continue}}break}else N++},b.parseMPEGPES=function(m){var y=m.data,E=y.length,o=0,x=0,A=m.pts;if(A===void 0){c.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;x<E;)if(k.isHeader(y,x)){var O=k.appendFrame(this._audioTrack,y,x,A,o);if(O)x+=O.length,o++;else break}else x++},b.parseID3PES=function(m){if(m.pts===void 0){c.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(m)},g}();u.minProbeByteLength=188;function s(g,b,_,m){return{key:g,frame:!1,pts:b,dts:_,units:[],debug:m,length:0}}function f(g,b){return(g[b+10]&31)<<8|g[b+11]}function i(g,b,_,m){var y={audio:-1,avc:-1,id3:-1,isAAC:!0},E=(g[b+1]&15)<<8|g[b+2],o=b+3+E-4,x=(g[b+10]&15)<<8|g[b+11];for(b+=12+x;b<o;){var A=(g[b+1]&31)<<8|g[b+2];switch(g[b]){case 207:if(!m){c.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:y.audio===-1&&(y.audio=A);break;case 21:y.id3===-1&&(y.id3=A);break;case 219:if(!m){c.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:y.avc===-1&&(y.avc=A);break;case 3:case 4:_?y.audio===-1&&(y.audio=A,y.isAAC=!1):c.logger.log("MPEG audio found, not supported in this browser");break;case 36:c.logger.warn("Unsupported HEVC stream type found");break;default:break}b+=((g[b+3]&15)<<8|g[b+4])+5}return y}function n(g){var b=0,_,m,y,E,o,x=g.data;if(!g||g.size===0)return null;for(;x[0].length<19&&x.length>1;){var A=new Uint8Array(x[0].length+x[1].length);A.set(x[0]),A.set(x[1],x[0].length),x[0]=A,x.splice(1,1)}_=x[0];var O=(_[0]<<16)+(_[1]<<8)+_[2];if(O===1){if(m=(_[4]<<8)+_[5],m&&m>g.size-6)return null;var D=_[7];D&192&&(E=(_[9]&14)*536870912+(_[10]&255)*4194304+(_[11]&254)*16384+(_[12]&255)*128+(_[13]&254)/2,D&64?(o=(_[14]&14)*536870912+(_[15]&255)*4194304+(_[16]&254)*16384+(_[17]&255)*128+(_[18]&254)/2,E-o>60*9e4&&(c.logger.warn(Math.round((E-o)/9e4)+"s delta between PTS and DTS, align them"),E=o)):o=E),y=_[8];var N=y+9;if(g.size<=N)return null;g.size-=N;for(var W=new Uint8Array(g.size),K=0,oe=x.length;K<oe;K++){_=x[K];var B=_.byteLength;if(N)if(N>B){N-=B;continue}else _=_.subarray(N),B-=N,N=0;W.set(_,b),b+=B}return m&&(m-=y+3),{data:W,pts:E,dts:o,len:m}}return null}function t(g,b){if(g.units.length&&g.frame){if(g.pts===void 0){var _=b.samples,m=_.length;if(m){var y=_[m-1];g.pts=y.pts,g.dts=y.dts}else{b.dropped++;return}}b.samples.push(g)}g.debug.length&&c.logger.log(g.pts+"/"+g.dts+":"+g.debug)}function d(g,b){var _=g.length;if(_>0){if(b.pts>=g[_-1].pts)g.push(b);else for(var m=_-1;m>=0;m--)if(b.pts<g[m].pts){g.splice(m,0,b);break}}else g.push(b)}function v(g){for(var b=g.byteLength,_=[],m=1;m<b-2;)g[m]===0&&g[m+1]===0&&g[m+2]===3?(_.push(m+2),m+=2):m++;if(_.length===0)return g;var y=b-_.length,E=new Uint8Array(y),o=0;for(m=0;m<y;o++,m++)o===_[0]&&(o++,_.shift()),E[m]=g[o];return E}ee.default=u},"./src/errors.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"ErrorTypes",function(){return w}),j.d(ee,"ErrorDetails",function(){return k});var w;(function(S){S.NETWORK_ERROR="networkError",S.MEDIA_ERROR="mediaError",S.KEY_SYSTEM_ERROR="keySystemError",S.MUX_ERROR="muxError",S.OTHER_ERROR="otherError"})(w||(w={}));var k;(function(S){S.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",S.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",S.KEY_SYSTEM_NO_SESSION="keySystemNoSession",S.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",S.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",S.MANIFEST_LOAD_ERROR="manifestLoadError",S.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",S.MANIFEST_PARSING_ERROR="manifestParsingError",S.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",S.LEVEL_EMPTY_ERROR="levelEmptyError",S.LEVEL_LOAD_ERROR="levelLoadError",S.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",S.LEVEL_SWITCH_ERROR="levelSwitchError",S.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",S.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",S.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",S.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",S.FRAG_LOAD_ERROR="fragLoadError",S.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",S.FRAG_DECRYPT_ERROR="fragDecryptError",S.FRAG_PARSING_ERROR="fragParsingError",S.REMUX_ALLOC_ERROR="remuxAllocError",S.KEY_LOAD_ERROR="keyLoadError",S.KEY_LOAD_TIMEOUT="keyLoadTimeOut",S.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",S.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",S.BUFFER_APPEND_ERROR="bufferAppendError",S.BUFFER_APPENDING_ERROR="bufferAppendingError",S.BUFFER_STALLED_ERROR="bufferStalledError",S.BUFFER_FULL_ERROR="bufferFullError",S.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",S.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",S.INTERNAL_EXCEPTION="internalException",S.INTERNAL_ABORTED="aborted",S.UNKNOWN="unknown"})(k||(k={}))},"./src/events.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"Events",function(){return w});var w;(function(k){k.MEDIA_ATTACHING="hlsMediaAttaching",k.MEDIA_ATTACHED="hlsMediaAttached",k.MEDIA_DETACHING="hlsMediaDetaching",k.MEDIA_DETACHED="hlsMediaDetached",k.BUFFER_RESET="hlsBufferReset",k.BUFFER_CODECS="hlsBufferCodecs",k.BUFFER_CREATED="hlsBufferCreated",k.BUFFER_APPENDING="hlsBufferAppending",k.BUFFER_APPENDED="hlsBufferAppended",k.BUFFER_EOS="hlsBufferEos",k.BUFFER_FLUSHING="hlsBufferFlushing",k.BUFFER_FLUSHED="hlsBufferFlushed",k.MANIFEST_LOADING="hlsManifestLoading",k.MANIFEST_LOADED="hlsManifestLoaded",k.MANIFEST_PARSED="hlsManifestParsed",k.LEVEL_SWITCHING="hlsLevelSwitching",k.LEVEL_SWITCHED="hlsLevelSwitched",k.LEVEL_LOADING="hlsLevelLoading",k.LEVEL_LOADED="hlsLevelLoaded",k.LEVEL_UPDATED="hlsLevelUpdated",k.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",k.LEVELS_UPDATED="hlsLevelsUpdated",k.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",k.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",k.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",k.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",k.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",k.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",k.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",k.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",k.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",k.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",k.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",k.CUES_PARSED="hlsCuesParsed",k.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",k.INIT_PTS_FOUND="hlsInitPtsFound",k.FRAG_LOADING="hlsFragLoading",k.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",k.FRAG_LOADED="hlsFragLoaded",k.FRAG_DECRYPTED="hlsFragDecrypted",k.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",k.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",k.FRAG_PARSING_METADATA="hlsFragParsingMetadata",k.FRAG_PARSED="hlsFragParsed",k.FRAG_BUFFERED="hlsFragBuffered",k.FRAG_CHANGED="hlsFragChanged",k.FPS_DROP="hlsFpsDrop",k.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",k.ERROR="hlsError",k.DESTROYING="hlsDestroying",k.KEY_LOADING="hlsKeyLoading",k.KEY_LOADED="hlsKeyLoaded",k.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",k.BACK_BUFFER_REACHED="hlsBackBufferReached"})(w||(w={}))},"./src/hls.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return g});var w=j("./node_modules/url-toolkit/src/url-toolkit.js"),k=j.n(w),S=j("./src/loader/playlist-loader.ts"),T=j("./src/loader/key-loader.ts"),C=j("./src/controller/id3-track-controller.ts"),h=j("./src/controller/latency-controller.ts"),p=j("./src/controller/level-controller.ts"),c=j("./src/controller/fragment-tracker.ts"),l=j("./src/controller/stream-controller.ts"),a=j("./src/is-supported.ts"),u=j("./src/utils/logger.ts"),s=j("./src/config.ts"),f=j("./node_modules/eventemitter3/index.js"),i=j.n(f),n=j("./src/events.ts"),t=j("./src/errors.ts");function d(b,_){for(var m=0;m<_.length;m++){var y=_[m];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,y.key,y)}}function v(b,_,m){return _&&d(b.prototype,_),m&&d(b,m),b}var g=function(){b.isSupported=function(){return Object(a.isSupported)()};function b(m){m===void 0&&(m={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new f.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,m);this.userConfig=m,Object(u.enableLogs)(y.debug),this._autoLevelCapping=-1,y.progressive&&Object(s.enableStreamingMode)(y);var E=y.abrController,o=y.bufferController,x=y.capLevelController,A=y.fpsController,O=this.abrController=new E(this),D=this.bufferController=new o(this),N=this.capLevelController=new x(this),W=new A(this),K=new S.default(this),oe=new T.default(this),B=new C.default(this),X=this.levelController=new p.default(this),V=new c.FragmentTracker(this),ne=this.streamController=new l.default(this,V);N.setStreamController(ne),W.setStreamController(ne);var $=[X,ne];this.networkControllers=$;var Z=[K,oe,O,D,N,W,B,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,Z),this.emeController=this.createController(y.emeController,null,Z),this.cmcdController=this.createController(y.cmcdController,null,Z),this.latencyController=this.createController(h.default,null,Z),this.coreComponents=Z}var _=b.prototype;return _.createController=function(y,E,o){if(y){var x=E?new y(this,E):new y(this);return o&&o.push(x),x}return null},_.on=function(y,E,o){o===void 0&&(o=this),this._emitter.on(y,E,o)},_.once=function(y,E,o){o===void 0&&(o=this),this._emitter.once(y,E,o)},_.removeAllListeners=function(y){this._emitter.removeAllListeners(y)},_.off=function(y,E,o,x){o===void 0&&(o=this),this._emitter.off(y,E,o,x)},_.listeners=function(y){return this._emitter.listeners(y)},_.emit=function(y,E,o){return this._emitter.emit(y,E,o)},_.trigger=function(y,E){if(this.config.debug)return this.emit(y,y,E);try{return this.emit(y,y,E)}catch(o){u.logger.error("An internal error happened while handling event "+y+'. Error message: "'+o.message+'". Here is a stacktrace:',o),this.trigger(n.Events.ERROR,{type:t.ErrorTypes.OTHER_ERROR,details:t.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:y,error:o})}return!1},_.listenerCount=function(y){return this._emitter.listenerCount(y)},_.destroy=function(){u.logger.log("destroy"),this.trigger(n.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},_.attachMedia=function(y){u.logger.log("attachMedia"),this._media=y,this.trigger(n.Events.MEDIA_ATTACHING,{media:y})},_.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(n.Events.MEDIA_DETACHING,void 0),this._media=null},_.loadSource=function(y){this.stopLoad();var E=this.media,o=this.url,x=this.url=w.buildAbsoluteURL(self.location.href,y,{alwaysNormalize:!0});u.logger.log("loadSource:"+x),E&&o&&o!==x&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),this.trigger(n.Events.MANIFEST_LOADING,{url:y})},_.startLoad=function(y){y===void 0&&(y=-1),u.logger.log("startLoad("+y+")"),this.networkControllers.forEach(function(E){E.startLoad(y)})},_.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(y){y.stopLoad()})},_.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},_.recoverMediaError=function(){u.logger.log("recoverMediaError");var y=this._media;this.detachMedia(),y&&this.attachMedia(y)},_.removeLevel=function(y,E){E===void 0&&(E=0),this.levelController.removeLevel(y,E)},v(b,[{key:"levels",get:function(){var y=this.levelController.levels;return y||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(y){u.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){u.logger.log("set nextLevel:"+y),this.levelController.manualLevel=y,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(y){u.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){u.logger.log("set firstLevel:"+y),this.levelController.firstLevel=y}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(y){u.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 E=!!y;E!==this.config.capLevelToPlayerSize&&(E?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=E)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(y){this._autoLevelCapping!==y&&(u.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,E=this.config.minAutoBitrate;if(!y)return 0;for(var o=y.length,x=0;x<o;x++)if(y[x].maxBitrate>E)return x;return 0}},{key:"maxAutoLevel",get:function(){var y=this.levels,E=this.autoLevelCapping,o;return E===-1&&y&&y.length?o=y.length-1:o=E,o}},{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 E=this.audioTrackController;E&&(E.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 E=this.subtitleTrackController;E&&(E.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 E=this.subtitleTrackController;E&&(E.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 n.Events}},{key:"ErrorTypes",get:function(){return t.ErrorTypes}},{key:"ErrorDetails",get:function(){return t.ErrorDetails}},{key:"DefaultConfig",get:function(){return b.defaultConfig?b.defaultConfig:s.hlsDefaultConfig},set:function(y){b.defaultConfig=y}}]),b}();g.defaultConfig=void 0},"./src/is-supported.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"isSupported",function(){return S}),j.d(ee,"changeTypeSupported",function(){return T});var w=j("./src/utils/mediasource-helper.ts");function k(){return self.SourceBuffer||self.WebKitSourceBuffer}function S(){var C=Object(w.getMediaSource)();if(!C)return!1;var h=k(),p=C&&typeof C.isTypeSupported=="function"&&C.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),c=!h||h.prototype&&typeof h.prototype.appendBuffer=="function"&&typeof h.prototype.remove=="function";return!!p&&!!c}function T(){var C,h=k();return typeof(h==null||((C=h.prototype)===null||C===void 0)?void 0:C.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return u}),j.d(ee,"LoadError",function(){return f});var w=j("./src/polyfills/number.ts"),k=j("./src/errors.ts");function S(i,n){i.prototype=Object.create(n.prototype),i.prototype.constructor=i,c(i,n)}function T(i){var n=typeof Map=="function"?new Map:void 0;return T=function(d){if(d===null||!p(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(d))return n.get(d);n.set(d,v)}function v(){return C(d,arguments,l(this).constructor)}return v.prototype=Object.create(d.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),c(v,d)},T(i)}function C(i,n,t){return h()?C=Reflect.construct:C=function(v,g,b){var _=[null];_.push.apply(_,g);var m=Function.bind.apply(v,_),y=new m;return b&&c(y,b.prototype),y},C.apply(null,arguments)}function h(){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(i){return!1}}function p(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function c(i,n){return c=Object.setPrototypeOf||function(d,v){return d.__proto__=v,d},c(i,n)}function l(i){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},l(i)}var a=Math.pow(2,17),u=function(){function i(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var n=i.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(d,v){var g=this,b=d.url;if(!b)return Promise.reject(new f({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(b?"part list":"url")));this.abort();var _=this.config,m=_.fLoader,y=_.loader;return new Promise(function(E,o){g.loader&&g.loader.destroy();var x=g.loader=d.loader=m?new m(_):new y(_),A=s(d),O={timeout:_.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:_.fragLoadingMaxRetryTimeout,highWaterMark:a};d.stats=x.stats,x.load(A,O,{onSuccess:function(N,W,K,oe){g.resetLoader(d,x),E({frag:d,part:null,payload:N.data,networkDetails:oe})},onError:function(N,W,K){g.resetLoader(d,x),o(new f({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:N,networkDetails:K}))},onAbort:function(N,W,K){g.resetLoader(d,x),o(new f({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:K}))},onTimeout:function(N,W,K){g.resetLoader(d,x),o(new f({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:K}))},onProgress:function(N,W,K,oe){v&&v({frag:d,part:null,payload:K,networkDetails:oe})}})})},n.loadPart=function(d,v,g){var b=this;this.abort();var _=this.config,m=_.fLoader,y=_.loader;return new Promise(function(E,o){b.loader&&b.loader.destroy();var x=b.loader=d.loader=m?new m(_):new y(_),A=s(d,v),O={timeout:_.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:_.fragLoadingMaxRetryTimeout,highWaterMark:a};v.stats=x.stats,x.load(A,O,{onSuccess:function(N,W,K,oe){b.resetLoader(d,x),b.updateStatsFromPart(d,v);var B={frag:d,part:v,payload:N.data,networkDetails:oe};g(B),E(B)},onError:function(N,W,K){b.resetLoader(d,x),o(new f({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:v,response:N,networkDetails:K}))},onAbort:function(N,W,K){d.stats.aborted=v.stats.aborted,b.resetLoader(d,x),o(new f({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:v,networkDetails:K}))},onTimeout:function(N,W,K){b.resetLoader(d,x),o(new f({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:v,networkDetails:K}))}})})},n.updateStatsFromPart=function(d,v){var g=d.stats,b=v.stats,_=b.total;if(g.loaded+=b.loaded,_){var m=Math.round(d.duration/v.duration),y=Math.min(Math.round(g.loaded/_),m),E=m-y,o=E*Math.round(g.loaded/y);g.total=g.loaded+o}else g.total=Math.max(g.loaded,g.total);var x=g.loading,A=b.loading;x.start?x.first+=A.first-A.start:(x.start=A.start,x.first=A.first),x.end=A.end},n.resetLoader=function(d,v){d.loader=null,this.loader===v&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),v.destroy()},i}();function s(i,n){n===void 0&&(n=null);var t=n||i,d={frag:i,part:n,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},v=t.byteRangeStartOffset,g=t.byteRangeEndOffset;return Object(w.isFiniteNumber)(v)&&Object(w.isFiniteNumber)(g)&&(d.rangeStart=v,d.rangeEnd=g),d}var f=function(i){S(n,i);function n(t){for(var d,v=arguments.length,g=new Array(v>1?v-1:0),b=1;b<v;b++)g[b-1]=arguments[b];return d=i.call.apply(i,[this].concat(g))||this,d.data=void 0,d.data=t,d}return n}(T(Error))},"./src/loader/fragment.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"ElementaryStreamTypes",function(){return u}),j.d(ee,"BaseSegment",function(){return s}),j.d(ee,"Fragment",function(){return f}),j.d(ee,"Part",function(){return i});var w=j("./src/polyfills/number.ts"),k=j("./node_modules/url-toolkit/src/url-toolkit.js"),S=j.n(k),T=j("./src/utils/logger.ts"),C=j("./src/loader/level-key.ts"),h=j("./src/loader/load-stats.ts");function p(n,t){n.prototype=Object.create(t.prototype),n.prototype.constructor=n,c(n,t)}function c(n,t){return c=Object.setPrototypeOf||function(v,g){return v.__proto__=g,v},c(n,t)}function l(n,t){for(var d=0;d<t.length;d++){var v=t[d];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(n,v.key,v)}}function a(n,t,d){return t&&l(n.prototype,t),d&&l(n,d),n}var u;(function(n){n.AUDIO="audio",n.VIDEO="video",n.AUDIOVIDEO="audiovideo"})(u||(u={}));var s=function(){function n(d){var v;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(v={},v[u.AUDIO]=null,v[u.VIDEO]=null,v[u.AUDIOVIDEO]=null,v),this.baseurl=d}var t=n.prototype;return t.setByteRange=function(v,g){var b=v.split("@",2),_=[];b.length===1?_[0]=g?g.byteRangeEndOffset:0:_[0]=parseInt(b[1]),_[1]=parseInt(b[0])+_[0],this._byteRange=_},a(n,[{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(k.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(v){this._url=v}}]),n}(),f=function(n){p(t,n);function t(v,g){var b;return b=n.call(this,g)||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 h.LoadStats,b.urlId=0,b.data=void 0,b.bitrateTest=!1,b.title=null,b.initSegment=null,b.type=v,b}var d=t.prototype;return d.createInitializationVector=function(g){for(var b=new Uint8Array(16),_=12;_<16;_++)b[_]=g>>8*(15-_)&255;return b},d.setDecryptDataFromLevelKey=function(g,b){var _=g;return(g==null?void 0:g.method)==="AES-128"&&g.uri&&!g.iv&&(_=C.LevelKey.fromURI(g.uri),_.method=g.method,_.iv=this.createInitializationVector(b),_.keyFormat="identity"),_},d.setElementaryStreamInfo=function(g,b,_,m,y,E){E===void 0&&(E=!1);var o=this.elementaryStreams,x=o[g];if(!x){o[g]={startPTS:b,endPTS:_,startDTS:m,endDTS:y,partial:E};return}x.startPTS=Math.min(x.startPTS,b),x.endPTS=Math.max(x.endPTS,_),x.startDTS=Math.min(x.startDTS,m),x.endDTS=Math.max(x.endDTS,y)},d.clearElementaryStreamInfo=function(){var g=this.elementaryStreams;g[u.AUDIO]=null,g[u.VIDEO]=null,g[u.AUDIOVIDEO]=null},a(t,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var g=this.sn;typeof g!="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'),g=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,g)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(w.isFiniteNumber)(this.programDateTime))return null;var g=Object(w.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+g*1e3}},{key:"encrypted",get:function(){var g;return!!((g=this.decryptdata)!==null&&g!==void 0&&g.keyFormat&&this.decryptdata.uri)}}]),t}(s),i=function(n){p(t,n);function t(d,v,g,b,_){var m;m=n.call(this,g)||this,m.fragOffset=0,m.duration=0,m.gap=!1,m.independent=!1,m.relurl=void 0,m.fragment=void 0,m.index=void 0,m.stats=new h.LoadStats,m.duration=d.decimalFloatingPoint("DURATION"),m.gap=d.bool("GAP"),m.independent=d.bool("INDEPENDENT"),m.relurl=d.enumeratedString("URI"),m.fragment=v,m.index=b;var y=d.enumeratedString("BYTERANGE");return y&&m.setByteRange(y,_),_&&(m.fragOffset=_.fragOffset+_.duration),m}return a(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var v=this.elementaryStreams;return!!(v.audio||v.video||v.audiovideo)}}]),t}(s)},"./src/loader/key-loader.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return T});var w=j("./src/events.ts"),k=j("./src/errors.ts"),S=j("./src/utils/logger.ts"),T=function(){function C(p){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=p,this._registerListeners()}var h=C.prototype;return h._registerListeners=function(){this.hls.on(w.Events.KEY_LOADING,this.onKeyLoading,this)},h._unregisterListeners=function(){this.hls.off(w.Events.KEY_LOADING,this.onKeyLoading)},h.destroy=function(){this._unregisterListeners();for(var c in this.loaders){var l=this.loaders[c];l&&l.destroy()}this.loaders={}},h.onKeyLoading=function(c,l){var a=l.frag,u=a.type,s=this.loaders[u];if(!a.decryptdata){S.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=a.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(s&&(S.logger.warn("abort previous key loader for type:"+u),s.abort()),!f){S.logger.warn("key uri is falsy");return}var n=i.loader,t=a.loader=this.loaders[u]=new n(i);this.decrypturl=f,this.decryptkey=null;var d={url:f,frag:a,responseType:"arraybuffer"},v={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};t.load(d,v,g)}else this.decryptkey&&(a.decryptdata.key=this.decryptkey,this.hls.trigger(w.Events.KEY_LOADED,{frag:a}))},h.loadsuccess=function(c,l,a){var u=a.frag;if(!u.decryptdata){S.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(c.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(w.Events.KEY_LOADED,{frag:u})},h.loaderror=function(c,l){var a=l.frag,u=a.loader;u&&u.abort(),delete this.loaders[a.type],this.hls.trigger(w.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:a,response:c})},h.loadtimeout=function(c,l){var a=l.frag,u=a.loader;u&&u.abort(),delete this.loaders[a.type],this.hls.trigger(w.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:a})},C}()},"./src/loader/level-details.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"LevelDetails",function(){return C});var w=j("./src/polyfills/number.ts");function k(h,p){for(var c=0;c<p.length;c++){var l=p[c];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function S(h,p,c){return p&&k(h.prototype,p),c&&k(h,c),h}var T=10,C=function(){function h(c){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=c}var p=h.prototype;return p.reloaded=function(l){if(!l){this.advanced=!0,this.updated=!0;return}var a=this.lastPartSn-l.lastPartSn,u=this.lastPartIndex-l.lastPartIndex;this.updated=this.endSN!==l.endSN||!!u||!!a,this.advanced=this.endSN>l.endSN||a>0||a===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(l.misses*.6):this.misses=l.misses+1,this.availabilityDelay=l.availabilityDelay},S(h,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(w.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||T}},{key:"drift",get:function(){var l=this.driftEndTime-this.driftStartTime;if(l>0){var a=this.driftEnd-this.driftStart;return a*1e3/l}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var l;return(l=this.partList)!==null&&l!==void 0&&l.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var l;return(l=this.fragments)!==null&&l!==void 0&&l.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 l;return(l=this.partList)!==null&&l!==void 0&&l.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var l;return(l=this.partList)!==null&&l!==void 0&&l.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),h}()},"./src/loader/level-key.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"LevelKey",function(){return C});var w=j("./node_modules/url-toolkit/src/url-toolkit.js"),k=j.n(w);function S(h,p){for(var c=0;c<p.length;c++){var l=p[c];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function T(h,p,c){return p&&S(h.prototype,p),c&&S(h,c),h}var C=function(){h.fromURL=function(c,l){return new h(c,l)},h.fromURI=function(c){return new h(c)};function h(p,c){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,c?this._uri=Object(w.buildAbsoluteURL)(p,c,{alwaysNormalize:!0}):this._uri=p}return T(h,[{key:"uri",get:function(){return this._uri}}]),h}()},"./src/loader/load-stats.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"LoadStats",function(){return w});var w=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(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return t});var w=j("./src/polyfills/number.ts"),k=j("./node_modules/url-toolkit/src/url-toolkit.js"),S=j.n(k),T=j("./src/loader/fragment.ts"),C=j("./src/loader/level-details.ts"),h=j("./src/loader/level-key.ts"),p=j("./src/utils/attr-list.ts"),c=j("./src/utils/logger.ts"),l=j("./src/utils/codecs.ts"),a=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,u=/#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"),f=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("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function n(_){var m,y;return i.test((m=(y=k.parseURL(_))===null||y===void 0?void 0:y.path)!=null?m:"")}var t=function(){function _(){}return _.findGroup=function(y,E){for(var o=0;o<y.length;o++){var x=y[o];if(x.id===E)return x}},_.convertAVC1ToAVCOTI=function(y){var E=y.split(".");if(E.length>2){var o=E.shift()+".";return o+=parseInt(E.shift()).toString(16),o+=("000"+parseInt(E.shift()).toString(16)).substr(-4),o}return y},_.resolve=function(y,E){return k.buildAbsoluteURL(E,y,{alwaysNormalize:!0})},_.parseMasterPlaylist=function(y,E){var o=[],x={},A=!1;a.lastIndex=0;for(var O;(O=a.exec(y))!=null;)if(O[1]){var D=new p.AttrList(O[1]),N={attrs:D,bitrate:D.decimalInteger("AVERAGE-BANDWIDTH")||D.decimalInteger("BANDWIDTH"),name:D.NAME,url:_.resolve(O[2],E)},W=D.decimalResolution("RESOLUTION");W&&(N.width=W.width,N.height=W.height),d((D.CODECS||"").split(/[ ,]+/).filter(function(oe){return oe}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=_.convertAVC1ToAVCOTI(N.videoCodec)),o.push(N)}else if(O[3]){var K=new p.AttrList(O[3]);K["DATA-ID"]&&(A=!0,x[K["DATA-ID"]]=K)}return{levels:o,sessionData:A?x:null}},_.parseMasterPlaylistMedia=function(y,E,o,x){x===void 0&&(x=[]);var A,O=[],D=0;for(u.lastIndex=0;(A=u.exec(y))!==null;){var N=new p.AttrList(A[1]);if(N.TYPE===o){var W={attrs:N,bitrate:0,id:D++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:o,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?_.resolve(N.URI,E):""};if(x.length){var K=_.findGroup(x,W.groupId)||x[0];v(W,K,"audioCodec"),v(W,K,"textCodec")}O.push(W)}}return O},_.parseLevelPlaylist=function(y,E,o,x,A){var O=new C.LevelDetails(E),D=O.fragments,N=null,W=0,K=0,oe=0,B=0,X=null,V=new T.Fragment(x,E),ne,$,Z,ue=-1,he=!1;for(s.lastIndex=0,O.m3u8=y;(ne=s.exec(y))!==null;){he&&(he=!1,V=new T.Fragment(x,E),V.start=oe,V.sn=W,V.cc=B,V.level=o,N&&(V.initSegment=N,V.rawProgramDateTime=N.rawProgramDateTime));var Oe=ne[1];if(Oe){V.duration=parseFloat(Oe);var we=(" "+ne[2]).slice(1);V.title=we||null,V.tagList.push(we?["INF",Oe,we]:["INF",Oe])}else if(ne[3])Object(w.isFiniteNumber)(V.duration)&&(V.start=oe,Z&&(V.levelkey=Z),V.sn=W,V.level=o,V.cc=B,V.urlId=A,D.push(V),V.relurl=(" "+ne[3]).slice(1),b(V,X),X=V,oe+=V.duration,W++,K=0,he=!0);else if(ne[4]){var Pe=(" "+ne[4]).slice(1);X?V.setByteRange(Pe,X):V.setByteRange(Pe)}else if(ne[5])V.rawProgramDateTime=(" "+ne[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),ue===-1&&(ue=D.length);else{if(ne=ne[0].match(f),!ne){c.logger.warn("No matches on slow regex match for level playlist!");continue}for($=1;$<ne.length&&!(typeof ne[$]!="undefined");$++);var _e=(" "+ne[$]).slice(1),xe=(" "+ne[$+1]).slice(1),Ve=ne[$+2]?(" "+ne[$+2]).slice(1):"";switch(_e){case"PLAYLIST-TYPE":O.type=xe.toUpperCase();break;case"MEDIA-SEQUENCE":W=O.startSN=parseInt(xe);break;case"SKIP":{var Ne=new p.AttrList(xe),Be=Ne.decimalInteger("SKIPPED-SEGMENTS");if(Object(w.isFiniteNumber)(Be)){O.skippedSegments=Be;for(var ze=Be;ze--;)D.unshift(null);W+=Be}var ye=Ne.enumeratedString("RECENTLY-REMOVED-DATERANGES");ye&&(O.recentlyRemovedDateranges=ye.split(" "));break}case"TARGETDURATION":O.targetduration=parseFloat(xe);break;case"VERSION":O.version=parseInt(xe);break;case"EXTM3U":break;case"ENDLIST":O.live=!1;break;case"#":(xe||Ve)&&V.tagList.push(Ve?[xe,Ve]:[xe]);break;case"DIS":B++;case"GAP":V.tagList.push([_e]);break;case"BITRATE":V.tagList.push([_e,xe]);break;case"DISCONTINUITY-SEQ":B=parseInt(xe);break;case"KEY":{var me,We=new p.AttrList(xe),He=We.enumeratedString("METHOD"),nt=We.URI,te=We.hexadecimalInteger("IV"),P=We.enumeratedString("KEYFORMATVERSIONS"),U=We.enumeratedString("KEYID"),q=(me=We.enumeratedString("KEYFORMAT"))!=null?me:"identity",Y=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Y.indexOf(q)>-1){c.logger.warn("Keyformat "+q+" is not supported from the manifest");continue}else if(q!=="identity")continue;He&&(Z=h.LevelKey.fromURL(E,nt),nt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(He)>=0&&(Z.method=He,Z.keyFormat=q,U&&(Z.keyID=U),P&&(Z.keyFormatVersions=P),Z.iv=te));break}case"START":{var J=new p.AttrList(xe),Ee=J.decimalFloatingPoint("TIME-OFFSET");Object(w.isFiniteNumber)(Ee)&&(O.startTimeOffset=Ee);break}case"MAP":{var ke=new p.AttrList(xe);V.relurl=ke.URI,ke.BYTERANGE&&V.setByteRange(ke.BYTERANGE),V.level=o,V.sn="initSegment",Z&&(V.levelkey=Z),V.initSegment=null,N=V,he=!0;break}case"SERVER-CONTROL":{var ht=new p.AttrList(xe);O.canBlockReload=ht.bool("CAN-BLOCK-RELOAD"),O.canSkipUntil=ht.optionalFloat("CAN-SKIP-UNTIL",0),O.canSkipDateRanges=O.canSkipUntil>0&&ht.bool("CAN-SKIP-DATERANGES"),O.partHoldBack=ht.optionalFloat("PART-HOLD-BACK",0),O.holdBack=ht.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ue=new p.AttrList(xe);O.partTarget=Ue.decimalFloatingPoint("PART-TARGET");break}case"PART":{var je=O.partList;je||(je=O.partList=[]);var tt=K>0?je[je.length-1]:void 0,dt=K++,qe=new T.Part(new p.AttrList(xe),V,E,dt,tt);je.push(qe),V.duration+=qe.duration;break}case"PRELOAD-HINT":{var Ye=new p.AttrList(xe);O.preloadHint=Ye;break}case"RENDITION-REPORT":{var Fe=new p.AttrList(xe);O.renditionReports=O.renditionReports||[],O.renditionReports.push(Fe);break}default:c.logger.warn("line parsed but not handled: "+ne);break}}}X&&!X.relurl?(D.pop(),oe-=X.duration,O.partList&&(O.fragmentHint=X)):O.partList&&(b(V,X),V.cc=B,O.fragmentHint=V);var Ie=D.length,Me=D[0],be=D[Ie-1];if(oe+=O.skippedSegments*O.targetduration,oe>0&&Ie&&be){O.averagetargetduration=oe/Ie;var Te=be.sn;O.endSN=Te!=="initSegment"?Te:0,Me&&(O.startCC=Me.cc,Me.initSegment||O.fragments.every(function(Le){return Le.relurl&&n(Le.relurl)})&&(c.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new T.Fragment(x,E),V.relurl=be.relurl,V.level=o,V.sn="initSegment",Me.initSegment=V,O.needSidxRanges=!0))}else O.endSN=0,O.startCC=0;return O.fragmentHint&&(oe+=O.fragmentHint.duration),O.totalduration=oe,O.endCC=B,ue>0&&g(D,ue),O},_}();function d(_,m){["video","audio","text"].forEach(function(y){var E=_.filter(function(x){return Object(l.isCodecType)(x,y)});if(E.length){var o=E.filter(function(x){return x.lastIndexOf("avc1",0)===0||x.lastIndexOf("mp4a",0)===0});m[y+"Codec"]=o.length>0?o[0]:E[0],_=_.filter(function(x){return E.indexOf(x)===-1})}}),m.unknownCodecs=_}function v(_,m,y){var E=m[y];E&&(_[y]=E)}function g(_,m){for(var y=_[m],E=m;E--;){var o=_[E];if(!o)return;o.programDateTime=y.programDateTime-o.duration*1e3,y=o}}function b(_,m){_.rawProgramDateTime?_.programDateTime=Date.parse(_.rawProgramDateTime):m!=null&&m.programDateTime&&(_.programDateTime=m.endProgramDateTime),Object(w.isFiniteNumber)(_.programDateTime)||(_.programDateTime=null,_.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/polyfills/number.ts"),k=j("./src/events.ts"),S=j("./src/errors.ts"),T=j("./src/utils/logger.ts"),C=j("./src/utils/mp4-tools.ts"),h=j("./src/loader/m3u8-parser.ts"),p=j("./src/types/loader.ts"),c=j("./src/utils/attr-list.ts");function l(s){var f=s.type;switch(f){case p.PlaylistContextType.AUDIO_TRACK:return p.PlaylistLevelType.AUDIO;case p.PlaylistContextType.SUBTITLE_TRACK:return p.PlaylistLevelType.SUBTITLE;default:return p.PlaylistLevelType.MAIN}}function a(s,f){var i=s.url;return(i===void 0||i.indexOf("data:")===0)&&(i=f.url),i}var u=function(){function s(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var f=s.prototype;return f.registerListeners=function(){var n=this.hls;n.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(k.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(k.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var n=this.hls;n.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(k.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(k.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(n){var t=this.hls.config,d=t.pLoader,v=t.loader,g=d||v,b=new g(t);return n.loader=b,this.loaders[n.type]=b,b},f.getInternalLoader=function(n){return this.loaders[n.type]},f.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},f.destroyInternalLoaders=function(){for(var n in this.loaders){var t=this.loaders[n];t&&t.destroy(),this.resetInternalLoader(n)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(n,t){var d=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:p.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},f.onLevelLoading=function(n,t){var d=t.id,v=t.level,g=t.url,b=t.deliveryDirectives;this.load({id:d,groupId:null,level:v,responseType:"text",type:p.PlaylistContextType.LEVEL,url:g,deliveryDirectives:b})},f.onAudioTrackLoading=function(n,t){var d=t.id,v=t.groupId,g=t.url,b=t.deliveryDirectives;this.load({id:d,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.AUDIO_TRACK,url:g,deliveryDirectives:b})},f.onSubtitleTrackLoading=function(n,t){var d=t.id,v=t.groupId,g=t.url,b=t.deliveryDirectives;this.load({id:d,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.SUBTITLE_TRACK,url:g,deliveryDirectives:b})},f.load=function(n){var t,d=this.hls.config,v=this.getInternalLoader(n);if(v){var g=v.context;if(g&&g.url===n.url){T.logger.trace("[playlist-loader]: playlist request ongoing");return}T.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),v.abort()}var b,_,m,y;switch(n.type){case p.PlaylistContextType.MANIFEST:b=d.manifestLoadingMaxRetry,_=d.manifestLoadingTimeOut,m=d.manifestLoadingRetryDelay,y=d.manifestLoadingMaxRetryTimeout;break;case p.PlaylistContextType.LEVEL:case p.PlaylistContextType.AUDIO_TRACK:case p.PlaylistContextType.SUBTITLE_TRACK:b=0,_=d.levelLoadingTimeOut;break;default:b=d.levelLoadingMaxRetry,_=d.levelLoadingTimeOut,m=d.levelLoadingRetryDelay,y=d.levelLoadingMaxRetryTimeout;break}if(v=this.createInternalLoader(n),(t=n.deliveryDirectives)!==null&&t!==void 0&&t.part){var E;if(n.type===p.PlaylistContextType.LEVEL&&n.level!==null?E=this.hls.levels[n.level].details:n.type===p.PlaylistContextType.AUDIO_TRACK&&n.id!==null?E=this.hls.audioTracks[n.id].details:n.type===p.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(E=this.hls.subtitleTracks[n.id].details),E){var o=E.partTarget,x=E.targetduration;o&&x&&(_=Math.min(Math.max(o*3,x*.8)*1e3,_))}}var A={timeout:_,maxRetry:b,retryDelay:m,maxRetryDelay:y,highWaterMark:0},O={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};v.load(n,A,O)},f.loadsuccess=function(n,t,d,v){if(v===void 0&&(v=null),d.isSidxRequest){this.handleSidxRequest(n,d),this.handlePlaylistLoaded(n,t,d,v);return}this.resetInternalLoader(d.type);var g=n.data;if(g.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,d,"no EXTM3U delimiter",v);return}t.parsing.start=performance.now(),g.indexOf("#EXTINF:")>0||g.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,t,d,v):this.handleMasterPlaylist(n,t,d,v)},f.loaderror=function(n,t,d){d===void 0&&(d=null),this.handleNetworkError(t,d,!1,n)},f.loadtimeout=function(n,t,d){d===void 0&&(d=null),this.handleNetworkError(t,d,!0)},f.handleMasterPlaylist=function(n,t,d,v){var g=this.hls,b=n.data,_=a(n,d),m=h.default.parseMasterPlaylist(b,_),y=m.levels,E=m.sessionData;if(!y.length){this.handleManifestParsingError(n,d,"no level found in manifest",v);return}var o=y.map(function(W){return{id:W.attrs.AUDIO,audioCodec:W.audioCodec}}),x=y.map(function(W){return{id:W.attrs.SUBTITLES,textCodec:W.textCodec}}),A=h.default.parseMasterPlaylistMedia(b,_,"AUDIO",o),O=h.default.parseMasterPlaylistMedia(b,_,"SUBTITLES",x),D=h.default.parseMasterPlaylistMedia(b,_,"CLOSED-CAPTIONS");if(A.length){var N=A.some(function(W){return!W.url});!N&&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"),A.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new c.AttrList({}),bitrate:0,url:""}))}g.trigger(k.Events.MANIFEST_LOADED,{levels:y,audioTracks:A,subtitles:O,captions:D,url:_,stats:t,networkDetails:v,sessionData:E})},f.handleTrackOrLevelPlaylist=function(n,t,d,v){var g=this.hls,b=d.id,_=d.level,m=d.type,y=a(n,d),E=Object(w.isFiniteNumber)(b)?b:0,o=Object(w.isFiniteNumber)(_)?_:E,x=l(d),A=h.default.parseLevelPlaylist(n.data,y,o,x,E);if(!A.fragments.length){g.trigger(k.Events.ERROR,{type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:y,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(m===p.PlaylistContextType.MANIFEST){var O={attrs:new c.AttrList({}),bitrate:0,details:A,name:"",url:y};g.trigger(k.Events.MANIFEST_LOADED,{levels:[O],audioTracks:[],url:y,stats:t,networkDetails:v,sessionData:null})}if(t.parsing.end=performance.now(),A.needSidxRanges){var D,N=(D=A.fragments[0].initSegment)===null||D===void 0?void 0:D.url;this.load({url:N,isSidxRequest:!0,type:m,level:_,levelDetails:A,id:b,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=A,this.handlePlaylistLoaded(n,t,d,v)},f.handleSidxRequest=function(n,t){var d=Object(C.parseSegmentIndex)(new Uint8Array(n.data));if(!d)return;var v=d.references,g=t.levelDetails;v.forEach(function(b,_){var m=b.info,y=g.fragments[_];y.byteRange.length===0&&y.setByteRange(String(1+m.end-m.start)+"@"+String(m.start)),y.initSegment&&y.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(n,t,d,v){this.hls.trigger(k.Events.ERROR,{type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===p.PlaylistContextType.MANIFEST,url:n.url,reason:d,response:n,context:t,networkDetails:v})},f.handleNetworkError=function(n,t,d,v){d===void 0&&(d=!1),T.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var g=S.ErrorDetails.UNKNOWN,b=!1,_=this.getInternalLoader(n);switch(n.type){case p.PlaylistContextType.MANIFEST:g=d?S.ErrorDetails.MANIFEST_LOAD_TIMEOUT:S.ErrorDetails.MANIFEST_LOAD_ERROR,b=!0;break;case p.PlaylistContextType.LEVEL:g=d?S.ErrorDetails.LEVEL_LOAD_TIMEOUT:S.ErrorDetails.LEVEL_LOAD_ERROR,b=!1;break;case p.PlaylistContextType.AUDIO_TRACK:g=d?S.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:S.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,b=!1;break;case p.PlaylistContextType.SUBTITLE_TRACK:g=d?S.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:S.ErrorDetails.SUBTITLE_LOAD_ERROR,b=!1;break}_&&this.resetInternalLoader(n.type);var m={type:S.ErrorTypes.NETWORK_ERROR,details:g,fatal:b,url:n.url,loader:_,context:n,networkDetails:t};v&&(m.response=v),this.hls.trigger(k.Events.ERROR,m)},f.handlePlaylistLoaded=function(n,t,d,v){var g=d.type,b=d.level,_=d.id,m=d.groupId,y=d.loader,E=d.levelDetails,o=d.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(n,d,"invalid target duration",v);return}if(!y)return;E.live&&(y.getCacheAge&&(E.ageHeader=y.getCacheAge()||0),(!y.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(g){case p.PlaylistContextType.MANIFEST:case p.PlaylistContextType.LEVEL:this.hls.trigger(k.Events.LEVEL_LOADED,{details:E,level:b||0,id:_||0,stats:t,networkDetails:v,deliveryDirectives:o});break;case p.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(k.Events.AUDIO_TRACK_LOADED,{details:E,id:_||0,groupId:m||"",stats:t,networkDetails:v,deliveryDirectives:o});break;case p.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(k.Events.SUBTITLE_TRACK_LOADED,{details:E,id:_||0,groupId:m||"",stats:t,networkDetails:v,deliveryDirectives:o});break}},s}();ee.default=u},"./src/polyfills/number.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"isFiniteNumber",function(){return w}),j.d(ee,"MAX_SAFE_INTEGER",function(){return k});var w=Number.isFinite||function(S){return typeof S=="number"&&isFinite(S)},k=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(de,ee,j){"use strict";j.r(ee);var w=function(){function k(){}return k.getSilentFrame=function(T,C){switch(T){case"mp4a.40.2":if(C===1)return new Uint8Array([0,200,0,128,35,128]);if(C===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(C===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(C===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(C===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(C===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(C===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(C===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(C===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},k}();ee.default=w},"./src/remux/mp4-generator.ts":function(de,ee,j){"use strict";j.r(ee);var w=Math.pow(2,32)-1,k=function(){function S(){}return S.init=function(){S.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 C;for(C in S.types)S.types.hasOwnProperty(C)&&(S.types[C]=[C.charCodeAt(0),C.charCodeAt(1),C.charCodeAt(2),C.charCodeAt(3)]);var h=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]);S.HDLR_TYPES={video:h,audio:p};var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),l=new Uint8Array([0,0,0,0,0,0,0,0]);S.STTS=S.STSC=S.STCO=l,S.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),S.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),S.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),S.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var a=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);S.FTYP=S.box(S.types.ftyp,a,s,a,u),S.DINF=S.box(S.types.dinf,S.box(S.types.dref,c))},S.box=function(C){for(var h=8,p=arguments.length,c=new Array(p>1?p-1:0),l=1;l<p;l++)c[l-1]=arguments[l];for(var a=c.length,u=a;a--;)h+=c[a].byteLength;var s=new Uint8Array(h);for(s[0]=h>>24&255,s[1]=h>>16&255,s[2]=h>>8&255,s[3]=h&255,s.set(C,4),a=0,h=8;a<u;a++)s.set(c[a],h),h+=c[a].byteLength;return s},S.hdlr=function(C){return S.box(S.types.hdlr,S.HDLR_TYPES[C])},S.mdat=function(C){return S.box(S.types.mdat,C)},S.mdhd=function(C,h){h*=C;var p=Math.floor(h/(w+1)),c=Math.floor(h%(w+1));return S.box(S.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,C>>24&255,C>>16&255,C>>8&255,C&255,p>>24,p>>16&255,p>>8&255,p&255,c>>24,c>>16&255,c>>8&255,c&255,85,196,0,0]))},S.mdia=function(C){return S.box(S.types.mdia,S.mdhd(C.timescale,C.duration),S.hdlr(C.type),S.minf(C))},S.mfhd=function(C){return S.box(S.types.mfhd,new Uint8Array([0,0,0,0,C>>24,C>>16&255,C>>8&255,C&255]))},S.minf=function(C){return C.type==="audio"?S.box(S.types.minf,S.box(S.types.smhd,S.SMHD),S.DINF,S.stbl(C)):S.box(S.types.minf,S.box(S.types.vmhd,S.VMHD),S.DINF,S.stbl(C))},S.moof=function(C,h,p){return S.box(S.types.moof,S.mfhd(C),S.traf(p,h))},S.moov=function(C){for(var h=C.length,p=[];h--;)p[h]=S.trak(C[h]);return S.box.apply(null,[S.types.moov,S.mvhd(C[0].timescale,C[0].duration)].concat(p).concat(S.mvex(C)))},S.mvex=function(C){for(var h=C.length,p=[];h--;)p[h]=S.trex(C[h]);return S.box.apply(null,[S.types.mvex].concat(p))},S.mvhd=function(C,h){h*=C;var p=Math.floor(h/(w+1)),c=Math.floor(h%(w+1)),l=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,C>>24&255,C>>16&255,C>>8&255,C&255,p>>24,p>>16&255,p>>8&255,p&255,c>>24,c>>16&255,c>>8&255,c&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 S.box(S.types.mvhd,l)},S.sdtp=function(C){var h=C.samples||[],p=new Uint8Array(4+h.length),c,l;for(c=0;c<h.length;c++)l=h[c].flags,p[c+4]=l.dependsOn<<4|l.isDependedOn<<2|l.hasRedundancy;return S.box(S.types.sdtp,p)},S.stbl=function(C){return S.box(S.types.stbl,S.stsd(C),S.box(S.types.stts,S.STTS),S.box(S.types.stsc,S.STSC),S.box(S.types.stsz,S.STSZ),S.box(S.types.stco,S.STCO))},S.avc1=function(C){var h=[],p=[],c,l,a;for(c=0;c<C.sps.length;c++)l=C.sps[c],a=l.byteLength,h.push(a>>>8&255),h.push(a&255),h=h.concat(Array.prototype.slice.call(l));for(c=0;c<C.pps.length;c++)l=C.pps[c],a=l.byteLength,p.push(a>>>8&255),p.push(a&255),p=p.concat(Array.prototype.slice.call(l));var u=S.box(S.types.avcC,new Uint8Array([1,h[3],h[4],h[5],252|3,224|C.sps.length].concat(h).concat([C.pps.length]).concat(p))),s=C.width,f=C.height,i=C.pixelRatio[0],n=C.pixelRatio[1];return S.box(S.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,f>>8&255,f&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]),u,S.box(S.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),S.box(S.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,n>>24,n>>16&255,n>>8&255,n&255])))},S.esds=function(C){var h=C.config.length;return new Uint8Array([0,0,0,0,3,23+h,0,1,0,4,15+h,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([h]).concat(C.config).concat([6,1,2]))},S.mp4a=function(C){var h=C.samplerate;return S.box(S.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,C.channelCount,0,16,0,0,0,0,h>>8&255,h&255,0,0]),S.box(S.types.esds,S.esds(C)))},S.mp3=function(C){var h=C.samplerate;return S.box(S.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,C.channelCount,0,16,0,0,0,0,h>>8&255,h&255,0,0]))},S.stsd=function(C){return C.type==="audio"?!C.isAAC&&C.codec==="mp3"?S.box(S.types.stsd,S.STSD,S.mp3(C)):S.box(S.types.stsd,S.STSD,S.mp4a(C)):S.box(S.types.stsd,S.STSD,S.avc1(C))},S.tkhd=function(C){var h=C.id,p=C.duration*C.timescale,c=C.width,l=C.height,a=Math.floor(p/(w+1)),u=Math.floor(p%(w+1));return S.box(S.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,h>>24&255,h>>16&255,h>>8&255,h&255,0,0,0,0,a>>24,a>>16&255,a>>8&255,a&255,u>>24,u>>16&255,u>>8&255,u&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,c>>8&255,c&255,0,0,l>>8&255,l&255,0,0]))},S.traf=function(C,h){var p=S.sdtp(C),c=C.id,l=Math.floor(h/(w+1)),a=Math.floor(h%(w+1));return S.box(S.types.traf,S.box(S.types.tfhd,new Uint8Array([0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255])),S.box(S.types.tfdt,new Uint8Array([1,0,0,0,l>>24,l>>16&255,l>>8&255,l&255,a>>24,a>>16&255,a>>8&255,a&255])),S.trun(C,p.length+16+20+8+16+8+8),p)},S.trak=function(C){return C.duration=C.duration||4294967295,S.box(S.types.trak,S.tkhd(C),S.mdia(C))},S.trex=function(C){var h=C.id;return S.box(S.types.trex,new Uint8Array([0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},S.trun=function(C,h){var p=C.samples||[],c=p.length,l=12+16*c,a=new Uint8Array(l),u,s,f,i,n,t;for(h+=8+l,a.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,c&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255],0),u=0;u<c;u++)s=p[u],f=s.duration,i=s.size,n=s.flags,t=s.cts,a.set([f>>>24&255,f>>>16&255,f>>>8&255,f&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,t>>>24&255,t>>>16&255,t>>>8&255,t&255],12+16*u);return S.box(S.types.trun,a)},S.initSegment=function(C){S.types||S.init();var h=S.moov(C),p=new Uint8Array(S.FTYP.byteLength+h.byteLength);return p.set(S.FTYP),p.set(h,S.FTYP.byteLength),p},S}();k.types=void 0,k.HDLR_TYPES=void 0,k.STTS=void 0,k.STSC=void 0,k.STCO=void 0,k.STSZ=void 0,k.VMHD=void 0,k.SMHD=void 0,k.STSD=void 0,k.FTYP=void 0,k.DINF=void 0,ee.default=k},"./src/remux/mp4-remuxer.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return t}),j.d(ee,"normalizePts",function(){return d});var w=j("./src/polyfills/number.ts"),k=j("./src/remux/aac-helper.ts"),S=j("./src/remux/mp4-generator.ts"),T=j("./src/events.ts"),C=j("./src/errors.ts"),h=j("./src/utils/logger.ts"),p=j("./src/types/loader.ts"),c=j("./src/utils/timescale-conversion.ts");function l(){return l=Object.assign||function(_){for(var m=1;m<arguments.length;m++){var y=arguments[m];for(var E in y)Object.prototype.hasOwnProperty.call(y,E)&&(_[E]=y[E])}return _},l.apply(this,arguments)}var a=10*1e3,u=1024,s=1152,f=null,i=null,n=!1,t=function(){function _(y,E,o,x){if(x===void 0&&(x=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=y,this.config=E,this.typeSupported=o,this.ISGenerated=!1,f===null){var A=navigator.userAgent||"",O=A.match(/Chrome\/(\d+)/i);f=O?parseInt(O[1]):0}if(i===null){var D=navigator.userAgent.match(/Safari\/(\d+)/i);i=D?parseInt(D[1]):0}n=!!f&&f<75||!!i&&i<600}var m=_.prototype;return m.destroy=function(){},m.resetTimeStamp=function(E){h.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=E},m.resetNextTimestamp=function(){h.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},m.resetInitSegment=function(){h.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},m.getVideoStartPts=function(E){var o=!1,x=E.reduce(function(A,O){var D=O.pts-A;return D<-4294967296?(o=!0,d(A,O.pts)):D>0?A:O.pts},E[0].pts);return o&&h.logger.debug("PTS rollover detected"),x},m.remux=function(E,o,x,A,O,D,N,W){var K,oe,B,X,V,ne,$=O,Z=O,ue=E.pid>-1,he=o.pid>-1,Oe=o.samples.length,we=E.samples.length>0,Pe=Oe>1,_e=(!ue||we)&&(!he||Pe)||this.ISGenerated||N;if(_e){this.ISGenerated||(B=this.generateIS(E,o,O));var xe=this.isVideoContiguous,Ve=-1;if(Pe&&(Ve=v(o.samples),!xe&&this.config.forceKeyFrameOnDiscontinuity))if(ne=!0,Ve>0){h.logger.warn("[mp4-remuxer]: Dropped "+Ve+" out of "+Oe+" video samples due to a missing keyframe");var Ne=this.getVideoStartPts(o.samples);o.samples=o.samples.slice(Ve),o.dropped+=Ve,Z+=(o.samples[0].pts-Ne)/(o.timescale||9e4)}else Ve===-1&&(h.logger.warn("[mp4-remuxer]: No keyframe found out of "+Oe+" video samples"),ne=!1);if(this.ISGenerated){if(we&&Pe){var Be=this.getVideoStartPts(o.samples),ze=d(E.samples[0].pts,Be)-Be,ye=ze/o.inputTimeScale;$+=Math.max(0,ye),Z+=Math.max(0,-ye)}if(we){if(E.samplerate||(h.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(E,o,O)),oe=this.remuxAudio(E,$,this.isAudioContiguous,D,he||Pe||W===p.PlaylistLevelType.AUDIO?Z:void 0),Pe){var me=oe?oe.endPTS-oe.startPTS:0;o.inputTimeScale||(h.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(E,o,O)),K=this.remuxVideo(o,Z,xe,me)}}else Pe&&(K=this.remuxVideo(o,Z,xe,0));K&&(K.firstKeyFrame=Ve,K.independent=Ve!==-1)}}return this.ISGenerated&&(x.samples.length&&(V=this.remuxID3(x,O)),A.samples.length&&(X=this.remuxText(A,O))),{audio:oe,video:K,initSegment:B,independent:ne,text:X,id3:V}},m.generateIS=function(E,o,x){var A=E.samples,O=o.samples,D=this.typeSupported,N={},W=!Object(w.isFiniteNumber)(this._initPTS),K="audio/mp4",oe,B,X;if(W&&(oe=B=Infinity),E.config&&A.length&&(E.timescale=E.samplerate,E.isAAC||(D.mpeg?(K="audio/mpeg",E.codec=""):D.mp3&&(E.codec="mp3")),N.audio={id:"audio",container:K,codec:E.codec,initSegment:!E.isAAC&&D.mpeg?new Uint8Array(0):S.default.initSegment([E]),metadata:{channelCount:E.channelCount}},W&&(X=E.inputTimeScale,oe=B=A[0].pts-Math.round(X*x))),o.sps&&o.pps&&O.length&&(o.timescale=o.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:o.codec,initSegment:S.default.initSegment([o]),metadata:{width:o.width,height:o.height}},W)){X=o.inputTimeScale;var V=this.getVideoStartPts(O),ne=Math.round(X*x);B=Math.min(B,d(O[0].dts,V)-ne),oe=Math.min(oe,V-ne)}if(Object.keys(N).length)return this.ISGenerated=!0,W&&(this._initPTS=oe,this._initDTS=B),{tracks:N,initPTS:oe,timescale:X}},m.remuxVideo=function(E,o,x,A){var O=E.inputTimeScale,D=E.samples,N=[],W=D.length,K=this._initPTS,oe=this.nextAvcDts,B=8,X,V,ne,$=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,ue=0,he=!1;if(!x||oe===null){var Oe=o*O,we=D[0].pts-d(D[0].dts,D[0].pts);oe=Oe-we}for(var Pe=0;Pe<W;Pe++){var _e=D[Pe];if(_e.pts=d(_e.pts-K,oe),_e.dts=d(_e.dts-K,oe),_e.dts>_e.pts){var xe=9e4*.2;ue=Math.max(Math.min(ue,_e.pts-_e.dts),-1*xe)}_e.dts<D[Pe>0?Pe-1:Pe].dts&&(he=!0)}he&&D.sort(function(Rt,st){var mt=Rt.dts-st.dts,lt=Rt.pts-st.pts;return mt||lt}),V=D[0].dts,ne=D[D.length-1].dts;var Ve=Math.round((ne-V)/(W-1));if(ue<0){if(ue<Ve*-2){h.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(c.toMsFromMpegTsClock)(-Ve,!0)+" ms");for(var Ne=ue,Be=0;Be<W;Be++)D[Be].dts=Ne=Math.max(Ne,D[Be].pts-Ve),D[Be].pts=Math.max(Ne,D[Be].pts)}else{h.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(c.toMsFromMpegTsClock)(ue,!0)+" ms to overcome this issue");for(var ze=0;ze<W;ze++)D[ze].dts=D[ze].dts+ue}V=D[0].dts}if(x){var ye=V-oe,me=ye>Ve,We=ye<-1;if(me||We){me?h.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(ye,!0)+" ms ("+ye+"dts) hole between fragments detected, filling it"):h.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(-ye,!0)+" ms ("+ye+"dts) overlapping between fragments detected"),V=oe;var He=D[0].pts-ye;D[0].dts=V,D[0].pts=He,h.logger.log("Video: First PTS/DTS adjusted: "+Object(c.toMsFromMpegTsClock)(He,!0)+"/"+Object(c.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(c.toMsFromMpegTsClock)(ye,!0)+" ms")}}n&&(V=Math.max(0,V));for(var nt=0,te=0,P=0;P<W;P++){for(var U=D[P],q=U.units,Y=q.length,J=0,Ee=0;Ee<Y;Ee++)J+=q[Ee].data.length;te+=J,nt+=Y,U.length=J,U.dts=Math.max(U.dts,V),U.pts=Math.max(U.pts,U.dts,0),$=Math.min(U.pts,$),Z=Math.max(U.pts,Z)}ne=D[W-1].dts;var ke=te+4*nt+8,ht;try{ht=new Uint8Array(ke)}catch(Rt){this.observer.emit(T.Events.ERROR,T.Events.ERROR,{type:C.ErrorTypes.MUX_ERROR,details:C.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ke,reason:"fail allocating video mdat "+ke});return}var Ue=new DataView(ht.buffer);Ue.setUint32(0,ke),ht.set(S.default.types.mdat,4);for(var je=0;je<W;je++){for(var tt=D[je],dt=tt.units,qe=0,Ye=0,Fe=dt.length;Ye<Fe;Ye++){var Ie=dt[Ye],Me=Ie.data,be=Ie.data.byteLength;Ue.setUint32(B,be),B+=4,ht.set(Me,B),B+=be,qe+=4+be}if(je<W-1)X=D[je+1].dts-tt.dts;else{var Te=this.config,Le=tt.dts-D[je>0?je-1:je].dts;if(Te.stretchShortVideoTrack&&this.nextAudioPts!==null){var Ce=Math.floor(Te.maxBufferHole*O),et=(A?$+A*O:this.nextAudioPts)-tt.pts;et>Ce?(X=et-Le,X<0&&(X=Le),h.logger.log("[mp4-remuxer]: It is approximately "+et/90+" ms to the next segment; using duration "+X/90+" ms for the last video frame.")):X=Le}else X=Le}var Qe=Math.round(tt.pts-tt.dts);N.push(new g(tt.key,X,qe,Qe))}if(N.length&&f&&f<70){var yt=N[0].flags;yt.dependsOn=2,yt.isNonSync=0}console.assert(X!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=oe=ne+X,this.isVideoContiguous=!0;var Dt=S.default.moof(E.sequenceNumber++,V,l({},E,{samples:N})),Bt="video",Pt={data1:Dt,data2:ht,startPTS:$/O,endPTS:(Z+X)/O,startDTS:V/O,endDTS:oe/O,type:Bt,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(ht.length,"MDAT length must not be zero"),Pt},m.remuxAudio=function(E,o,x,A,O){var D=E.inputTimeScale,N=E.samplerate?E.samplerate:D,W=D/N,K=E.isAAC?u:s,oe=K*W,B=this._initPTS,X=!E.isAAC&&this.typeSupported.mpeg,V=[],ne=E.samples,$=X?0:8,Z=this.nextAudioPts||-1,ue=o*D;if(this.isAudioContiguous=x=x||ne.length&&Z>0&&(A&&Math.abs(ue-Z)<9e3||Math.abs(d(ne[0].pts-B,ue)-Z)<20*oe),ne.forEach(function(Me){Me.pts=d(Me.pts-B,ue)}),!x||Z<0){if(ne=ne.filter(function(Me){return Me.pts>=0}),!ne.length)return;O===0?Z=0:A?Z=Math.max(0,ue):Z=ne[0].pts}if(E.isAAC)for(var he=O!==void 0,Oe=this.config.maxAudioFramesDrift,we=0,Pe=Z;we<ne.length;we++){var _e=ne[we],xe=_e.pts,Ve=xe-Pe,Ne=Math.abs(1e3*Ve/D);if(Ve<=-Oe*oe&&he)we===0&&(h.logger.warn("Audio frame @ "+(xe/D).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ve/D)+" ms."),this.nextAudioPts=Z=Pe=xe);else if(Ve>=Oe*oe&&Ne<a&&he){var Be=Math.round(Ve/oe);Pe=xe-Be*oe,Pe<0&&(Be--,Pe+=oe),we===0&&(this.nextAudioPts=Z=Pe),h.logger.warn("[mp4-remuxer]: Injecting "+Be+" audio frame @ "+(Pe/D).toFixed(3)+"s due to "+Math.round(1e3*Ve/D)+" ms gap.");for(var ze=0;ze<Be;ze++){var ye=Math.max(Pe,0),me=k.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);me||(h.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),me=_e.unit.subarray()),ne.splice(we,0,{unit:me,pts:ye}),Pe+=oe,we++}}_e.pts=Pe,Pe+=oe}for(var We=null,He=null,nt,te=0,P=ne.length;P--;)te+=ne[P].unit.byteLength;for(var U=0,q=ne.length;U<q;U++){var Y=ne[U],J=Y.unit,Ee=Y.pts;if(He!==null){var ke=V[U-1];ke.duration=Math.round((Ee-He)/W)}else if(x&&E.isAAC&&(Ee=Z),We=Ee,te>0){te+=$;try{nt=new Uint8Array(te)}catch(Me){this.observer.emit(T.Events.ERROR,T.Events.ERROR,{type:C.ErrorTypes.MUX_ERROR,details:C.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:te,reason:"fail allocating audio mdat "+te});return}if(!X){var ht=new DataView(nt.buffer);ht.setUint32(0,te),nt.set(S.default.types.mdat,4)}}else return;nt.set(J,$);var Ue=J.byteLength;$+=Ue,V.push(new g(!0,K,Ue,0)),He=Ee}var je=V.length;if(!je)return;var tt=V[V.length-1];this.nextAudioPts=Z=He+W*tt.duration;var dt=X?new Uint8Array(0):S.default.moof(E.sequenceNumber++,We/W,l({},E,{samples:V}));E.samples=[];var qe=We/D,Ye=Z/D,Fe="audio",Ie={data1:dt,data2:nt,startPTS:qe,endPTS:Ye,startDTS:qe,endDTS:Ye,type:Fe,hasAudio:!0,hasVideo:!1,nb:je};return this.isAudioContiguous=!0,console.assert(nt.length,"MDAT length must not be zero"),Ie},m.remuxEmptyAudio=function(E,o,x,A){var O=E.inputTimeScale,D=E.samplerate?E.samplerate:O,N=O/D,W=this.nextAudioPts,K=(W!==null?W:A.startDTS*O)+this._initDTS,oe=A.endDTS*O+this._initDTS,B=N*u,X=Math.ceil((oe-K)/B),V=k.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);if(h.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){h.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ne=[],$=0;$<X;$++){var Z=K+$*B;ne.push({unit:V,pts:Z,dts:Z})}return E.samples=ne,this.remuxAudio(E,o,x,!1)},m.remuxID3=function(E,o){var x=E.samples.length;if(!x)return;for(var A=E.inputTimeScale,O=this._initPTS,D=this._initDTS,N=0;N<x;N++){var W=E.samples[N];W.pts=d(W.pts-O,o*A)/A,W.dts=d(W.dts-D,o*A)/A}var K=E.samples;return E.samples=[],{samples:K}},m.remuxText=function(E,o){var x=E.samples.length;if(!x)return;for(var A=E.inputTimeScale,O=this._initPTS,D=0;D<x;D++){var N=E.samples[D];N.pts=d(N.pts-O,o*A)/A}E.samples.sort(function(K,oe){return K.pts-oe.pts});var W=E.samples;return E.samples=[],{samples:W}},_}();function d(_,m){var y;if(m===null)return _;for(m<_?y=-8589934592:y=8589934592;Math.abs(_-m)>4294967296;)_+=y;return _}function v(_){for(var m=0;m<_.length;m++)if(_[m].key)return m;return-1}var g=function(m,y,E,o){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=y,this.size=E,this.cts=o,this.flags=new b(m)},b=function(m){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=m?2:1,this.isNonSync=m?0:1}},"./src/remux/passthrough-remuxer.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/polyfills/number.ts"),k=j("./src/utils/mp4-tools.ts"),S=j("./src/loader/fragment.ts"),T=j("./src/utils/logger.ts"),C=function(){function c(){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 l=c.prototype;return l.destroy=function(){},l.resetTimeStamp=function(u){this.initPTS=u,this.lastEndDTS=null},l.resetNextTimestamp=function(){this.lastEndDTS=null},l.resetInitSegment=function(u,s,f){this.audioCodec=s,this.videoCodec=f,this.generateInitSegment(u),this.emitInitSegment=!0},l.generateInitSegment=function(u){var s=this.audioCodec,f=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(k.parseInitSegment)(u);s||(s=p(i.audio,S.ElementaryStreamTypes.AUDIO)),f||(f=p(i.video,S.ElementaryStreamTypes.VIDEO));var n={};i.audio&&i.video?n.audiovideo={container:"video/mp4",codec:s+","+f,initSegment:u,id:"main"}:i.audio?n.audio={container:"audio/mp4",codec:s,initSegment:u,id:"audio"}:i.video?n.video={container:"video/mp4",codec:f,initSegment:u,id:"main"}:T.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},l.remux=function(u,s,f,i,n){var t=this.initPTS,d=this.lastEndDTS,v={audio:void 0,video:void 0,text:i,id3:f,initSegment:void 0};Object(w.isFiniteNumber)(d)||(d=this.lastEndDTS=n||0);var g=s.samples;if(!g||!g.length)return v;var b={initPTS:void 0,timescale:1},_=this.initData;if((!_||!_.length)&&(this.generateInitSegment(g),_=this.initData),!_||!_.length)return T.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),v;this.emitInitSegment&&(b.tracks=this.initTracks,this.emitInitSegment=!1),Object(w.isFiniteNumber)(t)||(this.initPTS=b.initPTS=t=h(_,g,d));var m=Object(k.getDuration)(g,_),y=d,E=m+y;Object(k.offsetStartDTS)(_,g,t),m>0?this.lastEndDTS=E:(T.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var o=!!_.audio,x=!!_.video,A="";o&&(A+="audio"),x&&(A+="video");var O={data1:g,startPTS:y,startDTS:y,endPTS:E,endDTS:E,type:A,hasAudio:o,hasVideo:x,nb:1,dropped:0};return v.audio=O.type==="audio"?O:void 0,v.video=O.type!=="audio"?O:void 0,v.text=i,v.id3=f,v.initSegment=b,v},c}(),h=function(l,a,u){return Object(k.getStartDTS)(l,a)-u};function p(c,l){var a=c==null?void 0:c.codec;return a&&a.length>4?a:a==="hvc1"?"hvc1.1.c.L120.90":a==="av01"?"av01.0.04M.08":a==="avc1"||l===S.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}ee.default=C},"./src/task-loop.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return w});var w=function(){function k(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var S=k.prototype;return S.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},S.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},S.onHandlerDestroyed=function(){},S.hasInterval=function(){return!!this._tickInterval},S.hasNextTick=function(){return!!this._tickTimer},S.setInterval=function(C){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,C),!0)},S.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},S.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},S.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},S.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},S.doTick=function(){},k}()},"./src/types/cmcd.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"CMCDVersion",function(){return w}),j.d(ee,"CMCDObjectType",function(){return k}),j.d(ee,"CMCDStreamingFormat",function(){return S}),j.d(ee,"CMCDStreamType",function(){return T});var w=1,k;(function(C){C.MANIFEST="m",C.AUDIO="a",C.VIDEO="v",C.MUXED="av",C.INIT="i",C.CAPTION="c",C.TIMED_TEXT="tt",C.KEY="k",C.OTHER="o"})(k||(k={}));var S;(function(C){C.DASH="d",C.HLS="h",C.SMOOTH="s",C.OTHER="o"})(S||(S={}));var T;(function(C){C.VOD="v",C.LIVE="l"})(T||(T={}))},"./src/types/level.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"HlsSkip",function(){return S}),j.d(ee,"getSkipValue",function(){return T}),j.d(ee,"HlsUrlParameters",function(){return C}),j.d(ee,"Level",function(){return h});function w(p,c){for(var l=0;l<c.length;l++){var a=c[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,a.key,a)}}function k(p,c,l){return c&&w(p.prototype,c),l&&w(p,l),p}var S;(function(p){p.No="",p.Yes="YES",p.v2="v2"})(S||(S={}));function T(p,c){var l=p.canSkipUntil,a=p.canSkipDateRanges,u=p.endSN,s=c!==void 0?c-u:0;return l&&s<l?a?S.v2:S.Yes:S.No}var C=function(){function p(l,a,u){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=l,this.part=a,this.skip=u}var c=p.prototype;return c.addDirectives=function(a){var u=new self.URL(a);return this.msn!==void 0&&u.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&u.searchParams.set("_HLS_part",this.part.toString()),this.skip&&u.searchParams.set("_HLS_skip",this.skip),u.toString()},p}(),h=function(){function p(c){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=[c.url],this.attrs=c.attrs,this.bitrate=c.bitrate,c.details&&(this.details=c.details),this.id=c.id||0,this.name=c.name,this.width=c.width||0,this.height=c.height||0,this.audioCodec=c.audioCodec,this.videoCodec=c.videoCodec,this.unknownCodecs=c.unknownCodecs,this.codecSet=[c.videoCodec,c.audioCodec].filter(function(l){return l}).join(",").replace(/\.[^.,]+/g,"")}return k(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(l){var a=l%this.url.length;this._urlId!==a&&(this.details=void 0,this._urlId=a)}}]),p}()},"./src/types/loader.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"PlaylistContextType",function(){return w}),j.d(ee,"PlaylistLevelType",function(){return k});var w;(function(S){S.MANIFEST="manifest",S.LEVEL="level",S.AUDIO_TRACK="audioTrack",S.SUBTITLE_TRACK="subtitleTrack"})(w||(w={}));var k;(function(S){S.MAIN="main",S.AUDIO="audio",S.SUBTITLE="subtitle"})(k||(k={}))},"./src/types/transmuxer.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"ChunkMetadata",function(){return w});var w=function(T,C,h,p,c,l){p===void 0&&(p=0),c===void 0&&(c=-1),l===void 0&&(l=!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=k(),this.buffering={audio:k(),video:k(),audiovideo:k()},this.level=T,this.sn=C,this.id=h,this.size=p,this.part=c,this.partial=l};function k(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"AttrList",function(){return S});var w=/^(\d+)x(\d+)$/,k=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,S=function(){function T(h){typeof h=="string"&&(h=T.parseAttrList(h));for(var p in h)h.hasOwnProperty(p)&&(this[p]=h[p])}var C=T.prototype;return C.decimalInteger=function(p){var c=parseInt(this[p],10);return c>Number.MAX_SAFE_INTEGER?Infinity:c},C.hexadecimalInteger=function(p){if(this[p]){var c=(this[p]||"0x").slice(2);c=(c.length&1?"0":"")+c;for(var l=new Uint8Array(c.length/2),a=0;a<c.length/2;a++)l[a]=parseInt(c.slice(a*2,a*2+2),16);return l}else return null},C.hexadecimalIntegerAsNumber=function(p){var c=parseInt(this[p],16);return c>Number.MAX_SAFE_INTEGER?Infinity:c},C.decimalFloatingPoint=function(p){return parseFloat(this[p])},C.optionalFloat=function(p,c){var l=this[p];return l?parseFloat(l):c},C.enumeratedString=function(p){return this[p]},C.bool=function(p){return this[p]==="YES"},C.decimalResolution=function(p){var c=w.exec(this[p]);return c===null?void 0:{width:parseInt(c[1],10),height:parseInt(c[2],10)}},T.parseAttrList=function(p){var c,l={},a='"';for(k.lastIndex=0;(c=k.exec(p))!==null;){var u=c[2];u.indexOf(a)===0&&u.lastIndexOf(a)===u.length-1&&(u=u.slice(1,-1)),l[c[1]]=u}return l},T}()},"./src/utils/binary-search.ts":function(de,ee,j){"use strict";j.r(ee);var w={search:function(S,T){for(var C=0,h=S.length-1,p=null,c=null;C<=h;){p=(C+h)/2|0,c=S[p];var l=T(c);if(l>0)C=p+1;else if(l<0)h=p-1;else return c}return null}};ee.default=w},"./src/utils/buffer-helper.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"BufferHelper",function(){return S});var w=j("./src/utils/logger.ts"),k={length:0,start:function(){return 0},end:function(){return 0}},S=function(){function T(){}return T.isBuffered=function(h,p){try{if(h){for(var c=T.getBuffered(h),l=0;l<c.length;l++)if(p>=c.start(l)&&p<=c.end(l))return!0}}catch(a){}return!1},T.bufferInfo=function(h,p,c){try{if(h){var l=T.getBuffered(h),a=[],u;for(u=0;u<l.length;u++)a.push({start:l.start(u),end:l.end(u)});return this.bufferedInfo(a,p,c)}}catch(s){}return{len:0,start:p,end:p,nextStart:void 0}},T.bufferedInfo=function(h,p,c){p=Math.max(0,p),h.sort(function(b,_){var m=b.start-_.start;return m||_.end-b.end});var l=[];if(c)for(var a=0;a<h.length;a++){var u=l.length;if(u){var s=l[u-1].end;h[a].start-s<c?h[a].end>s&&(l[u-1].end=h[a].end):l.push(h[a])}else l.push(h[a])}else l=h;for(var f=0,i,n=p,t=p,d=0;d<l.length;d++){var v=l[d].start,g=l[d].end;if(p+c>=v&&p<g)n=v,t=g,f=t-p;else if(p+c<v){i=v;break}}return{len:f,start:n||0,end:t||0,nextStart:i}},T.getBuffered=function(h){try{return h.buffered}catch(p){return w.logger.log("failed to get media.buffered",p),k}},T}()},"./src/utils/cea-608-parser.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"Row",function(){return t}),j.d(ee,"CaptionScreen",function(){return d});var w=j("./src/utils/logger.ts"),k={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},S=function(E){var o=E;return k.hasOwnProperty(E)&&(o=k[E]),String.fromCharCode(o)},T=15,C=100,h={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},c={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},l={25:2,26:4,29:6,30:8,31:10,27:13,28:15},a=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u;(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"})(u||(u={}));var s=function(){function y(){this.time=null,this.verboseLevel=u.ERROR}var E=y.prototype;return E.log=function(x,A){this.verboseLevel>=x&&w.logger.log(this.time+" ["+x+"] "+A)},y}(),f=function(E){for(var o=[],x=0;x<E.length;x++)o.push(E[x].toString(16));return o},i=function(){function y(o,x,A,O,D){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=o||"white",this.underline=x||!1,this.italics=A||!1,this.background=O||"black",this.flash=D||!1}var E=y.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(x){for(var A=["foreground","underline","italics","background","flash"],O=0;O<A.length;O++){var D=A[O];x.hasOwnProperty(D)&&(this[D]=x[D])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(x){return this.foreground===x.foreground&&this.underline===x.underline&&this.italics===x.italics&&this.background===x.background&&this.flash===x.flash},E.copy=function(x){this.foreground=x.foreground,this.underline=x.underline,this.italics=x.italics,this.background=x.background,this.flash=x.flash},E.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},y}(),n=function(){function y(o,x,A,O,D,N){this.uchar=void 0,this.penState=void 0,this.uchar=o||" ",this.penState=new i(x,A,O,D,N)}var E=y.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(x,A){this.uchar=x,this.penState.copy(A)},E.setPenState=function(x){this.penState.copy(x)},E.equals=function(x){return this.uchar===x.uchar&&this.penState.equals(x.penState)},E.copy=function(x){this.uchar=x.uchar,this.penState.copy(x.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},y}(),t=function(){function y(o){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var x=0;x<C;x++)this.chars.push(new n);this.logger=o,this.pos=0,this.currPenState=new i}var E=y.prototype;return E.equals=function(x){for(var A=!0,O=0;O<C;O++)if(!this.chars[O].equals(x.chars[O])){A=!1;break}return A},E.copy=function(x){for(var A=0;A<C;A++)this.chars[A].copy(x.chars[A])},E.isEmpty=function(){for(var x=!0,A=0;A<C;A++)if(!this.chars[A].isEmpty()){x=!1;break}return x},E.setCursor=function(x){this.pos!==x&&(this.pos=x),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>C&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=C)},E.moveCursor=function(x){var A=this.pos+x;if(x>1)for(var O=this.pos+1;O<A+1;O++)this.chars[O].setPenState(this.currPenState);this.setCursor(A)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(x){x>=144&&this.backSpace();var A=S(x);if(this.pos>=C){this.logger.log(u.ERROR,"Cannot insert "+x.toString(16)+" ("+A+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(A,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(x){var A;for(A=x;A<C;A++)this.chars[A].reset()},E.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},E.clearToEndOfRow=function(){this.clearFromPos(this.pos)},E.getTextString=function(){for(var x=[],A=!0,O=0;O<C;O++){var D=this.chars[O].uchar;D!==" "&&(A=!1),x.push(D)}return A?"":x.join("")},E.setPenStyles=function(x){this.currPenState.setStyles(x);var A=this.chars[this.pos];A.setPenState(this.currPenState)},y}(),d=function(){function y(o){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var x=0;x<T;x++)this.rows.push(new t(o));this.logger=o,this.currRow=T-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=y.prototype;return E.reset=function(){for(var x=0;x<T;x++)this.rows[x].clear();this.currRow=T-1},E.equals=function(x){for(var A=!0,O=0;O<T;O++)if(!this.rows[O].equals(x.rows[O])){A=!1;break}return A},E.copy=function(x){for(var A=0;A<T;A++)this.rows[A].copy(x.rows[A])},E.isEmpty=function(){for(var x=!0,A=0;A<T;A++)if(!this.rows[A].isEmpty()){x=!1;break}return x},E.backSpace=function(){var x=this.rows[this.currRow];x.backSpace()},E.clearToEndOfRow=function(){var x=this.rows[this.currRow];x.clearToEndOfRow()},E.insertChar=function(x){var A=this.rows[this.currRow];A.insertChar(x)},E.setPen=function(x){var A=this.rows[this.currRow];A.setPenStyles(x)},E.moveCursor=function(x){var A=this.rows[this.currRow];A.moveCursor(x)},E.setCursor=function(x){this.logger.log(u.INFO,"setCursor: "+x);var A=this.rows[this.currRow];A.setCursor(x)},E.setPAC=function(x){this.logger.log(u.INFO,"pacData = "+JSON.stringify(x));var A=x.row-1;if(this.nrRollUpRows&&A<this.nrRollUpRows-1&&(A=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==A){for(var O=0;O<T;O++)this.rows[O].clear();var D=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var W=N.rows[D].cueStartTime,K=this.logger.time;if(W&&K!==null&&W<K)for(var oe=0;oe<this.nrRollUpRows;oe++)this.rows[A-this.nrRollUpRows+oe+1].copy(N.rows[D+oe])}}this.currRow=A;var B=this.rows[this.currRow];if(x.indent!==null){var X=x.indent,V=Math.max(X-1,0);B.setCursor(x.indent),x.color=B.chars[V].penState.foreground}var ne={foreground:x.color,underline:x.underline,italics:x.italics,background:"black",flash:!1};this.setPen(ne)},E.setBkgData=function(x){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(x)),this.backSpace(),this.setPen(x),this.insertChar(32)},E.setRollUpRows=function(x){this.nrRollUpRows=x},E.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(u.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(u.TEXT,this.getDisplayText());var x=this.currRow+1-this.nrRollUpRows,A=this.rows.splice(x,1)[0];A.clear(),this.rows.splice(this.currRow,0,A),this.logger.log(u.INFO,"Rolling up")},E.getDisplayText=function(x){x=x||!1;for(var A=[],O="",D=-1,N=0;N<T;N++){var W=this.rows[N].getTextString();W&&(D=N+1,x?A.push("Row "+D+": '"+W+"'"):A.push(W.trim()))}return A.length>0&&(x?O="["+A.join(" | ")+"]":O=A.join(`
|
|
|
`)),O},E.getTextAndFormat=function(){return this.rows},y}(),v=function(){function y(o,x,A){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=o,this.outputFilter=x,this.mode=null,this.verbose=0,this.displayedMemory=new d(A),this.nonDisplayedMemory=new d(A),this.lastOutputScreen=new d(A),this.currRollUpRow=this.displayedMemory.rows[T-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=A}var E=y.prototype;return E.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},E.getHandler=function(){return this.outputFilter},E.setHandler=function(x){this.outputFilter=x},E.setPAC=function(x){this.writeScreen.setPAC(x)},E.setBkgData=function(x){this.writeScreen.setBkgData(x)},E.setMode=function(x){if(x===this.mode)return;this.mode=x,this.logger.log(u.INFO,"MODE="+x),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=x},E.insertChars=function(x){for(var A=0;A<x.length;A++)this.writeScreen.insertChar(x[A]);var O=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,O+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(u.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},E.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},E.ccBS=function(){if(this.logger.log(u.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},E.ccAOF=function(){},E.ccAON=function(){},E.ccDER=function(){this.logger.log(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},E.ccRU=function(x){this.logger.log(u.INFO,"RU("+x+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(x)},E.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},E.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},E.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},E.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},E.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},E.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},E.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},E.ccEOC=function(){if(this.logger.log(u.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var x=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=x,this.writeScreen=this.nonDisplayedMemory,this.logger.log(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},E.ccTO=function(x){this.logger.log(u.INFO,"TO("+x+") - Tab Offset"),this.writeScreen.moveCursor(x)},E.ccMIDROW=function(x){var A={flash:!1};if(A.underline=x%2===1,A.italics=x>=46,A.italics)A.foreground="white";else{var O=Math.floor(x/2)-16,D=["white","green","blue","cyan","red","yellow","magenta"];A.foreground=D[O]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(A)),this.writeScreen.setPen(A)},E.outputDataUpdate=function(x){x===void 0&&(x=!1);var A=this.logger.time;if(A===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=A:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,A,this.lastOutputScreen),x&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:A),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(x){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,x,this.displayedMemory),this.cueStartTime=x))},y}(),g=function(){function y(o,x,A){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var O=new s;this.channels=[null,new v(o,x,O),new v(o+1,A,O)],this.cmdHistory=m(),this.logger=O}var E=y.prototype;return E.getHandler=function(x){return this.channels[x].getHandler()},E.setHandler=function(x,A){this.channels[x].setHandler(A)},E.addData=function(x,A){var O,D,N,W=!1;this.logger.time=x;for(var K=0;K<A.length;K+=2){if(D=A[K]&127,N=A[K+1]&127,D===0&&N===0)continue;if(this.logger.log(u.DATA,"["+f([A[K],A[K+1]])+"] -> ("+f([D,N])+")"),O=this.parseCmd(D,N),O||(O=this.parseMidrow(D,N)),O||(O=this.parsePAC(D,N)),O||(O=this.parseBackgroundAttributes(D,N)),!O&&(W=this.parseChars(D,N),W)){var oe=this.currentChannel;if(oe&&oe>0){var B=this.channels[oe];B.insertChars(W)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!O&&!W&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+f([D,N])+" orig: "+f([A[K],A[K+1]]))}},E.parseCmd=function(x,A){var O=this.cmdHistory,D=(x===20||x===28||x===21||x===29)&&A>=32&&A<=47,N=(x===23||x===31)&&A>=33&&A<=35;if(!(D||N))return!1;if(_(x,A,O))return b(null,null,O),this.logger.log(u.DEBUG,"Repeated command ("+f([x,A])+") is dropped"),!0;var W=x===20||x===21||x===23?1:2,K=this.channels[W];return x===20||x===21||x===28||x===29?A===32?K.ccRCL():A===33?K.ccBS():A===34?K.ccAOF():A===35?K.ccAON():A===36?K.ccDER():A===37?K.ccRU(2):A===38?K.ccRU(3):A===39?K.ccRU(4):A===40?K.ccFON():A===41?K.ccRDC():A===42?K.ccTR():A===43?K.ccRTD():A===44?K.ccEDM():A===45?K.ccCR():A===46?K.ccENM():A===47&&K.ccEOC():K.ccTO(A-32),b(x,A,O),this.currentChannel=W,!0},E.parseMidrow=function(x,A){var O=0;if((x===17||x===25)&&A>=32&&A<=47){if(x===17?O=1:O=2,O!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var D=this.channels[O];return D?(D.ccMIDROW(A),this.logger.log(u.DEBUG,"MIDROW ("+f([x,A])+")"),!0):!1}return!1},E.parsePAC=function(x,A){var O,D=this.cmdHistory,N=(x>=17&&x<=23||x>=25&&x<=31)&&A>=64&&A<=127,W=(x===16||x===24)&&A>=64&&A<=95;if(!(N||W))return!1;if(_(x,A,D))return b(null,null,D),!0;var K=x<=23?1:2;A>=64&&A<=95?O=K===1?h[x]:c[x]:O=K===1?p[x]:l[x];var oe=this.channels[K];return oe?(oe.setPAC(this.interpretPAC(O,A)),b(x,A,D),this.currentChannel=K,!0):!1},E.interpretPAC=function(x,A){var O,D={color:null,italics:!1,indent:null,underline:!1,row:x};return A>95?O=A-96:O=A-64,D.underline=(O&1)===1,O<=13?D.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(O/2)]:O<=15?(D.italics=!0,D.color="white"):D.indent=Math.floor((O-16)/2)*4,D},E.parseChars=function(x,A){var O,D=null,N=null;if(x>=25?(O=2,N=x-8):(O=1,N=x),N>=17&&N<=19){var W;N===17?W=A+80:N===18?W=A+112:W=A+144,this.logger.log(u.INFO,"Special char '"+S(W)+"' in channel "+O),D=[W]}else x>=32&&x<=127&&(D=A===0?[x]:[x,A]);if(D){var K=f(D);this.logger.log(u.DEBUG,"Char codes = "+K.join(",")),b(x,A,this.cmdHistory)}return D},E.parseBackgroundAttributes=function(x,A){var O=(x===16||x===24)&&A>=32&&A<=47,D=(x===23||x===31)&&A>=45&&A<=47;if(!(O||D))return!1;var N,W={};x===16||x===24?(N=Math.floor((A-32)/2),W.background=a[N],A%2===1&&(W.background=W.background+"_semi")):A===45?W.background="transparent":(W.foreground="black",A===47&&(W.underline=!0));var K=x<=23?1:2,oe=this.channels[K];return oe.setBkgData(W),b(x,A,this.cmdHistory),!0},E.reset=function(){for(var x=0;x<Object.keys(this.channels).length;x++){var A=this.channels[x];A&&A.reset()}this.cmdHistory=m()},E.cueSplitAtTime=function(x){for(var A=0;A<this.channels.length;A++){var O=this.channels[A];O&&O.cueSplitAtTime(x)}},y}();function b(y,E,o){o.a=y,o.b=E}function _(y,E,o){return o.a===y&&o.b===E}function m(){return{a:null,b:null}}ee.default=g},"./src/utils/codecs.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"isCodecType",function(){return k}),j.d(ee,"isCodecSupportedInMp4",function(){return S});var w={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 k(T,C){var h=w[C];return!!h&&h[T.slice(0,4)]===!0}function S(T,C){return MediaSource.isTypeSupported((C||"video")+'/mp4;codecs="'+T+'"')}},"./src/utils/cues.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/utils/vttparser.ts"),k=j("./src/utils/webvtt-parser.ts"),S=j("./src/utils/texttrack-utils.ts"),T=/\s/,C={newCue:function(p,c,l,a){for(var u=[],s,f,i,n,t,d=self.VTTCue||self.TextTrackCue,v=0;v<a.rows.length;v++)if(s=a.rows[v],i=!0,n=0,t="",!s.isEmpty()){for(var g=0;g<s.chars.length;g++)T.test(s.chars[g].uchar)&&i?n++:(t+=s.chars[g].uchar,i=!1);s.cueStartTime=c,c===l&&(l+=1e-4),n>=16?n--:n++;var b=Object(w.fixLineBreaks)(t.trim()),_=Object(k.generateCueId)(c,l,b);(!p||!p.cues||!p.cues.getCueById(_))&&(f=new d(c,l,b),f.id=_,f.line=v+1,f.align="left",f.position=10+Math.min(80,Math.floor(n*8/32)*10),u.push(f))}return p&&u.length&&(u.sort(function(m,y){return m.line==="auto"||y.line==="auto"?0:m.line>8&&y.line>8?y.line-m.line:m.line-y.line}),u.forEach(function(m){return Object(S.addCueToTrack)(p,m)})),u}};ee.default=C},"./src/utils/discontinuities.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"findFirstFragWithCC",function(){return T}),j.d(ee,"shouldAlignOnDiscontinuities",function(){return C}),j.d(ee,"findDiscontinuousReferenceFrag",function(){return h}),j.d(ee,"adjustSlidingStart",function(){return c}),j.d(ee,"alignStream",function(){return l}),j.d(ee,"alignPDT",function(){return u}),j.d(ee,"alignFragmentByPDTDelta",function(){return s}),j.d(ee,"alignMediaPlaylistByPDT",function(){return f});var w=j("./src/polyfills/number.ts"),k=j("./src/utils/logger.ts"),S=j("./src/controller/level-helper.ts");function T(i,n){for(var t=null,d=0,v=i.length;d<v;d++){var g=i[d];if(g&&g.cc===n){t=g;break}}return t}function C(i,n,t){return!!(n.details&&(t.endCC>t.startCC||i&&i.cc<t.startCC))}function h(i,n){var t=i.fragments,d=n.fragments;if(!d.length||!t.length){k.logger.log("No fragments to align");return}var v=T(t,d[0].cc);if(!v||v&&!v.startPTS){k.logger.log("No frag in previous level to align on");return}return v}function p(i,n){if(i){var t=i.start+n;i.start=i.startPTS=t,i.endPTS=t+i.duration}}function c(i,n){for(var t=n.fragments,d=0,v=t.length;d<v;d++)p(t[d],i);n.fragmentHint&&p(n.fragmentHint,i),n.alignedSliding=!0}function l(i,n,t){if(!n)return;a(i,t,n),!t.alignedSliding&&n.details&&u(t,n.details),!t.alignedSliding&&n.details&&!t.skippedSegments&&Object(S.adjustSliding)(n.details,t)}function a(i,n,t){if(C(i,t,n)){var d=h(t.details,n);d&&Object(w.isFiniteNumber)(d.start)&&(k.logger.log("Adjusting PTS using last level due to CC increase within current level "+n.url),c(d.start,n))}}function u(i,n){if(!n.fragments.length||!i.hasProgramDateTime||!n.hasProgramDateTime)return;var t=n.fragments[0].programDateTime,d=i.fragments[0].programDateTime,v=(d-t)/1e3+n.fragments[0].start;v&&Object(w.isFiniteNumber)(v)&&(k.logger.log("Adjusting PTS using programDateTime delta "+(d-t)+"ms, sliding:"+v.toFixed(3)+" "+i.url+" "),c(v,i))}function s(i,n){var t=i.programDateTime;if(!t)return;var d=(t-n)/1e3;i.start=i.startPTS=d,i.endPTS=d+i.duration}function f(i,n){if(!n.fragments.length||!i.hasProgramDateTime||!n.hasProgramDateTime)return;var t=n.fragments[0].programDateTime,d=n.fragments[0].start,v=t-d*1e3;i.fragments.forEach(function(g){s(g,v)}),i.fragmentHint&&s(i.fragmentHint,v),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/utils/ewma.ts"),k=function(){function S(C,h,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 w.default(C),this.fast_=new w.default(h)}var T=S.prototype;return T.update=function(h,p){var c=this.slow_,l=this.fast_;this.slow_.halfLife!==h&&(this.slow_=new w.default(h,c.getEstimate(),c.getTotalWeight())),this.fast_.halfLife!==p&&(this.fast_=new w.default(p,l.getEstimate(),l.getTotalWeight()))},T.sample=function(h,p){h=Math.max(h,this.minDelayMs_);var c=8*p,l=h/1e3,a=c/l;this.fast_.sample(l,a),this.slow_.sample(l,a)},T.canEstimate=function(){var h=this.fast_;return h&&h.getTotalWeight()>=this.minWeight_},T.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},T.destroy=function(){},S}();ee.default=k},"./src/utils/ewma.ts":function(de,ee,j){"use strict";j.r(ee);var w=function(){function k(T,C,h){C===void 0&&(C=0),h===void 0&&(h=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_=C,this.totalWeight_=h}var S=k.prototype;return S.sample=function(C,h){var p=Math.pow(this.alpha_,C);this.estimate_=h*(1-p)+p*this.estimate_,this.totalWeight_+=C},S.getTotalWeight=function(){return this.totalWeight_},S.getEstimate=function(){if(this.alpha_){var C=1-Math.pow(this.alpha_,this.totalWeight_);if(C)return this.estimate_/C}return this.estimate_},k}();ee.default=w},"./src/utils/fetch-loader.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"fetchSupported",function(){return s});var w=j("./src/polyfills/number.ts"),k=j("./src/loader/load-stats.ts"),S=j("./src/demux/chunk-cache.ts");function T(d,v){d.prototype=Object.create(v.prototype),d.prototype.constructor=d,l(d,v)}function C(d){var v=typeof Map=="function"?new Map:void 0;return C=function(b){if(b===null||!c(b))return b;if(typeof b!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v!="undefined"){if(v.has(b))return v.get(b);v.set(b,_)}function _(){return h(b,arguments,a(this).constructor)}return _.prototype=Object.create(b.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),l(_,b)},C(d)}function h(d,v,g){return p()?h=Reflect.construct:h=function(_,m,y){var E=[null];E.push.apply(E,m);var o=Function.bind.apply(_,E),x=new o;return y&&l(x,y.prototype),x},h.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(d){return!1}}function c(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function l(d,v){return l=Object.setPrototypeOf||function(b,_){return b.__proto__=_,b},l(d,v)}function a(d){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},a(d)}function u(){return u=Object.assign||function(d){for(var v=1;v<arguments.length;v++){var g=arguments[v];for(var b in g)Object.prototype.hasOwnProperty.call(g,b)&&(d[b]=g[b])}return d},u.apply(this,arguments)}function s(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var f=function(){function d(g){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=g.fetchSetup||n,this.controller=new self.AbortController,this.stats=new k.LoadStats}var v=d.prototype;return v.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},v.abortInternal=function(){var b=this.response;(!b||!b.ok)&&(this.stats.aborted=!0,this.controller.abort())},v.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},v.load=function(b,_,m){var y=this,E=this.stats;if(E.loading.start)throw new Error("Loader can only be used once.");E.loading.start=self.performance.now();var o=i(b,this.controller.signal),x=m.onProgress,A=b.responseType==="arraybuffer",O=A?"byteLength":"length";this.context=b,this.config=_,this.callbacks=m,this.request=this.fetchSetup(b,o),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){y.abortInternal(),m.onTimeout(E,b,y.response)},_.timeout),self.fetch(this.request).then(function(D){if(y.response=y.loader=D,!D.ok){var N=D.status,W=D.statusText;throw new t(W||"fetch, bad network response",N,D)}return E.loading.first=Math.max(self.performance.now(),E.loading.start),E.total=parseInt(D.headers.get("Content-Length")||"0"),x&&Object(w.isFiniteNumber)(_.highWaterMark)?y.loadProgressively(D,E,b,_.highWaterMark,x):A?D.arrayBuffer():D.text()}).then(function(D){var N=y.response;self.clearTimeout(y.requestTimeout),E.loading.end=Math.max(self.performance.now(),E.loading.first),E.loaded=E.total=D[O];var W={url:N.url,data:D};x&&!Object(w.isFiniteNumber)(_.highWaterMark)&&x(E,b,D,N),m.onSuccess(W,E,b,N)}).catch(function(D){if(self.clearTimeout(y.requestTimeout),E.aborted)return;var N=D.code||0;m.onError({code:N,text:D.message},b,D.details)})},v.getCacheAge=function(){var b=null;if(this.response){var _=this.response.headers.get("age");b=_?parseFloat(_):null}return b},v.loadProgressively=function(b,_,m,y,E){y===void 0&&(y=0);var o=new S.default,x=b.body.getReader(),A=function O(){return x.read().then(function(D){if(D.done)return o.dataLength&&E(_,m,o.flush(),b),Promise.resolve(new ArrayBuffer(0));var N=D.value,W=N.length;return _.loaded+=W,W<y||o.dataLength?(o.push(N),o.dataLength>=y&&E(_,m,o.flush(),b)):E(_,m,N,b),O()}).catch(function(){return Promise.reject()})};return A()},d}();function i(d,v){var g={method:"GET",mode:"cors",credentials:"same-origin",signal:v,headers:new self.Headers(u({},d.headers))};return d.rangeEnd&&g.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),g}function n(d,v){return new self.Request(d.url,v)}var t=function(d){T(v,d);function v(g,b,_){var m;return m=d.call(this,g)||this,m.code=void 0,m.details=void 0,m.code=b,m.details=_,m}return v}(C(Error));ee.default=f},"./src/utils/imsc1-ttml-parser.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"IMSC1_CODEC",function(){return c}),j.d(ee,"parseIMSC1",function(){return s});var w=j("./src/utils/mp4-tools.ts"),k=j("./src/utils/vttparser.ts"),S=j("./src/utils/vttcue.ts"),T=j("./src/demux/id3.ts"),C=j("./src/utils/timescale-conversion.ts"),h=j("./src/utils/webvtt-parser.ts");function p(){return p=Object.assign||function(y){for(var E=1;E<arguments.length;E++){var o=arguments[E];for(var x in o)Object.prototype.hasOwnProperty.call(o,x)&&(y[x]=o[x])}return y},p.apply(this,arguments)}var c="stpp.ttml.im1t",l=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,a=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,u={left:"start",center:"center",right:"end",start:"start",end:"end"};function s(y,E,o,x,A){var O=Object(w.findBox)(new Uint8Array(y),["mdat"]);if(O.length===0){A(new Error("Could not parse IMSC1 mdat"));return}var D=O[0],N=Object(T.utf8ArrayToStr)(new Uint8Array(y,D.start,D.end-D.start)),W=Object(C.toTimescaleFromScale)(E,1,o);try{x(f(N,W))}catch(K){A(K)}}function f(y,E){var o=new DOMParser,x=o.parseFromString(y,"text/xml"),A=x.getElementsByTagName("tt")[0];if(!A)throw new Error("Invalid ttml");var O={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},D=Object.keys(O).reduce(function(B,X){return B[X]=A.getAttribute("ttp:"+X)||O[X],B},{}),N=A.getAttribute("xml:space")!=="preserve",W=n(i(A,"styling","style")),K=n(i(A,"layout","region")),oe=i(A,"body","[begin]");return[].map.call(oe,function(B){var X=t(B,N);if(!X||!B.hasAttribute("begin"))return null;var V=b(B.getAttribute("begin"),D),ne=b(B.getAttribute("dur"),D),$=b(B.getAttribute("end"),D);if(V===null)throw g(B);if($===null){if(ne===null)throw g(B);$=V+ne}var Z=new S.default(V-E,$-E,X);Z.id=Object(h.generateCueId)(Z.startTime,Z.endTime,Z.text);var ue=K[B.getAttribute("region")],he=W[B.getAttribute("style")];Z.position=10,Z.size=80;var Oe=d(ue,he),we=Oe.textAlign;if(we){var Pe=u[we];Pe&&(Z.lineAlign=Pe),Z.align=we}return p(Z,Oe),Z}).filter(function(B){return B!==null})}function i(y,E,o){var x=y.getElementsByTagName(E)[0];return x?[].slice.call(x.querySelectorAll(o)):[]}function n(y){return y.reduce(function(E,o){var x=o.getAttribute("xml:id");return x&&(E[x]=o),E},{})}function t(y,E){return[].slice.call(y.childNodes).reduce(function(o,x,A){var O;return x.nodeName==="br"&&A?o+`
|
|
|
`:(O=x.childNodes)!==null&&O!==void 0&&O.length?t(x,E):E?o+x.textContent.trim().replace(/\s+/g," "):o+x.textContent},"")}function d(y,E){var o="http://www.w3.org/ns/ttml#styling",x=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return x.reduce(function(A,O){var D=v(E,o,O)||v(y,o,O);return D&&(A[O]=D),A},{})}function v(y,E,o){return y.hasAttributeNS(E,o)?y.getAttributeNS(E,o):null}function g(y){return new Error("Could not parse ttml timestamp "+y)}function b(y,E){if(!y)return null;var o=Object(k.parseTimeStamp)(y);return o===null&&(l.test(y)?o=_(y,E):a.test(y)&&(o=m(y,E))),o}function _(y,E){var o=l.exec(y),x=(o[4]|0)+(o[5]|0)/E.subFrameRate;return(o[1]|0)*3600+(o[2]|0)*60+(o[3]|0)+x/E.frameRate}function m(y,E){var o=a.exec(y),x=Number(o[1]),A=o[2];switch(A){case"h":return x*3600;case"m":return x*60;case"ms":return x*1e3;case"f":return x/E.frameRate;case"t":return x/E.tickRate}return x}},"./src/utils/logger.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"enableLogs",function(){return h}),j.d(ee,"logger",function(){return p});var w=function(){},k={trace:w,debug:w,log:w,warn:w,info:w,error:w},S=k;function T(c){var l=self.console[c];return l?l.bind(self.console,"["+c+"] >"):w}function C(c){for(var l=arguments.length,a=new Array(l>1?l-1:0),u=1;u<l;u++)a[u-1]=arguments[u];a.forEach(function(s){S[s]=c[s]?c[s].bind(c):T(s)})}function h(c){if(self.console&&c===!0||typeof c=="object"){C(c,"debug","log","info","warn","error");try{S.log()}catch(l){S=k}}else S=k}var p=S},"./src/utils/mediakeys-helper.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"KeySystems",function(){return w}),j.d(ee,"requestMediaKeySystemAccess",function(){return k});var w;(function(S){S.WIDEVINE="com.widevine.alpha",S.PLAYREADY="com.microsoft.playready"})(w||(w={}));var k=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"getMediaSource",function(){return w});function w(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"bin2str",function(){return C}),j.d(ee,"readUint16",function(){return h}),j.d(ee,"readUint32",function(){return p}),j.d(ee,"writeUint32",function(){return c}),j.d(ee,"findBox",function(){return l}),j.d(ee,"parseSegmentIndex",function(){return a}),j.d(ee,"parseInitSegment",function(){return u}),j.d(ee,"getStartDTS",function(){return s}),j.d(ee,"getDuration",function(){return f}),j.d(ee,"computeRawDurationFromSamples",function(){return i}),j.d(ee,"offsetStartDTS",function(){return n}),j.d(ee,"segmentValidRange",function(){return t}),j.d(ee,"appendUint8Array",function(){return d});var w=j("./src/utils/typed-array.ts"),k=j("./src/loader/fragment.ts"),S=Math.pow(2,32)-1,T=[].push;function C(v){return String.fromCharCode.apply(null,v)}function h(v,g){"data"in v&&(g+=v.start,v=v.data);var b=v[g]<<8|v[g+1];return b<0?65536+b:b}function p(v,g){"data"in v&&(g+=v.start,v=v.data);var b=v[g]<<24|v[g+1]<<16|v[g+2]<<8|v[g+3];return b<0?4294967296+b:b}function c(v,g,b){"data"in v&&(g+=v.start,v=v.data),v[g]=b>>24,v[g+1]=b>>16&255,v[g+2]=b>>8&255,v[g+3]=b&255}function l(v,g){var b=[];if(!g.length)return b;var _,m,y;"data"in v?(_=v.data,m=v.start,y=v.end):(_=v,m=0,y=_.byteLength);for(var E=m;E<y;){var o=p(_,E),x=C(_.subarray(E+4,E+8)),A=o>1?E+o:y;if(x===g[0])if(g.length===1)b.push({data:_,start:E+8,end:A});else{var O=l({data:_,start:E+8,end:A},g.slice(1));O.length&&T.apply(b,O)}E=A}return b}function a(v){var g=l(v,["moov"]),b=g[0],_=b?b.end:null,m=l(v,["sidx"]);if(!m||!m[0])return null;var y=[],E=m[0],o=E.data[0],x=o===0?8:16,A=p(E,x);x+=4;var O=0,D=0;o===0?x+=8:x+=16,x+=2;var N=E.end+D,W=h(E,x);x+=2;for(var K=0;K<W;K++){var oe=x,B=p(E,oe);oe+=4;var X=B&2147483647,V=(B&2147483648)>>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ne=p(E,oe);oe+=4,y.push({referenceSize:X,subsegmentDuration:ne,info:{duration:ne/A,start:N,end:N+X-1}}),N+=X,oe+=4,x=oe}return{earliestPresentationTime:O,timescale:A,version:o,referencesCount:W,references:y,moovEndOffset:_}}function u(v){for(var g=[],b=l(v,["moov","trak"]),_=0;_<b.length;_++){var m=b[_],y=l(m,["tkhd"])[0];if(y){var E=y.data[y.start],o=E===0?12:20,x=p(y,o),A=l(m,["mdia","mdhd"])[0];if(A){E=A.data[A.start],o=E===0?12:20;var O=p(A,o),D=l(m,["mdia","hdlr"])[0];if(D){var N=C(D.data.subarray(D.start+8,D.start+12)),W={soun:k.ElementaryStreamTypes.AUDIO,vide:k.ElementaryStreamTypes.VIDEO}[N];if(W){var K=l(m,["mdia","minf","stbl","stsd"])[0],oe=void 0;K&&(oe=C(K.data.subarray(K.start+12,K.start+16))),g[x]={timescale:O,type:W},g[W]={timescale:O,id:x,codec:oe}}}}}}var B=l(v,["moov","mvex","trex"]);return B.forEach(function(X){var V=p(X,4),ne=g[V];ne&&(ne.default={duration:p(X,12),flags:p(X,20)})}),g}function s(v,g){return l(g,["moof","traf"]).reduce(function(b,_){var m=l(_,["tfdt"])[0],y=m.data[m.start],E=l(_,["tfhd"]).reduce(function(o,x){var A=p(x,4),O=v[A];if(O){var D=p(m,4);y===1&&(D*=Math.pow(2,32),D+=p(m,8));var N=O.timescale||9e4,W=D/N;if(isFinite(W)&&(o===null||W<o))return W}return o},null);return E!==null&&isFinite(E)&&(b===null||E<b)?E:b},null)||0}function f(v,g){for(var b=0,_=0,m=0,y=l(v,["moof","traf"]),E=0;E<y.length;E++){var o=y[E],x=l(o,["tfhd"])[0],A=p(x,4),O=g[A];if(!O)continue;var D=O.default,N=p(x,0)|(D==null?void 0:D.flags),W=D==null?void 0:D.duration;N&8&&(N&2?W=p(x,12):W=p(x,8));for(var K=O.timescale||9e4,oe=l(o,["trun"]),B=0;B<oe.length;B++){if(W){var X=p(oe[B],4);b=W*X}else b=i(oe[B]);O.type===k.ElementaryStreamTypes.VIDEO?_+=b/K:O.type===k.ElementaryStreamTypes.AUDIO&&(m+=b/K)}}if(_===0&&m===0){var V=a(v);if(V!=null&&V.references)return V.references.reduce(function(ne,$){return ne+$.info.duration||0},0)}return _||m}function i(v){var g=p(v,0),b=8;g&1&&(b+=4),g&4&&(b+=4);for(var _=0,m=p(v,4),y=0;y<m;y++){if(g&256){var E=p(v,b);_+=E,b+=4}g&512&&(b+=4),g&1024&&(b+=4),g&2048&&(b+=4)}return _}function n(v,g,b){l(g,["moof","traf"]).forEach(function(_){l(_,["tfhd"]).forEach(function(m){var y=p(m,4),E=v[y];if(!E)return;var o=E.timescale||9e4;l(_,["tfdt"]).forEach(function(x){var A=x.data[x.start],O=p(x,4);if(A===0)c(x,4,O-b*o);else{O*=Math.pow(2,32),O+=p(x,8),O-=b*o,O=Math.max(O,0);var D=Math.floor(O/(S+1)),N=Math.floor(O%(S+1));c(x,4,D),c(x,8,N)}})})})}function t(v){var g={valid:null,remainder:null},b=l(v,["moof"]);if(b){if(b.length<2)return g.remainder=v,g}else return g;var _=b[b.length-1];return g.valid=Object(w.sliceUint8)(v,0,_.start-8),g.remainder=Object(w.sliceUint8)(v,_.start-8),g}function d(v,g){var b=new Uint8Array(v.length+g.length);return b.set(v),b.set(g,v.length),b}},"./src/utils/output-filter.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"default",function(){return w});var w=function(){function k(T,C){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=T,this.trackName=C}var S=k.prototype;return S.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},S.newCue=function(C,h,p){(this.startTime===null||this.startTime>C)&&(this.startTime=C),this.endTime=h,this.screen=p,this.timelineController.createCaptionsTrack(this.trackName)},S.reset=function(){this.cueRanges=[]},k}()},"./src/utils/texttrack-utils.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"sendAddTrackEvent",function(){return k}),j.d(ee,"addCueToTrack",function(){return S}),j.d(ee,"clearCurrentCues",function(){return T}),j.d(ee,"removeCuesInRange",function(){return C}),j.d(ee,"getCuesInRange",function(){return p});var w=j("./src/utils/logger.ts");function k(c,l){var a;try{a=new Event("addtrack")}catch(u){a=document.createEvent("Event"),a.initEvent("addtrack",!1,!1)}a.track=c,l.dispatchEvent(a)}function S(c,l){var a=c.mode;if(a==="disabled"&&(c.mode="hidden"),c.cues&&!c.cues.getCueById(l.id))try{if(c.addCue(l),!c.cues.getCueById(l.id))throw new Error("addCue is failed for: "+l)}catch(s){w.logger.debug("[texttrack-utils]: "+s);var u=new self.TextTrackCue(l.startTime,l.endTime,l.text);u.id=l.id,c.addCue(u)}a==="disabled"&&(c.mode=a)}function T(c){var l=c.mode;if(l==="disabled"&&(c.mode="hidden"),c.cues)for(var a=c.cues.length;a--;)c.removeCue(c.cues[a]);l==="disabled"&&(c.mode=l)}function C(c,l,a){var u=c.mode;if(u==="disabled"&&(c.mode="hidden"),c.cues&&c.cues.length>0)for(var s=p(c.cues,l,a),f=0;f<s.length;f++)c.removeCue(s[f]);u==="disabled"&&(c.mode=u)}function h(c,l){if(l<c[0].startTime)return 0;var a=c.length-1;if(l>c[a].endTime)return-1;for(var u=0,s=a;u<=s;){var f=Math.floor((s+u)/2);if(l<c[f].startTime)s=f-1;else if(l>c[f].startTime&&u<a)u=f+1;else return f}return c[u].startTime-l<l-c[s].startTime?u:s}function p(c,l,a){var u=[],s=h(c,l);if(s>-1)for(var f=s,i=c.length;f<i;f++){var n=c[f];if(n.startTime>=l&&n.endTime<=a)u.push(n);else if(n.startTime>a)return u}return u}},"./src/utils/time-ranges.ts":function(de,ee,j){"use strict";j.r(ee);var w={toString:function(S){for(var T="",C=S.length,h=0;h<C;h++)T+="["+S.start(h).toFixed(3)+","+S.end(h).toFixed(3)+"]";return T}};ee.default=w},"./src/utils/timescale-conversion.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"toTimescaleFromBase",function(){return k}),j.d(ee,"toTimescaleFromScale",function(){return S}),j.d(ee,"toMsFromMpegTsClock",function(){return T}),j.d(ee,"toMpegTsClockFromTimescale",function(){return C});var w=9e4;function k(h,p,c,l){c===void 0&&(c=1),l===void 0&&(l=!1);var a=h*p*c;return l?Math.round(a):a}function S(h,p,c,l){return c===void 0&&(c=1),l===void 0&&(l=!1),k(h,p,1/c,l)}function T(h,p){return p===void 0&&(p=!1),k(h,1e3,1/w,p)}function C(h,p){return p===void 0&&(p=1),k(h,w,1/p)}},"./src/utils/typed-array.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"sliceUint8",function(){return w});function w(k,S,T){return Uint8Array.prototype.slice?k.slice(S,T):new Uint8Array(Array.prototype.slice.call(k,S,T))}},"./src/utils/vttcue.ts":function(de,ee,j){"use strict";j.r(ee),ee.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var w=["","lr","rl"],k=["start","middle","end","left","right"];function S(c,l){if(typeof l!="string")return!1;if(!Array.isArray(c))return!1;var a=l.toLowerCase();return~c.indexOf(a)?a:!1}function T(c){return S(w,c)}function C(c){return S(k,c)}function h(c){for(var l=arguments.length,a=new Array(l>1?l-1:0),u=1;u<l;u++)a[u-1]=arguments[u];for(var s=1;s<arguments.length;s++){var f=arguments[s];for(var i in f)c[i]=f[i]}return c}function p(c,l,a){var u=this,s={enumerable:!0};u.hasBeenReset=!1;var f="",i=!1,n=c,t=l,d=a,v=null,g="",b=!0,_="auto",m="start",y=50,E="middle",o=50,x="middle";Object.defineProperty(u,"id",h({},s,{get:function(){return f},set:function(O){f=""+O}})),Object.defineProperty(u,"pauseOnExit",h({},s,{get:function(){return i},set:function(O){i=!!O}})),Object.defineProperty(u,"startTime",h({},s,{get:function(){return n},set:function(O){if(typeof O!="number")throw new TypeError("Start time must be set to a number.");n=O,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",h({},s,{get:function(){return t},set:function(O){if(typeof O!="number")throw new TypeError("End time must be set to a number.");t=O,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",h({},s,{get:function(){return d},set:function(O){d=""+O,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",h({},s,{get:function(){return v},set:function(O){v=O,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",h({},s,{get:function(){return g},set:function(O){var D=T(O);if(D===!1)throw new SyntaxError("An invalid or illegal string was specified.");g=D,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",h({},s,{get:function(){return b},set:function(O){b=!!O,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",h({},s,{get:function(){return _},set:function(O){if(typeof O!="number"&&O!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");_=O,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",h({},s,{get:function(){return m},set:function(O){var D=C(O);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");m=D,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",h({},s,{get:function(){return y},set:function(O){if(O<0||O>100)throw new Error("Position must be between 0 and 100.");y=O,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",h({},s,{get:function(){return E},set:function(O){var D=C(O);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");E=D,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",h({},s,{get:function(){return o},set:function(O){if(O<0||O>100)throw new Error("Size must be between 0 and 100.");o=O,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",h({},s,{get:function(){return x},set:function(O){var D=C(O);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");x=D,this.hasBeenReset=!0}})),u.displayState=void 0}return p.prototype.getCueAsHTML=function(){var c=self.WebVTT;return c.convertCueToDOMTree(self,this.text)},p}()},"./src/utils/vttparser.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"parseTimeStamp",function(){return S}),j.d(ee,"fixLineBreaks",function(){return l}),j.d(ee,"VTTParser",function(){return a});var w=j("./src/utils/vttcue.ts"),k=function(){function u(){}var s=u.prototype;return s.decode=function(i,n){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},u}();function S(u){function s(i,n,t,d){return(i|0)*3600+(n|0)*60+(t|0)+parseFloat(d||0)}var f=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?s(f[2],f[3],0,f[4]):s(f[1],f[2],f[3],f[4]):null}var T=function(){function u(){this.values=Object.create(null)}var s=u.prototype;return s.set=function(i,n){!this.get(i)&&n!==""&&(this.values[i]=n)},s.get=function(i,n,t){return t?this.has(i)?this.values[i]:n[t]:this.has(i)?this.values[i]:n},s.has=function(i){return i in this.values},s.alt=function(i,n,t){for(var d=0;d<t.length;++d)if(n===t[d]){this.set(i,n);break}},s.integer=function(i,n){/^-?\d+$/.test(n)&&this.set(i,parseInt(n,10))},s.percent=function(i,n){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(n)){var t=parseFloat(n);if(t>=0&&t<=100)return this.set(i,t),!0}return!1},u}();function C(u,s,f,i){var n=i?u.split(i):[u];for(var t in n){if(typeof n[t]!="string")continue;var d=n[t].split(f);if(d.length!==2)continue;var v=d[0],g=d[1];s(v,g)}}var h=new w.default(0,0,""),p=h.align==="middle"?"middle":"center";function c(u,s,f){var i=u;function n(){var v=S(u);if(v===null)throw new Error("Malformed timestamp: "+i);return u=u.replace(/^[^\sa-zA-Z-]+/,""),v}function t(v,g){var b=new T;C(v,function(y,E){var o;switch(y){case"region":for(var x=f.length-1;x>=0;x--)if(f[x].id===E){b.set(y,f[x].region);break}break;case"vertical":b.alt(y,E,["rl","lr"]);break;case"line":o=E.split(","),b.integer(y,o[0]),b.percent(y,o[0])&&b.set("snapToLines",!1),b.alt(y,o[0],["auto"]),o.length===2&&b.alt("lineAlign",o[1],["start",p,"end"]);break;case"position":o=E.split(","),b.percent(y,o[0]),o.length===2&&b.alt("positionAlign",o[1],["start",p,"end","line-left","line-right","auto"]);break;case"size":b.percent(y,E);break;case"align":b.alt(y,E,["start",p,"end","left","right"]);break}},/:/,/\s/),g.region=b.get("region",null),g.vertical=b.get("vertical","");var _=b.get("line","auto");_==="auto"&&h.line===-1&&(_=-1),g.line=_,g.lineAlign=b.get("lineAlign","start"),g.snapToLines=b.get("snapToLines",!0),g.size=b.get("size",100),g.align=b.get("align",p);var m=b.get("position","auto");m==="auto"&&h.position===50&&(m=g.align==="start"||g.align==="left"?0:g.align==="end"||g.align==="right"?100:50),g.position=m}function d(){u=u.replace(/^\s+/,"")}if(d(),s.startTime=n(),d(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);u=u.substr(3),d(),s.endTime=n(),d(),t(u,s)}function l(u){return u.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}var a=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new k,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=u.prototype;return s.parse=function(i){var n=this;i&&(n.buffer+=n.decoder.decode(i,{stream:!0}));function t(){var m=n.buffer,y=0;for(m=l(m);y<m.length&&m[y]!=="\r"&&m[y]!==`
|
|
|
`;)++y;var E=m.substr(0,y);return m[y]==="\r"&&++y,m[y]===`
|
|
|
`&&++y,n.buffer=m.substr(y),E}function d(m){C(m,function(y,E){},/:/)}try{var v="";if(n.state==="INITIAL"){if(!/\r\n|\n/.test(n.buffer))return this;v=t();var g=v.match(/^()?WEBVTT([ \t].*)?$/);if(!g||!g[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var b=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;b?b=!1:v=t();switch(n.state){case"HEADER":/:/.test(v)?d(v):v||(n.state="ID");continue;case"NOTE":v||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(v)){n.state="NOTE";break}if(!v)continue;if(n.cue=new w.default(0,0,""),n.state="CUE",v.indexOf("-->")===-1){n.cue.id=v;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{c(v,n.cue,n.regionList)}catch(m){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var _=v.indexOf("-->")!==-1;if(!v||_&&(b=!0)){n.oncue&&n.cue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}if(n.cue===null)continue;n.cue.text&&(n.cue.text+=`
|
|
|
`),n.cue.text+=v}continue;case"BADCUE":v||(n.state="ID")}}}catch(m){n.state==="CUETEXT"&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state=n.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=`
|
|
|
|
|
|
`,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(n){i.onparsingerror&&i.onparsingerror(n)}return i.onflush&&i.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":function(de,ee,j){"use strict";j.r(ee),j.d(ee,"generateCueId",function(){return a}),j.d(ee,"parseWebVTT",function(){return s});var w=j("./src/polyfills/number.ts"),k=j("./src/utils/vttparser.ts"),S=j("./src/demux/id3.ts"),T=j("./src/utils/timescale-conversion.ts"),C=j("./src/remux/mp4-remuxer.ts"),h=/\r\n|\n\r|\n|\r/g,p=function(i,n,t){return t===void 0&&(t=0),i.substr(t,n.length)===n},c=function(i){var n=parseInt(i.substr(-3)),t=parseInt(i.substr(-6,2)),d=parseInt(i.substr(-9,2)),v=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(w.isFiniteNumber)(n)||!Object(w.isFiniteNumber)(t)||!Object(w.isFiniteNumber)(d)||!Object(w.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return n+=1e3*t,n+=60*1e3*d,n+=60*60*1e3*v,n},l=function(i){for(var n=5381,t=i.length;t;)n=n*33^i.charCodeAt(--t);return(n>>>0).toString()};function a(f,i,n){return l(f.toString())+l(i.toString())+l(n)}var u=function(i,n,t){var d=i[n],v=i[d.prevCC];if(!v||!v.new&&d.new){i.ccOffset=i.presentationOffset=d.start,d.new=!1;return}for(;(g=v)!==null&&g!==void 0&&g.new;){var g;i.ccOffset+=d.start-v.start,d.new=!1,d=v,v=i[d.prevCC]}i.presentationOffset=t};function s(f,i,n,t,d,v,g,b){var _=new k.VTTParser,m=Object(S.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(h,`
|
|
|
`).split(`
|
|
|
`),y=[],E=Object(T.toMpegTsClockFromTimescale)(i,n),o="00:00.000",x=0,A=0,O,D=!0,N=!1;_.oncue=function(W){var K=t[d],oe=t.ccOffset,B=(x-E)/9e4;if(K!=null&&K.new&&(A!==void 0?oe=t.ccOffset=K.start:u(t,d,B)),B&&(oe=B-t.presentationOffset),N){var X=W.endTime-W.startTime,V=Object(C.normalizePts)((W.startTime+oe-A)*9e4,v*9e4)/9e4;W.startTime=V,W.endTime=V+X}var ne=W.text.trim();W.text=decodeURIComponent(encodeURIComponent(ne)),W.id||(W.id=a(W.startTime,W.endTime,ne)),W.endTime>0&&y.push(W)},_.onparsingerror=function(W){O=W},_.onflush=function(){if(O){b(O);return}g(y)},m.forEach(function(W){if(D)if(p(W,"X-TIMESTAMP-MAP=")){D=!1,N=!0,W.substr(16).split(",").forEach(function(K){p(K,"LOCAL:")?o=K.substr(6):p(K,"MPEGTS:")&&(x=parseInt(K.substr(7)))});try{A=c(o)/1e3}catch(K){N=!1,O=K}return}else W===""&&(D=!1);_.parse(W+`
|
|
|
`)}),_.flush()}},"./src/utils/xhr-loader.ts":function(de,ee,j){"use strict";j.r(ee);var w=j("./src/utils/logger.ts"),k=j("./src/loader/load-stats.ts"),S=/^age:\s*[\d.]+\s*$/m,T=function(){function C(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 k.LoadStats,this.retryDelay=0}var h=C.prototype;return h.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},h.abortInternal=function(){var c=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),c&&(c.onreadystatechange=null,c.onprogress=null,c.readyState!==4&&(this.stats.aborted=!0,c.abort()))},h.abort=function(){var c;this.abortInternal(),(c=this.callbacks)!==null&&c!==void 0&&c.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},h.load=function(c,l,a){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=c,this.config=l,this.callbacks=a,this.retryDelay=l.retryDelay,this.loadInternal()},h.loadInternal=function(){var c=this.config,l=this.context;if(!c)return;var a=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var s=this.xhrSetup;try{if(s)try{s(a,l.url)}catch(n){a.open("GET",l.url,!0),s(a,l.url)}a.readyState||a.open("GET",l.url,!0);var f=this.context.headers;if(f)for(var i in f)a.setRequestHeader(i,f[i])}catch(n){this.callbacks.onError({code:a.status,text:n.message},l,a);return}l.rangeEnd&&a.setRequestHeader("Range","bytes="+l.rangeStart+"-"+(l.rangeEnd-1)),a.onreadystatechange=this.readystatechange.bind(this),a.onprogress=this.loadprogress.bind(this),a.responseType=l.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),c.timeout),a.send()},h.readystatechange=function(){var c=this.context,l=this.loader,a=this.stats;if(!c||!l)return;var u=l.readyState,s=this.config;if(a.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),a.loading.first===0&&(a.loading.first=Math.max(self.performance.now(),a.loading.start)),u===4){l.onreadystatechange=null,l.onprogress=null;var f=l.status;if(f>=200&&f<300){a.loading.end=Math.max(self.performance.now(),a.loading.first);var i,n;if(c.responseType==="arraybuffer"?(i=l.response,n=i.byteLength):(i=l.responseText,n=i.length),a.loaded=a.total=n,!this.callbacks)return;var t=this.callbacks.onProgress;if(t&&t(a,c,i,l),!this.callbacks)return;var d={url:l.responseURL,data:i};this.callbacks.onSuccess(d,a,c,l)}else a.retry>=s.maxRetry||f>=400&&f<499?(w.logger.error(f+" while loading "+c.url),this.callbacks.onError({code:f,text:l.statusText},c,l)):(w.logger.warn(f+" while loading "+c.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),a.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},h.loadtimeout=function(){w.logger.warn("timeout while loading "+this.context.url);var c=this.callbacks;c&&(this.abortInternal(),c.onTimeout(this.stats,this.context,this.loader))},h.loadprogress=function(c){var l=this.stats;l.loaded=c.loaded,c.lengthComputable&&(l.total=c.total)},h.getCacheAge=function(){var c=null;if(this.loader&&S.test(this.loader.getAllResponseHeaders())){var l=this.loader.getResponseHeader("age");c=l?parseFloat(l):null}return c},C}();ee.default=T}}).default})},vHTk:function(rt,$e,H){rt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(rt,$e,H){"use strict";H.d($e,"a",function(){return J});var de=H("rePB"),ee=H("VTBJ"),j=H("KQm4"),w=H("U8pU"),k=H("ODXe"),S=H("q1tI"),T=H("TSYQ"),C=H.n(T),h=H("Gytx"),p=H.n(h),c=H("Kwbf"),l=H("t23M"),a=H("qx4F"),u=H("6eGT"),s=H("IBYe"),f=H("Ff2n"),i=H("c+Xe"),n=H("fyJ8"),t=H("biw7");function d(Ue,je,tt,dt,qe){var Ye=tt[Ue]||{},Fe=tt[je]||{},Ie,Me;Ye.fixed==="left"?Ie=dt.left[Ue]:Fe.fixed==="right"&&(Me=dt.right[je]);var be=!1,Te=!1,Le=!1,Ce=!1,et=tt[je+1],Qe=tt[Ue-1];if(qe==="rtl"){if(Ie!==void 0){var yt=Qe&&Qe.fixed==="left";Ce=!yt}else if(Me!==void 0){var Dt=et&&et.fixed==="right";Le=!Dt}}else if(Ie!==void 0){var Bt=et&&et.fixed==="left";be=!Bt}else if(Me!==void 0){var Pt=Qe&&Qe.fixed==="right";Te=!Pt}return{fixLeft:Ie,fixRight:Me,lastFixLeft:be,firstFixRight:Te,lastFixRight:Le,firstFixLeft:Ce,isSticky:dt.isSticky}}var v=H("sR1s");function g(Ue){var je=Ue.cells,tt=Ue.stickyOffsets,dt=Ue.flattenColumns,qe=Ue.rowComponent,Ye=Ue.cellComponent,Fe=Ue.onHeaderRow,Ie=Ue.index,Me=S.useContext(t.a),be=Me.prefixCls,Te=Me.direction,Le;Fe&&(Le=Fe(je.map(function(et){return et.column}),Ie));var Ce=Object(v.a)(je.map(function(et){return et.column}));return S.createElement(qe,Object.assign({},Le),je.map(function(et,Qe){var yt=et.column,Dt=d(et.colStart,et.colEnd,dt,tt,Te),Bt;return yt&&yt.onHeaderCell&&(Bt=et.column.onHeaderCell(yt)),S.createElement(n.a,Object.assign({},et,{ellipsis:yt.ellipsis,align:yt.align,component:Ye,prefixCls:be,key:Ce[Qe]},Dt,{additionalProps:Bt,rowType:"header"}))}))}g.displayName="HeaderRow";var b=g;function _(Ue){var je=[];function tt(Fe,Ie){var Me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;je[Me]=je[Me]||[];var be=Ie,Te=Fe.filter(Boolean).map(function(Le){var Ce={key:Le.key,className:Le.className||"",children:Le.title,column:Le,colStart:be},et=1,Qe=Le.children;return Qe&&Qe.length>0&&(et=tt(Qe,be,Me+1).reduce(function(yt,Dt){return yt+Dt},0),Ce.hasSubColumns=!0),"colSpan"in Le&&(et=Le.colSpan),"rowSpan"in Le&&(Ce.rowSpan=Le.rowSpan),Ce.colSpan=et,Ce.colEnd=Ce.colStart+et-1,je[Me].push(Ce),be+=et,et});return Te}tt(Ue,0);for(var dt=je.length,qe=function(Ie){je[Ie].forEach(function(Me){!("rowSpan"in Me)&&!Me.hasSubColumns&&(Me.rowSpan=dt-Ie)})},Ye=0;Ye<dt;Ye+=1)qe(Ye);return je}function m(Ue){var je=Ue.stickyOffsets,tt=Ue.columns,dt=Ue.flattenColumns,qe=Ue.onHeaderRow,Ye=S.useContext(t.a),Fe=Ye.prefixCls,Ie=Ye.getComponent,Me=S.useMemo(function(){return _(tt)},[tt]),be=Ie(["header","wrapper"],"thead"),Te=Ie(["header","row"],"tr"),Le=Ie(["header","cell"],"th");return S.createElement(be,{className:"".concat(Fe,"-thead")},Me.map(function(Ce,et){var Qe=S.createElement(b,{key:et,flattenColumns:dt,cells:Ce,stickyOffsets:je,rowComponent:Te,cellComponent:Le,onHeaderRow:qe,index:et});return Qe}))}var y=m,E=H("hW8S");function o(Ue){for(var je=Ue.colWidths,tt=Ue.columns,dt=Ue.columCount,qe=[],Ye=dt||tt.length,Fe=!1,Ie=Ye-1;Ie>=0;Ie-=1){var Me=je[Ie],be=tt&&tt[Ie],Te=be&&be[E.a];(Me||Te||Fe)&&(qe.unshift(S.createElement("col",Object.assign({key:Ie,style:{width:Me,minWidth:Me}},Te))),Fe=!0)}return S.createElement("colgroup",null,qe)}var x=o;function A(Ue,je){return Object(S.useMemo)(function(){for(var tt=[],dt=0;dt<je;dt+=1){var qe=Ue[dt];if(qe!==void 0)tt[dt]=qe;else return null}return tt},[Ue.join("_"),je])}var O=S.forwardRef(function(Ue,je){var tt=Ue.noData,dt=Ue.columns,qe=Ue.flattenColumns,Ye=Ue.colWidths,Fe=Ue.columCount,Ie=Ue.stickyOffsets,Me=Ue.direction,be=Ue.fixHeader,Te=Ue.offsetHeader,Le=Ue.stickyClassName,Ce=Ue.onScroll,et=Object(f.a)(Ue,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Qe=S.useContext(t.a),yt=Qe.prefixCls,Dt=Qe.scrollbarSize,Bt=Qe.isSticky,Pt=Bt&&!be?0:Dt,Rt=S.useRef(null),st=S.useCallback(function(Mt){Object(i.b)(je,Mt),Object(i.b)(Rt,Mt)},[]);S.useEffect(function(){var Mt;function Nt(it){var St=it.currentTarget,Wt=it.deltaX;Wt&&(Ce({currentTarget:St,scrollLeft:St.scrollLeft+Wt}),it.preventDefault())}return(Mt=Rt.current)===null||Mt===void 0||Mt.addEventListener("wheel",Nt),function(){var it;(it=Rt.current)===null||it===void 0||it.removeEventListener("wheel",Nt)}},[]);var mt=qe[qe.length-1],lt={fixed:mt?mt.fixed:null,onHeaderCell:function(){return{className:"".concat(yt,"-cell-scrollbar")}}},De=Object(S.useMemo)(function(){return Pt?[].concat(Object(j.a)(dt),[lt]):dt},[Pt,dt]),Ke=Object(S.useMemo)(function(){return Pt?[].concat(Object(j.a)(qe),[lt]):qe},[Pt,qe]),vt=Object(S.useMemo)(function(){var Mt=Ie.right,Nt=Ie.left;return Object(ee.a)(Object(ee.a)({},Ie),{},{left:Me==="rtl"?[].concat(Object(j.a)(Nt.map(function(it){return it+Pt})),[0]):Nt,right:Me==="rtl"?Mt:[].concat(Object(j.a)(Mt.map(function(it){return it+Pt})),[0]),isSticky:Bt})},[Pt,Ie,Bt]),ot=A(Ye,Fe);return S.createElement("div",{style:Object(ee.a)({overflow:"hidden"},Bt?{top:Te}:{}),ref:st,className:C()("".concat(yt,"-header"),Object(de.a)({},Le,!!Le))},S.createElement("table",{style:{tableLayout:"fixed",visibility:tt||ot?null:"hidden"}},S.createElement(x,{colWidths:ot?[].concat(Object(j.a)(ot),[Pt]):[],columCount:Fe+1,columns:Ke}),S.createElement(y,Object.assign({},et,{stickyOffsets:vt,columns:De,flattenColumns:Ke}))))});O.displayName="FixedHeader";var D=O,N=S.createContext(null),W=N;function K(Ue){var je=Ue.prefixCls,tt=Ue.children,dt=Ue.component,qe=Ue.cellComponent,Ye=Ue.fixHeader,Fe=Ue.fixColumn,Ie=Ue.horizonScroll,Me=Ue.className,be=Ue.expanded,Te=Ue.componentWidth,Le=Ue.colSpan,Ce=S.useContext(t.a),et=Ce.scrollbarSize;return S.useMemo(function(){var Qe=tt;return Fe&&(Qe=S.createElement("div",{style:{width:Te-(Ye?et:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(je,"-expanded-row-fixed")},Qe)),S.createElement(dt,{className:Me,style:{display:be?null:"none"}},S.createElement(n.a,{component:qe,prefixCls:je,colSpan:Le},Qe))},[tt,dt,Ye,Ie,Me,be,Te,Le,et])}var oe=K;function B(Ue){var je=Ue.className,tt=Ue.style,dt=Ue.record,qe=Ue.index,Ye=Ue.rowKey,Fe=Ue.getRowKey,Ie=Ue.rowExpandable,Me=Ue.expandedKeys,be=Ue.onRow,Te=Ue.indent,Le=Te===void 0?0:Te,Ce=Ue.rowComponent,et=Ue.cellComponent,Qe=Ue.childrenColumnName,yt=S.useContext(t.a),Dt=yt.prefixCls,Bt=yt.fixedInfoList,Pt=S.useContext(W),Rt=Pt.fixHeader,st=Pt.fixColumn,mt=Pt.horizonScroll,lt=Pt.componentWidth,De=Pt.flattenColumns,Ke=Pt.expandableType,vt=Pt.expandRowByClick,ot=Pt.onTriggerExpand,Mt=Pt.rowClassName,Nt=Pt.expandedRowClassName,it=Pt.indentSize,St=Pt.expandIcon,Wt=Pt.expandedRowRender,Kt=Pt.expandIconColumnIndex,tn=S.useState(!1),Re=Object(k.a)(tn,2),ve=Re[0],z=Re[1],Q=Me&&Me.has(Ue.recordKey);S.useEffect(function(){Q&&z(!0)},[Q]);var ae=Ke==="row"&&(!Ie||Ie(dt)),fe=Ke==="nest",Ae=Qe&&dt&&dt[Qe],Je=ae||fe,at;be&&(at=be(dt,qe));var Lt=function(I){if(vt&&Je&&ot(dt,I),at&&at.onClick){for(var F,ie=arguments.length,ce=new Array(ie>1?ie-1:0),se=1;se<ie;se++)ce[se-1]=arguments[se];(F=at).onClick.apply(F,[I].concat(ce))}},It;typeof Mt=="string"?It=Mt:typeof Mt=="function"&&(It=Mt(dt,qe,Le));var ct=Object(v.a)(De),kt=S.createElement(Ce,Object.assign({},at,{"data-row-key":Ye,className:C()(je,"".concat(Dt,"-row"),"".concat(Dt,"-row-level-").concat(Le),It,at&&at.className),style:Object(ee.a)(Object(ee.a)({},tt),at?at.style:null),onClick:Lt}),De.map(function(re,I){var F=re.render,ie=re.dataIndex,ce=re.className,se=ct[I],Xe=Bt[I],_t;I===(Kt||0)&&fe&&(_t=S.createElement(S.Fragment,null,S.createElement("span",{style:{paddingLeft:"".concat(it*Le,"px")},className:"".concat(Dt,"-row-indent indent-level-").concat(Le)}),St({prefixCls:Dt,expanded:Q,expandable:Ae,record:dt,onExpand:ot})));var At;return re.onCell&&(At=re.onCell(dt,qe)),S.createElement(n.a,Object.assign({className:ce,ellipsis:re.ellipsis,align:re.align,component:et,prefixCls:Dt,key:se,record:dt,index:qe,dataIndex:ie,render:F,shouldCellUpdate:re.shouldCellUpdate},Xe,{appendNode:_t,additionalProps:At}))})),nn;if(ae&&(ve||Q)){var Ot=Wt(dt,qe,Le+1,Q),un=Nt&&Nt(dt,qe,Le);nn=S.createElement(oe,{expanded:Q,className:C()("".concat(Dt,"-expanded-row"),"".concat(Dt,"-expanded-row-level-").concat(Le+1),un),prefixCls:Dt,fixHeader:Rt,fixColumn:st,horizonScroll:mt,component:Ce,componentWidth:lt,cellComponent:et,colSpan:De.length},Ot)}var an;return Ae&&Q&&(an=(dt[Qe]||[]).map(function(re,I){var F=Fe(re,I);return S.createElement(B,Object.assign({},Ue,{key:F,rowKey:F,record:re,recordKey:F,index:I,indent:Le+1}))})),S.createElement(S.Fragment,null,kt,nn,an)}B.displayName="BodyRow";var X=B,V=S.createContext(null),ne=V;function $(Ue){var je=Ue.columnKey,tt=Ue.onColumnResize,dt=S.useRef();return S.useEffect(function(){dt.current&&tt(je,dt.current.offsetWidth)},[]),S.createElement(l.a,{onResize:function(Ye){var Fe=Ye.offsetWidth;tt(je,Fe)}},S.createElement("td",{ref:dt,style:{padding:0,border:0,height:0}},S.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function Z(Ue){var je=Ue.data,tt=Ue.getRowKey,dt=Ue.measureColumnWidth,qe=Ue.expandedKeys,Ye=Ue.onRow,Fe=Ue.rowExpandable,Ie=Ue.emptyNode,Me=Ue.childrenColumnName,be=S.useContext(ne),Te=be.onColumnResize,Le=S.useContext(t.a),Ce=Le.prefixCls,et=Le.getComponent,Qe=S.useContext(W),yt=Qe.fixHeader,Dt=Qe.horizonScroll,Bt=Qe.flattenColumns,Pt=Qe.componentWidth;return S.useMemo(function(){var Rt=et(["body","wrapper"],"tbody"),st=et(["body","row"],"tr"),mt=et(["body","cell"],"td"),lt;je.length?lt=je.map(function(Ke,vt){var ot=tt(Ke,vt);return S.createElement(X,{key:ot,rowKey:ot,record:Ke,recordKey:ot,index:vt,rowComponent:st,cellComponent:mt,expandedKeys:qe,onRow:Ye,getRowKey:tt,rowExpandable:Fe,childrenColumnName:Me})}):lt=S.createElement(oe,{expanded:!0,className:"".concat(Ce,"-placeholder"),prefixCls:Ce,fixHeader:yt,fixColumn:Dt,horizonScroll:Dt,component:st,componentWidth:Pt,cellComponent:mt,colSpan:Bt.length},Ie);var De=Object(v.a)(Bt);return S.createElement(Rt,{className:"".concat(Ce,"-tbody")},dt&&S.createElement("tr",{"aria-hidden":"true",className:"".concat(Ce,"-measure-row"),style:{height:0}},De.map(function(Ke){return S.createElement($,{key:Ke,columnKey:Ke,onColumnResize:Te})})),lt)},[je,Ce,Ye,dt,qe,tt,et,Pt,Ie,Bt])}var ue=S.memo(Z);ue.displayName="Body";var he=ue,Oe=H("wRmb"),we=H("xEkU"),Pe=H.n(we);function _e(Ue){var je=Object(S.useRef)(Ue),tt=Object(S.useState)({}),dt=Object(k.a)(tt,2),qe=dt[1],Ye=Object(S.useRef)(null),Fe=Object(S.useRef)([]);function Ie(Me){Ye.current===null&&(Fe.current=[],Ye.current=Pe()(function(){Fe.current.forEach(function(be){je.current=be(je.current)}),Ye.current=null,qe({})})),Fe.current.push(Me)}return Object(S.useEffect)(function(){return function(){Pe.a.cancel(Ye.current)}},[]),[je.current,Ie]}function xe(Ue){var je=Object(S.useRef)(Ue),tt=Object(S.useRef)(null);function dt(){window.clearTimeout(tt.current)}function qe(Fe){je.current=Fe,dt(),tt.current=window.setTimeout(function(){je.current=null,tt.current=null},100)}function Ye(){return je.current}return Object(S.useEffect)(function(){return dt},[]),[qe,Ye]}function Ve(Ue,je,tt){var dt=Object(S.useMemo)(function(){for(var qe=[],Ye=[],Fe=0,Ie=0,Me=0;Me<je;Me+=1)if(tt==="rtl"){Ye[Me]=Ie,Ie+=Ue[Me]||0;var be=je-Me-1;qe[be]=Fe,Fe+=Ue[be]||0}else{qe[Me]=Fe,Fe+=Ue[Me]||0;var Te=je-Me-1;Ye[Te]=Ie,Ie+=Ue[Te]||0}return{left:qe,right:Ye}},[Ue,je,tt]);return dt}var Ne=Ve;function Be(Ue){var je=Ue.className,tt=Ue.children;return S.createElement("div",{className:je},tt)}var ze=Be,ye=H("n6Qo");function me(Ue){var je,tt=Ue.prefixCls,dt=Ue.record,qe=Ue.onExpand,Ye=Ue.expanded,Fe=Ue.expandable,Ie="".concat(tt,"-row-expand-icon");if(!Fe)return S.createElement("span",{className:C()(Ie,"".concat(tt,"-row-spaced"))});var Me=function(Te){qe(dt,Te),Te.stopPropagation()};return S.createElement("span",{className:C()(Ie,(je={},Object(de.a)(je,"".concat(tt,"-row-expanded"),Ye),Object(de.a)(je,"".concat(tt,"-row-collapsed"),!Ye),je)),onClick:Me})}function We(Ue,je,tt){var dt=[];function qe(Ye){(Ye||[]).forEach(function(Fe,Ie){dt.push(je(Fe,Ie)),qe(Fe[tt])})}return qe(Ue),dt}var He=H("zT1h"),nt=H("y0+3"),te=function(je,tt){var dt,qe,Ye=je.scrollBodyRef,Fe=je.onScroll,Ie=je.offsetScroll,Me=S.useContext(t.a),be=Me.prefixCls,Te=((dt=Ye.current)===null||dt===void 0?void 0:dt.scrollWidth)||0,Le=((qe=Ye.current)===null||qe===void 0?void 0:qe.clientWidth)||0,Ce=Te&&Le*(Le/Te),et=S.useRef(),Qe=_e({scrollLeft:0,isHiddenScrollBar:!1}),yt=Object(k.a)(Qe,2),Dt=yt[0],Bt=yt[1],Pt=S.useRef({delta:0,x:0}),Rt=S.useState(!1),st=Object(k.a)(Rt,2),mt=st[0],lt=st[1],De=function(){lt(!1)},Ke=function(it){it.persist(),Pt.current.delta=it.pageX-Dt.scrollLeft,Pt.current.x=0,lt(!0),it.preventDefault()},vt=function(it){var St,Wt=it||((St=window)===null||St===void 0?void 0:St.event),Kt=Wt.buttons;if(!mt||Kt===0){mt&<(!1);return}var tn=Pt.current.x+it.pageX-Pt.current.x-Pt.current.delta;tn<=0&&(tn=0),tn+Ce>=Le&&(tn=Le-Ce),Fe({scrollLeft:tn/Le*(Te+2)}),Pt.current.x=it.pageX},ot=function(){var it=Object(nt.b)(Ye.current).top,St=it+Ye.current.offsetHeight,Wt=document.documentElement.scrollTop+window.innerHeight;St-Object(a.a)()<=Wt||it>=Wt-Ie?Bt(function(Kt){return Object(ee.a)(Object(ee.a)({},Kt),{},{isHiddenScrollBar:!0})}):Bt(function(Kt){return Object(ee.a)(Object(ee.a)({},Kt),{},{isHiddenScrollBar:!1})})},Mt=function(it){Bt(function(St){return Object(ee.a)(Object(ee.a)({},St),{},{scrollLeft:it/Te*Le||0})})};return S.useImperativeHandle(tt,function(){return{setScrollLeft:Mt}}),S.useEffect(function(){var Nt=Object(He.a)(document.body,"mouseup",De,!1),it=Object(He.a)(document.body,"mousemove",vt,!1);return ot(),function(){Nt.remove(),it.remove()}},[Ce,mt]),S.useEffect(function(){var Nt=Object(He.a)(window,"scroll",ot,!1),it=Object(He.a)(window,"resize",ot,!1);return function(){Nt.remove(),it.remove()}},[]),S.useEffect(function(){Dt.isHiddenScrollBar||Bt(function(Nt){var it,St;return Object(ee.a)(Object(ee.a)({},Nt),{},{scrollLeft:Ye.current.scrollLeft/((it=Ye.current)===null||it===void 0?void 0:it.scrollWidth)*((St=Ye.current)===null||St===void 0?void 0:St.clientWidth)})})},[Dt.isHiddenScrollBar]),Te<=Le||!Ce||Dt.isHiddenScrollBar?null:S.createElement("div",{style:{height:Object(a.a)(),width:Le,bottom:Ie},className:"".concat(be,"-sticky-scroll")},S.createElement("div",{onMouseDown:Ke,ref:et,className:C()("".concat(be,"-sticky-scroll-bar"),Object(de.a)({},"".concat(be,"-sticky-scroll-bar-active"),mt)),style:{width:"".concat(Ce,"px"),transform:"translate3d(".concat(Dt.scrollLeft,"px, 0, 0)")}}))},P=S.forwardRef(te);function U(Ue,je){return S.useMemo(function(){var tt=!!Ue;return{isSticky:tt,stickyClassName:tt?"".concat(je,"-sticky-header"):"",offsetHeader:Object(w.a)(Ue)==="object"&&Ue.offsetHeader||0,offsetScroll:Object(w.a)(Ue)==="object"&&Ue.offsetScroll||0}},[Ue,je])}var q=[],Y={},J="rc-table-internal-hook",Ee=S.memo(function(Ue){var je=Ue.children;return je},function(Ue,je){return p()(Ue.props,je.props)?Ue.pingLeft!==je.pingLeft||Ue.pingRight!==je.pingRight:!1});function ke(Ue){var je,tt=Ue.prefixCls,dt=Ue.className,qe=Ue.rowClassName,Ye=Ue.style,Fe=Ue.data,Ie=Ue.rowKey,Me=Ue.scroll,be=Ue.tableLayout,Te=Ue.direction,Le=Ue.title,Ce=Ue.footer,et=Ue.summary,Qe=Ue.id,yt=Ue.showHeader,Dt=Ue.components,Bt=Ue.emptyText,Pt=Ue.onRow,Rt=Ue.onHeaderRow,st=Ue.internalHooks,mt=Ue.transformColumns,lt=Ue.internalRefs,De=Ue.sticky,Ke=Fe||q,vt=!!Ke.length,ot=S.useState(0),Mt=Object(k.a)(ot,2),Nt=Mt[0],it=Mt[1];S.useEffect(function(){it(Object(a.a)())});var St=S.useMemo(function(){return Object(v.c)(Dt,{})},[Dt]),Wt=S.useCallback(function(gt,Tt){return Object(v.b)(St,gt)||Tt},[St]),Kt=S.useMemo(function(){return typeof Ie=="function"?Ie:function(gt){var Tt=gt&>[Ie];return Tt}},[Ie]),tn=Object(E.c)(Ue),Re=tn.expandIcon,ve=tn.expandedRowKeys,z=tn.defaultExpandedRowKeys,Q=tn.defaultExpandAllRows,ae=tn.expandedRowRender,fe=tn.onExpand,Ae=tn.onExpandedRowsChange,Je=tn.expandRowByClick,at=tn.rowExpandable,Lt=tn.expandIconColumnIndex,It=tn.expandedRowClassName,ct=tn.childrenColumnName,kt=tn.indentSize,nn=Re||me,Ot=ct||"children",un=S.useMemo(function(){return ae?"row":Ue.expandable&&st===J&&Ue.expandable.__PARENT_RENDER_ICON__||Ke.some(function(gt){return gt&&Object(w.a)(gt)==="object"&>[Ot]})?"nest":!1},[!!ae,Ke]),an=S.useState(function(){return z||(Q?We(Ke,Kt,Ot):[])}),re=Object(k.a)(an,2),I=re[0],F=re[1],ie=S.useMemo(function(){return new Set(ve||I||[])},[ve,I]),ce=S.useCallback(function(gt){var Tt=Kt(gt,Ke.indexOf(gt)),Ft,mn=ie.has(Tt);mn?(ie.delete(Tt),Ft=Object(j.a)(ie)):Ft=[].concat(Object(j.a)(ie),[Tt]),F(Ft),fe&&fe(!mn,gt),Ae&&Ae(Ft)},[Kt,ie,Ke,fe,Ae]),se=S.useState(0),Xe=Object(k.a)(se,2),_t=Xe[0],At=Xe[1],Vt=Object(Oe.b)(Object(ee.a)(Object(ee.a)(Object(ee.a)({},Ue),tn),{},{expandable:!!ae,expandedKeys:ie,getRowKey:Kt,onTriggerExpand:ce,expandIcon:nn,expandIconColumnIndex:Lt,direction:Te}),st===J?mt:null),wt=Object(k.a)(Vt,2),Ht=wt[0],en=wt[1],jn=S.useMemo(function(){return{columns:Ht,flattenColumns:en}},[Ht,en]),Dr=S.useRef(),wr=S.useRef(),Nn=S.useRef(),hr=S.useState(!1),mi=Object(k.a)(hr,2),Ar=mi[0],yr=mi[1],pr=S.useState(!1),Yr=Object(k.a)(pr,2),Mr=Yr[0],Zr=Yr[1],Cr=_e(new Map),gi=Object(k.a)(Cr,2),li=gi[0],zr=gi[1],Kr=Object(v.a)(en),xi=Kr.map(function(gt){return li.get(gt)}),vi=S.useMemo(function(){return xi},[xi.join("_")]),Si=Ne(vi,en.length,Te),Fn=Me&&Object(v.d)(Me.y),Sn=Me&&Object(v.d)(Me.x),Er=Sn&&en.some(function(gt){var Tt=gt.fixed;return Tt}),Kn=S.useRef(),Lr=U(De,tt),rr=Lr.isSticky,Ri=Lr.offsetHeader,kr=Lr.offsetScroll,ni=Lr.stickyClassName,ji,ui,Di;Fn&&(ui={overflowY:"scroll",maxHeight:Me.y}),Sn&&(ji={overflowX:"auto"},Fn||(ui={overflowY:"hidden"}),Di={width:Me.x===!0?"auto":Me.x,minWidth:"100%"});var ta=S.useCallback(function(gt,Tt){zr(function(Ft){var mn=new Map(Ft);return mn.set(gt,Tt),mn})},[]),ci=xe(null),Fi=Object(k.a)(ci,2),wi=Fi[0],Ki=Fi[1];function Qi(gt,Tt){if(!Tt)return;typeof Tt=="function"?Tt(gt):Tt.scrollLeft!==gt&&(Tt.scrollLeft=gt)}var yi=function(Tt){var Ft=Tt.currentTarget,mn=Tt.scrollLeft,fn=typeof mn=="number"?mn:Ft.scrollLeft,Et=Ft||Y;if(!Ki()||Ki()===Et){var bt;wi(Et),Qi(fn,wr.current),Qi(fn,Nn.current),Qi(fn,(bt=Kn.current)===null||bt===void 0?void 0:bt.setScrollLeft)}if(Ft){var $t=Ft.scrollWidth,xt=Ft.clientWidth;yr(fn>0),Zr(fn<$t-xt)}},aa=function(){Nn.current&&yi({currentTarget:Nn.current})},ma=function(Tt){var Ft=Tt.width;aa(),At(Dr.current?Dr.current.offsetWidth:Ft)};S.useEffect(function(){return aa},[]),S.useEffect(function(){Sn&&aa()},[Sn]),S.useEffect(function(){st===J&<&&(lt.body.current=Nn.current)});var ln=Wt(["table"],"table"),wn=S.useMemo(function(){return be||(Er?Me.x==="max-content"?"auto":"fixed":Fn||en.some(function(gt){var Tt=gt.ellipsis;return Tt})?"fixed":"auto")},[Fn,Er,en,be]),pn,Un={colWidths:vi,columCount:en.length,stickyOffsets:Si,onHeaderRow:Rt,fixHeader:Fn},ur=S.useMemo(function(){return vt?null:typeof Bt=="function"?Bt():Bt},[vt,Bt]),mr=S.createElement(he,{data:Ke,measureColumnWidth:Fn||Sn||rr,expandedKeys:ie,rowExpandable:at,getRowKey:Kt,onRow:Pt,emptyNode:ur,childrenColumnName:Ot}),Zn=S.createElement(x,{colWidths:en.map(function(gt){var Tt=gt.width;return Tt}),columns:en}),hn=et&&S.createElement(ye.b,null,et(Ke)),Fr=Wt(["body"]);if(Fn||rr){var Bn;typeof Fr=="function"?(Bn=Fr(Ke,{scrollbarSize:Nt,ref:Nn,onScroll:yi}),Un.colWidths=en.map(function(gt,Tt){var Ft=gt.width,mn=Tt===Ht.length-1?Ft-Nt:Ft;return typeof mn=="number"&&!Number.isNaN(mn)?mn:(Object(c.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Bn=S.createElement("div",{style:Object(ee.a)(Object(ee.a)({},ji),ui),onScroll:yi,ref:Nn,className:C()("".concat(tt,"-body"))},S.createElement(ln,{style:Object(ee.a)(Object(ee.a)({},Di),{},{tableLayout:wn})},Zn,mr,hn),rr&&S.createElement(P,{ref:Kn,offsetScroll:kr,scrollBodyRef:Nn,onScroll:yi})),pn=S.createElement(S.Fragment,null,yt!==!1&&S.createElement(D,Object.assign({noData:!Ke.length},Un,jn,{direction:Te,offsetHeader:Ri,stickyClassName:ni,ref:wr,onScroll:yi})),Bn)}else pn=S.createElement("div",{style:Object(ee.a)(Object(ee.a)({},ji),ui),className:C()("".concat(tt,"-content")),onScroll:yi,ref:Nn},S.createElement(ln,{style:Object(ee.a)(Object(ee.a)({},Di),{},{tableLayout:wn})},Zn,yt!==!1&&S.createElement(y,Object.assign({},Un,jn)),mr,hn));var Bi=Object(E.b)(Ue),cr=S.createElement("div",Object.assign({className:C()(tt,dt,(je={},Object(de.a)(je,"".concat(tt,"-rtl"),Te==="rtl"),Object(de.a)(je,"".concat(tt,"-ping-left"),Ar),Object(de.a)(je,"".concat(tt,"-ping-right"),Mr),Object(de.a)(je,"".concat(tt,"-layout-fixed"),be==="fixed"),Object(de.a)(je,"".concat(tt,"-fixed-header"),Fn),Object(de.a)(je,"".concat(tt,"-fixed-column"),Er),Object(de.a)(je,"".concat(tt,"-scroll-horizontal"),Sn),Object(de.a)(je,"".concat(tt,"-has-fix-left"),en[0]&&en[0].fixed),Object(de.a)(je,"".concat(tt,"-has-fix-right"),en[en.length-1]&&en[en.length-1].fixed==="right"),je)),style:Ye,id:Qe,ref:Dr},Bi),S.createElement(Ee,{pingLeft:Ar,pingRight:Mr,props:Object(ee.a)(Object(ee.a)({},Ue),{},{stickyOffsets:Si,mergedExpandedKeys:ie})},Le&&S.createElement(ze,{className:"".concat(tt,"-title")},Le(Ke)),S.createElement("div",{className:"".concat(tt,"-container")},pn),Ce&&S.createElement(ze,{className:"".concat(tt,"-footer")},Ce(Ke))));Sn&&(cr=S.createElement(l.a,{onResize:ma},cr));var Br=S.useMemo(function(){return{prefixCls:tt,getComponent:Wt,scrollbarSize:Nt,direction:Te,fixedInfoList:en.map(function(gt,Tt){return d(Tt,Tt,en,Si,Te)}),isSticky:rr}},[tt,Wt,Nt,Te,en,Si,Te,rr]),bi=S.useMemo(function(){return Object(ee.a)(Object(ee.a)({},jn),{},{tableLayout:wn,rowClassName:qe,expandedRowClassName:It,componentWidth:_t,fixHeader:Fn,fixColumn:Er,horizonScroll:Sn,expandIcon:nn,expandableType:un,expandRowByClick:Je,expandedRowRender:ae,onTriggerExpand:ce,expandIconColumnIndex:Lt,indentSize:kt})},[jn,wn,qe,It,_t,Fn,Er,Sn,nn,un,Je,ae,ce,Lt,kt]),ft=S.useMemo(function(){return{onColumnResize:ta}},[ta]);return S.createElement(t.a.Provider,{value:Br},S.createElement(W.Provider,{value:bi},S.createElement(ne.Provider,{value:ft},cr)))}ke.Column=s.a,ke.ColumnGroup=u.a,ke.Summary=ye.a,ke.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var ht=$e.b=ke},wRmb:function(rt,$e,H){"use strict";H.d($e,"a",function(){return p});var de=H("rePB"),ee=H("KQm4"),j=H("VTBJ"),w=H("Ff2n"),k=H("q1tI"),S=H.n(k),T=H("Kwbf"),C=H("Zm9Q"),h=H("hW8S");function p(s){return Object(C.a)(s).filter(function(f){return k.isValidElement(f)}).map(function(f){var i=f.key,n=f.props,t=n.children,d=Object(w.a)(n,["children"]),v=Object(j.a)({key:i},d);return t&&(v.children=p(t)),v})}function c(s){return s.reduce(function(f,i){var n=i.fixed,t=n===!0?"left":n,d=i.children;return d&&d.length>0?[].concat(Object(ee.a)(f),Object(ee.a)(c(d).map(function(v){return Object(j.a)({fixed:t},v)}))):[].concat(Object(ee.a)(f),[Object(j.a)(Object(j.a)({},i),{},{fixed:t})])},[])}function l(s){for(var f=!0,i=0;i<s.length;i+=1){var n=s[i];if(f&&n.fixed!=="left")f=!1;else if(!f&&n.fixed==="left"){Object(T.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var t=!0,d=s.length-1;d>=0;d-=1){var v=s[d];if(t&&v.fixed!=="right")t=!1;else if(!t&&v.fixed==="right"){Object(T.a)(!1,"Index ".concat(d+1," of `columns` missing `fixed='right'` prop."));break}}}function a(s){return s.map(function(f){var i=f.fixed,n=Object(w.a)(f,["fixed"]),t=i;return i==="left"?t="right":i==="right"&&(t="left"),Object(j.a)({fixed:t},n)})}function u(s,f){var i=s.prefixCls,n=s.columns,t=s.children,d=s.expandable,v=s.expandedKeys,g=s.getRowKey,b=s.onTriggerExpand,_=s.expandIcon,m=s.rowExpandable,y=s.expandIconColumnIndex,E=s.direction,o=s.expandRowByClick,x=k.useMemo(function(){return n||p(t)},[n,t]),A=k.useMemo(function(){if(d){var N,W=y||0,K=x[W],oe=(N={},Object(de.a)(N,h.a,{className:"".concat(i,"-expand-icon-col")}),Object(de.a)(N,"title",""),Object(de.a)(N,"fixed",K?K.fixed:null),Object(de.a)(N,"className","".concat(i,"-row-expand-icon-cell")),Object(de.a)(N,"render",function(V,ne,$){var Z=g(ne,$),ue=v.has(Z),he=m?m(ne):!0,Oe=_({prefixCls:i,expanded:ue,expandable:he,record:ne,onExpand:b});return o?k.createElement("span",{onClick:function(Pe){return Pe.stopPropagation()}},Oe):Oe}),N),B=x.slice();return W>=0&&B.splice(W,0,oe),B}return x},[d,x,g,v,_,E]),O=k.useMemo(function(){var N=A;return f&&(N=f(N)),N.length||(N=[{render:function(){return null}}]),N},[f,A,E]),D=k.useMemo(function(){return E==="rtl"?a(c(O)):c(O)},[O,E]);return[O,D]}$e.b=u},wW8i:function(rt,$e,H){rt.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(rt,$e,H){"use strict";H.d($e,"a",function(){return c}),H.d($e,"b",function(){return a});var de=/margin|padding|width|height|max|min|offset/,ee={left:!0,top:!0},j={cssFloat:1,styleFloat:1,float:1};function w(u){return u.nodeType===1?u.ownerDocument.defaultView.getComputedStyle(u,null):{}}function k(u,s,f){if(s=s.toLowerCase(),f==="auto"){if(s==="height")return u.offsetHeight;if(s==="width")return u.offsetWidth}return s in ee||(ee[s]=de.test(s)),ee[s]?parseFloat(f)||0:f}function S(u,s){var f=arguments.length,i=w(u);return s=j[s]?"cssFloat"in u.style?"cssFloat":"styleFloat":s,f===1?i:k(u,s,i[s]||u.style[s])}function T(u,s,f){var i=arguments.length;if(s=j[s]?"cssFloat"in u.style?"cssFloat":"styleFloat":s,i===3)return typeof f=="number"&&de.test(s)&&(f="".concat(f,"px")),u.style[s]=f,f;for(var n in s)s.hasOwnProperty(n)&&T(u,n,s[n]);return w(u)}function C(u){return u===document.body?document.documentElement.clientWidth:u.offsetWidth}function h(u){return u===document.body?window.innerHeight||document.documentElement.clientHeight:u.offsetHeight}function p(){var u=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:u,height:s}}function c(){var u=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:u,height:s}}function l(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function a(u){var s=u.getBoundingClientRect(),f=document.documentElement;return{left:s.left+(window.pageXOffset||f.scrollLeft)-(f.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||f.scrollTop)-(f.clientTop||document.body.clientTop||0)}}},ynwM:function(rt,$e,H){var de=H("MFOe"),ee=de.Global;rt.exports={name:"oldFF-globalStorage",read:w,write:k,each:S,remove:T,clearAll:C};var j=ee.globalStorage;function w(h){return j[h]}function k(h,p){j[h]=p}function S(h){for(var p=j.length-1;p>=0;p--){var c=j.key(p);h(j[c],c)}}function T(h){return j.removeItem(h)}function C(){S(function(h,p){delete j[h]})}}}]);
|